Method and device for equipment data storage, equipment and storage medium

By adopting dual storage backup mechanism and data mirroring processing methods in smart devices, the problem of data storage stability and effectiveness of equipment without file system is solved, and efficient and reliable data storage is achieved.

CN119597212APending Publication Date: 2025-03-11QINGDAO HAIER TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411584171.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the prior art, when a platform without a file system is stored in a smart device, data stability and effectiveness are difficult to guarantee, especially when there is a problem with the basic data storage of the device, the device cannot work normally.

Method used

By periodically detecting the update status of memory data, when determining that the memory data is updated in the current task cycle, the memory data and its integrity verification code are stored in two areas of the ergonomic flash memory, using a dual storage backup mechanism, and a set type data image is mirrored into the memory when the device is started.

Benefits of technology

It realizes the effectiveness and stability of data storage, ensures that there is always a version of data available during the data writing process, and ensures the integrity and correctness of data during reading, improving the stability and ease of use of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597212A_ABST
    Figure CN119597212A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent equipment, and discloses an equipment data storage method and device, equipment and a storage medium. The method comprises the steps that under the condition that it is determined that memory data in a current task period is updated, integrity check is conducted on the memory data, and an integrity check code is obtained; storing the memory data and the integrity check code in a first area of the erasable flash memory in sequence; and storing the memory data and the integrity check code in a second area of the erasable flash memory in sequence. Thus, a dual-storage backup mechanism is selected for the memory data, it is guaranteed that one version of data is available all the time in the data writing process, the validity of data storage is improved, the data are stored after being subjected to overall verification, it is guaranteed that the data are completely and correctly read and loaded into the system, and the data storage efficiency is improved. And the stability and integrity of data storage are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart device technology, for example, to methods, devices, equipment and storage media for device data storage. Background Art

[0002] With the vigorous development of Internet of Things technology, more and more devices are becoming intelligent. To build a universal Internet of Things platform, in addition to considering enabling Internet of Things capabilities to platforms with file systems, we must also consider platforms that do not have file system capabilities.

[0003] At present, there are many types of smart devices, covering a wide range of fields. Platforms without file systems occupy a large number of device varieties. Therefore, when designing an IoT platform, platforms without file systems become a scenario that must be considered. Devices without file systems need to store various types of data in erasable flash memory (Flash). In the process of storing data in Flash, it is necessary to ensure that the access data is not affected by other factors as much as possible, and the data read out can always be read to ensure that the data is valid, especially the basic storage data of the device. Once there is a problem, the entire device cannot work properly. The validity of the data read from Flash must also be ensured to avoid the data being damaged. Therefore, the stability and effectiveness of data storage must be improved.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] The embodiments of the present disclosure provide a method, an apparatus, a device and a storage medium for device data storage to solve the technical problem that the stability and effectiveness of data storage need to be improved.

[0007] In some embodiments, the method comprises:

[0008] When it is determined that the memory data is updated in the current task cycle, the memory data is checked for integrity to obtain an integrity check code;

[0009] The memory data and the integrity check code are stored in the first area of ​​the erasable flash memory in sequence;

[0010] The memory data and the integrity check code are stored in the second area of ​​the erasable flash memory in sequence.

[0011] In this way, a dual storage backup mechanism can be selected for memory data to ensure that during the data writing process, there is always a version of the data available, which improves the effectiveness of data storage. In addition, the data is verified as a whole before storage to ensure that the data is read and loaded into the system is complete and correct, further improving the stability and integrity of data storage.

[0012] In some embodiments, it also includes:

[0013] When the device is started, the set type data image is stored in the memory to obtain the memory data.

[0014] In this way, only the set type data will become the memory data of the dual storage backup, and the data update operation is completed in the memory, which can prevent frequent operations on the Flash, take into account data reliability, memory capacity, and data processing speed, and improve the stability and ease of use of the device.

