Remote upgrading method and device for firmware program and computer equipment

By identifying the target running program area and remotely upgrading the firmware program based on the remote update strategy, the problems of interference and low efficiency during the remote upgrade process are solved, and stable and reliable upgrade process and efficient storage utilization are achieved.

CN119557145AInactive Publication Date: 2025-03-04BEIJING TASSON SCI & TECH CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202510113085.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the remote upgrade of firmware programs, it is easy to be disturbed by environmental interference, and the upgrade failure or data is missing. The traditional method is inefficient and has too much storage space, so it is impossible to effectively restore the original version of the program.

Method used

By obtaining the remote upgrade status and running program area identification, the target running program area is identified, and the firmware program is remotely upgraded based on the remote update execution policy. If the upgrade is abnormal, return the original program information; re-collect the upgrade status and identification until the upgrade is normal to ensure the stability and reliability of the upgrade process.

Benefits of technology

It improves the anti-interference ability and stability of remote upgrades, ensures the update success rate and accuracy of firmware programs, reduces storage space usage, and avoids inefficient original version program fallback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557145A_ABST
    Figure CN119557145A_ABST
Patent Text Reader

Abstract

The invention relates to a remote upgrading method and device for a firmware program and computer equipment. The method comprises the following steps: acquiring a remote upgrading state and a running program area identifier, and identifying a target running program area corresponding to the running program area identifier; based on the remote upgrading state and the target running program area, remote upgrading processing is carried out on the original program information of the firmware program through a remote updating execution strategy, a remote upgrading processing result of the firmware program is obtained, and under the condition that the remote updating processing result of the firmware program is updating abnormity, the original program information of the firmware program is returned; recollecting a new remote upgrade state and a new running program identifier, and reupgrading the original program information of the firmware program based on the new remote upgrade state and the new running program identifier until the remote update processing result of the firmware program is that the update is normal, and obtaining an updated new firmware program. By adopting the method, the efficiency of remotely upgrading the firmware program can be 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 remote firmware upgrade, and in particular to a method, device and computer equipment for remote firmware upgrade. Background Art

[0002] Firmware upgrades can optimize device performance, increase operating speed, reduce energy consumption, and enhance user experience. When upgrading firmware remotely, the limitations and geographical restrictions of firmware upgrades can be avoided. Therefore, remote firmware upgrades are one of the main ways to improve the efficiency of firmware upgrades. However, when upgrading firmware remotely, it is easily affected by environmental interference, resulting in the risk of remote upgrade failure or remote upgrade data loss. Therefore, how to improve the anti-interference, stability, and reliability of remote upgrades is the current research focus.

[0003] The traditional remote upgrade method is to divide the on-chip flash area of ​​the microcontroller into a boot program area (i.e., BootLoader), a running program area, a temporary storage area for upgrading firmware, an upgrade information storage area, and a user data area. When the microcontroller is powered on, the content of the upgrade information storage area is read from the boot program area. If it is known that the current device is in the non-upgrade stage, the program is jumped to the running program area, the application function is executed, and the upgrade data packet sent by the remote upgrade device is received in real time, and it is written into the temporary storage area for upgrading firmware. When the firmware program to be upgraded is received, the microcontroller is restarted, so that the microcontroller enters the boot program area again, and it is known that the current device is in the upgrade stage, the firmware program to be upgraded in the temporary storage area for upgrading firmware is read and stored in the running program area, so as to run the upgrade. However, this method involves too many transfers, and the original version of the program cannot be returned after the upgrade fails. In addition, the upgrade time is long and the storage program space is overused, which leads to low efficiency of remote firmware upgrade. Summary of the invention

[0004] Based on this, it is necessary to provide a remote upgrade method, device, computer equipment, computer-readable storage medium and computer program product for firmware programs in order to solve the above technical problems.

[0005] In a first aspect, the present application provides a remote upgrade method for a firmware program, comprising:

[0006] Acquire the remote upgrade status and the running program area identifier, and identify the target running program area corresponding to the running program area identifier;

[0007] Based on the remote upgrade state and the target running program area, the original program information of the firmware program is remotely upgraded through a remote update execution strategy to obtain a remote upgrade processing result of the firmware program, and when the remote update processing result of the firmware program is an update abnormality, the original program information of the firmware program is returned;

[0008] The new remote upgrade status and the new running program identifier are recollected, and based on the new remote upgrade status and the new running program identifier, the original program information of the firmware program is re-upgraded until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program.

[0009] Optionally, the identifying a target running program area corresponding to the running program area identifier includes:

[0010] In the database, query the target sub-operation program area corresponding to the operation program area identifier;

