DEENESPTFRRUARHIKOZHNL

मॉड्यूल ara::per — Persistency

Spezifikation: AUTOSAR_AP_SWS_Persistency.pdf (R25-11) · 140 API-Records

मॉड्यूल गाइडएआई जनित

संरचित कुंजी-मान युग्मों और फ़ाइलों को लगातार, लेन-देन सुरक्षित और हार्डवेयर-अमूर्त तरीके से सुरक्षित करता है।
एआई-जनित असत्यापित मॉडल: gemini-3.8-flash-medium · प्रयास: medium · तापमान: नियंत्रित नहीं किया जा सकता · प्रॉम्प्ट: 5a09fccb0066 उद्गम खुले प्रश्न (1)
कारणात्मक एंकर: R25-11 R25-11 से मान्य इस विनिर्देश संस्करण के लिए नए सिरे से संश्लेषित।
जर्मन मार्गदर्शिका से अनूदितgemini-3.8-flash-low · 2026-10-13 · जर्मन मूल

संरचित कुंजी-मान युग्मों और फ़ाइलों को लगातार, लेन-देन सुरक्षित और हार्डवेयर-अमूर्त तरीके से सुरक्षित करता है।

Adaptive मॉड्यूल Persistency (ara::per) गैर-वाष्पशील डेटा स्टोरेज के लिए एक हार्डवेयर-स्वतंत्र अमूर्त परत प्रदान करता है, जिसमें संरचित कुंजी-मान स्टोरेज (KeyValueStorage) और फ़ाइल-आधारित एक्सेस (FileStorage) दोनों शामिल हैं (EXP_SWArchitecture पृ. 43)। कुंजी-मान युग्मों में किए गए संशोधन इन-मेमोरी बफ़रिंग के अधीन होते हैं और स्थायी रूप से सुरक्षित होने के लिए एक स्पष्ट सिंक्रोनाइज़ेशन कॉल (SyncToStorage) की आवश्यकता होती है ([SWS_PER_00049])। डेटा अखंडता और पुनर्प्राप्ति तंत्र के अलावा, यह मॉड्यूल सॉफ़्टवेयर अपडेट के दौरान अपडेट और माइग्रेशन प्रक्रियाओं को भी नियंत्रित करता है ([SWS_PER_00357])।

कार्यात्मक क्लस्टर Persistency (ara::per) AUTOSAR Adaptive Platform के लिए गैर-वाष्पशील डेटा स्टोरेज हेतु एक मानकीकृत अमूर्त परत प्रदान करता है (EXP_SWArchitecture पृ. 43)। यह दो मूलभूत एक्सेस मॉडल प्रदान करता है: संरचित मापदंडों के लिए कुंजी-आधारित स्टोरेज KeyValueStorage और असंरचित पेलोड स्ट्रीम के लिए फ़ाइल-आधारित स्टोरेज FileStorage (SWS_Persistency पृ. 219)। Adaptive Applications और केंद्रीय प्लेटफ़ॉर्म डेमॉन जैसे State Management, Diagnostic Management या Update and Configuration Management दोनों भौतिक फ़ाइल सिस्टम या फ़्लैश ड्राइवरों से स्वतंत्र रूप से अपनी स्थितियों को स्थायी रूप से संग्रहीत करने के लिए इन इंटरफ़ेस का उपयोग करते हैं (EXP_SWArchitecture पृ. 93)।

PerArchContext cluster_apps Konsumenten cluster_per ara::per (Persistency Cluster) cluster_platform Plattformdienste & Basis AA Adaptive Application KVS KeyValueStorage (PortInterface) AA->KVS FS FileStorage (PortInterface) AA->FS LIFE Installation & Update (NativeInterface) AA->LIFE REC Recovery & Diagnostics (NativeInterface) AA->REC SM State Management SM->KVS DM निदान प्रबंधन DM->KVS DM->FS VUCM Update & Configuration Mgmt VUCM->KVS VUCM->FS RP Remote Persistency RP->KVS CRYPTO Cryptography (ara::crypto) KVS->CRYPTO OS Operating System (POSIX VFS / NVRAM) KVS->OS FS->OS

संदर्भ आरेख: अनुप्रयोग और प्लेटफ़ॉर्म उपभोक्ताओं के साथ-साथ अंतर्निहित ऑपरेटिंग सिस्टम के साथ Adaptive Platform में Persistency क्लस्टर का एम्बेडिंग। स्रोत: EXP_SWArchitecture पृ. 93, EXP_SWArchitecture पृ. 43।

KeyValueStorage में लेखन संचालन एक सख्त इन-मेमोरी ट्रांज़ैक्शन सिमेंटिक्स का पालन करते हैं ([SWS_PER_00046])। कुंजी-मान युग्मों में संशोधन प्रारंभ में अस्थायी रूप से बफ़र रहते हैं और केवल समकालिक कॉल SyncToStorage के माध्यम से स्थायी रूप से स्टोरेज माध्यम पर लिखे जाते हैं ([SWS_PER_00049]), जबकि DiscardPendingChanges असुरक्षित स्थितियों को त्याग देता है ([SWS_PER_00365])। FileStorage में, एक्सेस विशेष, टाइप किए गए एक्सेसर्स (ReadAccessor, WriteAccessor, ReadWriteAccessor) के माध्यम से होता है, जिन्हें विशेष रूप से UniqueHandle के माध्यम से प्रबंधित किया जाता है ([SWS_PER_00113], [SWS_PER_00114], [SWS_PER_00115])।

ट्रांजेक्शनल की-वैल्यू स्टोरेज और भौतिक फ़्लशAdaptive Applicationara::per (KeyValueStorage)Betriebssystem / NVRAMSetValue(key, value)मान को RAM में बफ़र करें (लेनदेन स्थिति)Result<void> (Erfolg)altCommit-Pfad (Dauerhaftes Sichern)SyncToStorage()CRC / अतिरेक (रिडंडेंसी) की गणना और वैकल्पिक एन्क्रिप्शनwrite() / fsync()Status OKResult<void> (Persistiert)रोलबैक पथ (असुरक्षित परिवर्तनों को छोड़ना)DiscardPendingChanges()अस्थिर RAM परिवर्तन छोड़ेंResult<void> (रीसेट किया गया)

अनुक्रम आरेख: इन-मेमोरी बफ़रिंग और भौतिक फ्लश के साथ एक की-वैल्यू स्टोरेज का लेखन और सिंक्रोनाइज़ेशन क्रम। स्रोत: [SWS_PER_00046], [SWS_PER_00049], [SWS_PER_00365], EXP_SWArchitecture पृ. 230।

इसके अलावा, मॉड्यूल जीवनचक्र और दोष-सहिष्णुता के लिए व्यापक तंत्रों को एकीकृत करता है: रनटाइम के दौरान कॉन्फ़िगरेशन परिवर्तन CheckForManifestUpdate और ReloadPersistencyManifest के माध्यम से संसाधित किए जाते हैं ([SWS_PER_00576], [SWS_PER_00577]), जबकि एप्लिकेशन-विशिष्ट डेटा माइग्रेशन अपडेट कॉलबैक के माध्यम से होते हैं ([SWS_PER_00356], [SWS_PER_00357])। यदि मैनिफ़ेस्ट-आधारित अतिरेक या अखंडता जाँच विफल हो जाती है, तो कॉलबैक भ्रष्टाचार की स्थिति के बारे में सूचित करते हैं ([SWS_PER_00433]), जिसके बाद क्षतिग्रस्त डेटा को RecoverKeyValueStorage, RecoverFile द्वारा या रीसेट संचालन के माध्यम से ठीक किया जा सकता है ([SWS_PER_00333], [SWS_PER_00337], [SWS_PER_00334])।

ara::per की सिस्टम सीमाएँ और आर्किटेक्चर एकीकरण

कार्यात्मक क्लस्टर Persistency (ara::per) AUTOSAR Adaptive Platform पर गैर-वाष्पशील डेटा स्टोरेज के लिए मानकीकृत अमूर्त तंत्र प्रदान करता है (EXP_SWArchitecture पृ. 43)। यह उपयोगकर्ता-परिभाषित अनुप्रयोगों और कार्यात्मक प्लेटफ़ॉर्म सेवाओं दोनों को ऑपरेटिंग-सिस्टम-विशिष्ट फ़ाइल सिस्टम, विभाजन संरचनाओं और फ़्लैश या NVRAM ड्राइवरों से अलग करता है (EXP_SWArchitecture पृ. 93)। प्रावधान में दो अलग-अलग प्राथमिक स्टोरेज प्रतिमान शामिल हैं: KeyValueStorage के माध्यम से कुंजी-आधारित डेटा एक्सेस और FileStorage के माध्यम से पदानुक्रमित फ़ाइल स्टोरेज (SWS_Persistency पृ. 219)। प्लेटफ़ॉर्म सेवाएँ जैसे Diagnostic Management (EXP_SWArchitecture पृ. 176), State Management (EXP_SWArchitecture पृ. 55), Update and Configuration Management (SWS_UpdateAndConfigurationManagement पृ. 18) और Remote Persistency (SWS_RemotePersistency पृ. 9) इन इंटरफ़ेस का उपयोग मानकीकृत पोर्ट-इंटरफ़ेस के रूप में करती हैं ([SWS_PER_00052], [SWS_PER_00116])।

स्थानीय स्टोरेज अमूर्तता प्रदान करने के अलावा, ara::per सीधे होस्ट ऑपरेटिंग सिस्टम के इंटरफ़ेस पर क्रिप्टोग्राफ़िक प्रिमिटिव्स और अतिरेक जाँचों को एकीकृत करता है (EXP_SWArchitecture पृ. 230)। एक पर्सिस्टेंसी स्टोरेज का कार्यात्मक कॉन्फ़िगरेशन AUTOSAR मैनिफ़ेस्ट में घोषणात्मक रूप से तैयार किया गया है और कोटा विनिर्देशों, अखंडता हैश, CRC प्रक्रियाओं और क्रिप्टोग्राफ़िक एन्क्रिप्शन पथों को ठोस इंस्टेंस से बांधता है (SWS_Persistency पृ. 104)। अन्य कार्यात्मक क्लस्टरों के लाइब्रेरी भाग अपने स्वयं के टारगेट कॉन्फ़िगरेशन के माध्यम से सीधे पर्सिस्टेंसी को बाँधते हैं, जबकि डेमॉन प्रक्रियाएं नियमित अनुप्रयोगों के समान इंस्टेंस-स्पेसिफायर के माध्यम से स्टोरेज इकाइयों तक पहुँचती हैं (SWS_Persistency पृ. 35)।

