CN112925553A - System upgrading method and device for embedded equipment - Google Patents

System upgrading method and device for embedded equipment Download PDF

Info

Publication number
CN112925553A
CN112925553A CN202110291404.0A CN202110291404A CN112925553A CN 112925553 A CN112925553 A CN 112925553A CN 202110291404 A CN202110291404 A CN 202110291404A CN 112925553 A CN112925553 A CN 112925553A
Authority
CN
China
Prior art keywords
file
differential
difference
system version
upgrading
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.)
Pending
Application number
CN202110291404.0A
Other languages
Chinese (zh)
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.)
Shanghai Chuanggong Telecom Technology Co Ltd
Original Assignee
Shanghai Chuanggong Telecom 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 Shanghai Chuanggong Telecom Technology Co Ltd filed Critical Shanghai Chuanggong Telecom Technology Co Ltd
Priority to CN202110291404.0A priority Critical patent/CN112925553A/en
Publication of CN112925553A publication Critical patent/CN112925553A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a system upgrading method and a device of embedded equipment, wherein the method comprises the following steps: the embedded device obtains the upgrade differential packet, then determines a first differential part and a second differential part from the upgrade differential packet, wherein the first differential part is obtained through content differential, the second differential part is obtained according to file differential, and then the first upgrade part is obtained based on the first differential part, so that overlong reduction time caused by overlarge differential files can be avoided, the second upgrade part is obtained based on the second differential part, so that overlow reduction efficiency caused by the overlarge required reduction positions of the differential files can be avoided, and finally, the system files of the embedded device are upgraded from a first system version to a second system version according to the first upgrade part and the second upgrade part, so that the reduction efficiency of the system versions is improved, and the reduction time of the system versions is reduced.

Description