[0011] By using the operation program adjustment strategy of the target sub-operation program area, operation adjustment processing is performed on each sub-operation program area to obtain the target operation program area.

[0012] Optionally, based on the remote upgrade state and the target running program area, performing remote upgrade processing on original program information of the firmware program through a remote update execution strategy to obtain a remote upgrade processing result of the firmware program includes:

[0013] Based on the remote upgrade status, identifying current update information of the firmware program and current restart information of the firmware program;

[0014] Based on the current update information of the firmware program and the current restart information of the firmware program, the remote update execution policy of the firmware program is queried, and based on the remote update execution policy of the firmware program, the original program information of the firmware program is remotely upgraded to obtain the remote upgrade processing result of the firmware program.

[0015] Optionally, the remote update execution strategy based on the firmware program, performing remote upgrade processing on original program information of the firmware program to obtain a remote upgrade processing result of the firmware program includes:

[0016] Through the startup program area, remote program information of the firmware program is remotely upgraded according to the remote execution strategy of the firmware program to obtain a new firmware program, and the running program identifier and the remote upgrade status are updated through the startup program area to obtain a first running program identifier and a first remote upgrade status;

[0017] The new firmware program is subjected to a program self-check process to obtain a self-check process result of the new firmware program, and the self-check process result of the new firmware program is used as a remote upgrade process result of the firmware program.

[0018] Optionally, the re-collecting of the new remote upgrade status and the new running program identifier includes:

[0019] Based on the remote upgrade processing result, updating the first remote upgrade state to obtain a new remote upgrade state;

[0020] Based on the running program identifier and the first running program identifier, a new running program identifier is generated through a program identifier return policy.

[0021] Optionally, the re-upgrading of the original program information of the firmware program based on the new remote upgrade state and the new running program identifier until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program, includes:

[0022] Based on the new running program identifier, adjusting the running strategy of the target running program area to obtain a new target running program area, and based on the new remote upgrade state, identifying the upgrade and restart result of the firmware program;

[0023] Based on the upgrade and restart strategy corresponding to the upgrade and restart result, the original program information of the firmware program is re-upgraded to obtain a new remote upgrade processing result of the firmware program, and the new remote upgrade processing result replaces the remote upgrade processing result, and the process returns to the step of returning to the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality, until the remote update processing result is a normal update, thereby obtaining an updated new firmware program.

[0024] In a second aspect, the present application also provides a remote upgrade device for a firmware program, comprising:

[0025] An acquisition module, used to acquire the remote upgrade status and the running program area identifier, and identify the target running program area corresponding to the running program area identifier;

[0026] A return module, configured to perform remote upgrade processing on the original program information of the firmware program based on the remote upgrade state and the target running program area through a remote update execution strategy, obtain a remote upgrade processing result of the firmware program, and return the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality;

[0027] The iteration module is used to re-collect the new remote upgrade status and the new running program identifier, and based on the new remote upgrade status and the new running program identifier, re-upgrade the original program information of the firmware program until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program.

[0028] Optionally, the acquisition module is specifically used to:

[0029] In the database, query the target sub-operation program area corresponding to the operation program area identifier;

[0030] By using the operation program adjustment strategy of the target sub-operation program area, operation adjustment processing is performed on each sub-operation program area to obtain the target operation program area.

[0031] Optionally, the return module is specifically used to:

[0032] Based on the remote upgrade status, identifying current update information of the firmware program and current restart information of the firmware program;

[0033] Based on the current update information of the firmware program and the current restart information of the firmware program, the remote update execution policy of the firmware program is queried, and based on the remote update execution policy of the firmware program, the original program information of the firmware program is remotely upgraded to obtain the remote upgrade processing result of the firmware program.

[0034] Optionally, the return module is specifically used to:

[0035] Through the startup program area, remote program information of the firmware program is remotely upgraded according to the remote execution strategy of the firmware program to obtain a new firmware program, and the running program identifier and the remote upgrade status are updated through the startup program area to obtain a first running program identifier and a first remote upgrade status;

[0036] The new firmware program is subjected to a program self-check process to obtain a self-check process result of the new firmware program, and the self-check process result of the new firmware program is used as a remote upgrade process result of the firmware program.

[0037] Optionally, the iteration module is specifically used for:

[0038] Based on the remote upgrade processing result, updating the first remote upgrade state to obtain a new remote upgrade state;

[0039] Based on the running program identifier and the first running program identifier, a new running program identifier is generated through a program identifier return policy.

[0040] Optionally, the iteration module is specifically used for:

[0041] Based on the new running program identifier, adjusting the running strategy of the target running program area to obtain a new target running program area, and based on the new remote upgrade state, identifying the upgrade and restart result of the firmware program;

[0042] Based on the upgrade and restart strategy corresponding to the upgrade and restart result, the original program information of the firmware program is re-upgraded to obtain a new remote upgrade processing result of the firmware program, and the new remote upgrade processing result replaces the remote upgrade processing result, and the process returns to the step of returning to the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality, until the remote update processing result is a normal update, thereby obtaining an updated new firmware program.

[0043] In a third aspect, the present application provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the first aspect are implemented.

[0044] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0045] In a fifth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.

[0046] The remote upgrade method, device and computer equipment of the above-mentioned firmware program obtain the remote upgrade status and the running program area identifier, and identify the target running program area corresponding to the running program area identifier; based on the remote upgrade status and the target running program area, through the remote update execution strategy, remote upgrade processing is performed on the original program information of the firmware program to obtain the remote upgrade processing result of the firmware program, and when the remote update processing result of the firmware program is an update abnormality, the original program information of the firmware program is returned; the new remote upgrade status and the new running program identifier are re-collected, and based on the new remote upgrade status and the new running program identifier, the original program information of the firmware program is re-upgraded until the remote update processing result of the firmware program is a normal update, and an updated new firmware program is obtained. This solution sets up a remote firmware program update and upgrade confirmation process. First, no matter whether the remote firmware upgrade program succeeds or fails, the previous version of the firmware program can be restored when the startup program does not have the function of transferring the firmware program. Second, no matter whether the remote firmware upgrade program succeeds or fails, when the startup program does not have the remote firmware upgrade function, the single-chip microcomputer device can still be guaranteed to have the remote upgrade function. Then, this solution replies to the original information during repeated updates, thereby occupying less storage program space. It avoids the inefficiency and low upgrade stability of returning to the original version of the program after being disturbed during remote updates. This comprehensively improves the efficiency of remote firmware upgrade programs. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are 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 creative work.

[0048] Figure 1 A flowchart of a remote firmware upgrade method in one embodiment;

[0049] Figure 2 A flowchart of a remote upgrade example of a firmware program in one embodiment;

[0050] Figure 3 A structural block diagram of a remote upgrade device for a firmware program in one embodiment;

[0051] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The remote upgrade method of the firmware program provided in the embodiment of the present application can be applied to the application environment of the remote upgrade of the firmware program. Among them, the method can be applied to the terminal, can also be applied to the server, and can also be applied to the system including the terminal and the server, and is realized through the interaction between the terminal and the server. Among them, the terminal can be, but not limited to, various personal computers, laptops, medium-sized computers, etc. Among them, the terminal sets the remote firmware program update and upgrade determination process. First, whether the remote upgrade firmware program succeeds or fails, when the startup program does not have the function of transporting the firmware program, the previous version of the firmware program can be restored to run; secondly, whether the remote upgrade firmware program succeeds or fails, when the startup program does not have the remote upgrade firmware function, it can still ensure that the single-chip microcomputer device has the remote upgrade function; then, this scheme replies to the original information during repeated updates, so that the storage program space occupied is small; avoids the problem of inefficiency and low upgrade stability of returning to the original version of the program after interference in the remote update. Thereby comprehensively improving the efficiency of the remote upgrade firmware program.

[0054] In an exemplary embodiment, Figure 1 As shown, a remote upgrade method for a firmware program is provided, and the method is applied to a terminal as an example for explanation, including the following steps S101 to S103. Among them:

[0055] Step S101, obtaining the remote upgrade status and the running program area identifier, and identifying the target running program area corresponding to the running program area identifier.

[0056] In this embodiment, the terminal obtains the remote upgrade status of the firmware program and the running program area identifier fed back by the running program area. The remote upgrade status includes but is not limited to an unknown upgrade status, an unupdated and unrestarted status, an updated and unrestarted status, an updated and restarted status, and an updated and restarted failure status: a) The unknown upgrade status refers to a state in which the remote upgrade status is written into the upgrade information storage area due to other reasons such as factory or unexpected power failure when writing Flash; b) The unupdated and unrestarted status executes the application program and does not start the remote upgrade function; c) The updated and unrestarted status refers to the firmware program to be upgraded has been written into the storage upgrade program area, and the single-chip device has not been restarted; d) The updated and restarted status refers to the firmware program to be upgraded has been written into the storage upgrade program area, and the single-chip device restarts to enter the startup program, the startup program jumps to the program area, and executes the upgrade firmware program; e) The updated and restarted failure status refers to the startup program jumps to the storage upgrade program area, and the upgrade firmware program fails to start. The running program area identifier fed back by the running program area includes but is not limited to an unknown identifier, a running program area 1 identifier, and a running program area 2 identifier. Among them, b) running program area 1 and running program area 2 store and execute application programs, and the application programs in these two areas have the remote upgrade function. When the single-chip microcomputer device application is executed in running program area 1, running program area 2 is used as the storage upgrade program area, and the program to be upgraded is stored in running program area 2 during remote upgrade. Conversely, when the single-chip microcomputer device application is executed in running program area 2, running program area 1 is used as the storage upgrade program area, and the program to be upgraded is stored in running program area 1 during remote upgrade. Finally, the terminal determines the target running program area based on the identified running program area identifier. The specific determination process will be described in detail later.

