A method, device, equipment and medium for upgrading software program of embedded device

Through the data dual-channel comparison and verification technology, the failure problem caused by single-channel write exceptions during the upgrade of embedded devices is solved, the stability and upgrade security of the device are improved, and the accuracy of program writing and equipment are ensured. reliability.

CN118760454BActive Publication Date: 2024-12-10CHINA ELECTRONICS CORP 6TH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410908454.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-12-10
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

The prior art is prone to inability to start or function abnormal due to power interruption and data transmission errors during the upgrade of embedded devices, and the risk of upgrade failure is high, and effective safety measures are lacking.

Method used

Using data dual-channel comparison and verification technology, by writing upgraded data packets to the two addresses of the embedded device for comparison, and upgrading after the data is consistent, ensuring the stability and security of data writing and avoiding single Exception problems caused by road writing.

Benefits of technology

It improves the maintenance stability of embedded devices and the efficiency and security of software program upgrades, avoids upgrade failures caused by single-channel write exceptions, and ensures the stability of program writes and device reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760454B_ABST
    Figure CN118760454B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and medium for upgrading software programs of embedded devices, the method comprising: writing each upgrade data packet received by the embedded device to the first address and the second address in the storage unit respectively, and comparing the upgrade data packets written in the first address and the second address one by one; when the data in the first address and the second address are consistent, writing the payload data of each upgrade data packet to the third address and the fourth address in the storage unit, and comparing the upgrade data packets written in the third address and the fourth address one by one; when the data in the third address and the fourth address are consistent, the software program of the embedded device is upgraded using the upgrade data packet. Through the method and device, the stability of program writing is ensured, the efficiency and security of software program upgrading are improved, and the problem of upgrade failure caused by abnormality of a certain bit of the data packet due to single-channel writing is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and medium for upgrading a software program of an embedded device. Background Art

[0002] Wide application of embedded systems in multiple fields: Embedded systems have shown broad application prospects in the fields of automobiles, medical equipment, smart homes and industrial automation. For example, in the automotive industry, with the development of intelligent driving technology, embedded systems are used in in-vehicle entertainment, navigation and security monitoring. In the field of medical equipment, embedded systems are used for real-time monitoring and data collection to improve the efficiency and accuracy of equipment. In addition, smart homes and industrial automation are also important application areas of embedded systems. With the use of embedded devices and the update and iteration of technology, the upgrade of equipment is very important.

[0003] In the prior art, embedded device upgrades are generally connected to the device through a physical interface such as a serial port, JTAG interface, or USB, and then a dedicated software tool is used to update the firmware. When there are many types of similar devices, an error in upgrading the firmware can easily cause the device to freeze or become a brick. In addition, during the upgrade process, if there is a power outage, data transmission error, or other problems, the device may fail to start or malfunction. Therefore, comprehensive security measures are needed to ensure the security and reliability of the upgrade process. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a method, device, equipment and medium for upgrading software programs of embedded devices. Through the dual-path data comparison and verification technology, the maintenance stability of embedded devices is improved, the stability of program writing is ensured, the efficiency and security of software program upgrades are improved, and the problem of upgrade failure caused by an abnormality in a certain bit of the data packet due to single-path writing is avoided.

[0005] In a first aspect, an embodiment of the present application provides a method for upgrading a software program of an embedded device, the method comprising:

[0006] When it is detected that the upgrade data packet is connected to the embedded device and the upgrade data packet is verified, controlling the embedded device to receive the upgrade data packet;

[0007] Writing each upgrade data packet received by the embedded device into a first address and a second address in a storage unit of the embedded device respectively, and comparing the upgrade data packets written in the first address and the second address one by one;

[0008] When the data in the first address is consistent with the data in the second address, the payload data of each upgrade data packet is written into the third address and the fourth address in the storage unit, and the upgrade data packets written in the third address and the fourth address are compared one by one;

[0009] When the data in the third address is compared to the data in the fourth address and they are consistent, the software program of the embedded device is upgraded using the upgrade data packet.

[0010] Furthermore, before detecting that the upgrade data is connected to the embedded device, the software program upgrade method further includes:

[0011] The device firmware information corresponding to the embedded device is stored in the configuration database.

[0012] Further, the following steps are performed to determine whether the upgrade data package has been verified:

[0013] The version information corresponding to the upgrade data packet is obtained, and when it is determined that the device firmware information stored in the configuration database matches the version information, it is considered that the upgrade data packet has passed verification.

[0014] Furthermore, after the software program of the embedded device is upgraded using the upgrade data packet, the software program upgrade method further includes:

[0015] Setting an upgrade flag in the embedded device;

[0016] The embedded device is controlled to restart, and when the upgrade flag is identified, the upgraded software program is started.

[0017] In a second aspect, an embodiment of the present application further provides a software program upgrade device for an embedded device, the software program upgrade device comprising:

[0018] A data receiving module, configured to control the embedded device to receive the upgrade data packet when it is detected that the upgrade data packet is connected to the embedded device and the upgrade data packet is verified;

[0019] A first data writing module, used for writing each upgrade data packet received by the embedded device to a first address and a second address in a storage unit of the embedded device, respectively, and comparing the upgrade data packets written in the first address and the second address one by one;

[0020] a second data writing module, configured to write the payload data of each upgrade data packet into a third address and a fourth address in the storage unit when the data in the first address is consistent with the data in the second address, and compare the upgrade data packets written in the third address and the fourth address one by one;

[0021] The upgrade module is used to upgrade the software program of the embedded device using the upgrade data packet when the data in the third address is consistent with the data in the fourth address.

[0022] Furthermore, the software program upgrade device further includes a storage module, and before detecting that the upgrade data is connected to the embedded device, the storage module is used to:

[0023] The device firmware information corresponding to the embedded device is stored in the configuration database.

[0024] Furthermore, the data receiving module is used to determine whether the upgrade data packet has been verified through the following steps:

[0025] The version information corresponding to the upgrade data packet is obtained, and when it is determined that the device firmware information stored in the configuration database matches the version information, it is considered that the upgrade data packet has passed verification.

[0026] Furthermore, the software program upgrade device further includes a program startup module. After the software program of the embedded device is upgraded using the upgrade data packet, the program startup module is used to:

[0027] Setting an upgrade flag in the embedded device;

[0028] The embedded device is controlled to restart, and when the upgrade flag is identified, the upgraded software program is started.

[0029] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the software program upgrade method for the embedded device as described above are performed.

[0030] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the software program upgrade method for an embedded device as described above are executed.

[0031] The embodiments of the present application provide a method, apparatus, device and medium for upgrading the software program of an embedded device. First, when it is detected that an upgrade data packet is connected to the embedded device and the upgrade data packet is verified, the embedded device is controlled to receive the upgrade data packet; then, each upgrade data packet received by the embedded device is written to a first address and a second address in a storage unit of the embedded device, respectively, and the upgrade data packets written in the first address and the second address are compared one by one; when the data in the first address is consistent with the data in the second address, the payload data of each upgrade data packet is written to a third address and a fourth address in the storage unit, and the upgrade data packets written in the third address and the fourth address are compared one by one; finally, when the data in the third address is consistent with the data in the fourth address, the upgrade data packet is used to upgrade the software program of the embedded device.

[0032] This application first writes the received data packets into two different addresses of the embedded device for data comparison, and then writes the payload data into two different addresses for data comparison. The data upgrade is performed only after the two data comparisons are consistent. Through the data dual-path comparison and verification technology, the maintenance stability of the embedded device is improved, the stability of program writing is ensured, the efficiency and security of software program upgrades are improved, and the upgrade failure caused by an abnormal bit of the data packet due to single-path writing is avoided.

[0033] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flowchart of a method for upgrading a software program of an embedded device provided in an embodiment of the present application;

[0036] Figure 2 One of the structural schematic diagrams of a software program upgrading device for an embedded device provided in an embodiment of the present application;

[0037] Figure 3 A second structural diagram of a software program upgrading device for an embedded device provided in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0040] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of computer technology.

[0041] Wide application of embedded systems in multiple fields: Embedded systems have shown broad application prospects in the fields of automobiles, medical equipment, smart homes and industrial automation. For example, in the automotive industry, with the development of intelligent driving technology, embedded systems are used in in-vehicle entertainment, navigation and security monitoring. In the field of medical equipment, embedded systems are used for real-time monitoring and data collection to improve the efficiency and accuracy of equipment. In addition, smart homes and industrial automation are also important application areas of embedded systems. With the use of embedded devices and the update and iteration of technology, the upgrade of equipment is very important.

[0042] According to research, the existing technology for upgrading embedded devices generally connects to the device through a physical interface such as a serial port, JTAG interface or USB, and then uses a dedicated software tool to update the firmware. When there are many types of similar devices, upgrading the firmware error can easily cause the device to get stuck and become a brick. And during the upgrade process, if there is a power outage, data transmission error, etc., the device may fail to start or malfunction. Therefore, comprehensive security measures are needed to ensure the security and reliability of the upgrade process.

[0043] Based on this, an embodiment of the present application provides a software program upgrade method for an embedded device. Through the data two-way comparison and verification technology, the maintenance stability of the embedded device is improved, the stability of program writing is ensured, the efficiency and security of software program upgrades are improved, and the problem of upgrade failure caused by an abnormality in a certain bit of the data packet due to single-way writing is avoided.

[0044] See also Figure 1 , Figure 1 This is a flowchart of a method for upgrading a software program of an embedded device provided in an embodiment of the present application. Figure 1 As shown in , the software program upgrade method provided in the embodiment of the present application includes:

[0045] S101, when it is detected that an upgrade data packet is connected to the embedded device and the upgrade data packet is verified, controlling the embedded device to receive the upgrade data packet.

[0046] Here, for the above step S101, in a specific implementation, when an external device connects an upgrade data packet to an embedded device, the upgrade data packet needs to be verified first. After the upgrade data packet is verified, the upgrade data receiving process starts to control the embedded device to receive the upgrade data packet.

[0047] As an optional embodiment, before detecting that the upgrade data is connected to the embedded device, the software program upgrade method provided in the embodiment of the present application further includes:

[0048] The device firmware information corresponding to the embedded device is stored in the configuration database.

[0049] Here, in the specific implementation, the configuration database stores the device firmware information of the embedded device. When the upgrade data packet is transmitted to the embedded device, the device firmware information needs to be compared with the version information of the upgrade data packet. If the comparison is consistent, it means that the upgrade data packet meets the verification, and the software program will be upgraded.

[0050] Specifically, with respect to the above step S101, the following steps are performed to determine whether the upgrade data package has passed the verification:

[0051] The version information corresponding to the upgrade data packet is obtained, and when it is determined that the device firmware information stored in the configuration database matches the version information, it is considered that the upgrade data packet has passed verification.

[0052] For the above steps, during the specific implementation, the version information corresponding to the upgrade data packet is obtained to determine whether the device firmware information of the embedded device matches the version information of the upgrade data packet. When the information matches, it can be determined that the upgrade data packet has been verified and the following upgrade steps can be executed.

[0053] As an optional embodiment, after determining that the information matches, an XOR algorithm can be used to perform algorithmic operations, decrypt the upgrade encryption code, and perform upgrade code comparison after decryption to ensure the stability and reliability of the data source.

[0054] S102, writing each upgrade data packet received by the embedded device into a first address and a second address in a storage unit of the embedded device respectively, and comparing the upgrade data packets written in the first address and the second address one by one.

[0055] For the above step S102, when it is specifically implemented, the receiving process of the upgrade data packet is started, each upgrade data packet received by the embedded device is written into the first address and the second address in the storage unit of the embedded device respectively, and the upgrade data packets written in the first address and the second address are compared one by one. Specifically, each time the embedded device receives an upgrade data packet, the upgrade data packet is written into the first address and the second address respectively. After each upgrade data packet is written, the next upgrade data packet is read and the next upgrade data packet is continued to be written into the first address and the second address until all the upgrade data packets are fully written. When the data writing process is completed, the upgrade data packet in the first address and the upgrade data packet in the second address are compared one by one. Once the data comparison is inconsistent, the upgrade process is stopped immediately, and it is considered that this upgrade fails. If the upgrade is not performed, the default software program is started. In this way, when the upgrade process is abnormally interrupted, the default software program will be started, and the upgrade process will not destroy the default program.

[0056] S103, when the data in the first address is consistent with the data in the second address, the payload data of each upgrade data packet is written into the third address and the fourth address in the storage unit, and the upgrade data packets written in the third address and the fourth address are compared one by one.

[0057] Here, the payload data refers to the data obtained after removing the integrity check data code (CRC, CyclicRedundancy Check) in the upgrade data packet. The integrity check data code is a very common check code. On computer networks, it is widely used in communication protocols, disk storage, etc. The core principle of the CRC code is: when sending or receiving data, the data is encoded according to a specific algorithm and sent to the receiver. After receiving the data, the receiver also decodes it according to the same algorithm. If the decoding result of the receiver is consistent with the encoding result of the sender, it means that the data has not been tampered with or damaged.