[0015] In some embodiments, determining whether memory data is updated in the current task cycle includes:

[0016] When it is determined that the memory data is updated during the operation of the device, an update mark is performed;

[0017] When it is determined that the running state corresponding to the low priority task is met, if an update mark corresponding to the current task cycle is detected, it is determined that the memory data is updated in the current task cycle.

[0018] It can be seen that by using a low-priority independent task to periodically detect the update flag, frequent operations on the Flash caused by writing once for each update can be avoided. In addition, using a low-priority task for update detection can avoid Flash operations interfering with normal business processes. Flash operations are only performed when the processor CPU is idle, further improving device performance.

[0019] In some embodiments, determining whether memory data is updated during operation of the device includes:

[0020] In the case where the current running data is data to be stored, if the current running data is set type data, the data to be stored is stored in the memory, and it is determined that the memory data is updated;

[0021] In a case where the current operation data deleted from the memory data is set type data, it is determined that the memory data is updated.

[0022] In this way, the update of the memory data corresponds to the update of the set type data, which can further improve the speed and efficiency of data processing.

[0023] In some embodiments, it also includes:

[0024] In the case where the current running data is the data to be stored, if the current running data is not the set type data, the data to be stored is stored in the third area of ​​the erasable flash memory.

[0025] Flash operates in blocks, so different types of data can be stored in different area blocks of Flash, which facilitates data management and application.

[0026] In some embodiments, it also includes:

[0027] The erasable flash memory is divided into a plurality of functional data storage areas, wherein the first functional data storage area includes a first area and a second area.

[0028] Therefore, different functional data can be stored in different storage areas according to the functional type of the data, ensuring the stability and efficiency of Flash block operations.

[0029] In some embodiments, the device for storing device data comprises:

[0030] The verification module is configured to perform integrity verification on the memory data to obtain an integrity verification code when determining that the memory data is updated in the current task cycle;

[0031] A first storage module is configured to store the memory data and the integrity check code in a first area of ​​the erasable flash memory;

[0032] The second storage module is configured to store the memory data and the integrity check code in a row in the second area of ​​the erasable flash memory.

[0033] In some embodiments, the apparatus for device data storage includes a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for device data storage when executing the program instructions.

[0034] In some embodiments, the device includes a device body; the above-mentioned device for storing device data is installed in the device body, wherein an energy consumption measuring device is configured in the refrigerator.

[0035] In some embodiments, the storage medium stores program instructions, and when the program instructions are run, the method for device data storage is executed.

[0036] The method, apparatus and device for device data storage provided by the embodiments of the present disclosure can achieve the following technical effects:

[0037] The update status of memory data is checked periodically. When it is determined that the memory data is updated in the current task cycle, the memory data and the corresponding integrity check code can be stored in two areas of the Flash respectively. That is, a dual storage backup mechanism is selected for the memory data to ensure that there is always one version of the data available during the data writing process, thereby improving the effectiveness of data storage. In addition, the data is checked as a whole before being stored to ensure that the data read and loaded into the system is complete and correct, further improving the stability and integrity of data storage.

[0038] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:

[0040] Figure 1 is a structural diagram of a device data storage system provided by an embodiment of the present disclosure;

[0041] Figure 2 It is a flowchart of a method for storing device data provided by an embodiment of the present disclosure;

[0042] Figure 3 It is a flowchart of a method for storing device data provided by an embodiment of the present disclosure;

[0043] Figure 4 is a structural schematic diagram of a device for storing data in a device provided by an embodiment of the present disclosure;

[0044] Figure 5 is a structural schematic diagram of a device for storing data in a device provided by an embodiment of the present disclosure;

[0045] Figure 6 is a structural schematic diagram of a device for storing data in a device provided by an embodiment of the present disclosure;

[0046] Figure 7 It is a schematic diagram of a device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0047] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0048] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure 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 terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0049] Unless otherwise stated, the term "plurality" means two or more.