[0057] Step S102, based on the remote upgrade status and the target running program area, the original program information of the firmware program is remotely upgraded through the remote update execution strategy to obtain the remote upgrade processing result of the firmware program, and when the remote update processing result of the firmware program is an update abnormality, the original program information of the firmware program is returned.

[0058] In this embodiment, the terminal performs remote upgrade processing on the original program information of the firmware program based on the remote upgrade status and the target running program area through the remote update execution strategy, obtains the remote upgrade processing result of the firmware program, and returns the original program information of the firmware program when the remote update processing result of the firmware program is an update exception. Among them, the update exception is characterized by two reasons: the firmware program startup exception or the self-test fails. After the firmware program returns the original program information, the terminal switches the current running program area to the previous running program area, and after restoring to the previous version of the program, the remote upgrade status is set to the updated restart failure state. The previous version of the program starts running, and detects that the remote upgrade status is the updated restart failure state, then notifies the remote upgrade device of the upgrade failure, and the entire remote upgrade function is executed.

[0059] Step S103, re-collect the new remote upgrade status and the new running program identifier, and re-upgrade the original program information of the firmware program based on the new remote upgrade status and the new running program identifier, until the remote update processing result of the firmware program is that the update is normal, and obtain the updated new firmware program.

[0060] In this embodiment, the terminal re-collects the new remote upgrade status and the new running program identifier, and re-upgrades the original program information of the firmware program based on the new remote upgrade status and the new running program identifier, until the remote update processing result of the firmware program is that the update is normal, and the updated new firmware program is obtained. The specific iterative process will be described in detail later.

[0061] Based on the above scheme, through the remote firmware program update and upgrade confirmation process, firstly, no matter whether the remote firmware program upgrade is successful or failed, the previous version of the firmware program can be restored when the startup program does not have the function of transferring the firmware program; secondly, no matter whether the remote firmware program upgrade is successful or failed, when the startup program does not have the remote firmware upgrade function, the single-chip microcomputer device can still be guaranteed to have the remote upgrade function; then, this scheme replies to the original information during repeated updates, so that the storage program space occupied is small; avoids the inefficiency and low upgrade stability of returning to the original version of the program after being disturbed by the remote update. Thereby comprehensively improving the efficiency of the remote firmware upgrade program.

[0062] Optionally, identifying the target running program area corresponding to the running program area identifier includes: querying the target sub-running program area corresponding to the running program area identifier in a database; and performing operation adjustment processing on each sub-running program area according to the running program adjustment strategy of the target sub-running program area to obtain the target running program area.

[0063] In this embodiment, the terminal queries the target sub-running program area corresponding to the running program area identifier in the database. For example, the target sub-running program area corresponding to the running program area 1 identifier is running program area 1, and the target sub-running program area corresponding to the running program area 2 identifier is running program area 2. Then, the terminal performs operation adjustment processing on each sub-running program area through the running program adjustment strategy of the target sub-running program area to obtain the target running program area. Specifically, when the running program area identifier is the running program area 1 identifier, the terminal sets the execution application address to the first address of the running program area 1, and the storage upgrade firmware program address to the first address of the running program area 2. When the running program area identifier is the running program area 2 identifier, the terminal sets the execution application address to the first address of the running program area 2, and the storage upgrade firmware program address to the first address of the running program area 1. Finally, the terminal uses the adjusted sub-running program areas as the target running program areas.

[0064] Based on the above scheme, the application is stored and executed through the running program area 1 and the running program area 2, and the application programs in these two areas have the remote upgrade function. When the single-chip device application is executed in the running program area 1, the running program area 2 is used as the storage upgrade program area, and the program to be upgraded is stored in the running program area 2 during remote upgrade. Conversely, when the single-chip device application is executed in the running program area 2, the running program area 1 is used as the storage upgrade program area, and the program to be upgraded is stored in the running program area 1 during remote upgrade. The flexibility and efficiency of remote upgrade are improved.

