Firmware upgrading method and device of embedded equipment, electronic equipment and storage medium

By integrating and verifying the firmware information of embedded devices, the problem of insufficient data security and stability during the firmware upgrade of embedded devices is solved, and a more efficient and reliable firmware upgrade process is achieved.

CN119127255APending Publication Date: 2024-12-13HANGZHOU HOLLYSYS AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411240674.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The prior art lacks data security, stability and flexibility during the firmware upgrade process of embedded devices, resulting in an increase in the risk of upgrade failure and reducing the efficiency of firmware upgrade.

Method used

By obtaining key information of each sub-firmware of embedded devices, integrating it into firmware information files, and packaging the sub-firmware and information files into system firmware files, integrating electronic tag files, and performing device detection, downloading, verification and updating to ensure the security of firmware Sex and stability.

Benefits of technology

Improves the security, stability and flexibility of firmware upgrades, reduces the risk of upgrade failure, and improves the efficiency of firmware upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127255A_ABST
    Figure CN119127255A_ABST
Patent Text Reader

Abstract

The invention provides a firmware upgrading method and device for embedded equipment, electronic equipment and a storage medium. The method comprises the following steps: acquiring key information corresponding to each sub-firmware in the embedded equipment, and integrating the key information into a firmware information file; packaging the sub-firmware and the firmware information file into a system firmware file; integrating the information of the system firmware file into an electronic tag file, and merging the electronic tag file into the system firmware file; detecting the embedded device, and judging whether the embedded device meets an upgrading condition or not; verifying the system firmware file downloaded into the embedded device, and verifying each sub-firmware in the system firmware file downloaded into the embedded device; and updating the corresponding original sub-firmware in the embedded equipment according to the firmware information file corresponding to the sub-firmware passing the verification. According to the firmware upgrading method and device, the security, stability and flexibility of firmware upgrading are improved, and the firmware upgrading efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of embedded devices, and in particular to a firmware upgrade method, device, electronic device and storage medium for an embedded device. Background Art

[0002] With the widespread use of embedded devices in various industries, firmware upgrades have become a critical task. Firmware upgrades are mainly used to improve device performance, patch security vulnerabilities, and introduce new features. However, the complexity of embedded devices, especially the hardware diversity and the use of multi-core CPUs, has brought challenges to firmware upgrades. Traditional firmware upgrade methods face limitations in security, stability, and flexibility, especially when dealing with different types of programmable devices (such as MPUs, FPGAs, and DSPs), the firmware management and upgrade process becomes particularly complex.

[0003] Existing technologies have obvious deficiencies in ensuring data integrity, security, and flexibility in adapting to different hardware configurations and operating systems during firmware upgrades. These limitations may lead to an unsmooth firmware upgrade process, increase the risk of upgrade failure, and affect the normal operation of the device and data security. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a firmware upgrade method, device, electronic device and storage medium for an embedded device to solve the problems of insufficient data security, stability and flexibility in the prior art, increased risk of upgrade failure and reduced firmware upgrade efficiency.

[0005] In a first aspect of an embodiment of the present application, a method for upgrading the firmware of an embedded device is provided, comprising: obtaining key information corresponding to each sub-firmware in the embedded device, and integrating the key information into a firmware information file; packaging the sub-firmware and the firmware information file into a system firmware file; integrating the information of the system firmware file into an electronic label file, and merging the electronic label file into the system firmware file; detecting the embedded device to determine whether the embedded device meets the upgrade conditions; when the embedded device meets the upgrade conditions, downloading the system firmware file to the embedded device; using the electronic label file to verify the system firmware file downloaded to the embedded device, and verifying each sub-firmware in the system firmware file downloaded to the embedded device; and updating the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the sub-firmware that has passed the verification.