PerArchContext cluster_apps Konsumenten cluster_per ara::per (Persistency Cluster) cluster_platform Plattformdienste & Basis AA Adaptive Application KVS KeyValueStorage (PortInterface) AA->KVS FS FileStorage (PortInterface) AA->FS LIFE Installation & Update (NativeInterface) AA->LIFE REC Recovery & Diagnostics (NativeInterface) AA->REC SM State Management SM->KVS DM निदान प्रबंधन DM->KVS DM->FS VUCM Update & Configuration Mgmt VUCM->KVS VUCM->FS RP Remote Persistency RP->KVS CRYPTO Cryptography (ara::crypto) KVS->CRYPTO OS Operating System (POSIX VFS / NVRAM) KVS->OS FS->OS

संदर्भ आरेख: अनुप्रयोग और प्लेटफ़ॉर्म उपभोक्ताओं के साथ-साथ अंतर्निहित ऑपरेटिंग सिस्टम के साथ Adaptive Platform में Persistency क्लस्टर का एम्बेडिंग। स्रोत: EXP_SWArchitecture पृ. 93, EXP_SWArchitecture पृ. 43।

की-वैल्यू स्टोरेज: इंस्टैंसिएशन, ट्रांज़ैक्शन सिमेंटिक्स और फ्लश मैकेनिज़्म

संरचित मापदंडों तक पहुँच क्लास ara::per::KeyValueStorage के माध्यम से की जाती है, जिसे एक ara::core::InstanceSpecifier निर्दिष्ट करते हुए कॉल ara::per::OpenKeyValueStorage के माध्यम से खोला जाता है ([SWS_PER_00052])। लौटाया गया SharedHandle<KeyValueStorage> स्टोरेज क्षेत्र को प्रकार-सुरक्षित तरीके से समाहित करता है और बेस कंटेनरों के हटाए गए मूव और कॉपी कंस्ट्रक्टर के माध्यम से अनियंत्रित दोहराव को रोकता है ([SWS_PER_00322], [SWS_PER_00324], [SWS_PER_00367])। SetValue ([SWS_PER_00046]) और GetValue ([SWS_PER_00044], [SWS_PER_00332]) के माध्यम से कुंजी-मान युग्मों को संशोधित या क्वेरी किया जाता है; इस दौरान KeyExists ([SWS_PER_00043]) अस्तित्व की जाँच और GetAllKeys ([SWS_PER_00042]) सभी सक्रिय कुंजियों की पूरी सूची प्रदान करता है।

लेखन और विलोपन संचालन एक सख्त इन-मेमोरी ट्रांज़ैक्शन सिमेंटिक्स के अधीन हैं: SetValue, RemoveKey ([SWS_PER_00047]) या RemoveAllKeys ([SWS_PER_00048]) द्वारा किए गए परिवर्तन प्रारंभ में प्रक्रिया के अस्थिर बफ़र में रहते हैं (EXP_SWArchitecture पृ. 230)। केवल SyncToStorage का स्पष्ट कॉल सभी लंबित संशोधनों को परमाणु और स्थायी रूप से भौतिक माध्यम पर सुरक्षित करता है ([SWS_PER_00049])। यदि अभी तक न लिखे गए लेन-देन चरणों को त्यागना हो, तो DiscardPendingChanges स्थिति को अंतिम SyncToStorage या खोलने की स्थिति में रीसेट कर देता है ([SWS_PER_00365])। एकल मानों के लिए GetCurrentValueSize ([SWS_PER_00554]) के माध्यम से और GetCurrentKeyValueStorageSize ([SWS_PER_00405]) के माध्यम से अतिरेक और मेटाडेटा सहित समग्र रूप से मेमोरी आवश्यकताओं की निगरानी की जा सकती है (EXP_SWArchitecture पृ. 231)।

ट्रांजेक्शनल की-वैल्यू स्टोरेज और भौतिक फ़्लशAdaptive Applicationara::per (KeyValueStorage)Betriebssystem / NVRAMSetValue(key, value)मान को RAM में बफ़र करें (लेनदेन स्थिति)Result<void> (Erfolg)altCommit-Pfad (Dauerhaftes Sichern)SyncToStorage()CRC / अतिरेक (रिडंडेंसी) की गणना और वैकल्पिक एन्क्रिप्शनwrite() / fsync()Status OKResult<void> (Persistiert)रोलबैक पथ (असुरक्षित परिवर्तनों को छोड़ना)DiscardPendingChanges()अस्थिर RAM परिवर्तन छोड़ेंResult<void> (रीसेट किया गया)

अनुक्रम आरेख: इन-मेमोरी बफ़रिंग और भौतिक फ्लश के साथ एक की-वैल्यू स्टोरेज का लेखन और सिंक्रोनाइज़ेशन क्रम। स्रोत: [SWS_PER_00046], [SWS_PER_00049], [SWS_PER_00365], EXP_SWArchitecture पृ. 230।

फ़ाइल-आधारित स्टोरेज एक्सेस और टाइप किए गए एक्सेस पदानुक्रम