[0065] Optionally, based on the remote upgrade status and the target running program area, the original program information of the firmware program is remotely upgraded through the remote update execution strategy to obtain the remote upgrade processing result of the firmware program, including: based on the remote upgrade status, identifying the current update information of the firmware program and the current restart information of the firmware program; based on the current update information of the firmware program and the current restart information of the firmware program, querying the remote update execution policy of the firmware program, and based on the remote update execution policy of the firmware program, remotely upgrading the original program information of the firmware program to obtain the remote upgrade processing result of the firmware program.

[0066] In this embodiment, the terminal identifies the current update information of the firmware program and the current restart information of the firmware program based on the remote upgrade status. The current update information includes updated and not updated, and the current restart information includes restarted and not restarted. The remote upgrade status can be divided into unknown status, not updated and not restarted status, updated and not restarted status, and updated and restarted status.

[0067] Then, the terminal queries the remote update execution strategy of the firmware program based on the current update information of the firmware program and the current restart information of the firmware program, and performs remote upgrade processing on the original program information of the firmware program based on the remote update execution strategy of the firmware program to obtain the remote upgrade processing result of the firmware program. Specifically, 1) if it is an unknown state or an updated restart failure state, it means that there is no running program area for executing the application program at present, and the remote upgrade function is executed; 2) if it is an unupdated and unrestarted state, jump to the running application address to execute the application program; 3) if it is an updated and unrestarted state, set the remote upgrade state to an updated and restarted state in the storage upgrade information u, set the current running program area to not store the firmware program area to be upgraded, and jump to the storage area to store the firmware program to be upgraded to execute the application program; 4) if it is an updated and restarted state, it means that the upgrade firmware program fails to start, and the previous version of the program is restored to run. Set the remote upgrade state to an updated and restart failure state in the storage upgrade information area, set the current running program area to the storage program area where the firmware of the previous version of the program is located, and jump to the storage program area to run the application program.

[0068] Based on the above solution, the original program information of the firmware program is remotely upgraded by identifying the update information and the restart information.

[0069] Optionally, based on the remote update execution strategy of the firmware program, the original program information of the firmware program is remotely upgraded to obtain a remote upgrade processing result of the firmware program, including: through the startup program area, in accordance with the remote execution strategy of the firmware program, the remote program information of the firmware program is remotely upgraded to obtain a new firmware program, and through the startup program area, the running program identifier and the remote upgrade status are updated to obtain a first running program identifier and a first remote upgrade status; the new firmware program is self-checked to obtain a self-check processing result of the new firmware program, and the self-check processing result of the new firmware program is used as the remote upgrade processing result of the firmware program.

[0070] In this embodiment, the terminal performs remote upgrade processing on the remote program information of the firmware program through the startup program area according to the remote execution strategy of the firmware program to obtain a new firmware program. Specifically, after all modules of the application are initialized, the main control program is entered to receive messages from various interrupts or interfaces in real time, and the corresponding module operations are performed according to the message content. When the main control program receives the remote upgrade startup instruction, the single-chip microcomputer device sends the first address of the firmware storage area to be upgraded to the remote upgrade device to execute the remote upgrade function. After receiving the first address of the firmware storage area to be upgraded, the remote upgrade device sends the remote upgrade firmware program file related to the first address of the firmware storage area to be upgraded to the single-chip microcomputer device. Then, after the single-chip microcomputer device receives the remote upgrade firmware program file, the remote upgrade device sends an MD5 verification instruction with the MD5 (Message-Digest Algorithm 5) verification code of the remote upgrade firmware program file to the single-chip microcomputer device. The single-chip microcomputer device performs MD5 verification calculation on the remote upgrade firmware program file. If the verification fails, the remote upgrade process ends. If the verification passes, the remote upgrade state is set to the updated but not restarted state, and the single-chip microcomputer device is restarted through the watchdog reset, and the startup program area is entered to execute the startup program. The startup program reads the upgrade information storage area, and detects that the remote upgrade state is the updated but not restarted state, then the remote upgrade state is set to the updated and restarted state (i.e., the first remote upgrade state), and the current running program area identifier is set to the running program area identifier of the storage upgrade firmware program (i.e., the first running program identifier). After that, the terminal jumps the upgraded firmware program to the running program area, runs the firmware program to be upgraded, and determines whether the upgraded firmware program starts and runs normally, or the self-test is normal. And the above judgment result is used as the remote upgrade processing result of the firmware program. After the self-check function is completed, the terminal sets the remote upgrade status to a non-updated and non-restarted state, notifies the remote upgrade device that the upgrade is successful, and the entire remote upgrade process is completed.

[0071] Based on the above scheme, the firmware program upgrade method set by this scheme can identify different situations when the firmware program is remotely updated, and can perform self-check on the firmware program to ensure the efficiency of remote upgrade and the success rate of the upgrade.