[0006] According to a second aspect of an embodiment of the present application, a firmware upgrade device for an embedded device is provided, comprising: an acquisition module, configured to acquire key information corresponding to each sub-firmware in the embedded device, and integrate the key information into a firmware information file; a packaging module, configured to package the sub-firmware and the firmware information file into a system firmware file; an integration module, configured to integrate the information of the system firmware file into an electronic label file, and merge the electronic label file into the system firmware file; a detection module, configured to detect the embedded device and determine whether the embedded device meets the upgrade conditions; a download module, configured to download the system firmware file to the embedded device when the embedded device meets the upgrade conditions; a verification module, configured to verify the system firmware file downloaded to the embedded device using the electronic label file, and verify each sub-firmware in the system firmware file downloaded to the embedded device; and an update module, configured to update the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the verified sub-firmware.

[0007] According to a third aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.

[0008] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0009] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0010] By acquiring key information corresponding to each sub-firmware in the embedded device, the key information is integrated into a firmware information file; the sub-firmware and firmware information files are packaged into a system firmware file; the information of the system firmware file is integrated into an electronic label file, and the electronic label file is merged into the system firmware file; the embedded device is detected to determine whether the embedded device meets the upgrade conditions; when the embedded device meets the upgrade conditions, the system firmware file is downloaded to the embedded device; the system firmware file downloaded to the embedded device is verified using the electronic label file, and each sub-firmware in the system firmware file downloaded to the embedded device is verified; according to the firmware information file corresponding to the verified sub-firmware, the corresponding original sub-firmware in the embedded device is updated. This application improves the security, stability and flexibility of firmware upgrades, avoids the risk of firmware upgrade failures, and improves the efficiency of firmware upgrades. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 It is a flowchart of a firmware upgrade method for an embedded device provided in an embodiment of the present application;

[0013] Figure 2 It is a structural diagram of a firmware upgrade device for an embedded device provided in an embodiment of the present application;

[0014] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0015] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0016] With the widespread use of embedded devices, firmware upgrades play an important role in improving device performance, fixing vulnerabilities, and adding new features. However, due to the hardware diversity of embedded devices and the use of multi-core CPUs, firmware upgrades face many challenges. An embedded device system usually contains application firmware and boot firmware of different programmable devices, which brings complexity to firmware upgrades. In addition, existing firmware upgrade methods are insufficient in terms of security, stability, and flexibility.

[0017] In view of the problems existing in the prior art, this application provides a new embedded device firmware upgrade method. The core of this method lies in its comprehensiveness and systematicness, aiming to solve the deficiencies of the prior art in terms of security, stability and flexibility, especially for diverse hardware configurations and multi-core CPU environments. The main steps of this solution include:

[0018] 1) System firmware packaging: Package all sub-firmware (such as boot firmware, kernel firmware, application firmware, etc.) in a complex embedded device system into a unified system firmware to ensure consistency and integrity throughout the upgrade process.

[0019] 2) Device detection: Before the upgrade begins, this method performs a comprehensive test on the embedded device, including hardware configuration, operating system version, installed applications, and the current working status of the device. This ensures that the device is in a suitable state for the upgrade and avoids upgrade failures caused by incompatibility or insufficient configuration.

[0020] 3) Firmware download: This step involves downloading the system firmware to the embedded device via the network or physical storage media. This link emphasizes the flexibility and adaptability of downloading, allowing firmware to be obtained from different sources.

[0021] 4) Firmware verification: After downloading, this method conducts a comprehensive verification of the system firmware and its sub-firmware, using technical means such as checksums and digital signatures to ensure the integrity and legitimacy of the firmware. This is a key step in ensuring firmware security.

[0022] 5) Firmware update: The sub-firmware that has passed the verification will be correctly updated to the device according to the instructions in the firmware information file (storage media, location, etc.). The differential upgrade technology is used to update only the changed parts, which improves the efficiency and speed of the upgrade.

[0023] 6) Device Restart: After the firmware is updated, the device will restart to activate the new firmware. During this process, the device will perform a self-check to ensure the normal operation of the new firmware.

[0024] Through the above process of this solution, the firmware upgrade method of this application has made innovations and improvements in terms of security, stability and flexibility, and can adapt to different hardware platforms and operating system environments. This not only improves the success rate of firmware upgrades, but also reduces the risks associated with upgrades, ensuring a smooth and efficient upgrade process.