असंरचित डेटा स्ट्रीम, बाइनरी ब्लॉक या लॉग फ़ाइलों के लिए क्लास ara::per::FileStorage कार्य करती है, जिसे ara::per::OpenFileStorage के माध्यम से इनिशियलाइज़ किया जाता है ([SWS_PER_00116])। एक FileStorage कंटेनर के भीतर, मौजूदा फ़ाइलों को GetAllFileNames के माध्यम से सूचीबद्ध किया जा सकता है ([SWS_PER_00110]), उनका अस्तित्व FileExists के माध्यम से जाँचा जा सकता है ([SWS_PER_00112]) या फ़ाइलों को DeleteFile के माध्यम से हटाया जा सकता है ([SWS_PER_00111])। आकार कोटा GetCurrentFileSize ([SWS_PER_00407]) और GetCurrentFileStorageSize ([SWS_PER_00406]) के माध्यम से निर्धारित किया जाता है (EXP_SWArchitecture पृ. 231)।

फ़ाइल एक्सेस स्वयं विशिष्ट एक्सेस क्लासों (EXP_SWArchitecture पृ. 88) के माध्यम से इंटरफ़ेस पृथक्करण के सिद्धांत का पालन करता है। आवश्यक मोड के आधार पर (OpenMode, [SWS_PER_00147], बिटवाइज़ ऑपरेटरों [SWS_PER_00144], [SWS_PER_00434] के माध्यम से संयोजन योग्य), फ़ैक्टरी विधियाँ विशेष UniqueHandle इंस्टेंस उत्पन्न करती हैं ([SWS_PER_00371], [SWS_PER_00569]):

सामान्य स्थिति और आकार संचालन जैसे GetPosition ([SWS_PER_00162]), SetPosition ([SWS_PER_00163]), MovePosition और गणना Origin ([SWS_PER_00146], [SWS_PER_00164]) का उपयोग करके सापेक्ष नेविगेशन, GetSize ([SWS_PER_00424]) और फ़ाइल के अंत की जाँच IsEof ([SWS_PER_00107]) सामान्य बेस क्लास FileAccessor में निहित हैं। विस्तारित फ़ाइल मेटाडेटा जैसे टाइमस्टैम्प और निर्माण के कारणों को GetFileInfo और संरचना FileInfo के माध्यम से पढ़ा जाता है ([SWS_PER_00435], [SWS_PER_00436], [SWS_PER_00438], [SWS_PER_00441], [SWS_PER_00442], [SWS_PER_00443], [SWS_PER_00444], [SWS_PER_00445])। व्याख्या: प्रकार सुरक्षा के अलावा, गैर-प्रतिलिपि योग्य एक्सेस इंस्टेंस में सख्त विभाजन का प्राथमिक उद्देश्य ऑपरेटिंग सिस्टम स्तर पर समवर्ती लेखन संघर्षों को नियतात्मक रूप से रोकना हो सकता है। प्रश्न Q-a990a7aa44326447 (खुला)

PerAccessorHierarchy FileStorage FileStorage (Container-Verwaltung) ReadAccessor ReadAccessor + ReadText() + ReadLine() + ReadBinary() + GetChar() / PeekChar() + GetByte() / PeekByte() FileStorage->ReadAccessor OpenFileReadOnly() WriteAccessor WriteAccessor + WriteText() + WriteBinary() + SetFileSize() + SyncToFile() FileStorage->WriteAccessor OpenFileWriteOnly() ReadWriteAccessor ReadWriteAccessor (Kombinierter Lese-/Schreibzugriff) FileStorage->ReadWriteAccessor OpenFileReadWrite() FileAccessor FileAccessor + GetPosition() + SetPosition() + MovePosition() + GetSize() + IsEof() ReadAccessor->FileAccessor WriteAccessor->FileAccessor ReadWriteAccessor->ReadAccessor ReadWriteAccessor->WriteAccessor

संरचना आरेख: फ़ाइल एक्सेस क्लासों और एक्सेस हैंडल का इंटरफ़ेस और क्लास पदानुक्रम। स्रोत: [SWS_PER_00113], [SWS_PER_00114], [SWS_PER_00115], EXP_SWArchitecture पृ. 88।

जीवनचक्र प्रबंधन, अपडेट प्रक्रियाएं और मैनिफ़ेस्ट सिंक्रोनाइज़ेशन

Update and Configuration Management (UCM) द्वारा सॉफ़्टवेयर अपडेट और नए इंस्टॉलेशन के लिए, Persistency समर्पित जीवनचक्र संचालन प्रदान करता है (EXP_SWArchitecture पृ. 92)। यदि किसी एप्लिकेशन के रनटाइम के दौरान एक अपडेट किया गया लक्ष्य कॉन्फ़िगरेशन लागू किया जाता है, तो एप्लिकेशन CheckForManifestUpdate का उपयोग करके यह निर्धारित कर सकता है कि कॉन्फ़िगरेशन परिवर्तन मौजूद हैं या नहीं ([SWS_PER_00576])। ReloadPersistencyManifest के साथ, ara::per अद्यतन कॉन्फ़िगरेशन को फिर से पढ़ता है, जिसके बाद परिवर्तित स्टोरेज परिभाषाएं अगले बंद होने और फिर से खुलने के बाद सक्रिय हो जाती हैं ([SWS_PER_00577])।

