WO2022057872A1 - Procédé de traitement de données et appareil associé - Google Patents

Procédé de traitement de données et appareil associé Download PDF

Info

Publication number
WO2022057872A1
WO2022057872A1 PCT/CN2021/118918 CN2021118918W WO2022057872A1 WO 2022057872 A1 WO2022057872 A1 WO 2022057872A1 CN 2021118918 W CN2021118918 W CN 2021118918W WO 2022057872 A1 WO2022057872 A1 WO 2022057872A1
Authority
WO
WIPO (PCT)
Prior art keywords
check code
interval
terminal
address
address interval
Prior art date
Application number
PCT/CN2021/118918
Other languages
English (en)
Chinese (zh)
Inventor
关楠
陈秋林
于洋
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022057872A1 publication Critical patent/WO2022057872A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's

Definitions

  • the present application relates to the field of computer technology, and in particular, to a data processing method and related apparatus.
  • the warning voltage threshold is usually set as A higher voltage value is likely to cause the IoT device to stop running when there is more power remaining, which affects the real-time response performance of the IoT device.
  • the present application provides a data processing method and related device.
  • the check code of the address range used by the program segment is calculated, and based on the check code and the entire program
  • the check code of other address ranges in the used address range determines the total check code of the address range used by the program, and there is no need to calculate the check code for the entire address range where the data is stored, thereby reducing the time required to calculate the check code.
  • Energy consumption and time enable the terminal to run continuously and ensure the real-time response performance of the terminal.
  • a first aspect of the present application provides a data processing method, which is applied to a terminal that works intermittently, that is, a terminal that works intermittently in the case of frequent power failures.
  • the method may include: the terminal executes a first program segment, where the first program segment may be one of multiple program segments of an application program. During the execution of the first program segment by the terminal, the terminal needs to use and modify the data in the first address interval. After executing the first program segment, the terminal calculates the first check code corresponding to the first address interval, for example, the first check code is calculated based on a cyclic redundancy check (Cyclic Redundancy Check, CRC) operation.
  • CRC Cyclic Redundancy Check
  • the terminal obtains a second check code corresponding to a second address interval, where the second address interval is an address interval other than the first address interval in the third address interval, and the third address interval is for executing the program to which the first program segment belongs.
  • the address range used when the second check code can be calculated when the terminal finishes executing other program segments. Since the third address interval is composed of the first address interval and the second address interval, the terminal can determine the third check code corresponding to the third address interval according to the first check code and the second check code.
  • the terminal stores the third check code in the non-volatile memory, where the third check code is used to verify the correctness of the data in the volatile memory after the terminal restores power supply, and the third address interval is located in the volatile memory. in memory.
  • the terminal calculates the check code of the address range used by the program segment after executing the program segment, and based on the check code and the check codes of other address ranges in the address range used by the whole program , the total check code of the address range used by the program can be determined.
  • the terminal no longer needs to calculate the check code for the entire address range where the data is stored, thereby reducing the energy consumption and time for calculating the check code, enabling the terminal to run continuously, and ensuring the real-time response performance of the terminal.
  • the volatile memory may further include a fourth address interval, and the data stored in the fourth address interval is the same as the data stored in the third address interval before the first program segment is executed, that is, the fourth address The interval is used to back up the data in the third address interval.
  • the third address interval is marked as a working interval
  • the fourth address interval is marked as a backup interval
  • the working interval is an interval used when the program is executed
  • the backup interval is used for backing up data in the working interval.
  • the terminal may copy the data in the third address interval to the third address interval, so as to ensure that the data in the third address interval serving as the working interval is the same as the data in the fourth address interval serving as the backup interval.
  • the data in the address range is the same, and the data in the work range is backed up. In this way, if the terminal is powered off during the execution of the first program segment, the terminal can copy the data in the backup section to the working section after restoring the power supply, so as to restore the data in the working section.
  • obtaining the second check code corresponding to the second address interval by the terminal includes: the terminal calculates the fourth check code of the address interval corresponding to the first address interval in the fourth address interval; The check code corresponding to the four address intervals and the fourth check code determine the second check code.
  • the terminal can determine to obtain the fourth address by calculating the check code of the address range corresponding to the first address range in the fourth address range, and based on the zero-padding property of the check operation and the check code of the fourth address range.
  • the check codes of other address ranges in the range that is, the second check codes corresponding to the second address range.
  • the method further includes: the terminal marks the fourth address interval as a working interval, and marks the third address interval as a backup interval; the terminal marks the third address interval as a backup interval; The data is copied to the fourth address range.
  • the method further includes: the terminal stores the first check code and the second check code in a volatile memory, where the first check code and the second check code are used to restore power supply at the terminal Then, it is compared with the third check code to verify the correctness of the data in the volatile memory. That is to say, after the power supply of the terminal is restored, a new check code can be calculated directly based on the first check code and the second check code in the volatile memory, and the new check code and the new check code can be stored in the NVM. The third check code of the volatile memory is compared to verify whether the data in the volatile memory has an error during the power failure.
  • the verification of the correctness of the data in the volatile memory can be realized, which can save the need to recalculate the data in the volatile memory.
  • the process of data check code saves the time for the terminal to verify the correctness of the data and prolongs the effective operation time of the terminal.
  • the terminal can decide whether to perform data verification according to the actual power-off duration, which avoids performing data verification every time the power is restored, and saves the terminal having to perform data verification. time to prolong the effective operation time of the terminal.
  • the method before the terminal executes the first program segment, the method further includes: executing one or more second program segments according to the voltage of the terminal being higher than the threshold voltage.
  • the second program segment may refer to any other program segment in the program to which the first program segment belongs, and the program may include one or more second program segments.
  • the terminal marks the address range used when executing one or more second program segments. According to the current voltage lower than the threshold voltage, the terminal calculates the check code corresponding to the marked address interval.
  • the terminal when the terminal is at a high battery level, the terminal will only mark the modified address range after executing the program segment; when the terminal is at a low battery level, the terminal will uniformly calculate the check code for the marked address range. In order to reduce the number of times of calculating the check code as much as possible.
  • the method further includes: the terminal periodically stores data in the volatile memory to the non-volatile memory, so as to periodically backup the detection point in the non-volatile memory. In this way, after the terminal restores power supply, when it is determined that the data in the volatile memory is verified incorrectly, the detection point stored in the NVM can be restored to the latest detection point, so as to avoid the terminal repeatedly executing the program frequently.
  • a second aspect of the present application provides a terminal, the terminal includes: a processing unit and an obtaining unit; a processing unit configured to execute a first program segment; and a processing unit configured to calculate a first check code corresponding to a first address interval,
  • the first address interval is the address interval used when executing the first program segment;
  • the obtaining unit is used to obtain the second check code corresponding to the second address interval, and the second address interval is the third address interval except the first address interval
  • the third address interval is the address interval used when executing the program to which the first program segment belongs;
  • the processing unit is also used to determine the third check code according to the first check code and the second check code
  • the third check code is the check code corresponding to the third address interval;
  • the processing unit is also used to store the third check code in the non-volatile memory, and the third check code is used after the terminal restores power supply
  • the correctness of the data in the volatile memory is checked, and the third address range is located in the volatile memory.
  • the volatile memory further includes a fourth address interval, and the data stored in the fourth address interval is the same as the data stored in the third address interval before the first program segment is executed; wherein, the third address interval is It is marked as a working area, the fourth address area is marked as a backup area, the working area is an area used when the program is executed, and the backup area is used for backing up data in the working area.
  • the processing unit is specifically configured to: calculate the fourth check code of the address interval corresponding to the first address interval in the fourth address interval; Check the code to determine the second check code.
  • the processing unit is further configured to: mark the fourth address interval as a working interval, and mark the third address interval as a backup interval; and copy the data of the third address interval to the fourth address interval.
  • the processing unit is further configured to: store the first check code and the second check code in a volatile memory, and the first check code and the second check code are used to restore power at the terminal Then, it is compared with the third check code to verify the correctness of the data in the volatile memory.
  • the processing unit is further configured to: obtain the power-off duration of the terminal after the power supply of the terminal is restored; if the power-off duration is less than the first duration, determine that the data in the volatile memory is correct; if the power-off duration is correct; If the duration is greater than the first duration and less than the second duration, it is determined that the correctness of the data in the volatile memory needs to be verified; if the power-off duration is greater than the second duration, it is determined that the data in the volatile memory is incorrect; wherein, The first duration is shorter than the second duration.
  • the processing unit is further configured to: determine a first address interval corresponding to the first program segment; acquire a check code corresponding to the first address interval, and store the check code corresponding to the first address interval in a volatile According to the check code corresponding to the first address interval, it is determined that the data in the first address interval is correct; based on the correctness of the data in the first address interval, it is determined to execute the first program segment.
  • the processing unit is further configured to: periodically store data in the volatile memory to the non-volatile memory.
  • a fifth aspect of the present application provides a computer program product, which, when executed on a computer, causes the computer to execute the method described in any one of the implementation manners of the first aspect.
  • a sixth aspect of the present application provides a chip including one or more processors. Part or all of the processor is used to read and execute the computer program stored in the memory, so as to execute the method in any possible implementation manner of any of the above aspects.
  • the chip includes a memory, and the memory and the processor are connected to the memory through a circuit or a wire.
  • the chip further includes a communication interface, and the processor is connected to the communication interface.
  • the communication interface is used for receiving data and/or information to be processed, the processor obtains the data and/or information from the communication interface, processes the data and/or information, and outputs the processing result through the communication interface.
  • the communication interface may be an input-output interface.
  • the method provided by the present application may be implemented by one chip, or may be implemented by multiple chips cooperatively.
  • FIG. 1 is a schematic diagram of a backup running state of an Internet of Things device according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of the distribution of another address range provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of terminal operation according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of the operation of a terminal after power supply is restored according to an embodiment of the present application.
  • the IoT device can collect energy from the operating environment to achieve power supply, such as harvesting energy such as light energy, radio frequency, pressure or thermal energy, and converting these energy into electrical energy.
  • energy harvesting to drive IoT devices can make the deployment of IoT devices highly flexible, reduce the limitations of usage scenarios, and have strong robustness.
  • IoT devices In the case of using energy harvesting to drive IoT devices, because the external energy source is unpredictable and unstable, IoT devices may be powered off frequently, making it difficult for programs in IoT devices to supply power in one A complete execution is completed within the cycle. In order to enable the continuous execution of programs during frequent power outages, intermittent computing is proposed and applied in IoT devices.
  • the IoT device In order to ensure that the IoT device can continue to execute the program in the case of frequent power failure, the IoT device needs to frequently backup the running state on the NVM during the operation process, that is, the value of the register and the variables to be used when the program is executed. to the NVM, so that after a power outage is encountered and power is restored, the operation can be resumed based on the backed-up operating state.
  • NVM Due to the slow write speed and write lifetime of NVM, frequently backing up the running state to NVM will quickly reduce the lifetime of NVM and eventually make IoT devices unusable. Therefore, in order to avoid frequent backup of the running state, a volatile memory is used in the related art to save data, so as to realize that the NVM is not used to backup the running state during a brief power failure.
  • Volatile memory such as SRAM
  • SRAM has faster read and write speed, lower power consumption and longer life than NVM, and has data retention characteristics.
  • a certain threshold usually 1.8V
  • the processor will stop working, and the SRAM can still keep the stored data without errors; as the power supply voltage continues to decrease, when the power supply voltage of the SRAM is low After a lower threshold (usually 0.4V), the data on the SRAM will continue to fail.
  • the power outage time is not very long. Therefore, the data retention feature of SRAM can be used, and the state is not backed up to the NVM during a short power failure, thereby reducing the state backup overhead of the system.
  • the length of time that the SRAM keeps data without errors is uncertain, it is necessary to detect whether the data on the SRAM is erroneous after power is restored.
  • the voltage threshold is set to a higher voltage value, which easily causes the IoT device to stop running when there is more power remaining, which affects the real-time response performance of the IoT device.
  • an embodiment of the present application provides a data processing method.
  • the check code of the address range used by the program segment is calculated, and based on the check code As well as the check codes of other address ranges in the address range used by the whole program, determine the total check code of the data in the volatile memory, and do not need to calculate the check code for the entire address range where the data is stored, thus reducing the calculation
  • the energy consumption and time of the check code enable the terminal to run continuously and ensure the real-time response performance of the terminal.
  • Check perform check operation on the target data, such as Cyclic Redundancy Check (CRC) operation, to obtain the check code of the data.
  • CRC Cyclic Redundancy Check
  • Verification The process of performing a check operation on the target data, and comparing the new check code obtained with the check code obtained by performing the check operation on the target data before to determine whether the target data has changed.
  • CRC A channel coding technology that can generate a fixed-digit check code based on data such as network packets or computer files, which is mainly used to detect errors that may occur after data transmission or storage.
  • CRC has mathematical properties such as linear additivity and zero-padding.
  • Equation 1 The linear additivity of CRC can be expressed as Equation 1:
  • a and B are two independent data
  • the linear additivity of CRC refers to the CRC result after A and B perform XOR operation, which is equal to the result of performing CRC operation on A and B respectively and then XOR operation.
  • Equation 2 The zero-padding property of CRC can be shown in Equation 2:
  • A0...0 means adding n zeros after the data A, that is, shifting the data A to the left by n bits.
  • the zero-padding property of CRC means that the CRC result after a left shift of data by n bits can be directly obtained by multiplying it by a certain coefficient, without having to recalculate the CRC of the entire data.
  • FIG. 2 is a schematic flowchart of a data processing method provided by an embodiment of the present application.
  • an embodiment of the present application provides a data processing method. The method is applied to a terminal that works intermittently. The method may include the following steps.
  • Step 201 the terminal executes the first program segment.
  • one or more application programs may be installed in the terminal, and each application program may include multiple program segments.
  • the application has its corresponding application code, and the terminal implements the running of the application by executing the application code.
  • An application code can be divided into multiple non-repetitive sub-code segments, which can also be called program segments or Atomic Execution Block (AEB).
  • the manner of dividing an application code into multiple program segments may include, but is not limited to, the following manners: acquiring multiple detection points in the application code based on the static detection technology, and separating the application code according to the multiple detection points, That is, the code segment between two adjacent detection points is a program segment; or, if the application code is written based on the task model, one application code can correspond to multiple tasks, and each application code in the application code can correspond to multiple tasks.
  • Each program segment is the subcode segment corresponding to each task.
  • Multiple program segments divided by an application code have a fixed execution sequence, and the terminal can execute the multiple program segments in sequence according to the execution sequence of the multiple program segments during operation.
  • the above-mentioned first program segment may be the program segment currently executed by the terminal.
  • Step 202 the terminal calculates a first check code corresponding to a first address interval, where the first address interval is an address interval used when executing the first program segment.
  • the data that the terminal needs to access is usually located in a fixed address range in the memory. By accessing the address range, the terminal can obtain and modify the data in the address range. This address range can be called the terminal execution program segment. address range used.
  • the address range used by the terminal when executing the program segment is fixed, and the terminal can determine the address range used when executing each program segment. For example, when the program developer pre-specifies the address range corresponding to the program segment, or captures the address range corresponding to each program segment based on the analysis tool in the related art, the terminal can be based on the mapping relationship between the program segment and the address range. , to determine the address range used when executing each program segment.
  • the terminal may determine the first address interval used when executing the first program segment, and after the terminal finishes executing the first program segment, calculate the first check code corresponding to the first address interval. For example, the terminal may calculate the check code corresponding to the data in the first address interval through CRC operation, thereby obtaining the first check code. The terminal may also obtain the first check code by calculating the first check code through other check operation methods, as long as the check operation method has the above-mentioned linear additivity and zero-padding properties, and this embodiment does not calculate the check code for the terminal.
  • the code method is specifically limited. For convenience of description, the following embodiments will be described below by taking the manner in which the terminal obtains the check code based on the CRC operation as an example.
  • Step 203 the terminal obtains the second check code corresponding to the second address interval, the second address interval is the address interval other than the first address interval in the third address interval, and the third address interval is the execution of the first program segment.
  • the address range used in the program is the address range used in the program.
  • each program segment in the terminal has a fixed corresponding address range
  • multiple address ranges corresponding to all the program segments in the same program may constitute the address range corresponding to the program.
  • program A includes program segment A1, program segment A2 and program segment A3, and the three program segments correspond to address interval 1, address interval 2 and address interval 3 respectively; then, the address interval 1, address interval 2 and address interval 3
  • the formed address range 4 is the address range corresponding to the program A.
  • address interval 1, address interval 2 and address interval 3 may be three separate address intervals, for example, the range of address interval 1 is 1-10, the range of address interval 2 is 11-15, and the range of address interval 3 is 16-20, the range of address interval 4 is 1-20.
  • Address interval 1, address interval 2 and address interval 3 may also have overlapping address ranges. For example, the range of address interval 1 is 1-10, the range of address interval 2 is 5-15, and the range of address interval 3 is 10-10. 20, the range of address interval 4 is also 1-20.
  • the terminal may determine the address interval (ie, the third address interval) used when executing the program to which the first program segment belongs, and determine the first address interval according to the third address interval and the first address interval.
  • an address interval other than the first address interval ie, the second address interval. Since the second address interval is the address interval used by the terminal when executing other program segments in the program, when the execution of other program segments is completed, the terminal will also calculate the check code of the address interval used by other program segments, so the terminal The second check code corresponding to the second address interval can be obtained.
  • Step 204 the terminal determines a third check code according to the first check code and the second check code, where the third check code is a check code corresponding to the third address interval.
  • the terminal may determine the third check code corresponding to the third address interval according to the first check code and the second check code based on the zero-padding property of the check operation. code verification.
  • FIG. 3 is a schematic diagram of distribution of an address range provided by an embodiment of the present application.
  • the third check code CS3 can be calculated according to the following formula 3:
  • the constant in formula 3 is a given constant value. It can be known from Equation 3 that, based on the check codes corresponding to the two address ranges respectively, the total check codes corresponding to the two address ranges can be calculated.
  • the above formula 3 takes the second check code as a check code corresponding to the second address interval as an example, and describes the process of calculating the third check code based on the first check code and the second check code.
  • the second address interval can also be divided into multiple address intervals, and the multiple address intervals constituting the second address interval have corresponding check codes, so the second check code may also refer to the second check code. Multiple check codes corresponding to multiple address ranges in the address range.
  • FIG. 4 is a schematic diagram of distribution of another address range provided by this embodiment of the present application.
  • the first address interval includes address interval 1
  • the first check code may refer to the check code corresponding to address interval 1, that is, the first check code is CRC (1010)
  • the second address interval includes In address interval 2 and address interval 3
  • the second check code may refer to the check codes corresponding to address interval 2 and address interval 3
  • the second check code may include CRC(1010) and CRC(1010).
  • the second check code refers to multiple check codes corresponding to the second address interval, it can also be calculated from the first check code and the second check code based on the zero-padding property of CRC.
  • the specific calculation process is not repeated in this embodiment.
  • Step 205 Store the third check code in the NVM, the third check code is used to check the correctness of the data in the volatile memory after the terminal restores power supply, and the third address interval is located in the volatile memory.
  • the third check code may be stored in the NVM to ensure the correctness of the third check code after the terminal is powered off. Since the data in the NVM will not be wrong after the terminal is powered off, after the terminal is powered off and the power is restored, the terminal can check the data in the third address range according to the third check code stored in the NVM. data is verified. That is to say, after the power supply is restored, the terminal can recalculate the check code of the third address interval located in the volatile memory, and compare the recalculated check code with the third check code stored in the NVM. Comparison.
  • the terminal can continue to execute the program based on the data in the volatile memory; if the two check codes are different, then It can be considered that the data in the volatile memory has an error during the power failure, and the terminal can no longer execute the program based on the data in the volatile memory.
  • FIG. 5 is a schematic diagram of operation comparison of a terminal according to an embodiment of the present application.
  • the terminal stops executing the program after its voltage reaches the pre-warning voltage, and the processor is actually powered off after a period of time.
  • the terminal is in a standby state, and the program cannot be continuously advanced, resulting in poor real-time responsiveness of the terminal.
  • the terminal can continue to execute the program segment after its voltage reaches the pre-warning voltage, and verify the address range used by the program segment to ensure the correctness of the data after the power supply is restored. In this way, until the processor is actually powered off, the terminal continues to advance the execution of the program until the processor is powered off and stops running. That is to say, in this solution, the terminal can prolong the execution time of the program as much as possible, which ensures the real-time response performance of the terminal.
  • the terminal may periodically store the data in the volatile memory to the NVM. For example, the terminal may copy the data in the volatile memory to the NVM every 5 minutes or 10 minutes, so as to periodically back up the detection point in the NVM. In this way, after the terminal restores power supply, when it is determined that the data in the volatile memory is verified incorrectly, the detection point stored in the NVM can be restored to the latest detection point, so as to avoid the terminal repeatedly executing the program frequently.
  • the terminal may also store the first check code and the second check code in a volatile memory, and store the third check code in the NVM.
  • the terminal can directly calculate a new check code based on the first check code and the second check code in the volatile memory, and store the new check code with the The third check code in the NVM is compared. If the new check code is the same as the third check code, it can be determined that there is no error in the first check code and the second check code in the volatile memory, that is, it can be considered that the data in the volatile memory is broken.
  • the verification of the correctness of the data in the volatile memory can be realized, and the verification of the data in the volatile memory can be omitted.
  • the code process saves the time for the terminal to verify the correctness of the data and prolongs the effective operation time of the terminal.
  • the terminal when the terminal uses the check code stored in the volatile memory and the check code stored in the NVM to verify the correctness of the data in the volatile memory after power off, the terminal Before executing each program segment, the program segment can also be verified based on the check code in the volatile memory to further ensure the correctness of the data.
  • the terminal may determine the first address interval corresponding to the first program segment, and obtain the check code corresponding to the first address interval, and the check code corresponding to the first address interval is stored in an easy-to-use address. in volatile memory. If the terminal determines that the data in the first address interval is correct according to the check code corresponding to the first address interval, it determines that the first program segment can be executed. If the data in the first address interval is incorrect, the terminal can restart the system or restore to the latest detection point stored on the NVM.
  • the volatile memory Since the volatile memory has data retention characteristics, it can be determined that no error has occurred in the volatile memory even if the data in the volatile memory is not verified when the terminal is powered off for a short time. In the case that the terminal is powered off for a long time, even if the data in the volatile memory is not verified, it can be determined that an error has occurred in the volatile memory.
  • the terminal may obtain its own power-off duration after power is restored. If the power-off duration of the terminal is less than the first duration, it is determined that the data in the volatile memory is correct; if the power-off duration of the terminal is greater than the first duration and less than the second duration, it is determined that the data in the volatile memory needs to be verified If the power-off duration of the terminal is longer than the second duration, it is determined that the data in the volatile memory is incorrect; wherein, the first duration is less than the second duration.
  • the designer of the terminal still determines two durations that can guarantee the accuracy, namely the first duration and the third duration. Two hours.
  • the first duration indicates that the power-off time of the terminal is short enough to ensure that the data on the volatile memory will not be wrong. Therefore, when the power-off duration of the terminal is shorter than the first duration, the terminal can skip the step of data verification.
  • the second duration indicates that the power-off time of the terminal is long enough, and the data on the volatile memory must have been wrong. Therefore, when the power-off duration of the terminal is longer than the second duration, the terminal can restart the system or restore to NVM. The most recent detection point stored on it.
  • the terminal can decide whether to perform data verification according to the actual power-off duration, which avoids performing data verification every time the power supply is restored, saves the time for the terminal to perform data verification, and prolongs the time of the terminal. Effective time to run.
  • FIG. 6a is a schematic structural diagram of a circuit for determining a power-off duration provided by an embodiment of the present application.
  • the circuit includes an intermittent power supply circuit shown in the left dashed box and a time keeping circuit shown in the right dashed box.
  • the time keeping circuit is composed of a switch S1, a switch S2, a capacitor C2 and a resistor.
  • the working mode of the time keeping circuit is:
  • the voltage across the capacitor C2 is detected to calculate the magnitude relationship between the power-off duration T off and the first duration T LB and the second duration T UB .
  • FIG. 6b is a schematic diagram of the voltage variation curve of a time keeping circuit provided by the embodiment of the present application.
  • the volatile memory in the terminal may further include a fourth address interval, and the data stored in the fourth address interval is the same as the data stored in the third address interval before executing the first program segment .
  • the third address interval is marked as a working buffer, and the working buffer refers to the interval used when the program is executed, that is, during the execution of the program, the corresponding data is accessed and modified in the working buffer.
  • the fourth address interval is marked as a backup buffer, and the backup buffer is used to back up the data of the working area.
  • the terminal may copy the data in the third address interval to the third address interval, so as to ensure that the data in the third address interval serving as the working interval is the same as the data in the fourth address interval serving as the backup interval.
  • the data in the address range is the same, and the data in the work range is backed up. In this way, if the terminal is powered off during the execution of the first program segment, the terminal can copy the data in the backup section to the working section after restoring the power supply, so as to restore the data in the working section.
  • FIG. 7 is a schematic flowchart of an execution program segment provided by an embodiment of the present application. As shown in FIG. 7 , the flow of the terminal executing the program segment before and after the power failure includes the following steps.
  • step 701 the terminal executes program segment 1.
  • the program segment 1 includes adding operation to the variable x. Therefore, the terminal performs an addition operation on the variable x in the working range, thereby modifying the value of the variable x from 0 to 1.
  • the terminal is powered off, and after a brief power off, the terminal restores the power supply.
  • step 702 after the terminal restores the power supply, the terminal copies the data in the backup section to the working section.
  • the terminal Since the terminal performs an addition operation on the variable x in the working area before the power failure, after the power supply is restored, the value of the variable x in the working area is 1, and the value of the variable x in the backup area is still 0.
  • the terminal may copy the data in the backup section to the working section, so that the value of the variable x in the working section is still 0.
  • step 703 the terminal executes program segment 1 again.
  • the terminal restores the data in the work area, the terminal continues to run, that is, executes the program segment 1 again, and performs an addition operation on the variable x in the work area, thereby changing the value of the variable x from 0 to 1.
  • the backup interval can back up the data in the working area, so as to ensure that after the terminal is powered off and the power supply is restored, the data in the working area can be restored, so that the data in the working area can be restored.
  • the phenomenon of data errors in the terminal is avoided, and the correctness of the data is ensured.
  • the terminal in order to ensure that the backup interval can play an effective role in data backup, the terminal needs to perform data copy after each execution of the program segment, so as to ensure that the data in the backup interval and the working interval are the same.
  • the process of performing data copying by the terminal may include: after the execution of the first program segment is completed, the terminal marks the fourth address interval as a working interval, and marks the third address interval as a backup interval; then, The terminal then copies the data in the third address range to the fourth address range.
  • the terminal after executing the first program segment, the terminal marks the third address range, which was originally a working range, as a backup range by performing an operation of exchanging pointers, and marks the fourth address range, which was originally a backup range, as a work range. range to realize the exchange of the working range and the backup range. Then, the terminal copies the data in the fourth address interval to the third address interval to ensure data consistency.
  • the terminal marks the third address range as the working range with the pointer "0", and marks the fourth address range as the backup range with the pointer "1"; after executing the first program segment, the terminal By exchanging the pointers, the third address range is marked as a backup range by the pointer "1", and the fourth address range is marked as the working range by the pointer "0".
  • the quick interchange between the working area and the backup area is realized by exchanging pointers, which can effectively avoid the phenomenon of data errors due to power failure during the data copying process.
  • the terminal restores power supply, the terminal still needs to copy the data in the backup area (ie the fourth address area) to the working area (ie the third address area).
  • the backup interval since the backup interval has already copied some data in the working interval before the power failure, the data in the backup interval has actually been contaminated and is wrong data. In this way, restoring the data in the backup area to the working area will also cause the data in the working area to be wrong data, thereby affecting the normal operation of the terminal.
  • the terminal when the terminal is provided with a working area and a backup area, the terminal may also acquire the second check code corresponding to the second address interval based on the data in the backup area.
  • the process that the terminal obtains the second check code corresponding to the second address interval may include: the terminal calculates the fourth check code of the address interval corresponding to the first address interval in the fourth address interval; The corresponding check code and the fourth check code determine the second check code.
  • the fourth address interval is a backup interval corresponding to the third address interval
  • the address scope of the fourth address interval and the address scope of the third address interval are the same and fixed.
  • the address range of the third address interval may be 1-100
  • the address range of the fourth address interval may be 101-200.
  • the address range with the address range of 50-60 in the third address range corresponds to the address range with the address range of 150-160 in the fourth address range
  • the address range with the address range of 50-60 and the address range of 150-160 The data on the address range is the same.
  • the terminal can determine to obtain the fourth address by calculating the check code of the address range corresponding to the first address range in the fourth address range, and based on the above-mentioned zero-padding property and the check code of the fourth address range.
  • the check codes of other address ranges in the range that is, the second check codes corresponding to the second address range.
  • FIG. 8 is a schematic diagram of calculating a check code according to an embodiment of the present application.
  • the data in the backup section is the same as that in the working section, and the address section S0 and the address section S1 in the backup section correspond to the address section S0' and the address section S1' in the working section, respectively.
  • the check codes corresponding to the address interval S0 and the address interval S1 are calculated after executing other program segments.
  • the program segment 1 accesses and modifies the address range S2' in the work range, so that the work range is divided into three address ranges: S01', S2', and S11'.
  • the backup interval can also be divided into three corresponding address intervals: S01, S02+S12, and S11.
  • the check code corresponding to the work interval after executing the program segment 1 can actually be calculated based on the check codes corresponding to the address interval S01 ′, the address interval S2 ′ and the address interval S11 ′ respectively.
  • the sub-check code of the address interval S2' can be obtained by directly performing the check code calculation on the data in the address interval S2'.
  • the check codes corresponding to the address interval S01' and the address interval S11' can be obtained by calculating the check codes corresponding to the address interval S01 and the address interval S11 in the backup interval.
  • the second check code corresponding to the second address interval in the working interval By calculating the second check code corresponding to the second address interval in the working interval based on the data in the backup interval, when the first address interval is small, the time and energy consumed by the CRC operation can be effectively reduced, and the terminal can be improved. After the execution of the program segment, the efficiency of the check code is calculated, so that the electric power of the terminal can be saved and the effective operation time of the terminal can be prolonged.
  • the power in the terminal can be maintained at a relatively high level, so as to ensure that the terminal will not be powered off for a long period of time in the future.
  • the terminal does not need to calculate the check code every time after executing the program segment, so as to save the energy consumption of the terminal.
  • the terminal executes one or more second program segments according to whether the voltage of the terminal is higher than the threshold voltage.
  • the second program segment may refer to any other program segment in the program to which the first program segment belongs, and the program may include one or more second program segments.
  • the terminal marks the address range used when executing one or more second program segments. According to the current voltage lower than the threshold voltage, the terminal calculates the check code corresponding to the marked address interval.
  • This threshold voltage is used to indicate that the terminal is at a low battery level, that is, the terminal may face power outage at any time.
  • the value of the threshold voltage may be determined according to the actual energy harvesting capability of the terminal, which is not specifically limited in this embodiment.
  • the terminal can be used to mark the address range used when executing the program segment after each program segment is executed; the terminal can also be used to mark the address range used when executing the multiple program segments after executing the multiple program segments.
  • the address range to use can be used.
  • the current voltage of the terminal may be detected once to determine whether the current voltage is lower than the threshold voltage. In this way, when the terminal determines that the current voltage is lower than the threshold voltage, the terminal uniformly calculates the check code for the marked address interval, so as to reduce the number of times of calculating the check code as much as possible.
  • FIG. 9 is a schematic flowchart of terminal operation provided by an embodiment of the present application.
  • the running process after the terminal is powered on includes the following steps.
  • Step S1 After each time the terminal restores power supply, first determine the time length of the last power outage. If the power-off time is too long, that is, T off >T UB , the terminal restarts or restores to the last detection point stored on the NVM.
  • T off represents the power-off duration of the terminal
  • T UB represents the above-mentioned second duration, that is, the upper limit of the time during which the data on the volatile memory must be in error.
  • the flag is used to mark the correctness of the data on the volatile memory. When the flag is 0, it indicates that the data is correct, and the verification operation on the data can be skipped.
  • Step S4 In the case of T LB ⁇ T off ⁇ T UB , before the terminal executes the program segment, it is necessary to verify whether the check code corresponding to the data on the volatile memory is correct. That is, the terminal verifies whether the check code corresponding to the data on the volatile memory is correct by comparing whether the check code stored in the volatile memory is the same as the check code stored on the NVM. If the verification fails (that is, the check codes are not the same), it means that an error occurs in the data on the volatile memory, and the terminal restarts or restores to the latest detection point stored on the NVM.
  • Step S5 the terminal determines whether the current voltage V is greater than the threshold voltage V T .
  • Step S6 when the voltage V is higher than the threshold voltage VT , it means that the terminal is currently at a high battery level, and the high battery level working mode can be executed, that is, the check code does not need to be calculated after each execution of the program segment.
  • Step S7 If the data to be used in the program segment passes the verification or does not need to be verified for the data to be used in the program segment, the terminal copies the data in the backup section to the work section.
  • Step S8 the terminal executes the program segment.
  • Step S9 After the execution of the program segment is completed, the terminal marks the modified address range (ie, marks the address range where the data used by the program segment is located), then schedules the next ready program segment, and repeats steps S6 to S9.
  • the modified address range ie, marks the address range where the data used by the program segment is located
  • Step S10 when the voltage V is lower than the threshold voltage VT , it means that the terminal is currently at a low battery level and needs to execute the low battery level working mode, that is, the check code is calculated after each execution of the program segment.
  • the terminal calculates the check code of the marked address range, calculates and obtains the total check code of the address range used by the whole program, and stores the total check code in the NVM.
  • the terminal may copy all data on the volatile memory to the NVM as a detection point.
  • Step S12 the terminal exchanges the pointers of the backup interval and the working interval, namely marking the original backup interval in the volatile memory as the working interval and marking the original working interval as the backup interval, and copying the data in the backup interval after the exchange of pointers to the work area.
  • Step S15 the terminal determines whether the data to be used in the program segment passes the verification, and if the verification fails, the terminal restarts or restores to the latest detection point stored on the NVM.
  • Step S16 if the verification is passed, the terminal executes the program segment.
  • Step S17 After executing the program segment, the terminal exchanges the pointers of the backup area and the working area.
  • Step S18 the terminal calculates the check code corresponding to the address interval used to execute the program segment in the backup interval, and calculates the total check code corresponding to the address interval used by the program according to the check code, and calculates the total check code. Stored in NVM.
  • Step S19 the terminal copies the data in the backup section to the working section, then schedules the next ready program segment, and repeats steps S13 to S19 until the power is turned off.
  • FIG. 10a is a schematic diagram of a relationship between a program segment and an address interval provided by an embodiment of the present application.
  • the code of the application program includes program segment 1, program segment 2, and program segment 3, and program segment 1, program segment 2, and program segment 3 use address ranges DB1, DB2, and DB3 respectively.
  • FIG. 10b is a schematic flowchart of a terminal executing a program segment at a low battery level according to an embodiment of the present application. As shown in Fig. 10b, the process of the terminal executing the program segment at a low power level includes the following steps.
  • the terminal successfully executes program segment 1.
  • DB1 in the workspace is updated to DB1'.
  • the terminal detects and finds that the current voltage value is lower than the threshold voltage, and the terminal enters the low power level working mode.
  • the terminal calculates the check code of the modified address range, that is, calculates the check code of DB1', and obtains CS1.
  • the terminal when executing the previous program segment, the terminal also calculates and obtains the check codes of other address ranges in the working range, which are CS0, CS_delta and CSn respectively. In this way, the terminal can calculate the total check code CS_total corresponding to the working interval according to the multiple sub-check codes corresponding to the working interval, and store the CS_total in the NVM.
  • the terminal also copies the data in the working area to the backup area.
  • the terminal is ready to schedule and execute program segment 2, and program segment 2 will use the address range DB2 in the work range. Since the data correctness of DB2 has not been verified in this power-on cycle, the terminal can verify the correctness of the data intervals DB2, DB3 and DB4 through the verification code CS_delta. If the verification result is that there is no error in the data, the terminal can execute program segment 2.
  • the terminal schedules the execution of program segment 2, and the modifications to DB2 during the execution of program segment 2 all occur in the work area.
  • the terminal successfully executes program segment 2, and DB2 in the work area is updated to DB2'.
  • the terminal quickly updates DB2' to the backup range by exchanging pointers.
  • the terminal calculates the check code of the modified address range, that is, calculates the check code of DB2', and obtains CS2.
  • the terminal can obtain it by calculating the check codes CS_delta of DB2 to DB4 and the check codes CS(DB2) of DB2, that is, CS_delta-CS(DB2).
  • the terminal can calculate the total check code CS_total according to the multiple sub-check codes CS0, CS1, CS2, CS_delta-CS(DB2) and CSn corresponding to the working interval, and store the CS_total in the NVM.
  • the terminal copies DB2' in the backup section to the working section, and verifies the data correctness of DB3. Since DB2 has been verified through CS_delta at time t2, the terminal can determine that program segment 3 is scheduled to be executed.
  • the terminal schedules the execution of program segment 3, and the modifications to DB3 during the execution of program segment 3 all occur in the work area.
  • FIG. 11 is a schematic diagram of operation of a terminal after power supply is restored according to an embodiment of the present application. As shown in Figure 11, the terminal performs the following steps after power is restored.
  • Step 1101 the terminal verifies whether the check code on the volatile memory is correct through the total check code CS_total on the NVM. That is, the terminal recalculates a new total check code based on the check code on the volatile memory (ie CS0, CS1, CS2, CS_delta and CSn), and compares the new total check code with the total check code stored on the NVM. The check codes are compared. If the two are the same, it means that the check code on the volatile memory is correct. If the two are different, it means that the data on the volatile memory is wrong.
  • Step 1102 if the verification code on the volatile memory is correct, the terminal verifies whether the data to be used by the program segment 3 (ie DB3 ) is correct based on the verification code CS_delta.
  • Step 1103 when the data to be used in the program segment 3 is verified to be correct, the terminal copies the data in the backup section to the working section.
  • Step 1104 the terminal schedules the execution of program segment 3.
  • FIG. 12 is a schematic structural diagram of a terminal 1200 provided by an embodiment of the present application.
  • the terminal 1200 includes: a processing unit 1201 and an obtaining unit 1202; the processing unit 1201 is used for executing the first program segment; the processing unit 1201, which is also used to calculate the first check code corresponding to the first address range, where the first address range is the address range used when executing the first program segment; the obtaining unit 1202 is used to obtain the second address range corresponding to the second address range.
  • the second address interval is the address interval other than the first address interval in the third address interval
  • the third address interval is the address interval used when executing the program to which the first program segment belongs
  • the processing unit 1201 also It is used to determine the third check code according to the first check code and the second check code
  • the third check code is the check code corresponding to the third address interval
  • the processing unit 1201 is also used for the third check code.
  • the code is stored in the non-volatile memory
  • the third verification code is used to verify the correctness of the data in the volatile memory after the terminal restores power supply
  • the third address range is located in the volatile memory.
  • the volatile memory further includes a fourth address interval, and the data stored in the fourth address interval is the same as the data stored in the third address interval before the first program segment is executed; wherein, the third address interval is It is marked as a working area, the fourth address area is marked as a backup area, the working area is an area used when the program is executed, and the backup area is used for backing up data in the working area.
  • the processing unit 1201 is specifically configured to: calculate the fourth check code of the address interval corresponding to the first address interval in the fourth address interval; Check code, determine the second check code.
  • the processing unit 1201 is further configured to: mark the fourth address range as a working range, and mark the third address range as a backup range; and copy the data of the third address range to the fourth address range.
  • the processing unit 1201 is further configured to: store the first check code and the second check code in a volatile memory, and the first check code and the second check code are used for recovery at the terminal After the power is supplied, it is compared with the third check code to verify the correctness of the data in the volatile memory.
  • the processing unit 1201 is further configured to: obtain the power-off duration of the terminal after the power supply of the terminal is restored; if the power-off duration is less than the first duration, determine that the data in the volatile memory is correct; If the power-on duration is greater than the first duration and less than the second duration, it is determined that the correctness of the data in the volatile memory needs to be verified; if the power-off duration is greater than the second duration, it is determined that the data in the volatile memory is incorrect; wherein , the first duration is less than the second duration.
  • the processing unit 1201 is further configured to: execute one or more second program segments according to the voltage of the terminal being higher than the threshold voltage; mark the address range used when executing the one or more second program segments ; Calculate the check code corresponding to the marked address interval according to the voltage of the terminal being lower than the threshold voltage.
  • the processing unit 1201 is further configured to: determine the first address range corresponding to the first program segment; obtain the check code corresponding to the first address range, and store the check code corresponding to the first address range in an easy-to-use In the volatile memory; according to the check code corresponding to the first address interval, it is determined that the data in the first address interval is correct; based on the correctness of the data in the first address interval, it is determined to execute the first program segment.
  • the processing unit 1201 is further configured to: periodically store the data in the volatile memory to the non-volatile memory.
  • FIG. 13 is a schematic structural diagram of a terminal 100 according to an embodiment of the present application.
  • the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an energy collection module 140, a power management module 141, a battery 142, Antenna 1, Antenna 2, mobile communication module 150, wireless communication module 160, sensor module 170, etc.
  • the sensor module 170 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
  • the terminal 100 may include more or less components than shown, or some components may be combined, or some components may be separated, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the gyro sensor may be used to determine the motion attitude of the terminal 100 .
  • Air pressure sensors are used to measure air pressure.
  • the acceleration sensor can detect the magnitude of the acceleration of the terminal 100 in various directions (including three axes or six axes). When the terminal 100 is stationary, the magnitude and direction of gravity can be detected.
  • the ambient light sensor is used to sense ambient light brightness.
  • the fingerprint sensor is used to collect fingerprints.
  • a temperature sensor is used to detect temperature.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • graphics processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller may be the nerve center and command center of the terminal 100 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I1C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I1S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I1C integrated circuit
  • I1S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the terminal 100 .
  • the terminal 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the energy collection module 140 is used to obtain energy input from the operating environment, such as light energy, radio frequency, pressure or heat energy, and converts the energy into electrical energy to be stored in the battery 142 .
  • the power management module 141 is used to connect the battery 142 , the energy collection module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the energy collection module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the wireless communication module 160, and the like.
  • the wireless communication function of the terminal 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 1G/3G/4G/5G, etc. applied on the terminal 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves and radiate it out through the antenna 2 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
  • the wireless communication module 160 can provide applications on the terminal 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 1 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation
  • the antenna 1 of the terminal 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the terminal 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the terminal 100 by executing the instructions stored in the internal memory 121 .
  • the internal memory 121 may include a volatile memory 121A and a non-volatile memory 121B, the volatile memory 121A is used to store data used in the process of executing the program, and the non-volatile memory 121B is used to save the data in the volatile memory 121A.
  • the check code corresponding to the data and the data in the backup volatile memory 121A.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