[0025] The following describes in detail a firmware upgrade method and apparatus for an embedded device provided by the present application in conjunction with the accompanying drawings and specific embodiments.

[0026] Figure 1 It is a flowchart of a firmware upgrade method for an embedded device provided in an embodiment of the present application. Figure 1 The firmware upgrade method of the embedded device can be performed by a third-party upgrade program. Figure 1 As shown, the firmware upgrade method of the embedded device may specifically include:

[0027] S101, obtaining key information corresponding to each sub-firmware in the embedded device, and integrating the key information into a firmware information file;

[0028] S102, packaging the sub-firmware and the firmware information file into a system firmware file;

[0029] S103, integrating the information of the system firmware file into an electronic label file, and merging the electronic label file into the system firmware file;

[0030] S104, detecting the embedded device to determine whether the embedded device meets the upgrade conditions;

[0031] S105, when the embedded device meets the upgrade conditions, downloading the system firmware file to the embedded device;

[0032] S106, using the electronic label file to verify the system firmware file downloaded to the embedded device, and verifying each sub-firmware in the system firmware file downloaded to the embedded device;

[0033] S107, updating the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the verified sub-firmware.

[0034] In some embodiments, obtaining key information corresponding to each sub-firmware in the embedded device and integrating the key information into a firmware information file includes:

[0035] Collect key information corresponding to each sub-firmware in the embedded device, and store the collected key information corresponding to the sub-firmware in the created firmware information file;

[0036] Among them, the key information includes the name, length, verification information, storage medium, storage location and storage method of the sub-firmware.

[0037] Specifically, the embodiments of the present application describe in detail the specific process of creating and managing firmware information files in a complex embedded device system. The system firmware packaging process mainly includes the following processes:

[0038] First, collect the key information of the sub-firmware and record the basic information of each sub-firmware in the embedded system in detail. Collect the name, size (length), verification information (checksum or digital signature), storage medium (such as flash memory, hard disk), storage location (specific location in the device) and storage method (file system format used) of each sub-firmware. Use appropriate software tools or manual processes to detect and record this information. For example, for firmware stored in flash memory, its size and checksum can be obtained by reading the firmware header information.

[0039] Furthermore, a firmware information file is created to integrate the collected information into a structured document as a reference for the upgrade process. Using automated scripts or manual editing, the key information of all sub-firmware is compiled into a unified file. The file can be in XML, JSON or other suitable formats to ensure easy reading and parsing. The information of each sub-firmware is listed as a separate entry, including its identifier (name), size, checksum, storage medium and location, etc. This information will be used in the subsequent packaging and installation process.

[0040] Furthermore, the firmware information file plays a key role in the packaging and upgrading process of the system firmware. In the packaging stage, it is used to determine which sub-firmware needs to be included in the final system firmware package. In the upgrading stage, the file provides the necessary information to ensure that each sub-firmware is correctly installed to the specified location. As the system evolves and the sub-firmware is updated, the firmware information file needs to be updated regularly to reflect the latest firmware status.

[0041] Furthermore, a general or customized packaging technology (such as CPIO or tar) is used to merge all sub-firmware and firmware information files into a single system firmware file. The generated system firmware file contains all the upgrade data required by the embedded device.

[0042] By using the method of the above-mentioned embodiment of the present application, the various sub-firmware of programmable devices such as MPU, FPGA, DSP, etc. are packaged in a way that simplifies the firmware upgrade process, reduces the probability of errors, and facilitates management. Packaging information such as firmware storage method, storage medium, storage location, etc. into the firmware itself in the form of a file can effectively solve the problem of inconsistent upgrade codes caused by the hardware diversity of embedded devices. This approach encapsulates the storage details of the firmware inside the firmware file, so that embedded devices on different hardware platforms do not need to care about the differences in storage details during the upgrade process, and only need to follow a unified upgrade process.