मौजूदा एप्लिकेशन डेटा को माइग्रेट करने के लिए, RegisterApplicationDataUpdateCallback के माध्यम से एक कॉलबैक फ़ंक्शन पंजीकृत किया जाता है, जो भिन्न कॉन्ट्रैक्ट संस्करण स्थितियों के आधार पर डेटा माइग्रेशन आवश्यक होने पर ara::per द्वारा ट्रिगर किया जाता है ([SWS_PER_00356])। अलग-अलग तत्वों में विशिष्ट परिवर्तनों की निगरानी RegisterDataUpdateIndication के माध्यम से की जा सकती है ([SWS_PER_00578])। सत्यापन चरण के दौरान UpdatePersistency द्वारा संपूर्ण पर्सिस्टेंसी अद्यतन प्रक्रिया शुरू की जाती है ([SWS_PER_00357])। सफल अद्यतन के बाद, CleanUpPersistency पुराने बैकअप और माइग्रेशन डेटा को हटा देता है ([SWS_PER_00567]), जबकि ResetPersistency स्टोरेज क्षेत्रों को पूरी तरह से खाली कर देता है, ताकि अगली बार खोले जाने पर वे मैनिफ़ेस्ट से नए सिरे से बनाए जाएँ ([SWS_PER_00358])।

मैनिफ़ेस्ट अद्यतन और डेटा माइग्रेशनAdaptive Applicationara::per (Persistency)UCM / ManifestCheckForManifestUpdate()Result<bool> (अपडेट उपलब्ध)optManifest-Aktualisierung erkanntReloadPersistencyManifest()Lese neue Target-ConfigurationKonfiguration geladenResult<void>UpdatePersistency()Callback: appDataUpdateCallback(storage, version)Migriere anwendungsspezifische DatenMigration abgeschlossenResult<void> (UpdatePersistency OK)CleanUpPersistency()अस्थायी बैकअप और पुराना डेटा हटाएँResult<void> (Bereinigt)

अनुक्रम आरेख: कॉन्फ़िगरेशन जाँच, कॉलबैक माइग्रेशन और क्लीनअप के साथ पर्सिस्टेंसी अपडेट का क्रम। स्रोत: [SWS_PER_00356], [SWS_PER_00357], [SWS_PER_00567], [SWS_PER_00576], [SWS_PER_00577], EXP_SWArchitecture पृ. 92।

अखंडता निगरानी, अतिरेक प्रबंधन और पुनर्प्राप्ति

दूषित डेटा रिकॉर्ड को रोकने के लिए, की-वैल्यू और फ़ाइल स्टोरेज कॉन्फ़िगर करने योग्य रिडंडेंसी प्रतियों और अखंडता तंत्रों (CRC, हैश, MAC प्रमाणीकरण और एन्क्रिप्शन) का समर्थन करते हैं (SWS_Persistency पृ. 104, EXP_SWArchitecture पृ. 230)। यदि आंतरिक अतिरेक जाँच विफल हो जाती है, तो सुरक्षा-संबंधित अनुप्रयोगों को RegisterRecoveryReportCallback के माध्यम से सूचित किया जा सकता है ([SWS_PER_00433])। कॉलबैक RecoveryReportKind (उदा. kKeyValueStorageRecoveryFailed) के साथ-साथ प्रभावित इंस्टेंस और की/फ़ाइल नाम प्रसारित करता है ([SWS_PER_00432], EXP_SWArchitecture पृ. 91)।

क्षतिग्रस्त डेटा की लक्षित पुनर्प्राप्ति के लिए बारीक मरम्मत और रीसेट विधियां उपलब्ध हैं:

  • पुनर्प्राप्ति: स्टोरेज स्तर पर, RecoverKeyValueStorage ([SWS_PER_00333]) और RecoverAllFiles ([SWS_PER_00335]) बंद कंटेनरों की मरम्मत की अनुमति देते हैं; तत्व स्तर पर, RecoverKey ([SWS_PER_00427]) और RecoverFile ([SWS_PER_00337]) सर्वोत्तम-प्रयास प्रक्रिया में व्यक्तिगत क्षतिग्रस्त प्रविष्टियों को पुनर्प्राप्त करते हैं।
  • फ़ैक्टरी सेटिंग्स पर रीसेट करना: ResetKeyValueStorage ([SWS_PER_00334]) और ResetAllFiles ([SWS_PER_00336]) के माध्यम से, कंटेनरों को प्रारंभिक वितरण की स्थिति में रीसेट किया जा सकता है; इसी तरह, ResetKey ([SWS_PER_00426]) या ResetFile ([SWS_PER_00338]) व्यक्तिगत तत्वों को उनकी कॉन्फ़िगर की गई प्रारंभिक स्थिति में रीसेट करते हैं।
