A data backup method and apparatus

By adjusting the shutdown voltage in IoT devices according to the data lifetime, data with a long lifetime is backed up to non-volatile memory, while data with a short lifetime is retained in volatile memory. This solves the problem of low efficiency in energy harvesting systems under frequent power outages, and achieves more efficient data backup and system operation.

CN116414618BActive Publication Date: 2026-07-14HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2021-12-31
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In existing technologies, the energy harvesting system of IoT devices consumes a lot of energy and time when backing up data under frequent power outages, resulting in low system operating efficiency. Furthermore, the high power consumption and time required for writing non-volatile memory reduce the system's operating efficiency and lifespan.

Method used

By backing up long-lived data to non-volatile memory and retaining short-lived data in volatile memory when the voltage inside the electronic device drops to the shutdown voltage, the backup cost can be optimized, the amount of data to be backed up can be reduced, and the backup efficiency can be improved by adjusting the shutdown voltage according to the data's lifespan, taking advantage of the data retention characteristics of volatile memory.

Benefits of technology

It reduces the amount of data backup, improves the system's data processing efficiency, extends the system's uptime, reduces the write frequency of non-volatile memory, and extends the system's lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116414618B_ABST
    Figure CN116414618B_ABST
Patent Text Reader

Abstract

The application provides a data backup method and device, which is used for backing up data with long life span in a non-volatile memory and retaining data with a life span segment in a volatile memory when the voltage in the device drops to a shutdown voltage, thereby reducing the data backup amount, improving the backup efficiency, and further improving the system execution efficiency. The method comprises the following steps: acquiring collected data, wherein the collected data comprises data collected by a sensor, and the collected data is stored in the volatile memory; if the voltage in the electronic device drops to a shutdown voltage, backing up data with a life span greater than a first threshold in the collected data in the non-volatile memory to obtain backup data, wherein the shutdown voltage is not lower than the minimum working voltage of the processor, and the life span represents the effective duration of the data in the electronic device, and the backup data is used for reading data from the non-volatile memory and processing when the voltage in the electronic device is not lower than the shutdown voltage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of the Internet of Things, and more particularly to a data backup method and apparatus. Background Technology

[0002] With the development of IoT technology, IoT devices are becoming increasingly widespread. How to power such a massive number of IoT devices has become a key issue limiting the development of the IoT. To break the limitations of traditional battery power supply for IoT systems, energy harvesting systems have emerged. Energy harvesting systems can obtain energy from the external environment to power the system itself.

[0003] Intermittent computing monitors changes in external voltage during system operation. When the external voltage drops to a pre-set threshold, the system backs up data to non-volatile memory (NVM) and then shuts down. The system continues to draw power from the external source during shutdown. Once the accumulated power reaches a power-on threshold, the system powers on and resumes operation. Data stored in NVM is not lost during system shutdown; therefore, when the system powers on, it can resume execution from where it left off using the data stored in NVM. Thus, through data saving and recovery, the system can continue operating even with frequent power outages.

[0004] However, NVM consumes a lot of power and time for writes, and data backups require significant energy and time, greatly reducing the energy available for program execution and lowering system efficiency. Therefore, improving system efficiency has become a pressing issue. Summary of the Invention

[0005] This application provides a data backup method and apparatus for backing up long-lived data in non-volatile memory and retaining short-lived data in volatile memory when the voltage inside the device drops to the shutdown voltage, thereby reducing the amount of data backup, improving backup efficiency, and thus improving system execution efficiency.

[0006] In view of this, firstly, this application provides a data backup method applied to an electronic device. The electronic device includes a sensor, a processor, a non-volatile memory, and a volatile memory. The minimum holding voltage of the volatile memory is lower than the minimum operating voltage of the processor, meaning that the volatile memory can still operate for a period of time after the processor in the electronic device stops working. The method includes: acquiring collected data, including data collected by the sensor, and storing the collected data in the volatile memory; if the voltage in the electronic device drops to the shutdown voltage, backing up data with a lifetime greater than a first threshold in the non-volatile memory to obtain backup data. The shutdown voltage is not lower than the minimum operating voltage of the processor. The lifetime represents the effective duration of the data in the electronic device. The backup data is used to read data from the non-volatile memory and process it when the voltage in the electronic device is not lower than the shutdown voltage. The first threshold is positively correlated with the holding time of the volatile memory, and the holding time of the volatile memory includes the time it takes for the voltage in the electronic device to drop from the shutdown voltage to the minimum holding voltage.

[0007] In this embodiment, when the voltage within the electronic device drops to the shutdown voltage, long-lived data can be backed up to non-volatile memory, while short-lived data is retained in volatile memory with data retention properties. Therefore, if the time between the next startup and the current shutdown of the electronic device is too long, even if data in the memory is lost, this data is already invalid and can be considered discarded as invalid data. This reduces the amount of data backup and improves backup efficiency. Consequently, more time is provided for system data processing, improving the system's data execution efficiency.

[0008] In one possible implementation, the method further includes determining the shutdown voltage value based on the lifetime of the collected data. This is equivalent to adjusting the shutdown voltage based on data freshness, thereby adjusting the data backup cost and restart cost to achieve optimal backup efficiency.

[0009] In one possible implementation, the aforementioned determination of the shutdown voltage value based on the lifetime of the collected data may include: obtaining the correlation between the shutdown voltage and the holding time, wherein the holding time is the duration during which the voltage in the electronic device drops from the shutdown voltage to the minimum holding voltage when the electronic device is triggered to shut down; and determining the shutdown voltage value based on the correlation and the lifetime of the collected data.

[0010] Therefore, in the embodiments of this application, the relationship between the shutdown voltage and the holding time can be obtained, and then the value of the shutdown voltage can be determined according to the lifetime of the collected data, thereby adjusting the holding time and adjusting the amount of data that needs to be backed up.

[0011] In one possible implementation, the aforementioned adjustment of the shutdown voltage based on the correlation and the lifetime of the collected data may include: obtaining the backup cost corresponding to multiple voltage values ​​based on the correlation and the lifetime of the collected data; and selecting one voltage value from the multiple voltage values ​​as the shutdown voltage based on the backup cost corresponding to the multiple voltage values.