[0043] By packaging storage-related information into the firmware file, the consistency and portability of the firmware upgrade code can be ensured, reducing the workload of separate development and debugging for different hardware platforms. At the same time, this approach also simplifies the upgrade process, improves upgrade efficiency and reliability, and provides users with a more convenient and stable firmware upgrade experience.

[0044] In summary, packaging the firmware storage method, storage medium, storage location and other information into the firmware itself in the form of files can effectively solve the problem of inconsistent upgrade codes caused by the hardware diversity of embedded devices and improve the efficiency and reliability of firmware upgrades.

[0045] In some embodiments, integrating information of the system firmware file into an electronic label file, and merging the electronic label file into the system firmware file, includes:

[0046] Generate an electronic label file using the information of the system firmware file, and merge the electronic label file into the head or tail of the system firmware file;

[0047] The information of the system firmware file includes file length, verification information, name of the embedded device and firmware version number.

[0048] Specifically, the embodiment of the present application also describes how to generate an electronic tag file and effectively merge it into a system firmware file during an embedded device firmware upgrade process. The process may include the following steps:

[0049] First, create an electronic label file that contains important information about the system firmware file. The electronic label file contains the length of the system firmware file, a checksum or digital signature (used to verify the integrity and authenticity of the firmware), the device name (identifying the device type to which the firmware applies), and the firmware version number (used to distinguish different versions of firmware). In actual applications, you can use scripts or tools to calculate the above information based on the actual data of the system firmware file and generate a formatted electronic label file.

[0050] Furthermore, the electronic label file is attached to the head or tail of the system firmware file. For example, a file editing tool or a programming script is used to insert the electronic label file content into an appropriate position of the system firmware file. This operation involves file read and write operations and data flow management. In actual applications, it can be decided to place the electronic label file at the beginning or the end of the system firmware file according to the needs of the upgrade process.

[0051] Through the method of the embodiment of the present application, the checksum or digital signature, file length, embedded device name, firmware version number and other information of the system firmware file are synthesized into an electronic tag file, and the checksum or digital signature can be used to verify the integrity and authenticity of the system firmware file to prevent malicious tampering or virus infection. Through information such as file length, the correctness and integrity of the system firmware file can be ensured to avoid upgrade failures due to file damage or loss, improve the security and reliability of firmware upgrades, and facilitate management and tracking.

[0052] In some embodiments, detecting the embedded device to determine whether the embedded device meets the upgrade conditions includes:

[0053] Scan the hardware configuration of the embedded device to detect whether the hardware configuration meets the requirements;

[0054] Check the operating system version running on the embedded device to confirm whether the operating system version is compatible;

[0055] Checking installed applications on the embedded device to determine if there are conflicting applications;

[0056] Check the system working status of the embedded device to determine whether the system working status meets the upgrade conditions.

[0057] Specifically, before starting the firmware upgrade, in order to ensure that the embedded device is in a state suitable for upgrading, various tests will be performed on the embedded device. The content and process of the device detection are described in detail below in conjunction with a specific embodiment, which may specifically include the following:

[0058] Hardware configuration detection: Check the device's CPU type, memory size, storage space, etc. to ensure that they meet the requirements of the new firmware.

[0059] OS version detection: Confirms whether the OS version running on the embedded device is compatible with the new firmware.

[0060] Installed Application Detection: Checks installed apps on the embedded device to identify any apps that might conflict with the new firmware.

[0061] System working status detection: Evaluate the current operating status of the embedded device, such as battery power, network connection status, working status, etc., to ensure that the device will not be affected by low power or disconnected connection during the upgrade process, and avoid firmware upgrades in some working states that cannot be upgraded.

[0062] Further, the device detection process is as follows:

[0063] First, hardware compatibility check, by scanning the hardware configuration of the embedded device, including processor type, memory, storage space, etc., to ensure that the hardware resources are sufficient to support the new firmware.

[0064] Second, OS version confirmation: check the OS version running on the embedded device to confirm that the OS version is compatible with the new firmware.

[0065] Third, application conflict detection checks the applications installed on the embedded device to ensure that there are no applications that conflict with the new firmware.