La présente demande divulgue un procédé de traitement de données, applicable à un terminal fonctionnant par intermittence et consistant : à exécuter un premier segment de programme ; à calculer un premier code de vérification correspondant à un premier intervalle d'adresse, le premier intervalle d'adresse étant un intervalle d'adresse utilisé lors de l'exécution du premier segment de programme ; à obtenir un deuxième code de vérification correspondant à un deuxième intervalle d'adresse, le deuxième intervalle d'adresse étant un intervalle d'adresse dans un troisième intervalle d'adresse excluant le premier intervalle d'adresse et le troisième intervalle d'adresse étant un intervalle d'adresse utilisé lors de l'exécution d'un programme auquel le premier segment de programme appartient ; à déterminer un troisième code de vérification selon le premier code de vérification et le deuxième code de vérification, et à stocker le troisième code de vérification dans une mémoire non volatile (NVM), de façon à vérifier des données dans une mémoire volatile après que l'alimentation électrique a été rétablie. Selon la présente solution, il n'est pas nécessaire de calculer un code de vérification pour l'ensemble de l'intervalle d'adresse où les données sont stockées et, ainsi, la consommation d'énergie et le temps de calcul du code de vérification peuvent être réduits, ce qui permet au terminal de continuer à fonctionner, et de garantir l'efficacité de réponse en temps réel du terminal.
PCT/CN2021/118918 2020-09-21 2021-09-17 Procédé de traitement de données et appareil associé WO2022057872A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010997523.3A CN114253758A (zh) 2020-09-21 2020-09-21 一种数据处理方法及相关装置
CN202010997523.3 2020-09-21