[0012] Therefore, in the real-time method of this application, the backup cost corresponding to multiple discrete voltage values ​​can be calculated, and then the voltage value with the optimal backup cost can be selected as the shutdown voltage, thereby maximizing the backup efficiency of electronic devices and reducing backup costs.

[0013] In one possible implementation, the aforementioned correlation between obtaining the shutdown voltage and the holding time may include: measuring the time it takes for the electronic device to drop to the lowest holding voltage after being shut down from multiple voltage values, and obtaining the correlation.

[0014] Therefore, in the embodiments of this application, the correlation between power-off voltage and holding time can be obtained by measurement, thereby obtaining an accurate correlation between power-off voltage and holding time. Generally, there is a positive correlation between power-off voltage and holding time, that is, the higher the power-off voltage, the longer the data holding time, and the less data needs to be backed up.

[0015] In one possible implementation, the aforementioned backup cost may include data backup standby cost and restart cost. The data backup cost is the cost of backing up the data collected by the sensor, and the restart cost is the cost of restarting the electronic device. For example, when the electronic device is powered off, not only the collected data needs to be backed up, but also the applications in the electronic device need to be backed up. When the electronic device is restarted, the backup data of the applications needs to be read to restore the state of the electronic device before it was powered off. In this embodiment, the data backup cost and restart cost can be balanced by adjusting the power-off voltage, thereby achieving better backup standby and improving system execution efficiency.

[0016] In one possible implementation, the first threshold includes the retention time of the volatile memory, which includes the time it takes for the voltage in the electronic device to drop from the power-off voltage to the minimum retention voltage.

[0017] Therefore, in this embodiment, data with a lifespan shorter than the retention time can be stored in volatile memory. If the electronic device does not restart after the retention time has expired, it is equivalent to discarding the invalid data, eliminating the need to back up this part of the data and improving backup efficiency.

[0018] Secondly, this application provides a data backup device applied to an electronic device, the electronic device including a sensor, a processor, a non-volatile memory, and a volatile memory, wherein the minimum holding voltage of the volatile memory is lower than the minimum operating voltage of the processor, and the device includes:

[0019] The data acquisition module is used to acquire data, including data collected by the sensors, and the data is stored in volatile memory.

[0020] The backup module is used to back up data with a lifetime greater than a first threshold in non-volatile memory if the voltage inside the electronic device drops to the shutdown voltage, thus obtaining backup data. The shutdown voltage is not lower than the minimum operating voltage of the processor. The lifetime indicates the effective duration of the data in the electronic device. The backup data is used to read data from the non-volatile memory and process it when the voltage inside the electronic device is not lower than the shutdown voltage.

[0021] In one possible implementation, the device further includes an adjustment module for determining the value of the shutdown voltage based on the lifetime of the acquired data.

[0022] In one possible implementation, it is specifically used for:

[0023] Obtain the correlation between shutdown voltage and hold duration. Hold duration is the time it takes for the voltage in the electronic device to drop from the shutdown voltage to the minimum hold voltage when the electronic device is triggered to shut down. Determine the value of the shutdown voltage based on the correlation and the lifetime of the collected data.

[0024] In one possible implementation, the adjustment module is specifically used to: obtain backup costs corresponding to multiple voltage values ​​based on the correlation and the lifetime of the collected data; and select one voltage value from the multiple voltage values ​​as the shutdown voltage based on the backup costs corresponding to the multiple voltage values.

[0025] In one possible implementation, the adjustment module is specifically used to measure the time it takes for the electronic device to drop to the lowest holding voltage after being powered off from multiple voltage values, thereby obtaining a correlation.

[0026] In one possible implementation, the first threshold includes the retention time of the volatile memory, which includes the time it takes for the voltage in the electronic device to drop from the power-off voltage to the minimum retention voltage.

[0027] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the processor and the memory are interconnected via a circuit, and the processor calls program code in the memory to execute processing-related functions in the data backup method shown in any of the first aspects above. Optionally, the electronic device may be a chip.

[0028] Fourthly, embodiments of this application provide an electronic device, which may also be referred to as a digital processing chip or a chip. The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface, and the program instructions are executed by the processing unit. The processing unit is used to perform processing-related functions as described in the first aspect or any optional embodiment of the first aspect.

[0029] Fifthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect or any optional embodiment of the first aspect.

[0030] In a sixth aspect, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect or any optional implementation thereof. Attached Figure Description

[0031] Figure 1 A schematic diagram of the structure of an electronic device provided in this application;

[0032] Figure 2 A flowchart illustrating a data backup method provided in this application;

[0033] Figure 3 A flowchart illustrating another data backup method provided in this application;

[0034] Figure 4 A flowchart illustrating another data backup method provided in this application;

[0035] Figure 5 A schematic diagram of a data retention scenario provided in this application;

[0036] Figure 6 This application provides a schematic diagram of a power-off voltage adjustment method.

[0037] Figure 7 This application provides a schematic diagram illustrating the relationship between backup duration and shutdown voltage.

[0038] Figure 8 A schematic diagram of a backup process provided for this application;

[0039] Figure 9 This application provides a schematic diagram of the structure of a data backup device;

[0040] Figure 10 This application provides a schematic diagram of the structure of another electronic device. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0042] First, the method provided in this application can be deployed in various electronic devices, such as various terminals or servers. These terminals may include, but are not limited to: environmental monitoring equipment (such as outdoor environmental monitoring equipment, forest fire prevention equipment, bridge condition detection equipment, smart agricultural monitoring equipment, etc.), smart wearable devices, smart mobile phones, televisions, tablets, wristbands, head-mounted displays (HMDs), augmented reality (AR) devices, mixed reality (MR) devices, cellular phones, smartphones, personal digital assistants (PDAs), etc.

[0043] For example, see Figure 1 The structure of the electronic device provided in this application will be illustrated below using a specific example.

[0044] The electronic device 100 may specifically include an energy harvester 101, a sensor 102, a processor 103, a volatile memory 104, a non-volatile memory 105, and a timer 106. Among them, the timer 106 is an optional device.