[0066] Fourth, system status assessment evaluates the current operating status of the device, such as battery power and network connection, to confirm that the embedded device has sufficient power and a stable connection during the upgrade process.

[0067] Through the device detection operation of the above-mentioned embodiment of the present application, a comprehensive detection of the embedded device before the firmware upgrade can improve the upgrade success rate, avoid the risk of upgrade failure, and improve the stability of the device. The embodiment of the present application can prevent problems that may occur during the upgrade process by detecting and ensuring that the device meets all the prerequisites for the upgrade. Ensure that the hardware and software environment of the device is suitable for the new firmware, thereby improving the success rate of the upgrade. Reduce the risk of upgrade failure caused by hardware incompatibility, software conflicts, or inappropriate device status.

[0068] Further, after the device detection is completed, the system firmware is downloaded to the embedded device through a network or storage device. For example, the firmware is downloaded from a remote server using a network connection (such as Wi-Fi, Ethernet, or cellular network), or the firmware is directly copied to the embedded device using a physical storage medium (such as a USB drive, SD card, etc.).

[0069] In some embodiments, the electronic tag file is used to verify the system firmware file downloaded to the embedded device, and each sub-firmware in the system firmware file downloaded to the embedded device is verified, including:

[0070] According to the verification information in the electronic tag file, the system firmware file downloaded to the embedded device is verified to confirm the correctness and legality of the system firmware file;

[0071] When the system firmware file is verified, the system firmware file is unpacked to extract the sub-firmware and firmware information files in the system firmware file;

[0072] The extracted sub-firmware is verified according to the verification information in the firmware information file to confirm the correctness and legality of the sub-firmware.

[0073] Specifically, the embodiment of the present application also discloses in detail the process of effectively verifying the system firmware downloaded in the embedded device. First, the system downloads a system firmware file containing necessary upgrades through the network or other means. In order to ensure that this firmware file is legal and has not been tampered with, the system first refers to the electronic tag file attached to the firmware file. This electronic tag file contains key information, such as the firmware's checksum or digital signature, file length, device name and firmware version number.

[0074] Further, using this information, the system first confirms whether the downloaded firmware file maintains data integrity and authenticity. This step is crucial as it ensures that the device does not install tampered or unauthorized firmware, thereby preventing possible security risks.

[0075] Furthermore, once the system firmware file passes the preliminary verification, the next step is to unpack the file and extract the various sub-firmware and firmware information files contained therein. The firmware information file contains verification information for each sub-firmware, such as a checksum or digital signature. For each sub-firmware, the system performs the verification process again to ensure that they are also complete, correct and legal. This step is to ensure that each sub-firmware is suitable for the requirements of the specific device and firmware upgrade.

[0076] Furthermore, during the verification process, the system uses two technical means: checksums and digital signatures. Checksums are usually used to detect whether errors occur during data transmission or storage, and are mainly used to ensure the integrity of data during transmission or storage, while digital signatures are used to verify the source of data, ensure that the sender of the data is credible, and prove that the data has not been tampered with, that is, digital signatures are used to confirm the source of the data and ensure that the data has not been modified since it was generated. Together, these two methods provide a solid verification mechanism to ensure the security and reliability of firmware upgrades.

[0077] Through the firmware verification operation of the above embodiment of the present application, the embodiment of the present application first verifies the entire system firmware, and then verifies the sub-firmware one by one, to ensure that the entire system firmware and its components are correct and legal, and have not been tampered with. In this way, the installation of illegal firmware can be effectively prevented, protecting the device from potential security threats.

[0078] In some embodiments, updating the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the verified sub-firmware includes:

[0079] Read the firmware information file to obtain the storage medium, storage location and storage method corresponding to the verified sub-firmware;

[0080] Compare the verified sub-firmware with the corresponding original sub-firmware in the embedded device to determine the changed data portion;

[0081] According to the storage medium, storage location and storage method corresponding to the verified sub-firmware, the changed data part in the original sub-firmware is updated.

