Update processing method and device of embedded device, embedded device and system
By receiving and processing new firmware packages generated by the code management system, switching to Bootloader mode, and using the new firmware package to update the application of embedded devices, solving the problem of low update efficiency of embedded devices, improving data transmission efficiency and realizing automated management.
Patent Information
- Application Number
- CN202311845351.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-01
AI Technical Summary
In the online upgrade method of embedded devices, the download and update of the complete firmware package is long and prone to failure during wireless transmission, resulting in low data transmission and update efficiency.
By receiving the new firmware package generated by the code management system, switching to Bootloader mode, using the starter characters in the new firmware package, the address and length information of the same code content, update the application, and generate the most suitable target update version to avoid incorrect updates.
It greatly reduces the size of the firmware upgrade package, improves the data transmission efficiency of online upgrades, realizes automated management, and avoids incorrect updates.
Smart Images

Figure CN120234028A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to data processing technologies, and in particular to an update processing method, apparatus, embedded device, and system for an embedded device. Background Art
[0002] Currently, during the use of an embedded device, in order to better handle more application scenarios, updates are required.
[0003] In the prior art, the online upgrade method for an embedded device is mainly to download and update a complete firmware package.
[0004] However, in the prior art, when downloading and updating a complete firmware package, since the firmware package for update is too large, the download process takes a long time, and moreover, problems such as upgrade failure may occur due to unstable network during wireless transmission, affecting the use effect, resulting in low data transmission efficiency, and further resulting in low update efficiency. Summary of the Invention
[0005] The present application provides an update processing method, apparatus, embedded device, and system for an embedded device to solve the technical problem of low update efficiency of the embedded device.
[0006] In a first aspect, the present application provides an update processing method for an embedded device, which is applied to the embedded device where an application program is deployed, and includes:
[0007] If a new firmware package sent by a code management system is received, store the new firmware package in a storage module; wherein, the new firmware package is generated by the code management system when it determines that the current running version of the application program is different from the target update version, and is generated according to the target update version and the current running version; the target update version is determined according to the obtained version information of the application program;
[0008] Switch the current running mode to the Bootloader mode;
[0009] In the Bootloader mode, update the current running version of the application program according to the new firmware package to obtain an updated application program.
[0010] Further, the version information includes software version information and hardware version information;
[0011] The software version information is the information of the currently running version; the new firmware package is generated by the code management system comparing the target version information of the target update version with the software version information of the currently running version, copying the address information and length information of the same code content obtained from the comparison to the new firmware package, and writing the different code content obtained from the comparison into the new firmware package.
[0012] Further, the new firmware package includes a start symbol, the number of frames, frame data, and a firmware CRC check code.
[0013] Further, in the Bootloader mode, according to the new firmware package, the current running version of the application program is updated to obtain an updated application program, including:
[0014] In the Bootloader mode, according to the start symbol in the new firmware package, it is determined that the new firmware package exists in the storage module;
[0015] According to the address information and length information of the same code content in the new firmware package, the backup address corresponding to the address information in the pre-backup application program is determined, and the firmware code at the backup address is copied to the application program; and the different code content in the new firmware package is decompressed, and the decompressed content is updated to the application program to obtain an updated application program.
[0016] Further, after updating the current running version of the application program according to the new firmware package to obtain an updated application program, the method further includes:
[0017] According to the firmware CRC check code, the target update version in the updated application program is verified to obtain verification result information; wherein, the verification result information indicates whether the application program is updated successfully.
[0018] In a second aspect, the present application provides an update processing method for an embedded device, which is applied to a code management system and includes:
[0019] Obtain the version information of the application program in the embedded device; and determine the target update version corresponding to the version information;
[0020] If it is determined that the currently running version of the application program is different from the target update version, then a new firmware package is generated according to the target update version and the currently running version;
[0021] Send the new firmware package to the storage module of the application program, so that the application program switches its current running mode to the Bootloader mode, and in the Bootloader mode, update the current running version of the application program according to the new firmware package to obtain an updated application program.
[0022] Further, the version information includes software version information and hardware version information, and the software version information is the information of the current running version;
[0023] Determining the target update version corresponding to the version information includes:
[0024] Determine the target update version corresponding to the hardware version information;
[0025] Generating a new firmware package according to the target update version and the current running version includes:
[0026] Compare the target version information of the target update version with the software version information of the current running version, copy the address information and length information of the same code content obtained by the comparison to the new firmware package, and write the different code content obtained by the comparison into the new firmware package.
[0027] Further, the new firmware package includes a start symbol, the number of frames, frame data, and a firmware CRC check code;
[0028] The updated application program is that in the Bootloader mode of the embedded device, according to the start symbol in the new firmware package, it is determined that the new firmware package exists in the storage module;
[0029] According to the address information and length information of the same code content in the new firmware package, determine the backup address corresponding to the address information in the pre-backup program, copy the firmware code at the backup address to the application program; and decompress the different code content in the new firmware package, and update the decompressed content to the application program to obtain.
[0030] In a third aspect, the present application provides an update processing device for an embedded device, which is applied to an embedded device, and the embedded device is deployed with an application program, including:
[0031] A receiving module, configured to store the new firmware package in the storage module if a new firmware package sent by the code management system is received; wherein, the new firmware package is generated by the code management system when it is determined that the current running version of the application program is different from the target update version; the target update version is determined according to the obtained version information of the application program;
[0032] A switching module, configured to switch the current operating mode to the Bootloader mode;
[0033] An update module, configured to update the current running version of the application program according to the new firmware package in the Bootloader mode to obtain an updated application program.
[0034] In a fourth aspect, the present application provides an update processing device for an embedded device, which is applied to a code management system and includes:
[0035] An acquisition module, configured to acquire the version information of the application program in the embedded device;
[0036] A determination module, configured to determine a target update version corresponding to the version information;
[0037] A generation module, configured to generate a new firmware package according to the target update version and the current running version if it is determined that the current running version of the application program is different from the target update version;
[0038] A sending module, configured to send the new firmware package to the storage module of the application program, so that the application program switches the current operating mode to the Bootloader mode, and in the Bootloader mode, updates the current running version of the application program according to the new firmware package to obtain an updated application program.
[0039] In a fifth aspect, the present application provides an embedded device, including a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the method described in the first aspect is implemented.
[0040] In a sixth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, the method described in the first aspect is implemented.
[0041] In a seventh aspect, the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0042] An update processing method, device, embedded device and system for an embedded device provided by the present application. If a new firmware package is received from a code management system, the new firmware package is stored in a storage module. The new firmware package is generated by the code management system based on a target update version and a current running version when it determines that the current running version of the application is different from the target update version. The target update version is determined according to the version information of the acquired application. Switch the current running mode to the Bootloader mode. In the Bootloader mode, the current running version of the application is updated according to the new firmware package to obtain the updated application. In this solution, the code management system acquires the version information of the application, generates the most suitable target update version according to the version information, and determines whether the current running version is the target update version. If it is not the target update version, the code management system generates a new firmware package according to the target update version and the current running version, and sends the new firmware package to the embedded device. After receiving the new firmware package, the embedded device enters the Bootloader mode and updates the current running version of the application. Therefore, the size of the firmware upgrade package that needs to be downloaded during software update is greatly reduced, the data transmission efficiency of online upgrade is improved, the code management system automatically manages the firmware of each version by itself, avoiding incorrect updates, and solving the technical problem of low update efficiency of the embedded device. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0044] Figure 1 It is a schematic flowchart of an update processing method for an embedded device provided by an embodiment of the present application;
[0045] Figure 2 It is a schematic flowchart of another update processing method for an embedded device provided by an embodiment of the present application;
[0046] Figure 3 It is a data structure diagram of an update processing method for an embedded device provided by an embodiment of the present application;
[0047] Figure 4 It is a schematic flowchart of yet another update processing method for an embedded device provided by an embodiment of the present application;
[0048] Figure 5 It is a data structure diagram of another update processing method for an embedded device provided by an embodiment of the present application;
[0049] Figure 6Schematic flowchart of yet another update processing method for an embedded device provided by an embodiment of the present application;
[0050] Figure 7 Storage information allocation diagram of an embedded device provided by an embodiment of the present application;
[0051] Figure 8 Schematic flowchart of yet another update processing method for an embedded device provided by an embodiment of the present application;
[0052] Figure 9 Schematic flowchart of another update processing method for an embedded device provided by an embodiment of the present application;
[0053] Figure 10 Schematic structural diagram of an update processing device for an embedded device provided by an embodiment of the present application;
[0054] Figure 11 Schematic structural diagram of another update processing device for an embedded device provided by an embodiment of the present application;
[0055] Figure 12 Schematic structural diagram of yet another update processing device for an embedded device provided by an embodiment of the present application;
[0056] Figure 13 Schematic structural diagram of an embedded device provided by an embodiment of the present application;
[0057] Figure 14 Schematic structural diagram of a code management system provided by an embodiment of the present application.
[0058] Through the above-mentioned drawings, specific embodiments of the present disclosure have been shown, and more detailed descriptions will be provided later. These drawings and textual descriptions are not intended to limit the scope of the concept of the present disclosure in any way, but to illustrate the concept of the present disclosure to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0059] Here, exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure.
[0060] Currently, during the use of embedded devices, in order to better cope with more application scenarios, updates are required.
[0061] In one example, the online upgrade method of the embedded device mainly involves downloading and updating the complete firmware package. However, in the prior art, when downloading and updating the complete firmware package, since the firmware package for updating is too large, the download process takes a long time. Moreover, during the wireless transmission process, problems such as network instability may cause the upgrade to fail, affecting the usage effect, resulting in low data transmission efficiency, and further leading to low update efficiency.
[0062] In one example, the online upgrade method of the embedded device includes partition upgrade of the firmware package, that is, partitioning the firmware package program and upgrading according to the changed partition. However, partition upgrade is mainly for large systems, and it is necessary to configure the FLASH address range for each module code during the program development process, which has many restrictions, is cumbersome, and the reserved amount is not easy to control.
[0063] An update processing method, device, embedded device, and system for an embedded device provided in this application aim to solve the above technical problems in the prior art.
[0064] The following uses specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the above technical problems. These several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0065] Figure 1 The following is a schematic flowchart of an update processing method for an embedded device provided in an embodiment of this application, which is applied to an embedded device. The embedded device is deployed with an application program, such as Figure 1 As shown, the method includes:
[0066] Step 101: If a new firmware package sent by the code management system is received, store the new firmware package in the storage module; where the new firmware package is generated by the code management system when it determines that the current running version of the application program is different from the target update version; the target update version is determined according to the obtained version information of the application program.
[0067] Exemplarily, the execution subject of this embodiment can be an embedded device. First, Figure 2 The following is a schematic flowchart of another update processing method for an embedded device provided in an embodiment of this application, such as Figure 2As shown in the figure, the embedded device includes a single-chip microcomputer, instruments such as a flowmeter, sensors for collecting data, etc. An application program APP 22, a storage module 24, and a BootLoader 23 are deployed on the single-chip microcomputer. The update process of the embedded device is realized through wired / wireless interaction between the embedded device and the code management system 21. The code management system 21 is used to manage the firmware codes of various versions of various types of embedded devices, and the code management system 21 includes the firmware codes of various versions of the embedded device imported in advance.
[0068] In this step, during the interaction between the code management system and the embedded device, the code management system obtains the version information of the application program. The version information includes the software version information and the hardware version information of the currently running version. According to the mapping relationship between the preset hardware version information and the update version, the code management system determines and recommends the most suitable target update version corresponding to the hardware version information, and judges whether the currently running version is the target update version. If it is not the target update version, the code management system compares the software version information with the target version information of the target update version to generate a new firmware package, and finally sends the new firmware package to the embedded device. When the embedded device receives the new firmware package sent by the code management system, it stores the new firmware package in the storage module of the application program.
[0069] Specifically, during the process of the code management system generating a new firmware package, the code management system compares the target version information of the target update version with the software version information of the currently running version to obtain the same code content and different code content obtained by the comparison. It copies the address information and length information of the same code content obtained by the comparison to the new firmware package, and writes the different code content obtained by the comparison into the new firmware package, thereby obtaining a complete new firmware package. The new firmware package includes a start symbol, the number of frames, frame data, and a firmware CRC check code.
[0070] Step 102: Switch the current operating mode to the Bootloader mode.
[0071] Exemplarily, the embedded device switches the current operating mode to the Bootloader mode.
[0072] Step 103: In the Bootloader mode, update the currently running version of the application program according to the new firmware package to obtain the updated application program.
[0073] Exemplarily, in the Bootloader mode, first, the embedded device determines whether there is a new firmware package in the storage module according to the start symbol in the new firmware package. If it is determined that there is a new firmware package in the storage module, for the same code content, according to the address information and length information of the same code content in the new firmware package, the backup address corresponding to the address information in the pre-backup backup program is determined, and the firmware code at the backup address is copied to the application program. For different code content, the different code content in the new firmware package is decompressed, and the decompressed content is updated to the application program to obtain the updated application program.
[0074] For example, Figure 3 is a data structure diagram of an update processing method for an embedded device provided by an embodiment of the present application, as Figure 3 shown Figure 3 is the firmware compressed file structure in the new firmware package, including: start symbol, number of frames, frame data, firmware CRC check code, where the new firmware package compresses the firmware code into n frame data.
[0075] (1) The start symbol is used to determine whether there is a new firmware package in the storage module during the update process.
[0076] (2) There are two types of frame data in the new firmware package. One is copied from the old version of the APP, that is, the same code content, including the firmware copy address and copy data length of the old version of the APP. When it is parsed that the new firmware package contains the old version of the APP copy frame, the firmware code needs to be copied from the copy address in the pre-backup APP to the flash of the MCU. The other type of frame data is the newly added firmware block, that is, different code content. The newly added firmware block contains the newly added firmware content, which is compressed and needs to be decompressed and updated to the flash of the MCU.
[0077] (3) The firmware CRC check code is used to verify whether the firmware update of the old version of the APP is successful.
[0078] In the embodiment of the present application, if a new firmware package sent by the code management system is received, the new firmware package is stored in the storage module; wherein, the new firmware package is generated by the code management system according to the target update version and the current running version when it is determined that the current running version of the application is different from the target update version; the target update version is determined according to the obtained version information of the application. Switch the current running mode to the Bootloader mode. In the Bootloader mode, update the current running version of the application according to the new firmware package to obtain the updated application. In this solution, the code management system obtains the version information of the application, generates the most suitable target update version according to the version information, and determines whether the current running version is the target update version. If it is not the target update version, the code management system generates a new firmware package according to the target update version and the current running version, and sends the new firmware package to the embedded device. After receiving the new firmware package, the embedded device enters the Bootloader mode and updates the current running version of the application. Therefore, the size of the firmware upgrade package that needs to be downloaded during software update is greatly reduced, the data transmission efficiency of online upgrade is improved, the code management system automatically manages each version of the firmware by itself, avoiding incorrect updates, and solving the technical problem of low update efficiency of embedded devices.
[0079] Figure 4 FIG. is a schematic flowchart of another update processing method for an embedded device provided by an embodiment of the present application, which is applied to an embedded device on which an application is deployed, such as Figure 4 shown, the method includes:
[0080] Step 301, if a new firmware package sent by the code management system is received, store the new firmware package in the storage module; wherein, the new firmware package is generated by the code management system according to the target update version and the current running version when it is determined that the current running version of the application is different from the target update version; the target update version is determined according to the obtained version information of the application.
[0081] In an example, the version information includes software version information and hardware version information; the software version information is the information of the current running version; the new firmware package is generated by the code management system comparing the target version information of the target update version with the software version information of the current running version, copying the address information and length information of the same code content obtained by the comparison to the new firmware package, and writing the different code content obtained by the comparison into the new firmware package.
[0082] In an example, the new firmware package includes a start symbol, a frame number, frame data, and a firmware CRC check code.
[0083] Exemplarily, this step can be referred to Figure 1Step 101 in [the above] will not be elaborated further.
[0084] Step 302: Switch the current operating mode to the Bootloader mode.
[0085] Exemplarily, the embedded device can switch the current operating mode to the Bootloader mode.
[0086] Step 303: In the Bootloader mode, determine that there is a new firmware package in the storage module according to the start symbol in the new firmware package.
[0087] Exemplarily, in the Bootloader mode, the embedded device can determine whether there is a new firmware package in the storage module according to the start symbol in the new firmware package.
[0088] Step 304: According to the address information and length information of the same code content in the new firmware package, determine the backup address corresponding to the address information in the pre-backup backup program, copy the firmware code at the backup address to the application program; and decompress the different code content in the new firmware package, and update the decompressed content to the application program to obtain an updated application program.
[0089] Exemplarily, when the embedded device is updated, it needs to pre-backup and obtain a backup program, and then erase the current running version of the application program to be updated. Therefore, according to the address information and length information of the same code content in the new firmware package, determine the backup address corresponding to the address information in the backup program, and copy the firmware code at the backup address to the application program. And decompress the different code content in the new firmware package, and update the decompressed content to the application program to obtain an updated application program.
[0090] Step 305: According to the firmware CRC check code, check the target update version in the updated application program to obtain check result information; wherein, the check result information indicates whether the application program is updated successfully.
[0091] Exemplarily, Figure 5 is a data structure diagram of another update processing method for the embedded device provided by the embodiments of the present application. As Figure 5 shown, Figure 5 are the new firmware code and the old firmware code. The binary file (1, 4) blocks and (3, 6) blocks are the same parts, and the (2, 5) blocks are the different parts. When checking, the diff algorithm can be used to compare the two binary files. Regarding the same parts of the content, the position information and length information of the same parts in the original application program need to be written into another compressed file. Regarding the different parts, the code content of the different parts needs to be completely written into another compressed file. According to Figure 5It can be seen that 3 frames of data can be generated. The first frame is the old version APP copy frame, with the copy start address being 0 and the copy length being 1000. The second frame is the new firmware block frame, and the firmware block content is the gzip compressed data from the new firmware address 1000 to 1200, and the data length is the length after compression of 201 bytes. The third frame is the old version APP copy frame, with the copy start address being 1101 and the copy length being 1000.
[0092] In the embodiment of the present application, if a new firmware package sent by the code management system is received, the new firmware package is stored in the storage module; wherein, the new firmware package is generated by the code management system when it determines that the current running version of the application is different from the target update version, and the target update version is determined according to the obtained version information of the application. The current running mode is switched to the Bootloader mode. In the Bootloader mode, according to the start symbol in the new firmware package, it is determined that there is a new firmware package in the storage module. According to the address information and length information of the same code content in the new firmware package, the backup address corresponding to the address information in the pre-backup backup program is determined, and the firmware code at the backup address is copied to the application; and the different code content in the new firmware package is decompressed, and the decompressed content is updated to the application to obtain the updated application. According to the firmware CRC checksum, the target update version in the updated application is checked to obtain the check result information; wherein, the check result information indicates whether the application is updated successfully. Therefore, it greatly reduces the size of the firmware upgrade package that needs to be downloaded during software update, improves the data transmission efficiency of online upgrade, the code management system automatically manages each version of the firmware by itself, avoids incorrect updates, and solves the technical problem of low update efficiency of embedded devices.
[0093] In one example, Figure 6 is a schematic flowchart of another update processing method for an embedded device provided by the embodiment of the present application, as Figure 6As shown in the figure, it includes: start; the code management system reads the software and hardware version information from the embedded device; the code management system generates a new compressed package according to the version information; the embedded device obtains the new compressed package from the program management module and saves it to the specified storage area; the embedded device enters the Bootloader mode; determines whether the new compressed package contains a start symbol; if it contains a start symbol, determines whether the APP firmware code has been backed up; if it has been backed up, erases the APP firmware code; if it has not been backed up, backs up the APP firmware code; parses the new compressed package and writes it to the FALSH address of the APP; verifies the updated current APP firmware code; if it is determined that the verification is successful, switches to the APP mode; if it is determined that the verification fails, erases the updated current APP firmware code, rewrites the backed-up APP firmware code to the APP's flash, and erases the start symbol of the new compressed package.
[0094] Therefore, in the embodiment of the present application, the APP firmware code will be pre-backed up before firmware update to prevent the embedded device from malfunctioning after the update fails; moreover, compared with the firmware package partition upgrade in the prior art, in the present application, there is no need to configure the addresses of each module, and the implementation is simple, convenient and easy to operate.
[0095] In one example, Figure 7 is a storage information allocation diagram of an embedded device provided by an embodiment of the present application. As Figure 7 shown, 1 is used to store the Bootloader program, which is saved in the internal FLASH of the MCU; 2 is used to store the application program, which is saved in the internal FLASH of the MCU; 3 is used to back up the application program (which can be saved in the external FLASH); 4 is used to store the received new firmware package (which can be saved in the external FLASH).
[0096] Figure 8 is a schematic flowchart of another update processing method for an embedded device provided by an embodiment of the present application, which is applied to the code management system. As Figure 8 shown, the method includes:
[0097] Step 401, obtain the version information of the application program in the embedded device; and determine the target update version corresponding to the version information.
[0098] Step 402, if it is determined that the current running version of the application program is different from the target update version, generate a new firmware package according to the target update version and the current running version.
[0099] Step 403, send the new firmware package to the storage module of the application program, so that the application program switches its current running mode to the Bootloader mode, and in the Bootloader mode, update the current running version of the application program according to the new firmware package to obtain the updated application program.
[0100] The method of this embodiment can execute the technical solutions in the above method. The specific implementation process and technical principle are the same, and will not be elaborated here.
[0101] Figure 9 As shown in the flowchart of another update processing method for an embedded device provided by an embodiment of the present application, which is applied to a code management system, such as Figure 9 shown, the method includes:
[0102] Step 501, obtain the version information of the application program in the embedded device.
[0103] In one example, the version information includes software version information and hardware version information, and the software version information is the information of the currently running version.
[0104] Step 502, determine the target update version corresponding to the hardware version information.
[0105] Step 503, if it is determined that the currently running version of the application program is different from the target update version, then compare the target version information of the target update version with the software version information of the currently running version, copy the address information and length information of the same code content obtained by the comparison to the new firmware package, and write the different code content obtained by the comparison to the new firmware package.
[0106] In one example, the new firmware package includes a start symbol, the number of frames, frame data, and a firmware CRC check code.
[0107] Step 504, send the new firmware package to the storage module of the application program, so that the application program switches its current running mode to the Bootloader mode, and in the Bootloader mode, update the currently running version of the application program according to the new firmware package to obtain an updated application program.
[0108] In one example, the updated application program is obtained in the Bootloader mode of the embedded device. According to the start symbol in the new firmware package, it is determined that there is a new firmware package in the storage module; according to the address information and length information of the same code content in the new firmware package, the backup address corresponding to the address information in the pre-backup program is determined, and the firmware code at the backup address is copied to the application program; and the different code content in the new firmware package is decompressed, and the decompressed content is updated to the application program.
[0109] The method of this embodiment can execute the technical solutions in the above method. The specific implementation process and technical principle are the same, and will not be elaborated here.
[0110] Figure 10The following is a schematic structural diagram of an update processing device for an embedded device provided by an embodiment of the present application, which is applied to an embedded device. The embedded device deploys an application program, such as Figure 10 shown. The device includes:
[0111] A receiving module 61, configured to store the new firmware package in the storage module if a new firmware package sent by the code management system is received; wherein, the new firmware package is generated by the code management system according to the target update version and the current running version when it is determined that the current running version of the application program is different from the target update version; the target update version is determined according to the obtained version information of the application program.
[0112] A switching module 62, configured to switch the current running mode to the Bootloader mode.
[0113] An update module 63, configured to update the current running version of the application program according to the new firmware package in the Bootloader mode to obtain the updated application program.
[0114] The device of this embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principle are the same, which will not be elaborated here.
[0115] Figure 11 The following is a schematic structural diagram of another update processing device for an embedded device provided by an embodiment of the present application. On the basis of the embodiment shown in Figure 10 shown, as Figure 11 shown, the version information includes software version information and hardware version information.
[0116] The software version information is the information of the current running version; the new firmware package is generated by the code management system comparing the target version information of the target update version with the software version information of the current running version, copying the address information and length information of the same code content obtained by the comparison to the new firmware package, and writing the different code content obtained by the comparison into the new firmware package.
[0117] In one example, the new firmware package includes a start symbol, a frame number, frame data, and a firmware CRC check code.
[0118] In one example, the update module 63 includes:
[0119] A determination unit 631, configured to determine that there is a new firmware package in the storage module according to the start symbol in the new firmware package in the Bootloader mode.
[0120] An update unit 632, configured to determine a backup address corresponding to the address information in the pre-backup application program according to the address information and length information of the same code content in the new firmware package, copy the firmware code at the backup address to the application program; and decompress the different code content in the new firmware package, and update the decompressed content to the application program to obtain an updated application program.
[0121] In one example, the device further includes:
[0122] A verification module 71, configured to, after updating the current running version of the application program according to the new firmware package to obtain an updated application program, verify the target updated version in the updated application program according to the firmware CRC verification code to obtain verification result information; wherein the verification result information indicates whether the application program is updated successfully.
[0123] The device in this embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principle are the same, which will not be elaborated here.
[0124] Figure 12 FIG. is a schematic structural diagram of another update processing device for an embedded device provided by an embodiment of the present application, which is applied to a code management system, such as Figure 12 As shown, the device includes:
[0125] An acquisition module 81, configured to acquire the version information of the application program in the embedded device.
[0126] A determination module 82, configured to determine a target updated version corresponding to the version information.
[0127] A generation module 83, configured to, if it is determined that the current running version of the application program is different from the target updated version, generate a new firmware package according to the target updated version and the current running version.
[0128] A sending module 84, configured to send the new firmware package to the storage module of the application program, so that the application program switches its current running mode to the Bootloader mode, and in the Bootloader mode, update the current running version of the application program according to the new firmware package to obtain an updated application program.
[0129] The device in this embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principle are the same, which will not be elaborated here.
[0130] Based on the embodiment shown in Figure 12 Another update processing device for an embedded device provided by an embodiment of the present application includes: The version information includes software version information and hardware version information, and the software version information is the information of the current running version.
[0131] Determination module 82, specifically configured to:
[0132] Determine a target update version corresponding to the hardware version information.
[0133] Generation module 83, specifically configured to:
[0134] Compare the target version information of the target update version with the software version information of the currently running version, copy the address information and length information of the same code content identified by the comparison to the new firmware package, and write the different code content identified by the comparison to the new firmware package.
[0135] In one example, the new firmware package includes a start symbol, the number of frames, frame data, and a firmware CRC check code.
[0136] The updated application program is that in the Bootloader mode of the embedded device, according to the start symbol in the new firmware package, it is determined that there is a new firmware package in the storage module.
[0137] According to the address information and length information of the same code content in the new firmware package, determine the backup address corresponding to the address information in the pre-backup program, copy the firmware code at the backup address to the application program; and decompress the different code content in the new firmware package, and update the decompressed content to the application program.
[0138] The device of this embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principle are the same, which will not be elaborated here.
[0139] Figure 13 This is a schematic structural diagram of an embedded device provided by an embodiment of the present application, as Figure 13 shown, the embedded device includes: a memory 91 and a processor 92.
[0140] The memory 91 stores a computer program that can run on the processor 92.
[0141] The processor 92 is configured to execute the method provided in the above embodiment.
[0142] The embedded device further includes a receiver 93 and a transmitter 94. The receiver 93 is used to receive instructions and data sent by an external device, and the transmitter 94 is used to send instructions and data to the external device.
[0143] Figure 14 This is a schematic structural diagram of a code management system provided by an embodiment of the present application, as Figure 14 shown, the code management system includes: a memory 101 and a processor 102.
[0144] A computer program that can run on the processor 102 is stored in the memory 101.
[0145] The processor 102 is configured to execute the method provided in the above embodiments.
[0146] The code management system further includes a receiver 103 and a transmitter 104. The receiver 103 is used to receive instructions and data sent by an external device, and the transmitter 104 is used to send instructions and data to the external device.
[0147] An embodiment of the present application also provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the embedded device, the embedded device can execute the method provided in the above embodiments.
[0148] An embodiment of the present application also provides a computer program product. The computer program product includes: a computer program. The computer program is stored in a readable storage medium. At least one processor of the embedded device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable the embedded device to execute the solution provided in any of the above embodiments.
[0149] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0150] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A method for update processing of an embedded device, characterized in that Applied to an embedded device, the embedded device is deployed with an application program, including: If a new firmware package sent by the code management system is received, store the new firmware package in the storage module; wherein, the new firmware package is generated by the code management system when it determines that the current running version of the application program is different from the target update version, based on the target update version and the current running version; the target update version is determined according to the obtained version information of the application program; Switch the current running mode to the Bootloader mode; In the Bootloader mode, update the current running version of the application program according to the new firmware package to obtain the updated application program.
2. The method according to claim 1, wherein The version information includes software version information and hardware version information; The software version information is the information of the current running version; the new firmware package is generated by the code management system comparing the target version information of the target update version with the software version information of the current running version, copying the address information and length information of the same code content found in the comparison to the new firmware package, and writing the different code content found in the comparison to the new firmware package.
3. The method according to claim 2, wherein The new firmware package includes a start symbol, the number of frames, frame data, and a firmware CRC check code.
4. The method according to claim 3, wherein In the Bootloader mode, updating the current running version of the application program according to the new firmware package to obtain the updated application program includes: In the Bootloader mode, determine that the new firmware package exists in the storage module according to the start symbol in the new firmware package; According to the address information and length information of the same code content in the new firmware package, determine the backup address in the pre-backup application program corresponding to the address information, copy the firmware code at the backup address to the application program; and decompress the different code content in the new firmware package and update the decompressed content to the application program to obtain the updated application program.
5. The method according to claim 3, wherein After updating the current running version of the application program according to the new firmware package to obtain the updated application program, the method further includes: Check the target update version in the updated application program according to the firmware CRC check code to obtain check result information; wherein, the check result information indicates whether the application program is updated successfully.
6. A method for update processing of an embedded device, characterized in that, Applied to a code management system, including: Obtain the version information of the application program in the embedded device; and determine the target update version corresponding to the version information; If it is determined that the current running version of the application program is different from the target update version, generate a new firmware package according to the target update version and the current running version; Send the new firmware package to the storage module of the application program, so that the application program switches the current running mode to the Bootloader mode, and in the Bootloader mode, update the current running version of the application program according to the new firmware package to obtain the updated application program.
7. The method according to claim 6, wherein The version information includes software version information and hardware version information, and the software version information is the information of the currently running version; The determining of the target update version corresponding to the version information includes: Determining the target update version corresponding to the hardware version information; The generating of a new firmware package according to the target update version and the currently running version includes: Comparing the target version information of the target update version with the software version information of the currently running version, copying the address information and length information of the same code content obtained by the comparison to the new firmware package, and writing the different code content obtained by the comparison to the new firmware package.
8. The method according to claim 6, characterized in that The new firmware package includes a start symbol, a frame count, frame data, and a firmware CRC check code; The updated application program is that when the embedded device is in the Bootloader mode, according to the start symbol in the new firmware package, it is determined that the new firmware package exists in the storage module; According to the address information and length information of the same code content in the new firmware package, determining the backup address corresponding to the address information in the pre-backup program, copying the firmware code at the backup address to the application program; and decompressing the different code content in the new firmware package and updating the decompressed content to the application program.
9. An update processing device for an embedded device, characterized in that, Applied to an embedded device, the embedded device is deployed with an application program, including: A receiving module, configured to store the new firmware package in a storage module if the new firmware package sent by the code management system is received; wherein, the new firmware package is generated by the code management system according to the target update version and the currently running version when it is determined that the currently running version of the application program is different from the target update version; the target update version is determined according to the obtained version information of the application program; A switching module, configured to switch the current running mode to the Bootloader mode; An updating module, configured to, in the Bootloader mode, update the currently running version of the application program according to the new firmware package to obtain an updated application program.
10. An update processing device for an embedded device, characterized in that, Applied to a code management system, including: An obtaining module, configured to obtain the version information of the application program in the embedded device; A determining module, configured to determine the target update version corresponding to the version information; A generating module, configured to, if it is determined that the currently running version of the application program is different from the target update version, generate a new firmware package according to the target update version and the currently running version; A sending module, configured to send the new firmware package to the storage module of the application program, so that the application program switches the current running mode to the Bootloader mode, and in the Bootloader mode, updates the currently running version of the application program according to the new firmware package to obtain an updated application program.
11. An embedded device, characterized in that, Including a memory and a processor, a computer program executable on the processor is stored in the memory, and when the processor executes the computer program, the method described in any one of the above claims 1-5 is implemented.
12. A code management system, characterized in that, It includes a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the method described in any one of claims 6-8 above is implemented.
13. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium. When the computer-executable instructions are executed by the processor, they are used to implement the method described in any one of claims 1-5, or the method described in any one of claims 6-8.