CN112328287B - Method, device, equipment and storage medium for updating embedded equipment system - Google Patents

Method, device, equipment and storage medium for updating embedded equipment system Download PDF

Info

Publication number
CN112328287B
CN112328287B CN202011331837.6A CN202011331837A CN112328287B CN 112328287 B CN112328287 B CN 112328287B CN 202011331837 A CN202011331837 A CN 202011331837A CN 112328287 B CN112328287 B CN 112328287B
Authority
CN
China
Prior art keywords
partition
system partition
table file
data
mode
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.)
Active
Application number
CN202011331837.6A
Other languages
Chinese (zh)
Other versions
CN112328287A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a method, a device, an electronic device and a storage medium for updating a system of an embedded device, wherein a partition table file is added in a system updating packet, so that a 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 memory chip of the embedded equipment is aged, the embedded equipment is updated from a single system to double system backups, so that the situation that the embedded equipment cannot be started can be reduced. When the memory chip space of the embedded device is insufficient, the embedded device is updated from the double backup of the system to a single system, so that the condition that the system upgrade fails due to the insufficient memory space is reduced.

Description

Method, device, equipment and storage medium for updating embedded equipment system
Technical Field
The present application relates to the field of embedded devices, and in particular, to a method and 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 fields of production and living of people.
The embedded device is special computer equipment which is centered on application and is based on modern computer technology, and software and hardware modules can be flexibly cut according to user requirements (functions, reliability, cost, volume, power consumption, environment and the like). The embedded device is capable of operating independently, and its software content generally includes only the software running environment and its operating system. Compared with a general computer, the embedded device has a large difference, and cannot realize a large-capacity storage function because of no large-capacity medium matched with the embedded device.
Generally, the embedded devices may be divided into single backup system devices and dual backup system devices according to the number of system backups.
The single backup system device is an embedded device with only one set of system, and has the advantages of saving storage space, and being unable to be started after the system is damaged, for example, for Flash storage chip storage, due to the storage characteristic of the Flash storage chip, erasing data is unstable, when the system in the single backup system device is abnormal, the device is unable to be started, and the device can only be repaired by re-burning the Flash storage chip.
The double-backup system equipment refers to embedded equipment with two sets of systems, and has the advantages of high system safety, and when one set of system is damaged, the other set of system can be used for starting and repairing the damaged system. The dual backup system device has the disadvantage of occupying more storage space because of storing two complete systems.
In the prior art, embedded devices have been cured as single backup system devices or dual backup system devices when shipped from the factory. With the use of the embedded device, the memory chip can 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 the failure of the upgrade of the dual-backup system device system.
Disclosure of Invention
The embodiment of the application aims to provide an updating method and device of an embedded device system, electronic equipment 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 updating method for 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, newly dividing the system partitions according to the system partition number mode represented by the partition table file to obtain target system partitions;
And according to the system updating data, completing the system updating of the target system partition.
In one embodiment, the partition table file indicates a system partition mode that is a dual-system partition, and the current actual system partition mode is a single-system partition;
And if the system partitions are different, re-dividing the system partitions according to the system partition mode indicated by the partition table file to obtain target system partitions, wherein the method comprises the following steps of:
If the two system partitions are different, dividing the two system partitions according to 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 updating of the target system partition is completed according to the system updating data, and the method comprises the following steps:
According to the system update data, performing system update on the first system partition to obtain updated system data;
and copying the updated system data in the first system partition to the second system partition.
In one embodiment, after 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;
before the copying of the updated system data in the first system partition into the second system partition, the method further comprises:
restarting the embedded device according to the system data in the first system partition where the mark 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;
And if the system partitions are different, re-dividing the system partitions according to the system partition mode indicated by the partition table file to obtain target system partitions, wherein the method comprises the following steps of:
and if the two system partitions are different, the original double system partition is re-divided into target system partitions according to the single system partition represented by the partition table file, wherein the target system partitions are single system partitions.
In one embodiment, 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; the method further comprises the steps of:
And discarding the error message after acquiring the error message aiming at the fourth system partition.
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 update package acquisition module is used for acquiring a system update package;
The system update package analysis module is used for analyzing the system update package to obtain a partition table file and system update 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 re-dividing the system partition according to the system partition mode indicated by the partition table file to obtain a target system partition under the condition that the system partition mode indicated by the partition table file is different from the current actual system partition mode;
And the system updating module is used for completing the system updating of the target system partition according to the system updating data.
In one embodiment, the partition table file indicates a system partition mode that is a dual-system partition, and the current actual system partition mode is a single-system partition;
The system partition dividing module is specifically configured to: dividing a target system partition according to the double system partition represented by the partition table file under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, wherein the target system partition comprises a first system partition and a second system partition;
the system update module comprises:
The first system partition updating sub-module 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 sub-module is used for copying the updated system data in the first system partition into the second system partition.
In one embodiment, the system partition partitioning module is further configured to: adding a markup file in the first system partition;
The apparatus further comprises: an embedded device restarting module for: restarting the embedded device according to the system data in the first system partition where the mark 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 dividing 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 re-divided into a target system partition 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 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; the apparatus further comprises:
And the error reporting message processing module is used for discarding the error reporting message after acquiring the error reporting message aiming at the fourth system partition.
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 any embedded equipment system updating method when executing the program stored in the memory.
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, where the computer program when executed by a processor implements any one of the embedded device system updating methods of the present application.
The embodiment of the application provides an embedded equipment system updating method, an embedded equipment system updating device, electronic equipment and a storage medium, and a system updating package is acquired; 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 modes indicated by the partition table files, and the target system partitions are obtained; and according to the system update data, completing the system update of the target system partition. In the embodiment of the application, the partition table file is added in the system update package, so that the system partition of the embedded device can be divided into the system partition modes represented by the partition table file, and the conversion of the embedded device between the single system partition and the double system partition can be realized. After the memory chip of the embedded equipment is aged, the embedded equipment is updated from a single system to double system backups, so that the situation that the embedded equipment cannot be started can be reduced. When the memory chip space of the embedded device is insufficient, the embedded device is updated from the double backup of the system to a single system, so that the condition that the system upgrade fails due to the insufficient memory space is reduced. Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a first flowchart of an update method of an embedded device system according to an embodiment of the present application;
FIG. 2 is a second flowchart of an update method of an embedded device system according to an embodiment of the present application;
FIG. 3 is a third flowchart of an update method of an embedded device system according to an embodiment of the present application;
FIG. 4 is a fourth flowchart of an update method of an embedded device system according to an embodiment of the present application;
FIG. 5 is a fifth flowchart of an update method of an embedded device system according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a configuration of an update apparatus of an embedded device system according to an embodiment of the present application;
fig. 7 is a schematic diagram of an electronic device according to an embodiment of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
First, terms in the present application will be explained:
Dual backup system: the system program is stored in two partitions, and when one partition data is abnormal, the system program can be started from the backup partition and the abnormal partition can be rewritten. In the case of dual system backups, the system program will occupy two partitions.
Upgrading: and the user directly performs maintainability upgrade on the system of the equipment through a web browser.
In the prior art, embedded devices have been cured as single backup system devices or dual backup system devices when shipped from the factory. Along with the use process of the embedded equipment, the storage chip can be aged, a system in the storage chip is more easily damaged, and the single backup system equipment 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 the failure of the upgrade of the dual-backup system device system.
In order to reduce the anomaly of the embedded device, the embodiment of the application provides an updating method of an embedded device system, which comprises the following steps:
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 partition table files are different, the system partition is divided again according to the system partition mode indicated by the partition table files, and a target system partition is obtained;
and according to the system updating data, completing the system updating of the target system partition.
In the embodiment of the application, the partition table file is added in the system update package, so that the system partition of the embedded device can be divided into the system partition modes represented by the partition table file, and the conversion of the embedded device between the single system partition and the double system partition can be realized. After the memory chip of the embedded equipment is aged, the embedded equipment is updated from a single system to double system backups, so that the situation that the embedded equipment cannot be started can be reduced. When the memory chip space of the embedded device is insufficient, the embedded device is updated from the double backup of the system to a single system, so that the condition that the system upgrade fails due to the insufficient memory space is reduced.
Referring to fig. 1, fig. 1 is a schematic flow chart of an updating method of an embedded device system according to an embodiment of the present application, where the method includes:
s11, acquiring a system update package.
The method for updating the embedded device in the embodiment of the application can be realized through the embedded device, and in particular, the embedded device can be a video camera, a hard disk video recorder, a spliced display and the like.
The embedded device may acquire the system update package through a wired or wireless manner, for example, may upload the system update package to the embedded device through a browser interface, or may import the system update package into the embedded device through the flash disk. The embedded device may also download the system update package from the server over the network.
S12, analyzing the system update package to obtain a partition table file and system update data.
The system update data is the data required by the system update, and the system update package comprises the partition table file in addition to the system update data. The partition table file indicates the number of system partitions, and for example, the partition table file may indicate a single system partition (system partition number of 1) or a double system partition (system partition number of 2). In addition, the partition table file may also include an identification of the system partition, such as a name or the like. The embedded device analyzes the system update package to obtain the partition table file and the system update data.
S13, 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 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. If the system data are the same, the system data in the current actual system partition are updated directly by using the system update data.
S14, if the system partitions are different, the system partitions are re-divided according to the system partition mode indicated by the partition table file, and the target system partitions are obtained.
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 re-divides 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 represents a single system partition, so that 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, one system partition is provided, and the partition table file represents the dual system partition, so that the embedded device divides the current one system partition into two system partitions, and the target system partition includes the two system partitions.
S15, completing the system updating of the target system partition according to the system updating data.
And using the system update data to complete the system update for the target system partition. For example, if the embedded device has one system partition, only the system partition needs to be updated. If the embedded device has two system partitions, the two system partitions are respectively updated.
In the embodiment of the application, the partition table file is added in the system update package, so that the system partition of the embedded device can be divided into the system partition modes represented by the partition table file, and the conversion of the embedded device between the single system partition and the double system partition can be realized. After the memory chip of the embedded equipment is aged, the embedded equipment is updated from a single system to double system backups, so that the situation that the embedded equipment cannot be started can be reduced. When the memory chip space of the embedded device is insufficient, the embedded device is updated from the double backup of the system to a single system, so that the condition that the system upgrade fails due to the insufficient memory space is reduced.
In one possible implementation manner, 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, S14, if different, re-dividing the system partition according to the system partition mode indicated by the partition table file to obtain a target system partition, including:
S141, if the two system partitions are different, dividing the two system partitions according to 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.
When the partition table file represents 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 as a target system partition.
The step S15 of completing the system update of the target system partition according to the system update data, includes:
and S151, performing system updating on the first system partition according to the system updating data to obtain updated system data.
The identification of the first system partition is the same as the identification of the system partition before division, for example, the partition names are the same, and the device upgrade logic installs the program of the system update data into the first system partition according to the update logic of the single backup system.
And S152, copying the updated system data in the first system partition into 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-volume update and incremental update, and in general, the embedded device adopts a full-volume update mode, and the system update data needs to include complete system data. In this case, the formatting operation may be performed simultaneously in the process of dividing the system partition.
As technology advances, partitioning system partitions may not have been formatted. Therefore, the embedded device can be updated in an incremental updating mode, when the incremental updating mode is adopted, the system updating data can only comprise part of system data, at the moment, the integrity of the original system data in the embedded device needs to be ensured, the original system partition is divided into two system partitions in a non-formatting mode, and one system partition keeps the identification and the data of the original system partition and is called a first system partition. The other system partition sets an identification that is distinct from the first system partition, referred to as the second system partition. The first system partition comprises original system data, the equipment upgrading logic installs a program of the 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 to 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 equipment is updated to the double backup system, and the situation that the embedded equipment cannot be started due to the aging of the memory chip of the embedded equipment can be reduced.
In a possible implementation manner, after 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:
and S153, adding a mark file in 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 dual-backup system, firstly, whether the system partitions have the marked files or not is detected, and the system data in the system partitions with the marked files are preferentially selected for starting.
Before copying the updated system data in the first system partition to the second system partition, the method further includes:
S16, restarting the embedded device according to the system data in the first system partition where the mark file is located.
And restarting the embedded device after the system data in the first system partition is updated and the mark file is added in the first system partition. The embedded device selects system data in a system partition (a first system partition) with the marked file for starting, and copies the system data in the first system partition into a second system partition.
After the embedded device completes the update of the first system partition, the update of the second system partition is not directly started because the embedded device is still using system data corresponding to the single system partition. Adding a mark file in a first system partition, and restarting the embedded device; during the restarting process, the embedded device will check the mark files in the first system partition and the second system partition, and because the mark files exist in the first system partition, the embedded device is started according to the system data in the first system partition. After the restart of the embedded device is completed, the system data corresponding to the dual-system partition in actual use can be copied into the second system partition by the system data in the first system partition, so that the update of the second system partition is completed.
In the embodiment of the application, the mark file is utilized to distinguish the first system partition which is updated completely from the second system partition which is not updated, thereby reducing the condition of starting error,
In one possible implementation manner, 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 system partition is different, the system partition is repartitioned according to the system partition mode indicated by the partition table file, to obtain a target system partition, which includes:
And S142, if the two system partitions are different, the original double system partitions are re-divided into target system partitions according to the single system partitions represented by the partition table files, wherein the target system partitions are single system partitions.
When the partition table file represents 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 combined into one system partition to obtain a target system partition. The device upgrade logic installs the program of system update data into the target system partition.
In the embodiment of the application, the update of the embedded equipment from the double-backup system to the single-backup system is realized, and the condition of update failure of the embedded equipment system caused by insufficient memory chip space of the embedded equipment can be reduced.
In one 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 method further includes:
S17, after the error reporting information aiming at the fourth system partition is acquired, discarding the error reporting information.
Although the updating of the third system partition is completed, the system actually used by the embedded device is a dual-backup system, so that after the updating of the third system partition is completed, the updating of the system data is automatically performed on the fourth system partition and a mark file is added in the fourth system partition, but the fourth system partition does not exist at this time, an error reporting message is generated, and after the error reporting message for the fourth system partition is acquired, the error reporting message is directly discarded, so that the situation that the system repeatedly tries to update the fourth system partition according to the error reporting 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 partitions are only used to distinguish one system partition from another system partition, which is independent of the number. 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 update logic of the dual-backup system, a fourth system partition is required to be updated and a mark file is added, and the adding object of the mark file is set as the fourth system partition, an error report message aiming at the fourth system partition system is received, wherein the error report message comprises an error report message of the update failure of the fourth system partition system and an error report message of the addition failure of the mark 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 implementation of the application, under the condition that the identification of the target system partition is the same as the identification of the third system partition, the adding object of the mark file is set as the fourth system partition, and the error message aiming at the fourth system partition system is discarded, so that the system resource waste caused by analyzing and processing the error message aiming at the fourth system partition system can be reduced, and the processing of unnecessary error message can be reduced.
In one possible implementation manner, before the acquiring the system update package, the method further includes: and sending the attribute parameters of the system partition, wherein the attribute parameters of the system partition comprise the total capacity of the system partition and the health parameters of a memory chip for storing the system data.
The embedded device may send a system partition attribute parameter to the update server, where the system partition attribute parameter includes a total capacity of a system partition of the embedded device and a health parameter 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, a factory time of the memory chip, a cumulative number of IO (input/output) errors, a cumulative number of erasures, or the like. In addition, the system partition attribute parameters may also include parameters such as the number of system partitions, the identification of the system partitions, and the like.
After receiving the system partition attribute parameters of the embedded device, the update server determines the partition table file of the embedded device according to the system partition attribute parameters. When a system update package is sent to the embedded device, the partition table file of the embedded device is added to the system update package.
The update server may obtain the total data amount of the updated system, for example, in the case that the total capacity of the system partition in the attribute parameters of the system partition is not less than twice the total data amount, and the health parameter of the memory chip indicates that the memory chip is at risk, it is determined that the partition table file indicates a dual-system partition. For example, in the case where the total capacity of the system partition is less than twice the total data amount in the system partition attribute parameter, it is determined that the partition table file represents a dual system partition. For example, in the case where the total capacity of the system partition is not less than twice the total data amount in the system partition attribute parameter, and the health parameter of the memory chip indicates that the memory chip is not at risk, it is determined that the partition table file indicates a dual-system partition.
Under the condition that the health parameter of the memory chip is smaller than a preset threshold, for example, the accumulated IO (the number of errors is smaller than the preset threshold), the health parameter of the memory chip is determined to indicate that the memory chip is not at risk, otherwise, the health parameter of the memory chip is determined to indicate that the memory chip is at 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 will specifically refer to an embedded device as an NVR (Network Video Recorder, network hard disk recorder).
The user can remotely complete the process of starting the device after upgrading the embedded device system in a browser mode and the like. The process comprises the following steps:
Step one: and acquiring a system update package uploaded by a user, and upgrading the NVR system through a browser.
Step two: after the NVR receives the system update package, the system update package is analyzed and checked, 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 NVR single-double backup partition is adjusted.
Step four: and the NVR writes the program in the system update package into the partition according to the actual single-double backup partition.
Step five: and starting a program from the system partition by the NVR according to the actual single-double backup partition, and maintaining the system partition data.
After the upgrade package is analyzed, the NVR issues the partition table file in the upgrade package to 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 partition and dav1 partition again; or the dav0 and dav1 partitions are merged and divided into dav0 partitions. The process comprises the following steps:
Step one: when NVR is upgraded, a system update package is analyzed, a partition table file is taken out, and the partition table file is issued to uboot
Step two: after uboot receives the partition table file issued by NVR, analyzing and checking 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 system partition is not adjusted.
When the NVR is a single backup system, the running program and the executed logic are single backups. If the system is required to be adjusted to double-backup, a partition table file representing a double-system partition is required to be placed in a system update package, the system partition is adjusted by uboot, then an upgrading program stores the program in the system update into dav0 (because the existing program is subjected to single-backup logic), meanwhile, a mark file is added into dav0, after NVR upgrading is successfully restarted, new double-backup logic is executed, data is copied from dav0 to dav1, and the equipment is switched from single-backup to double-backup.
The specific process of switching the single backup system to the double backup system comprises the following steps:
Step one: NVR running program is single backup, and upgrade logic is single backup
Step two: and upgrading NVR by using a system update package comprising partition table files of the double system partitions through a browser, and dividing dav0 and dav1 partitions according to the partition table files by uboot.
Step three: the upgrade logic stores the system update package program in dav0 and adds a markup file at dav 0.
Step four: and (5) finishing upgrading, and restarting the equipment.
Step five: and running a new program, starting data from dav0 according to the marked file in dav0, copying the data in dav0 to dav1, and setting the marked file in dav1 according to the judgment that the dual-backup mechanism is started.
Step six: the NVR operates normally in a dual backup form, and is restarted again by the user.
Step seven: normal existing dual backup execution logic, i.e., determines which is the normal partition based on the tag files in dav0, dav1, i.e., starts from that partition.
The specific process of switching the single backup system by the double backup system comprises the following steps:
Step one: the NVR has run the program as dual backup and the upgrade logic is also dual backup.
Step two: using a system update package including a partition table file of a single system partition, uboot is repartitioned into dav0 partitions according to the partition table merging dav0 and dav1 by a browser upgrade apparatus.
Step three: the upgrade logic stores the system update package program into dav1, and adds a mark file into dav1, at this time, because dav1 partition does not exist, writing fails, and the partition is adjusted to be a single partition in the upgrade process, so that errors are not reported, and the execution is continued.
Step four: the upgrade logic stores the upgrade package program in dav 0.
Step five: and (5) finishing upgrading, and restarting the equipment.
Step six: and the new program is operated, and the single backup mechanism is started from dav0 according to the judgment, so that the system is operated.
In the embodiment of the application, the single-double backup system logic of the equipment can be dynamically adjusted in a remote upgrading mode for the existing equipment of the user. The adjustment can be independently balanced on stability and functional diversity.
The embodiment of the application also provides an updating device of the embedded equipment system, referring to fig. 6, the device comprises:
a system update package acquisition module 601, configured to acquire a system update package;
a system update package parsing module 602, configured to parse 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 partition mode of the system represented by the partition table file is the same as the current partition mode of the actual system;
A system partition dividing module 604, configured to re-divide the system partition according to the system partition manner indicated by the partition table file to obtain a target system partition when the system partition manner indicated by the partition table file is different from the current actual system partition manner;
The system update module 605 is configured to complete the system update of the target system partition according to the system update data.
In one possible implementation manner, 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 dividing module 604 is specifically configured to: dividing a target system partition according to the double system partition represented by the partition table file under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, 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 sub-module 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 sub-module is used for copying the updated system data in the first system partition into the second system partition.
In one possible implementation, the system partition partitioning module 604 is further configured to: adding a mark file in the first system partition;
the device further comprises: 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 one possible implementation manner, 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 dividing 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 re-divided into a target system partition according to the single-system partition represented by the partition table file, wherein the target system partition is the single-system partition.
In one possible implementation 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; the device further comprises:
And the error message processing module is used for discarding the error message after acquiring the error message aiming at the fourth system partition.
The embodiment of the application also provides embedded equipment, which comprises: a processor and a memory;
The memory is used for storing a computer program;
The processor is used for implementing any one of the above-mentioned embedded equipment system updating methods 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 for the above-mentioned electronic devices may be a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include RAM (Random Access Memory ) or 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 aforementioned processor.
The processor may be a general-purpose processor, including a CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but may also be a DSP (DIGITAL SIGNAL Processing), ASIC (Application SPECIFIC INTEGRATED Circuit), FPGA (Field-Programmable gate array) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the updating method of the embedded equipment system when being executed by a processor.
In yet another embodiment of the present application, a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of updating an embedded device system of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part 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, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, 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 a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It should be noted that, in this document, the technical features in each alternative may be combined to form a solution, so long as they are not contradictory, and all such solutions are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for embodiments of the apparatus, electronic device, storage medium and computer program product, the description is relatively simple, as it is substantially similar to the method embodiments, as relevant points are found in the partial description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. A method for updating an embedded device system, the method comprising:
Acquiring a system update package;
Analyzing the system update package to obtain a partition table file and system update data; the partition table file represents a system partition mode of a double-system partition or a single-system partition;
Judging whether the system partition mode represented by the partition table file is the same as the current actual system partition mode; the current actual system partition mode is a single system partition or a double system partition;
if the partition table files are different, the system partition is divided again according to the system partition mode indicated by the partition table files, and a target system partition is obtained;
And according to the system updating data, completing the system updating of the target system partition.
2. The method of claim 1, wherein the partition table file indicates a system partition mode of a dual system partition, and the current actual system partition mode is a single system partition;
And if the system partitions are different, re-dividing the system partitions according to the system partition mode indicated by the partition table file to obtain target system partitions, wherein the method comprises the following steps of:
If the two system partitions are different, dividing the two system partitions according to 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 updating of the target system partition is completed according to the system updating data, and the method comprises the following steps:
According to the system update data, performing system update on the first system partition to obtain updated system data;
and copying the updated system data in the first system partition to the second system partition.
3. The method of claim 2, wherein after 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;
before the copying of the updated system data in the first system partition into the second system partition, the method further comprises:
restarting the embedded device according to the system data in the first system partition where the mark file is located.
4. The method of claim 1, wherein the partition table file indicates a system partition mode that is a single system partition, and the current actual system partition mode is a dual system partition;
And if the system partitions are different, re-dividing the system partitions according to the system partition mode indicated by the partition table file to obtain target system partitions, wherein the method comprises the following steps of:
and if the two system partitions are different, the original double system partition is re-divided into target system partitions according to the single system partition represented by the partition table file, wherein the target system partitions are single system partitions.
5. The method of claim 4, wherein the original dual system partition comprises a third system partition and a fourth system partition, and the identity of the target system partition is the same as the identity of the third system partition; the method further comprises the steps of:
And discarding the error message after acquiring the error message aiming at the fourth system partition.
6. An embedded appliance system updating apparatus, the apparatus comprising:
the system update package acquisition module is used for acquiring a system update package;
The system update package analysis module is used for analyzing the system update package to obtain a partition table file and system update data; the partition table file represents a system partition mode of a double-system partition or a single-system partition;
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 current actual system partition mode is a single system partition or a double system partition;
The system partition dividing module is used for re-dividing the system partition according to the system partition mode indicated by the partition table file to obtain a target system partition under the condition that the system partition mode indicated by the partition table file is different from the current actual system partition mode;
And the system updating module is used for completing the system updating of the target system partition according to the system updating data.
7. The apparatus of claim 6, wherein the partition table file indicates a system partition mode that is a dual system partition, and the current actual system partition mode is a single system partition;
The system partition dividing module is specifically configured to: dividing a target system partition according to the double system partition represented by the partition table file under the condition that the system partition mode represented by the partition table file is different from the current actual system partition mode, wherein the target system partition comprises a first system partition and a second system partition;
the system update module comprises:
The first system partition updating sub-module 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 sub-module 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 partition partitioning module is further to: adding a markup file in the first system partition;
The apparatus further comprises: an embedded device restarting module for: restarting the embedded device according to the system data in the first system partition where the mark file is located.
9. The apparatus of claim 6, wherein the partition table file indicates a system partition mode that is a single system partition, and the current actual system partition mode is a dual system partition;
The system partition dividing 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 re-divided into a target system partition 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 original dual system partition comprises a third system partition and a fourth system partition, the identity of the target system partition being the same as the identity of the third system partition; the apparatus further comprises:
And the error reporting message processing module is used for discarding the error reporting message after acquiring the error reporting message aiming at the fourth system partition.
11. An embedded device, comprising a processor and a memory;
The memory is used for storing a computer program;
The processor is configured to implement the method of any one of claims 1-5 when executing a program stored on the memory.
12. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-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 CN112328287A (en) 2021-02-05
CN112328287B true 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)