[0050] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0051] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0052] Some smart devices do not have a file system, and all kinds of data need to be stored in an erasable flash memory (Flash). In the disclosed embodiment, the update status of the memory data can be periodically detected. When it is determined that the memory data has been updated in the current task cycle, the memory data and the corresponding integrity check code can be stored in two areas of the Flash, respectively, that is, a dual storage backup mechanism is selected for the memory data to ensure that there is always a version of the data available during the data writing process, thereby improving the effectiveness of data storage. In addition, the data is checked as a whole before being stored to ensure that the data is read and loaded into the system is complete and correct, further improving the stability and integrity of data storage. In addition, by storing the image of the set type of data in the memory and periodically updating the memory data, frequent operations on the Flash caused by writing once for each update can be avoided, further improving the stability of the device.

[0053] Figure 1 Schematic diagram of an architecture for a device data storage system provided by an embodiment of the present disclosure. Figure 1As shown, the device data storage system may include: a processor CPU 100, an internal storage 200 and an external memory 300. The processor CPU 100 may access the internal storage 200 and the external memory 300 respectively, and read and write data to the internal storage 200 and the external memory 300 respectively.

[0054] Among them, the memory storage 200 is a memory, which is used to temporarily store the calculation data in the CPU and the data exchanged with the external memory. It is a bridge for the external memory 300 to communicate with the CPU 100. However, once the device is powered off, the written data on the memory will not be stored. The external memory 300 can save the written data after the device is powered off. Among them, the external memory 300 is an erasable flash memory Flash. Therefore, writing data into an external memory such as Flash is the only way to achieve device data storage.

[0055] In the disclosed embodiment, the update status of the memory data can be periodically detected. When it is determined that the memory data is updated in the current task cycle, the memory data and the corresponding integrity check code can be stored in two areas of the Flash respectively, thereby realizing double backup storage of the memory data and improving the effectiveness of data storage.

[0056] Figure 2 is a flow chart of a method for storing device data provided by an embodiment of the present disclosure, such as Figure 2 As shown, the process of device data storage includes:

[0057] Step 201: When it is determined that the memory data is updated in the current task cycle, an integrity check is performed on the memory data to obtain an integrity check code.

[0058] The memory can temporarily store the calculation data in the CPU and the data exchanged with the external memory. In addition, in the embodiment of the present disclosure, when the device starts, the setting type data image can be stored in the memory to obtain the memory data. Among them, the external memory can be a rewritable flash memory Flash, which can be divided into multiple functional data storage areas according to the type of stored data. For example, the type of stored data may include: device basic data, scene data, scene template data, multiple connected sub-machine information, etc. In this way, for each data type, a corresponding functional data storage area can be divided in Flash.

[0059] Taking into account both CPU processing performance and data integrity, when the device is started, only the setting type data image can be stored in the memory to obtain the memory data. According to the importance of the data, one, two or more data types can be determined as setting type data. For example, the basic data of the device may contain important information such as the SSID and password of the WiFi. Once the device is lost, it cannot be connected to the Internet. Therefore, the basic data of the device can be determined as the setting type data, or, according to the specific application of the device, the basic data of the device and the scene data can be determined as the setting type data, etc.

[0060] In this way, during the operation of the device, the memory data includes the set type data, and the memory data also includes the calculation data in the CPU, and other data exchanged with the external memory, etc.

[0061] The device can periodically monitor the update status of the memory data. If a periodic moment is reached, the update status of the memory data in the task cycle can be detected. At the periodic moment, the update status of the memory data in the current task cycle is detected. In some embodiments, determining that the memory data is updated in the current task cycle includes: when it is determined that the memory data is updated during the operation of the device, an update mark is made; when it is determined that the corresponding operation status of the low-priority task is met, if an update mark corresponding to the current task cycle is checked, it is determined that the memory data is updated in the current task cycle.