[0072] Optionally, re-collecting a new remote upgrade status and a new running program identifier includes: based on the remote upgrade processing result, updating the first remote upgrade status to obtain a new remote upgrade status; based on the running program identifier and the first running program identifier, generating a new running program identifier through a program identifier return policy.

[0073] In this embodiment, the terminal updates the first remote upgrade state based on the remote upgrade processing result to obtain a new remote upgrade state. Among them, based on the running program identifier and the first running program identifier, a new running program identifier is generated through the program identifier return policy. Among them, if the firmware program to be upgraded is abnormally started, or the self-test fails, it can be powered on again to allow the single-chip microcomputer device to enter the startup program area to execute the startup program. The startup program detects that the remote upgrade state is updated and restarted, indicating that the firmware program to be upgraded is abnormally started, or the self-test fails. Then, the current running program area is switched to the previous running program area. After the program is restored to the previous version, the remote upgrade state is set to the updated restart failure state. The previous version of the program starts and runs, and detects that the remote upgrade state is updated and restarted. Failed state, the remote upgrade device is notified that the upgrade has failed, and the entire remote upgrade function is completed.

[0074] Based on the above solution, the success rate of the remote upgrade firmware program is ensured by updating the remote upgrade status and the new running program identifier.

[0075] Optionally, based on the new remote upgrade status and the new running program identifier, the original program information of the firmware program is re-upgraded until the remote update processing result of the firmware program is that the update is normal, and an updated new firmware program is obtained, including: based on the new running program identifier, adjusting the running strategy of the target running program area to obtain a new target running program area, and based on the new remote upgrade status, identifying the upgrade and restart result of the firmware program; based on the upgrade and restart strategy corresponding to the upgrade and restart result, the original program information of the firmware program is re-upgraded to obtain a new remote upgrade processing result of the firmware program, and replacing the remote upgrade processing result with the new remote upgrade processing result, and returning to the step of returning the original program information of the firmware program when the remote update processing result of the firmware program is that the update is abnormal, until the remote update processing result is that the update is normal, and an updated new firmware program is obtained.

[0076] In this embodiment, the terminal adjusts the operation strategy of the target operation program area based on the new operation program identifier, obtains the new target operation program area, and identifies the upgrade and restart result of the firmware program based on the new remote upgrade status. Then, the terminal re-upgrades the original program information of the firmware program based on the upgrade and restart strategy corresponding to the upgrade and restart result, obtains the new remote upgrade processing result of the firmware program, and replaces the remote upgrade processing result with the new remote upgrade processing result, and returns to the step of returning the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality, until the remote update processing result is a normal update, and obtains the updated new firmware program. Specifically, the terminal a) clears the firmware program information to be upgraded, and the firmware program information to be upgraded includes the file size and the number of data packets of the file; b) reads the remote upgrade status identifier and the program operation area identifier in the upgrade information storage area; c) determines the operation program area identifier, if it is an unknown identifier, resets and restarts the single-chip microcomputer device, ends the process, and waits for the single-chip microcomputer device to reset and start the execution of the startup program remote upgrade function. If it is the operation program area 1 identifier, the address of the firmware storage area to be upgraded is set to the first address of the operation program area 2. If it is the running program area 2 mark, set the address of the firmware storage area to be upgraded to the first address of the running program area 1; d) Determine the remote upgrade mark. If it is an unknown state or an updated but not restarted state, reset and restart the MCU device, end the process, and wait for the MCU device to reset and start the execution of the startup program remote upgrade function. If it is a not updated and not restarted state, the process ends and the MCU device executes the main control program. If it is an updated and restarted state, notify the remote upgrade device that the upgrade is successful, set the remote upgrade state to a not updated and not restarted state, and the process ends. If it is an updated and restarted failure state, notify the remote upgrade device that the upgrade failed, set the remote upgrade state to a not updated and not restarted state, and the process ends.

[0077] Based on the above scheme, no matter whether the remote firmware upgrade succeeds or fails, if the startup program does not have the function of transferring the firmware program, the previous version of the firmware program can be restored to run, thereby ensuring the firmware update success rate and update accuracy.

[0078] This application also provides an example of remote upgrade of a firmware program, such as Figure 2 As shown, the specific processing process includes the following steps:

[0079] Step S201, obtaining the remote upgrade status and the running program area identifier.

[0080] Step S202, querying the database for the target sub-running program area corresponding to the running program area identifier.

[0081] Step S203, performing operation adjustment processing on each sub-operating program area according to the operation program adjustment strategy of the target sub-operating program area to obtain the target operating program area.

[0082] Step S204: Based on the remote upgrade status, identify the current update information of the firmware program and the current restart information of the firmware program.

