Multi-mode software upgrade method and system for embedded system

By adopting the multi-mode software upgrade method in the embedded system, regularly comparing version information, preprocessing upgrade packages, real-time monitoring of download processes, and adjusting download methods according to scores, the problem of poor stability of traditional upgrade methods is solved, and a more efficient and reliable upgrade process is achieved.

CN119759394APending Publication Date: 2025-04-04SHENZHEN JOVISION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510260798.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The software upgrade method of traditional embedded systems has problems such as poor stability, low upgrade efficiency and reliability, especially when network conditions are complex or equipment is widely distributed.

Method used

A multi-mode software upgrade method is proposed. By regularly collecting the version information of firmware and application software, comparing it with the server, and determining whether it is necessary to upgrade. Then, preprocess the upgrade package, monitor the download process in real time, judge whether to adjust the download method based on the comprehensive score, and perform download exception warning and rollback if necessary.

Benefits of technology

Through multi-link optimization, the reliability and efficiency of upgrades are improved, the stability of the embedded system during the upgrade process is ensured, the downtime caused by download failure is reduced, and the system's independent upgrade capabilities and user experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759394A_ABST
    Figure CN119759394A_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of software update, and discloses a multi-mode software upgrade method and system for an embedded system, the method comprising: regularly collecting firmware version information and application software version information, judging whether to upgrade the firmware and / or application software; pre-processing the upgrade package of the latest version corresponding to the firmware and / or application software, downloading it to the embedded system, and monitoring the download process in real time, and comprehensively scoring the download process according to the download process parameters and the upgrade package parameters; comprehensively scoring the download process corresponding to each adjusted download method, and judging whether to perform a download abnormality warning according to each comprehensive score; if it is judged that a download abnormality warning is needed, uploading the warning information to a server; if it is judged that no warning is needed, verifying the integrity of the downloaded upgrade package, and judging whether the upgrade package needs to be re-downloaded. The present invention realizes the stability of embedded system software upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software updating, and in particular to a multi-mode software upgrading method and system for an embedded system. Background Art

[0002] With the widespread application of embedded systems in industrial control, smart home, automotive electronics and other fields, the continuous expansion and complexity of their functions have put forward higher requirements for system upgrade management.

[0003] Traditional embedded system software upgrade methods usually adopt a single mode, such as manual upgrades through physical media (USB) or simple OTA (Over-The-Air) upgrades. These methods have the following problems: First, a single mode cannot flexibly adapt to the upgrade requirements in different scenarios, especially when the network conditions are complex or the devices are widely distributed, the upgrade efficiency and reliability are low; second, the lack of real-time monitoring and dynamic adjustment of the upgrade process can easily lead to system failures due to network fluctuations, download failures or damage to the upgrade package; in addition, traditional methods usually lack intelligent exception handling mechanisms. Once the upgrade fails, manual intervention may be required, increasing maintenance costs and the risk of system downtime.

[0004] Therefore, it is necessary to provide a multi-mode software upgrade method and system for an embedded system to solve the problem of poor stability of traditional embedded system software upgrade. Summary of the invention

[0005] In view of this, the present invention proposes a multi-mode software upgrade method and system for an embedded system, aiming to solve the problem of poor stability of software upgrade in traditional embedded systems.

[0006] The present invention proposes a multi-mode software upgrade method for an embedded system, comprising: Regularly collect firmware version information and application software version information, and compare them with the latest firmware version information and latest software version information provided by the server to determine whether to upgrade the firmware and / or application software; If it is determined that the firmware and / or application software needs to be upgraded, preprocess the upgrade package of the latest version corresponding to the firmware and / or application software, download the preprocessed upgrade package to the embedded system, monitor the download process in real time, and comprehensively score the download process according to the download process parameters and the upgrade package parameters; Determine whether to adjust the download method according to the comprehensive score, and if it is determined to be adjusted, comprehensively score the download process corresponding to each adjusted download method, and determine whether to issue a download abnormality warning according to each comprehensive score; If it is determined that a download abnormality warning is required, the warning information will be uploaded to the server and the firmware and / or application software will be rolled back to the previous version; if it is determined that no warning is required, the integrity of the downloaded upgrade package will be verified to determine whether the upgrade package needs to be re-downloaded.

[0007] Further, the periodic collection of firmware version information and application software version information, and the comparison with the latest firmware version information and the latest software version information provided by the server, respectively, to determine whether to upgrade the firmware and / or application software, include: If the latest firmware version information is higher than the current firmware version information, it is determined that the current firmware version needs to be upgraded, otherwise, the firmware does not need to be upgraded; If the latest application software version information is higher than the current application software version information, it is determined that the current application software needs to be upgraded; otherwise, the application software does not need to be upgraded.

[0008] Further, if it is determined that the firmware and / or application software needs to be upgraded, preprocessing the upgrade package of the latest version corresponding to the firmware and / or application software includes: Calculate a first hash value of the upgrade package using a hash algorithm; Generate a pair of public and private keys, the private key is used to encrypt the content of the upgrade package and the first hash value to generate a digital signature, and the public key is used to verify the legitimacy of the digital signature after the upgrade package is downloaded; The first hash value and digital signature are attached to the upgrade package or stored separately as a description file.

[0009] Further, the pre-processed upgrade package is downloaded to the embedded system, and the download process is monitored in real time, and the download process is comprehensively scored according to the download process parameters and the upgrade package parameters, including: The download process parameters include: whether the download is completed, the total download time, the total download interruption time and the number of download interruptions; The upgrade package parameter is the upgrade package volume.

[0010] Further, the pre-processed upgrade package is downloaded to the embedded system, and the download process is monitored in real time, and the download process is comprehensively scored according to the download process parameters and the upgrade package parameters, and further includes: If the download is not completed, the overall score is zero; If the download is complete, the comprehensive score is greater than zero, and is calculated based on the total download time, total download interruption time, number of download interruptions, and upgrade package size: Si=(1-Ti / Tt)*(V / Tt)*[1 / (1+Ni)]; In the above formula, Si represents the comprehensive score, Ti represents the total duration of download interruption, Tt represents the total download time, V represents the size of the upgrade package, and Ni represents the number of download interruptions.

[0011] Furthermore, the downloading method includes: File upgrade: The upgrade package is transferred to the device via USB, and the device automatically triggers the upgrade process after detecting the upgrade package; OTA upgrade: Download the latest upgrade package through wireless network for upgrade; URL upgrade: Enter the URL address of the upgrade package through the interface, and the device will automatically download the upgrade package from the URL address and upgrade.

[0012] Furthermore, judging whether to adjust the download method according to the comprehensive score includes: If the comprehensive score is zero, it is determined that the download method needs to be adjusted; If the comprehensive score is greater than zero, it is determined that there is no need to adjust the download method.

[0013] Furthermore, if it is determined to be an adjustment, a comprehensive score is given to the download process corresponding to each download method after the adjustment, and when judging whether to issue a download abnormality warning according to each comprehensive score, it includes: If the comprehensive scores corresponding to each download method are all zero, it is determined that no download abnormality warning is issued, and the warning information is uploaded to the server, and the firmware and / or application software is rolled back to the previous version; If the comprehensive score corresponding to a download method is not zero, no download abnormality warning will be issued.

[0014] Furthermore, if it is determined that no warning is issued, the integrity of the downloaded upgrade package is verified, and it is determined whether the upgrade package needs to be re-downloaded, including: After receiving the upgrade package, the device end recalculates the second hash value of the upgrade package content, uses the public key to decrypt the digital signature to obtain the first hash value, and compares the second hash value with the first hash value; If the second hash value is equal to the first hash value, it is determined that the upgrade package does not need to be re-downloaded and the upgrade package is started; otherwise, it is determined that the upgrade package needs to be re-downloaded.

[0015] Compared with the prior art, the invention has the beneficial effect that the invention improves the reliability and efficiency of the upgrade through multi-link optimization. Regularly collecting and comparing the version information of the firmware and application software can timely discover the parts of the system that need to be upgraded, avoiding functional defects or safety hazards that may be caused by the long-term operation of the embedded system in the old version. By preprocessing the upgrade package and real-time monitoring of the download process, combined with the comprehensive scoring mechanism to dynamically evaluate the download quality, it can effectively identify the impact of factors such as network fluctuations and device performance on the download of the upgrade package, and adjust the download method according to the score, thereby improving the download efficiency and stability. In addition, the abnormal warning helps to timely discover and locate problems, reduce the downtime caused by download failure, and provide data support for remote operation and maintenance by uploading warning information. The rollback mechanism ensures that the embedded system can be restored to the stable previous version when the upgrade fails, avoiding the unavailability or functional damage of the embedded system due to upgrade errors. Finally, by verifying the integrity of the download package and re-downloading when necessary, the security and reliability of the upgrade data are guaranteed, and the risk in the upgrade process is further reduced. This method not only enhances the autonomous upgrade capability of the embedded system, but also improves the security, stability and user experience of the embedded system operation. In addition, by classifying and processing the upgrades of firmware and application software, the stability of the embedded system during the upgrade process is ensured, avoiding the crash of the embedded system caused by improper upgrades.

[0016] On the other hand, the present application also provides a multi-mode software upgrade system for an embedded system, comprising: The acquisition module is configured to regularly acquire firmware version information and application software version information, and compare them with the latest firmware version information and the latest software version information provided by the server, respectively, to determine whether to upgrade the firmware and / or application software; The download scoring module is configured to pre-process the upgrade package of the latest version corresponding to the firmware and / or application software if it is determined that the firmware and / or application software needs to be upgraded, download the pre-processed upgrade package to the embedded system, monitor the download process in real time, and comprehensively score the download process according to the download process parameters and the upgrade package parameters; An early warning judgment module is configured to judge whether to adjust the download method according to the comprehensive score, and if it is judged to be adjusted, comprehensively score the download process corresponding to each adjusted download method, and judge whether to issue a download abnormality early warning according to each comprehensive score; The verification module is configured to upload the warning information to the server and roll back the firmware and / or application software to the previous version if it is determined that a download abnormality warning is needed; if it is determined that no warning is needed, verify the integrity of the downloaded upgrade package and determine whether the upgrade package needs to be re-downloaded.

[0017] It is understandable that the multi-mode software upgrade method and system of the embedded system provided in the present application have the same beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 A flowchart of a multi-mode software upgrade method for an embedded system provided by an embodiment of the present invention; Figure 2 A functional block diagram of a multi-mode software upgrade system for an embedded system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to be able to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features described in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0020] In some embodiments of the present application, see Figure 1 As shown, this embodiment provides a multi-mode software upgrade method for an embedded system, comprising the following steps: S100, regularly collect firmware version information and application software version information, and compare them with the latest firmware version information and the latest software version information provided by the server to determine whether to upgrade the firmware and / or application software; S200: if it is determined that the firmware and / or application software needs to be upgraded, preprocess the upgrade package of the latest version corresponding to the firmware and / or application software, download the preprocessed upgrade package to the embedded system, monitor the download process in real time, and comprehensively score the download process according to the download process parameters and the upgrade package parameters; S300, judging whether to adjust the download method according to the comprehensive score, and if it is judged to be adjusted, comprehensively scoring the download process corresponding to each download method after the adjustment, and judging whether to issue a download abnormality warning according to each comprehensive score; S400. If it is determined that a download abnormality warning is required, the warning information is uploaded to the server and the firmware and / or application software is rolled back to the previous version; if it is determined that no warning is required, the integrity of the downloaded upgrade package is verified to determine whether the upgrade package needs to be re-downloaded.

[0021] It is understandable that the present invention improves the reliability and efficiency of the upgrade through multi-link optimization. Regularly collecting and comparing the version information of the firmware and application software can timely discover the parts of the system that need to be upgraded, avoiding functional defects or safety hazards that may be caused by the long-term operation of the embedded system in the old version. Through the real-time monitoring of the preprocessing and downloading process of the upgrade package, combined with the comprehensive scoring mechanism to dynamically evaluate the download quality, it can effectively identify the impact of factors such as network fluctuations and device performance on the download of the upgrade package, and adjust the download method according to the score, thereby improving the download efficiency and stability. In addition, the abnormal warning helps to timely discover and locate problems, reduce the downtime caused by download failure, and provide data support for remote operation and maintenance by uploading warning information. The rollback mechanism ensures that the embedded system can be restored to a stable previous version when the upgrade fails, avoiding the unavailability or functional damage of the embedded system due to upgrade errors. Finally, by verifying the integrity of the download package and re-downloading when necessary, the security and reliability of the upgrade data are guaranteed, and the risk in the upgrade process is further reduced. This method not only enhances the autonomous upgrade capability of the embedded system, but also improves the security, stability and user experience of the embedded system operation. In addition, by classifying and processing the upgrades of firmware and application software, the stability of the embedded system during the upgrade process is ensured, avoiding the crash of the embedded system caused by improper upgrades.

[0022] In some embodiments of the present application, firmware version information and application software version information are regularly collected and compared with the latest firmware version information and the latest software version information provided by the server, respectively, to determine whether to upgrade the firmware and / or application software, including: If the latest firmware version information is higher than the current firmware version information, it is determined that the current firmware version needs to be upgraded, otherwise, the firmware does not need to be upgraded; If the latest application software version information is higher than the current application software version information, it is determined that the current application software needs to be upgraded; otherwise, the application software does not need to be upgraded.

[0023] It is understandable that by regularly collecting the version information of the firmware and application software and comparing it with the latest version information provided by the server, an automated and accurate upgrade judgment can be achieved. If it is found that the firmware or application software version is outdated, the upgrade is triggered only when necessary, avoiding meaningless repetitive operations and improving the resource utilization and operating efficiency of the embedded system. At the same time, this method can timely identify potential safety hazards or performance bottlenecks of the embedded system, and ensure that the device always runs in the best state through upgrades. In addition, the present invention also simplifies the upgrade decision-making process, reduces manual intervention, and improves the automation and intelligence level of the upgrade, thereby enhancing the reliability of the system and user experience.

[0024] In some embodiments of the present application, if it is determined that the firmware and / or application software needs to be upgraded, preprocessing the upgrade package of the latest version corresponding to the firmware and / or application software includes: Calculate the first hash value of the upgrade package using a hash algorithm; Generate a pair of public and private keys, the private key is used to encrypt the content of the upgrade package and the first hash value to generate a digital signature, and the public key is used to verify the legitimacy of the digital signature after the upgrade package is downloaded; The first hash value and the digital signature are attached to the upgrade package or stored separately as a description file.

[0025] It is understandable that by using a hash algorithm to calculate a hash value and generate a digital signature in the preprocessing of the upgrade package, the integrity and legitimacy of the upgrade package during transmission and use can be effectively ensured. The calculation of the hash value can quickly detect whether the upgrade package has been tampered with to ensure data consistency; and the digital signature further verifies the source credibility of the upgrade package through encryption technology to prevent malicious attacks or forged upgrade packages. Attaching the first hash value and digital signature to the upgrade package or storing them separately as a description file not only facilitates the verification of the upgrade package, but also enhances the embedded system's resistance to security risks, provides multiple security guarantees for the upgrade process of the embedded system, and effectively improves the reliability of the upgrade and the security of data transmission.

[0026] In some embodiments of the present application, the preprocessed upgrade package is downloaded to the embedded system, and the download process is monitored in real time. When the download process is comprehensively scored according to the download process parameters and the upgrade package parameters, it includes: Download process parameters include: whether the download is complete, total download time, total download interruption time and number of download interruptions; The upgrade package parameter is the upgrade package size.

[0027] In some embodiments of the present application, the preprocessed upgrade package is downloaded to the embedded system, and the download process is monitored in real time. When the download process is comprehensively scored according to the download process parameters and the upgrade package parameters, the following is also included: If the download is not completed, the overall score is zero; If the download is complete, the comprehensive score is greater than zero. The comprehensive score is calculated based on the total download time, total download interruption time, number of download interruptions, and upgrade package size: Si=(1-Ti / Tt)*(V / Tt)*[1 / (1+Ni)]; In the above formula, Si represents the comprehensive score, Ti represents the total duration of download interruption, Tt represents the total download time, V represents the size of the upgrade package, and Ni represents the number of download interruptions.

[0028] It is understandable that by real-time monitoring of the upgrade package download process and calculating the comprehensive score, the efficiency and stability of the download can be comprehensively evaluated. The comprehensive scoring model of the download process parameters combined with the upgrade package volume can not only quantify the download quality, but also identify potential problems. If the download is not completed, the score is directly zero, which clearly indicates the abnormal situation and avoids erroneous data processing; and for the completed download, the comprehensive score is calculated to accurately reflect the network stability, transmission efficiency and interruption impact. The scoring mechanism provides a basis for optimizing the download method, which is convenient for dynamically adjusting the download method and improving the overall upgrade efficiency. At the same time, the score can also serve as the basic data for abnormal warning and performance evaluation, ensuring the reliability of the download and the success rate of the upgrade, thereby improving the security and stability of the operation of the embedded system. Preferably, after the comprehensive score evaluation is completed, the download process parameters, the upgrade package volume and the comprehensive score are uploaded to the upgrade log.

