Firmware updating method and system
By using a deterministic random number generator between the microcontroller and the recognition computing device to collaboratively generate keys and verification codes, the low efficiency and security issues of firmware updates caused by insufficient computing power are solved, secure verification and fast updates are achieved, and the risks of erroneous updates and attacks are reduced.
Patent Information
- Application Number
- CN202410283579.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-16
AI Technical Summary
Microcontrollers with insufficient computing power are inefficient and vulnerable when performing firmware updates involving complex encryption logic, making security verification difficult to achieve with existing technologies.
The first and second deterministic random number generators are used to work together between the first and second computing devices. Through the encryption and decryption process of the key and verification code, it is ensured that only approved computing devices are allowed to update the microcontroller firmware. The same random number generator is used to generate consistent keys and verification codes for security verification.
It achieves security verification for microcontrollers with lower computing power, avoids accidental updates and damages to firmware, and completes decryption updates in a short time, reducing the risk of hacker attacks and the impact of power outages.
Smart Images

Figure CN120653271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a firmware updating method and system. Background Art
[0002] Firmware update security is gaining increasing attention. Some industries, such as gaming and automotive, place significant emphasis on the security of microcontroller firmware (FW) updates. If you use a software update tool to update a microcontroller's firmware, but you don't want the firmware to be damaged or altered, only approved firmware update tools should be used.
[0003] However, if the microcontroller's computing power is insufficient and the software update tool uses complex encryption logic to encrypt the firmware update file, a higher-end microcontroller will be required or the microcontroller will take longer to successfully decrypt the firmware update file. Summary of the Invention
[0004] In view of the above, the present invention provides a firmware update method and system to meet the above requirements.
[0005] According to one embodiment of the present invention, a firmware update method includes: using a first computing device to obtain a first key and a first verification code using a first deterministic random number generator; using the first computing device to encrypt first firmware update data and the first verification code using the first key to output first encrypted data; using a second computing device to receive second encrypted data; using the second computing device to obtain a second key and a second verification code using a second deterministic random number generator, wherein the second deterministic random number generator is the same as the first deterministic random number generator; using the second computing device to decrypt the second encrypted data using the second key to obtain a third verification code and second firmware update data; and, when the second computing device determines that the second verification code matches the third verification code, updating the firmware of the second computing device according to the second firmware update data.
[0006] According to one embodiment of the present invention, a firmware update system includes: a first computing device and a second computing device. The first computing device includes a first deterministic random number generator. The second computing device includes a second deterministic random number generator and firmware, and the second computing device is connected to the first computing device. The first computing device is used to obtain a first key and a first verification code using the first deterministic random number generator, and to encrypt first firmware update data and the first verification code using the first key to output first encrypted data. The second computing device is used to receive second encrypted data, obtain a second key and a second verification code using the second deterministic random number generator, decrypt the second encrypted data using the second key to obtain a third verification code and second firmware update data, and update the firmware of the second computing device according to the second firmware update data when it is determined that the second verification code matches the third verification code, wherein the second deterministic random number generator is the same as the first deterministic random number generator.
[0007] In summary, the firmware update method and system according to one or more of the above embodiments can be applied to a second computing device (e.g., a microcontroller) with lower computing power. This allows the second computing device to achieve security verification, allowing only authorized first computing devices to update the firmware of the second computing device. This prevents firmware corruption caused by mistakenly sending update commands. Furthermore, the second computing device does not need to spend a lot of time to decrypt the update data.
[0008] The above description of the disclosed contents and the following description of the embodiments are intended to demonstrate and explain the spirit and principles of the present invention, and to provide further explanation of the claims of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 FIG. 1 is a block diagram of a firmware update system according to an embodiment of the present invention.
[0010] Figure 2 FIG. 4 is a flowchart of a firmware updating method according to an embodiment of the present invention.
[0011] Figure 3 FIG. 4 is a flow chart of determining an update result according to an embodiment of the present invention.
[0012] Figure 4 FIG. 4 is a flow chart of a synchronous deterministic random number generator according to an embodiment of the present invention.
[0013] Figure 5 FIG. 4 is a flow chart illustrating a protection mechanism for verification failure according to an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following detailed description of the features and advantages of the present invention is sufficient to enable any person skilled in the art to understand the technical content of the present invention and implement it accordingly. Furthermore, based on the disclosure of this specification, the claims, and the accompanying drawings, any person skilled in the art can easily understand the relevant objects and advantages of the present invention. The following examples further illustrate the concepts of the present invention but are not intended to limit the scope of the present invention in any way.
[0015] Please refer to Figure 1 ,in Figure 1 FIG. 1 is a block diagram of a firmware update system according to an embodiment of the present invention. Figure 1 As shown, the firmware update system 1 includes a first computing device 10 and a second computing device 20. The first computing device 10 is in communication or electrically connected to the second computing device 20. For example, the first computing device 10 and the second computing device 20 can be connected to each other via at least one of an inter-integrated circuit (I2C) interface, a universal synchronous receiver / transmitter (UART), a universal serial bus (USB), a controller area network (CAN), a secure digital input and output (SDIO), Ethernet, and a serial peripheral interface bus (SPI).
[0016] The first computing device 10 includes a first deterministic random bit generator (DRBG) 100. The first deterministic random bit generator 100 generates a first key for encryption and decryption, and generates a first verification code for verification. The first computing device 10 is, for example, a host or a firmware update tool, and may include one or more processors, such as a central processing unit (CPU), a graphics processor (GPU), a microprocessor (MCU), a programmable logic controller (PLC), or other processors with signal processing capabilities.
[0017] The second computing device 20 includes a second deterministic random number generator 200 and firmware 201. The second deterministic random number generator 200 generates a second key for encryption and decryption, and generates a second verification code for verification. Firmware 201 is the firmware to be updated on the second computing device 20. The second computing device 20 is, for example, a microcontroller.
[0018] It should be noted that the verification code generated by the deterministic random number generator is not a cyclic redundancy check (CRC) verification code, but the encrypted data described below may contain a CRC verification code to verify the correctness of the data.
[0019] Please refer to Figure 1 and Figure 2 ,in Figure 2 FIG is a flow chart of a firmware update method according to an embodiment of the present invention. Figure 2 As shown, the firmware update method includes: step S101: using a first computing device to obtain a first key and a first verification code using a first deterministic random number generator; step S103: using the first computing device to encrypt first firmware update data and the first verification code using the first key to output first encrypted data; step S105: using a second computing device to receive second encrypted data; step S107: using the second computing device to obtain a second key and a second verification code using a second deterministic random number generator; step S109: using the second computing device to decrypt the second encrypted data using the second key to obtain a third verification code and second firmware update data; and step S111: using the second computing device to update the firmware of the second computing device according to the second firmware update data when the second verification code and the third verification code are determined to match.
[0020] In step S101, the first computing device 10 calculates a first key based on a random initial value and a preset calculation formula, and calculates a first verification code based on the first key and the preset calculation formula. For example, the preset calculation formula may be as shown in the following formula (1). In formula (1), A1 is used as the random initial value to generate A2 as the first key; then, A1 is replaced by the first key to generate A2 as the first verification code.
[0021] A2=A1*1122334455 + 66778899 Formula (1)
[0022] It should be noted that the above formula (1) is only an example, and when the computing power of the second computing device 20 is low, a low-complexity preset calculation formula can be designed; when the protection of the firmware 201 is to be improved, a high-complexity preset calculation formula can also be designed.
[0023] Furthermore, the first computing device 10 may use the first random number initial value as a seed for the first deterministic random number generator 100 to generate a first digital sequence, use one number in the first digital sequence as a first key, and use another number in the first digital sequence as a first verification code. Similar to the above, when the computing power of the first computing device 10 and the second computing device 20 is low, the number of bits in the first deterministic random number generator 100 may be reduced. When the protection of the firmware 201 is to be enhanced, the number of bits in the first deterministic random number generator 100 may be increased.
[0024] In step S103, the first computing device 10 encrypts the first firmware update data and the first verification code using the first key to output first encrypted data. The first firmware update data may include at least one of an update instruction and a firmware update file. In other words, the first encrypted data includes the encrypted first firmware update data and the first verification code.
[0025] In step S105, the second computing device 20 receives the second encrypted data. In step S107, the second computing device 20 uses a second deterministic random number generator 200 to obtain a second key and a second verification code. The second deterministic random number generator 200 is identical to the first deterministic random number generator 100. The second computing device 20 may use the second random number initial value as a seed for the second deterministic random number generator 200 to generate a second number sequence, use the first number in the second number sequence as the second key, and use the second number in the second number sequence as the second verification code. Furthermore, the first random number initial value may be the same as the second random number initial value, and the order of the first and second numbers of the first number sequence in the first number sequence may be the same as the order of the first and second numbers of the second number sequence in the second number sequence. In other words, when the first deterministic random number generator 100 and the second deterministic random number generator 200 have been pre-set to use the same order of numbers in the number sequence, the first deterministic random number generator 100 and the second deterministic random number generator 200 can generate the key and the verification code with the same random number initial value and order.
[0026] It is also worth noting that Figure 1 Step S105 is shown as being executed before step S107, i.e., receiving the second encrypted data can be regarded as a triggering mechanism for the second computing device 20 to execute step S107. However, the second computing device 20 may execute step S107 first and then execute step S105, or execute steps S105 and S107 simultaneously.
[0027] In step S109 , the second computing device 20 decrypts the second encrypted data received in step S105 using the second key to obtain a third verification code and second firmware update data.
[0028] In step S111, the second computing device 20 determines whether the second verification code and the third verification code are identical. If the second verification code and the third verification code are identical, this indicates that the second encrypted data originated from the first computing device 10, the first key and the second key are identical, and the first verification code is the third verification code. Therefore, the second computing device 20 can update its firmware 201 based on the second firmware update data (i.e., the first firmware update data).
[0029] Conversely, if the second verification code is different from the third verification code, it indicates that the second encrypted data may not be from the first computing device 10 and / or the first key and the second key are different keys. Therefore, the second computing device 20 may refuse to update the firmware 201 based on the second firmware update data corresponding to the third verification code.
[0030] Thus, the firmware update method and system according to one or more of the above embodiments can be applied to a second computing device (e.g., a microcontroller) with lower computing power. This allows the second computing device with lower computing power to achieve security verification, allowing only authorized first computing devices to update the firmware of the second computing device. This prevents firmware damage caused by mistakenly sending update commands. Furthermore, the second computing device does not need to spend too much time to decrypt the update data.
[0031] Please refer to Figure 1 and Figure 3 ,in Figure 3 FIG. 4 is a flow chart of determining an update result according to an embodiment of the present invention. Figure 3 The steps shown can be performed in Figure 2 After step S111. Figure 3 As shown, determining the update result may include: step S201: encrypting the second verification code and the update result using the second key by the second computing device to output third encrypted data; step S203: receiving the fourth encrypted data by the first computing device; step S205: decrypting the fourth encrypted data by the first computing device using the first key to obtain the fourth verification code; and step S207: determining the update result by the first computing device based on whether the fourth verification code matches the first verification code.
[0032] In step S201, the second computing device 20 uses the second key to encrypt the second verification code and the update result of the firmware 201 to generate and output third encrypted data. The update result may include one or more of the updated portion of the firmware 201, the update time, and the storage location of the firmware 201. The present invention is not limited to the content of the update result.
[0033] In step S203, the first computing device 10 receives the fourth encrypted data. In step S205, the first computing device 10 decrypts the fourth encrypted data received in step S203 using the first key to obtain a fourth verification code.
[0034] In step S207, the first computing device 10 may determine whether the first verification code and the fourth verification code are identical. If the first verification code and the fourth verification code are identical, it indicates that the third encrypted data originated from the second computing device 20. Therefore, the first computing device 10 may determine that the update of the firmware 201 using the first firmware update data was successful. Conversely, if the first verification code and the fourth verification code are different, the first computing device 10 may determine that the update of the firmware 201 using the first firmware update data was unsuccessful.
[0035] Please refer to Figure 1 and Figure 4 ,in Figure 4 FIG. 4 is a flow chart of a synchronous deterministic random number generator according to an embodiment of the present invention. Figure 4 The steps shown can be performed in Figure 2 Before step S101, that is, Figure 4 It can be considered as a stage of synchronizing the first deterministic random number generator 100 and the second deterministic random number generator 200 before using the first deterministic random number generator 100 and the second deterministic random number generator 200 to verify and update the firmware 201. Figure 4 The steps can be performed each time before the first computing device 10 wants to update the firmware 201. Figure 4 As shown, the synchronous deterministic random number generator includes: step S301: a first computing device outputs a first data seed and a synchronization instruction to a second computing device based on a first system parameter; step S303: a second computing device generates a second data seed based on a second system parameter; step S305: the second computing device generates an initial random value for the second deterministic random number generator based on the first and second data seeds; step S307: the second computing device outputs the second data seed to the first computing device; and step S309: the first computing device generates an initial random value for the first deterministic random number generator based on the first and second data seeds. It should be noted that step S307 can be performed before step S305, or step S307 and step S305 can be performed simultaneously.
[0036] In step S301, the first computing device 10 outputs a first data seed and a synchronization instruction to the second computing device 20 based on a first system parameter. The first system parameter may include at least one of the current timestamp counter of the first computing device 10 and the voltage value of the AC power input to the first computing device 10. Furthermore, when the first computing device 10 includes multiple deterministic random number generators, the first system parameter may also be a combination of random numbers generated by the multiple deterministic random number generators. The present invention is not limited to the content of the first system parameter. In one embodiment, the first computing device 10 may use the first system parameter as the first data seed. In another embodiment, the first computing device 10 may encrypt the first system parameter to generate the first data seed, where the first data seed may be implemented as a verification code. The synchronization instruction may be used to instruct the second computing device 20 to begin synchronization of the deterministic random number generator.
[0037] In step S303, the second computing device 20 generates a second data seed based on the second system parameter. The second system parameter may include at least one of the current timestamp of the second computing device 20 and the voltage value of the AC power input to the second computing device 20. Furthermore, when the second computing device 20 includes multiple deterministic random number generators, the second system parameter may also be a combination of random numbers generated by the multiple deterministic random number generators. The present invention does not limit the content of the second system parameter. The second system parameter may be generated using the same or different data type as the first system parameter. In one embodiment, the second computing device 20 may use the second system parameter as the second data seed. In another embodiment, the second computing device 20 may encrypt the second system parameter to generate the second data seed, where the second data seed may be implemented as a verification code. The second computing device 20 may generate the second data seed after receiving a synchronization instruction.
[0038] In step S305, the second computing device 20 generates a second random initial value for the second deterministic random number generator 200 based on the combination of the first data seed and the second data seed. Furthermore, if the first data seed is generated by encrypting the first system parameter, the second computing device 20 can decrypt the first data seed to obtain the first system parameter, combine the first system parameter with the second data seed, and use the combination as the second random initial value for the second deterministic random number generator 200. Furthermore, the second computing device 20 can use the combination of the first system parameter and the second system parameter as the second random initial value for the second deterministic random number generator 200.
[0039] In step S307, second computing device 20 outputs the second data seed to first computing device 10. Corresponding to step S303, second computing device 20 may directly use the second system parameters as the second data seed and output the second data seed to first computing device 10. Alternatively, second computing device 20 may use the encrypted second system parameters as the second data seed and output the encrypted second data seed to first computing device 10.
[0040] In step S309, the first computing device 10 generates a first random initial value for the first deterministic random number generator 100 based on the combination of the first data seed and the second data seed. Furthermore, if the second data seed is generated by encrypting a second system parameter, the first computing device 10 can decrypt the second data seed to obtain the second system parameter, combine the second system parameter with the first data seed, and use the combination as the first random initial value for the first deterministic random number generator 100. Furthermore, the first computing device 10 can use the combination of the first system parameter and the second system parameter as the first random initial value for the first deterministic random number generator 100.
[0041] The combinations described in steps S305 and S309 may be generated based on a preset combination formula, and the preset combination formula may be preset in the first computing device 10 and the second computing device 20. For example, the preset combination formula may be the addition of the first system parameter to the second system parameter, the subtraction of the first system parameter from the second system parameter, the multiplication of the first system parameter by the second system parameter, or the division of the first system parameter by the second system parameter. The preset combination formulas described above are merely examples and are not intended to limit the present invention.
[0042] Furthermore, the aforementioned first key is generated based on a first random initial value, and the aforementioned second key is generated based on a second random initial value. Specifically, the first key may be generated by using the first random initial value as a seed for a first deterministic random number generator 100, and the first verification code may be a second random number generated by the first deterministic random number generator 100 based on the first key. Similarly, the second key may be generated by using the second random initial value as a seed for a second deterministic random number generator 200, and the second verification code may be a second random number generated by the second deterministic random number generator 200 based on the second key.
[0043] In execution Figure 4 Before the step of performing the above steps, the first computing device 10 and the second computing device 20 may each establish the same deterministic random number generator (i.e., the first deterministic random number generator 100 and the second deterministic random number generator 200) so as to subsequently use the deterministic random number generator to generate a random number sequence with a longer period but a fixed pattern.
[0044] Please refer to Figure 1 and Figure 5 ,in Figure 5 FIG. 4 is a flow chart illustrating a protection mechanism for verification failure according to an embodiment of the present invention. Figure 5 The steps shown can be performed in Figure 2 After step S109. Figure 5 As shown, the protection mechanism for verification failure includes: step S401: determining whether the second verification code does not match the third verification code; step S403: counting the number of verification rejections; step S405: determining whether the number of verification rejections is equal to or greater than a preset number; when the determination result of step S405 is "yes", executing step S407: suspending the reception of another encrypted data; and when the determination result of step S405 is "no", executing step S409: adopting the received encrypted data as the second encrypted data. Step S401 can be regarded as the second computing device 20 in Figure 2 The result of determining that the second verification code does not match the third verification code after step S109 is not described here.
[0045] In step S403 and step S405, the second computing device 20 adds 1 to the number of authentication rejections and determines whether the number of authentication rejections after adding 1 is equal to or greater than a predetermined number. The initial value of the number of authentication rejections can be 0. The predetermined number can be 5, for example, but the present invention is not limited thereto.
[0046] When the second computing device 20 determines that the number of authentication rejections is equal to or greater than the preset number, in step S407, the second computing device 20 may refuse to update the firmware 201 based on the second encrypted data and refuse to receive another encrypted data. On the contrary, when the second computing device 20 determines that the number of authentication rejections is not equal to or greater than the preset number, in step S409, the second computing device 20 may receive a new encrypted data and use this encrypted data as the encrypted data. Figure 2 Furthermore, the second computing device 20 may reset the number of rejected verifications to zero each time it determines that the second verification code matches the third verification code.
[0047] Furthermore, the second computing device 20 may increment the update count by 1 each time it receives a piece of second encrypted data, and refuse to accept further encrypted data if the update count is equal to or greater than another predetermined count, where the predetermined count is, for example, 10, but the present invention is not limited thereto. Furthermore, the second computing device 20 may reset the update count to zero after a predetermined time period, where the predetermined time period is, for example, 24 hours.
[0048] By limiting the number of verification failures and the number of updates, the risk of the firmware 201 being accessed by hackers can be reduced.
[0049] In addition, when executing the corresponding Figure 2 、 Figure 3 and Figure 5 During any of the embodiments of the present invention, when at least one target device among the first computing device 10 and the second computing device 20 is triggered by a power-off signal, the at least one target device can restore the firmware 201 of the second computing device 20 according to the secure version, for example, to a previous version of the firmware 201. Accordingly, when the first computing device 10 and / or the second computing device 20 is powered off during the update process, the impact of the power outage on the firmware 201 can be reduced.
[0050] In summary, the firmware update method and system according to one or more of the above embodiments can be applied to a second computing device (e.g., a microcontroller) with lower computing power. This allows the second computing device with lower computing power to also achieve security verification, and only allows approved first computing devices to update the firmware of the second computing device. This can prevent the firmware from being damaged by mistakenly sending update commands. Furthermore, the second computing device does not need to spend too much time to decrypt the update data. In addition, by limiting the number of verification failures and the number of updates, the risk of the firmware being accessed by hackers can be reduced. Moreover, by restoring the firmware in response to a power-off signal, the impact of power outages on the firmware can be reduced.
[0051]
Explanation of symbols
[0052] 1: Firmware update system
[0053] 10: First computing device
[0054] 100: First deterministic random number generator
[0055] 20: Second computing device
[0056] 200: Second deterministic random number generator
[0057] 201: Firmware
[0058] S101, S103, S105, S107, S109, S111, S201, S203, S205, S207, S301, S303, S305, S307, S309, S401, S403, S405, S407, S409: steps.
Claims
1. A firmware update method, characterized in that: Include: Using a first deterministic random number generator with a first computing device to obtain a first key and a first verification code; encrypting the first firmware update data and the first verification code using the first key with the first computing device to output first encrypted data; receiving second encrypted data using a second computing device; Obtaining a second key and a second verification code using a second deterministic random number generator with the second computing device, wherein the second deterministic random number generator is the same as the first deterministic random number generator; decrypting the second encrypted data using the second key with the second computing device to obtain a third verification code and second firmware update data; and When the second computing device determines that the second verification code matches the third verification code, the firmware of the second computing device is updated according to the second firmware update data.
2. The firmware update method according to claim 1 , wherein obtaining the first key and the first verification code by the first computing device using the first deterministic random number generator comprises: Using a first random number initial value as a seed for the first deterministic random number generator to generate a first number sequence; and The first number in the first number sequence is used as the first key, and the second number in the first number sequence is used as the first verification code.
3. The firmware update method according to claim 2 , wherein obtaining the second key and the second verification code by the second computing device using the second deterministic random number generator comprises: using a second random number initial value as a seed for the second deterministic random number generator to generate a second number sequence; and The first number in the second number sequence is used as the second key, and the second number in the second number sequence is used as the second verification code. The first random number initial value is the same as the second random number initial value, and the order of the first number and the second number in the first number sequence in the first number sequence is the same as the order of the first number and the second number in the second number sequence in the second number sequence.
4. The firmware update method according to claim 1 , wherein obtaining the first key and the first verification code by the first computing device using the first deterministic random number generator comprises: Calculate the first key according to the random number initial value and a preset calculation formula; and The first verification code is calculated according to the first key and the preset calculation formula.
5. The firmware updating method according to claim 1 , wherein after updating the firmware of the second computing device according to the second firmware updating data, the method further comprises: encrypting the second verification code and updating the result with the second computing device using the second key to output third encrypted data; receiving fourth encrypted data with the first computing device; decrypting the fourth encrypted data using the first key with the first computing device to obtain a fourth verification code; and The first computing device determines an update result according to whether the fourth verification code matches the first verification code. The firmware update method according to claim 1 , wherein: Also includes: Outputting a first data seed and a synchronization instruction to the second computing device according to a first system parameter by the first computing device; generating a second data seed according to a second system parameter by the second computing device; generating, by the second computing device, a random initial value for the second deterministic random number generator according to the first data seed and the second data seed, wherein the second key is generated according to the random initial value of the second deterministic random number generator; Outputting the second data seed to the first computing device by the second computing device; and The first computing device generates a random initial value of the first deterministic random number generator according to the first data seed and the second data seed, wherein the first key is generated according to the random initial value of the first deterministic random number generator.
7. The firmware update method according to claim 6, wherein Outputting the first data seed and the synchronization instruction to the second computing device according to the first system parameter by the first computing device includes: encrypting the first system parameter with the first computing device to generate the first data seed, The step of generating the random number initial value of the second deterministic random number generator by the second computing device according to the first data seed and the second data seed comprises: decrypting the first data seed using the second computing device to obtain the first system parameter; and The first system parameter and the second data seed are combined as the random number initial value of the second deterministic random number generator.
8. The firmware update method according to claim 6, wherein Outputting the second data seed to the first computing device by the second computing device includes: encrypting the second system parameter with the second computing device to generate the second data seed, The step of generating the random number initial value of the first deterministic random number generator by the first computing device according to the first data seed and the second data seed comprises: decrypting the second data seed using the first computing device to obtain the second system parameter; and The first data seed and the second system parameter are combined as the random number initial value of the second deterministic random number generator.
9. The firmware update method according to claim 1, wherein: Also includes: When it is determined that the second verification code does not match the third verification code, counting the number of verification rejections by the second computing device; Determine whether the number of verification rejections is equal to or greater than a preset number; When the number of verification rejections is equal to or greater than the preset number, suspending receiving another encrypted data; as well as When the number of verification rejections is not equal to or greater than the preset number, the received encrypted data is used as the second encrypted data.
10. The firmware update method according to claim 1, wherein: Also includes: When at least one target device among the first computing device and the second computing device is triggered by a power-off signal, the firmware of the second computing device is restored by the at least one target device according to a secure version.
11. A firmware update system, characterized in that: Include: a first computing device comprising a first deterministic random number generator, the first computing device being configured to obtain a first key and a first verification code using the first deterministic random number generator, and encrypt first firmware update data and the first verification code using the first key to output first encrypted data; and A second computing device includes a second deterministic random number generator and firmware, the second computing device being connected to the first computing device. The second computing device is configured to receive second encrypted data, obtain a second key and a second verification code using the second deterministic random number generator, decrypt the second encrypted data using the second key to obtain a third verification code and second firmware update data, and update the firmware of the second computing device according to the second firmware update data when the second verification code matches the third verification code. The second deterministic random number generator is the same as the first deterministic random number generator.
12. The firmware update system according to claim 11, wherein the first computing device uses a first random number initial value as a seed of the first deterministic random number generator to generate a first digital sequence, uses a first number in the first digital sequence as the first key, and uses a second number in the first digital sequence as the first verification code.
13. The firmware update system according to claim 12 , wherein the second computing device uses a second random number initial value as a seed for the second deterministic random number generator to generate a second digital sequence, uses a first number in the second digital sequence as the second key, and uses a second number in the second digital sequence as the second verification code. The first random number initial value is the same as the second random number initial value, and the order of the first number and the second number in the first number sequence in the first number sequence is the same as the order of the first number and the second number in the second number sequence in the second number sequence. 14 . The firmware update system according to claim 11 , wherein the first computing device calculates the first key according to an initial random number value and a preset calculation formula, and calculates the first verification code according to the first key and the preset calculation formula.
15. The firmware updating system according to claim 11, wherein after the firmware of the second computing device is updated according to the second firmware updating data, The second computing device is further configured to encrypt the second verification code using the second key and update the result to output third encrypted data. The first computing device is further configured to receive fourth encrypted data, decrypt the fourth encrypted data using the first key to obtain a fourth verification code, and determine an update result based on whether the fourth verification code matches the first verification code.
16. The firmware update system according to claim 11, wherein The first computing device is further configured to output a first data seed and a synchronization instruction to the second computing device according to the first system parameter, and to generate a random number initial value for the first deterministic random number generator according to the first data seed and the second data seed. The second computing device is further configured to generate the second data seed according to the second system parameter, generate the random number initial value of the second deterministic random number generator according to the first data seed and the second data seed, and output the second data seed to the first computing device. The first key is generated according to the initial random value of the first deterministic random number generator, and the second key is generated according to the initial random value of the second deterministic random number generator.
17. The firmware update system according to claim 16, wherein The first computing device encrypts the first system parameter to generate the first data seed. The first computing device decrypts the first data seed to obtain the first system parameter, and combines the first system parameter and the second data seed as the random number initial value of the second deterministic random number generator.
18. The firmware update system according to claim 16, wherein The second computing device encrypts the second system parameter to generate the second data seed, The first computing device decrypts the second data seed to obtain the second system parameter, and combines the first data seed and the second system parameter as the random number initial value of the second deterministic random number generator.
19. The firmware update system according to claim 11, wherein when it is determined that the second verification code does not match the third verification code, the second computing device is further used to count the number of verification rejections, and when it is determined that the number of verification rejections is equal to or greater than a preset number, suspend receiving another encrypted data; and when it is determined that the number of verification rejections is not equal to or greater than the preset number, adopt the received encrypted data as the second encrypted data. 20 . The firmware update system of claim 11 , wherein when at least one target device among the first computing device and the second computing device is triggered by a power-off signal, the at least one target device restores the firmware of the second computing device according to a secure version.