Firmware upgrade methods, apparatus, devices and computer-readable storage media
By acquiring and utilizing the module upgrade file sent by the control module, multiple firmware updates can be performed simultaneously, solving the problem of low firmware upgrade efficiency in existing technologies and improving upgrade efficiency.
Patent Information
- Application Number
- CN202411522151.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-10-29
AI Technical Summary
In the existing technology, the firmware upgrade efficiency of device modules is low, requiring the acquisition of upgrade packages one by one for each upgrade, resulting in low efficiency.
By obtaining the module upgrade files of the target module, including firmware upgrade files of multiple firmwares, the control module sends the upgrade data packet to the target module for upgrade, thereby achieving simultaneous upgrade of multiple firmwares.
It improves the efficiency of firmware upgrades, enabling the upgrading of multiple firmware versions through a single module upgrade file, thereby increasing the overall upgrade speed.
Smart Images

Figure CN119781790B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of firmware upgrades, and more particularly to a firmware upgrade method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] When upgrading the firmware of modules on a device, it is necessary to obtain the upgrade package of each firmware to be upgraded from the server one by one, and then upgrade each firmware one by one, which is inefficient. Summary of the Invention
[0003] This application provides a firmware upgrade method, apparatus, device, and computer-readable storage medium, which can improve firmware upgrade efficiency.
[0004] To achieve the above objectives, according to a first aspect of this application, a firmware upgrade method is provided, applied to a first device, the method comprising:
[0005] Obtain the module upgrade file of the target module in the second device, wherein the module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module;
[0006] The upgrade data packet is sent to the control module of the second device according to the module upgrade file, and then sent to the target module through the control module, so that the target module can upgrade the at least two firmwares.
[0007] According to a second aspect of this application, another firmware upgrade method is provided, applied to a target module of a second device, the second device further comprising a control module, the method comprising:
[0008] The system 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. The target upgrade file includes firmware upgrade files corresponding to at least two firmware components in the target module.
[0009] Determine the write location of the upgrade data packet;
[0010] The upgrade data packet is written according to the write location to upgrade the at least two firmware files of the target module.
[0011] According to a third aspect of this application, another firmware upgrade method is provided, applied to the control module of a second device, the second device further comprising a target module for firmware to be upgraded, the method comprising:
[0012] Receive an upgrade data packet sent by a 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 firmware files.
[0014] According to a fourth aspect of this application, a firmware upgrade device is provided, integrated into a first device, the device comprising:
[0015] The acquisition unit is used to acquire the module upgrade file of the target module in the 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 configured 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 firmware files.
[0017] According to a fifth aspect of this application, another firmware upgrade device is provided, integrated into a target module of a second device, the second device further comprising a control module, the device comprising:
[0018] The first receiving unit is configured to receive 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. The target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0019] A determining unit is used to determine the write location of the upgrade data packet;
[0020] An upgrade unit is configured to write the upgrade data packet according to the write location to upgrade the at least two firmware files of the target module.
[0021] According to a sixth aspect of this application, yet another firmware upgrade device is provided, integrated into the control module of a second device, the second device further comprising a target module for firmware to be upgraded, the device comprising:
[0022] The second receiving unit is configured to receive an upgrade data packet sent by the first device based on the 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 can upgrade the at least two firmware files.
[0024] According to a seventh aspect of this application, an apparatus is provided, including a memory and a processor; the memory stores a computer program, and the processor is configured to run the computer program in the memory to perform any of the firmware upgrade methods provided in the embodiments of this application.
[0025] According to an eighth aspect of this application, a computer-readable storage medium is provided for storing a computer program, which is loaded by a processor to execute any of the firmware upgrade methods provided in the embodiments of this application.
[0026] This application embodiment obtains the module upgrade file of the target module in the second device. The module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module. According to the module upgrade file, an upgrade data packet is sent to the control module of the second device, 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 realize the upgrade of multiple firmwares in the target module of the second device through a single module upgrade file, thereby improving the firmware upgrade efficiency. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart of the firmware upgrade method provided in the embodiments of this application;
[0029] Figure 2 This is a schematic diagram of the framework of the module upgrade file provided in the embodiments of this application;
[0030] Figure 3 This is another flowchart of the firmware upgrade method provided in the embodiments of this application;
[0031] Figure 4 This is another flowchart of the firmware upgrade method provided in the embodiments of this application;
[0032] Figure 5 This is an interactive flowchart of the firmware upgrade method provided in the embodiments of this application;
[0033] Figure 6 This is a schematic diagram of the firmware upgrade device provided in the embodiments of this application;
[0034] Figure 7 This is a schematic diagram of another firmware upgrade device provided in an embodiment of this application;
[0035] Figure 8 This is a schematic diagram of another firmware upgrade device provided in the embodiments of this application;
[0036] Figure 9 This is a schematic diagram of the device provided in the embodiments of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] This application provides a firmware upgrade method, apparatus, device, and computer-readable storage medium. The firmware upgrade apparatus can be integrated into a device.
[0039] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0040] This application provides a firmware upgrade method applied to a first device, which may be a terminal or other device. The following description will focus on a first firmware upgrade device, which can be integrated into the device itself. Figure 1 As shown, the specific process of this firmware upgrade method can be as follows:
[0041] 101. Obtain the module upgrade file of the target module in the second device. The module upgrade file includes the firmware upgrade files corresponding to at least two firmwares in the target module.
[0042] The first device and the second device can be different devices. For example, the first device can be a terminal, and the second device can be a vehicle. Alternatively, the first device and the second device can be the same device. The specific configuration can be flexibly set according to needs 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, or an electric fan control module. The UWB module can detect living information in the vehicle, the fragrance control module can control the release of fragrance in the vehicle, and the electric fan control module can be used to control the operation of the vehicle's fan.
[0044] The module upgrade file may include firmware upgrade files for at least two firmware files in the target module. After the firmware upgrade file is written to the target module, the corresponding firmware can be upgraded. For example, the module upgrade file may include firmware upgrade files for at least two of the target module's configuration file, application file, and driver file (for example, it may be a firmware upgrade package).
[0045] 102. Send upgrade data packets to the control module of the second device according to the module upgrade file, and send the upgrade data packets to the target module through the control module so that the target module upgrades at least two firmwares.
[0046] The first device can communicate indirectly 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. Through the control module of the second device, the upgrade data packet is sent to the target module. The target module writes the data upgrade packet, thereby upgrading at least two firmware on the target module.
[0047] Upgrade data packages can be obtained by dividing the data of the module upgrade firmware. Each upgrade data package includes a portion of the data in the module upgrade firmware file. Multiple module upgrade data packages corresponding to the module upgrade file can be merged to obtain the module upgrade file.
[0048] In this embodiment of the application, the module upgrade file includes firmware upgrade files for 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 firmware upgrade files for multiple firmware versions of the target module. The write location of each firmware upgrade file can be included in each upgrade data packet. After receiving the upgrade data packet, the target module 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 manifest, which may include the address of each firmware upgrade file in the module upgrade file within the target module. 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 manifest, and the second upgrade data packet includes partial data of the firmware upgrade files. 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] The first upgrade data packet is sent to the control module, and then sent to the target module through the control module. The firmware manifest includes the write location of each firmware upgrade file in the target module.
[0052] Multiple 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 to the target module based on the write position in the firmware manifest.
[0053] The module upgrade file includes a first upgrade data package and a second upgrade data package. The first upgrade data package includes a firmware manifest. There can be one or more first upgrade data packages. The number of first upgrade data packages depends on the size of the firmware manifest. If the firmware manifest is large, there can be multiple first upgrade data packages.
[0054] The second upgrade data packet may contain part of the data in the firmware upgrade file. It can be obtained by splitting the firmware upgrade file into multiple data packets with a smaller data size 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 then sends the second upgrade data packet to the target module through the control module. The target module can obtain the firmware manifest by parsing the first upgrade data packet, and can determine the write location of each second upgrade data in the target module based on the firmware manifest.
[0056] Splitting a module upgrade file into multiple data upgrade packages can be done by splitting the module upgrade file based on a preset data volume threshold, resulting in multiple upgrade data packages with a data volume less than or equal to the data volume threshold.
[0057] For example, the framework of a module upgrade package can be as follows: Figure 2 As shown, the module upgrade file includes a firmware manifest and multiple firmware upgrade files. The firmware manifest 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 target module's chip (e.g., the starting address), the number of firmware upgrade files, and the decryption key for the upgrade data package, etc.
[0058] Optionally, before the first device sends the upgrade data packet according to the data size limit of the target module and sends the upgrade data packet to the control module of the second device according to the module upgrade file, the method further includes:
[0059] Determine the threshold amount of data the target module can receive for the upgrade data packet;
[0060] Based on the threshold of received data volume, each firmware upgrade file in the target module's module upgrade file is split into multiple upgrade data packets.
[0061] The received data volume threshold is the threshold for the data length of each data packet for the target module. The received data volume threshold can be set in advance based on the memory information of the target module, or it can be determined by the control module based on the data transmission characteristics or memory usage of the target module. For example, if the total number of upgrade data packets for the module upgrade file is required to not 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 number of packets threshold to obtain the received data volume threshold. Alternatively, the data volume of the data packets that the target module can receive can be determined based on 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 target module's module upgrade file into multiple upgrade data packets based on the target module's threshold for the amount of data received for upgrade data packets. The data amount of each upgrade data packet is less than or equal to the data amount threshold.
[0063] Optionally, the first device can generate an upgrade data package from the firmware manifest and split each firmware upgrade file to obtain multiple upgrade data packages.
[0064] The module upgrade package can be a corresponding module upgrade package obtained by the first device according to the target module that the second device needs to upgrade (e.g., obtained from a server or from local storage). Optionally, it can also be extracted by the first device from the upgrade package of the second device. The upgrade package includes module upgrade files for multiple modules of the second device, and the second device obtains the module upgrade file corresponding to the target module from it. That is, in one embodiment, before the step "obtaining the module upgrade file of the target module in the second device", the firmware upgrade method provided in this application embodiment may further include:
[0065] Obtain the firmware upgrade package for the second device, which includes module upgrade files for multiple modules of the second device;
[0066] Based on the firmware version of each module in the second device and the firmware version of the module upgrade file, determine the modules of the second device to be upgraded.
[0067] Identify the target module from the modules to be upgraded.
[0068] For example, the first device can obtain the firmware upgrade package of the second device. The firmware upgrade package includes module upgrade files for multiple modules of the second device. Based on the firmware upgrade package, the firmware version of each firmware upgrade file in the module upgrade file of each module is determined.
[0069] Obtain the firmware version of each module application of the second device, as well as the firmware version of each firmware upgrade file in the corresponding module upgrade text file, and determine the module that needs to be upgraded, i.e. the module to be upgraded.
[0070] Then, determine the target module for the current firmware upgrade from the modules to be upgraded.
[0071] After the module upgrade file is sent to the target module via the control module, it can be verified whether the target module has completed the firmware upgrade. If the target module has completed the firmware upgrade, the firmware upgrades of other modules of the second device can be performed. That is, in one embodiment, after the step "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 via the control module", the method further includes:
[0072] The control module obtains the current firmware version of each firmware in the target module.
[0073] If the firmware version currently used by each firmware in the target module is the same as the firmware version of each firmware upgrade file in the module upgrade text file, then a new target module is determined from the modules to be upgraded.
[0074] Return to the step of obtaining the module upgrade file for the target module, until the firmware of each module to be upgraded on the second device is upgraded.
[0075] For example, the first device can obtain the current firmware version of each firmware of the target module through the control module; compare the current firmware version of 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. Then, a new target module is determined from the modules to be upgraded, and the execution of step 101 is returned to obtain the module upgrade file of the new target module. Based on the module upgrade file of the new target module, the firmware upgrade of the new target module is performed. This process is repeated until all modules to be upgraded have completed the firmware upgrade.
[0076] In one embodiment, after the first device sends the entire data upgrade package of the module upgrade file of the target module to the target module, it can request the target module to perform memory verification to ensure that the target module has written the firmware upgrade file. That is, the firmware upgrade method provided in this application embodiment may further include:
[0077] In response to the completion of the module upgrade file transmission, a memory verification request is sent to the target module through the control module. The memory verification request instructs the target module to verify the written firmware upgrade file and returns the memory verification result to the first device through the control module.
[0078] The upgrade result of the target module is determined based on the memory verification result returned by the target module.
[0079] For example, the first device checks whether all upgrade data in the upgrade file of the detection module has been sent to the target module. If so, it sends a memory verification request 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 each firmware upgrade file. For example, it performs byte-by-byte operations on the data at the write position of the firmware upgrade file (such as accumulation, XOR operation, etc.) to obtain the 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 on the target module, and compare the operation result with the memory verification result returned by the target module. If they match, the target module has completed the firmware upgrade.
[0082] In one embodiment, the module upgrade file is generated through the following steps:
[0083] The system acquires multiple firmware upgrade files from the second device, along with upgrade information for each file, including file size and write location. It then groups these firmware upgrade files to obtain at least two firmware upgrade files for each module. Based on the upgrade information from these two files, it generates a firmware manifest for each module. Finally, it merges these two firmware upgrade files to obtain a merged firmware upgrade file for each module. Finally, it generates a module upgrade file for each module based on the merged firmware upgrade file and the firmware manifest.
[0084] As can be seen from the above, the embodiments of this application obtain the module upgrade file of the target module in the second device, which includes firmware upgrade files corresponding to at least two firmwares in the target module; send upgrade data packets to the control module of the second device according to the module upgrade file, and send the upgrade data packets to the target module through the control module, so that the target module upgrades at least two firmwares. This can realize the upgrading of multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the firmware upgrade efficiency.
[0085] This application embodiment also provides another firmware upgrade method, applied to a target module of a second device. The second device may further include a control module. The second device can be a device requiring firmware upgrade, such as a vehicle. The following description will focus on a second firmware upgrade device, which can be integrated into the target module. Figure 3 As shown, the specific process of this firmware upgrade method can be as follows:
[0086] 201. Receive 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. 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 packets sent by the control module. The upgrade data packets 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 firmwares of the target module. The first device divides the data of the module upgrade firmware to obtain multiple upgrade data packets.
[0088] 202. Determine the write location of the upgrade data packet.
[0089] For example, the target module of the second device determines the firmware corresponding to the upgrade data packet, and determines the write location of the upgrade data packet based on the corresponding firmware.
[0090] Optionally, the target module can determine the write location of the upgrade data packet based on the firmware manifest sent by the first device through the control module. The firmware manifest may contain the upgrade data packet sent by the first device through the control module, specifically it may be included in the first upgrade data packet. That is, in one embodiment, the upgrade data includes a first upgrade data packet and a second upgrade data packet. The first upgrade data packet includes the firmware manifest, and the second upgrade data packet includes part of the firmware upgrade file data. The step "determine the write location of the upgrade data packet" may include:
[0091] Based on the firmware list in the first upgrade data package, determine the write location of the second upgrade data package;
[0092] Step 203, "Write the upgrade data packet according to the write location," includes:
[0093] Write the second upgrade data packet into the target module according to the write location.
[0094] The target module can obtain a firmware manifest by parsing the first upgrade data packet. Based on the firmware manifest, the write position of each second upgrade data in the target module can be determined, and the second upgrade data packet is written into the target module according to the write position.
[0095] 203. Write an upgrade data packet according to the write location to upgrade at least two firmware versions of the target module.
[0096] For example, the target module can write data upgrade packages one by one according to the write address of each data upgrade package, thereby upgrading at least two firmware on the target module.
[0097] The module upgrade file can be split into multiple upgrade data packets. These multiple upgrade data packets are sent sequentially to the target module. Each upgrade data packet can be sent to the target module after the previous upgrade data packet has been written to it. That is, in one embodiment, after the step "write upgrade data packets according to the writing position", the firmware upgrade method provided in this application embodiment further 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. The feedback signal is used to instruct the first device to send the 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.
[0100] For example, after writing the upgrade data packet into the chip in the target module according to the writing position, the target module sends a feedback signal to the control module. The control module sends the feedback signal to the first device, which 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 sends feedback information to the first device after the upgrade data packet is written. This process is repeated until all upgrade data packets of the module upgrade file are sent to the target module.
[0101] As can be seen from the above, this embodiment of the 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. The target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module. The write position of the upgrade data packet is determined. The upgrade data packet is written according to the write position to upgrade at least two firmwares of the target module. This can realize the upgrade of multiple firmwares in the target module of the second device through a single module upgrade file, thereby improving the firmware upgrade efficiency.
[0102] This application embodiment also provides another firmware upgrade method, applied to the control module of a second device. The second device may further include a target module for the firmware to be upgraded. This embodiment will be described from the perspective of a firmware upgrade device, which can be integrated into the control module, such as... Figure 4 As shown, the specific process of this firmware upgrade method can be as follows:
[0103] 301. Receive an upgrade data packet sent by the first device based on the 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.
[0104] The first device can communicate indirectly with the target module of the second device through the control module of the second device, and the first device sends the upgrade data packet of the module upgrade file to the control module of the second device.
[0105] 302. Send the upgrade data package to the target module so that the target module upgrades at least two firmware versions.
[0106] The control module sends the upgrade data packet to the target module so that the target module can write the data upgrade packet, thereby upgrading at least two firmware versions on the target module.
[0107] The upgrade data packet sent by the first device can 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 can also send upgrade data packets based on the data volume limit of the target module. The first device can obtain the data volume threshold for the target module to receive upgrade data packets 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 this application embodiment can also include:
[0109] Receive a data volume confirmation request sent by the first device;
[0110] Based on the data volume confirmation request, and based on the target module's memory information and the total data volume of the module upgrade file, determine the threshold for the target module to receive the upgrade data packet.
[0111] The system returns a received data volume threshold to the first device, instructing 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 data volume threshold for the target module to receive 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 data volume threshold to the first device.
[0113] The received data volume threshold can be set in advance based on the memory information of the target module. The control module obtains the preset received data volume threshold from memory based on the identifier of the target module.
[0114] The control module can also determine the data size based on the target module's memory information (e.g., memory usage). For example, if the target module requires that the total number of upgrade data packets for the module upgrade file not exceed a preset data packet number threshold, then the control module can calculate the maximum data size of each upgrade data packet based on the total number of module upgrade files and the preset data packet number threshold, thus obtaining the received data size threshold. Alternatively, the control module can determine the size of the data packets that the target module can receive based on the target module's memory usage, thus obtaining the received data size threshold.
[0115] After the first device receives the data volume threshold, it can split each firmware upgrade file in the target module's module upgrade file into multiple upgrade data packets according to the target module's data volume threshold for receiving upgrade data packets. 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 embodiments of this application receive an upgrade data packet sent by the first device based on the module upgrade file of the target module, the module upgrade file including firmware upgrade files corresponding to at least two firmwares in the target module; and send the upgrade data packet to the target module so that the target module upgrades at least two firmwares; thus, it is possible to upgrade multiple firmwares in the target module of the second device through one module upgrade file, thereby improving firmware upgrade efficiency.
[0117] Based on the above embodiments, in order to more clearly illustrate the firmware upgrade method provided in this application, the interaction between the target module of the first device and the second device and the control module of the second device is further described below, such as... Figure 5 As shown, the interaction flow between the first device, the target module of the second device, and the control module of the second device can be as follows:
[0118] The first device obtains module upgrade files for multiple modules of the second device from the server, and assigns a number to each firmware upgrade file in the module upgrade files according to the number agreed upon 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 on the second device that needs to be upgraded.
[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 performs post-encryption on 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 stored security verification code, and returns the comparison result to the second device.
[0124] If the security verification is successful, the first device will determine the target module from the modules to be upgraded.
[0125] The first device sends a storage area erase command to the control module.
[0126] Upon receiving the instruction, the control module instructs the target module to erase the data in the area to be written to the firmware upgrade file.
[0127] After the target module completes the erasure, it sends the erasure result to the control module, which then feeds back the erasure 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 will provide a data volume threshold.
[0130] The first device splits the firmware upgrade file into several upgrade data packets based on the threshold of the amount of received data.
[0131] The first device sends upgrade data packets to the control module sequentially. Each time the control module receives an upgrade data packet, it sends the upgrade data packet to the target module.
[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 undelivered upgrade package data to the control module in sequence.
[0134] Each time the control module receives a data packet, it transmits the data to the target module.
[0135] The target module writes the corresponding firmware to the corresponding location according to the manifest information. After the writing is completed, it sends the writing result back to the control module, which then sends the writing result back to the first device.
[0136] The first device checks whether all data upgrade packages for the target module have been sent. If not, it continues to send upgrade data packages. If all upgrade data packages have been sent, it sends a memory verification request to the target module.
[0137] After receiving a memory verification request, the control module sends a memory verification request to the target module. Upon receiving the memory verification request, the target module performs memory verification and sends the verification result back to the control module, which then sends the result back to the first device.
[0138] The first device sends a firmware version retrieval request to the target module. After receiving the request from the first device, the control module sends a firmware version retrieval request to the target module. After receiving the firmware version retrieval request, the target module sends the firmware versions of each firmware to the control module in the negotiated format. The control module then feeds back the firmware versions 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 match, the firmware upgrade of the target module is complete.
[0140] The first device checks whether all modules to be upgraded have completed the firmware upgrade. If there are still modules that have not completed the firmware upgrade, the firmware upgrade is performed on the modules that have not completed the firmware upgrade.
[0141] To facilitate better implementation of the firmware upgrade method provided in this application embodiment, a firmware upgrade apparatus is also provided in one embodiment. The meanings of the terms used are the same as in the firmware upgrade method described above, and specific implementation details can be found in the description of the method embodiment.
[0142] The firmware upgrade device can be integrated into 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, as detailed below:
[0143] (1) Acquisition unit 401 is used to acquire the module upgrade file of the target module in the second device. The module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0144] (2) The first sending unit 402 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 at least two firmware.
[0145] In one embodiment, the module upgrade file further includes a first upgrade data package and a second upgrade data package, the first upgrade data package including a firmware manifest, and the second upgrade data package including a portion of the firmware upgrade file;
[0146] The first transmitting unit 402 can also be used for:
[0147] The first upgrade data packet is sent to the control module, and then sent to the target module through the control module. The firmware manifest includes the write location of each firmware upgrade file in the target module.
[0148] Multiple 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 to the target module based on the write position in the firmware manifest.
[0149] In one embodiment, the firmware upgrade device may further include:
[0150] The threshold determination unit is used to determine the threshold amount of data received by the target module for the 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 volume threshold, so as to obtain multiple upgrade data packets.
[0152] In one embodiment, the firmware upgrade device may further include:
[0153] The firmware upgrade package acquisition unit is used to acquire the firmware upgrade package of the second device, which includes module upgrade files for multiple modules of the second device.
[0154] The module determination unit is used to determine the modules to be upgraded in the second device based on the firmware version of each module applied in the second device and the firmware version of the module upgrade file.
[0155] The selection unit is used to determine the target module from the modules to be upgraded.
[0156] In one embodiment, the firmware upgrade device may further include:
[0157] The version acquisition unit is used to obtain the current firmware version of each firmware of the target module through the control module;
[0158] The module determination unit is used 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 on the second device is upgraded.
[0160] In one embodiment, the firmware upgrade device may further include:
[0161] The memory verification unit is used to send a memory verification request to the target module through the control module in response to the completion of the module upgrade file sending. The memory verification request instructs the target module to verify the written firmware upgrade file and returns the 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 based on the memory verification result returned by the target module.
[0163] As can be seen from the above, in this embodiment of the application, the module upgrade file of the target module in the second device is obtained by the acquisition unit 401. The module upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module. The first sending unit 402 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 can upgrade at least two firmwares. This can realize the upgrade of multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the firmware upgrade efficiency.
[0164] To facilitate better implementation of the firmware upgrade method provided in this application embodiment, a firmware upgrade apparatus is also provided in one embodiment. The meanings of the terms used are the same as in the firmware upgrade method described above, and specific implementation details can be found in the description of the method embodiment.
[0165] The firmware upgrade device can be integrated into the target module of the second device, which 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 upgrade unit 503, as detailed below:
[0166] (1) The first receiving unit 501 is used to receive the 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. The target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0167] (2) Determine unit 502, used to determine the write location of the upgrade data packet.
[0168] (3) Upgrade unit 503 is used to write upgrade data packets according to the write position to upgrade at least two firmwares of the target module.
[0169] In one embodiment, the determining unit 502 is further configured to:
[0170] Based on the firmware list in the first upgrade data package, determine the write location of the second upgrade data package;
[0171] Upgrade unit 503 is also used for:
[0172] Write the second upgrade data packet into the target module according to the write location.
[0173] In one embodiment, the firmware upgrade device may further include:
[0174] The feedback unit is used to send a feedback signal to the first device through the control module in response to the completion of the upgrade data packet writing. The feedback signal is used to instruct the first device to send the 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.
[0176] As can be seen from the above, in this embodiment of the application, the first receiving unit 501 receives the 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. The target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module. The determining unit 502 determines the writing position of the upgrade data packet. The upgrading unit 503 writes the upgrade data packet according to the writing position to upgrade at least two firmwares of the target module. This can realize the upgrading of multiple firmwares in the target module of the second device through a single module upgrade file, thereby improving the firmware upgrade efficiency.
[0177] To facilitate better implementation of the firmware upgrade method provided in this application embodiment, a firmware upgrade apparatus is also provided in one embodiment. The meanings of the terms used are the same as in the firmware upgrade method described above, and specific implementation details can be found in the description of the method embodiment.
[0178] The firmware upgrade device can be integrated into the control module of a second device, which also includes the 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, as detailed below:
[0179] (1) The second receiving unit 601 is used to receive the upgrade data packet sent by the first device based on the 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.
[0180] (2) The second sending unit 602 is used to send the upgrade data packet to the target module so that the target module can upgrade at least two firmwares.
[0181] In one embodiment, the firmware upgrade device may further include:
[0182] A request receiving unit is used to receive a data volume confirmation request sent by the first device;
[0183] The threshold calculation unit is used to determine the threshold for the amount of data the target module can receive for the upgrade data packet based on the data volume confirmation request, the memory information of the target module, and the total data volume of the module upgrade file.
[0184] The threshold return unit is used to return the received data volume threshold to the first device, so as to instruct the first device to split the module upgrade file based on the received data volume threshold to obtain multiple upgrade data packets.
[0185] As can be seen from the above, in this embodiment of the application, the second receiving unit 601 receives the upgrade data packet sent by the first device based on the module upgrade file of the target module. 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 can upgrade at least two firmwares. This can realize the upgrading of multiple firmwares in the target module of the second device through one module upgrade file, thereby improving the firmware upgrade efficiency.
[0186] This application also provides a device, such as... Figure 9 As shown, it illustrates a structural schematic diagram of the device involved in the embodiments of this 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 understand that... Figure 9 The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0188] in:
[0189] The processor 1001 is the control center of the device, connecting various parts of the device through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1002, and by calling data stored in the memory 1002, thereby providing overall monitoring of the device. 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 handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the 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. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, 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 high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. 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 that supplies power to the various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1003 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0192] The device may also include an input unit 1004, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0193] Although not shown, the device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the device loads 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 runs the computer programs stored in the memory 1002 to realize various functions, as follows:
[0194] Obtain the module upgrade file of the target module in the second device. The module upgrade file includes the firmware upgrade files corresponding to at least two firmwares in the target module.
[0195] The upgrade data packet is sent to the control module of the second device according to the module upgrade file, and then sent to the target module through the control module so that the target module upgrades at least two firmware versions.
[0196] or:
[0197] The system 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. The target upgrade file includes firmware upgrade files corresponding to at least two firmwares in the target module.
[0198] Determine the location to write the upgrade data packet;
[0199] An upgrade data packet is written according to the write location to upgrade at least two firmware versions of the target module.
[0200] Or perhaps:
[0201] Receive an upgrade data packet sent by the first device based on the 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;
[0202] The upgrade data packet is sent to the target module so that the target module upgrades at least two firmware versions.
[0203] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0204] As can be seen from the above, the embodiments of this application can upgrade multiple firmware files in the target module of the second device through a single module upgrade file, thereby improving firmware upgrade efficiency.
[0205] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of the device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the device to perform the methods provided in the various optional implementations of the above embodiments.
[0206] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0207] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute any of the firmware upgrade methods provided in embodiments of this application.
[0208] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0209] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0210] Since the computer program stored in the computer-readable storage medium can execute any of the firmware upgrade methods provided in the embodiments of this application, the beneficial effects that any of the firmware upgrade methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0211] The firmware upgrade method, apparatus, device, and computer-readable storage medium provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A firmware upgrade method characterized by comprising: Applied to a first device, the method comprises: Obtaining a module upgrade file of a target module in a second device, the module upgrade file comprising firmware upgrade files corresponding to at least two firmwares in the target module; According to the module upgrade file, sending an upgrade data packet to a control module of the second device, and sending the upgrade data packet to the target module through the control module, so that the target module upgrades the at least two firmwares; Wherein, the module upgrade file further comprises a first upgrade data packet and a second upgrade data packet, the first upgrade data packet comprises a firmware list, and the second upgrade data packet comprises partial data of the firmware upgrade file; According to the module upgrade file, sending an upgrade data packet to a control module of the second device, and sending the upgrade data packet to the target module through the control module, so that the target module upgrades the at least two firmwares; Sending the 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 comprises a writing position of each firmware upgrade file in the target module; Sending a plurality of second upgrade data packets to the target module through the control module in sequence, so that the target module writes the second upgrade data packets into the target module based on the writing position in the firmware list.
2. The method of claim 1, wherein, Before the step of sending an upgrade data packet to a control module of the second device according to the module upgrade file, the method further comprises: Determining a receiving data amount threshold of the target module for upgrade data packets; According to the receiving data amount threshold, performing splitting processing on each firmware upgrade file in the module upgrade file of the target module to obtain a plurality of upgrade data packets.
3. The method of claim 1, wherein, Before the step of obtaining a module upgrade file of a target module in a second device, the method further comprises: Obtaining a firmware upgrade synthesis packet of the second device, wherein the firmware upgrade synthesis packet comprises module upgrade files of a plurality of modules of the second device; According to firmware versions applied by each module in the second device and firmware versions of the module upgrade files, determining modules to be upgraded of the second device; Determining the target module from the modules to be upgraded.
4. The method of claim 3, wherein, After 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, the method further comprises: Obtaining firmware versions currently applied by each firmware of the target module through the control module; If the firmware versions currently applied by each firmware of the target module are the same as firmware versions of each firmware upgrade file in the module upgrade file, determining a new target module from the modules to be upgraded; Returning to execute the step of obtaining a module upgrade file of a target module until the firmware of each module to be upgraded of the second device is upgraded.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: In response to the module upgrade file sending being completed, sending a memory check request to the target module through the control module, the memory check request instructing the target module to check the written firmware upgrade file, and returning a memory check result to the first device through the control module; Determining an upgrade result of the target module according to the memory check result returned by the target module.
6. A firmware upgrade method characterized by comprising: A target module applied to a second device, the second device further comprising a control module, the method comprising: Receiving an upgrade data packet sent by a first device through the control module, the upgrade data packet being sent by the first device based on a module upgrade file of the target module, the target upgrade file comprising firmware upgrade files corresponding to at least two firmwares in the target module; Determining a write position of the upgrade data packet; According to the write position, writing the upgrade data packet to upgrade the at least two firmwares of the target module; Wherein, the upgrade data comprises a first upgrade data packet and a second upgrade data packet, the first upgrade data packet comprises a firmware list, and the second upgrade data packet comprises part of data of the firmware upgrade file, and the determination of the write position of the upgrade data packet comprises: According to the firmware list in the first upgrade data packet, determining the write position of the second upgrade data packet; According to the write position, writing the second upgrade data packet in the target module. After the writing of the upgrade data packet according to the write position, the method further comprises:
7. The method of claim 6, wherein, In response to the upgrade data packet being written, sending a feedback signal to the first device through the control module, the feedback signal being used to instruct the first device to send a next upgrade data packet; Returning to the step of receiving the upgrade data packet sent by the first device through the control module of the second device until the sending of the upgrade data packet corresponding to the module upgrade file is completed. A control module applied to a second device, the second device further comprising a target module of a firmware to be upgraded, the method comprising:
8. A firmware upgrade method characterized by comprising: Receiving an upgrade data packet sent by a first device based on a module upgrade file of the target module, the module upgrade file comprising firmware upgrade files corresponding to at least two firmwares in the target module; Sending the upgrade data packet to the target module to enable the target module to upgrade the at least two firmwares, wherein the target module upgrading the at least two firmwares comprises: Receiving the upgrade data packet sent by the first device through the control module; Determining a write position of the upgrade data packet; According to the write position, writing the upgrade data packet to upgrade the at least two firmwares of the target module; Wherein, the upgrade data comprises a first upgrade data packet and a second upgrade data packet, the first upgrade data packet comprises a firmware list, and the second upgrade data packet comprises part of data of the firmware upgrade file, and the determination of the write position of the upgrade data packet comprises: determine a write position of the second upgrade data packet according to the firmware list in the first upgrade data packet; the writing the upgrade data packet according to the write position comprises: writing the second upgrade data packet in the target module according to the write position.
9. The method of claim 8, wherein, Before the receiving the upgrade data packet sent by the first device based on the module upgrade file of the target module, the method further comprises: receiving a data amount confirmation request sent by the first device; determining a receiving data amount threshold of the target module for the upgrade data packet according to the memory information of the target module and a total data amount of the module upgrade file according to the data amount confirmation request; returning the receiving data amount threshold to the first device to instruct the first device to split the module upgrade file based on the receiving data amount threshold to obtain a plurality of upgrade data packets.
10. A firmware upgrade device, integrated into a first device, characterized in that, The apparatus comprises: an obtaining unit, configured to obtain a module upgrade file of a target module in a second device, the module upgrade file comprising firmware upgrade files corresponding to at least two firmwares in the target module; a first sending unit, configured to send an upgrade data packet to a 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; the module upgrade file further comprises a first upgrade data packet and a second upgrade data packet, the first upgrade data packet comprising a firmware list, and the second upgrade data packet comprising partial data of the firmware upgrade files; the first sending unit is further configured to: send the first upgrade data packet to the control module, and send the first upgrade data packet to the target module through the control module, the firmware list comprising a write position of each firmware upgrade file in the target module; send a plurality of second upgrade data packets to the target module through the control module in sequence, so that the target module writes the second upgrade data packets into the target module based on the write positions in the firmware list.
11. A firmware upgrade apparatus integrated in a target module of a second device, the second device further comprising a control module, characterized in that, The apparatus comprises: a first receiving unit, configured to receive an upgrade data packet sent by a first device through a control module, the upgrade data packet being sent by the first device based on a module upgrade file of a target module, the target upgrade file comprising firmware upgrade files corresponding to at least two firmwares in the target module; a determining unit, configured to determine a write position of the upgrade data packet; an upgrading unit, configured to write the upgrade data packet according to the write position, so as to upgrade the at least two firmwares of the target module; wherein the upgrade data comprises a first upgrade data packet and a second upgrade data packet, the first upgrade data packet comprising a firmware list, and the second upgrade data packet comprising partial data of the firmware upgrade files, and the determining unit is further configured to: determine a write position of the second upgrade data packet according to the firmware list in the first upgrade data packet; the upgrading unit is further configured to: write the second upgrade data packet in the target module according to the write position.
12. A firmware upgrade apparatus integrated in a control module of a second device, the second device further comprising a target module whose firmware is to be upgraded, characterized in that, The apparatus comprises: The second receiving unit is 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 comprises firmware upgrade files corresponding to at least two firmwares in the target module. The second sending unit is configured to send the upgrade data packet to the target module, so that the target module upgrades the at least two firmwares, wherein the target module upgrading the at least two firmwares comprises: receiving the upgrade data packet sent by the first device through the control module; determining a write position of the upgrade data packet; writing the upgrade data packet according to the write position, so as to upgrade the at least two firmwares of the target module; wherein the upgrade data comprises a first upgrade data packet and a second upgrade data packet, the first upgrade data packet comprises a firmware list, and the second upgrade data packet comprises partial data of the firmware upgrade file, and the determining of the write position of the upgrade data packet comprises: determining the write position of the second upgrade data packet according to the firmware list in the first upgrade data packet; the writing of the upgrade data packet according to the write position comprises: writing the second upgrade data packet in the target module according to the write position.
13. An apparatus, comprising: The computer readable storage medium is configured to store a computer program, and the computer program is loaded by a processor to execute the firmware upgrade method in claims 1-5 or any one of claims 6-9.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store a computer program, and the computer program is loaded by a processor to execute the firmware upgrade method in claims 1-5 or any one of claims 6-9.
Citation Information
Patent Citations
Equipment upgrading method and device, computer equipment and storage medium
CN117667130A