[0045] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0046] Specifically, the energy harvester 101 can be used to harvest energy from the external environment to provide power for the operation of electronic devices. The energy harvester can harvest energy in one or more of the following ways: solar energy, wind energy, thermal energy, radio frequency energy, pressure, etc. For example, in IoT devices, harvesting energy through an energy harvester eliminates the need for battery replacement or reduces the frequency of battery replacement, making it more environmentally friendly and reducing limitations on usage scenarios, thus exhibiting strong versatility.

[0047] Sensor 102 can be used to collect information about the environment in which the electronic device is located, and can be used to monitor the environment of the electronic device. The number of sensors can be one or more, and the sensors can include, but are not limited to, one or more of the following: pressure sensor, gyroscope sensor, barometric pressure sensor, magnetic sensor, accelerometer, distance sensor, proximity sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, bone conduction sensor, motion sensor, etc.

[0048] Processor 103 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.

[0049] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0050] The processor 103 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 103 is a cache memory. This memory can store instructions or data that the processor 103 has just used or that are used repeatedly. If the processor 103 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 103, and thus improves the efficiency of the system.

[0051] In some embodiments, the processor 103 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0052] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 103 may include multiple I2C buses. The processor 103 can couple sensors, chargers, flashlights, cameras, etc., through different I2C bus interfaces. For example, the processor 103 can couple a touch sensor through the I2C interface, enabling the processor 103 and the touch sensor to communicate via the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0053] The non-volatile memory 105 can be used to store data that needs to be stored in the electronic device, such as data collected by sensors, music, video, and other files, stored on an external memory card. Typically, the data in the non-volatile memory 105 can be stored for a longer period than the data stored in the volatile memory 104. The non-volatile memory 105 can be installed in the electronic device or connected to the electronic device via a memory interface. For example, the non-volatile memory 105 can be a non-volatile memory (NVM) or an external memory card, such as a MicroSD card, connected via an external memory interface to expand the storage capacity of the electronic device 100.

[0054] The volatile memory 104 can be used to store computer executable program code, which includes instructions. The volatile memory 104 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area may store data required during the use of the electronic device 100 (such as data collected by cached sensors, data generated by program execution, etc.). Furthermore, the volatile memory 104 may include high-speed random access memory or static random access memory (SRAM), such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the volatile memory 104 and / or instructions stored in memory located in the processor. Moreover, the volatile memory 104 in the electronic device provided in this application has data retention characteristics, that is, when the voltage inside the electronic device reaches the shutdown voltage, the data in the volatile memory 104 can still be retained for a period of time.

[0055] Taking SRAM as an example, SRAM (Static Random Access Memory) is a type of volatile memory widely used in most embedded devices' SOCs (system-on-chip). Compared to NVM, SRAM offers faster read / write speeds, lower power consumption, and no read / write overhead. SRAM devices possess data retention characteristics. The minimum data retention voltage of SRAM (typically around 0.4V) is significantly lower than the minimum operating voltage of the CPU (typically around 1.8V). When the CPU is about to stop working, the remaining power can still ensure that the data in the SRAM is retained for a certain period of time. Depending on factors such as chip circuit parameters and the SRAM operating environment, the SRAM data retention time can reach hundreds of milliseconds, tens of seconds, or even hundreds of seconds for different shutdown voltages.

[0056] The timer 106 can be a timer set inside the electronic device or a timer connected to the electronic device through an interface, used for timing.

[0057] In addition, the electronic device may include more or fewer components; for example, it may also include a battery, a wireless communication module, a modem, a display screen, a microphone, or a speaker. Figure 1 Components not shown in the diagram.

[0058] For example, a wireless communication module can provide a solution for wireless communication applications in electronic devices. A wireless communication module may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The wireless communication module can receive electromagnetic waves via an antenna, filter and amplify the received electromagnetic waves, and transmit them to a modem processor for demodulation. The wireless communication module can also amplify the signal modulated by the modem processor and radiate it as electromagnetic waves via the antenna. In some embodiments, at least some functional modules of the wireless communication module may be housed within the processor. In some embodiments, at least some functional modules of the wireless communication module and at least some modules of the processor 103 may be housed in the same device.

[0059] A modem processor may include a modulator and a demodulator. The modulator modulates a low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to a baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to an application processor. The application processor outputs sound signals through an audio device (not limited to a speaker, receiver, etc.) or displays images or videos on a display screen. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor and housed within the same device as a mobile wireless communication module or other functional modules.

[0060] The aforementioned wireless communication technologies may include, but are not limited to: 5th-Generation (5G) systems, Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), Bluetooth, the Global Navigation Satellite System (GNSS), Wireless Fidelity (WiFi), Near Field Communication (NFC), FM (Frequency Modulation Broadcasting), Zigbee, Radio Frequency Identification (RFID), and / or Infrared (IR) technologies. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS), etc.

[0061] In some embodiments, the electronic device 100 may also include a wired communication module ( Figure 1 (not shown in the image), or, the aforementioned wireless communication module can be replaced with a wired communication module (not shown in the image), Figure 1(Not shown in the image), this wired communication module enables electronic devices to communicate with other devices via a wired network. This wired network may include, but is not limited to, one or more of the following: optical transport network (OTN), synchronous digital hierarchy (SDH), passive optical network (PON), Ethernet, or flex Ethernet (FlexE), etc.

[0062] The electronic device provided in this application can be applied to various scenarios, such as smart wearable scenarios, vehicle-mounted scenarios, or outdoor monitoring scenarios. For example, in some outdoor monitoring scenarios, the energy harvester can collect energy from the environment, such as solar or wind energy. Of course, there may be situations where the energy is insufficient. Therefore, it is necessary to monitor the voltage inside the electronic device in a timely manner. When the voltage inside the electronic device is too low, the status or data of the program running inside the electronic device should be backed up in a timely manner. When the voltage inside the electronic device is sufficient, processing can be resumed based on the backup data, realizing the intermittent operation of the system and thus adapting to environmental changes.

[0063] For example, in some IoT scenarios, multiple IoT nodes can be set up. These IoT nodes can be the aforementioned... Figure 1 The electronic devices shown are used for environmental monitoring via multiple IoT nodes. With the development of IoT technology, IoT devices are becoming increasingly widespread. Traditional battery power is no longer suitable for such large-scale IoT systems. Specifically, 1) traditional battery power is not environmentally friendly, as equipping each device with a battery generates a large amount of electronic waste; 2) battery-powered devices are very difficult to maintain during use, and replacing or charging batteries is impossible in certain harsh deployment environments. Therefore, how to power such a large number of IoT devices has become a key issue restricting the development of IoT. To break the limitations of traditional battery power on the development of IoT systems, energy harvesting systems have emerged. Energy harvesting systems can obtain energy from the external environment to power the system itself. Furthermore, various types of energy from the external environment can be utilized by energy harvesting devices, such as light, solar, wind, thermal, radio frequency, and pressure. IoT devices powered by energy harvesting do not require battery replacement, are more environmentally friendly, reduce limitations on usage scenarios, and have strong robustness.