System upgrading method and device for embedded equipment
Technical Field
The present invention relates to the field of embedded device systems, and in particular, to a system upgrade method and apparatus for an embedded device.
Background
In recent years, embedded wearable products have gradually risen, and embedded equipment products are diversified. Because the system data packet of the embedded device is too large, when upgrading the system version, a binary differential reduction method is generally adopted, and OTA (Over-the-Air Technology) upgrading is performed.
The difference reduction method is that all embedded devices do not bypass a basic function, and the difference reduction method of the OTA in the industry at present basically adopts a uniform binary difference method based on contents to manufacture a difference packet for a resource file and a firmware file of a module chip so as to reduce the current version of the system to a target version.
However, because the computational power of an MCU (Microcontroller Unit) is limited, the time consumed in restoring the differential packet by the binary differential method is long, which affects the speed of upgrading the system version and user experience. Therefore, a system upgrade method is needed to improve the system version upgrade efficiency of the embedded device and reduce the system version upgrade time of the embedded device.
Disclosure of Invention
The embodiment of the invention provides a system upgrading method and device of embedded equipment, which are used for improving the system version upgrading efficiency of the embedded equipment and reducing the system version upgrading time of the embedded equipment.
In a first aspect, an embodiment of the present invention provides a method for upgrading a system of an embedded device, including:
the embedded equipment acquires the upgrade difference packet; the up-scaling differential packet is determined based on a difference between the first system version and the second system version;
the embedded equipment determines a first differential part and a second differential part from the upgrading differential packet; the first difference part is obtained by content difference; the second difference part is obtained according to file difference;
the embedded equipment obtains a first upgrading part based on the first differential part and obtains a second upgrading part based on the second differential part;
and the embedded equipment upgrades the system file of the embedded equipment from the first system version to the second system version according to the first upgrading part and the second upgrading part.
In the technical scheme, the upgrade difference packet is determined to be different difference parts, and the current version of the system is restored to the target version according to the different upgrade parts, wherein the first upgrade part obtained based on the content difference can avoid overlong restoration time caused by overlarge difference files, and the second upgrade part obtained based on the file difference can avoid overlow restoration efficiency caused by the overlarge required restoration positions of the difference files, so that the system version restoration efficiency is improved, and the system version restoration time is shortened.
Optionally, the obtaining, by the embedded device, a first upgrade portion based on the first differential portion, and obtaining a second upgrade portion based on the second differential portion, includes:
the embedded equipment obtains the first upgrading part based on the first difference part according to a first reduction algorithm; the first reduction algorithm is a reduction algorithm based on content difference;
the embedded equipment obtains the second upgrading part according to a second reduction algorithm based on the second difference part; the second reduction algorithm is a reduction algorithm based on file difference.
In the above technical solution, the upgraded part is obtained by the corresponding reduction algorithm for the different differential parts, specifically, the first reduction algorithm based on the content differential avoids that the reduction time is too long due to the too large differential file, and the second reduction algorithm based on the file differential avoids that the reduction efficiency is too low due to the too large required reduction position of the differential file, so that the reduction efficiency of the system version is improved, and the reduction time of the system version is reduced.
Optionally, after the embedded device obtains the upgraded differential packet, before the embedded device determines the first differential part and the second differential part from the upgraded differential packet, the method further includes:
and the embedded equipment passes the upgrade differential packet.
According to the technical scheme, after the upgrade differential packet is obtained, the upgrade differential packet is verified, and only after the verification is passed, the first differential part and the second differential part can be obtained from the upgrade differential packet, so that the accuracy of the upgrade differential packet is ensured, and the system upgrade safety of the embedded equipment is improved.
In a second aspect, an embodiment of the present invention provides a method for generating an upgraded differential packet, including:
the method comprises the steps that a server determines a first chip file and a first resource file from files of a first system version of the embedded equipment;
the server determines a second chip file and a second resource file from all files of a second system version of the embedded equipment;
the server executes content difference on the first chip file and the second chip file to obtain a first difference part;
the server executes file differencing on the first resource file and the second resource file to obtain a second differencing part;
and the server determines an upgraded differential packet according to the first differential part and the second differential part.
In the technical scheme, each file in the system is divided into a chip file and a resource file, generally, the resource of the chip file is large, so that the first differential part obtained through content differential can prevent the embedded device from being too long in restoration time caused by overlarge differential files during restoration, the resource of the resource file is generally small, and the second differential part obtained through file differential can prevent the embedded device from being too low in restoration efficiency caused by the overlarge required restoration positions of the differential files during restoration, so that the system version restoration efficiency is improved, and the system version restoration time is shortened.
And the first differential part and the second differential part are used for determining the upgrade differential packet, so that the embedded equipment only needs to check one differential packet when checking the differential parts, and the two differential parts do not need to be checked, thereby reducing the checking cost, improving the checking efficiency and saving the file transmission resource.
Optionally, the determining, by the server, the first chip file and the first resource file from the files of the first system version of the embedded device includes:
the server determines a first chip file and a first resource file from each file of a first system version of the embedded equipment according to the format of each file in the first system version; or determining a first chip file and a first resource file from each file of the first system version according to the resource size of each file in the first system version of the embedded device.
According to the technical scheme, each file in the system is divided into the chip files or the resource files according to the format of the file or the resource size of each file, so that the differential part corresponding to the file difference and the content difference is obtained, and further, when the embedded device restores the differential part, the situation that the restoring time is too long due to the fact that the differential file is too large is avoided, and the situation that the restoring efficiency is too low due to the fact that the required restoring positions of the differential file are too large is avoided.
Optionally, the determining, by the server, the upgraded differential packet according to the first differential part and the second differential part includes:
and the server combines the first differential part and the second differential part according to a preset programming language to determine the upgrading differential packet.
In the technical scheme, the upgrading differential packet is obtained by combining the first differential part and the second differential part, so that the embedded equipment only needs to check one upgrading differential packet when checking the safety and the accuracy of the upgrading differential packet, and the two differential parts do not need to be checked, thereby reducing the checking cost and time, improving the checking efficiency and saving the file transmission resources.
In a third aspect, an embodiment of the present invention provides a system upgrading apparatus for an embedded device, including:
the acquisition module is used for acquiring the upgrade difference packet; the up-scaling differential packet is determined based on a difference between the first system version and the second system version;
the processing module is used for determining a first difference part and a second difference part from the upgrading difference packet; the first difference part is obtained by content difference; the second difference part is obtained according to file difference;
obtaining a first upgrading part based on the first difference part and obtaining a second upgrading part based on the second difference part;
and upgrading the system file of the embedded equipment from the first system version to the second system version according to the first upgrading part and the second upgrading part.
Optionally, the processing module is specifically configured to:
obtaining the first upgrading part according to a first reduction algorithm based on the first difference part; the first reduction algorithm is a reduction algorithm based on content difference;
obtaining the second upgrading part according to a second reduction algorithm based on the second difference part; the second reduction algorithm is a reduction algorithm based on file difference.
Optionally, the processing module is specifically configured to:
after the step-up differential packet is acquired, the step-up differential packet is verified before the first differential part and the second differential part are determined from the step-up differential packet.
In a fourth aspect, an embodiment of the present invention provides an apparatus for generating an upgrade difference package, including:
the embedded device comprises a splitting unit, a storage unit and a processing unit, wherein the splitting unit is used for determining a first chip file and a first resource file from all files of a first system version of the embedded device;
determining a second chip file and a second resource file from files of a second system version of the embedded equipment;
the processing unit is used for executing content difference on the first chip file and the second chip file to obtain a first difference part;
performing file differencing on the first resource file and the second resource file to obtain a second differencing part;
and determining an upgraded differential packet according to the first differential part and the second differential part.
Optionally, the processing unit is specifically configured to:
determining a first chip file and a first resource file from each file of a first system version of the embedded equipment according to the format of each file in the first system version; or determining a first chip file and a first resource file from each file of the first system version according to the resource size of each file in the first system version of the embedded device.
Optionally, the processing unit is specifically configured to:
and combining the first differential part and the second differential part according to a preset programming language to determine the upgrade differential packet.
In a fifth aspect, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the system upgrading method of the embedded equipment or the generation method of the upgrading differential packet according to the obtained program.
In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, where the computer-executable instructions are configured to enable a computer to execute the method for upgrading a system of the embedded device or the method for generating the upgrade difference package.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a system architecture diagram according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a system upgrade method for an embedded device according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for generating an upgrade difference packet according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating the classification and format of a file according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating generation of an upgrade difference package according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a system upgrade of an embedded device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a system upgrading apparatus for an embedded device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an upgrade difference packet generation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
In the prior art, when the OTA upgrade package of the multi-type firmware of the embedded system is differentially restored, the difference is that the OTA upgrade package may include a file differential in units of files and a content differential in units of measurement units (such as KB, MB, etc.) of file contents.
The file difference is equivalent to directly determining a file with two system versions having difference as a difference part, when the system is upgraded, the file is directly used as an upgrading part to be upgraded, and when the difference reduction calculation is carried out, the calculation is carried out by taking the file as a unit so as to reduce the calculation of the difference reduction. For example, a file a in the first system version and a file a in the second system version have some program differences, so that the file a is determined as a differential part, and when the first system version is upgraded to the second system version, the file a is directly used as an upgrade part to replace the file a to upgrade the system version, where only one differential reduction calculation is performed on the file a during the upgrade, and the differential reduction calculation may be reduced, where the file a and the file a are files of the same firmware or files of the same function, generally, names of the two files are the same, and may also be different, and are not limited specifically, and here, "a" and "a" do not refer to file names.
The content difference is equivalent to searching for content difference according to a preset data metering unit for any file, determining the content with difference as a difference part in the preset data metering unit, and replacing data at the position with the content difference instead of replacing the file when the system is upgraded. For example, a preset data measurement unit is set to 100KB for an a-file (200 KB in size) in the first system version and an a-file (210 KB in size) in the second system version, whereby the data of the a-file can be divided into two segments, 0-100KB and 101KB-200KB, and a data header and a data segment data flag for each segment of data are recorded. When the file a is compared with the file A, the file A also determines two sections of data according to the data header and the data segmentation data marks, and compares the two sections of data with the data of the file a one by one, if the difference between the first section of data (0-100KB) in the file a and the first section of data (0-110KB) in the file A is found, the first section of data of the file A is determined as a differential part, when the system version is upgraded, the differential reduction is carried out on the first section of data of the file A, the corresponding upgraded file is obtained, and then the system version is upgraded.
In the two system version upgrading methods, for the system version upgrading of the file difference, if the resource of the file is too large (such as 10MB) and the difference content is smaller (such as 20KB), when the system version upgrading is performed by using the file difference, the resource of the difference part which needs to be subjected to the difference reduction is too large, so that the difference reduction time is too long, and the system version upgrading efficiency is affected.
In the system version upgrading aiming at the content difference, if the resource of a file is smaller (such as 200KB), the difference content is more, and the preset data measurement unit is smaller (such as 10KB), the difference part of the file is too much, and when the system version upgrading is carried out, a differential reduction algorithm needs to be carried out for many times to obtain the corresponding upgrading part, so that the system version upgrading efficiency is low.
Therefore, a method for upgrading a system version is needed to improve the efficiency of upgrading the system version.
Fig. 1 illustrates an exemplary system architecture to which embodiments of the present invention are applicable, which includes a server 100, where the server 100 may include a processor 110, a communication interface 120, and a memory 130.
Wherein the communication interface 120 is used for transmitting the differential part between different system versions.
The processor 110 is a control center of the server 100, connects various parts of the entire server 100 using various interfaces and routes, performs various functions of the server 100 and processes data by operating or executing software programs and/or modules stored in the memory 130 and calling data stored in the memory 130. Alternatively, processor 110 may include one or more processing units.
The memory 130 may be used to store software programs and modules, and the processor 110 executes various functional applications and data processing by operating the software programs and modules stored in the memory 130. The memory 130 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to a business process, and the like. Further, the memory 130 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
It should be noted that the structure shown in fig. 1 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 2 exemplarily shows a flowchart of a system upgrade method for an embedded device according to an embodiment of the present invention, where the flowchart may be executed by a system upgrade apparatus for an embedded device.
As shown in fig. 2, the process specifically includes:
step 210, the embedded device obtains the upgrade difference packet.
In an embodiment of the present invention, the upgrade differential package is determined based on a difference between the first system version and the second system version. The differences include differences of logic codes, differences of parameters set in the logic codes, and the like, and are not limited to specific differences.
In step 220, the embedded device determines a first differential portion and a second differential portion from the upgraded differential packet.
In one implementation, the first differential portion and the second differential portion may both be differentiated according to content.
In another practical way, the first differential part and the second differential part may be obtained according to file differentiation.
In the embodiment of the invention, the first difference part is obtained by content difference, and the second difference part is obtained by file difference.
Step 230, the embedded device obtains a first upgrade portion based on the first differential portion, and obtains a second upgrade portion based on the second differential portion.
In the embodiment of the invention, the corresponding differential reduction algorithm is adopted according to the mode of obtaining the differential part, and then the corresponding upgrading part is obtained.
And step 240, the embedded device upgrades the system file of the embedded device from the first system version to the second system version according to the first upgrading part and the second upgrading part.
In step 210, the upgrade difference package is generally configured by a server, and the server determines the upgrade difference package according to a difference between a first system version and a second system version of the embedded device, where the first system version may be understood as a current system version of the embedded device, and the second system version may be understood as a system version with upgrade.
Further, fig. 3 exemplarily shows a flow chart of a method for generating an upgraded differential packet, and as shown in fig. 3, the flow chart includes the following steps.
In step 310, the server determines a first chip file and a first resource file from the files of the first system version of the embedded device.
In the embodiment of the present invention, a server determines a file corresponding to a first system version of an embedded device according to the first system version, and the file of the system version generally includes a chip file and a resource file, and fig. 4 exemplarily shows a schematic diagram of classification and format of a file, and as shown in fig. 4, the file of the system version includes a chip file and a resource file.
Specifically, the chip files are generally binary files, and include files in an stm.bin format, files in an nfc.bin format, files in a tp.bin format, files in a bt.bin format, and the like. The resource file is generally an interface file, and includes a png format (a picture format), a jpg format (a picture format), an xml format (a table format), a js format (a language format), and so on.
In one implementation, the files in the embedded device may be distinguished according to file names.
In the embodiment of the present invention, the files may be distinguished according to the format of the files or according to the resource sizes of the files.
Further, the server determines the first chip file and the first resource file from each file of the first system version according to the format of each file in the first system version of the embedded device, or determines the first chip file and the first resource file from each file of the first system version according to the resource size of each file in the first system version of the embedded device.
For example, a file whose file format is a binary format is determined as a first chip file, such as a file in stm. Determining a file with a file format of png, a file with a jpg format and a file with an xml format as a first resource file.
For another example, a file with a resource size larger than 1MB is determined as the first chip file, and a file with a resource size not larger than 1MB is determined as the first resource file.
In step 320, the server determines a second chip file and a second resource file from the files of the second system version of the embedded device.
In the embodiment of the present invention, the server determines the corresponding second chip file and second resource file according to the manner in step 310. For example, if the server determines the first chip file and the first resource file from the files of the first system version according to the file grid in step 310, the server determines the second chip file and the second resource file from the files of the second system version according to the file format. If the server determines the first chip file and the first resource file from the files of the first system version according to the file format in step 310, the server determines the second chip file and the second resource file from the files of the second system version according to the file format.
Step 330, the server performs content difference on the first chip file and the second chip file to obtain a first difference part.
In an embodiment of the present invention, the first differential portion is determined by performing content differential according to a first chip file and a second chip file, for example, the first chip file is a binary B-file, the size of the B-file is 1.2M, the B-file is divided into 12 parts of first file contents according to the content differential method, a data header and a data trailer of each part of the first file contents are recorded, then the B-file of the second chip file is divided into 12 parts of second file contents according to the data header and the data trailer of each part of the first file contents, N parts of the file contents having a difference are determined, and corresponding data headers and data trailers are recorded, where N is not greater than 12, so that the first differential portion is obtained according to the N parts of the file having a difference and the corresponding data header and data trailer.
Step 340, the server performs file differencing on the first resource file and the second resource file to obtain a second differencing part.
In this embodiment of the present invention, the second difference portion is determined by performing file difference according to the first resource file and the second resource file, for example, on the basis of consistency of file names, it is determined whether the first resource file and the second resource file have a difference, and if there is a difference, the second resource file is determined as the second difference portion.
Step 350, the server determines an upgraded differential packet according to the first differential part and the second differential part.
In an implementation manner, the first differential part and the second differential part may be stored in a folder, and then the folder is compressed, so as to determine the hierarchical differential packet.
In another practical way, the first differential part and the second differential part are compressed respectively to obtain a first compressed file and a second compressed file, and then the first compressed file and the second compressed file are stored in a folder to obtain the upgrade differential packet.
In the embodiment of the invention, the server combines the first difference part and the second difference part according to a preset programming language to determine the upgrade difference packet. The preset programming language may be a merge instruction in an SQL statement, or may be an instruction of another programming language, which is not limited herein.
In the step 220, the embedded device obtains the first upgraded part according to the first restoring algorithm based on the first difference part, where the first restoring algorithm is a content difference-based restoring algorithm.
And the embedded equipment obtains a second upgrading part based on a second difference part according to a second reduction algorithm, wherein the second reduction algorithm is a file difference-based reduction algorithm.
In the embodiment of the invention, aiming at different differential parts, the corresponding upgrading parts, namely upgrading files, can be restored according to the corresponding restoration algorithm.
For example, for the first differential portion, since the first differential portion is obtained by content differentiation, a content differentiation-based restoration algorithm is applied to the first differential portion, so that an upgrade file can be obtained, where the upgrade file includes different locations and contents of chip files, which are equivalent to locations and contents that need to be upgraded.
For the second difference part, because the second difference part is obtained by file difference, a restoration algorithm based on file difference is used for the second difference part, and an upgrade file can be obtained, wherein the upgrade file comprises files which are different from the files of the first version system correspondingly and are equivalent to files needing to be upgraded.
It should be noted that, after the embedded device obtains the upgrade differential packet, before the embedded device determines the first differential part and the second differential part from the upgrade differential packet, the embedded device checks that the upgrade differential packet passes.
In one implementable approach, the upgraded differential packet is checked according to a parity check method.
In another implementation, the upgrade difference packet is checked against a Cyclic Redundancy Check (CRC). The CRC method is a channel coding technology for generating a short fixed bit check code according to data such as network data packets or computer files and the like, and is used for detecting or checking errors which may occur after data transmission or storage by using the principles of division and remainder.
For example, the sender and the receiver may agree on a predetermined integer P before communicating. And then the sender determines F meeting a formula of T mod P ═ 0 according to the data D before sending, generates a CRC code T, and then T is the splicing of the data bit D and the check bit F and sends T to the receiver. And after receiving the CRC code T, the receiving side performs a result-T mod P operation, and if and only if the result is 0, the receiving side determines that the data sent by the sending side is correct.
In the embodiment of the invention, the upgrade difference packet is verified according to an RSA encryption algorithm. The RSA algorithm is an asymmetric encryption algorithm and is also an algorithm of a public key, the key comprises a public key and a private key, and the public key is a public key.
For example, the receiver randomly selects two unequal prime numbers, determines a public key and a private key according to an euler function and a preset random integer, and discloses the public key. When the sender sends the ciphertext, the sender encrypts the ciphertext through the public key and sends the encrypted data to the receiver. And the receiver decrypts the encrypted data according to the private key which is not disclosed by the receiver to obtain the ciphertext.
In the embodiment of the invention, the receiver is equivalent to an embedded device, the sender is equivalent to a server, the ciphertext is equivalent to the upgrade difference packet, and the embedded device verifies the upgrade difference packet after the public key is encrypted according to the private key.
In step 240, the embedded device restores a second system version based on the first system version according to the first updated portion and the second updated portion, and then updates the system file of the embedded device from the first system version to the second system version according to the restored second system version.
In order to better explain the above technical solution, the generation of the upgrade difference packet and the system upgrade of the embedded device are explained in the following specific example.
Example 1
Fig. 5 exemplarily shows a schematic diagram of generation of an upgrade difference package, as shown in fig. 5, a server determines, for a current basic version (equivalent to the first system version) and a target version (equivalent to the second system version) to be upgraded of an embedded device system, files between the two versions, and divides the files into a chip file and a resource file according to a file format or a resource size, determines a chip file difference portion according to the chip file of the basic version and the chip file of the target version, determines a resource file difference portion according to the resource file of the basic version and the resource file of the target version, and then merges the chip file difference portion and the resource file difference portion according to a merge instruction in an SQL statement to obtain the upgrade difference package.
In the embodiment of the invention, the upgrade differential packet is obtained by combining the chip file differential part and the resource file differential part, only one upgrade differential packet can be checked without checking the two differential parts when the safety and the accuracy of the upgrade differential packet are checked, so that the checking cost and the checking time are reduced, the checking efficiency is improved, and the file transmission resource is also saved.
Example 2
Fig. 6 exemplarily shows a schematic diagram of system upgrade of an embedded device, and as shown in fig. 6, after acquiring an upgrade differential packet sent by a server, the embedded device verifies the upgrade differential packet, and verifies whether the upgrade differential packet meets a verification condition, so as to ensure that the upgrade differential packet is not tampered by a lawbreaker, avoid an attack behavior of the lawbreaker, and ensure the security and accuracy of the upgrade differential packet.
After the upgrade differential package is determined to meet the verification condition, a chip file differential part and a resource file differential part are determined according to a differential reduction tool, a chip file upgrade part is determined according to the chip file differential part and a corresponding reduction algorithm based on the current basic version of the embedded device system, a resource file upgrade part is determined according to the resource file differential part and the corresponding reduction algorithm, then a target version is determined according to the chip file upgrade part and the resource file upgrade part, and finally the system file of the self-upgrading device is upgraded from the basic version to the target version according to the reduced target version.
In the embodiment of the invention, the upgrading part is obtained by corresponding reduction algorithms aiming at different differential parts, so that the upgrading part obtained based on the content differential can avoid overlong reduction time caused by overlarge differential files, and the upgrading part obtained based on the file differential can avoid overlow reduction efficiency caused by the overlarge required reduction positions of the differential files, thereby improving the reduction efficiency of the system version and reducing the reduction time of the system version.
Based on the same technical concept, fig. 7 exemplarily shows a schematic structural diagram of a system upgrade apparatus for an embedded device according to an embodiment of the present invention, and the apparatus can execute a flow of the system upgrade method for an embedded device.
As shown in fig. 7, the apparatus specifically includes:
an obtaining module 710, configured to obtain an upgrade difference packet; the up-scaling differential packet is determined based on a difference between the first system version and the second system version;
a processing module 720, configured to determine a first differential portion and a second differential portion from the upgraded differential packet; the first difference part is obtained by content difference; the second difference part is obtained according to file difference;
obtaining a first upgrading part based on the first difference part and obtaining a second upgrading part based on the second difference part;
and upgrading the system file of the embedded equipment from the first system version to the second system version according to the first upgrading part and the second upgrading part.
Optionally, the processing module 720 is specifically configured to:
obtaining the first upgrading part according to a first reduction algorithm based on the first difference part; the first reduction algorithm is a reduction algorithm based on content difference;
obtaining the second upgrading part according to a second reduction algorithm based on the second difference part; the second reduction algorithm is a reduction algorithm based on file difference.
Optionally, the processing module 720 is specifically configured to:
after the step-up differential packet is acquired, the step-up differential packet is verified before the first differential part and the second differential part are determined from the step-up differential packet.
Based on the same technical concept, fig. 8 exemplarily shows a schematic structural diagram of an apparatus for generating an upgraded difference packet according to an embodiment of the present invention, and the apparatus can execute a flow of the method for generating an upgraded difference packet.
As shown in fig. 8, the apparatus specifically includes:
the splitting unit 810 is configured to determine a first chip file and a first resource file from files of a first system version of the embedded device;
determining a second chip file and a second resource file from files of a second system version of the embedded equipment;
a processing unit 820, configured to perform content differentiation on the first chip file and the second chip file to obtain a first differential portion;
performing file differencing on the first resource file and the second resource file to obtain a second differencing part;
and determining an upgraded differential packet according to the first differential part and the second differential part.
Optionally, the processing unit 820 is specifically configured to:
determining a first chip file and a first resource file from each file of a first system version of the embedded equipment according to the format of each file in the first system version; or determining a first chip file and a first resource file from each file of the first system version according to the resource size of each file in the first system version of the embedded device.
Optionally, the processing unit 820 is specifically configured to:
and combining the first differential part and the second differential part according to a preset programming language to determine the upgrade differential packet.
Based on the same technical concept, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the system upgrading method of the embedded equipment or the generation method of the upgrading differential packet according to the obtained program.
Based on the same technical concept, an embodiment of the present invention further provides a computer-readable storage medium, where computer-executable instructions are stored, and the computer-executable instructions are configured to enable a computer to execute the method for upgrading a system of the embedded device or the method for generating the upgrade differential packet.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A system upgrading method for an embedded device is characterized by comprising the following steps:
the embedded equipment acquires the upgrade difference packet; the up-scaling differential packet is determined based on a difference between the first system version and the second system version;
the embedded equipment determines a first differential part and a second differential part from the upgrading differential packet; the first difference part is obtained by content difference; the second difference part is obtained according to file difference;
the embedded equipment obtains a first upgrading part based on the first differential part and obtains a second upgrading part based on the second differential part;
and the embedded equipment upgrades the system file of the embedded equipment from the first system version to the second system version according to the first upgrading part and the second upgrading part.
2. The method of claim 1, wherein the embedded device deriving a first upgraded portion based on the first differential portion and deriving a second upgraded portion based on the second differential portion, comprises:
the embedded equipment obtains the first upgrading part based on the first difference part according to a first reduction algorithm; the first reduction algorithm is a reduction algorithm based on content difference;
the embedded equipment obtains the second upgrading part according to a second reduction algorithm based on the second difference part; the second reduction algorithm is a reduction algorithm based on file difference.
3. The method of claim 1, wherein after the embedded device obtains the upgraded differential packet, the embedded device determines the first differential portion and the second differential portion from the upgraded differential packet, further comprising:
and the embedded equipment passes the upgrade differential packet.
4. A method for generating an up-conversion differential packet, comprising:
the method comprises the steps that a server determines a first chip file and a first resource file from files of a first system version of the embedded equipment;
the server determines a second chip file and a second resource file from all files of a second system version of the embedded equipment;
the server executes content difference on the first chip file and the second chip file to obtain a first difference part;
the server executes file differencing on the first resource file and the second resource file to obtain a second differencing part;
and the server determines an upgraded differential packet according to the first differential part and the second differential part.
5. The method of claim 4, wherein the server determining the first chip file and the first resource file from among the files of the first system version of the embedded device comprises:
the server determines a first chip file and a first resource file from each file of a first system version of the embedded equipment according to the format of each file in the first system version; or
And determining a first chip file and a first resource file from each file of the first system version according to the resource size of each file in the first system version of the embedded equipment.
6. The method of claim 4, wherein the server determining an upgraded differential packet from the first differential portion and the second differential portion comprises:
and the server combines the first differential part and the second differential part according to a preset programming language to determine the upgrading differential packet.
7. A system upgrading device of an embedded device is characterized by comprising:
the acquisition module is used for acquiring the upgrade difference packet; the up-scaling differential packet is determined based on a difference between the first system version and the second system version;
the processing module is used for determining a first difference part and a second difference part from the upgrading difference packet; the first difference part is obtained by content difference; the second difference part is obtained according to file difference;
obtaining a first upgrading part based on the first difference part and obtaining a second upgrading part based on the second difference part;
and upgrading the system file of the embedded equipment from the first system version to the second system version according to the first upgrading part and the second upgrading part.
8. An apparatus for generating an upgrade difference package, comprising:
the embedded device comprises a splitting unit, a storage unit and a processing unit, wherein the splitting unit is used for determining a first chip file and a first resource file from all files of a first system version of the embedded device;
determining a second chip file and a second resource file from files of a second system version of the embedded equipment;
the processing unit is used for executing content difference on the first chip file and the second chip file to obtain a first difference part;
performing file differencing on the first resource file and the second resource file to obtain a second differencing part;
and determining an upgraded differential packet according to the first differential part and the second differential part.
9. A computing device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory to perform the method of any one of claims 1 to 3 or 4 to 6 in accordance with the obtained program.
10. A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 3 or 4 to 6.
CN202110291404.0A 2021-03-18 2021-03-18 System upgrading method and device for embedded equipment Pending CN112925553A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110291404.0A CN112925553A (en) 2021-03-18 2021-03-18 System upgrading method and device for embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110291404.0A CN112925553A (en) 2021-03-18 2021-03-18 System upgrading method and device for embedded equipment