[0029] In some embodiments of the present application, the downloading method includes: File upgrade: Transfer the upgrade package to the device via USB. The device will automatically trigger the upgrade process after detecting the upgrade package. OTA upgrade: Download the latest upgrade package through wireless network for upgrade; URL upgrade: Enter the URL address of the upgrade package through the interface, and the device will automatically download the upgrade package from the URL address and perform the upgrade.

[0030] It can be understood that in some embodiments of the present application, by supporting multiple download methods (file upgrade, OTA upgrade and URL upgrade), the flexibility and adaptability of the system are significantly improved. File upgrades are transmitted locally via USB, which is suitable for scenarios with unstable networks or no network environment; OTA upgrades (Over-The-Air) achieve remote automatic upgrades through wireless networks, reducing manual operations and suitable for maintenance of large-scale distributed devices; URL upgrades (Uniform Resource Locator) allow users to directly download upgrade packages from a remote server by entering a link address, providing flexibility and convenience. Multiple upgrade methods can meet the needs of different scenarios, ensuring that the device can be successfully upgraded in various network environments, improving the efficiency of embedded system operation and user experience, while also reducing maintenance costs and operational complexity.

[0031] In some embodiments of the present application, judging whether to adjust the download method according to the comprehensive score includes: If the overall score is zero, it is determined that the download method needs to be adjusted; If the comprehensive score is greater than zero, it is determined that there is no need to adjust the download method.

[0032] In some embodiments of the present application, if it is determined to be an adjustment, a comprehensive score is given to the download process corresponding to each download method after the adjustment, and when judging whether to issue a download abnormality warning according to each comprehensive score, it includes: If the comprehensive scores corresponding to each download method are all zero, it is determined that no download abnormality warning is issued, and the warning information is uploaded to the server, and the firmware and / or application software is rolled back to the previous version; If the comprehensive score corresponding to a download method is not zero, no download abnormality warning will be issued.

[0033] It can be understood that by dynamically adjusting the download method based on the comprehensive score and judging whether to trigger the download abnormality warning, the upgrade efficiency and reliability of the embedded system are effectively improved. When the comprehensive score is zero, the problems with the current download method can be quickly identified and switched to the alternative solution to ensure that the upgrade task is not disturbed; when the comprehensive score is greater than zero, the current method is maintained to avoid unnecessary switching and save resources. Furthermore, the scores of each download method are compared. If all method scores are zero, the warning information is uploaded in time and rolled back to the previous version to prevent the impact of upgrade failure on system operation; if the comprehensive score of some methods is normal, the warning is not triggered to avoid overreaction. This method reduces unnecessary rollback and warning operations while ensuring the success rate of the upgrade, and enhances the intelligence and stability of the embedded system.

[0034] In some embodiments of the present application, if it is determined that no warning is issued, then verifying the integrity of the downloaded upgrade package and determining whether the upgrade package needs to be re-downloaded includes: After receiving the upgrade package on the device side, recalculate the second hash value of the upgrade package content, use the public key to decrypt the digital signature to obtain the first hash value, and compare the second hash value with the first hash value; If the second hash value is equal to the first hash value, it is determined that there is no need to re-download the upgrade package and the upgrade package is started; otherwise, it is determined that the upgrade package needs to be re-downloaded.

[0035] It can be understood that by verifying the integrity of the downloaded upgrade package on the device side, it can be effectively ensured that the upgrade package has not been tampered with or damaged during the transmission process. Specifically, by recalculating the second hash value of the upgrade package and comparing it with the first hash value after decryption of the digital signature, the data consistency can be accurately verified. When the two hash values ​​are equal, the upgrade package is directly started to avoid unnecessary repeated downloads and improve the upgrade efficiency; if the two are not equal, the re-download is triggered in time to prevent upgrade failures or system abnormalities due to incomplete data. This verification method not only improves the security and reliability of the upgrade process, but also reduces the risk of the system being caused by the operation of erroneous upgrade packages, providing an important guarantee for the stable operation of embedded systems.