[0064] While using energy harvesting to power the Internet of Things (IoT) frees IoT systems from battery limitations, it also presents unprecedented challenges for software design. Because externally harvested energy is typically very small, unpredictable, and unstable, IoT devices may face very frequent power outages. In traditional IoT systems, if a task cannot complete before a power outage, it will be re-executed after the system restarts. This cycle repeats, and the task may never complete, or the system may stagnate. To ensure that tasks can be completed on energy-harvesting IoT devices, intermittent computing has been proposed.

[0065] Intermittent computing monitors changes in external voltage during system operation. When the external voltage drops to a pre-set threshold (i.e., shutdown voltage or warning voltage), the system backs up data to non-volatile memory (NVM) and then shuts down. The system continues to draw power from the external source during shutdown. Once the accumulated energy reaches a power-on threshold, the system powers on and resumes operation. Data stored in NVM is not lost when the system shuts down; therefore, when the system powers on, it can resume execution from where it left off using the data stored in NVM. Thus, through data saving and recovery, the system can continue running even with frequent power outages. Specifically, for example, during program execution, when the system detects that the external voltage has reached the shutdown voltage, it begins data backup. The data backup copies the data to NVM. The system then shuts down and waits for charging to complete. During charging, the data stored in NVM is not lost. After charging is complete, the system resumes execution using the data in persistent memory.

[0066] The methods described above can ensure the system's correct operation under frequent power outages. However, due to the very high power consumption and time required for NVM writes, data backup consumes a significant amount of energy and time, greatly reducing the energy available for program execution and lowering system efficiency. Furthermore, NVMs generally have a limited write lifespan. Once the number of writes to an NVM reaches a certain value, the NVM fails and cannot be reused. Therefore, the frequent data backups performed by existing energy harvesting equipment also significantly reduce the lifespan of NVMs, thereby reducing the overall system lifespan. Moreover, the excessive energy and time consumed in data backup leaves insufficient energy for the system to perform normal application tasks, severely impacting the amount of data collected and processed, and consequently affecting system responsiveness.

[0067] Energy harvesting IoT devices are widely used in the field of data sensing due to their maintenance-free nature. In data sensing, systems have strict requirements for data freshness. If data has been collected for too long, it no longer represents the current system state and therefore cannot be used. Traditional sensing systems often specify a lifespan for the collected data; if data exceeds its lifespan, it is discarded.

[0068] Because sensor data generally possesses a freshness attribute, common methods for backing up data in intermittent systems reveal a problem: data is indiscriminately backed up to persistent storage. Over time, some of the data existing in persistent storage will expire, making backing up this data to persistent storage a waste of effort and severely squandering the already very limited energy of the intermittent system.

[0069] Therefore, this application provides a data backup method for utilizing the data retention characteristics of volatile memory to perform data backup based on data freshness, thereby backing up more effective data, reducing the amount of data backup, improving data backup efficiency, and improving the working efficiency of electronic devices.

[0070] First, to facilitate understanding, some terms used in this application will be introduced.

[0071] Data freshness: In sensing systems, collected data typically has a lifespan description; data exceeding this lifespan is considered invalid. Data freshness represents the time from the current moment until the end of the data's lifespan. The shorter this time, the worse the data freshness, and the closer the data is to expiration. This lifespan can be understood as the effective duration of data within the system.

[0072] SRAM data retention characteristic: When the processor's supply voltage drops below its minimum operating voltage (typically around 1.8V), the processor will stop working. However, SRAM can still retain data intact until its minimum data retention voltage (typically around 0.4V) even after the system voltage drops below this value. This behavior of retaining data in SRAM after the processor is powered off is called the SRAM data retention characteristic. Furthermore, the minimum retention voltage of SRAM is usually lower than the minimum operating voltage of the CPU.

[0073] Power-off voltage: When the voltage of the battery / capacitor in an electronic device reaches the power-off voltage, the processor stops working and the SRAM is powered down. The power-off voltage is typically not less than the processor's minimum operating voltage to allow the processor to operate normally.

[0074] Retention time: Data in SRAM can be retained for a certain period of time after the processor stops working. For a fixed shutdown voltage, the minimum length of time that data can be correctly retained in SRAM is called the SRAM data retention time at that shutdown voltage. This is equivalent to the length of time the data in SRAM continues to be retained after the system voltage drops to the shutdown voltage and the system is shut down.

[0075] The method and process provided in this application are described below. (See attached document.) Figure 2 This application provides a flowchart illustrating a data backup method.

[0076] 201. Obtain the collected data.

[0077] The acquired data may include data collected by sensors in electronic devices. Typically, the data collected by sensors can be cached in volatile memory so that programs running in electronic devices can quickly read the data from the volatile memory and process it.

[0078] The minimum holding voltage of this volatile memory is lower than the minimum operating voltage of the processor. That is, after the processor stops running, the data in the volatile memory can still be retained for a period of time, which is called the holding time.

[0079] The sensor can be as described above. Figure 1 Any of the sensors shown can collect information about the environment when the electronic device is working. For example, a temperature sensor can collect temperature information in the environment, a humidity sensor can collect humidity information in the environment, and a light sensor can collect light intensity information in the environment. The specific sensors can be adjusted according to the actual application scenario. Different electronic devices may be equipped with different sensors, and this application does not limit them.