Families Citing this family (1)

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

Citations (12)

* 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
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
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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201102924A (en) * 2009-07-03 2011-01-16 Inventec Appliances Corp Embedded electronic device and method for updating firmware thereof
CN103473099B (en) * 2013-09-13 2017-02-01 惠州Tcl移动通信有限公司 Software upgrading method and system for mobile terminal
US11442933B2 (en) * 2017-09-21 2022-09-13 Oracle International Corporation Function semantic based partition-wise SQL execution and partition pruning

Patent Citations (13)

* 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
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
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
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
IPTV机顶盒升级系统的分析与设计;冉大为;《中国优秀硕士学位论文全文数据库信息科技辑》(第S2期);第I136-1302页 *
Patient experience of health care system hassles:Dual-system vs single-system users;Polly H.NoeL PhD等;《Health Services Research》;第548-555页 *

Also Published As

Publication number Publication date
CN112328287A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN111880740B (en) Data processing method, device, computer system and readable storage medium
CN110209405B (en) Automatic upgrading method and device for distributed system
US20140068325A1 (en) Test case result processing
CN113220332B (en) BIOS firmware refreshing test method and device, electronic equipment and storage medium
US20150067316A1 (en) Electronic device and testing method
US8086909B1 (en) Automatic core file upload
US20190149571A1 (en) Method and device for repairing page vulnerability
CN112328287B (en) Method, device, equipment and storage medium for updating embedded equipment system
CN111045710A (en) Method, equipment and medium for upgrading SAS-Expander firmware based on IPMI command
CN112015447A (en) System updating method and device for electronic equipment, electronic equipment and storage medium
CN108664255B (en) Software upgrading method and device
CN111694684B (en) Abnormal construction method and device of storage device, electronic device and storage medium
TWI518680B (en) Method for maintaining file system of computer system
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN111352764B (en) Chip repairing method, device, equipment and storage medium
CN111694724B (en) Test method and device of distributed form system, electronic equipment and storage medium
CN111949287B (en) Software upgrading method and device
CN105278993B (en) A kind of drive module upgrade method and device based on linux system
CN115687138A (en) Code checking method and device and server
CN112559349B (en) Program running method and running device
CN116594794A (en) Fault detection method, container configuration device, container cluster and storage medium
CN112783683B (en) Data processing method, device, equipment and storage medium
CN114490196A (en) Database switching method, system, device and medium
US11429537B2 (en) Method, device, and computer program product for managing storage system
CN112328288A (en) Method, system, equipment and storage medium for updating server component

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

Inventor after: Wu Guanmen

Inventor after: Peng Yangyun

Inventor before: Wu Guanmen

GR01 Patent grant
GR01 Patent grant