Write-in storage method and device for incremental data, equipment and storage medium
By splitting the total dynamic data value to high and low values, and using the position-by-position zero characteristics of Flash flash memory to update the storage value, the problem of high rewritten frequency of frequently changing data on storage media in IoT terminals is solved, and the service life of the storage media is extended and the risk of data loss is reduced.
Patent Information
- Application Number
- CN202411694023.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-25
AI Technical Summary
In IoT terminals, frequently changing data (such as vehicle mileage and fuel consumption) have high rewritten frequency on storage media, resulting in a shortening of the service life of storage media. In the prior art, when reducing the write frequency by setting a trigger threshold, there is a risk of data loss.
By obtaining the total value of dynamic data, splitting it into high and low values, and updating the storage value based on these values, the position-by-position zero characteristic of Flash memory is used to reduce the number of erases and extend the service life of the storage medium.
It effectively reduces the erase frequency of storage media, improves the service life of storage media, and reduces the risk of data loss.
Smart Images

Figure CN119883106A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of storage, and in particular to a method, device, equipment and storage medium for writing and storing incremental data. Background Art
[0002] In IoT terminal applications, it is often necessary to store some frequently changing data, such as vehicle mileage and fuel consumption. Storage media are required to store this type of data. Considering the limited service life of storage media, erasing storage media will reduce the life of the corresponding storage media. If there is no appropriate measure, the storage media will be worn out very quickly. Taking the vehicle mileage as an example, assuming that the accuracy of each write is 0.01 kilometers, and the maximum driving distance to be considered in the entire vehicle life cycle is 1 million kilometers, if data is written once every 10 meters, the total number of writes will be as high as 100 million times. If such a large amount of writes is not handled by appropriate technical means, it is difficult to achieve reliable read and write operations on the current small-capacity bare storage media that does not use a file system, which may lead to data mutation problems caused by storage unit failure.
[0003] In order to solve the above problems, the current method is to reduce the frequency of data writing by setting trigger thresholds such as time intervals or accumulated mileage, and then writing data after the trigger conditions are met. However, if the trigger threshold is set too small, although it can alleviate the pressure caused by frequent writing to a certain extent, its effect is still limited; on the contrary, if the threshold is too large, there is a risk that an abnormal situation (such as system crash) occurs before the predetermined writing condition is reached, and the data temporarily stored in the RAM may be lost, resulting in a significant regression in the recorded mileage.
[0004] It can be seen that the reasonable selection and optimization of data writing strategy is crucial to ensure long-term stable operation. Therefore, how to optimize the strategy of writing continuously increasing and frequently changing data into storage media to improve the service life of storage media is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In order to overcome the deficiencies of the prior art, the present application provides a method, device, equipment and storage medium for writing incremental data, which can optimize the strategy of writing continuously incremental and frequently changing data into the storage medium, thereby achieving the effect of increasing the service life of the storage medium.
[0006] The technical solution adopted by this application to solve its technical problem is: In a first aspect, the present application provides a method for writing and storing incremental data, the method comprising: Get the total value of dynamic data; Determine the high-order value and the low-order value of the current dynamic data according to the total value of the dynamic data and the preset number of bits, and update the currently stored high-order storage value based on the high-order value; Performing a modulo calculation on the high-order value based on a preset number of pages to determine a current low-order storage page; A bitwise zeroing is performed in the low-order storage page according to the low-order value to update the currently stored low-order storage value.
[0007] Optionally, the step of determining the high value and the low value of the current dynamic data according to the total value of the dynamic data and the preset number of bits includes: Based on the preset number of bits, performing rounding calculation on the total value of the dynamic data to obtain the high-order value; Based on the preset number of bits, a modulo calculation is performed on the total value of the dynamic data to obtain the low-order value.
[0008] Optionally, the step of updating the currently stored high-order storage value based on the high-order value includes: Reading the high-order storage value; Determine whether the high-order value of the current dynamic data is consistent with the high-order storage value, and if not, write the high-order value of the current dynamic data to update the currently stored high-order storage value; Otherwise, the high-order storage value is retained.
[0009] Optionally, the method further includes: Obtain a total value reading instruction, and read the high-order storage value based on the total value reading instruction; Based on the preset number of pages, performing a modulo calculation on the high-order storage value to determine a low-order storage page of the current dynamic data; Reading the low-order storage page to determine a currently stored low-order storage value; Based on the lower storage value and the higher storage value, a current total value of dynamic data is determined.
[0010] Optionally, in the step of determining the current total value of dynamic data based on the low-order storage value and the high-order storage value, the formula used is: .
[0011] Optionally, the step of reading the low-order storage page to determine a currently stored low-order storage value includes: Reading the low-order storage page to obtain storage page data of the low-order storage page; The number of zero-bits in the storage page data is counted, and the number of zero-bits is used as the low-order storage value.
[0012] Optionally, the step of performing position zeroing according to the low-order value in the offset page to update the currently stored low-order storage value includes: Determine whether the current pointer returns to the starting page, the pointer is used to track the currently written low-order storage page, and the starting page is the starting low-order storage page; If the pointer returns to the start page, the storage sector corresponding to the low-order storage page is erased.
[0013] In a second aspect, the present application provides a storage device for writing incremental data, comprising: A dynamic data total value acquisition module is used to acquire the dynamic data total value; A high and low value determination module, used to determine the high value and low value of the current dynamic data according to the total value of the dynamic data and the preset number of bits, and update the currently stored high value based on the high value; A low-order storage page determination module, configured to perform a modulo calculation on the high-order value based on a preset number of pages to determine a current low-order storage page; The low-order value writing module is used to perform position zeroing in the low-order storage page according to the low-order value to update the currently stored low-order storage value.
[0014] In a third aspect, the present application provides an electronic device, including: one or more processors; one or more memories; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the electronic device to perform the above-mentioned method.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium, in which a program or instruction is stored. When the program or instruction is executed, the above method is implemented.
[0016] The beneficial effects of the present application are as follows: the present application splits the total value of dynamic data (for example, the total value of dynamic data corresponding to fuel consumption is the total fuel consumption, and the total value of dynamic data corresponding to vehicle mileage is the total mileage) into a high value and a low value, and the high value and the low value are calculated based on the total value of dynamic data and the preset number of bits, respectively; after storing the current high value, the page offset of the current dynamic data low value storage is determined based on the high value and the preset number of pages, that is, the low storage page is found; based on the characteristic that Flash memory can be zeroed (that is, a certain bit is changed from 1 to 0 individually), the number of bits that need to be set to zero can be determined according to the low value, and the position of the corresponding number of bits in the low storage page is set to zero based on the number of bits set to zero, thereby updating the low storage value.
[0017] Furthermore, when the total value of dynamic data needs to be read later, the reading can be completed based on the low-order storage value and the high-order storage value, and in the process of storing the total value of dynamic data, the characteristics of Flash memory are used, and only when the entire stored sector is reset to zero, it needs to be erased, thereby greatly reducing the number of erasures. If it is a conventional write, each rewrite requires an erase, and each erase will cause a loss in the service life of the storage medium. Obviously, the present application significantly improves the service life of the storage medium compared to conventional technology.
[0018] In summary, the present application provides a strategy for optimizing the writing of continuously increasing and frequently changing data into a storage medium, thereby reducing the frequency of erasing the medium and achieving the beneficial effect of increasing the service life of the storage medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of the flow of the method for writing and storing incremental data provided in an embodiment of the present application; Figure 2 It is a data reading method provided by an embodiment of the present application for storing the data writing storage method of the present application for incremental data; Figure 3 It is a virtual structural diagram of a storage device for writing incremental data provided by the present application; Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The present application is further described below in conjunction with the accompanying drawings and embodiments.
[0021] The following will clearly and completely describe the concept, specific structure and technical effects of the present application in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of them. Based on the embodiments of the present application, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present application. In addition, all the connection / connection relationships involved in the patent do not simply refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features created in this application can be combined interactively without conflicting with each other.
[0022] Reference Figure 1 , Figure 1 : is a flow chart of a method for writing and storing incremental data provided in an embodiment of the present application, which specifically includes the following steps, which are described in detail below: In step S11, the total value of dynamic data is obtained.
[0023] Specifically, dynamic data refers to data that continuously increases and frequently changes, such as fuel consumption and vehicle mileage. The total value of dynamic data refers to the total value of the dynamic data at the current acquisition time. If the dynamic data is fuel consumption, the total value of the dynamic data is the total fuel consumption; if the dynamic data is vehicle mileage, the total value of dynamic data is the total mileage, and the same applies to other dynamic data. There is no limitation on this application due to the type of dynamic data.
[0024] In step S12, the high-order value and the low-order value of the current dynamic data are determined according to the total value of the dynamic data and the preset number of bits, and the currently stored high-order storage value is updated based on the high-order value.
[0025] Specifically, the preset number of bits is preset by relevant personnel according to actual conditions. In the embodiment of the present application, taking the writing of vehicle mileage as an example, a 4KByte storage space can be used for storage, which includes 16 pages, each page has 256 bytes, each byte is 8 bits, that is, the preset number of bits is 8*256=2048 bits, and the total mileage is rounded and remaindered according to the preset number of bits, so that the total mileage can be split into high value and low value.
[0026] More specifically, the step of determining the high value and the low value of the current dynamic data according to the total value of the dynamic data and the preset number of bits includes: Based on the preset number of bits, a rounding calculation is performed on the total value of the dynamic data to obtain the high-order value.
[0027] Specifically, assuming that the current total mileage is 10000 and the preset number of bits is 2048, the calculated high-order value = 10000 / / 2048=4 (rounded), so the current high-order value is 4.
[0028] More specifically, it is necessary to update the currently stored high-order storage value based on the high-order value to complete the storage of the current high-order value. Specifically: Reading the high-order storage value; Determine whether the high-order value of the current dynamic data is consistent with the high-order storage value, and if not, write the high-order value of the current dynamic data to update the currently stored high-order storage value; Otherwise, the high-order storage value is retained.
[0029] Specifically, the current storage sector stores the high-order value stored last time (if it is the first time to record, the initial high-order value is 0), and the high-order value stored in the sector is defined as the high-order storage value. The high-order value obtained through the above steps needs to be compared with the current high-order storage value. If the two are inconsistent, the new high-order value is written into the high-order storage value to replace and update, and the storage of the current high-order value is completed; if the two are consistent, the current stored high-order value is retained without repeated writing.
[0030] Furthermore, it is also necessary to perform a modulo calculation on the total value of the dynamic data based on the preset number of bits to obtain the low-order value.
[0031] Specifically, corresponding to the above high-order value, assuming that the current total mileage is 10000 and the preset number of bits is 2048, the calculated low-order value = 10000%2048=1808 (remainder), that is, the low-order value is 1808. The obtained low-order value is used to subsequently set the corresponding number of zeros in the located low-order storage page. For details, please refer to the following steps to update the low-order storage value.
[0032] In step S13, a modulo calculation is performed on the high-order value based on a preset number of pages to determine the current low-order storage page.
[0033] Specifically, the preset number of pages is preset by relevant personnel based on actual needs. In the embodiment of the present application, a 4KByte storage space is used to implement this solution. The 4KByte storage sector has 16 pages, each page has 256 bytes, that is, the preset number of pages is 16. The modulus calculation is performed on the high-order value based on the preset number of pages. From the above steps, it can be seen that the high-order value calculated in the embodiment of the present application is 4, so the modulus calculation can be expressed as the page offset of the low-order storage page = 4%16=4 (modulus), that is, the low-order storage page is page 4, that is, the 4th page in 16 pages. The low-order storage page is used to store the current low-order storage value. When the currently stored low-order value is read subsequently, it is necessary to read according to the data of the corresponding low-order storage page.
[0034] In step S14, bit-by-bit zeroing is performed in the lower-bit storage page according to the lower-bit value to update the currently stored lower-bit storage value.
[0035] Specifically, after determining the page offset in the above steps, the corresponding low-order storage page can be located, and then the position is zeroed in the low-order storage page according to the value of the low-order value. For example, the embodiment based on the above steps has determined the low-order storage page (i.e., page 4) currently used to store the low-order value and the current low-order value (i.e., 1808). Therefore, in this step, bits 0-1807 (a total of 1808 bits) of page 4 in this sector are set from 1 to 0, thereby completing the update of the low-order storage page. According to the number of bits of "0" in the current low-order storage page, the currently stored low-order storage value can be determined.
[0036] Through the above steps, the storage of the total value of the dynamic data currently obtained can be completed. The stored data can be read through the following steps. Please refer to Figure 2 , Figure 2 The data reading method provided in the embodiment of the present application for storing the incremental data writing storage method of the present application specifically includes the following steps: In step S21, a total value read instruction is obtained, and the high-order storage value is read based on the total value read instruction.
[0037] Specifically, the total value reading instruction can be automatically issued according to preset conditions, or it can be actively obtained by relevant personnel. For example, for vehicle mileage, the total value reading instruction can be automatically issued when the vehicle is started. Based on this instruction, the storage area used to store high-order values is first read to obtain the current high-order storage value.
[0038] In step S22, based on the preset number of pages, a modulo calculation is performed on the high-order storage value to determine the low-order storage page of the current dynamic data.
[0039] Specifically, the high-order storage value is regionally calculated based on the preset number of pages. For example, in combination with the embodiments provided by the above-mentioned storage steps S11 to S14, it is known that the preset number of pages is 16, and the current high-order storage value is 4. Therefore, the low-order storage page determined in this step is 4%16=4 (remainder), that is, the number of pages currently storing the low-order storage value is determined, that is, the 4th page of the 16 pages of the sector.
[0040] In step S23, the lower storage page is read to determine the currently stored lower storage value.
[0041] Specifically, data is read from the determined low-order storage page, and a currently stored low-order storage value is determined based on the read data, which specifically includes the following steps: The lower storage page is read to obtain storage page data of the lower storage page.
[0042] Specifically, data is read from the low-order storage page. In the embodiment of the present application, page 4 is read to obtain storage page data in page 4. The storage page data includes the value of each bit in the page, that is, "0" or "1".
[0043] Furthermore, the number of zero-bits in the storage page data is counted, and the number of zero-bits is used as the low-order storage value.
[0044] Specifically, the bitCount method can be used to count all the zero-set bits (that is, the number of "0" bits) in the obtained storage page data, wherein the bitCount method is to count the number of 1s contained in the integer in binary form through bit operations, and based on the total number of bits (2048 in the embodiment of the present application) and the number of "1"s contained, the number of "0" bits contained can be counted. In the embodiment of the present application, the low-order storage value obtained in this step is 1808.
[0045] In step S24, the current total value of dynamic data is determined based on the lower storage value and the upper storage value.
[0046] Specifically, based on the high-order storage value and the low-order storage value read above, combined with the above-mentioned preset number of bits, the current total value of dynamic data can be determined. Specifically, the total value of dynamic data can be determined using the following formula: .
[0047] In the embodiment of the present application, the total value of dynamic data is the total mileage, the high-order storage value is 4, the preset number of bits is 2048, and the low-order storage value is 1808, that is, .
[0048] More specifically, in the step of updating the currently stored low-order storage value, there may be a situation where all bits of all pages in the storage sector are set to zero (that is, all pages used to write the low-order storage value have been used up). In this case, the entire sector needs to be erased before writing. Specifically: Determine whether the current pointer returns to the starting page, the pointer is used to track the currently written low-order storage page, and the starting page is the starting low-order storage page; Specifically, in the above steps, a pointer or other method is required to record which corresponding low-order storage page the current low-order storage value is stored in. When the page pointed to by the pointer scrolls to zero, it means that the currently written low-order storage page has reached the starting position of the storage of the sector, that is, all the bits in the entire sector have been set to zero. For example, the storage sector used in the embodiment of the present application has a total of 16 pages. When the pointer scrolls back from page 16 to page 1 (page 0), it means that the sector is full. This judgment can be used to determine whether the sector needs to be erased.
[0049] Furthermore, if the pointer returns to the start page, the storage sector corresponding to the low-order storage page is erased.
[0050] Specifically, if the pointer returns to the starting page, the entire storage sector is erased. Since the flash is erased in units of storage sectors, erasure is also the time when the corresponding flash is worn. Based on this, it can be seen that compared with the conventional solution in which each time new data is written, it is necessary to erase and then write again. This application proposes recording dynamic data by position zero, which significantly reduces the erasure frequency, while also maintaining a certain frequency of recording.
[0051] For example, assuming that each bit in the storage area represents 0.01km, and a 4KByte storage space is used, because the written content is written from 1 to 0 bit by bit, only erasing the entire sector will cause a write life loss. The mileage experienced by the entire sector when it is fully written once is: the total number of bits in the storage sector = 2048×16=32768 bits, and the corresponding total mileage that can be recorded is 32768×0.01km=327.68km. It can be seen that if the conventional method is used to enter 327.68km of mileage data in units of 0.01km, the sector needs to be erased up to 32768 times, while the technical solution provided by this application only needs to be erased once, which obviously reduces the frequency of erasing and achieves the same recording effect.
[0052] More specifically, the incremental data writing and storage method provided by the present application has a reliable fault-tolerant mechanism. Since the damage mechanism of Flash is that it cannot be erased due to time aging, that is, it cannot be returned from "0" to "1", this does not affect the normal writing of other bits and the reading of all bits. Also, because the present application adopts a bit-by-bit storage method, when an error occurs in a certain bit and it cannot be erased, an error of 0.01 km will only occur when the number of written bits corresponding to the low-order storage value is just the bit before the failed bit, and the terminal happens to read the low-order mileage. The probability of this error occurring is extremely low, and the error is also within the acceptable error range, and will not affect the subsequent entry of other bits. Based on this, it can be seen that the incremental data writing and storage method provided by the present application has an extremely high fault tolerance rate.
[0053] In a second aspect, the present application provides a storage device for writing incremental data, referring to Figure 3 , Figure 3 It is a virtual structural diagram of the incremental data writing storage device provided by the present application, including: The dynamic data total value acquisition module 100 is used to acquire the dynamic data total value; A high and low bit value determination module 200, for determining a high bit value and a low bit value of current dynamic data according to the total value of the dynamic data and a preset number of bits, and updating a currently stored high bit value based on the high bit value; A low-order storage page determination module 300 is used to perform a modulo calculation on the high-order value based on a preset number of pages to determine a current low-order storage page; The low-order value writing module 400 is used to perform position-by-position zeroing in the low-order storage page according to the low-order value to update the currently stored low-order storage value.
[0054] The incremental data writing and storage device described in the embodiment of the present application can execute the incremental data writing and storage method provided in the above embodiment. The incremental data writing and storage device has the corresponding functional steps and beneficial effects of the incremental data writing and storage method described in the above embodiment. Please refer to the embodiment of the incremental data writing and storage method for details. The embodiment of the present application will not be repeated here.
[0055] The present application also provides an electronic device. Figure 4 , Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include a processor and a memory, wherein the processor and the memory may be connected via a bus or other means. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned various types of chips. The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the write storage method of incremental data in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the write storage method of incremental data in the above-mentioned method embodiment is realized.
[0056] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by a processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. The one or more modules are stored in the memory, and when executed by the processor, the write storage method of incremental data in the above method embodiment is executed. The specific details of the above electronic device can be understood by corresponding to the corresponding descriptions and effects in the above method embodiment, and will not be repeated here. Those skilled in the art can understand that all or part of the processes in the above embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program, when executed, may include the processes of the embodiments of the above methods. Among them, the storage medium can be a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0057] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0058] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims, the inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present application.
[0059] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims.
Claims
1. A method for writing and storing incremental data, characterized in that: The method comprises: Get the total value of dynamic data; Determine the high-order value and the low-order value of the current dynamic data according to the total value of the dynamic data and the preset number of bits, and update the currently stored high-order storage value based on the high-order value; Performing a modulo calculation on the high-order value based on a preset number of pages to determine a current low-order storage page; A bitwise zeroing is performed in the low-order storage page according to the low-order value to update the currently stored low-order storage value.
2. The method for writing and storing incremental data according to claim 1, characterized in that: The step of determining the high value and the low value of the current dynamic data according to the total value of the dynamic data and the preset number of bits comprises: Based on the preset number of bits, performing rounding calculation on the total value of the dynamic data to obtain the high-order value; Based on the preset number of bits, a modulo calculation is performed on the total value of the dynamic data to obtain the low-order value.
3. The method for writing and storing incremental data according to claim 1, characterized in that: The step of updating the currently stored high-order storage value based on the high-order value comprises: Reading the high-order storage value; Determine whether the high-order value of the current dynamic data is consistent with the high-order storage value, and if not, write the high-order value of the current dynamic data to update the currently stored high-order storage value; Otherwise, the high-order storage value is retained.
4. The method for writing and storing incremental data according to claim 1, characterized in that: The method further comprises: Obtain a total value reading instruction, and read the high-order storage value based on the total value reading instruction; Based on the preset number of pages, performing a modulo calculation on the high-order storage value to determine a low-order storage page of the current dynamic data; Reading the low-order storage page to determine a currently stored low-order storage value; Based on the lower storage value and the higher storage value, a current total value of dynamic data is determined.
5. The method for writing and storing incremental data according to claim 4, characterized in that: In the step of determining the current total value of dynamic data based on the low-order storage value and the high-order storage value, the formula used is: 。 6. The method for writing and storing incremental data according to claim 4, characterized in that: The step of reading the lower storage page to determine the currently stored lower storage value comprises: Reading the low-order storage page to obtain storage page data of the low-order storage page; The number of zero-bits in the storage page data is counted, and the number of zero-bits is used as the low-order storage value.
7. The method for writing and storing incremental data according to claim 1, characterized in that: The step of performing position zeroing according to the low-order value in the offset page to update the currently stored low-order storage value comprises: Determine whether the current pointer returns to the starting page, the pointer is used to track the currently written low-order storage page, and the starting page is the starting low-order storage page; If the pointer returns to the start page, the storage sector corresponding to the low-order storage page is erased.
8. A storage device for writing incremental data, characterized in that: include: A dynamic data total value acquisition module is used to acquire the dynamic data total value; A high and low value determination module, used to determine the high value and low value of the current dynamic data according to the total value of the dynamic data and the preset number of bits, and update the currently stored high value based on the high value; A low-order storage page determination module, configured to perform a modulo calculation on the high-order value based on a preset number of pages to determine a current low-order storage page; The low-order value writing module is used to perform position zeroing in the low-order storage page according to the low-order value to update the currently stored low-order storage value.
9. An electronic device, characterized in that: include: one or more processors; one or more memories; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions, which, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a program or an instruction, and when the program or the instruction is executed, the method according to any one of claims 1 to 7 is implemented.