[0082] Specifically, the embodiment of the present application will describe in detail how to update the corresponding original sub-firmware in the device according to the verified sub-firmware information in the embedded device. This process not only ensures the correctness of the firmware update, but also improves the efficiency of the update by adopting the differential upgrade technology.

[0083] First, the firmware update process begins with an in-depth reading of the firmware information file. This file contains detailed information about each verified sub-firmware, such as the specific media, exact location, and storage format they should be stored in the device. This information is crucial for guiding how to update the firmware correctly to ensure that the firmware can run correctly on the device.

[0084] The next step is to compare each verified sub-firmware with the corresponding sub-firmware in the device. The purpose of this step is to determine which data parts have changed. During the firmware upgrade process, not all data may need to be updated. By updating only the parts that have changed, the time and network bandwidth required during the upgrade process can be greatly reduced.

[0085] Further, once it is determined which data needs to be updated, the next step is to actually update it. According to the instructions provided in the firmware information file, the system will accurately locate the media and location where each sub-firmware should be stored, and update these sub-firmware in the correct way. During the update process, the system pays special attention to updating only those data parts that have changed, which is achieved through differential upgrade technology.

[0086] In practical applications, differential upgrade technology allows the system to download and install only those parts that are different from the existing firmware. For example, a special algorithm is used to identify the differences between the new and old firmware, and only these differences are transferred and installed. This method is more efficient than the traditional full firmware replacement. It compares the differences between the new and old firmware and only updates the changed parts, thus saving time and reducing data transmission. Therefore, it is particularly suitable for situations where network bandwidth is limited or device storage space is tight. This method not only saves time and network resources, but also reduces the risks that may be caused by comprehensive updates.

[0087] In some embodiments, after updating the corresponding original sub-firmware in the embedded device, the method further includes:

[0088] Restart the embedded device to make the updated sub-firmware take effect at the next startup. During the startup process of the embedded device, a preset self-test program is executed to test the function of the updated sub-firmware.

[0089] Specifically, the embodiment of the present application also describes in detail the restart and self-test process after completing the sub-firmware update in the embedded device. This process is a key step to ensure that the new firmware is correctly installed and can work normally. The following is a detailed description of the embedded device restart and self-test process, which may specifically include the following:

[0090] First, once the firmware is updated, the embedded device will be rebooted. The reboot process is not just shutting down and restarting the device, it is a key action to activate the new firmware. During this process, the new firmware will replace the old firmware and start running on the device. The reboot process ensures that the device can smoothly transition to the new operating state.

[0091] Furthermore, to ensure that the new firmware is working properly and all features of the device are functioning as expected, the device will perform a series of preset self-tests during the boot process. These self-tests are designed to be quick yet comprehensive, checking a variety of hardware and software features to ensure that the new firmware has not introduced any issues or incompatibilities.

[0092] In one example, the self-check procedure may include, but is not limited to, the following checks:

[0093] Hardware Check: Check the core hardware components of the device, such as CPU, memory, storage devices, etc., to ensure that they are working properly.

[0094] Software Functionality Check: Tests critical software functionality in the new firmware to ensure all expected features work properly.

[0095] Connectivity Tests: If the device relies on a network or other external connections, the self-test will verify that those connections are stable.

[0096] Security Check: Ensures that the new firmware follows all security protocols and standards.

[0097] Successful completion of the self-test procedure verifies the validity and reliability of the new firmware. If any problems are found during the self-test process, the embedded device can roll back to the old firmware version or display an error message to prompt the user to take further action.

[0098] According to the technical solution provided by the embodiment of the present application, the embodiment of the present application provides a method for packaging each sub-firmware of the embedded device system, which can simplify the firmware upgrade process, reduce the probability of error, and facilitate management. Synthesizing the checksum or digital signature, file length, embedded device name, firmware version number and other information of the system firmware file into an electronic tag file can ensure the correctness and integrity of the system firmware file, avoid upgrade failures due to file damage or missing, improve the security and reliability of firmware upgrades, and facilitate management and tracking. Packaging the firmware storage method, storage medium, storage location and other information into the firmware itself in the form of a file can effectively solve the problem of inconsistent upgrade codes caused by the hardware diversity of embedded devices, and improve the efficiency and reliability of firmware upgrades. Before the firmware upgrade, a comprehensive detection of the embedded device can improve the success rate of the upgrade, avoid the risks brought by the upgrade failure, and improve the stability of the device.