[0062] When the memory data is updated, only the update mark is performed. When the corresponding running status of the low-priority task is met, the update mark in the current task cycle will be checked and the Flash will be operated. In this way, it can not only avoid writing to the Flash once for each update and reduce the frequent operations on the Flash, but also the low-priority task can avoid data storage interfering with the normal business process of the device. The Flash operation can be performed when the CPU is idle, which improves the equipment operation efficiency and the service life of the Flash.

[0063] In some embodiments, determining whether memory data has been updated during device operation includes: when the current operating data is data to be stored, if the current operating data is set type data, storing the data to be stored in the memory, and determining that the memory data has been updated; when the current operating data deleted from the memory data is set type data, determining that the memory data has been updated.

[0064] Since the memory data includes not only the set type data, when the data to be stored is the set type data, when the data to be stored is stored in the memory, it can be determined that the memory data is updated. Alternatively, when some set type data is deleted from the memory data, it can also be determined that the memory data is updated.

[0065] In the disclosed embodiment, when it is determined that the memory data is updated in the current task cycle, an integrity check is performed on the memory data to obtain an integrity check code.

[0066] Data integrity verification is a technology that verifies data integrity. It calculates data through a specific algorithm to generate a check value, namely the integrity check code, to verify whether the data has been tampered with during transmission or storage. The integrity check code is usually a string of specific characters, which is compared with the original data. If they are the same, it means that the data has not been tampered with, otherwise the data integrity is destroyed. Common data integrity verification algorithms include MD5, SHA-1, SHA-256, etc.

[0067] Among them, the MD5 Message-Digest Algorithm, a widely used cryptographic hash function, can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission. Therefore, in some embodiments, the memory data can be checked for integrity and the corresponding MD5 value can be calculated.

[0068] Step 202: Store the memory data and the integrity check code in the first area of ​​the erasable flash memory.

[0069] Step 203: Store the memory data and the integrity check code in the second area of ​​the erasable flash memory.

[0070] Since the Flash is divided into multiple functional data storage areas, the first functional data storage area may correspond to the set type data, so the first functional data storage area includes the first area and the second area. Therefore, in some embodiments, the memory data may be first stored in the first area, and then the calculated integrity check code may be stored in the first area.

[0071] In the disclosed embodiment, a dual storage backup mechanism may be selected for important data, that is, the type of data is set to correspond to the dual storage backup mechanism. Therefore, the memory data needs to be stored in the second area, and the calculated integrity check code needs to be stored in the second area.

[0072] For example: the first function data storage area corresponding to the setting type data includes storage area A and storage area B. Since the memory data including the setting type data and its corresponding integrity check code need to be stored in storage area A and storage area B respectively, it can always be determined that there is a version of the setting type data available, and at worst the most recent data before the write failure can be read. For example, if the device loses power during the process of writing to storage area A, then storage area A becomes a bad area. Then, the data of storage area B will be mirrored in the memory when it is restarted and loaded next time. At this time, the data stored last time is read. Conversely, if the device loses power during the process of writing to storage area B, the data of storage area A, that is, the latest data, can be directly read at the next startup.

[0073] It can be seen that in the disclosed embodiment, the update status of the memory data can be periodically detected. When it is determined that the memory data is updated in the current task cycle, the memory data and the corresponding integrity check code can be stored in two areas of the Flash, that is, a dual storage backup mechanism is selected for the memory data to ensure that there is always a version of the data available during the data writing process, thereby improving the effectiveness of data storage. In addition, the data is checked as a whole before being stored to ensure that the data is read and loaded into the system in a complete and correct manner, thereby further improving the stability and integrity of the data storage. In addition, by storing the image of the set type of data in the memory and periodically updating the memory data, frequent operations on the Flash caused by writing once for each update can be avoided, thereby further improving the stability of the device.

[0074] Of course, in some embodiments, during the operation of the device, when the current operation data is the data to be stored, if the current operation data is not the set type data, the data to be stored is stored in the third area of ​​the erasable flash memory. Different types of data can be stored in different area blocks of the Flash, which is convenient for data management and application.

[0075] The operation flow is summarized into a specific embodiment below to illustrate the device data storage process provided by the embodiment of the present invention.

[0076] In one embodiment of the present disclosure, Figure 1 As shown, the device includes a CPU, memory and external storage Flash. The setting type data can be device basic data, and the Flash is divided into multiple function data storage areas, wherein the first function data storage area corresponds to the device basic data, including storage area A and storage area B.

[0077] Figure 3 FIG. 1 is a flow chart of a method for storing device data provided by an embodiment of the present disclosure. Figure 3 As shown, the process of device data storage includes:

[0078] Step 301: When the device is started, basic device data is read from the first function data storage area of ​​the Flash, mirrored, and stored in the memory.

[0079] Step 302: Determine whether the memory data is updated during the operation of the device. If yes, execute step 303; otherwise, return to step 302.

[0080] If the basic device data is written into the memory or deleted from the memory, it can be determined that the memory data is updated, and step 303 is executed.

[0081] Step 303: The device marks the memory data as updated.

[0082] Step 304: Determine whether the current running state of the device satisfies the running state corresponding to the low priority task. If yes, execute step 305; otherwise, return to step 304.

[0083] Steps 302-303 and steps 304-410 may be parallel mechanisms.

[0084] Step 305: Determine whether an update mark corresponding to the current task cycle is detected. If yes, execute step 306; otherwise, return to step 304.

[0085] Step 306: The device uses the MD5 information digest algorithm to perform integrity check on the memory data to obtain the corresponding MD5 value.

[0086] Step 307: The device stores the memory data into storage area A in the Flash.

[0087] Step 308: The device stores the MD5 value in storage area A in the Flash.

[0088] Step 309: The device stores the memory data into storage area B in the Flash.

[0089] Step 310: The device stores the MD5 value in storage area B in the Flash.

[0090] It can be seen that in this embodiment, when the device is started, the basic data image of the device can be stored in the memory. In this way, during the operation of the device, once the memory data is updated, the corresponding update mark can be made.

[0091] Thus, when the CPU is idle, that is, when the corresponding running state of the low-priority task is met, and when the update mark corresponding to the current task cycle is detected, the memory data and the corresponding MD5 value can be stored in two areas of the Flash, that is, a dual storage backup mechanism is selected for the memory data to ensure that there is always a version of the data available during the data writing process, which improves the effectiveness of data storage, and the data is checked as a whole before storage to ensure that the data is read and loaded into the system is complete and correct, further improving the stability and integrity of data storage. In addition, update detection and data storage can be carried out in parallel to avoid frequent operations on the Flash caused by writing once for each update, further improving the stability of the device.

[0092] According to the above-mentioned process for device data storage, an apparatus for device data storage can be constructed.

[0093] Figure 4 Schematic diagram of a device data storage device provided by an embodiment of the present disclosure. Figure 4 As shown, the device includes: a testing module 410 , a first storage module 420 , and a second module 430 .

[0094] The verification module 410 is configured to perform integrity verification on the memory data to obtain an integrity verification code when it is determined that the memory data is updated in the current task cycle.

[0095] The first storage module 420 is configured to store the memory data and the integrity check code in the first area of ​​the erasable flash memory.

[0096] The second storage module 430 is configured to store the memory data and the integrity check code in a row in the second area of ​​the erasable flash memory.

[0097] In some embodiments, it also includes:

[0098] The image processing module is configured to store the set type data image into the memory when the device is started to obtain the memory data.

[0099] In some embodiments, it also includes:

[0100] An update marking module is configured to mark the update when it is determined that the memory data is updated during the operation of the device;