[0080] 202. If the voltage inside the electronic device drops to the shutdown voltage, the data with a lifespan greater than the first threshold in the collected data will be backed up in non-volatile memory to obtain backup data.

[0081] It can continuously monitor the voltage inside the electronic device. When the voltage inside the electronic device drops to the shutdown voltage, the data with a lifespan greater than the first threshold can be backed up in the non-volatile memory to obtain the backup data stored in the non-volatile memory. The data with a lifespan less than the first threshold can be retained in the non-volatile memory.

[0082] The first threshold is positively correlated with the retention time of the volatile memory (VRAM); that is, the longer the VRAM retention time, the larger the first threshold, and the shorter the VRAM retention time, the smaller the first threshold. Typically, the first threshold is not greater than or close to the VRAM retention time. Therefore, the validity period of data retained in VRAM is relatively short. If the electronic device is powered on again within the retention time, the data held in the VRAM can continue to be processed. If the electronic device is not powered on again within the retention time, the data in the VRAM is lost. However, since the data held in the VRAM has exceeded its validity period, it can be directly discarded without needing to be backed up in non-volatile memory. This effectively reduces the amount of data backed up in the VRAM, improving backup efficiency.

[0083] The shutdown voltage can be a preset value or a value determined based on collected data. For example, a fixed shutdown voltage can be preset; when the voltage inside the electronic device drops to this voltage, the device shuts down and then naturally loses power. Alternatively, the shutdown voltage can be adjusted based on the lifetime of the collected data. For instance, the amount of data that needs to be backed up is related to the retention time of volatile memory. A higher shutdown voltage results in a longer retention time, requiring less data to be backed up. However, a higher shutdown voltage typically leads to more system restarts. Therefore, the shutdown voltage can be adjusted based on backup and restart costs to suit the actual scenarios of the electronic device.

[0084] Optionally, the process of adjusting the power-off voltage may include: obtaining the correlation between the power-off voltage and the retention time of the volatile memory, and then determining the value of the power-off voltage based on the correlation and the lifetime of the acquired data.

[0085] Optionally, multiple voltage values ​​can be determined, and then the backup cost corresponding to the multiple voltage values ​​can be calculated based on the correlation and the lifetime of the collected data; subsequently, based on the backup cost corresponding to the multiple voltage values, one of the voltage values ​​can be selected as the shutdown voltage.

[0086] Of course, the shutdown voltage value that balances data backup cost and restart cost can also be calculated based on a pre-set backup cost equation.

[0087] In addition, the relationship between shutdown voltage and holding time can be obtained by measuring the time it takes for the electronic device to drop to the lowest holding voltage after being shut down from multiple voltage values.

[0088] Therefore, in this embodiment, the shutdown voltage can be adjusted based on the lifetime of the collected data, thereby achieving optimal backup cost for electronic devices and improving the operating efficiency of electronic devices while reducing backup cost.

[0089] The foregoing has introduced the method flow provided in this application. To facilitate understanding, the method flow provided in this application will be described in more detail below in conjunction with specific application scenarios.

[0090] See Figure 3 This application provides a flowchart illustrating another data backup method.

[0091] Typically, the operating state of electronic devices can be divided into multiple states, such as waiting state, data sensing state, processing state, and data backup state.

[0092] After the system is powered on, it enters a waiting state, waiting for data acquisition to be triggered.

[0093] After triggering data acquisition, the system enters the data sensing state, which involves collecting data through sensors.

[0094] When in a data-aware state, if data processing is triggered, data processing can continue, and after the data processing is completed, the system will enter a waiting state.

[0095] After the system is powered on, the voltage inside the electronic device can be monitored in real time. When the voltage inside the electronic device drops to the shutdown voltage, data backup can be performed, and the device will be shut down after the backup is completed.

[0096] Furthermore, taking the setup of NVM and SRAM in an electronic device as an example, a more detailed process can be found as follows: Figure 4 As shown below, each step will be explained in more detail.

[0097] I. Waiting state

[0098] The system powers on when the electronic device is turned on. This can be done by the user manually turning it on, or by turning it on when the voltage inside the electronic device is detected to be higher than the power-on voltage. The specific timing can be adjusted according to the actual application scenario.

[0099] II. Data Perception

[0100] After powering on, the system initially enters a waiting state. During this waiting period, if data acquisition is triggered, it enters a data sensing state, where data is collected using sensors internal to the electronic device or externally connected sensors. Specifically, data acquisition can be triggered periodically, when a change in a variable is detected, by the processor based on demand, or by the user. The specific approach can be adjusted according to the actual application scenario. For example, when a program running within the electronic device requires data collected by a specific sensor, that program can trigger data sensing, initiating the sensor to collect the data.

[0101] During the data sensing process, environmental data can be collected by sensors. For example, a temperature sensor can collect ambient temperature, an image sensor can collect images, and a humidity sensor can collect ambient humidity. The sensors used in different electronic devices, applications, or scenarios may be the same or different, and adjustments can be made according to the actual application scenario.

[0102] After the sensor collects data, the data can be stored in memory, such as volatile memory or other internal memory. For example, in this embodiment, taking the setting of SRAM in an electronic device as an example, the data collected by the sensor can be cached in SRAM so that the processor can read the data from SRAM and process it.

[0103] Furthermore, during the data sensing phase, the lifespan of the data can be determined, which can be understood as the effective duration of the data within the electronic device. The specific storage location of the data can also be determined based on its lifespan, such as storing it in SRAM or NVM. The shutdown voltage can also be adjusted based on the data's lifespan to optimize subsequent backup costs.

[0104] In the data perception stage, when the collected data needs to be processed, such as when the data volume reaches a preset amount or when data processing is performed periodically, the data processing stage can begin.

[0105] III. Data Processing

[0106] After the sensor collects data, the data can be stored in SRAM. When further processing is needed, the data processing stage can be triggered.

[0107] The data processing stage may include processing the data or further transmitting the data.

