CN112328287A - Embedded equipment system updating method, device, equipment and storage medium - Google Patents

Embedded equipment system updating method, device, equipment and storage medium Download PDF

Info

Publication number
CN112328287A
CN112328287A CN202011331837.6A CN202011331837A CN112328287A CN 112328287 A CN112328287 A CN 112328287A CN 202011331837 A CN202011331837 A CN 202011331837A CN 112328287 A CN112328287 A CN 112328287A
Authority
CN
China
Prior art keywords
partition
system partition
updating
table file
data
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
CN202011331837.6A
Other languages
Chinese (zh)
Other versions
CN112328287B (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202011331837.6A priority Critical patent/CN112328287B/en
Publication of CN112328287A publication Critical patent/CN112328287A/en
Application granted granted Critical
Publication of CN112328287B publication Critical patent/CN112328287B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Abstract

The embodiment of the application provides a method and a device for updating a system of an embedded device, an electronic device and a storage medium, wherein a partition table file is added into a system update package, so that the system partition of the embedded device can be divided into a system partition mode represented by the partition table file, and the conversion of the embedded device between a single system partition and a double system partition can be realized. After the storage chip of the embedded device is aged, the embedded device is updated from a single system to a system double backup, so that the condition that the embedded device cannot be started can be reduced. When the space of the storage chip of the embedded equipment is insufficient, the embedded equipment is updated to a single system from the system double backup, so that the condition of system upgrading failure caused by insufficient storage space is reduced.

Description

Embedded equipment system updating method, device, equipment and storage medium
Technical Field
The present application relates to the field of embedded device technologies, and in particular, to a method and an apparatus for updating an embedded device system, an electronic device, and a storage medium.
Background
With the development of computer technology, embedded devices with various functions are widely applied to the production and living fields of people.
The embedded device is a special computer device which takes application as a center, is based on modern computer technology and can flexibly cut software and hardware modules according to user requirements (function, reliability, cost, volume, power consumption, environment and the like). The embedded device can operate independently, and the software content of the embedded device generally only comprises a software running environment and an operating system thereof. Compared with a common computer, the embedded device has great diversity, and cannot realize a large-capacity storage function because a large-capacity medium matched with the embedded device is not available.
Generally, according to the number of system backups, the embedded devices can be divided into single backup system devices and dual backup system devices.
The single backup system device is an embedded device with only one set of system, and has the advantages of saving storage space and having the disadvantage that the system cannot be started after being damaged, for example, for the storage of a Flash memory chip, the erasing data is unstable due to the storage characteristics of the Flash memory chip, when the system in the single backup system device is abnormal, the device cannot be started, and the system can only be repaired by burning the Flash memory chip again.
The double backup system device is an embedded device with two sets of systems, and has the advantages that the system safety is high, and when one set of system is damaged, the other set of system can be used for starting and repairing the damaged system. The double backup system device has the disadvantage of occupying more storage space due to the fact that two complete systems are stored.
In the prior art, an embedded device is already solidified into a single backup system device or a dual backup system device when being shipped from a factory. With the use of embedded devices, the memory chip will be aged, the system in the memory chip is more easily damaged, and the single backup system device is easily unable to be started. With the upgrade of the embedded device system, the data volume of the system may increase, and the space of the memory chip of the dual-backup system device may be insufficient, which may cause a failure of the system upgrade of the dual-backup system device.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for updating an embedded device system, an electronic device, and a storage medium, so as to reduce the abnormality of the embedded device. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides an embedded device system updating method, where the method includes:
acquiring a system update package;
analyzing the system update package to obtain a partition table file and system update data;
judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode;
if the system partitions are different, newly dividing the system partitions according to the number of the system partitions represented by the partition table file to obtain target system partitions;
and finishing the system updating of the target system partition according to the system updating data.
In one embodiment, the system partition mode represented by the partition table file is a dual-system partition, and the current actual system partition mode is a single-system partition;
if the system partition is different from the target system partition, repartitioning the system partition according to the system partition mode represented by the partition table file to obtain the target system partition, including:
if the two system partitions are different, dividing the two system partitions according to the double system partitions represented by the partition table file to obtain target system partitions, wherein the target system partitions comprise a first system partition and a second system partition;
the completing the system update of the target system partition according to the system update data includes:
according to the system updating data, performing system updating on the first system partition to obtain updated system data;
and copying the updated system data in the first system partition into the second system partition.
In an embodiment, after the updating the system data to be updated in the first system partition according to the system update data to obtain updated system data, the method further includes:
adding a markup file in the first system partition;
prior to the copying of the updated system data in the first system partition into the second system partition, the method further comprises:
and restarting the embedded equipment according to the system data in the first system partition where the marking file is located.
In one embodiment, the system partition mode represented by the partition table file is a single system partition, and the current actual system partition mode is a dual system partition;
if the system partition is different from the target system partition, repartitioning the system partition according to the system partition mode represented by the partition table file to obtain the target system partition, including:
and if the two system partitions are different, according to the single system partition represented by the partition table file, re-dividing the original double system partition into the target system partition, wherein the target system partition is the single system partition.
In one embodiment, the native dual system partition includes a third system partition and a fourth system partition, and the identification of the target system partition is the same as the identification of the third system partition; the method further comprises the following steps:
and when the error message aiming at the fourth system partition is acquired, discarding the error message.
In a second aspect, an embodiment of the present application provides an apparatus for updating an embedded device system, where the apparatus includes:
the system updating package obtaining module is used for obtaining a system updating package;
the system updating package analyzing module is used for analyzing the system updating package to obtain a partition table file and system updating data;
the partition mode judging module is used for judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode;
the system partition dividing module is used for dividing the system partitions again according to the system partition mode represented by the partition table file to obtain target system partitions under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode;
and the system updating module is used for finishing the system updating of the target system partition according to the system updating data.
In one embodiment, the system partition mode represented by the partition table file is a dual-system partition, and the current actual system partition mode is a single-system partition;
the system partition module is specifically configured to: under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, dividing to obtain a target system partition according to the double system partitions represented by the partition table file, wherein the target system partition comprises a first system partition and a second system partition;
the system update module includes:
the first system partition updating submodule is used for carrying out system updating on the first system partition according to the system updating data to obtain updated system data;
and the second system partition updating submodule is used for copying the updated system data in the first system partition into the second system partition.
In one embodiment, the system partitioning module is further configured to: adding a markup file in the first system partition;
the device further comprises: an embedded device restart module to: and restarting the embedded equipment according to the system data in the first system partition where the marking file is located.
In one embodiment, the system partition mode represented by the partition table file is a single system partition, and the current actual system partition mode is a dual system partition;
the system partition module is specifically configured to: and under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, the original double-system partition is divided into the target system partition again according to the single-system partition represented by the partition table file, wherein the target system partition is the single-system partition.
In one embodiment, the native dual system partition includes a third system partition and a fourth system partition, and the identification of the target system partition is the same as the identification of the third system partition; the device further comprises:
and the error message processing module is used for discarding the error message after the error message for the fourth system partition is acquired.
In a third aspect, an embodiment of the present application provides an embedded device, including a processor and a memory;
the memory is used for storing a computer program;
the processor is used for realizing the system updating method of any embedded equipment in the application when the program stored in the memory is executed.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any embedded device system updating method in the present application.
The method, the device, the electronic equipment and the storage medium for updating the embedded equipment system provided by the embodiment of the application acquire a system update package; analyzing the system update package to obtain a partition table file and system update data; judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode; if the system partitions are different, the system partitions are re-divided according to the system partition mode represented by the partition table file to obtain target system partitions; and finishing the system updating of the target system partition according to the system updating data. In the embodiment of the application, the partition table file is added into the system update package, so that the system partition of the embedded device can be divided into the system partition mode represented by the partition table file, and the conversion of the embedded device between a single system partition and a double system partition can be realized. After the storage chip of the embedded device is aged, the embedded device is updated from a single system to a system double backup, so that the condition that the embedded device cannot be started can be reduced. When the space of the storage chip of the embedded equipment is insufficient, the embedded equipment is updated to a single system from the system double backup, so that the condition of system upgrading failure caused by insufficient storage space is reduced. Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a first flowchart illustrating an embedded device system updating method according to an embodiment of the present application;
fig. 2 is a second flowchart of an embedded device system updating method according to an embodiment of the present application;
fig. 3 is a third flowchart illustrating an embedded device system updating method according to an embodiment of the present application;
fig. 4 is a fourth flowchart illustrating an embedded device system updating method according to an embodiment of the present application;
fig. 5 is a fifth flowchart illustrating an embedded device system updating method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an embedded device system updating apparatus according to an embodiment of the present application;
fig. 7 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
First, terms in the present application are explained:
double backup system: the system program is stored in the two partitions, and when data of one partition is abnormal, the system program can be started from the backup partition and erased again. In the case of a system double backup, the system program will occupy two partitions.
Upgrading: and the user directly carries out maintainability upgrading on the system of the equipment through the network browser.
In the prior art, an embedded device is already solidified into a single backup system device or a dual backup system device when being shipped from a factory. With the use of the embedded device, the memory chip will be aged, the system in the memory chip is more easily damaged, and the single backup system device is easily unable to be started. With the upgrade of the embedded device system, the data volume of the system may increase, and the space of the memory chip of the dual-backup system device may be insufficient, which may cause a failure of the system upgrade of the dual-backup system device.
In order to reduce the above-mentioned abnormality of the embedded device, an embodiment of the present application provides a method for updating an embedded device system, where the method includes:
acquiring a system update package;
analyzing the system update package to obtain a partition table file and system update data;
judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode;
if the system partitions are different, the system partitions are re-divided according to the system partition mode represented by the partition table file to obtain target system partitions;
and finishing the system updating of the target system partition according to the system updating data.
In the embodiment of the application, the partition table file is added into the system update package, so that the system partition of the embedded device can be divided into the system partition mode represented by the partition table file, and the conversion of the embedded device between a single system partition and a double system partition can be realized. After the storage chip of the embedded device is aged, the embedded device is updated from a single system to a system double backup, so that the condition that the embedded device cannot be started can be reduced. When the space of the storage chip of the embedded equipment is insufficient, the embedded equipment is updated to a single system from the system double backup, so that the condition of system upgrading failure caused by insufficient storage space is reduced.
Referring to fig. 1, fig. 1 is a schematic flowchart of an embedded device system update method according to an embodiment of the present application, where the method includes:
and S11, acquiring a system update package.
The method for updating the embedded device in the embodiment of the application can be realized by the embedded device, and specifically, the embedded device can be a video camera, a hard disk video recorder, a splicing display and the like.
The embedded device may obtain the system update package in a wired or wireless manner, for example, the system update package may be uploaded to the embedded device through a browser interface, or the system update package may be imported into the embedded device through a flash disk. The embedded device may also download system update packages from a server over a network.
And S12, analyzing the system update package to obtain a partition table file and system update data.
The system update package includes the partition table file in addition to the system update data. The partition table file indicates the number of system partitions, for example, the partition table file may indicate a single system partition (system partition number 1) or a double system partition (system partition number 2). In addition, the partition table file may also include an identification of the system partition, such as a name. And the embedded equipment analyzes the system update package to obtain a partition table file and system update data.
S13, it is determined whether the system partition method indicated by the partition table file is the same as the current actual system partition method.
The system partition mode is single system partition or double system partition. The embedded device acquires the current actual system partition mode and compares whether the current actual system partition mode is the same as the system partition mode represented by the partition table file. And if the system data in the current actual system partition is the same as the system data in the actual system partition, directly updating the system data in the actual system partition by using the system updating data.
And S14, if not, re-dividing the system partition according to the system partition mode indicated by the partition table file to obtain the target system partition.
And under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, the embedded device repartitions the system partition according to the system partition mode represented by the partition table file to obtain the target system partition.
For example, the current actual system partition mode of the embedded device is a dual system partition, that is, there are two system partitions, and the partition table file indicates a single system partition, then the embedded device merges the current two system partitions into one system partition, that is, the target system partition.
For example, the current actual system partition mode of the embedded device is a dual system partition, that is, there is one system partition, and the partition table file indicates the dual system partition, then the embedded device divides the current one system partition into two system partitions, and at this time, the target system partition includes two system partitions.
And S15, completing the system update of the target system partition according to the system update data.
And completing the system updating aiming at the target system partition by utilizing the system updating data. For example, if the embedded device has one system partition, the system update may be performed only for the one system partition. And if the embedded device has two system partitions, respectively updating the two system partitions.
In the embodiment of the application, the partition table file is added into the system update package, so that the system partition of the embedded device can be divided into the system partition mode represented by the partition table file, and the conversion of the embedded device between a single system partition and a double system partition can be realized. After the storage chip of the embedded device is aged, the embedded device is updated from a single system to a system double backup, so that the condition that the embedded device cannot be started can be reduced. When the space of the storage chip of the embedded equipment is insufficient, the embedded equipment is updated to a single system from the system double backup, so that the condition of system upgrading failure caused by insufficient storage space is reduced.
In a possible embodiment, the system partition mode represented by the partition table file is a dual-system partition, and the current actual system partition mode is a single-system partition; referring to fig. 2, if the system partition is not repartitioned according to the system partition mode indicated by the partition table file in the above S14, obtaining the target system partition includes:
and S141, if the two system partitions are different, dividing the two system partitions according to the two system partitions shown by the partition table file to obtain target system partitions, wherein the target system partitions comprise a first system partition and a second system partition.
When the partition table file indicates a dual system partition and the current actual system partition mode of the embedded device is a single system partition, one system partition of the embedded device needs to be divided into two system partitions, namely a first system partition and a second system partition, wherein the first system partition and the second system partition are collectively called a target system partition.
In step S15, the system updating of the target system partition is completed according to the system update data, including:
and S151, according to the system updating data, performing system updating on the first system partition to obtain updated system data.
The identifier of the first system partition is the same as the identifier of the system partition before division, for example, the partition name is the same, and according to the update logic of the single backup system, the device upgrade logic installs the program of the system update data into the first system partition.
S152, copying the updated system data in the first system partition to the second system partition.
After the system data in the first system partition is updated, the updated system data in the first system partition is copied to the second system partition, so that the system update of the whole target system partition is completed.
The system update can be divided into full update and incremental update, and in general, the embedded device adopts a full update mode, and the system update data needs to include complete system data. In this case, the formatting operation may be performed simultaneously during the partitioning of the system partition.
With the development of technology, partitioning system partitions may not have to be formatted. Therefore, the embedded device can be updated in an incremental updating mode, when the incremental updating mode is adopted, the system updating data only comprises part of system data, the integrity of the original system data in the embedded device needs to be ensured at this time, the original system partition is divided into two system partitions in an unformatted mode, and one system partition retains the identification and the data of the original system partition and is called as a first system partition. The other system partition sets an identification that is distinct from the first system partition and is referred to as the second system partition. The first system partition comprises original system data, the equipment upgrading logic installs a program of system updating data into the first system partition, and upgrades the original system data, so that updated system data is obtained. And copying the updated system data in the first system partition into the second system partition, thereby completing the system update of the whole target system partition.
In the embodiment of the application, the single backup system of the embedded device is updated to the double backup system, and the situation that the embedded device cannot be started due to aging of a storage chip of the embedded device can be reduced.
In a possible implementation manner, after the updating the system data to be updated in the first system partition according to the system update data to obtain updated system data, referring to fig. 3, the method further includes:
s153, adding a markup file to the first system partition.
The markup file is used to indicate that the system data in the system partition is complete. In the process of starting the embedded equipment of the double-backup system, whether a marker file exists in each system partition is detected, and system data in the system partition with the marker file is selected preferentially to start.
Before copying the updated system data in the first system partition to the second system partition, the method further includes:
and S16, restarting the embedded device according to the system data in the first system partition where the markup file is located.
And after the system data in the first system partition is updated, and the mark file is added into the first system partition, restarting the embedded equipment. The embedded device selects system data in a system partition (a first system partition) with a marker file to start, and copies the system data in the first system partition to a second system partition.
After the embedded device completes the update of the first system partition, because the embedded device currently uses the system data corresponding to the single system partition, the update of the second system partition is not directly started. Adding a mark file in the first system partition, and then restarting the embedded equipment; during the restarting process, the embedded device checks the mark files in the first system partition and the second system partition, and the embedded device is started according to the system data in the first system partition because the mark files exist in the first system partition. After the embedded device is restarted, the actually used system data corresponding to the dual system partitions can be copied from the system data in the first system partition to the second system partition, so that the update of the second system partition is completed.
In the embodiment of the application, the mark file is used to distinguish the first system partition with the system updating completed from the second system partition with the system not updated, thereby reducing the starting error condition,
in a possible embodiment, the system partition mode represented by the partition table file is a single system partition, and the current actual system partition mode is a dual system partition;
referring to fig. 4, if the difference is different, repartitioning the system partition according to the system partition mode represented by the partition table file to obtain the target system partition includes:
and S142, if the two system partitions are different, re-dividing the original double system partitions into target system partitions according to the single system partitions represented by the partition table file, wherein the target system partitions are single system partitions.
When the partition table file indicates a single system partition and the current actual system partition of the embedded device is a dual system partition, two system partitions of the embedded device need to be merged into one system partition to obtain a target system partition. The device upgrade logic installs a program of system update data into the target system partition.
In the embodiment of the application, the dual-backup system of the embedded device is updated into the single-backup system, and the condition that the system of the embedded device fails to be updated due to insufficient space of a storage chip of the embedded device can be reduced.
In a possible manner, the original dual system partition includes a third system partition and a fourth system partition, and the identifier of the target system partition is the same as the identifier of the third system partition; referring to fig. 5, the above method further includes:
and S17, when the error message for the fourth system partition is acquired, discarding the error message.
Although the update of the third system partition is completed, the currently and actually used system of the embedded device is a dual-backup system, so after the update of the third system partition is completed, the system data is automatically updated for the fourth system partition and a marker file is added to the fourth system partition, but at this time, the fourth system partition does not exist, so an error message is generated, and after the error message for the fourth system partition is acquired, the error message is directly discarded, so that the situation that the system repeatedly attempts to update the fourth system partition according to the error message is prevented.
In the embodiment of the present application, the third system partition and the fourth system partition do not mean that there are three system partitions or four system partitions in the embedded device, and the third and fourth system partitions are only used to distinguish one system partition from another system partition, regardless of the number. And under the condition that the identification of the target system partition is the same as the identification of the third system partition, according to the updating logic of the dual-backup system, the fourth system partition and the added marker file are also required to be updated, the added object of the marker file is set as the fourth system partition, and error reporting messages aiming at the fourth system partition system can be received, wherein the error reporting messages comprise error reporting messages of failed updating of the fourth system partition system and error reporting messages of failed adding of the marker file of the fourth system partition system. The embedded device directly discards the error message without performing other processing on the error message.
In the embodiment of the present application, when the identifier of the target system partition is the same as the identifier of the third system partition, the added object of the markup file is set as the fourth system partition, and the error message for the fourth system partition system is discarded, so that system resource waste caused by analyzing and processing the error message for the fourth system partition system can be reduced, and processing of unnecessary error messages can be reduced.
In a possible implementation, before the obtaining the system update package, the method further includes: and sending system partition attribute parameters, wherein the system partition attribute parameters comprise the total capacity of the system partition and health parameters of a storage chip for storing system data.
The embedded device may send the system partition attribute parameters to the update server, where the system partition attribute parameters include a total capacity of a system partition of the embedded device and health parameters of a memory chip storing system data. The health parameter of the memory chip is used to indicate the performance of the memory chip, and may be, for example, factory time, accumulated IO (input/output) error count, accumulated erase count, or the like of the memory chip. The system partition attribute parameters may further include the number of system partitions, the identification of the system partitions, and other parameters.
And after receiving the system partition attribute parameters of the embedded equipment, the updating server determines the partition table file of the embedded equipment according to the system partition attribute parameters. And when the system update package is sent to the embedded device, the partition table file of the embedded device is added into the system update package.
The update server may obtain a total data volume of the updated system, for example, when the total capacity of the system partition in the system partition attribute parameter is not less than twice the total data volume, and the health parameter of the storage chip indicates that the storage chip is at risk, it is determined that the partition table file indicates the dual-system partition. For example, in the case where the total capacity of the system partitions is less than twice the total data amount in the system partition attribute parameter, it is determined that the partition table file indicates a dual system partition. For example, in the case that the total capacity of the system partition in the system partition attribute parameters is not less than twice the total data amount, and the health parameter of the storage chip indicates that there is no risk in the storage chip, it is determined that the partition table file indicates the dual-system partition.
When the health parameter of the memory chip is smaller than the preset threshold, for example, the accumulated IO (when the number of errors is smaller than the preset threshold, it is determined that the health parameter of the memory chip indicates that the memory chip does not have a risk, otherwise, it is determined that the health parameter of the memory chip indicates that the memory chip does have a risk.
In the embodiment of the application, the system partition attribute parameters are sent, so that the corresponding partition table file can be conveniently determined.
The following description specifically describes the embedded device as NVR (Network Video Recorder, Network hard disk Recorder).
The user can remotely complete the process of upgrading the embedded equipment system and starting the equipment after upgrading in a browser mode and the like. The process comprises the following steps:
the method comprises the following steps: and acquiring a system update package uploaded by a user, and upgrading the NVR system through the browser.
Step two: and after receiving the system update package, the NVR analyzes and checks the system update package, and the like.
Step three: and the NVR judges according to the partition table file in the system update package, and if the system partition is changed, the single-backup partition and the double-backup partition of the NVR are adjusted.
Step four: and the NVR writes the program in the system updating package into the partition according to the actual single-backup partition and the actual double-backup partition.
Step five: and the NVR starts a program from the system partition according to the actual single-backup partition and the actual double-backup partition, and maintains the data of the system partition.
After the upgrade package is analyzed, the NVR sends the partition table file in the upgrade package to the uboot, the uboot compares the partition table file with the system partition information in the NVR, and if the difference exists, the corresponding system partition is adjusted, for example, the original dav0 partition is divided into dav0 partitions and dav1 partitions again; or partitioning the dav0 and the dav1 into dav0 partitions in a merging mode. The process comprises the following steps:
the method comprises the following steps: when the NVR is upgraded, the system update package is analyzed, the partition table file is taken out, and the partition table file is issued to the uboot
Step two: after the uboot receives the partition table file issued by the NVR, the uboot analyzes and checks the partition table file to ensure the validity of the data
Step three: uboot compares the partition table file with the actual system partition.
Step four: if the difference exists, the corresponding system partition is adjusted, otherwise, the corresponding system partition is not adjusted.
When the NVR is a single backup system, the running program and the executed logic are single backup. If the adjustment is to be a double backup, a partition table file representing a double system partition needs to be put into a system update package, the system partition is adjusted by the uboot, then the program in the system update is stored into the dav0 by the upgrading program (because the existing program executes single backup logic), meanwhile, after a marker file is added into the dav0, after the NVR upgrade is successfully restarted, new double backup logic is executed, data is copied from the dav0 to the dav1, and the device is switched from the single backup to the double backup.
The specific process of switching the double backup system by the single backup system comprises the following steps:
the method comprises the following steps: the NVR running program is a single backup, and the upgrading logic is also a single backup
Step two: using a system update package including a partition table file of dual system partitions, upgrading NVR through a browser, uboot partitions dav0, dav1 according to the partition table file.
Step three: the upgrade logic stores the system update package program in the dav0 and adds a markup file at the dav 0.
Step four: and after the upgrade is completed, restarting the equipment.
Step five: the new program runs, enables the dual backup mechanism according to the determination, starts data from the dav0 according to the flag file in the dav0, copies the data in the dav0 to the dav1, and sets the flag file in the dav 1.
Step six: the NVR normally runs in a double backup mode and is restarted by the user again.
Step seven: the normal existing dual backup execution logic determines which is the normal partition according to the marked files in the dav0 and the dav1, and starts from the partition.
The specific process of switching the double backup system to the single backup system comprises the following steps:
the method comprises the following steps: the NVR running program is double backup, and the upgrading logic is also double backup.
Step two: using a system update package including the partition table file for a single system partition, the uboot is repartitioned into dav0 partitions according to the partition table merge dav0 and dav1 by the browser upgrade device.
Step three: the upgrading logic stores the system update package program into the dav1, and adds a mark file in the dav1, at this time, because the dav1 partition does not exist, the writing fails, and the partition is judged to be adjusted to be a single partition in the upgrading process, so that no error is reported, and the upgrading logic continues to execute.
Step four: the upgrade logic stores the upgrade package program in the dav 0.
Step five: and after the upgrade is completed, restarting the equipment.
Step six: the new program runs, starting the program from dav0, running the system, based on the determination that the single backup mechanism is enabled.
In the embodiment of the application, for the existing equipment of a user, the logic of a single backup system and a double backup system of the equipment can be dynamically adjusted in a remote upgrading mode. The method can automatically balance and adjust stability and functional diversity.
An embodiment of the present application further provides an apparatus for updating an embedded device system, referring to fig. 6, where the apparatus includes:
a system update package obtaining module 601, configured to obtain a system update package;
a system update package analysis module 602, configured to analyze the system update package to obtain a partition table file and system update data;
a partition mode determining module 603, configured to determine whether the system partition mode indicated by the partition table file is the same as a current actual system partition mode;
a system partition dividing module 604, configured to, when the system partition manner indicated by the partition table file is different from a current actual system partition manner, re-divide the system partition according to the system partition manner indicated by the partition table file to obtain a target system partition;
and a system update module 605, configured to complete system update of the target system partition according to the system update data.
In a possible embodiment, the system partition mode represented by the partition table file is a dual-system partition, and the current actual system partition mode is a single-system partition;
the system partitioning module 604 is specifically configured to: under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, dividing the double-system partition represented by the partition table file to obtain a target system partition, wherein the target system partition comprises a first system partition and a second system partition;
the system update module 605 includes:
the first system partition updating submodule is used for performing system updating on the first system partition according to the system updating data to obtain updated system data;
and the second system partition updating submodule is used for copying the updated system data in the first system partition into the second system partition.
In a possible implementation, the system partitioning module 604 is further configured to: adding a mark file in the first system partition;
the above-mentioned device still includes: and the embedded equipment restarting module is used for restarting the embedded equipment according to the system data in the first system partition where the mark file is located.
In a possible embodiment, the system partition mode represented by the partition table file is a single system partition, and the current actual system partition mode is a dual system partition;
the system partitioning module 604 is specifically configured to: and under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, the original double-system partition is divided into the target system partition again according to the single-system partition represented by the partition table file, wherein the target system partition is the single-system partition.
In a possible embodiment, the native dual system partition includes a third system partition and a fourth system partition, and the identifier of the target system partition is the same as the identifier of the third system partition; the above-mentioned device still includes:
and the error message processing module is used for discarding the error message after the error message for the fourth system partition is acquired.
An embodiment of the present application further provides an embedded device, including: a processor and a memory;
the memory is used for storing computer programs;
the processor is used for realizing the method for updating any embedded equipment system when executing the computer program stored in the memory.
Optionally, referring to fig. 7, the electronic device according to the embodiment of the present application further includes a communication interface 702 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete communication with each other through the communication bus 704.
The communication bus mentioned in the electronic device may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a RAM (Random Access Memory) or an NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method for updating the embedded device system is implemented.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described embodiments of the embedded device system updating method.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be noted that, in this document, the technical features in the various alternatives can be combined to form the scheme as long as the technical features are not contradictory, and the scheme is within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the electronic device, the storage medium and the computer program product, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. An embedded device system updating method, the method comprising:
acquiring a system update package;
analyzing the system update package to obtain a partition table file and system update data;
judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode;
if the system partitions are different, the system partitions are re-divided according to the system partition mode represented by the partition table file to obtain target system partitions;
and finishing the system updating of the target system partition according to the system updating data.
2. The method according to claim 1, wherein the system partition mode represented by the partition table file is a dual system partition, and the current actual system partition mode is a single system partition;
if the system partition is different from the target system partition, repartitioning the system partition according to the system partition mode represented by the partition table file to obtain the target system partition, including:
if the two system partitions are different, dividing the two system partitions according to the double system partitions represented by the partition table file to obtain target system partitions, wherein the target system partitions comprise a first system partition and a second system partition;
the completing the system update of the target system partition according to the system update data includes:
according to the system updating data, performing system updating on the first system partition to obtain updated system data;
and copying the updated system data in the first system partition into the second system partition.
3. The method according to claim 2, wherein after the updating the system data to be updated in the first system partition according to the system update data to obtain updated system data, the method further comprises:
adding a markup file in the first system partition;
prior to the copying of the updated system data in the first system partition into the second system partition, the method further comprises:
and restarting the embedded equipment according to the system data in the first system partition where the marking file is located.
4. The method according to claim 1, wherein the system partition mode represented by the partition table file is a single system partition, and the current actual system partition mode is a dual system partition;
if the system partition is different from the target system partition, repartitioning the system partition according to the system partition mode represented by the partition table file to obtain the target system partition, including:
and if the two system partitions are different, according to the single system partition represented by the partition table file, re-dividing the original double system partition into the target system partition, wherein the target system partition is the single system partition.
5. The method of claim 4, wherein the native dual system partition comprises a third system partition and a fourth system partition, and wherein the target system partition has the same identifier as the third system partition; the method further comprises the following steps:
and when the error message aiming at the fourth system partition is acquired, discarding the error message.
6. An embedded device system updating apparatus, the apparatus comprising:
the system updating package obtaining module is used for obtaining a system updating package;
the system updating package analyzing module is used for analyzing the system updating package to obtain a partition table file and system updating data;
the partition mode judging module is used for judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode;
the system partition dividing module is used for dividing the system partitions again according to the system partition mode represented by the partition table file to obtain target system partitions under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode;
and the system updating module is used for finishing the system updating of the target system partition according to the system updating data.
7. The apparatus according to claim 6, wherein the system partition mode represented by the partition table file is a dual system partition, and the current actual system partition mode is a single system partition;
the system partition module is specifically configured to: under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, dividing to obtain a target system partition according to the double system partitions represented by the partition table file, wherein the target system partition comprises a first system partition and a second system partition;
the system update module includes:
the first system partition updating submodule is used for carrying out system updating on the first system partition according to the system updating data to obtain updated system data;
and the second system partition updating submodule is used for copying the updated system data in the first system partition into the second system partition.
8. The apparatus of claim 7, wherein the system partitioning module is further configured to: adding a markup file in the first system partition;
the device further comprises: an embedded device restart module to: and restarting the embedded equipment according to the system data in the first system partition where the marking file is located.
9. The apparatus according to claim 6, wherein the system partition mode represented by the partition table file is a single system partition, and the current actual system partition mode is a dual system partition;
the system partition module is specifically configured to: and under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, the original double-system partition is divided into the target system partition again according to the single-system partition represented by the partition table file, wherein the target system partition is the single-system partition.
10. The apparatus of claim 9, wherein the native dual system partition comprises a third system partition and a fourth system partition, and wherein the target system partition has the same identifier as the third system partition; the device further comprises:
and the error message processing module is used for discarding the error message after the error message for the fourth system partition is acquired.
11. An embedded device, comprising a processor and a memory;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, implementing the method of any of claims 1-5.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
CN202011331837.6A 2020-11-24 2020-11-24 Method, device, equipment and storage medium for updating embedded equipment system Active CN112328287B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011331837.6A CN112328287B (en) 2020-11-24 2020-11-24 Method, device, equipment and storage medium for updating embedded equipment system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011331837.6A CN112328287B (en) 2020-11-24 2020-11-24 Method, device, equipment and storage medium for updating embedded equipment system

Publications (2)

Publication Number Publication Date
CN112328287A true CN112328287A (en) 2021-02-05
CN112328287B CN112328287B (en) 2024-05-03

Family

ID=74308598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011331837.6A Active CN112328287B (en) 2020-11-24 2020-11-24 Method, device, equipment and storage medium for updating embedded equipment system

Country Status (1)

Country Link
CN (1) CN112328287B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495746A (en) * 2021-05-31 2021-10-12 杭州华橙软件技术有限公司 Program upgrading method, device, medium and electronic equipment

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7181708B1 (en) * 2004-08-10 2007-02-20 Cadence Design Systems, Inc. Coverage metric and coverage computation for verification based on design partitions
US20110004871A1 (en) * 2009-07-03 2011-01-06 Inventec Appliances Corp. Embedded electronic device and firmware updating method thereof
CN102394890A (en) * 2011-11-15 2012-03-28 上海市共进通信技术有限公司 Multiprotocol voice control system, operation method and switching method in support of SIP (session initiation protocol) and H.248
CN103744694A (en) * 2013-12-24 2014-04-23 武汉烽火众智数字技术有限责任公司 Dynamic partition searching device based on Nand flash memory and method thereof
CN104156249A (en) * 2014-08-18 2014-11-19 四川九成信息技术有限公司 Embedded software upgrading method
CN104331318A (en) * 2014-10-27 2015-02-04 上海斐讯数据通信技术有限公司 Embedded type dual system and working method thereof
CN104866363A (en) * 2015-06-11 2015-08-26 广西一铭软件股份有限公司 One-click installation method capable of realizing operating system user definition
US20150277897A1 (en) * 2013-09-13 2015-10-01 Huizhou Tcl Mobile Communication Co., Ltd. Software upgrade method and system for mobile terminal
CN106020865A (en) * 2016-05-10 2016-10-12 百度在线网络技术(北京)有限公司 System upgrading method and device
CN106293848A (en) * 2013-03-15 2017-01-04 青岛海信移动通信技术股份有限公司 A kind of method and device of system upgrade
WO2017067448A1 (en) * 2015-10-22 2017-04-27 深圳市中兴微电子技术有限公司 Firmware-over-the-air upgrade method, system and computer storage medium
CN108829351A (en) * 2018-06-04 2018-11-16 成都傲梅科技有限公司 A kind of MBR disk turns the method and its system of GPT disk
US20190087457A1 (en) * 2017-09-21 2019-03-21 Oracle International Corporation Function semantic based partition-wise sql execution and partition pruning
CN111522569A (en) * 2020-05-09 2020-08-11 中瓴智行(成都)科技有限公司 Hypervisor-based embedded multi-system upgrading method and computer-readable storage medium
CN113900699A (en) * 2021-05-26 2022-01-07 荣耀终端有限公司 System upgrading method and electronic equipment

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7181708B1 (en) * 2004-08-10 2007-02-20 Cadence Design Systems, Inc. Coverage metric and coverage computation for verification based on design partitions
US20110004871A1 (en) * 2009-07-03 2011-01-06 Inventec Appliances Corp. Embedded electronic device and firmware updating method thereof
CN102394890A (en) * 2011-11-15 2012-03-28 上海市共进通信技术有限公司 Multiprotocol voice control system, operation method and switching method in support of SIP (session initiation protocol) and H.248
CN106293848A (en) * 2013-03-15 2017-01-04 青岛海信移动通信技术股份有限公司 A kind of method and device of system upgrade
US20150277897A1 (en) * 2013-09-13 2015-10-01 Huizhou Tcl Mobile Communication Co., Ltd. Software upgrade method and system for mobile terminal
CN103744694A (en) * 2013-12-24 2014-04-23 武汉烽火众智数字技术有限责任公司 Dynamic partition searching device based on Nand flash memory and method thereof
CN104156249A (en) * 2014-08-18 2014-11-19 四川九成信息技术有限公司 Embedded software upgrading method
CN104331318A (en) * 2014-10-27 2015-02-04 上海斐讯数据通信技术有限公司 Embedded type dual system and working method thereof
CN104866363A (en) * 2015-06-11 2015-08-26 广西一铭软件股份有限公司 One-click installation method capable of realizing operating system user definition
CN106610840A (en) * 2015-10-22 2017-05-03 深圳市中兴微电子技术有限公司 FOTA (Firmware Over-The-Air) upgrade method and system
WO2017067448A1 (en) * 2015-10-22 2017-04-27 深圳市中兴微电子技术有限公司 Firmware-over-the-air upgrade method, system and computer storage medium
CN106020865A (en) * 2016-05-10 2016-10-12 百度在线网络技术(北京)有限公司 System upgrading method and device
US20190087457A1 (en) * 2017-09-21 2019-03-21 Oracle International Corporation Function semantic based partition-wise sql execution and partition pruning
CN108829351A (en) * 2018-06-04 2018-11-16 成都傲梅科技有限公司 A kind of MBR disk turns the method and its system of GPT disk
CN111522569A (en) * 2020-05-09 2020-08-11 中瓴智行(成都)科技有限公司 Hypervisor-based embedded multi-system upgrading method and computer-readable storage medium
CN113900699A (en) * 2021-05-26 2022-01-07 荣耀终端有限公司 System upgrading method and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
POLLY H.NOEL PHD等: "Patient experience of health care system hassles:Dual-system vs single-system users", 《HEALTH SERVICES RESEARCH》, pages 548 - 555 *
冉大为: "IPTV机顶盒升级系统的分析与设计", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 2, pages 136 - 1302 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495746A (en) * 2021-05-31 2021-10-12 杭州华橙软件技术有限公司 Program upgrading method, device, medium and electronic equipment
CN113495746B (en) * 2021-05-31 2024-02-02 杭州华橙软件技术有限公司 Program upgrading method, device, medium and electronic equipment

Also Published As

Publication number Publication date
CN112328287B (en) 2024-05-03

Similar Documents

Publication Publication Date Title
US10175969B2 (en) Data processing for upgrading medical equipment
US9830376B2 (en) Language tag management on international data storage
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN112015447A (en) System updating method and device for electronic equipment, electronic equipment and storage medium
CN111694684B (en) Abnormal construction method and device of storage device, electronic device and storage medium
CN112328287A (en) Embedded equipment system updating method, device, equipment and storage medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
US20120151005A1 (en) Image file download method
CN111694724B (en) Test method and device of distributed form system, electronic equipment and storage medium
CN110737455A (en) Firmware updating method and device and electronic equipment
CN111045710A (en) Method, equipment and medium for upgrading SAS-Expander firmware based on IPMI command
US11429537B2 (en) Method, device, and computer program product for managing storage system
CN111352764B (en) Chip repairing method, device, equipment and storage medium
CN116594794A (en) Fault detection method, container configuration device, container cluster and storage medium
CN113535470A (en) Configuration backup method and device, electronic equipment and storage medium
CN114115753B (en) Storage device, request processing method and device based on storage device
CN113626245B (en) Method for preventing ios application program from crashing
CN112035119B (en) Data deleting method and device
CN111404715B (en) Network service instantiation method and device, electronic equipment and storage medium
CN115484277A (en) Communication method, communication device, storage disaster tolerance system, electronic device and storage medium
CN114116289A (en) Mirror image file repairing method and device, AP (access point) equipment and network system
CN117931254A (en) Firmware upgrading method and device, electronic equipment and storage medium
CN113064608A (en) OTA (over the air) upgrading method, device, equipment and medium
CN115543399A (en) Software processing system, software processing method and device
CN115113907A (en) Method for updating device system, electronic device, and storage medium

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
CB03 Change of inventor or designer information

Inventor after: Wu Guanmen

Inventor after: Peng Yangyun

Inventor before: Wu Guanmen

CB03 Change of inventor or designer information
GR01 Patent grant