[0083] Step S205, based on the current update information of the firmware program and the current restart information of the firmware program, query the remote update execution policy of the firmware program, and based on the remote update execution policy of the firmware program, remotely upgrade the original program information of the firmware program to obtain the remote upgrade processing result of the firmware program.

[0084] Step S206, through the startup program area, according to the remote execution strategy of the firmware program, remotely upgrade the remote program information of the firmware program to obtain a new firmware program, and through the startup program area, update the running program identifier and the remote upgrade status to obtain a first running program identifier and a first remote upgrade status.

[0085] Step S207, performing a program self-check process on the new firmware program to obtain a self-check process result of the new firmware program, and using the self-check process result of the new firmware program as a remote upgrade process result of the firmware program.

[0086] Step S208: based on the remote upgrade processing result, update the first remote upgrade state to obtain a new remote upgrade state.

[0087] Step S209: Based on the running program identifier and the first running program identifier, a new running program identifier is generated through a program identifier return policy.

[0088] Step S210, based on the new running program identifier, adjusting the running strategy of the target running program area, obtaining a new target running program area, and identifying the upgrade and restart result of the firmware program based on the new remote upgrade state.

[0089] Step S211, based on the upgrade and restart strategy corresponding to the upgrade and restart result, the original program information of the firmware program is re-upgraded to obtain a new remote upgrade processing result of the firmware program, and the new remote upgrade processing result replaces the remote upgrade processing result, and returns to the step of returning the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality, until the remote update processing result is a normal update, and an updated new firmware program is obtained.

[0090] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0091] Based on the same inventive concept, the embodiment of the present application also provides a remote upgrade device for a firmware program for implementing the remote upgrade method of the firmware program involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the remote upgrade device for one or more firmware programs provided below can refer to the limitations of the remote upgrade method for the firmware program above, and will not be repeated here.

[0092] In an exemplary embodiment, Figure 3 As shown, a remote upgrade device for a firmware program is provided, comprising: an acquisition module 310, a return module 320 and an iteration module 330, wherein:

[0093] The acquisition module 310 is used to acquire the remote upgrade status and the running program area identifier, and identify the target running program area corresponding to the running program area identifier;

[0094] A return module 320 is used to perform remote upgrade processing on the original program information of the firmware program based on the remote upgrade state and the target running program area through a remote update execution strategy to obtain a remote upgrade processing result of the firmware program, and return the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality;

[0095] The iteration module 330 is used to re-collect the new remote upgrade status and the new running program identifier, and based on the new remote upgrade status and the new running program identifier, re-upgrade the original program information of the firmware program until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program.

[0096] Optionally, the acquisition module 310 is specifically configured to:

[0097] In the database, query the target sub-operation program area corresponding to the operation program area identifier;

[0098] By using the operation program adjustment strategy of the target sub-operation program area, operation adjustment processing is performed on each sub-operation program area to obtain the target operation program area.

[0099] Optionally, the return module 320 is specifically configured to:

[0100] Based on the remote upgrade status, identifying current update information of the firmware program and current restart information of the firmware program;

[0101] Based on the current update information of the firmware program and the current restart information of the firmware program, the remote update execution policy of the firmware program is queried, and based on the remote update execution policy of the firmware program, the original program information of the firmware program is remotely upgraded to obtain the remote upgrade processing result of the firmware program.

[0102] Optionally, the return module 320 is specifically configured to:

[0103] Through the startup program area, remote program information of the firmware program is remotely upgraded according to the remote execution strategy of the firmware program to obtain a new firmware program, and the running program identifier and the remote upgrade status are updated through the startup program area to obtain a first running program identifier and a first remote upgrade status;

[0104] The new firmware program is subjected to a program self-check process to obtain a self-check process result of the new firmware program, and the self-check process result of the new firmware program is used as a remote upgrade process result of the firmware program.

[0105] Optionally, the iteration module 330 is specifically configured to:

[0106] Based on the remote upgrade processing result, updating the first remote upgrade state to obtain a new remote upgrade state;

[0107] Based on the running program identifier and the first running program identifier, a new running program identifier is generated through a program identifier return policy.

[0108] Optionally, the iteration module 330 is specifically configured to:

[0109] Based on the new running program identifier, adjusting the running strategy of the target running program area to obtain a new target running program area, and based on the new remote upgrade state, identifying the upgrade and restart result of the firmware program;

[0110] Based on the upgrade and restart strategy corresponding to the upgrade and restart result, the original program information of the firmware program is re-upgraded to obtain a new remote upgrade processing result of the firmware program, and the new remote upgrade processing result replaces the remote upgrade processing result, and the process returns to the step of returning to the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality, until the remote update processing result is a normal update, thereby obtaining an updated new firmware program.