[0108] For example, in outdoor temperature monitoring scenarios, sensors can be used to collect ambient temperature data in real time. Once the temperature data has been collected for a certain period, analysis of the ambient temperature can be triggered to analyze temperature changes over that period. Alternatively, when a user needs to know the current ambient temperature, analysis of temperature changes over a certain period can be actively triggered. Specific adjustments can be made according to the actual application scenario. This application is merely an illustrative example and is not intended to be limiting.

[0109] Furthermore, the data collected by the sensors can be transmitted to other devices. For example, in an Internet of Things (IoT) system comprising multiple IoT devices (i.e., electronic devices), a unified IoT server can collect the data collected by each IoT device and perform unified analysis and processing.

[0110] It should be noted that data processing methods vary depending on the application scenario. This application is merely an illustrative example and is not intended to be limiting.

[0111] IV. Data Backup

[0112] In particular, the voltage inside the electronic device can be monitored in real time during each processing stage of the electronic device. If the voltage inside the electronic device drops to the shutdown voltage during all the above stages, the data backup stage can be entered.

[0113] If the process transitions from the data awareness phase to the data backup phase, the backup location can be determined based on the data's lifespan. Data with a lifespan greater than a first threshold can be backed up in NVM, while data with a lifespan less than the first threshold can be retained in SRAM. This can be understood as keeping shorter-lived data in SRAM and backing up longer-lived data in NVM. The first threshold can include the SRAM retention period, or it can be a value within a certain range of that retention period.

[0114] If the process moves from the data processing stage to the data backup stage, and the data to be processed is not yet complete, the lifespan of the unprocessed data can be determined, and the specific storage location of the data can be determined based on the lifespan.

[0115] In addition to backing up the data collected by sensors, it is also possible to back up the data generated by the program running in the electronic device, such as the values ​​of global variables or local variables generated during program execution.

[0116] Therefore, in the embodiments of this application, the data retention characteristics of SRAM can be utilized. When the data of the lifetime period is stored in SRAM, if the time until the next system power-on is too long, such as longer than the data lifetime or longer than the SRAM retention time, it means that the data stored in SRAM has been lost and the data has become invalid. Even if the data is lost, it will not affect the operation of the electronic device.

[0117] For example, such as Figure 5 As shown, if the lifespan of data is shorter than the data retention time of SRAM, this data can be stored in SRAM instead of persistent storage. Even if a prolonged power outage causes the data stored in SRAM to be lost, it can be discarded directly because its actual lifespan has already exceeded its own. This effectively utilizes the data retention characteristic of SRAM to achieve automatic filtering of expired data. The resulting effect is a significant reduction in the amount of data that intermittent systems back up to persistent storage.

[0118] Furthermore, to optimize backup costs, the cost of data backup and the cost of restarting can be balanced by adjusting the shutdown voltage.

[0119] First, before adjusting the power-off voltage, it is necessary to obtain the correlation between the power-off voltage and the SRAM hold time. To obtain this correlation, it is necessary to determine the minimum hold voltage of the SRAM. This hold voltage can be calibrated during the production of the SRAM or it can be obtained by measurement.

[0120] For example, if the SRAM manufacturer specifies the minimum hold voltage for the SRAM, this minimum hold voltage can be obtained directly. If it is not specified, it can be obtained through measurement. For instance, the system voltage of an electronic device can be charged to a level higher than the minimum hold voltage of the SRAM, and the data stored in the SRAM can be read. Then, the system can be powered off, allowing it to naturally drop to a certain voltage value V. The system can then be charged again and powered on, and the data in the SRAM can be read again and compared with the data before powering off. If they match, V is higher than the minimum hold voltage; if they do not match, V is lower than the hold voltage. This process can be repeated until the minimum hold voltage is found. Therefore, even when the minimum hold voltage of the SRAM is unknown, it can be obtained through measurement, adapting to a wider range of scenarios.

[0121] After obtaining the minimum hold voltage of the SRAM, the minimum hold time corresponding to different power-off voltages can be measured. For example, adjust the system voltage to V_off and power off until the voltage drops to the minimum hold voltage of the SRAM (which can be obtained through external testing instruments), and record the elapsed time TR. TR can be measured multiple times under different external environments, and the minimum value can be taken. Repeat the above steps for different power-off voltages to obtain the minimum hold time corresponding to different power-off voltages, and thus obtain the correlation between the power-off voltage and the hold time of the SRAM.

[0122] Then, based on this correlation and the lifespan of the data in SRAM, the backup cost corresponding to multiple voltage values ​​can be calculated. Then, the voltage value with the lowest backup cost can be selected from these multiple voltage values ​​as the shutdown voltage.

[0123] For example, typically after the system shuts down, the remaining power after shutdown is used to power up SRAM to retain data. Therefore, the system's shutdown voltage determines the amount of power allocated to SRAM for data retention and the data retention time. Furthermore, a higher shutdown voltage means more power is allocated to SRAM for data retention, resulting in a longer SRAM data retention time. However, a higher shutdown voltage also leads to more reboots, and consequently, higher reboot costs. For example, ... Figure 6As shown, under a high shutdown voltage, the system restarts five times, but under a low shutdown voltage, the system only restarts three times. Therefore, adjusting the shutdown voltage can further improve the system's operating efficiency.

[0124] Therefore, the backup cost can be divided into data backup standby cost and restart cost. By adjusting the shutdown voltage, the data backup cost and restart cost can be balanced to achieve the optimal backup cost.

[0125] For example, based on the system's charge and discharge rates, the data backup cost equation can be obtained:

[0126] Cost=f(V_off,CR,DR)+g(V_off,CR,DR)

[0127] This equation represents the cost of data backup and the cost of restarting, where:

[0128] Data backup costs:

[0129]

[0130] This represents the cost of data backup within a time period T, assuming a charging rate of CR and a discharging rate of DR. Here, Size_i represents the size of the acquired data i, p_i represents the acquisition period of data i, f_i represents the lifespan of data i, and RT(V_off) represents the SRAM data retention time when the power-off voltage is V_off.

[0131] Restart cost:

[0132] This represents the cost of restarting the system within time T, where Sys_size represents the amount of system state data (the system incurs additional energy and time overhead during startup and shutdown due to power outages; the g function describes this overhead, which is directly related to the number of system startups and shutdowns).