PerRecoveryFlow Start डेटा एक्सेस या अखंडता जाँच Check अतिरेक/अखंडता जाँच (CRC, Hash, MAC, प्रतियाँ) Start->Check Report Trigger RegisterRecoveryReportCallback (RecoveryReportKind gemeldet) Check->Report Fehler Success मेमोरी फिर से सुसंगत स्थिति में Check->Success OK Decide Wiederherstellungsstrategie? Report->Decide RecoverStorage RecoverKeyValueStorage() / RecoverAllFiles() Decide->RecoverStorage पूर्ण कंटेनर सुधार RecoverSingle RecoverKey() / RecoverFile() (Best-Effort) Decide->RecoverSingle Einzelwert-Reparatur ResetDefault ResetKeyValueStorage() / ResetAllFiles() (Werkswerte) Decide->ResetDefault प्रारंभिक स्थिति में रीसेट करें RecoverStorage->Success RecoverSingle->Success ResetDefault->Success

गतिविधि आरेख: डेटा भ्रष्टाचार के मामले में निर्णय पथ, अतिरेक जाँच से कॉलबैक के माध्यम से पुनर्प्राप्ति या रीसेट तक। स्रोत: [SWS_PER_00333], [SWS_PER_00334], [SWS_PER_00432], [SWS_PER_00433]।

त्रुटि की स्थिति में व्यवहार

ara::per में त्रुटि स्थितियों को अनियंत्रित C++ अपवादों के माध्यम से प्रचारित नहीं किया जाता है, बल्कि रिटर्न प्रकार ara::core::Result के माध्यम से नियतात्मक रूप से मैप किया जाता है ([SWS_PER_00044], [SWS_PER_00113])। मॉड्यूल GetPerDomain ([SWS_PER_00352]) के माध्यम से अपना स्वयं का त्रुटि डोमेन परिभाषित करता है, जिसे PerErrorDomain द्वारा Name ([SWS_PER_00314]) और Message ([SWS_PER_00315]) के माध्यम से मानकीकृत त्रुटि रिज़ॉल्यूशन के साथ लागू किया जाता है, साथ ही गणना PerErrc या प्रकार उपनाम Errc ([SWS_PER_00311], [SWS_PER_00411])। सक्षम अपवादों वाले वातावरण के लिए PerException ([SWS_PER_00355], [SWS_PER_00412]) और ThrowAsException ([SWS_PER_00350]) उपलब्ध हैं, जबकि MakeErrorCode प्लेटफ़ॉर्म-अनुरूप त्रुटि कोड के निर्माण को समाहित करता है ([SWS_PER_00351])।

विशिष्ट त्रुटि कोड संसाधन- और समवर्ती-संबंधित संघर्षों को कवर करते हैं: संचालन जैसे OpenKeyValueStorage ([SWS_PER_00052]), OpenFileStorage ([SWS_PER_00116]), DeleteFile ([SWS_PER_00111]) या RecoverKeyValueStorage ([SWS_PER_00333]) kResourceBusy के साथ विफल हो जाते हैं यदि संबंधित स्टोरेज तत्व पहले से खुला है या UpdatePersistency जैसे रखरखाव कार्यों द्वारा समानांतर रूप से संशोधित किया जा रहा है। असंगत प्रकार निर्दिष्ट करते समय, SetValue त्रुटि kDataTypeMismatch ([SWS_PER_00046]) की रिपोर्ट करता है। भौतिक हार्डवेयर त्रुटियों (PerErrc::kPhysical) के मामले में, यह विभेदित किया जाता है कि क्या रोलबैक सिमेंटिक्स मौजूद है (उदा. पढ़ने और स्थिति संचालन जैसे [SWS_PER_00167], [SWS_PER_00168] में, जहाँ पॉइंटर्स अपरिवर्तित रहते हैं) या क्या रोलबैक गारंटी के बिना डेटा भ्रष्टाचार हो सकता है (उदा. [SWS_PER_00122], [SWS_PER_00166], [SWS_PER_00423] में)।

सिंक्रोनाइज़ेशन और एक्सेस त्रुटियों के निदान के लिए, मॉड्यूल मानकीकृत DLT लॉग संदेश उत्पन्न करता है (SWS_Persistency पृ. 110)। यहाँ, संदेश जैसे SyncToStorage (संदेश ID 0x80008037), SyncToFile (0x80008036) और DiscardPendingChanges (0x80008038) विस्तृत रूप से प्रभावित कुंजी सेट और मेमोरी आवंटन को लॉग करते हैं, जिसके माध्यम से अपूर्ण शटडाउन (उदा. ara::core::Deinitialize के माध्यम से) के मामले में भी स्थिति पुनर्निर्माण योग्य रहती है (SWS_Persistency पृ. 110)।

आगे विस्तृत साक्ष्य

पर्सिस्टेंसी क्लस्टर की वास्तुकला और संपर्क निम्नलिखित मानक आवश्यकताओं और दस्तावेज़ अंशों पर आधारित हैं:

यह मॉड्यूल गाइड AUTOSAR Adaptive रिलीज़ R25-11 के विनिर्देशों पर आधारित है। कथन विशेष रूप से बाध्यकारी SWS आवश्यकताओं और संबंधित आर्किटेक्चर दस्तावेज़ों पर आधारित हैं।

function: 116 class: 10 enumeration: 6 variable: 5 type alias: 2 struct: 1

ara::per

FileAccessor क्लास

FileAccessor contains a common basis for ReadAccessor and WriteAccessor

का आधार ReadAccessor, WriteAccessor

FileInfo क्लास