[0099] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0100] Figure 2 Schematic diagram of the structure of the firmware upgrade device of the embedded device provided in the embodiment of the present application. Figure 2 As shown, the firmware upgrade device of the embedded device includes:

[0101] The acquisition module 201 is configured to acquire key information corresponding to each sub-firmware in the embedded device and integrate the key information into a firmware information file;

[0102] The packaging module 202 is configured to package the sub-firmware and the firmware information files into a system firmware file;

[0103] An integration module 203 is configured to integrate the information of the system firmware file into an electronic label file, and merge the electronic label file into the system firmware file;

[0104] The detection module 204 is configured to detect the embedded device and determine whether the embedded device meets the upgrade conditions;

[0105] The download module 205 is configured to download the system firmware file to the embedded device when the embedded device meets the upgrade conditions;

[0106] The verification module 206 is configured to verify the system firmware file downloaded to the embedded device using the electronic tag file, and verify each sub-firmware in the system firmware file downloaded to the embedded device;

[0107] The updating module 207 is configured to update the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the verified sub-firmware.

[0108] In some embodiments, Figure 2 The acquisition module 201 collects key information corresponding to each sub-firmware in the embedded device, and stores the collected key information corresponding to the sub-firmware into the created firmware information file; wherein the key information includes the name, length, verification information, storage medium, storage location and storage method corresponding to the sub-firmware.

[0109] In some embodiments, Figure 2 The integration module 203 generates an electronic label file using the information of the system firmware file, and merges the electronic label file into the head or tail of the system firmware file; wherein the information of the system firmware file includes file length, verification information, name of the embedded device and firmware version number.

[0110] In some embodiments, Figure 2 The detection module 204 scans the hardware configuration of the embedded device to detect whether the hardware configuration meets the requirements; checks the operating system version running on the embedded device to confirm whether the operating system version is compatible; checks the applications installed on the embedded device to determine whether there are conflicting applications; and checks the system working status of the embedded device to determine whether the system working status meets the upgrade conditions.

[0111] In some embodiments, Figure 2 The verification module 206 verifies the system firmware file downloaded to the embedded device according to the verification information in the electronic tag file to confirm the correctness and legality of the system firmware file; when the system firmware file is verified, the system firmware file is unpacked to extract the sub-firmware and firmware information file in the system firmware file; according to the verification information in the firmware information file, the extracted sub-firmware is verified to confirm the correctness and legality of the sub-firmware.

[0112] In some embodiments, Figure 2 The update module 207 reads the firmware information file to obtain the storage medium, storage location and storage method corresponding to the verified sub-firmware; compares the verified sub-firmware with the corresponding original sub-firmware in the embedded device to determine the changed data part; and updates the changed data part in the original sub-firmware according to the storage medium, storage location and storage method corresponding to the verified sub-firmware.

[0113] In some embodiments, Figure 2 After updating the corresponding original sub-firmware in the embedded device, the restart module 208 restarts the embedded device so that the updated sub-firmware takes effect at the next startup. During the startup process of the embedded device, a preset self-test program is executed to detect the function of the updated sub-firmware.

[0114] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0115] Figure 3 Schematic diagram of an electronic device 3 provided in an embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 301 executes the computer program 303, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0116] The electronic device 3 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 The electronic device 3 is merely an example and does not limit the electronic device 3 , and may include more or less components than those shown in the figure, or different components.

[0117] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0118] The memory 302 may be an internal storage unit of the electronic device 3, for example, a hard disk or memory of the electronic device 3. The memory 302 may also be an external storage device of the electronic device 3, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 3. The memory 302 may also include both an internal storage unit of the electronic device 3 and an external storage device. The memory 302 is used to store computer programs and other programs and data required by the electronic device.