[0133] The total system cost is the sum of the cost of data backup and the cost of system restart, denoted as Cost.

[0134] The optimal shutdown voltage can be found by obtaining the V_off value that causes Cost to reach its minimum value.

[0135] However, directly solving the equation to obtain the optimal shutdown voltage is usually very complex, and it is difficult to calculate the objectively optimal V_off value during system operation.

[0136] The system uses a fixed shutdown voltage. By utilizing the data retention characteristics of SRAM to save data with a short lifespan, the data backup overhead can be reduced. However, in reality, the external energy source varies, so the system needs to dynamically adjust the shutdown voltage to ensure that the system is always in an optimal state during actual operation. However, the method of dynamically calculating the optimal shutdown voltage by solving the above equations is very complex. Especially on some embedded MCUs with low computing power, due to the lack of complex calculators, it may be necessary to enumerate all possible shutdown voltages, consuming a large amount of energy and introducing a greater computational cost. In the embodiments of this application, a fast method for calculating V_off is proposed.

[0137] Since the restart cost increases linearly with the increase of V_off, the cost of data backup is a step function. Therefore, it is only necessary to test the SRAM retention voltages corresponding to the lifespans of different data. By comparing a limited number of voltages, the shutdown voltage that minimizes the system data backup can be obtained, which is equivalent to screening out the voltage value with the optimal backup cost from multiple voltage values.

[0138] For example, as Figure 7 shown, assume there are three types of data D1, D2, D3, with validity periods f1, f2, f3 respectively, and f1 < f2 < f3. The shutdown voltages for storing D1, D1 + D2, D1 + D2 + D3 in SRAM are V1, V2, V3 respectively, and V1 < V2 < V3. Suppose the shutdown voltage is within the interval [V1, V2]. The data backup cost is the same within this shutdown voltage range, but the restart cost is the highest at V2. Therefore, the total cost of the system must be the lowest at V1. Similarly, within the interval [V2, V3], only the voltage V2 needs to be observed. Therefore, to obtain the optimal shutdown voltage, only Vmin, V1, V2, V3 need to be judged, rather than directly solving a complex equation, which greatly improves the efficiency of determining the shutdown voltage.

[0139] Therefore, since different shutdown voltages lead to different SRAM retention times and the total cost of the system, a minimum data backup cost can be obtained by adjusting the shutdown voltage of the system. At the same time, by using an efficient method for dynamically calculating the optimal voltage, the system can always maintain the minimum backup cost under changing energy conditions.

[0140] Exemplarily, the comparison effect between backing up all data and only backing up data with a long lifespan can be as Figure 8 shown. The system backs up data before power-off shutdown and continues to execute from the backed-up data after power-on. The method provided in this application only backs up data with a long lifespan (data with a short lifespan is retained in SRAM), rather than backing up all data. It has high backup efficiency, and more energy can be used for the execution of system application tasks, improving the system operation efficiency.

[0141] The method flow provided in this application has been described above. The apparatus provided in this application for performing the aforementioned method is described below.

[0142] First, refer to Figure 9 This application provides a schematic diagram of a data backup device. Applied to electronic devices, the electronic devices include sensors, processors, non-volatile memory, and volatile memory. The minimum holding voltage of the volatile memory is lower than the minimum operating voltage of the processor. The data backup device includes:

[0143] The acquisition module 901 is used to acquire acquisition data, including data collected by the sensor, and the acquisition data is stored in volatile memory.

[0144] The backup module 902 is used to back up data with a lifetime greater than a first threshold in non-volatile memory if the voltage inside the electronic device drops to the shutdown voltage, thereby obtaining backup data. The shutdown voltage is not lower than the minimum operating voltage of the processor. The lifetime indicates the effective duration of the data in the electronic device. The backup data is used to read data from the non-volatile memory and process it when the voltage inside the electronic device is not lower than the shutdown voltage.

[0145] In one possible implementation, the device further includes an adjustment module 903 for determining the value of the shutdown voltage based on the lifetime of the collected data.

[0146] In one possible implementation, the adjustment module 903 is specifically used for:

[0147] Obtain the correlation between shutdown voltage and hold duration. Hold duration is the time it takes for the voltage in the electronic device to drop from the shutdown voltage to the minimum hold voltage when the electronic device is triggered to shut down. Determine the value of the shutdown voltage based on the correlation and the lifetime of the collected data.

[0148] In one possible implementation, the adjustment module 903 is specifically used to: obtain the backup cost corresponding to multiple voltage values ​​based on the correlation and the lifetime of the collected data; and select one of the voltage values ​​as the shutdown voltage based on the backup cost corresponding to the multiple voltage values.

[0149] In one possible implementation, the adjustment module 903 is specifically used to measure the time it takes for the electronic device to drop to the lowest holding voltage after being turned off from multiple voltage values, thereby obtaining the correlation.

[0150] In one possible implementation, the first threshold includes the retention time of the volatile memory, which includes the time it takes for the voltage in the electronic device to drop from the power-off voltage to the minimum retention voltage.

[0151] Please see Figure 10The following is a schematic diagram of another electronic device provided in this application.

[0152] The electronic device may include the aforementioned wearable device, terminal, or vehicle, and may include a processor 1001, a memory 1002, and a transceiver 1003. The processor 1001 and the memory 1002 are interconnected via a circuit. The memory 1002 stores program instructions and data.

[0153] The aforementioned are stored in memory 1002 Figures 2-8 The steps in the code include the corresponding program instructions and data.

[0154] Processor 1001 is used to execute the aforementioned Figures 2-8 The method steps performed by the first device or electronic device shown in any of the embodiments.

[0155] Transceiver 1003 is used to perform the aforementioned Figures 2-8 The steps of receiving or transmitting data performed by the first device or electronic device shown in any of the embodiments.

[0156] This application also provides a computer-readable storage medium storing a program for generating vehicle speed, which, when run on a computer, causes the computer to perform the aforementioned... Figures 2-8 The steps in the method described in the illustrated embodiment.

[0157] Alternatively, the aforementioned Figure 10 The electronic device shown is a chip.