[0036] On the other hand, see Figure 2 As shown, the present application also provides a multi-mode software upgrade system for an embedded system, which is used to apply the multi-mode software upgrade method for the embedded system, including: The acquisition module is configured to regularly acquire firmware version information and application software version information, and compare them with the latest firmware version information and the latest software version information provided by the server, respectively, to determine whether to upgrade the firmware and / or application software; The download scoring module is configured to pre-process the upgrade package of the latest version of the firmware and / or application software if it is determined that the firmware and / or application software needs to be upgraded, download the pre-processed upgrade package to the embedded system, monitor the download process in real time, and comprehensively score the download process according to the download process parameters and the upgrade package parameters; The early warning judgment module is configured to judge whether to adjust the download method according to the comprehensive score. If it is judged to be adjusted, the download process corresponding to each adjusted download method is comprehensively scored, and whether to issue a download abnormality early warning according to each comprehensive score; The verification module is configured to upload the warning information to the server and roll back the firmware and / or application software to the previous version if it is determined that a download abnormality warning is needed; if it is determined that no warning is needed, verify the integrity of the downloaded upgrade package and determine whether the upgrade package needs to be re-downloaded.

[0037] It can be understood that the embedded system multi-mode software upgrade system provided by the present invention realizes the intelligent, refined and efficient upgrade of the embedded system through the collaborative work of the acquisition module, the download scoring module, the early warning judgment module and the verification module. The acquisition module can regularly monitor and compare the firmware and application software version information to ensure that the upgrade requirements are discovered in time; the download scoring module monitors the download process in real time and comprehensively scores, optimizes the selection of download methods, and improves resource utilization and upgrade efficiency; the early warning judgment module determines whether it is necessary to adjust the download method or trigger an abnormal warning based on the scoring results, and can quickly respond to download anomalies to prevent the negative impact of upgrade failures on the system; the verification module ensures the integrity of the download package, and further improves the reliability and security of the upgrade by rolling back and re-downloading when necessary. This systematic and modular design not only reduces the need for manual intervention, but also significantly enhances the adaptability of the embedded system in multiple scenarios, providing strong support for the stable operation of the system and user experience.

[0038] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0039] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0040] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0041] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0042] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A multi-mode software upgrade method for an embedded system, characterized in that: include: Regularly collect firmware version information and application software version information, and compare them with the latest firmware version information and latest software version information provided by the server to determine whether to upgrade the firmware and / or application software; If it is determined that the firmware and / or application software needs to be upgraded, preprocess the upgrade package of the latest version corresponding to the firmware and / or application software, download the preprocessed upgrade package to the embedded system, monitor the download process in real time, and comprehensively score the download process according to the download process parameters and the upgrade package parameters; Determine whether to adjust the download method according to the comprehensive score, and if it is determined to be adjusted, comprehensively score the download process corresponding to each adjusted download method, and determine whether to issue a download abnormality warning according to each comprehensive score; If it is determined that a download abnormality warning is required, the warning information is uploaded to the server and the firmware and / or application software is rolled back to the previous version; If it is determined that no warning is issued, the integrity of the downloaded upgrade package is verified to determine whether the upgrade package needs to be re-downloaded.

2. The multi-mode software upgrade method for an embedded system according to claim 1, characterized in that: The periodic collection of firmware version information and application software version information, and the comparison with the latest firmware version information and the latest software version information provided by the server, respectively, to determine whether to upgrade the firmware and / or application software include: If the latest firmware version information is higher than the current firmware version information, it is determined that the current firmware version needs to be upgraded, otherwise, the firmware does not need to be upgraded; If the latest application software version information is higher than the current application software version information, it is determined that the current application software needs to be upgraded; otherwise, the application software does not need to be upgraded.

3. The multi-mode software upgrade method for an embedded system according to claim 2, characterized in that: If it is determined that the firmware and / or application software needs to be upgraded, preprocessing the upgrade package of the latest version corresponding to the firmware and / or application software includes: Calculate a first hash value of the upgrade package using a hash algorithm; Generate a pair of public and private keys, the private key is used to encrypt the content of the upgrade package and the first hash value to generate a digital signature, and the public key is used to verify the legitimacy of the digital signature after the upgrade package is downloaded; The first hash value and digital signature are attached to the upgrade package or stored separately as a description file.