Publications (1)

Publication Number Publication Date
WO2022057872A1 true WO2022057872A1 (fr) 2022-03-24

Family

ID=80776443

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/118918 WO2022057872A1 (fr) 2020-09-21 2021-09-17 Procédé de traitement de données et appareil associé

Country Status (2)

Country Link
CN (1) CN114253758A (fr)
WO (1) WO2022057872A1 (fr)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220382563A1 (en) * 2021-05-31 2022-12-01 Autochips Inc. Program startup method, electronic system, and non-transitory storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140519A (zh) * 2006-09-04 2008-03-12 广达电脑股份有限公司 嵌入式系统及其开机程序码自动备份方法
CN101710253A (zh) * 2009-11-25 2010-05-19 安凯(广州)微电子技术有限公司 嵌入式系统的深度休眠方法
CN103763064A (zh) * 2014-01-26 2014-04-30 中国电子科技集团公司第五十八研究所 适用于超高速通讯系统的循环冗余校验码生成方法与电路
CN108038021A (zh) * 2017-11-13 2018-05-15 北京全路通信信号研究设计院集团有限公司 一种计算机程序运行阶段代码内存校验方法
CN109426579A (zh) * 2017-08-28 2019-03-05 西门子公司 机床加工文件的中断恢复方法及适用该方法的机床
WO2019132464A1 (fr) * 2017-12-28 2019-07-04 삼성전자 주식회사 Appareil d'affichage et son procédé de fonctionnement
CN111552590A (zh) * 2020-04-16 2020-08-18 国电南瑞科技股份有限公司 一种电力二次设备内存位翻转的检测恢复方法及系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140519A (zh) * 2006-09-04 2008-03-12 广达电脑股份有限公司 嵌入式系统及其开机程序码自动备份方法
CN101710253A (zh) * 2009-11-25 2010-05-19 安凯(广州)微电子技术有限公司 嵌入式系统的深度休眠方法
CN103763064A (zh) * 2014-01-26 2014-04-30 中国电子科技集团公司第五十八研究所 适用于超高速通讯系统的循环冗余校验码生成方法与电路
CN109426579A (zh) * 2017-08-28 2019-03-05 西门子公司 机床加工文件的中断恢复方法及适用该方法的机床
CN108038021A (zh) * 2017-11-13 2018-05-15 北京全路通信信号研究设计院集团有限公司 一种计算机程序运行阶段代码内存校验方法
WO2019132464A1 (fr) * 2017-12-28 2019-07-04 삼성전자 주식회사 Appareil d'affichage et son procédé de fonctionnement
CN111552590A (zh) * 2020-04-16 2020-08-18 国电南瑞科技股份有限公司 一种电力二次设备内存位翻转的检测恢复方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220382563A1 (en) * 2021-05-31 2022-12-01 Autochips Inc. Program startup method, electronic system, and non-transitory storage medium