[0101] The update detection module is configured to determine that the memory data is updated in the current task cycle if an update mark corresponding to the current task cycle is detected when it is determined that the running state corresponding to the low priority task is met.

[0102] In some embodiments, the update marking module is specifically configured to, when the current running data is data to be stored and the current running data is data of the set type, store the data to be stored in the memory and determine that the memory data has been updated; when the current running data deleted from the memory data is data of the set type, determine that the memory data has been updated.

[0103] In some embodiments, it also includes: a third storage module, which is configured to store the data to be stored in a third area in the erasable flash memory when the current running data is the data to be stored and if the current running data is not the set type data.

[0104] In some embodiments, it further includes: a partition module configured to divide the erasable flash memory into a plurality of functional data storage areas, wherein the first functional data storage area includes a first area and a second area.

[0105] Figure 5 Schematic diagram of a device data storage device provided by an embodiment of the present disclosure. Figure 5 As shown, the device data storage apparatus 400 includes: a checking module 410, a first storage module 420, a second storage module 430, a mirror processing module 440, an update marking module 450, an update detection module 460, a third storage module 470 and a partitioning module 480.

[0106] Among them, the division module 480 can divide the lash into multiple functional data storage areas, among which the first functional data storage area corresponds to the setting type data, including storage area A and storage area B.

[0107] When the device is started, the mirror processing module 440 reads the set type data from the first function data storage area of ​​the Flash, performs mirror processing, and stores it in the memory.

[0108] In the case where the current running data is data to be stored, if the current running data is set type data, the data to be stored is stored in the memory, and the update marking module 450 determines that the memory data has been updated and performs corresponding update marking; and in the case where the current running data deleted from the memory data is set type data, the update marking module 450 determines that the memory data has been updated and performs corresponding update marking.

[0109] When the CPU is idle, it is determined that the current operating state of the device meets the corresponding operating state of the low-priority task. When the update detection module 460 detects the update mark corresponding to the current task cycle, it is determined that the memory data is updated in the current task cycle. Therefore, the verification module 410 can use the MD5 information digest algorithm to check the integrity of the memory data to obtain the corresponding MD5 value.

[0110] After the first storage module 420 stores the memory data in the storage area A in the Flash, the MD5 value is stored in the storage area A in the Flash. Also, after the second storage module 430 stores the memory data in the storage area B in the Flash, the MD5 value is stored in the storage area B in the Flash.

[0111] Of course, in the case where the current operating data is the data to be stored, if the current operating data is not the set type data, the third storage module 470 can store the data to be stored in the area C in the erasable flash memory.

[0112] It can be seen that in this embodiment, when the device is started, the set type data image can be stored in the memory. In this way, during the operation of the device, once the memory data is updated, the device for storing the device data can make a corresponding update mark, and when the device operation state meets the operation state corresponding to the low priority task, and when the update mark corresponding to the current task cycle is detected, the memory data and the corresponding MD5 value can be stored in two areas of the Flash, that is, a dual storage backup mechanism is selected for the memory data to ensure that during the data writing process, there is always a version of the data available, which improves the effectiveness of data storage, and the data is checked as a whole before being stored to ensure that the data is read and loaded into the system is complete and correct, which further improves the stability and integrity of data storage.

[0113] Combination Figure 6 The embodiment of the present disclosure provides a device 600 for storing device data, comprising:

[0114] The processor 1000 and the memory 1001 may also include a communication interface 1002 and a bus 1003. The processor 1000, the communication interface 1002, and the memory 1001 may communicate with each other through the bus 1003. The communication interface 1002 may be used for information transmission. The processor 1000 may call the logic instructions in the memory 1001 to execute the method for device data storage of the above embodiment.

[0115] In addition, the logic instructions in the above-mentioned memory 1001 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0116] The memory 1001 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 1000 executes functional applications and data processing by running the program instructions / modules stored in the memory 1001, that is, implements the method for device data storage in the above method embodiment.

