EEPROM data storage method and device, electronic equipment and vehicle
Through the EEPROM data storage method of cyclic storage, the effective utilization rate and service life of EEPROM in the prior art under the demand for high-frequency data updates is solved, and more efficient data storage and longer equipment life are achieved.
Patent Information
- Application Number
- CN202411809535.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-13
AI Technical Summary
When facing the demand for high-frequency data updates, the existing EEPROM static storage method leads to a decrease in the effective utilization rate of data blocks and a shortened overall service life, which cannot meet the growing storage needs.
Through circular storage, the single storage information to be stored is stored in several storage data blocks in the storage space, so as to avoid the premature formation of bad blocks by a single storage data block due to excessive read and write times.
It extends the overall service life of EEPROM, improves the effective utilization rate of data blocks, and solves the performance bottleneck of EEPROM's own read and write characteristics.
Smart Images

Figure CN119987652A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data storage, and in particular to an EEPROM data storage method, device, electronic device and vehicle. Background Art
[0002] Due to its high reliability and long erase and write times, EEPROM is widely used in embedded systems to save some important data that needs to be saved frequently. Currently, EEPROM generally uses static storage to store important data. The static storage method is to divide the data into different data blocks according to size and store them in the EEPROM in an associated manner. When the data needs to be updated, the new data is written to the data block corresponding to the old data, that is, the new data overwrites the corresponding old data and erases the same corresponding address.
[0003] The existing EEPROM static storage method has exposed significant limitations when dealing with application scenarios that require frequent data updates, such as accurately recording car mileage. Under this high-frequency data writing demand, the data blocks in the EEPROM will quickly approach the limit of their erasable times, resulting in a significant reduction in the effective utilization of the data blocks and greatly shortening the overall service life of the EEPROM. The existing EEPROM static storage method has obvious shortcomings when facing high-frequency data update needs. With the continuous enhancement of ECU functions and the continuous increase in storage requirements, these problems will become more prominent and become an insurmountable obstacle for existing technologies. Therefore, it is necessary to seek more advanced and efficient storage solutions to meet the growing storage needs. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to provide an EEPROM data storage method, device, electronic device and vehicle, aiming to extend the overall service life of the EEPROM by cyclic storage.
[0005] In a first aspect, the present application provides an EEPROM data storage method, the method comprising:
[0006] Acquire single storage information to be stored, and locate the storage space corresponding to the single storage information;
[0007] Acquire the first storage data block where the single storage information was last stored;
[0008] If the first storage data block is not the last storage data block of the storage space, taking the next storage data block of the first storage data block as the second storage data block;
[0009] If the first storage data block is the last storage data block of the storage space, the first data block of the storage space is used as the second storage data block;
[0010] The single storage information is stored in the second storage data block.
[0011] In a possible implementation, if the first storage data block is not the last storage data block of the storage space, the step of using the next storage data block of the first storage data block as the second storage data block specifically includes:
[0012] If the first storage data block is not the last valid storage data block in the storage space, the next valid storage data block of the first storage data block is used as the second storage data block.
[0013] In a possible implementation, if the first storage data block is the last storage data block in the storage space, the step of using the first data block in the storage space as the second storage data block specifically includes:
[0014] If the first storage data block is the last valid storage data block in the storage space, the first valid data block in the storage space is used as the second storage data block.
[0015] In a possible implementation manner, before the step of obtaining the single storage information to be stored and locating the storage space corresponding to the single storage information, the method further includes:
[0016] Performing CRC check on the storage data block in the EEPROM;
[0017] If the storage data block passes the CRC check, the storage data block is registered as a valid storage data block;
[0018] If the storage data block fails the CRC check, the storage data block is registered as an invalid storage data block.
[0019] In a possible implementation manner, after the step of storing the single storage information in the second storage data block, the method further includes:
[0020] Performing a CRC check on the second stored data block;
[0021] If the second storage data block fails the CRC check, the single storage information is stored in the second storage data block again.
[0022] In a possible implementation, the EEPROM data storage method further includes:
[0023] receiving a data read request, and locating a target storage data block according to the data read request;
[0024] Performing CRC check on the target storage data block;
[0025] If the target storage data block fails the CRC check, the target storage data block is registered as an invalid data block;
[0026] If the target storage data block passes the CRC check, data is read from the target storage data block.
[0027] In a second aspect, the present application provides an EEPROM data storage device, the device comprising:
[0028] A first acquisition module, used to acquire single storage information to be stored, and locate the storage space corresponding to the single storage information;
[0029] A second acquisition module, used to acquire the first storage data block where the single storage information was last stored;
[0030] a first judging module, configured to judge that if the first storage data block is not the last storage data block of the storage space, then use the next storage data block of the first storage data block as the second storage data block;
[0031] a second determination module, configured to determine if the first storage data block is the last storage data block of the storage space, and then use the first data block of the storage space as the second storage data block;
[0032] A data storage module is used to store the single storage information into the second storage data block.
[0033] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the EEPROM data storage method as described in the first aspect or any possible implementation method of the first aspect is implemented.
[0034] In a fourth aspect, the present application provides a vehicle, comprising the EEPROM data storage device described in the second aspect or the electronic device described in the third aspect.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the EEPROM data storage method described in the above-mentioned first aspect or any possible implementation method of the first aspect.
[0036] The EEPROM data storage method, device, electronic device and vehicle proposed in the present application store single storage information to be stored in a plurality of storage data blocks in a storage space by means of cyclic storage, thereby avoiding the premature formation of bad blocks due to excessive reading and writing times of a single storage data block, greatly delaying the time when bad blocks appear in the storage space, and solving the performance bottleneck of the read and write characteristics of the EEPROM itself. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a flow chart of an EEPROM data storage method provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of the structure of an EEPROM data storage device provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0043] First, some nouns involved in this application are analyzed:
[0044] EEPROM: EEPROM (Electrically Erasable Programmable Read-Only Memory) refers to electrically erasable programmable read-only memory, which is a special semiconductor storage device that plays an important role in a variety of application scenarios with its non-volatility and programmability. EEPROM is a semiconductor storage device that allows users to electronically rewrite multiple times. Even in the event of a power outage, the data stored in the EEPROM will not be lost; users can electronically erase and reprogram the data in the EEPROM multiple times without replacing the entire chip; EEPROM usually has high reliability and durability, and can withstand a certain degree of electrical and physical stress, which allows it to maintain stable performance even under harsh environmental conditions.
[0045] Storage data block: A storage data block is a group or several groups of records arranged in sequence. It is a data unit for transmission between the main memory and the input device, output device or external memory. It is a physical record of data and has a corresponding relationship with the logical record of data (a data unit that is logically connected and occupies a group of adjacent units in the memory).
[0046] CRC check: CRC (Cyclic Redundancy Check) check, also known as cyclic redundancy check, is a fast algorithm that generates a short fixed-bit check code based on data such as network data packets or computer files. It is mainly used to detect or check errors that may occur after data transmission or storage. CRC check uses the principle of division and remainder to achieve the function of error detection. In CRC check, the data is regarded as a binary polynomial, and the divisor (i.e., the generating polynomial) is also expressed as a binary polynomial. By using long division, the two polynomials are divided, and the remainder is the check code.
[0047] At present, EEPROM is widely used in embedded systems due to its high reliability and ultra-long erase and write times (erasable 1 million times). It is used to save some important data that needs to be saved frequently. At present, EEPROM generally uses static storage to store important data. The static storage method is to divide the data into different data blocks according to size and store them in the EEPROM in an associated manner. When the data needs to be updated, the new data is written to the data block where the corresponding old data is stored, that is, the new data overwrites the corresponding old data and erases the same corresponding address.
[0048] In the existing usage method, the reliability of data is usually guaranteed by the characteristics of EEPROM itself. After the number of erase and write times reaches the limit value, the data block is invalidated, and the corresponding EEPROM is also invalidated. For common operations such as DID, DTC, calibration data, etc., 1 million erase and write times can be satisfied, but for some frequent data, it is far from enough. For example, if the mileage of a car needs to be saved accurately to 0.1 kilometers, then the vehicle has traveled 100,000 kilometers, which has reached 1 million times, but the vehicle must have traveled more than 100,000 kilometers. If the mileage is frequently stored in the EEPROM, several individual storage blocks will soon be close to the limit of erase and write times, resulting in bad block failures, which greatly affects the service life and quality of the product. It can be seen that the static storage method of EEPROM makes the utilization rate of data blocks low and the service life short.
[0049] Therefore, the EEPROM will be exhausted due to its own read and write characteristics (erasable times 1 million) and will not meet the storage requirements; and the data will be permanently lost due to the occurrence of bad blocks; and the validity of the data cannot be guaranteed.
[0050] In view of the problem of low storage utilization of existing EEPROM, the present application transforms the existing EEPROM storage processing method, improves the dependence on EEPROM operation when reading and writing data, adds strategies to extend the read and write life of EEPROM, and reduces the limitations brought by the EEPROM's own read and write characteristics (erasable times of 1 million). In the case of bad blocks in data blocks, it is necessary to increase monitoring and data backup to prevent data loss. In addition, by dividing multiple storage blocks to store single data information, it is reduced to repeatedly operate the same block to read and write a data information and realize data backup, and CRC check data is added at the end of each divided data storage block to realize the identification of bad blocks and increase the validity of data.
[0051] The EEPROM data storage method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a vehicle terminal, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the EEPROM data storage method, etc., but is not limited to the above forms.
[0052] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0053] It should be noted that in each specific implementation of the present application, when it is necessary to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0054] Figure 1 A schematic diagram of a flow chart of an EEPROM data storage method provided in an embodiment of the present application, Figure 1 The method may include but is not limited to steps S101 to S105.
[0055] S101, obtaining a single storage information to be stored, and locating a storage space corresponding to the single storage information;
[0056] S102, obtaining the first storage data block where the single storage information was last stored;
[0057] S103: If the first storage data block is not the last storage data block in the storage space, use the next storage data block of the first storage data block as the second storage data block;
[0058] S104: If the first storage data block is the last storage data block in the storage space, use the first data block in the storage space as the second storage data block;
[0059] S105: Store the single storage information into the second storage data block.
[0060] Specifically, since the number of read and write operations of EEPROM is limited, in order to extend the life of EEPROM, a wear leveling algorithm is used to evenly distribute read and write operations to different data blocks. First, it is necessary to receive the data that needs to be stored in EEPROM, which may come from sensor readings, user input, calculation results, etc. The EEPROM is divided into multiple storage areas and data blocks, each of which is used to store specific information. The storage range of the information to be stored can be obtained by locating the storage space. Then, the storage data block used when the information was stored last time is searched to determine the storage data block needed to store the information this time. If the location of the last storage is not the last data block of the storage space, then there are subsequent storage data blocks in the storage space that can continue to store data. If the location of the last storage is already the last data block of the storage space, then in order to continue to store data, it is necessary to return to the starting position of the storage space (i.e., the first data block). The last step is to write the information to be stored into the second storage data block determined in step S103 or S104.
[0061] More specifically, a single storage information is divided into multiple (for example: 16) sequentially adjacent data blocks in the EEPROM storage space, and the first data block serves as the next data block adjacent to the last data block, forming a closed-loop connection between the multiple data blocks required for the single storage information, so that the single storage information is sequentially and cyclically saved in one of the data blocks each time it is saved. At the same time, the circular storage strategy can also effectively retain and back up the original data.
[0062] In some embodiments, the step S103 specifically includes:
[0063] If the first storage data block is not the last valid storage data block in the storage space, the next valid storage data block of the first storage data block is used as the second storage data block.
[0064] Specifically, by introducing the description of "valid storage data block", only data blocks that are considered valid or available for storage in the storage space will be considered. In the storage space of EEPROM, not all data blocks may be in an available state. For example, some data blocks may be marked as unavailable due to previous write errors, hardware failures or other reasons. Therefore, before writing new data, the integrity of the data block is checked (such as by checksum or CRC). If the data block is incomplete or damaged, it will not be considered as a valid storage data block. Therefore, in step S103, when it is determined that the first storage data block is not the last valid storage data block of the storage space, the system will select the next valid storage data block as the second storage data block. This ensures that the storage of data is carried out on valid, undamaged or retained data blocks. This refinement makes the data storage method more robust and reliable because it can avoid writing data into unavailable or damaged data blocks, thereby reducing the risk of data loss or damage. At the same time, this also requires the system to be able to track and manage the status and integrity of the data blocks, which may require additional data structures or algorithms to support.
[0065] In some embodiments, the step S104 specifically includes:
[0066] If the first storage data block is the last valid storage data block in the storage space, the first valid data block in the storage space is used as the second storage data block.
[0067] Specifically, in step S104, the system adopts a circular storage strategy. After a traversal of the circular storage, it is necessary to return to the beginning of the storage space and select the first valid data block as the new storage location (i.e., the second storage data block). The concretization of step S104 makes the data storage method more flexible and efficient, and ensures the integrity and reliability of the data through an effective data management and protection mechanism.
[0068] In some embodiments, before the step S101, the following steps are further included:
[0069] Performing CRC check on the storage data block in the EEPROM;
[0070] If the storage data block passes the CRC check, the storage data block is registered as a valid storage data block;
[0071] If the storage data block fails the CRC check, the storage data block is registered as an invalid storage data block.
[0072] Specifically, it is necessary to perform bad block detection on the storage data blocks in the EEPROM during initialization to avoid data loss caused by storing data in bad blocks. Traverse all storage data blocks in the EEPROM and perform CRC check on each data block. CRC check is a commonly used data integrity verification method that generates a check value (i.e., CRC code) by performing specific mathematical operations on the data. This check value can then be compared with the original check value stored in the data block to check whether the data has been modified or damaged during storage or transmission. If the CRC check of the data block is successful (i.e., the calculated CRC code matches the stored CRC code), it indicates that the data in the data block is complete and has not been modified or damaged. Therefore, the system registers the data block as a valid storage data block, which means that the storage data block can be used to store new data or as a source for reading data. If the CRC check of the data block fails (i.e., the calculated CRC code does not match the stored CRC code), it indicates that the data in the data block may have been modified, damaged, or there are other problems. Therefore, the system registers the data block as an invalid storage data block and avoids using it to store or read data.
[0073] Through this process, the system can effectively screen and manage the storage data blocks in the EEPROM before starting to store new data. This helps ensure that only complete and reliable data blocks are used to store data, thereby improving the reliability and security of data storage.
[0074] In some embodiments, after the step S105, the following steps are further included:
[0075] Performing a CRC check on the second stored data block;
[0076] If the second storage data block fails the CRC check, the single storage information is stored in the second storage data block again.
[0077] Specifically, after storing the single storage information in the second storage data block, the system immediately performs a CRC check on the data block, which is to verify whether the data is correctly stored during the writing process and whether the stored data remains intact. If the CRC check of the second storage data block fails, it means that an error occurred during the writing process, causing the data to be damaged or modified, and the system needs to take measures to ensure the integrity of the data. The system will re-store the single storage information to the second storage data block and try to write the data to the same data block again. Before re-writing, the system will first clear or erase the old data in the data block to avoid any potential conflicts or interference. If the data block still fails to pass the CRC check after re-writing, the system will try to write the data to another valid storage data block in the EEPROM. At the same time, the system will record an error log for subsequent analysis of the cause of the problem and taking appropriate corrective measures.
[0078] The rewrite process adds time and complexity to data write operations because it requires a CRC check to be performed after each write. However, given the importance of data integrity and reliability, this overhead is usually worth it. Through the rewrite process, the system can ensure that the data remains intact and reliable after being written to the EEPROM, thereby improving the quality of data storage.
[0079] In some embodiments, the EEPROM data storage method further comprises:
[0080] receiving a data read request, and locating a target storage data block according to the data read request;
[0081] Performing CRC check on the target storage data block;
[0082] If the target storage data block fails the CRC check, the target storage data block is registered as an invalid data block;
[0083] If the target storage data block passes the CRC check, data is read from the target storage data block.
[0084] Specifically, the system receives a data read request from the outside or inside, and the data read request includes an identifier or address of the data to be read. The system uses the information provided in the request to locate the target storage data block in the EEPROM storing the required data, and can determine the location of the data block by looking up the data structure (such as an index table or directory) in the EEPROM. Before reading data from the target storage data block, the system performs a CRC check on the data block to verify whether the data in the data block remains intact during storage and whether it has not been accidentally modified. If the CRC check of the target storage data block fails, it means that the data in the data block may be damaged or unreadable. In this case, the system registers the data block as an invalid data block and avoids reading data from the data block. If the CRC check of the target storage data block succeeds, it means that the data in the data block is complete and can be read safely. The system reads the data from the data block and provides it to the requester.
[0085] By performing CRC check before data is read, bad block data is avoided, ensuring the reliability and integrity of the data read from the EEPROM. Through CRC check, the system can detect any potential data corruption or errors and take appropriate measures to ensure data availability. This is especially important for applications that require high data integrity and reliability, such as embedded systems, medical equipment, automotive control systems, etc.
[0086] Figure 2 A schematic diagram of the structure of an EEPROM data storage device provided in an embodiment of the present application, wherein the EEPROM data storage device comprises:
[0087] The first acquisition module 201 is used to acquire the single storage information to be stored and locate the storage space corresponding to the single storage information;
[0088] The second acquisition module 202 is used to acquire the first storage data block where the single storage information was last stored;
[0089] A first judgment module 203 is used to judge that if the first storage data block is not the last storage data block of the storage space, then use the next storage data block of the first storage data block as the second storage data block;
[0090] A second determination module 204, configured to determine if the first storage data block is the last storage data block of the storage space, and then use the first data block of the storage space as the second storage data block;
[0091] The data storage module 205 is used to store the single storage information into the second storage data block.
[0092] The specific implementation of the EEPROM data storage device is substantially the same as the specific implementation of the EEPROM data storage method described above, and will not be described in detail herein.
[0093] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above EEPROM data storage method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0094] See also Figure 3 , Figure 3 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0095] The processor 301 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0096] The memory 302 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 302 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 302, and the processor 301 calls and executes the EEPROM data storage method of the embodiment of this application;
[0097] Input / output interface 303, used to implement information input and output;
[0098] The communication interface 304 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0099] A bus 305 that transmits information between the various components of the device (e.g., the processor 301, the memory 302, the input / output interface 303, and the communication interface 304);
[0100] The processor 301 , the memory 302 , the input / output interface 303 and the communication interface 304 are connected to each other in communication within the device via the bus 305 .
[0101] An embodiment of the present application further provides a vehicle, comprising the above-mentioned EEPROM data storage device or the above-mentioned electronic device.
[0102] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned EEPROM data storage method when executed by a processor.
[0103] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0104] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0105] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0107] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0108] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0109] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0110] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0111] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0113] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.
Claims
1. An EEPROM data storage method, characterized in that: The method comprises: Acquire single storage information to be stored, and locate the storage space corresponding to the single storage information; Acquire the first storage data block where the single storage information was last stored; If the first storage data block is not the last storage data block of the storage space, taking the next storage data block of the first storage data block as the second storage data block; If the first storage data block is the last storage data block of the storage space, the first data block of the storage space is used as the second storage data block; The single storage information is stored in the second storage data block.
2. The EEPROM data storage method according to claim 1, characterized in that: The step of using the next storage data block of the first storage data block as the second storage data block if the first storage data block is not the last storage data block of the storage space specifically includes: If the first storage data block is not the last valid storage data block in the storage space, the next valid storage data block of the first storage data block is used as the second storage data block.
3. The EEPROM data storage method according to claim 1, characterized in that: The step of using the first data block of the storage space as the second storage data block if the first storage data block is the last storage data block of the storage space specifically includes: If the first storage data block is the last valid storage data block in the storage space, the first valid data block in the storage space is used as the second storage data block.
4. The EEPROM data storage method according to claim 1, characterized in that: Before the step of obtaining the single storage information to be stored and locating the storage space corresponding to the single storage information, the method further includes: Performing CRC check on the storage data block in the EEPROM; If the storage data block passes the CRC check, the storage data block is registered as a valid storage data block; If the storage data block fails the CRC check, the storage data block is registered as an invalid storage data block.
5. The EEPROM data storage method according to claim 1, characterized in that: After the step of storing the single storage information in the second storage data block, the method further includes: Performing a CRC check on the second stored data block; If the second storage data block fails the CRC check, the single storage information is stored in the second storage data block again.
6. The EEPROM data storage method according to claim 1, characterized in that: The EEPROM data storage method also includes: receiving a data read request, and locating a target storage data block according to the data read request; Performing CRC check on the target storage data block; If the target storage data block fails the CRC check, the target storage data block is registered as an invalid data block; If the target storage data block passes the CRC check, data is read from the target storage data block.
7. An EEPROM data storage device, characterized in that: The device comprises: A first acquisition module, used to acquire single storage information to be stored, and locate the storage space corresponding to the single storage information; A second acquisition module, used to acquire the first storage data block where the single storage information was last stored; a first judging module, configured to judge that if the first storage data block is not the last storage data block of the storage space, then use the next storage data block of the first storage data block as the second storage data block; a second determination module, configured to determine if the first storage data block is the last storage data block of the storage space, and then use the first data block of the storage space as the second storage data block; A data storage module is used to store the single storage information into the second storage data block.
8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the EEPROM data storage method according to any one of claims 1 to 6 when executing the computer program.
9. A vehicle, characterized in that: The vehicle comprises the EEPROM data storage device of claim 7 or the electronic device of claim 8.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the EEPROM data storage method according to any one of claims 1 to 6 is implemented.