Also Published As

Publication number Publication date
CN114253758A (zh) 2022-03-29

Similar Documents

Publication Publication Date Title
US10261701B2 (en) Methods to communicate a timestamp to a storage system
TWI592800B (zh) 記憶體管理方法及使用所述方法的儲存控制器
US7774390B2 (en) Apparatus for collecting garbage block of nonvolatile memory according to power state and method of collecting the same
EP2581826A1 (fr) Procédé et dispositif de démarrage à froid d'un terminal mobile android
US10592126B2 (en) Memory management method, memory storage device and memory control circuit unit
JP2008518283A (ja) 最適化された不揮発性記憶システム
TWI489466B (zh) 記憶體抹除方法、記憶體控制器與記憶體儲存裝置
US10089182B2 (en) Energy-efficient nonvolatile microprocessor
CN103823769A (zh) 计算机系统及数据回复方法
WO2022057872A1 (fr) Procédé de traitement de données et appareil associé
KR20150045253A (ko) 데이터 저장 장치
TWI648634B (zh) 記憶體管理方法、記憶體儲存裝置及記憶體控制電路單元
US11693567B2 (en) Memory performance optimization method, memory control circuit unit and memory storage device
TWI473103B (zh) 快閃記憶體儲存裝置及其不良儲存區域的判定方法
KR20210039171A (ko) 메모리 시스템을 포함하는 데이터 처리 시스템에서 동작 정보를 송수신하는 방법 및 장치
CN115687174A (zh) 一种固态硬盘动态垃圾回收的方法及固态硬盘
US20190146909A1 (en) Valid data management method and storage controller
TW201721653A (zh) 記憶體管理方法、記憶體控制電路單元與記憶體儲存裝置
US20210263846A1 (en) Processor system
US7743277B2 (en) System and method for detecting and reducing data corruption in a storage device
WO2022057933A1 (fr) Procédé et appareil d'exécution d'application et dispositif informatique
CN116414618A (zh) 一种数据备份方法以及装置
CN106873901B (zh) 存储器管理方法、存储器控制电路单元与存储器存储装置
Mikhaylov et al. Energy efficient data restoring after power-downs for wireless sensor networks nodes with energy scavenging
CN102855192B (zh) 存储器抹除方法、存储器控制器与存储器储存装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21868694

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21868694

Country of ref document: EP

Kind code of ref document: A1