[0119] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0120] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0121] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A firmware upgrade method for an embedded device, characterized in that: include: Obtain key information corresponding to each sub-firmware in the embedded device, and integrate the key information into a firmware information file; Packing the sub-firmware and the firmware information file into a system firmware file; Integrate the information of the system firmware file into an electronic label file, and merge the electronic label file into the system firmware file; Detecting the embedded device to determine whether the embedded device meets the upgrade conditions; When the embedded device meets the upgrade condition, downloading the system firmware file to the embedded device; Using the electronic tag file to verify the system firmware file downloaded to the embedded device, and verifying each sub-firmware in the system firmware file downloaded to the embedded device; According to the firmware information file corresponding to the verified sub-firmware, the corresponding original sub-firmware in the embedded device is updated.

2. The method according to claim 1, characterized in that The step of obtaining key information corresponding to each sub-firmware in the embedded device and integrating the key information into a firmware information file includes: Collecting key information corresponding to each sub-firmware in the embedded device, and storing the collected key information corresponding to the sub-firmware in the created firmware information file; The key information includes the name, length, verification information, storage medium, storage location and storage method corresponding to the sub-firmware.

3. The method according to claim 1, characterized in that The step of integrating the information of the system firmware file into an electronic label file, and merging the electronic label file into the system firmware file, comprises: Generate the electronic label file using the information of the system firmware file, and merge the electronic label file into the head or tail of the system firmware file; The information of the system firmware file includes file length, verification information, name of the embedded device and firmware version number.

4. The method according to claim 1, characterized in that: The detecting the embedded device to determine whether the embedded device meets the upgrade condition includes: Scanning the hardware configuration of the embedded device to detect whether the hardware configuration meets the requirements; Checking the operating system version running on the embedded device to confirm whether the operating system version is compatible; Checking installed applications on the embedded device to determine whether there are conflicting applications; The system operating state of the embedded device is checked to determine whether the system operating state meets the upgrade condition.

5. The method according to claim 1, characterized in that The method of using the electronic tag file to verify the system firmware file downloaded to the embedded device and verifying each sub-firmware in the system firmware file downloaded to the embedded device includes: Verifying the system firmware file downloaded to the embedded device according to the verification information in the electronic tag file to confirm the correctness and legality of the system firmware file; When the system firmware file is verified, the system firmware file is unpacked to extract the sub-firmware and firmware information files in the system firmware file; The extracted sub-firmware is verified according to the verification information in the firmware information file to confirm the correctness and legality of the sub-firmware.

6. The method according to claim 1, characterized in that The updating of the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the verified sub-firmware includes: Read the firmware information file to obtain the storage medium, storage location and storage method corresponding to the verified sub-firmware; Compare the verified sub-firmware with the corresponding original sub-firmware in the embedded device to determine the changed data portion; According to the storage medium, storage location and storage method corresponding to the verified sub-firmware, the changed data part in the original sub-firmware is updated.

7. The method according to claim 1, characterized in that After the corresponding original sub-firmware in the embedded device is updated, the method further includes: The embedded device is restarted to make the updated sub-firmware take effect at the next startup. A preset self-test program is executed during the startup process of the embedded device to detect the function of the updated sub-firmware.

8. A firmware upgrade device for an embedded device, characterized in that: include: An acquisition module is configured to acquire key information corresponding to each sub-firmware in the embedded device, and integrate the key information into a firmware information file; A packaging module, configured to package the sub-firmware and the firmware information file into a system firmware file; an integration module, configured to integrate the information of the system firmware file into an electronic label file, and merge the electronic label file into the system firmware file; A detection module is configured to detect the embedded device and determine whether the embedded device meets the upgrade conditions; A download module, configured to download the system firmware file to the embedded device when the embedded device meets the upgrade condition; A verification module, configured to verify the system firmware file downloaded to the embedded device using the electronic label file, and to verify each sub-firmware in the system firmware file downloaded to the embedded device; The update module is configured to update the corresponding original sub-firmware in the embedded device according to the firmware information file corresponding to the verified sub-firmware.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.