Publications (1)

Publication Number Publication Date
CN112925553A true CN112925553A (en) 2021-06-08

Family

ID=76175834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110291404.0A Pending CN112925553A (en) 2021-03-18 2021-03-18 System upgrading method and device for embedded equipment

Country Status (1)

Country Link
CN (1) CN112925553A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070018093A (en) * 2004-06-10 2007-02-13 삼성전자주식회사 Apparatus and method for efficient generation of delta files for over-the-air upgrades in a wireless network
CN101002406A (en) * 2004-06-10 2007-07-18 三星电子株式会社 Apparatus and method for efficient generation of delta files for over-the-air upgrades in a wireless network
CN106293793A (en) * 2015-06-02 2017-01-04 西安中兴新软件有限责任公司 The method for upgrading software of a kind of terminal, device and system
CN106919382A (en) * 2017-01-22 2017-07-04 百度在线网络技术(北京)有限公司 For generating the method and apparatus that application updates bag
CN110837393A (en) * 2019-11-14 2020-02-25 北京知道创宇信息技术股份有限公司 Method and device for manufacturing firmware differential upgrade package and readable storage medium
US20200133656A1 (en) * 2018-10-30 2020-04-30 Walmart Apollo, Llc Systems and methods for differential bundle updates
CN111580851A (en) * 2020-06-24 2020-08-25 腾讯科技(深圳)有限公司 Data management method and related device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070018093A (en) * 2004-06-10 2007-02-13 삼성전자주식회사 Apparatus and method for efficient generation of delta files for over-the-air upgrades in a wireless network
CN101002406A (en) * 2004-06-10 2007-07-18 三星电子株式会社 Apparatus and method for efficient generation of delta files for over-the-air upgrades in a wireless network
CN106293793A (en) * 2015-06-02 2017-01-04 西安中兴新软件有限责任公司 The method for upgrading software of a kind of terminal, device and system
CN106919382A (en) * 2017-01-22 2017-07-04 百度在线网络技术(北京)有限公司 For generating the method and apparatus that application updates bag
US20200133656A1 (en) * 2018-10-30 2020-04-30 Walmart Apollo, Llc Systems and methods for differential bundle updates
CN110837393A (en) * 2019-11-14 2020-02-25 北京知道创宇信息技术股份有限公司 Method and device for manufacturing firmware differential upgrade package and readable storage medium
CN111580851A (en) * 2020-06-24 2020-08-25 腾讯科技(深圳)有限公司 Data management method and related device