[0117] The memory 1001 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 1001 may include a high-speed random access memory and may also include a non-volatile memory. For example: the memory 1001 may be Figure 1 The external memory in can be Flash.

[0118] An embodiment of the present disclosure provides a device for storing device data, including: a processor and a memory storing program instructions, wherein the processor is configured to execute a method for storing device data when executing the program instructions.

[0119] Combination Figure 7 , the embodiment of the present disclosure provides a device, including: a device body 700, a device data storage device 400 (600) is installed on the device body, wherein an energy consumption measuring device is configured in the refrigerator. The installation relationship described here is not limited to placement inside the product, but also includes installation connections with other components of the product, including but not limited to physical connections, electrical connections or signal transmission connections. It can be understood by those skilled in the art that the device data storage device 400 (600) can be adapted to a feasible device body, thereby realizing other feasible embodiments.

[0120] An embodiment of the present disclosure provides a storage medium storing program instructions, wherein the program instructions, when executed, execute the method for storing device data as described above.

[0121] An embodiment of the present disclosure provides a computer program product, which includes a computer program stored on a storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above-mentioned method for storing device data.

[0122] The above-mentioned storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0123] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0124] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, individual components and functions are optional, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The scope of the embodiments of the present disclosure includes the entire scope of the claims, and all available equivalents of the claims. When used in this application, although the terms "first", "second", etc. may be used in this application to describe each element, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, without changing the meaning of the description, the first element can be called the second element, and similarly, the second element can be called the first element, as long as all occurrences of the "first element" are renamed consistently and all occurrences of the "second element" are renamed consistently. The first element and the second element are both elements, but may not be the same element. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms "a", "an" and "the" are intended to include the plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0125] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0126] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be 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. In addition, the coupling or direct coupling or communication connection between each other 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. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0127] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for storing device data, characterized in that: include: When it is determined that the memory data is updated in the current task cycle, the memory data is checked for integrity to obtain an integrity check code; The memory data and the integrity check code are stored in the first area of ​​the erasable flash memory in sequence; The memory data and the integrity check code are stored in the second area of ​​the erasable flash memory in sequence.

2. The method according to claim 1, characterized in that Also includes: When the device is started, the set type data image is stored in the memory to obtain the memory data.

3. The method according to claim 1, characterized in that Determining whether the memory data is updated in the current task cycle includes: When it is determined that the memory data is updated during the operation of the device, an update mark is performed; When it is determined that the running state corresponding to the low priority task is met, if an update mark corresponding to the current task cycle is detected, it is determined that the memory data is updated in the current task cycle.

4. The method according to claim 3, characterized in that Determining whether memory data is updated during operation of the device includes: In the case where the current running data is data to be stored, if the current running data is set type data, the data to be stored is stored in the memory, and it is determined that the memory data is updated; In a case where the current operation data deleted from the memory data is set type data, it is determined that the memory data is updated.

5. The method according to claim 4, characterized in that Also includes: In the case where the current running data is the data to be stored, if the current running data is not the set type data, the data to be stored is stored in the third area of ​​the erasable flash memory.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: The erasable flash memory is divided into a plurality of functional data storage areas, wherein the first functional data storage area includes a first area and a second area.

7. A device for storing device data, characterized in that: include: The verification module is configured to perform integrity verification on the memory data to obtain an integrity verification code when determining that the memory data is updated in the current task cycle; A first storage module is configured to store the memory data and the integrity check code in a first area of ​​the erasable flash memory; The second storage module is configured to store the memory data and the integrity check code in a row in the second area of ​​the erasable flash memory.

8. A device for storing device data, the device comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to perform the method for device data storage according to any one of claims 1 to 6 when executing the program instructions.

9. A device, characterized in that: include: Equipment body; The device for storing device data as claimed in claim 7 or 8 is installed in the device body.

10. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for storing device data as described in any one of claims 1 to 6 is executed.