This structure contains additional information on a file returned by GetFileInfo.

FileStorage क्लास

The File Storage contains a set of files identified by their file names.

KeyValueStorage क्लास

The Key-Value Storage contains a set of keys with associated values.

PerErrorDomain क्लास

Defines the error domain for Persistency.

से इनहेरिट करता है ara::core::ErrorDomain

PerException क्लास

Exception type thrown by Persistency.

से इनहेरिट करता है ara::core::Exception

ReadAccessor क्लास

ReadAccessor is used to read file data

से इनहेरिट करता है FileAccessor

का आधार ReadWriteAccessor

ReadWriteAccessor क्लास

ReadWriteAccessor is used to read and write file data

से इनहेरिट करता है ReadAccessor, WriteAccessor

SharedHandle क्लास

Handle to a File Storage or Key-Value Storage

UniqueHandle क्लास

Handle to a ReadAccessor or ReadWriteAccessor

WriteAccessor क्लास

WriteAccessor is used to write file data

से इनहेरिट करता है FileAccessor

का आधार ReadWriteAccessor

CheckForManifestUpdate फ़ंक्शन

Checks for updates of the Persistency Target Configuration. This method can be used to detect configuration updates that are installed by UCM while the Adaptive Application that uses Persistency is running. To re-read the updated Target Configuration, the Adaptive Application needs to call ara::per:: ReloadPersistencyManifest.

ara::core::Result< bool > CheckForManifestUpdate () noexcept;
CleanUpPersistency फ़ंक्शन

Removes backup data and other unused data of all Persistency Key-Value Storages and File Storages.

ara::core::Result< void > CleanUpPersistency () noexcept;
GetCurrentFileStorageSize फ़ंक्शन

Returns the space in bytes currently occupied by a File Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the File Storage is not opened and no other operation on the File Storage takes place at the same time.

ara::core::Result< std::uint64_t > GetCurrentFileStorageSize (const ara::core::InstanceSpecifier &fs) noexcept;
GetCurrentKeyValueStorageSize फ़ंक्शन

Returns the space in bytes currently occupied by a Key-Value Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the Key-Value Storage is not opened and no other operation on the Key-Value Storage takes place at the same time.

ara::core::Result< std::uint64_t > GetCurrentKeyValueStorageSize (const ara::core::InstanceSpecifier &kvs) noexcept;
GetPerDomain फ़ंक्शन

Returns the global PerErrorDomain object.

constexpr const ara::core::ErrorDomain & GetPerDomain () noexcept;
MakeErrorCode फ़ंक्शन

Creates an error code.