[0111] Each module in the above-mentioned remote upgrade device of the firmware program can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0112] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a remote upgrade method of a firmware program is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0113] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0114] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of a remote upgrade method of a firmware program when executing the computer program.

[0115] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a remote upgrade method of a firmware program are implemented.

[0116] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of a remote upgrade method of a firmware program when executed by a processor.

[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0118] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0119] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A remote upgrade method for a firmware program, characterized in that: The method comprises: Acquire the remote upgrade status and the running program area identifier, and identify the target running program area corresponding to the running program area identifier; Based on the remote upgrade state and the target running program area, the original program information of the firmware program is remotely upgraded through a remote update execution strategy to obtain a remote upgrade processing result of the firmware program, and when the remote update processing result of the firmware program is an update abnormality, the original program information of the firmware program is returned; The new remote upgrade status and the new running program identifier are recollected, and based on the new remote upgrade status and the new running program identifier, the original program information of the firmware program is re-upgraded until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program.

2. The method according to claim 1, characterized in that The identifying the target running program area corresponding to the running program area identifier includes: In the database, query the target sub-operation program area corresponding to the operation program area identifier; By using the operation program adjustment strategy of the target sub-operation program area, operation adjustment processing is performed on each sub-operation program area to obtain the target operation program area.

3. The method according to claim 1, characterized in that Based on the remote upgrade state and the target running program area, the original program information of the firmware program is remotely upgraded through a remote update execution strategy to obtain a remote upgrade processing result of the firmware program, including: Based on the remote upgrade status, identifying current update information of the firmware program and current restart information of the firmware program; Based on the current update information of the firmware program and the current restart information of the firmware program, the remote update execution policy of the firmware program is queried, and based on the remote update execution policy of the firmware program, the original program information of the firmware program is remotely upgraded to obtain the remote upgrade processing result of the firmware program.

4. The method according to claim 1, characterized in that The remote update execution strategy based on the firmware program performs remote upgrade processing on the original program information of the firmware program to obtain the remote upgrade processing result of the firmware program, including: Through the startup program area, remote program information of the firmware program is remotely upgraded according to the remote execution strategy of the firmware program to obtain a new firmware program, and the running program identifier and the remote upgrade status are updated through the startup program area to obtain a first running program identifier and a first remote upgrade status; The new firmware program is subjected to a program self-check process to obtain a self-check process result of the new firmware program, and the self-check process result of the new firmware program is used as a remote upgrade process result of the firmware program.

5. The method according to claim 4, characterized in that The re-collection of the new remote upgrade status and the new running program identifier includes: Based on the remote upgrade processing result, updating the first remote upgrade state to obtain a new remote upgrade state; Based on the running program identifier and the first running program identifier, a new running program identifier is generated through a program identifier return policy.

6. The method according to claim 1, characterized in that The method of re-upgrading the original program information of the firmware program based on the new remote upgrade state and the new running program identifier until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program, includes: Based on the new running program identifier, adjusting the running strategy of the target running program area to obtain a new target running program area, and based on the new remote upgrade state, identifying the upgrade and restart result of the firmware program; Based on the upgrade and restart strategy corresponding to the upgrade and restart result, the original program information of the firmware program is re-upgraded to obtain a new remote upgrade processing result of the firmware program, and the new remote upgrade processing result replaces the remote upgrade processing result, and the process returns to the step of returning to the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality, until the remote update processing result is a normal update, thereby obtaining an updated new firmware program.

7. A remote upgrade device for a firmware program, characterized in that: The device comprises: An acquisition module, used to acquire the remote upgrade status and the running program area identifier, and identify the target running program area corresponding to the running program area identifier; A return module, configured to perform remote upgrade processing on the original program information of the firmware program based on the remote upgrade state and the target running program area through a remote update execution strategy, obtain a remote upgrade processing result of the firmware program, and return the original program information of the firmware program when the remote update processing result of the firmware program is an update abnormality; The iteration module is used to re-collect the new remote upgrade status and the new running program identifier, and based on the new remote upgrade status and the new running program identifier, re-upgrade the original program information of the firmware program until the remote update processing result of the firmware program is that the update is normal, thereby obtaining an updated new firmware program.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • System and method for upgrading firmware of MCU on line

    CN105740034A

  • Firmware remote upgrading method and device

    CN113805921A

  • Remote wireless upgrading method based on single-chip microcomputer equipment and server

    CN115167900A

  • Program module upgrading method and device, electronic equipment and readable storage medium

    CN116701057A

  • Energy controller module program remote upgrading method, device, equipment and medium

    CN117591339A