[0158] This application also provides an electronic device, which may also be referred to as a digital processing chip or a chip. The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface, and the program instructions are executed by the processing unit. The processing unit is used to perform the aforementioned... Figures 2-8 The method steps performed by the electronic device shown in any of the embodiments.

[0159] This application also provides a digital processing chip. This digital processing chip integrates circuitry for implementing the processor 1001 described above, or the functions of the processor 1001, and one or more interfaces. When the digital processing chip integrates a memory, it can complete the method steps of any one or more of the foregoing embodiments. When the digital processing chip does not integrate a memory, it can be connected to an external memory via a communication interface. The digital processing chip implements the actions performed by the electronic device in the foregoing embodiments based on the program code stored in the external memory.

[0160] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned actions. Figures 2-8 The steps performed by the electronic device in the method described in the illustrated embodiment.

[0161] The electronic device provided in this application embodiment can be a chip, which includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in a storage unit to cause the chip within the server to perform the aforementioned operations. Figures 2-8 The device search method described in the illustrated embodiment. Optionally, the storage unit is a storage unit within the chip, such as a register, cache, etc. The storage unit can also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), etc.

[0162] Specifically, the aforementioned processing unit or processor can be a central processing unit (CPU), a neural-network processing unit (NPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0163] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more processors used to control the above. Figures 2-8 The method of program execution of integrated circuits.

[0164] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0166] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0167] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0168] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0169] Finally, it should be noted that the above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data backup method, characterized in that, Applied to an electronic device, the electronic device including a sensor, a processor, a non-volatile memory, and a volatile memory, wherein the minimum holding voltage of the volatile memory is lower than the minimum operating voltage of the processor, the method includes: Acquire collected data, including data collected by the sensor, and store the collected data in the volatile memory; If the voltage inside the electronic device drops to the shutdown voltage, data with a lifetime greater than a first threshold from the collected data is backed up in the non-volatile memory to obtain backup data. The shutdown voltage is not lower than the minimum operating voltage of the processor. The lifetime represents the effective duration of the data in the electronic device. The backup data is used to read data from the non-volatile memory and process it when the voltage inside the electronic device is not lower than the shutdown voltage. The first threshold is positively correlated with the retention time of the volatile memory. The retention time of the volatile memory includes the time it takes for the voltage inside the electronic device to drop from the shutdown voltage to the minimum retention voltage.

2. The method according to claim 1, characterized in that, The method further includes: The value of the shutdown voltage is determined based on the lifetime of the collected data.

3. The method according to claim 2, characterized in that, Determining the value of the shutdown voltage based on the lifetime of the collected data includes: Obtain the correlation between the shutdown voltage and the holding time, wherein the holding time is the duration during which the voltage in the electronic device drops from the shutdown voltage to the minimum holding voltage when the electronic device is triggered to shut down; The value of the shutdown voltage is determined based on the correlation and the lifetime of the collected data.

4. The method according to claim 3, characterized in that, The step of adjusting the shutdown voltage based on the correlation and the lifetime of the collected data includes: Based on the correlation and the lifetime of the collected data, the backup cost corresponding to multiple voltage values ​​is obtained; Based on the backup cost corresponding to the plurality of voltage values, one of the voltage values ​​is selected from the plurality of voltage values ​​as the shutdown voltage.

5. The method according to claim 3 or 4, characterized in that, The process of obtaining the correlation between the shutdown voltage and the holding time includes: The correlation is obtained by measuring the time it takes for the electronic device to drop to the lowest holding voltage after being powered off from multiple voltage values.

6. The method according to any one of claims 1-5, characterized in that, The first threshold includes the retention time of the volatile memory.

7. A data backup device, characterized in that, Applied to electronic devices, the electronic devices including sensors, processors, non-volatile memory, and volatile memory, wherein the minimum holding voltage of the volatile memory is lower than the minimum operating voltage of the processor, the device includes: The acquisition module is used to acquire acquisition data, including data acquired by the sensor, and the acquisition data is stored in the volatile memory; A backup module is used to back up data with a lifetime greater than a first threshold in the non-volatile memory if the voltage inside the electronic device drops to the shutdown voltage, thereby obtaining backup data. The shutdown voltage is not lower than the minimum operating voltage of the processor, and the lifetime represents the effective duration of the data in the electronic device. The backup data is used to read data from the non-volatile memory and process it when the voltage inside the electronic device is not lower than the shutdown voltage. The first threshold is positively correlated with the retention time of the volatile memory, and the retention time of the volatile memory includes the time it takes for the voltage in the electronic device to drop from the shutdown voltage to the minimum retention voltage.

8. The apparatus according to claim 7, characterized in that, The device further includes: An adjustment module is used to determine the value of the shutdown voltage based on the lifetime of the collected data.

9. The apparatus according to claim 8, characterized in that, The adjustment module is specifically used for: Obtain the correlation between the shutdown voltage and the holding time, wherein the holding time is the duration during which the voltage in the electronic device drops from the shutdown voltage to the minimum holding voltage when the electronic device is triggered to shut down; The value of the shutdown voltage is determined based on the correlation and the lifetime of the collected data.

10. The apparatus according to claim 9, characterized in that, The adjustment module is specifically used for: Based on the correlation and the lifetime of the collected data, the backup cost corresponding to multiple voltage values ​​is obtained; Based on the backup cost corresponding to the plurality of voltage values, one of the voltage values ​​is selected from the plurality of voltage values ​​as the shutdown voltage.

11. The apparatus according to claim 9 or 10, characterized in that, The adjustment module is specifically used for: The correlation is obtained by measuring the time it takes for the electronic device to drop to the lowest holding voltage after being powered off from multiple voltage values.

12. The apparatus according to any one of claims 7-11, characterized in that, The first threshold includes the retention time of the volatile memory.

13. An electronic device, characterized in that, The method includes one or more processors coupled to a memory storing a program that, when executed by the one or more processors, implements the steps of any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that, The program, when executed by the processing unit, performs the method as described in any one of claims 1 to 6.

15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 6.

16. A chip, characterized in that, The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface, and the program instructions are executed by the processing unit. The processing unit is used to perform the steps of the method as described in any one of claims 1 to 6.