4. The multi-mode software upgrade method for an embedded system according to claim 3, characterized in that: The method of downloading the pre-processed upgrade package to the embedded system, monitoring the download process in real time, and comprehensively scoring the download process according to the download process parameters and the upgrade package parameters includes: The download process parameters include: whether the download is completed, the total download time, the total download interruption time and the number of download interruptions; The upgrade package parameter is the upgrade package volume.

5. The multi-mode software upgrade method for an embedded system according to claim 4, characterized in that: The method of downloading the pre-processed upgrade package to the embedded system, monitoring the download process in real time, and comprehensively scoring the download process according to the download process parameters and the upgrade package parameters also includes: If the download is not completed, the overall score is zero; If the download is complete, the comprehensive score is greater than zero, and is calculated based on the total download time, total download interruption time, number of download interruptions, and upgrade package size: Si=(1-Ti / Tt)*(V / Tt)*[1 / (1+Ni)]; In the above formula, Si represents the comprehensive score, Ti represents the total duration of download interruption, Tt represents the total download time, V represents the size of the upgrade package, and Ni represents the number of download interruptions.

6. The multi-mode software upgrade method for an embedded system according to claim 5, characterized in that: The downloading method comprises: File upgrade: The upgrade package is transferred to the device via USB, and the device automatically triggers the upgrade process after detecting the upgrade package; OTA upgrade: Download the latest upgrade package through wireless network for upgrade; URL upgrade: Enter the URL address of the upgrade package through the interface, and the device will automatically download the upgrade package from the URL address and upgrade.

7. The multi-mode software upgrade method for an embedded system according to claim 6, characterized in that: The step of determining whether to adjust the download method according to the comprehensive score includes: If the comprehensive score is zero, it is determined that the download method needs to be adjusted; If the comprehensive score is greater than zero, it is determined that there is no need to adjust the download method.

8. The multi-mode software upgrade method for an embedded system according to claim 7, characterized in that: If it is determined to be an adjustment, a comprehensive score is given to the download process corresponding to each download method after the adjustment, and whether to issue a download abnormality warning is determined according to each comprehensive score, including: If the comprehensive scores corresponding to each download method are all zero, it is determined that no download abnormality warning is issued, and the warning information is uploaded to the server, and the firmware and / or application software is rolled back to the previous version; If the comprehensive score corresponding to a download method is not zero, no download abnormality warning will be issued.

9. The multi-mode software upgrade method for an embedded system according to claim 8, characterized in that: If it is determined that no warning is issued, then verifying the integrity of the downloaded upgrade package and determining whether the upgrade package needs to be re-downloaded includes: After receiving the upgrade package, the device end recalculates the second hash value of the upgrade package content, uses the public key to decrypt the digital signature to obtain the first hash value, and compares the second hash value with the first hash value; If the second hash value is equal to the first hash value, it is determined that the upgrade package does not need to be re-downloaded and the upgrade package is started; otherwise, it is determined that the upgrade package needs to be re-downloaded.

10. A multi-mode software upgrade system for an embedded system, used for applying the multi-mode software upgrade method for an embedded system as claimed in any one of claims 1 to 9, characterized in that: include: The acquisition module is configured to regularly acquire firmware version information and application software version information, and compare them with the latest firmware version information and the latest software version information provided by the server, respectively, to determine whether to upgrade the firmware and / or application software; The download scoring module is configured to pre-process the upgrade package of the latest version corresponding to the firmware and / or application software if it is determined that the firmware and / or application software needs to be upgraded, download the pre-processed upgrade package to the embedded system, monitor the download process in real time, and comprehensively score the download process according to the download process parameters and the upgrade package parameters; An early warning judgment module is configured to judge whether to adjust the download method according to the comprehensive score, and if it is judged to be adjusted, comprehensively score the download process corresponding to each adjusted download method, and judge whether to issue a download abnormality early warning according to each comprehensive score; The verification module is configured to upload the warning information to the server and roll back the firmware and / or application software to the previous version if it is determined that a download abnormality warning is required; If it is determined that no warning is issued, the integrity of the downloaded upgrade package is verified to determine whether the upgrade package needs to be re-downloaded.

Citation Information

Patent Citations

  • Vehicle-mounted gateway security authentication method and device based on embedded Linux system

    CN116489649A

  • Key device on-line upgrading supervision system and method based on Internet of Things

    CN119336379A

  • Upgrade package downloading control method and device, computer equipment and storage medium

    CN119496795A

  • Vehicle upgrade packet processing method and apparatus

    EP4050474A1