[0058] With respect to the above step S103, in the specific implementation, when the data in the first address is consistent with the data in the second address, the integrity check data code in each upgrade data packet is removed, and the payload data of each upgrade data packet is written to the third address and the fourth address. After the writing is completed, each upgrade data packet at the third address and the fourth address is read packet by packet to perform data comparison. If the comparison fails, the upgrade process is exited and the upgrade is considered to have failed. If the upgrade is not performed, the default software program is started.

[0059] S104, when the data in the third address is compared with the data in the fourth address and they are consistent, the software program of the embedded device is upgraded using the upgrade data packet.

[0060] With respect to the above step S104, when the data in the third address is compared with the data in the fourth address and is consistent, the software program of the embedded device is upgraded using the upgrade data packet, and the upgrade is considered successful. In this way, the stability of program writing is ensured by the double verification mechanism of the above steps S102 and S103, the efficiency and safety of software program upgrade are improved, and the problem of upgrade failure caused by an abnormality of a certain bit of the data packet due to single-channel writing is avoided.

[0061] As an optional embodiment, after the software program of the embedded device is upgraded using the upgrade data packet, the software program upgrade method provided in the embodiment of the present application further includes:

[0062] An upgrade flag in the embedded device is set; the embedded device is controlled to restart, and when the upgrade flag is identified, the upgraded software program is started.

[0063] For the above two steps, when the software program is successfully upgraded, the upgrade flag in the embedded device is set. At this time, the embedded device is controlled to restart. After the embedded device restarts again, the secondary boot program will judge the upgrade flag. When the upgrade flag is identified, the upgraded software program is started. This ensures the stability of the device, and once the upgrade process is terminated, it can ensure that the backup program is not disturbed, and the upgrade flag can be maintained at the first time to ensure that the embedded device will not be unusable.

[0064] The method for upgrading the software program of an embedded device provided in an embodiment of the present application includes: first, when it is detected that an upgrade data packet is connected to the embedded device and the upgrade data packet is verified, the embedded device is controlled to receive the upgrade data packet; then, each upgrade data packet received by the embedded device is written to a first address and a second address in a storage unit of the embedded device, respectively, and the upgrade data packets written in the first address and the second address are compared one by one; when the data in the first address is consistent with the data in the second address, the payload data of each upgrade data packet is written to a third address and a fourth address in the storage unit, and the upgrade data packets written in the third address and the fourth address are compared one by one; finally, when the data in the third address is consistent with the data in the fourth address, the upgrade data packet is used to upgrade the software program of the embedded device.

[0065] This application first writes the received data packets into two different addresses of the embedded device for data comparison, and then writes the payload data into two different addresses for data comparison. The data upgrade is performed only after the two data comparisons are consistent. Through the data dual-path comparison and verification technology, the maintenance stability of the embedded device is improved, the stability of program writing is ensured, the efficiency and security of software program upgrades are improved, and the upgrade failure caused by an abnormal bit of the data packet due to single-path writing is avoided.

[0066] See also Figure 2 and Figure 3 , Figure 2 This is one of the structural diagrams of a software program upgrade device for an embedded device provided in an embodiment of the present application. Figure 3 This is a second structural diagram of a software program upgrade device for an embedded device provided in an embodiment of the present application. Figure 2 As shown in , the software program upgrading device 200 includes:

[0067] The data receiving module 201 is used to control the embedded device to receive the upgrade data packet when it is detected that the upgrade data packet is connected to the embedded device and the upgrade data packet is verified;

[0068] A first data writing module 202, used to write each upgrade data packet received by the embedded device to a first address and a second address in a storage unit of the embedded device, respectively, and compare the upgrade data packets written in the first address and the second address one by one;

[0069] The second data writing module 203 is used to write the payload data of each upgrade data packet into the third address and the fourth address in the storage unit when the data in the first address is consistent with the data in the second address, and compare the upgrade data packets written in the third address and the fourth address one by one;

[0070] The upgrade module 204 is used to upgrade the software program of the embedded device using the upgrade data packet when the data in the third address is consistent with the data in the fourth address.

[0071] like Figure 3 As shown in , the software program upgrade device 200 further includes a storage module 205. Before detecting that the upgrade data is connected to the embedded device, the storage module 205 is used to:

[0072] The device firmware information corresponding to the embedded device is stored in the configuration database.

[0073] Furthermore, the data receiving module 201 is used to determine whether the upgrade data packet has been verified through the following steps:

[0074] The version information corresponding to the upgrade data packet is obtained, and when it is determined that the device firmware information stored in the configuration database matches the version information, it is considered that the upgrade data packet has passed verification.

[0075] Furthermore, the software program upgrade device 200 further includes a program startup module 206. After the software program of the embedded device is upgraded using the upgrade data packet, the program startup module 206 is used to:

[0076] Setting an upgrade flag in the embedded device;

[0077] The embedded device is controlled to restart, and when the upgrade flag is identified, the upgraded software program is started.

[0078] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0079] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1The steps of the method for upgrading the software program of the embedded device in the method embodiment shown in the figure, and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.

[0080] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for upgrading the software program of the embedded device in the method embodiment shown in the figure, and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.

[0081] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0082] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0083] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0084] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0085] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0086] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0087] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for upgrading software programs of an embedded device, characterized in that: The software program upgrading method comprises: When it is detected that the upgrade data packet is connected to the embedded device and the upgrade data packet is verified, controlling the embedded device to receive the upgrade data packet; Writing each upgrade data packet received by the embedded device into a first address and a second address in a storage unit of the embedded device respectively, and comparing the upgrade data packets written in the first address and the second address one by one; When the data in the first address is consistent with the data in the second address, the payload data of each upgrade data packet is written into the third address and the fourth address in the storage unit, and the upgrade data packets written in the third address and the fourth address are compared one by one; When the data in the third address is compared to the data in the fourth address and they are consistent, the software program of the embedded device is upgraded using the upgrade data packet.

2. The software program upgrade method according to claim 1, characterized in that: Before detecting that the upgrade data is connected to the embedded device, the software program upgrade method further includes: The device firmware information corresponding to the embedded device is stored in the configuration database.

3. The software program upgrade method according to claim 2, characterized in that: Determine whether the upgrade data package has been verified by the following steps: The version information corresponding to the upgrade data packet is obtained, and when it is determined that the device firmware information stored in the configuration database matches the version information, it is considered that the upgrade data packet has passed verification.

4. The software program upgrade method according to claim 1, characterized in that: After the software program of the embedded device is upgraded using the upgrade data package, the software program upgrade method further includes: Setting an upgrade flag in the embedded device; The embedded device is controlled to restart, and when the upgrade flag is identified, the upgraded software program is started.

5. A software program upgrade device for an embedded device, characterized in that: The software program upgrading device comprises: A data receiving module, configured to control the embedded device to receive the upgrade data packet when it is detected that the upgrade data packet is connected to the embedded device and the upgrade data packet is verified; A first data writing module, used for writing each upgrade data packet received by the embedded device to a first address and a second address in a storage unit of the embedded device, respectively, and comparing the upgrade data packets written in the first address and the second address one by one; a second data writing module, configured to write the payload data of each upgrade data packet into a third address and a fourth address in the storage unit when the data in the first address is consistent with the data in the second address, and compare the upgrade data packets written in the third address and the fourth address one by one; The upgrade module is used to upgrade the software program of the embedded device using the upgrade data packet when the data in the third address is consistent with the data in the fourth address.

6. The software program upgrade device according to claim 5, characterized in that: The software program upgrade device further includes a storage module, which is used to: The device firmware information corresponding to the embedded device is stored in the configuration database.

7. The software program upgrade device according to claim 6, characterized in that: The data receiving module is used to determine whether the upgrade data packet has been verified through the following steps: The version information corresponding to the upgrade data packet is obtained, and when it is determined that the device firmware information stored in the configuration database matches the version information, it is considered that the upgrade data packet has passed verification.

8. The software program upgrade device according to claim 5, characterized in that: The software program upgrade device further comprises a program startup module. After the software program of the embedded device is upgraded using the upgrade data packet, the program startup module is used to: Setting an upgrade flag in the embedded device; The embedded device is controlled to restart, and when the upgrade flag is identified, the upgraded software program is started.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to perform the steps of the software program upgrade method as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the software program upgrading method according to any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Version upgrading method and device, electronic equipment and storage medium

    CN113254037A

  • Remote firmware upgrading method, system and device, embedded equipment and storage medium

    CN114978904A