Firmware upgrading method, device and equipment and computer readable storage medium
By acquiring and sending module upgrade files containing multiple firmware upgrade files, the problem of low firmware upgrade efficiency in the existing technology is solved, and the simultaneous upgrade of multiple firmware is achieved, and the upgrade efficiency is improved.
Patent Information
- Application Number
- CN202411522151.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-10-29
AI Technical Summary
During the firmware upgrade process of device modules, the existing technology is inefficient and needs to obtain and upgrade firmware one by one, resulting in a long upgrade time.
By obtaining the module upgrade file of the target module, the file contains at least two firmware upgrade files, sending the upgrade data packet to the control module, and sending the data packet to the target module through the control module, achieving simultaneous upgrade of multiple firmware.
Improves the efficiency of firmware upgrades, and can upgrade multiple firmware in the target module at the same time through one module upgrade file, shortening the upgrade time.
Smart Images

Figure CN119781790A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of firmware upgrade, and in particular to a firmware upgrade method, apparatus, device and computer-readable storage medium. Background Art
[0002] When upgrading the firmware of the module on the device, it is necessary to obtain the upgrade packages of the firmware to be upgraded from the server one by one, and then upgrade the firmware one by one, which leads to low upgrade efficiency. Summary of the invention
[0003] Embodiments of the present application provide a firmware upgrade method, apparatus, device, and computer-readable storage medium, which can improve the efficiency of firmware upgrade.
[0004] In order to achieve the above object, according to a first aspect of the present application, a firmware upgrade method is provided, which is applied to a first device, and the method includes:
[0005] Obtain a module upgrade file of a target module in a second device, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0006] An upgrade data packet is sent to a control module of the second device according to the module upgrade file, and the upgrade data packet is sent to the target module through the control module, so that the target module upgrades the at least two firmwares.
[0007] According to a second aspect of the present application, another firmware upgrade method is provided, which is applied to a target module of a second device, wherein the second device further includes a control module, and the method includes:
[0008] receiving an upgrade data packet sent by the first device through the control module, wherein the upgrade data packet is sent by the first device based on a module upgrade file of the target module, wherein the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0009] Determining a writing position of the upgrade data packet;
[0010] The upgrade data packet is written according to the write position to upgrade the at least two firmwares of the target module.
[0011] According to a third aspect of the present application, another firmware upgrade method is provided, which is applied to a control module of a second device, wherein the second device also includes a target module of firmware to be upgraded, and the method includes:
[0012] Receiving an upgrade data packet sent by the first device based on a module upgrade file of the target module, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0013] The upgrade data packet is sent to the target module, so that the target module upgrades the at least two firmwares.
[0014] According to a fourth aspect of the present application, a firmware upgrade apparatus is provided, which is integrated in a first device, and the apparatus includes:
[0015] An acquisition unit, configured to acquire a module upgrade file of a target module in a second device, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0016] The first sending unit is used to send an upgrade data packet to the control module of the second device according to the module upgrade file, and send the upgrade data packet to the target module through the control module, so that the target module upgrades the at least two firmwares.
[0017] According to a fifth aspect of the present application, another firmware upgrade device is provided, which is integrated into a target module of a second device, wherein the second device further includes a control module, and the device includes:
[0018] A first receiving unit is used to receive an upgrade data packet sent by the first device through the control module, wherein the upgrade data packet is sent by the first device based on a module upgrade file of the target module, and the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0019] A determination unit, used to determine a writing position of the upgrade data packet;
[0020] An upgrading unit is used to write the upgrading data packet according to the writing position to upgrade the at least two firmwares of the target module.
[0021] According to a sixth aspect of the present application, there is provided another firmware upgrade device, which is integrated into a control module of a second device, wherein the second device further includes a target module of firmware to be upgraded, and the device includes:
[0022] A second receiving unit, configured to receive an upgrade data packet sent by the first device based on a module upgrade file of the target module, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0023] The second sending unit is used to send the upgrade data packet to the target module, so that the target module upgrades the at least two firmwares.
[0024] According to the seventh aspect of the present application, a device is provided, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any firmware upgrade method provided in the embodiments of the present application.
[0025] According to an eighth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute any one of the firmware upgrade methods provided in the embodiments of the present application.
[0026] The embodiment of the present application obtains a module upgrade file of a target module in a second device, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; an upgrade data packet is sent to a control module of the second device according to the module upgrade file, and the upgrade data packet is sent to the target module through the control module, so that the target module upgrades at least two firmwares. This can achieve the goal of upgrading multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the efficiency of firmware upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0028] Figure 1 is a flowchart of a firmware upgrade method provided in an embodiment of the present application;
[0029] Figure 2 It is a schematic diagram of the framework of the module upgrade file provided in the embodiment of the present application;
[0030] Figure 3 is another flow chart of the firmware upgrade method provided in an embodiment of the present application;
[0031] Figure 4 is another flow chart of the firmware upgrade method provided in the embodiment of the present application;
[0032] Figure 5 is an interactive flow chart of the firmware upgrade method provided in an embodiment of the present application;
[0033] Figure 6 It is a schematic diagram of a firmware upgrade device provided in an embodiment of the present application;
[0034] Figure 7 is a schematic diagram of another firmware upgrade device provided in an embodiment of the present application;
[0035] Figure 8 Schematic diagram of another firmware upgrade device provided in an embodiment of the present application;
[0036] Fig. 9 It is a schematic diagram of the structure of the device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0038] The embodiments of the present application provide a firmware upgrade method, apparatus, device and computer-readable storage medium. The firmware upgrade apparatus can be integrated in a device.
[0039] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0040] A firmware upgrade method provided in an embodiment of the present application is applied to a first device, which may be a terminal or other device. The following description will be made from the perspective of a first firmware upgrade device, which may be specifically integrated in the device, such as Figure 1 As shown, the specific process of the firmware upgrade method can be as follows:
[0041] 101. Obtain a module upgrade file of a target module in a second device, where the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0042] The first device and the second device may be different devices, for example, the first device may be a terminal, and the second device may be a vehicle, etc. The first device and the second device may also be the same device, which may be flexibly configured as required and is not limited here.
[0043] The target module can be a module in the second device that provides a specified function, such as an ultra-wideband (UWB) module, a fragrance control module, and an electronic fan control module, wherein the UWB module can detect living body information in the vehicle, the fragrance control module can control the release of fragrance in the vehicle, and the electronic fan control module can be used to control the operation of the vehicle's fan.
[0044] Among them, the module upgrade file may include firmware upgrade files of at least two firmware in the target module. After the firmware upgrade file is written into the target module, the corresponding firmware can be upgraded. For example, the module upgrade file may include at least two firmware upgrade files of the configuration file, application file and driver file of the target module (for example, it can be a firmware upgrade package).
[0045] 102. Send an upgrade data packet to a control module of a second device according to the module upgrade file, and send the upgrade data packet to a target module through the control module, so that the target module upgrades at least two firmwares.
[0046] The first device can indirectly communicate with the target module of the second device through the control module of the second device. The first device sends the upgrade data packet of the module upgrade file to the control module of the second device, and the upgrade data packet is sent to the target module through the control module of the second device. The target module writes the data upgrade package to upgrade at least two firmwares on the target module.
[0047] The upgrade data packet can be obtained by dividing the data of the module upgrade firmware, each upgrade data packet includes part of the data in the module upgrade firmware file, and the module upgrade file can be obtained by merging multiple module upgrade data packets corresponding to the module upgrade file.
[0048] In the embodiment of the present application, the module upgrade file includes firmware upgrade files of multiple firmware (at least two) of the target module, and multiple firmware of the target module can be upgraded through one module upgrade file.
[0049] The module upgrade file includes the firmware upgrade files of multiple firmware of the target module. The write location of each firmware upgrade file can be included in each upgrade data packet. After the target module receives the upgrade data packet, it parses the upgrade data packet to obtain the firmware upgrade data and the write location of the firmware upgrade data, and writes the firmware upgrade data according to the write location.
[0050] Optionally, the module upgrade file may further include a firmware list, which may include the address of each firmware upgrade file in the module upgrade file in the target module, that is, in one embodiment, the module upgrade file includes a first upgrade data packet and a second upgrade data packet, the first upgrade data packet includes the firmware list, and the second upgrade data packet includes part of the data of the firmware upgrade file, and the step of "sending the upgrade data packet to the control module of the second device according to the module upgrade file, and sending the upgrade data packet to the target module through the control module" may include:
[0051] Sending a first upgrade data packet to a control module, and sending the first upgrade data packet to a target module through the control module, wherein the firmware list includes a write position of each firmware upgrade file in the target module;
[0052] The plurality of second upgrade data packets are sequentially sent to the target module through the control module, so that the target module writes the second upgrade data packets into the target module based on the writing position in the firmware list.
[0053] The module upgrade file includes a first upgrade data packet and a second upgrade data packet. The first upgrade data packet includes a firmware list. There can be one or more first upgrade data packets. The number of first upgrade data packets depends on the size of the firmware list. If the firmware list is large, there can be multiple first upgrade data packets.
[0054] The second upgrade data packet may include part of the data in the firmware upgrade file, and may be obtained by splitting the firmware upgrade file. The splitting process may split the firmware upgrade file into multiple data packets with a smaller data volume than the firmware upgrade file.
[0055] After the first device sends the first upgrade data packet to the target module through the control module, it sends the second upgrade data packet to the target module through the control module. The target module can obtain a firmware list by parsing the first upgrade data packet, and the write location of each second upgrade data in the target module can be determined based on the firmware list.
[0056] Splitting the module upgrade file into multiple data upgrade packages may be performed by splitting the module upgrade file based on a preset data volume threshold to obtain multiple upgrade data packets whose data volumes are less than or equal to the data volume threshold.
[0057] For example, the framework of the module upgrade package can be as follows: Figure 2 As shown, the module upgrade file includes a firmware list and multiple firmware upgrade files. The firmware list records the position of each firmware upgrade file in the module upgrade (e.g., the starting position), the size of each firmware upgrade file, the address of each firmware upgrade file in the chip of the target module (e.g., the starting address), the number of firmware upgrade files, the decryption key of the upgrade data packet, etc.
[0058] Optionally, the first device may also send the upgrade data packet according to the data volume limit of the target module on the data packet, and before sending the upgrade data packet to the control module of the second device according to the module upgrade file, the method further includes:
[0059] Determine a threshold value of the amount of data received by the target module for the upgrade data packet;
[0060] According to the received data amount threshold, each firmware upgrade file in the module upgrade file of the target module is split and processed to obtain multiple upgrade data packets.
[0061] Among them, the received data volume threshold is the threshold of the data length of each data packet of the target module. The received data volume threshold can be set in advance according to the memory information of the target module, or it can be determined by the control module according to the data transmission characteristics or memory usage of the target module. For example, the target module requires that the total number of upgrade data packets of the module upgrade file cannot exceed the preset data packet number threshold. Then, the maximum data volume of each upgrade data packet can be calculated based on the total number of module upgrade files and the preset packet number threshold to obtain the received data volume threshold, or the data volume of the data packet that the target module can receive can be determined according to the memory usage of the target module to obtain the received data volume threshold.
[0062] The first device splits each firmware upgrade file in the module upgrade file of the target module into multiple upgrade data packets according to a data volume threshold of the target module for receiving the upgrade data packet, and the data volume of each upgrade data packet is less than or equal to the data volume threshold.
[0063] Optionally, the first device may generate an upgrade data package from the firmware list, and split each firmware upgrade file to obtain multiple upgrade data packages.
[0064] The module upgrade package may be a corresponding module upgrade package obtained by the first device according to the target module to be upgraded by the second device (for example, obtained from a server or obtained from a local storage device). Optionally, it may also be extracted by the first device from an upgrade synthesis package of the second device, where the upgrade synthesis package includes module upgrade files of multiple modules of the second device, and the second device obtains the module upgrade file corresponding to the target module therefrom. That is, in one embodiment, before the step of “obtaining the module upgrade file of the target module in the second device”, the firmware upgrade method provided in the embodiment of the present application may further include:
[0065] Acquire a firmware upgrade synthesis package of the second device, where the firmware upgrade synthesis package includes module upgrade files of multiple modules of the second device;
[0066] Determine the module to be upgraded of the second device according to the firmware version of each module application in the second device and the firmware version of the module upgrade file;
[0067] A target module is determined from among the modules to be upgraded.
[0068] For example, the first device can obtain a firmware upgrade synthesis package of the second device, which includes module upgrade files of multiple modules of the second device, and determine the firmware version of each firmware upgrade file in the module upgrade text file of each module according to the firmware upgrade synthesis package.
[0069] The firmware versions of the applications of each module of the second device and the firmware versions of each firmware upgrade file in the corresponding module upgrade text file are obtained to determine the module that needs to be upgraded, that is, the module to be upgraded.
[0070] And determine the target module currently undergoing firmware upgrade from the modules to be upgraded.
[0071] After the module upgrade file is sent to the target module through the control module, it can be checked whether the target module has completed the firmware upgrade. If the target module has completed the firmware upgrade, the firmware upgrade can be performed on other modules of the second device. That is, in one embodiment, after the step of "sending the upgrade data packet to the control module of the second device according to the module upgrade file, and sending the upgrade data packet to the target module through the control module", the method further includes:
[0072] Obtain the firmware version currently applied by each firmware of the target module through the control module;
[0073] If the firmware version currently applied to each firmware of the target module is the same as the firmware version of each firmware upgrade file in the module upgrade text file, a new target module is determined from the modules to be upgraded;
[0074] Return to the step of obtaining the module upgrade file of the target module until the firmware of each module to be upgraded of the second device is upgraded.
[0075] For example, the first device can obtain the firmware version currently applied by each firmware of the target module through the control module; compare the firmware version currently applied by each firmware of the target module with the version of the firmware upgrade file in the module upgrade file. If they are the same, it means that the target module has completed the firmware upgrade, and a new target module is determined from the modules to be upgraded, and return to execute step 101, obtain the module upgrade file of the new target module, and based on the module upgrade file of the new target module, perform firmware upgrade on the new target module, and continue the cycle until all modules to be upgraded have completed the firmware upgrade.
[0076] In one embodiment, after the first device sends all the data upgrade packages of the module upgrade file of the target module to the target module, the target module may be requested to perform a memory check to ensure that the firmware upgrade file is written into the target module, that is, the firmware upgrade method provided in the embodiment of the present application may also include:
[0077] In response to the module upgrade file being sent, a memory check request is sent to the target module through the control module, the memory check request instructs the target module to check the written firmware upgrade file, and returns the memory check result to the first device through the control module;
[0078] The upgrade result of the target module is determined according to the memory verification result returned by the target module.
[0079] For example, the first device detects whether all upgrade data of the module upgrade file are sent to the target module. If yes, a memory check request is sent to the target module through the control module.
[0080] After receiving the memory verification request, the target module verifies the data at the write position of the firmware upgrade file for each firmware upgrade file, for example, performs byte-by-byte operations (such as accumulation, "exclusive OR" operations, etc.) on the data at the write position of the firmware upgrade file to obtain a memory verification result, and returns the memory verification result to the first device;
[0081] The first device determines the upgrade result of the target module based on the memory verification result returned by the second device. Specifically, the first device can perform the same byte-by-byte operation on the firmware upgrade file in the module upgrade file as the target module, and compare the operation result with the memory verification result returned by the target module. If they are consistent, the target module completes the firmware upgrade.
[0082] In one embodiment, the module upgrade file is generated by the following steps:
[0083] Acquire multiple firmware upgrade files of the second device, and upgrade information of each firmware upgrade file, where the upgrade information may include the size, write location, etc. of the firmware upgrade file; group the multiple firmware upgrade files of the second device to obtain at least two firmware upgrade files corresponding to each module; generate a firmware list for each module according to the upgrade information of the at least two firmware upgrade files corresponding to each module; merge the at least two firmware upgrade files of each module to obtain a merged firmware upgrade file corresponding to each module; generate a module upgrade file for each module based on the merged firmware upgrade file and the firmware list of each module.
[0084] As can be seen from the above, the embodiment of the present application obtains the module upgrade file of the target module in the second device, and the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; sends an upgrade data packet to the control module of the second device according to the module upgrade file, and sends the upgrade data packet to the target module through the control module, so that the target module upgrades at least two firmwares. This can achieve the upgrade of multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the firmware upgrade efficiency.
[0085] The embodiment of the present application also provides another firmware upgrade method, which is applied to a target module of a second device. The second device may further include a control module. The second device may be a device that requires firmware upgrade, such as a vehicle. The following description will be made from the perspective of a second firmware upgrade device. The second firmware upgrade device may be specifically integrated in the target module, such as Figure 3 As shown, the specific process of the firmware upgrade method can be as follows:
[0086] 201. Receive an upgrade data packet sent by a first device through a control module, where the upgrade data packet is sent by the first device based on a module upgrade file of a target module, where the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0087] For example, the target module can control the upgrade data packet sent by the module, and the upgrade data packet sent by the control module can be sent by the first device based on the module upgrade file of the target module. The module upgrade file includes firmware upgrade files of at least two firmware of the target module. The first device divides the data of the module upgrade firmware to obtain multiple upgrade data packets.
[0088] 202. Determine a writing location for the upgrade data package.
[0089] For example, the target module of the second device determines the firmware corresponding to the upgrade data packet, and determines the writing position of the upgrade data packet according to the corresponding firmware.
[0090] Optionally, the target module may determine the write location of the upgrade data packet according to the firmware list sent by the first device through the control module. The firmware list may include the upgrade data packet sent by the first device through the control module, and may be specifically included in the first upgrade data packet. That is, in one embodiment, the upgrade data includes the first upgrade data packet and the second upgrade data packet. The first upgrade data packet includes the firmware list, and the second upgrade data packet includes part of the data of the firmware upgrade file. The step of "determining the write location of the upgrade data packet" may include:
[0091] Determine a writing position of a second upgrade data packet according to the firmware list in the first upgrade data packet;
[0092] Step 203, "writing the upgrade data packet according to the writing position", includes:
[0093] The second upgrade data packet is written in the target module according to the write position.
[0094] The target module can obtain a firmware list by parsing the first upgrade data packet, determine the write position of each second upgrade data in the target module based on the firmware list, and write the second upgrade data packet in the target module according to the write position.
[0095] 203. Write an upgrade data packet according to the write position to upgrade at least two firmwares of the target module.
[0096] For example, the target module may write data upgrade packages one by one according to the write addresses of the data upgrade packages, so as to upgrade at least two firmwares on the target module.
[0097] The module upgrade file can be split into multiple upgrade data packets, and the multiple upgrade data packets are sent to the target module in sequence. Each upgrade data packet can be sent to the target module after the previous upgrade data packet is written to the target module. That is, in one embodiment, after the step of "writing the upgrade data packet according to the write position", the firmware upgrade method provided in the embodiment of the present application also includes:
[0098] In response to the completion of writing the upgrade data packet, a feedback signal is sent to the first device through the control module, where the feedback signal is used to instruct the first device to send a next upgrade data packet;
[0099] Return to the step of receiving the upgrade data packet sent by the first device through the control module of the second device until the upgrade data packet corresponding to the module upgrade file is sent completely.
[0100] For example, after writing the upgrade data packet in the chip in the target module according to the write position, the target module sends a feedback signal to the control module, and the control module sends the feedback signal to the first device. The feedback signal can instruct the first device to send the next upgrade data packet. After receiving the feedback signal, the first device can send the next upgrade data packet. The target module receives the next upgrade data packet sent by the first device, and after the upgrade data packet is written, it sends feedback information to the first device, and the cycle continues until the upgrade data packets of the module upgrade file are sent to the target module.
[0101] As can be seen from the above, the embodiment of the present application receives an upgrade data packet sent by the first device through the control module, the upgrade data packet is sent by the first device based on the module upgrade file of the target module, and the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; determines the write location of the upgrade data packet; writes the upgrade data packet according to the write location to upgrade at least two firmwares of the target module; it can be achieved that multiple firmwares in the target module of the second device can be upgraded through one module upgrade file, thereby improving the efficiency of firmware upgrade.
[0102] The present application embodiment also provides another firmware upgrade method, which is applied to the control module of the second device. The second device may also include a target module of the firmware to be upgraded. This embodiment will be described from the perspective of a firmware upgrade device, which may be specifically integrated in the control module, such as Figure 4 As shown, the specific process of the firmware upgrade method can be as follows:
[0103] 301. Receive an upgrade data packet sent by a first device based on a module upgrade file of a target module, where the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0104] The first device may communicate indirectly with the target module of the second device through the control module of the second device, and the first device sends an upgrade data packet of the module upgrade file to the control module of the second device.
[0105] 302. Send an upgrade data packet to a target module, so that the target module upgrades at least two firmwares.
[0106] The control module sends the upgrade data packet to the target module so that the target module writes the data upgrade packet to upgrade at least two firmwares on the target module.
[0107] The upgrade data packet sent by the first device may be obtained by splitting the module upgrade file based on a preset data volume threshold, and the data volume of the upgrade data packet is less than or equal to the data volume threshold.
[0108] The first device may also send an upgrade data packet according to the data volume limit of the target module for the data packet. The first device may obtain the receiving data volume threshold of the target module for the upgrade data packet through a data volume confirmation request. That is, in one embodiment, before the step of "receiving the upgrade data packet sent by the first device based on the module upgrade file of the target module", the firmware upgrade method provided in the embodiment of the present application may also include:
[0109] receiving a data volume confirmation request sent by the first device;
[0110] According to the data volume confirmation request, the target module is determined to receive a data volume threshold for the upgrade data packet according to the memory information of the target module and the total data volume of the module upgrade file;
[0111] The received data volume threshold is returned to the first device to instruct the first device to split the module upgrade file based on the received data volume threshold to obtain multiple upgrade data packets.
[0112] The first device can send a data volume confirmation request to the control module. After receiving the data volume control request, the control module determines the receiving data volume threshold of the target module for the upgrade data packet based on the memory information of the target module and the total data volume of the module upgrade file, and returns the receiving data volume threshold to the first device.
[0113] The received data volume threshold may be pre-set according to the memory information of the target module, and the control module obtains the preset received data volume threshold by querying from the memory based on the identifier of the target module.
[0114] The control module can also be determined based on the memory information of the target module (for example, memory usage). For example, the target module requires that the total number of upgrade data packets of the module upgrade file must not exceed a preset data packet number threshold. In this case, the control module can calculate the maximum data volume of each upgrade data packet based on the total number of module upgrade files and the preset packet number threshold to obtain the received data volume threshold, or the control module can determine the size of the data packet that the target module can receive based on the memory usage of the target module to obtain the received data volume threshold.
[0115] After the first device receives the data volume threshold, it can split each firmware upgrade file in the module upgrade file of the target module into multiple upgrade data packets according to the target module's receiving data volume threshold for the upgrade data packet, and the data volume of each upgrade data packet is less than or equal to the data volume threshold.
[0116] As can be seen from the above, the embodiment of the present application receives an upgrade data packet sent by the first device based on a module upgrade file of the target module, and the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; sends the upgrade data packet to the target module so that the target module upgrades at least two firmwares; it can be achieved by upgrading multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the efficiency of firmware upgrade.
[0117] On the basis of the above embodiments, in order to more clearly illustrate the firmware upgrade method provided by the present application, the following further illustrates the interaction between the first device, the target module of the second device, and the control module of the second device. Figure 5 As shown, the interaction process between the first device, the target module of the second device and the control module of the second device may be as follows:
[0118] The first device obtains module upgrade files of multiple modules of the second device from the server, and numbers each firmware upgrade file in the module upgrade files according to the numbering agreed with the second device.
[0119] The first device obtains the firmware version of each module on the second device through the control module, compares the firmware version of each module on the second device with the firmware version of the firmware upgrade file, and determines the module to be upgraded on the second device.
[0120] The first device sends a security verification request related to firmware upgrade to the control module.
[0121] The control module generates a security verification code and returns it to the first device.
[0122] The first device post-encrypts the security verification code and sends the encrypted security verification code to the control module.
[0123] After receiving the encrypted security verification code, the control module decrypts the encrypted security verification code, compares the decrypted security verification code with the locally retained security verification code, and returns the comparison result to the second device.
[0124] If the security verification passes, the first device determines a target module from the modules to be upgraded.
[0125] The first device sends a storage area erasing instruction to the control module.
[0126] After receiving the instruction, the control module instructs the target module to erase the data in the area to be written into the firmware upgrade file.
[0127] After the target module completes erasing, it sends the erasing result to the control module, and the control module then feeds back the erasing result to the first device.
[0128] After receiving the result of successful erasure, the first device sends a data volume confirmation request to the control module.
[0129] After receiving the data volume confirmation request, the control module feeds back a received data volume threshold.
[0130] The first device splits the upgrade firmware file into a plurality of upgrade data packets according to the fed-back received data amount threshold.
[0131] The first device sends the upgrade data packets to the control module in sequence. The control module sends the upgrade data packets to the target module each time it receives an upgrade data packet.
[0132] The target module parses the upgrade data packet and extracts the firmware list.
[0133] After the target module obtains the firmware list, the first device continues to send the unsent upgrade package data to the control module in sequence.
[0134] After receiving each packet of data, the control module transmits the data to the target module.
[0135] The target module writes the corresponding firmware to the corresponding location according to the list information, and feeds back the writing result to the control module after the writing is completed, and the control module feeds back the writing result to the first device.
[0136] The first device checks whether all data upgrade packages of the target module have been sent, and if not, continues to send the upgrade data package. If the upgrade data package has been sent, a memory check request is sent to the target module.
[0137] After receiving the memory verification request, the control module sends the memory verification request to the target module. After receiving the memory verification request, the target module performs memory verification and feeds back the verification result to the control module, which then feeds back the result to the first device.
[0138] The first device sends a firmware version acquisition request to read the firmware of the target module. After receiving the request from the first device, the control module sends a firmware version acquisition request to the target module. After receiving the firmware version acquisition request, the target module sends the firmware version of each firmware to the control module in the negotiated format, and the control module then feeds back the firmware version to the first device.
[0139] After receiving the firmware version of the target module, the first device compares it with the latest firmware version. If they are consistent, the firmware upgrade of the target module is completed.
[0140] The first device checks whether all modules to be upgraded have completed the firmware upgrade. If there are still modules whose firmware has not been upgraded, the firmware upgrade is performed on the modules whose firmware upgrade has not been completed.
[0141] In order to better implement the firmware upgrade method provided in the embodiment of the present application, a firmware upgrade device is also provided in one embodiment. The meanings of the terms are the same as those in the above firmware upgrade method, and the specific implementation details can refer to the description in the method embodiment.
[0142] The firmware upgrade device may be integrated in the first device, such as Figure 6 As shown, the firmware upgrade device may include: an acquisition unit 401 and a first sending unit 402, which are specifically as follows:
[0143] (1) An acquisition unit 401 is configured to acquire a module upgrade file of a target module in a second device, where the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0144] (2) A first sending unit 402 is used to send an upgrade data packet to a control module of a second device according to the module upgrade file, and send the upgrade data packet to a target module through the control module, so that the target module upgrades at least two firmwares.
[0145] In one embodiment, the module upgrade file further includes a first upgrade data packet and a second upgrade data packet, the first upgrade data packet includes a firmware list, and the second upgrade data packet includes partial data of the firmware upgrade file;
[0146] The first sending unit 402 may also be used for:
[0147] Sending a first upgrade data packet to a control module, and sending the first upgrade data packet to a target module through the control module, wherein the firmware list includes a write position of each firmware upgrade file in the target module;
[0148] The plurality of second upgrade data packets are sequentially sent to the target module through the control module, so that the target module writes the second upgrade data packets into the target module based on the writing position in the firmware list.
[0149] In one embodiment, the firmware upgrade device may further include:
[0150] A threshold determination unit, used to determine a threshold value of a received data volume of a target module for an upgrade data packet;
[0151] The splitting unit is used to split each firmware upgrade file in the module upgrade file of the target module according to the received data amount threshold value to obtain multiple upgrade data packets.
[0152] In one embodiment, the firmware upgrade device may further include:
[0153] A composite package acquisition unit, used to acquire a firmware upgrade composite package of the second device, wherein the firmware upgrade composite package includes module upgrade files of multiple modules of the second device;
[0154] A module determination unit, configured to determine a module to be upgraded of the second device according to a firmware version of each module application in the second device and a firmware version of a module upgrade file;
[0155] The selection unit is used to determine a target module from the modules to be upgraded.
[0156] In one embodiment, the firmware upgrade device may further include:
[0157] A version acquisition unit, used to acquire the firmware version currently applied by each firmware of the target module through the control module;
[0158] A module determination unit, configured to determine a new target module from the modules to be upgraded if the firmware version currently applied to each firmware of the target module is the same as the firmware version of each firmware upgrade file in the module upgrade text file;
[0159] The loop unit is used to return to the step of obtaining the module upgrade file of the target module until the firmware of each module to be upgraded of the second device is upgraded.
[0160] In one embodiment, the firmware upgrade device may further include:
[0161] A memory verification unit, configured to send a memory verification request to a target module through a control module in response to completion of sending the module upgrade file, wherein the memory verification request instructs the target module to verify the written firmware upgrade file, and returns a memory verification result to the first device through the control module;
[0162] The result determination unit is used to determine the upgrade result of the target module according to the memory verification result returned by the target module.
[0163] As can be seen from the above, the embodiment of the present application obtains the module upgrade file of the target module in the second device through the acquisition unit 401, and the module upgrade file includes firmware upgrade files corresponding to at least two firmware in the target module; the first sending unit 402 sends the upgrade data packet to the control module of the second device according to the module upgrade file, and sends the upgrade data packet to the target module through the control module, so that the target module upgrades at least two firmwares. It can be achieved that multiple firmwares in the target module of the second device can be upgraded through one module upgrade file, thereby improving the firmware upgrade efficiency.
[0164] In order to better implement the firmware upgrade method provided in the embodiment of the present application, a firmware upgrade device is also provided in one embodiment. The meanings of the terms are the same as those in the above firmware upgrade method, and the specific implementation details can refer to the description in the method embodiment.
[0165] The firmware upgrade device can be specifically integrated in a target module of a second device, and the second device also includes a control module, such as Figure 7 As shown, the firmware upgrade device may include: a first receiving unit 501, a determining unit 502 and an upgrading unit 503, which are specifically as follows:
[0166] (1) A first receiving unit 501 is configured to receive an upgrade data packet sent by a first device through a control module, wherein the upgrade data packet is sent by the first device based on a module upgrade file of a target module, wherein the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0167] (2) A determination unit 502 is used to determine a writing position of the upgrade data package.
[0168] (3) An upgrading unit 503, used to write an upgrading data packet according to a writing position to upgrade at least two firmwares of a target module.
[0169] In one embodiment, the determining unit 502 is further configured to:
[0170] Determine a writing position of a second upgrade data packet according to the firmware list in the first upgrade data packet;
[0171] The upgrading unit 503 is further used for:
[0172] The second upgrade data packet is written in the target module according to the write position.
[0173] In one embodiment, the firmware upgrade device may further include:
[0174] A feedback unit, configured to send a feedback signal to the first device through the control module in response to completion of writing the upgrade data packet, wherein the feedback signal is used to instruct the first device to send a next upgrade data packet;
[0175] The data packet receiving unit is used to return to the step of receiving the upgrade data packet sent by the first device through the control module of the second device until the upgrade data packet corresponding to the module upgrade file is sent completely.
[0176] As can be seen from the above, the embodiment of the present application receives an upgrade data packet sent by the first device through the control module through the first receiving unit 501, and the upgrade data packet is sent by the first device based on the module upgrade file of the target module, and the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; the determination unit 502 determines the write position of the upgrade data packet; the upgrade unit 503 writes the upgrade data packet according to the write position to upgrade at least two firmwares of the target module; it can be achieved that multiple firmwares in the target module of the second device can be upgraded through one module upgrade file, thereby improving the efficiency of firmware upgrade.
[0177] In order to better implement the firmware upgrade method provided in the embodiment of the present application, a firmware upgrade device is also provided in one embodiment. The meanings of the terms are the same as those in the above firmware upgrade method, and the specific implementation details can refer to the description in the method embodiment.
[0178] The firmware upgrade device may be specifically integrated into a control module of a second device, and the second device also includes a target module of the firmware to be upgraded, such as Figure 8 As shown, the firmware upgrade device may include: a second receiving unit 601 and a second sending unit 602, specifically as follows:
[0179] (1) A second receiving unit 601 is configured to receive an upgrade data packet sent by the first device based on a module upgrade file of a target module, where the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0180] (2) A second sending unit 602 is used to send an upgrade data packet to a target module, so that the target module upgrades at least two firmwares.
[0181] In one embodiment, the firmware upgrade device may further include:
[0182] A request receiving unit, configured to receive a data volume confirmation request sent by a first device;
[0183] A threshold calculation unit, used to confirm the request according to the data volume, and determine the receiving data volume threshold of the target module for the upgrade data packet according to the memory information of the target module and the total data volume of the module upgrade file;
[0184] The threshold value returning unit is used to return the received data volume threshold value to the first device to instruct the first device to split the module upgrade file based on the received data volume threshold value to obtain multiple upgrade data packets.
[0185] As can be seen from the above, the embodiment of the present application receives an upgrade data packet sent by the first device based on the module upgrade file of the target module through the second receiving unit 601, and the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; the second sending unit 602 sends the upgrade data packet to the target module so that the target module upgrades at least two firmwares; it is possible to upgrade multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the efficiency of firmware upgrade.
[0186] The present application also provides a device, such as Fig. 9 As shown, it shows a schematic diagram of the structure of the device involved in the embodiment of the present application, specifically:
[0187] The device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will appreciate that Fig. 9 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0188] in:
[0189] The processor 1001 is the control center of the device. It uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it executes various functions of the device and processes data, thereby monitoring the device as a whole. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and computer programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.
[0190] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0191] The device also includes a power supply 1003 for supplying power to each component. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0192] The device may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0193] Although not shown, the device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 1001 in the device will load the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002, thereby realizing various functions, as follows:
[0194] Obtaining a module upgrade file of a target module in a second device, where the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0195] Sending an upgrade data packet to a control module of a second device according to the module upgrade file, and sending the upgrade data packet to a target module through the control module, so that the target module upgrades at least two firmwares;
[0196] or:
[0197] Receive an upgrade data packet sent by the first device through the control module, where the upgrade data packet is sent by the first device based on a module upgrade file of a target module, where the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0198] Determine the writing location of the upgrade data package;
[0199] An upgrade data packet is written according to the write position to upgrade at least two firmwares of the target module.
[0200] Or:
[0201] Receiving an upgrade data packet sent by the first device based on a module upgrade file of a target module, where the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0202] The upgrade data packet is sent to the target module, so that the target module upgrades at least two firmwares.
[0203] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.
[0204] As can be seen from the above, the embodiment of the present application can upgrade multiple firmware in the target module of the second device through one module upgrade file, thereby improving the efficiency of firmware upgrade.
[0205] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the device executes the methods provided in various optional implementations in the above-mentioned embodiments.
[0206] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0207] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute any firmware upgrade method provided in the embodiment of the present application.
[0208] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0209] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0210] Since the computer program stored in the computer-readable storage medium can execute any one of the firmware upgrade methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the firmware upgrade methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0211] The above is a detailed introduction to a firmware upgrade method, device, equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A firmware upgrade method, characterized in that: Applied to a first device, the method includes: Obtain a module upgrade file of a target module in a second device, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; An upgrade data packet is sent to the control module of the second device according to the module upgrade file, and the upgrade data packet is sent to the target module through the control module, so that the target module upgrades the at least two firmwares.
2. The method according to claim 1, characterized in that The module upgrade file also includes a first upgrade data packet and a second upgrade data packet, the first upgrade data packet includes a firmware list, and the second upgrade data packet includes part of the data of the firmware upgrade file; The step of sending an upgrade data packet to a control module of the second device according to the module upgrade file, and sending the upgrade data packet to the target module through the control module, comprises: Sending a first upgrade data packet to the control module, and sending the first upgrade data packet to the target module through the control module, wherein the firmware list includes a write position of each firmware upgrade file in the target module; A plurality of second upgrade data packets are sequentially sent to the target module through the control module, so that the target module writes the second upgrade data packets into the target module based on the writing position in the firmware list.
3. The method according to claim 1, characterized in that Before sending the upgrade data packet to the control module of the second device according to the module upgrade file, the method further includes: Determine a threshold value of the amount of data received by the target module for the upgrade data packet; According to the received data amount threshold, each of the firmware upgrade files in the module upgrade file of the target module is split and processed to obtain multiple upgrade data packets.
4. The method according to claim 1, characterized in that: Before obtaining the module upgrade file of the target module in the second device, the method further includes: Acquire a firmware upgrade synthesis package of the second device, wherein the firmware upgrade synthesis package includes module upgrade files of multiple modules of the second device; Determining the module to be upgraded of the second device according to the firmware version of each module application in the second device and the firmware version of the module upgrade file; The target module is determined from the modules to be upgraded.
5. The method according to claim 4, characterized in that After sending the upgrade data packet to the control module of the second device according to the module upgrade file and sending the upgrade data packet to the target module through the control module, the method further includes: Acquire the firmware version currently applied by each firmware of the target module through the control module; If the firmware version currently applied to each firmware of the target module is the same as the firmware version of each firmware upgrade file in the module upgrade text file, then determining a new target module from the module to be upgraded; Return to the step of obtaining the module upgrade file of the target module until the firmware of each module to be upgraded of the second device is upgraded.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to the module upgrade file being sent, a memory check request is sent to the target module through the control module, the memory check request instructs the target module to check the written firmware upgrade file, and returns the memory check result to the first device through the control module; The upgrade result of the target module is determined according to the memory verification result returned by the target module.
7. A firmware upgrade method, characterized in that: A target module applied to a second device, wherein the second device further includes a control module, and the method includes: receiving an upgrade data packet sent by the first device through the control module, wherein the upgrade data packet is sent by the first device based on a module upgrade file of the target module, wherein the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; Determining a writing position of the upgrade data packet; The upgrade data packet is written according to the write position to upgrade the at least two firmwares of the target module.
8. The method according to claim 7, characterized in that The upgrade data includes a first upgrade data packet and a second upgrade data packet, the first upgrade data packet includes a firmware list, and the second upgrade data packet includes partial data of the firmware upgrade file, and determining the write location of the upgrade data packet includes: Determining a writing location of the second upgrade data packet according to the firmware list in the first upgrade data packet; Writing the upgrade data packet according to the write position includes: The second upgrade data packet is written into the target module according to the write position.
9. The method according to claim 8, characterized in that After writing the upgrade data packet according to the write position, the method further includes: In response to completion of writing the upgrade data packet, sending a feedback signal to the first device through the control module, wherein the feedback signal is used to instruct the first device to send a next upgrade data packet; Return to the step of receiving the upgrade data packet sent by the first device through the control module of the second device until the upgrade data packet corresponding to the module upgrade file is sent completely.
10. A firmware upgrade method, characterized in that: A control module applied to a second device, wherein the second device further comprises a target module of firmware to be upgraded, and the method comprises: Receiving an upgrade data packet sent by the first device based on a module upgrade file of the target module, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; The upgrade data packet is sent to the target module, so that the target module upgrades the at least two firmwares.
11. The method according to claim 10, characterized in that Before receiving the upgrade data packet sent by the first device based on the module upgrade file of the target module, the method further includes: receiving a data volume confirmation request sent by the first device; Determine, according to the data volume confirmation request, a data volume threshold for receiving the upgrade data packet of the target module according to the memory information of the target module and the total data volume of the module upgrade file; The received data volume threshold is returned to the first device to instruct the first device to split the module upgrade file based on the received data volume threshold to obtain multiple upgrade data packets.
12. A firmware upgrade device, integrated in a first device, characterized in that: The device comprises: An acquisition unit, configured to acquire a module upgrade file of a target module in a second device, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; The first sending unit is used to send an upgrade data packet to the control module of the second device according to the module upgrade file, and send the upgrade data packet to the target module through the control module, so that the target module upgrades the at least two firmwares.
13. A firmware upgrade device, integrated in a target module of a second device, wherein the second device further comprises a control module, characterized in that: The device comprises: A first receiving unit is used to receive an upgrade data packet sent by the first device through the control module, wherein the upgrade data packet is sent by the first device based on a module upgrade file of the target module, and the target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; A determination unit, used to determine a writing position of the upgrade data packet; An upgrading unit is used to write the upgrading data packet according to the writing position to upgrade the at least two firmwares of the target module.
14. A firmware upgrade device, integrated in a control module of a second device, wherein the second device further comprises a target module of firmware to be upgraded, characterized in that: The device comprises: A second receiving unit, configured to receive an upgrade data packet sent by the first device based on a module upgrade file of the target module, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module; The second sending unit is used to send the upgrade data packet to the target module, so that the target module upgrades the at least two firmwares.
15. A device, characterized in that It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the firmware upgrade method according to any one of claims 1 to 11.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the firmware upgrade method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Single-chip microcomputer firmware upgrading method and device, computer equipment and storage medium
CN112379901A
Firmware upgrading method and device, electronic equipment and storage medium
CN114115978A
Firmware upgrading method and device, computing equipment and storage medium
CN115686590A
CPLD (Complex Programmable Logic Device) chip firmware upgrading method
CN116578322A
Firmware upgrading method, electronic equipment and storage medium
CN117369847A