Similar Documents

Publication Publication Date Title
CN111382463B (en) Block chain system and method based on stream data
CN106484453B (en) Method and device for realizing system upgrading
CN112000355B (en) Method and device for firmware upgrading and household appliance
CN104052818A (en) Version upgrade method and device for mobile terminal
CN105389177A (en) Software version confirmation method, device and system
CN105573785A (en) Differential package manufacturing method and device
CN106161336A (en) A kind of information updating method, Apparatus and system
CN112286565B (en) Embedded system differential upgrading method based on storage container
CN110417828A (en) A kind of upgrade method and device of internet-of-things terminal
CN110659905A (en) Transaction verification method, device, terminal equipment and storage medium
CN111258756A (en) Load balancing method and device, computer equipment and readable storage medium
CN110989934B (en) Block chain link point data storage method, block chain system and block chain node
CN113961226B (en) Software development kit repairing method, terminal, server and equipment
CN112132574A (en) Block chain data checking method, data processing method, device and equipment
CN111045856A (en) Method, apparatus and computer program product for managing application systems
CN112579141A (en) Firmware updating method, device, equipment and storage medium of embedded system
CN112925553A (en) System upgrading method and device for embedded equipment
CN110674511A (en) Offline data protection method and system based on elliptic curve encryption algorithm
CN109871227B (en) Software upgrading method and device based on second-order differential increment
CN113312073B (en) Installation package file processing method and related device
CN107395772B (en) Management method and management system for repeated data
CN113609215A (en) Data processing method, device, equipment and computer readable storage medium
JP2019029921A (en) Transmitter, receiver, and communication method
CN110825406A (en) Software upgrading method and related equipment
CN113824757B (en) Data acquisition method, system and computer readable 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