constexpr ara::core::ErrorCode MakeErrorCode (PerErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;
OpenFileStorage फ़ंक्शन

Opens a File Storage. OpenFileStorage will fail with kResourceBusy when the File Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. Because multiple threads can access the same File Storage concurrently, the File Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same File Storage went out of scope.

ara::core::Result< SharedHandle< FileStorage > > OpenFileStorage (const ara::core::InstanceSpecifier &fs) noexcept;
OpenKeyValueStorage फ़ंक्शन

Opens a Key-Value Storage. OpenKeyValueStorage will fail with kResourceBusy when the Key-Value Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. Because multiple threads can access the same Key-Value Storage concurrently, the Key-Value Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same Key-Value Storage went out of scope.

ara::core::Result< SharedHandle< KeyValueStorage > > OpenKeyValue Storage (const ara::core::InstanceSpecifier &kvs) noexcept;
operator| फ़ंक्शन

Merges two OpenMode modifiers into one.

constexpr OpenMode operator| (OpenMode left, OpenMode right);
operator|= फ़ंक्शन

Merges an OpenMode modifier into this OpenMode.

OpenMode & operator|= (OpenMode &left, const OpenMode &right);
RecoverAllFiles फ़ंक्शन

Recovers a File Storage, including all files. RecoverAllFiles recovers a File Storage when the redundancy checks fail. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. This method does a best-effort recovery of all files. After recovery, files might show outdated or initial content, or might be lost.

ara::core::Result< void > RecoverAllFiles (const ara::core::Instance Specifier &fs) noexcept;
RecoverKeyValueStorage फ़ंक्शन

Recovers a Key-ValueStorage. RecoverKeyValueStorage allows to recover a Key-Value Storage when the redundancy checks fail. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. This method does a best-effort recovery of all key-value pairs. After recovery, keys might show outdated or initial value, or might be lost.

ara::core::Result< void > RecoverKeyValueStorage (const ara::core::InstanceSpecifier &kvs) noexcept;

Registers an application data update callback with Persistency. The provided callback function will be called by Persistency if an update of stored application data might be necessary. This decision is based on the contract versions. The contract version that last accessed Persistency is provided as an argument to the callback, as well as the ara::core::InstanceSpecifier referring to the updated Key- Value Storage or File Storage. Based on this information, the Adaptive Application can decide which updates are actually necessary, e.g. a migration from any older contract version could be supported, with different steps required for each of these. The provided function will be called from the context of ara::per::UpdatePersistency, ara::per::OpenKeyValueStorage, or ara::per::OpenFileStorage.

void RegisterApplicationDataUpdateCallback (std::function< void(const ara::core::InstanceSpecifier &storage, ara::core::String contract Version)> appDataUpdateCallback) noexcept;
RegisterDataUpdateIndication फ़ंक्शन

Registers a data update indication callback with Persistency. The provided callback function will be called by Persistency when an update of stored data happened. It will be called from the context of ara::per::UpdatePersistency, ara:: per::OpenKeyValueStorage, or ara::per::OpenFileStorage.

void RegisterDataUpdateIndication (std::function< void(const ara::core::InstanceSpecifier &updatedStorage, ara::core::StringView updatedElement)> dataUpdateIndication, ara::core::InstanceSpecifier monitoredStorage, ara::core::Vector< ara::core::String > monitored Elements) noexcept;
RegisterRecoveryReportCallback फ़ंक्शन

Register a recovery reporting callback with Persistency. This callback can be used in safety-aware Adaptive Applications to detect actions of the Persistency that are related to the correctness of the persisted data and the reliability of the storage.

void RegisterRecoveryReportCallback (std::function< void(const ara::core::InstanceSpecifier &storage, ara::per::RecoveryReportKind recoveryReportKind, ara::core::Vector< ara::core::String > reported Elements, ara::core::Vector< std::uint8_t > reportedInstances)> recoveryReportCallback) noexcept;
ReloadPersistencyManifest फ़ंक्शन

Re-reads the Target Configuration. This method can be used to prepare for updates of the Key-Value Storages and File Storages of Persistency after a new Target Configuration was installed by UCM while the Adaptive Application that uses Persistency is running. Storages are only updated after closing them, either when they are opened again or by an explicit call to ara:: per::UpdatePersistency.

ara::core::Result< void > ReloadPersistencyManifest () noexcept;
ResetAllFiles फ़ंक्शन

Resets a File Storage, including all files. ResetAllFiles resets a File Storage to the initial state, containing only the files which were deployed from the Target Configuration, with their initial content. Afterwards, the File Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles.

ara::core::Result< void > ResetAllFiles (const ara::core::Instance Specifier &fs) noexcept;
ResetKeyValueStorage फ़ंक्शन

Resets a Key-Value Storage to the initial state. ResetKeyValueStorage allows to reset a Key-Value Storage to the initial state, containing only key-value pairs which were deployed from the Target Configuration, with their initial values. Afterwards, the Key-Value Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage.

ara::core::Result< void > ResetKeyValueStorage (const ara::core::InstanceSpecifier &kvs) noexcept;
ResetPersistency फ़ंक्शन

Resets all Key-Value Storages and File Storages by entirely removing their content. The Key-Value Storages and File Storages will be re-created when ara::per:: OpenFileStorage or ara::per::OpenKeyValueStorage is called next time.

ara::core::Result< void > ResetPersistency () noexcept;
UpdatePersistency फ़ंक्शन

Updates all Persistency Key-Value Storages and File Storages after a new Target Configuration was installed. This method can be used to update the persistent data of the Adaptive Application during verification phase.

ara::core::Result< void > UpdatePersistency () noexcept;
FileCreationState एन्यूमरेशन

This enumeration describes how and when a file was created.

enum class FileCreationState : std::uint32_t {...};
FileModificationState एन्यूमरेशन

This enumeration describes how and when a file was last modified.

enum class FileModificationState : std::uint32_t {...};
OpenMode एन्यूमरेशन

This enumeration defines how a file shall be opened. The values can be combined (using | and |=) as long as they do not contradict each other.

enum class OpenMode : std::uint32_t {...};
Origin एन्यूमरेशन

Specification of origin used in MovePosition.

enum class Origin : std::uint32_t {...};
PerErrc एन्यूमरेशन

Defines the errors for Persistency. The enumeration values 0 - 255 are reserved for AUTOSAR assigned errors, the stack provider is free to define additional errors starting from 256.

enum class PerErrc : ara::core::ErrorDomain::CodeType {...};
RecoveryReportKind एन्यूमरेशन

Defines the reported recovery actions.

enum class RecoveryReportKind : std::uint32_t {...};

नेमस्पेस

मॉड्यूल का UML क्लास आरेख

Abgerundete Rahmen = Namespaces; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = modulfremde bzw. externe Basisklassen. Klicken öffnet die Klassenseite.

G cluster_1 ara::per nara__per__FileAccessor932 FileAccessor nara__per__ReadAccessor956 ReadAccessor nara__per__ReadAccessor956->nara__per__FileAccessor932 nara__per__ReadWriteAccessor483 ReadWriteAccessor nara__per__ReadWriteAccessor483->nara__per__ReadAccessor956 nara__per__WriteAccessor940 WriteAccessor nara__per__ReadWriteAccessor483->nara__per__WriteAccessor940 nara__per__WriteAccessor940->nara__per__FileAccessor932 nara__per__FileInfo503 «struct» FileInfo nara__per__FileStorage945 FileStorage nara__per__KeyValueStorage981 KeyValueStorage nara__per__PerErrorDomain979 PerErrorDomain nara__core__ErrorDomain335 ara::core::ErrorDomain nara__per__PerErrorDomain979->nara__core__ErrorDomain335 nara__per__PerException768 PerException nara__core__Exception792 ara::core::Exception nara__per__PerException768->nara__core__Exception792 nara__per__SharedHandle980 SharedHandle nara__per__UniqueHandle733 UniqueHandle