CN111324488A - Program backup processing method and device - Google Patents

Program backup processing method and device Download PDF

Info

Publication number
CN111324488A
CN111324488A CN202010089127.0A CN202010089127A CN111324488A CN 111324488 A CN111324488 A CN 111324488A CN 202010089127 A CN202010089127 A CN 202010089127A CN 111324488 A CN111324488 A CN 111324488A
Authority
CN
China
Prior art keywords
program
partitions
backup
area
areas
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010089127.0A
Other languages
Chinese (zh)
Other versions
CN111324488B (en
Inventor
游佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202010089127.0A priority Critical patent/CN111324488B/en
Publication of CN111324488A publication Critical patent/CN111324488A/en
Application granted granted Critical
Publication of CN111324488B publication Critical patent/CN111324488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup
    • 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/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data

Landscapes

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

Abstract

The invention provides a program backup processing method and a device, wherein the method comprises the following steps: acquiring the lengths of program areas of a plurality of partitions of a main program area of a memory, wherein the main program area comprises the plurality of partitions, and the plurality of partitions comprise the program area and a reserved area; splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas to a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area; the target reserved area is arranged at the last of the backup partition, the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions, the problem that a minimum system with a cut function is started after failure in the related technology and can be used only after secondary upgrading is solved, the space used for backup can be greatly reduced, the effect of full backup is achieved, secondary upgrading is not needed, and the system can be directly used.

Description

Program backup processing method and device
Technical Field
The invention relates to the technical field of information, in particular to a program backup processing method and device.
Background
Because function updating or bug repairing of the existing intelligent device can involve a program upgrading function, if an abnormality occurs in the program upgrading process, correct operation of the device can be directly influenced, so that the program generally needs to be backed up, and the program can be recovered or started from a backup program when the upgrading abnormality occurs.
Fig. 1 is a schematic diagram of a flash backup partitioning method according to the related art, and as shown in fig. 1, a piece of flash is divided into 2 completely equal partitions, one is a main program partition, and the other is a backup program partition, a 1:1 backup is performed, a program of a normal partition is completely copied in a backup area, and when an upgrade is abnormal, the program can be restored or restarted through the backup program. The method is widely used in current program backup, and has the defects that the method mainly has requirements on the space size of a flash, and the reserved space of the flash is small in small-sized devices, especially devices sensitive to cost, so that half of the space is required to be reserved for backup, and the storage space is not enough in many cases.
If the size of the flash is not enough to be divided into 2 equal partitions, backup cannot be performed in a 1:1 manner, fig. 2 is a schematic diagram of a flash backup partition manner according to a minimum system set in the related art, and as shown in fig. 2, a minimum system capable of being started can be placed in a backup area to save space in a general way, so that the minimum system can be ensured to upgrade a main program area when upgrade is abnormal, and the device cannot be completely hung up after upgrade fails.
The scheme can be generally used when the reserved space of the flash is insufficient, but has the following defects:
if the main program area is damaged after the upgrade fails, the equipment cannot be normally used after being started, a minimum system with cut functions is started after the upgrade fails, the minimum system can be used only after the upgrade is carried out for the second time, and the experience feeling is poor.
Aiming at the problem that a minimum system with a cut function is started after failure in the related technology and can be used only after secondary upgrading, a solution is not provided.
Disclosure of Invention
The embodiment of the invention provides a program backup processing method and device, which at least solve the problem that a minimum system with cut functions is started after failure in the related technology and can be used only after secondary upgrading.
According to an embodiment of the present invention, there is provided a program backup processing method including:
acquiring the lengths of program areas of a plurality of partitions of a main program area of a memory, wherein the main program area comprises the plurality of partitions, and the plurality of partitions comprise the program area and a reserved area;
splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas to a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
and setting a target reserved area at the last of the backup partitions, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions.
Optionally, the method further comprises:
splicing the program areas of the partitions according to the lengths of the program areas of the partitions, backing up the spliced program areas into one backup partition of the backup program areas of the memory, reserving a target area at the initial position of the backup partition, and indicating the number of the backed-up partitions, the sequence of the backup partitions and the lengths of the program areas of the partitions through the target area.
Optionally, after splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions and then backing up the spliced program areas of the plurality of partitions into one backup partition of the backup program area of the memory, the method further includes:
and if the program of the main program area is detected to be damaged, restoring the programs of the plurality of partitions of the main program area through the backup partition of the backup program area.
Optionally, the restoring the programs of the plurality of partitions of the main program area through the backup partition of the backup program area includes:
erasing the plurality of partitions in the main program area;
and restoring the programs in the backup partitions to a plurality of partitions of the main program area according to the sequence of the backup partitions.
Optionally, obtaining lengths of program areas of a plurality of partitions of the main program area of the memory comprises:
for each partition of the plurality of partitions, performing the following operations, wherein each partition is referred to as a current partition when performing the following operations:
and determining the length between the position of the first program with the non-preset identification and the starting positions of the plurality of partitions from the last forward search of the current partition as the length of the program area of the current partition.
According to another embodiment of the present invention, there is also provided a program backup processing apparatus including:
the device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring the lengths of program areas of a plurality of partitions of a main program area of the storage, the main program area comprises the plurality of partitions, and the plurality of partitions comprise the program areas and reserved areas;
the backup module is used for splicing the program areas of the partitions according to the lengths of the program areas of the partitions and backing up the spliced program areas to a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
and the setting module is used for setting a target reserved area at the last of the backup partitions, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions.
Optionally, the apparatus further comprises:
and the indicating module is used for splicing the program areas of the partitions according to the lengths of the program areas of the partitions, backing up the spliced program areas to a backup partition of the backup program area of the memory, reserving a target area at the initial position of the backup partition, and indicating the number of the backed-up partitions, the sequence of the backup partitions and the lengths of the program areas of the partitions through the target area.
Optionally, the apparatus further comprises:
and the recovery module is used for recovering the programs of the plurality of partitions of the main program area through the backup partitions of the backup program area if the programs of the main program area are detected to be damaged.
Optionally, the recovery module comprises:
an erasing submodule for erasing the plurality of partitions in the main program area;
and the recovery submodule is used for recovering the programs in the backup partitions to the plurality of partitions in the main program area according to the sequence of the backup partitions.
Optionally, the obtaining module includes:
an execution submodule, configured to perform the following for each partition of the plurality of partitions, wherein each partition is referred to as a current partition when performing the following:
and determining the length between the position of the first program with the non-preset identification and the starting positions of the plurality of partitions from the last forward search of the current partition as the length of the program area of the current partition.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the lengths of the program areas of a plurality of subareas of a main program area of a memory are obtained, wherein the main program area comprises the subareas, and the subareas comprise the program areas and reserved areas; splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas to one backup partition of the backup program areas of the memory; and a target reserved area is arranged at the last of the backup partitions, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the partitions, so that the problem that a minimum system with a cut function is started after failure in the related technology and can be used only after secondary upgrading is solved, a compact full backup mode is used in a memory, the space used for backup can be greatly reduced, the effect of full backup is achieved, secondary upgrading is not needed, and the system can be directly used.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic diagram of a flash backup partitioning manner according to the related art;
FIG. 2 is a diagram illustrating a flash backup partitioning scheme according to a related art system for setting a minimum;
fig. 3 is a block diagram of a hardware configuration of a mobile terminal of the program backup processing method according to the embodiment of the present invention;
FIG. 4 is a flow chart of a program backup processing method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a program full backup storage manner according to the related art;
FIG. 6 is a schematic illustration of a compact backup storage according to an embodiment of the present invention;
fig. 7 is a block diagram of a program backup processing device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking a mobile terminal as an example, fig. 3 is a hardware structure block diagram of the mobile terminal of the program backup processing method according to the embodiment of the present invention, as shown in fig. 3, the mobile terminal 10 may include one or more processors 102 (only one is shown in fig. 3) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 3 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 3, or have a different configuration than shown in FIG. 3.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to the message receiving method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a program backup processing method operating in the mobile terminal or the network architecture is provided, and fig. 4 is a flowchart of the program backup processing method according to the embodiment of the present invention, as shown in fig. 4, the flowchart includes the following steps:
step S402, acquiring the lengths of program areas of a plurality of sub-areas of a main program area of a memory, wherein the main program area comprises the plurality of sub-areas, and the plurality of sub-areas comprise the program areas and reserved areas;
for an embedded system, data files required generally can be divided into running program files and resource files, and the embodiment of the present invention is mainly directed to backup of the running program files, and certainly, the present invention is also applicable to the resource files.
Further, for each partition of the plurality of partitions, performing the following operations, wherein each partition is referred to as a current partition when performing the following operations: and determining the length between the position of the first program with the non-preset identification and the starting positions of the plurality of partitions from the last forward search of the current partition as the length of the program area of the current partition.
Step S404, splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas into a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
specifically, only the program area of the main program area containing the program files is backed up and spliced in one backup partition of the backup program area, so that the space occupied by the backup program files is effectively saved.
Step S406, a target reserved area is set at the last of the backup partitions, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions.
Specifically, a reserved area is uniformly arranged behind the program files backed up in the backup partition, and the space occupied by the reserved area is far smaller than the sum of the reserved areas of the program areas in the main program area, so that the space occupied by the backup is greatly reduced.
Through the steps S402 to S406, the problem that the system started after failure is the minimum system with the cut functions and can be used only after secondary upgrade in the related art can be solved, a compact full backup mode is used in the memory, the space used for backup can be greatly reduced, and the effect of full backup can be achieved, and the system can be directly used without secondary upgrade.
According to the embodiment of the invention, the program areas of the plurality of partitions are spliced according to the lengths of the program areas of the plurality of partitions, the spliced program areas are backed up in one backup partition of the backup program area of the memory, a target area is reserved at the initial position of the backup partition, and the number of the backed-up partitions, the sequence of the backup partitions and the lengths of the program areas of the plurality of partitions are indicated by the target area, so that the backed-up content can be restored to the main program area subsequently.
Optionally, after splicing the program areas of the multiple partitions according to the lengths of the program areas of the multiple partitions and then backing up the spliced program areas of the multiple partitions into one backup partition of a backup program area of the memory, if it is detected that the program of the main program area is damaged, the programs of the multiple partitions of the main program area are restored through the backup partition of the backup program area. Further, erasing the plurality of partitions in the main program area; and restoring the programs in the backup partitions to a plurality of partitions of the main program area according to the sequence of the backup partitions.
The memory can be a flash, particularly a Nand flash, and devices in related technologies have requirements on backup functions, and backup mainly ensures that the devices can normally operate after being upgraded or abnormal due to other reasons. The embodiment of the invention is based on a compact program backup mode, analyzes the program storage mode of full backup 1:1 in Nand flash, and can find most practical use cases as follows, fig. 5 is a schematic diagram of the program full backup storage mode according to the related art, as shown in fig. 5, each partition has a plurality of unused areas, shadow parts belong to the unused areas in the partition, and the areas are reserved, on one hand, the Nand flash has bad blocks, generally 5% of the bad blocks are allowed, the positions of the bad blocks are random, but the partition is performed according to a fixed format, so that a space of the bad blocks must be reserved for each partition; another aspect is to reserve space for subsequent extensions of the program.
According to the backup mode of 1:1, a lot of space is actually wasted, fig. 6 is a schematic diagram of a storage mode of a compact backup according to an embodiment of the present invention, as shown in fig. 6, these wasted reserved areas are saved back, a compact mode is adopted for backup, only areas with programs are backed up, the whole backup program is compacted to form a backup partition, after being merged into a partition, only a bad block area of a large partition needs to be reserved, and meanwhile, an area reserved for subsequent expansion can also be saved (generally, the reserved area of each partition is not used last, only a part needs to be reserved properly). The compact backup approach also requires an extra header information to record the actual size of each partition.
If only the actual area of the program in each partition is backed up, the actual area size of each partition needs to be acquired first. The Nand flash has a characteristic that each byte of data of an unused block after erasure is 0xff, and there is an ingenious way to obtain the size of each partition: from the back to the front, starting with the last 0xff, the actual size of the program can be calculated if data other than 0xff is found, indicating that the end of the actual program area is found. Certainly, there is an extreme case that the last of the program is composed of many all-0 xff byte data, and it does not matter, this part of data may not need to be backed up, the whole partition is erased before the program is restored, the erased data is 0xff, and then restoration is performed, the data which is not modified after the restoration is completed is all-0 xff, which is equivalent to that this part of all-0 xff data which is not backed up is also restored.
By the embodiment of the invention, a compact full backup mode is used in the Nand flash, the space used by backup can be greatly reduced, and the effect of full backup is achieved. Compared with a full backup mode, the compact backup only backs up the part actually provided with the program, the quantity of the backed-up program is reduced, the calculation method is simpler, the calculation quantity is small, the backup speed is higher than the full backup speed, and the backup time is saved.
Example 2
According to another embodiment of the present invention, there is also provided a program backup processing apparatus, and fig. 7 is a block diagram of the program backup processing apparatus according to the embodiment of the present invention, as shown in fig. 7, including:
an obtaining module 72, configured to obtain lengths of program areas of multiple partitions of a main program area of a memory, where the main program area includes the multiple partitions, and the multiple partitions each include the program area and a reserved area;
a backup module 74, configured to splice the program areas of the multiple partitions according to the lengths of the program areas of the multiple partitions, and backup the spliced program areas to a backup partition of a backup program area of the memory, where a space of the main program area is greater than a space of the backup program area;
a setting module 76, configured to set a target reserved area at the last of the backup partitions, where the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions.
Optionally, the apparatus further comprises:
and the indicating module is used for splicing the program areas of the partitions according to the lengths of the program areas of the partitions, backing up the spliced program areas to a backup partition of the backup program area of the memory, reserving a target area at the initial position of the backup partition, and indicating the number of the backed-up partitions, the sequence of the backup partitions and the lengths of the program areas of the partitions through the target area.
Optionally, the apparatus further comprises:
and the recovery module is used for recovering the programs of the plurality of partitions of the main program area through the backup partitions of the backup program area if the programs of the main program area are detected to be damaged.
Optionally, the recovery module comprises:
an erasing submodule for erasing the plurality of partitions in the main program area;
and the recovery submodule is used for recovering the programs in the backup partitions to the plurality of partitions in the main program area according to the sequence of the backup partitions.
Optionally, the obtaining module 72 includes:
an execution submodule, configured to perform the following for each partition of the plurality of partitions, wherein each partition is referred to as a current partition when performing the following:
and determining the length between the position of the first program with the non-preset identification and the starting positions of the plurality of partitions from the last forward search of the current partition as the length of the program area of the current partition.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, obtaining the lengths of program areas of a plurality of subareas of a main program area of a memory, wherein the main program area comprises the subareas, and the subareas comprise the program areas and reserved areas;
s2, splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas into a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
s3, setting a target reserved area at the last of the backup subareas, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of subareas.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Example 4
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, obtaining the lengths of program areas of a plurality of subareas of a main program area of a memory, wherein the main program area comprises the subareas, and the subareas comprise the program areas and reserved areas;
s2, splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas into a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
s3, setting a target reserved area at the last of the backup subareas, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of subareas.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A program backup processing method, comprising:
acquiring the lengths of program areas of a plurality of partitions of a main program area of a memory, wherein the main program area comprises the plurality of partitions, and the plurality of partitions comprise the program area and a reserved area;
splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions, and backing up the spliced program areas to a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
and setting a target reserved area at the last of the backup partitions, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions.
2. The method of claim 1, further comprising:
splicing the program areas of the partitions according to the lengths of the program areas of the partitions, backing up the spliced program areas into one backup partition of the backup program areas of the memory, reserving a target area at the initial position of the backup partition, and indicating the number of the backed-up partitions, the sequence of the backup partitions and the lengths of the program areas of the partitions through the target area.
3. The method of claim 2, wherein after splicing the program areas of the plurality of partitions according to the lengths of the program areas of the plurality of partitions and then backing up the spliced program areas of the plurality of partitions into one backup partition of the spare area of the memory, the method further comprises:
and if the program of the main program area is detected to be damaged, restoring the programs of the plurality of partitions of the main program area through the backup partition of the backup program area.
4. The method of claim 3, wherein restoring the programs of the plurality of partitions of the main program area through the backup partition of the backup program area comprises:
erasing the plurality of partitions in the main program area;
and restoring the programs in the backup partitions to a plurality of partitions of the main program area according to the sequence of the backup partitions.
5. The method of any of claims 1 to 4, wherein obtaining the lengths of the program areas of the plurality of partitions of the main program area of the memory comprises:
for each partition of the plurality of partitions, performing the following operations, wherein each partition is referred to as a current partition when performing the following operations:
and determining the length between the position of the first program with the non-preset identification and the starting positions of the plurality of partitions from the last forward search of the current partition as the length of the program area of the current partition.
6. A program backup processing apparatus, characterized by comprising:
the device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring the lengths of program areas of a plurality of partitions of a main program area of the storage, the main program area comprises the plurality of partitions, and the plurality of partitions comprise the program areas and reserved areas;
the backup module is used for splicing the program areas of the partitions according to the lengths of the program areas of the partitions and backing up the spliced program areas to a backup partition of a standby program area of the memory, wherein the space of the main program area is larger than that of the standby program area;
and the setting module is used for setting a target reserved area at the last of the backup partitions, wherein the space of the target reserved area is smaller than the sum of the spaces of the reserved areas of the plurality of partitions.
7. The apparatus of claim 6, further comprising:
and the indicating module is used for splicing the program areas of the partitions according to the lengths of the program areas of the partitions, backing up the spliced program areas to a backup partition of the backup program area of the memory, reserving a target area at the initial position of the backup partition, and indicating the number of the backed-up partitions, the sequence of the backup partitions and the lengths of the program areas of the partitions through the target area.
8. The apparatus of claim 7, further comprising:
and the recovery module is used for recovering the programs of the plurality of partitions of the main program area through the backup partitions of the backup program area if the programs of the main program area are detected to be damaged.
9. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method of any one of claims 1 to 5 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 5.
CN202010089127.0A 2020-02-12 2020-02-12 Program backup processing method and device Active CN111324488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010089127.0A CN111324488B (en) 2020-02-12 2020-02-12 Program backup processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010089127.0A CN111324488B (en) 2020-02-12 2020-02-12 Program backup processing method and device

Publications (2)

Publication Number Publication Date
CN111324488A true CN111324488A (en) 2020-06-23
CN111324488B CN111324488B (en) 2023-12-08

Family

ID=71165178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010089127.0A Active CN111324488B (en) 2020-02-12 2020-02-12 Program backup processing method and device

Country Status (1)

Country Link
CN (1) CN111324488B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6542975B1 (en) * 1998-12-24 2003-04-01 Roxio, Inc. Method and system for backing up data over a plurality of volumes
FR2856753A1 (en) * 2003-06-25 2004-12-31 Gaz De France DEVICE FOR FIXING EQUIPMENT ON A VIBRATORY DECOUPLING PARTITION
US20050125464A1 (en) * 2003-12-04 2005-06-09 International Business Machines Corp. System, method and program for backing up a computer program
CN101127004A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 System and method for accessing data on flash memory
US7546323B1 (en) * 2004-09-30 2009-06-09 Emc Corporation System and methods for managing backup status reports
US20120158666A1 (en) * 2010-12-17 2012-06-21 International Business Machines Corporation Restoring a restore set of files from backup objects stored in sequential backup devices
CN103336749A (en) * 2013-05-31 2013-10-02 南京熊猫电子股份有限公司 Access method of FLASH parameter of embedded system
CN103744694A (en) * 2013-12-24 2014-04-23 武汉烽火众智数字技术有限责任公司 Dynamic partition searching device based on Nand flash memory and method thereof
CN104461654A (en) * 2014-12-27 2015-03-25 西安大唐电信有限公司 OBD equipment function unit and firmware classification optional upgrading method
WO2017000567A1 (en) * 2015-07-02 2017-01-05 中兴通讯股份有限公司 Bootrom upgrading method and device
CN106776122A (en) * 2016-11-23 2017-05-31 武汉光迅科技股份有限公司 A kind of method of main-apparatus protection in start-up course based on Flash
CN108111336A (en) * 2017-12-05 2018-06-01 宁波三星医疗电气股份有限公司 A kind of Power Line Carrier Communication Module program startup, upgrading and switching method
CN109032632A (en) * 2018-07-13 2018-12-18 深圳高新兴物联科技有限公司 A kind of FOTA upgrade method, wireless communication terminal and storage medium
CN109408282A (en) * 2018-08-31 2019-03-01 深圳市有方科技股份有限公司 Application Backup restoration methods, equipment and computer readable storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6542975B1 (en) * 1998-12-24 2003-04-01 Roxio, Inc. Method and system for backing up data over a plurality of volumes
FR2856753A1 (en) * 2003-06-25 2004-12-31 Gaz De France DEVICE FOR FIXING EQUIPMENT ON A VIBRATORY DECOUPLING PARTITION
US20050125464A1 (en) * 2003-12-04 2005-06-09 International Business Machines Corp. System, method and program for backing up a computer program
US7546323B1 (en) * 2004-09-30 2009-06-09 Emc Corporation System and methods for managing backup status reports
CN101127004A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 System and method for accessing data on flash memory
US20120158666A1 (en) * 2010-12-17 2012-06-21 International Business Machines Corporation Restoring a restore set of files from backup objects stored in sequential backup devices
CN103336749A (en) * 2013-05-31 2013-10-02 南京熊猫电子股份有限公司 Access method of FLASH parameter of embedded system
CN103744694A (en) * 2013-12-24 2014-04-23 武汉烽火众智数字技术有限责任公司 Dynamic partition searching device based on Nand flash memory and method thereof
CN104461654A (en) * 2014-12-27 2015-03-25 西安大唐电信有限公司 OBD equipment function unit and firmware classification optional upgrading method
WO2017000567A1 (en) * 2015-07-02 2017-01-05 中兴通讯股份有限公司 Bootrom upgrading method and device
CN106776122A (en) * 2016-11-23 2017-05-31 武汉光迅科技股份有限公司 A kind of method of main-apparatus protection in start-up course based on Flash
CN108111336A (en) * 2017-12-05 2018-06-01 宁波三星医疗电气股份有限公司 A kind of Power Line Carrier Communication Module program startup, upgrading and switching method
CN109032632A (en) * 2018-07-13 2018-12-18 深圳高新兴物联科技有限公司 A kind of FOTA upgrade method, wireless communication terminal and storage medium
CN109408282A (en) * 2018-08-31 2019-03-01 深圳市有方科技股份有限公司 Application Backup restoration methods, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN111324488B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
CN106155915B (en) Data storage processing method and device
CN109032632B (en) FOTA upgrading method, wireless communication terminal and storage medium
CN109558160A (en) Upgrade method, embedded system
CN110647333A (en) Firmware upgrading method and equipment configured to upgrade firmware therein
CN104915226A (en) Network device software starting method, device and network device
CN112612524A (en) Method, device and equipment for starting Linux system and storage medium
CN111104147A (en) BMC upgrading method, device, terminal and storage medium
CN113672270A (en) Upgrading method, computer system and remote upgrading device
CN112860291B (en) Firmware upgrading method and device
CN108664255B (en) Software upgrading method and device
CN107623705B (en) Storage mode upgrading method, device and system based on video cloud storage system
CN112214353A (en) Firmware recovery method and device, computer equipment and storage medium
CN111324488B (en) Program backup processing method and device
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN112527446A (en) Time zone synchronization method, equipment and terminal equipment
CN113490112B (en) Wireless earphone, data processing method of wireless earphone and storage medium
CN116072202A (en) Storage device management method, system and storage medium
CN105786650A (en) Data management method and device
CN107438011B (en) Method and device for determining configuration information, network manager and system
CN115878381A (en) Data recovery method and device based on SRM disc, storage medium and electronic device
CN110795155B (en) System starting method and device, electronic equipment and storage medium
CN114995852A (en) Equipment upgrading method, equipment and computer readable storage medium
CN113778485A (en) System operation method and device of electronic chip, electronic chip and storage medium
CN117234544B (en) Method and device for recovering system of server equipment
CN117742761A (en) Firmware updating method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant