Firmware upgrade method, device, equipment and storage medium

By using a combination method of common addresses and independent addresses in multiple devices of the same type, efficient firmware upgrades are achieved, solving the problem of low efficiency of multi-device firmware upgrades in the prior art, suitable for large-scale device deployment and enhanced system stability.

CN119739406APending Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411889841.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art is less efficient in the firmware upgrade process of multiple devices of the same type, especially when frequent upgrades are required or large amounts of devices are involved.

Method used

By detecting multiple devices of the same type connected to the serial bus, the target device that meets the firmware upgrade conditions is determined, and firmware upgrade data is sent based on the common address, while using independent addresses to monitor the upgrade progress and status in real time.

Benefits of technology

It significantly improves the efficiency of equipment firmware upgrades, realizes concurrent firmware upgrades of multiple devices of the same type, is suitable for large-scale deployment scenarios of the same type of device, and enhances the stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739406A_ABST
    Figure CN119739406A_ABST
Patent Text Reader

Abstract

The present application provides a firmware upgrade method, apparatus, device and storage medium, the method comprising: detecting multiple devices of the same type connected via a serial bus, and determining multiple target devices of the same type that meet firmware upgrade conditions; determining a universal address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; sending firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; receiving firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses in sequence, and determining that the firmware upgrade of the multiple target devices of the same type is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of embedded systems, and in particular to a firmware upgrade method, device, equipment and storage medium. Background Art

[0002] IIC bus (Inter-Integrated Circuit, two-wire serial bus) is a widely used serial communication protocol, mainly used to connect various devices. Its advantages are simple communication protocol, low cost and multi-device connection capability. In modern embedded system design, online upgrade of device firmware has become an important maintenance function. Traditional firmware upgrade methods are often performed on a single device in sequence. This method is less efficient when multiple devices of the same type coexist, especially when frequent upgrades are required or a large number of devices are involved.

[0003] Therefore, in view of the shortcomings of the prior art solutions, the present invention provides a firmware upgrade method. Summary of the invention

[0004] Based on this, it is necessary to provide a firmware upgrade method, device, equipment and storage medium to address the above technical problems.

[0005] On the one hand, a firmware upgrade method is provided, the method comprising: detecting multiple devices of the same type connected via a serial bus, and determining multiple target devices of the same type that meet firmware upgrade conditions; determining a universal address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; sending firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; receiving firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses in sequence, and determining that the firmware upgrade of the multiple target devices of the same type is completed.

[0006] Optionally, the detecting of multiple devices of the same type connected via a serial bus to determine multiple target devices of the same type that meet firmware upgrade conditions includes: obtaining the operating status and current firmware versions of the multiple devices of the same type; determining multiple target devices of the same type that meet firmware upgrade conditions based on the operating status and current firmware versions of the multiple devices of the same type, wherein the firmware upgrade conditions include being in an operating state of receiving solid-state upgrade data and the current firmware version matching the firmware upgrade data.

[0007] Optionally, after determining the universal address and the independent address corresponding to each target device of the same type based on the multiple target devices of the same type, the method further includes: determining a verification code of the firmware upgrade data based on the firmware upgrade data; and sending an identifier and a verification code of the firmware upgrade data to the multiple target devices of the same type based on the independent address, so that the multiple target devices of the same type can verify the received data based on the verification code and the identifier.

[0008] Optionally, sending firmware upgrade data to the multiple target devices of the same type based on the universal address includes: determining the size of the data packet according to the transmission rate; dividing the firmware upgrade data into multiple data packets according to the size of the data packet, wherein each data packet includes the firmware upgrade data and a check code; and sending each data packet to the multiple target devices of the same type in turn based on the universal address.

[0009] Optionally, the sequentially receiving the firmware upgrade status sent by the multiple target same-type devices based on the independent address includes: receiving the firmware upgrade status sent by the multiple target same-type devices based on the independent address, wherein the firmware upgrade status includes firmware upgrade success and firmware upgrade failure; when the firmware upgrade status is firmware upgrade failure, determining the type of the firmware upgrade failure, wherein the type of firmware upgrade failure includes data packet error and upgrade interruption; when the type of the firmware upgrade failure is upgrade interruption, based on the independent address, sending a rollback instruction to the device corresponding to the upgrade interruption status, and receiving a rollback completion message returned by the device corresponding to the upgrade interruption status; based on the universal address, resending the firmware upgrade data to the device corresponding to the upgrade interruption status; when the type of the firmware upgrade failure is data packet error, determining one or more error data packets according to the identifier of the error data packet in the firmware upgrade status; and sending the one or more error data packets to the device corresponding to the data packet error status based on the universal address.

[0010] Optionally, when the type of firmware upgrade data transmission failure is a data packet transmission error, the method further includes: determining the number of transmission errors for each data packet based on the devices whose firmware upgrade status is a data packet transmission error among the multiple target devices of the same type; determining the order of sending the data packets with transmission errors based on the number of transmission errors of the data packets; and sending the data packets with transmission errors in sequence based on the universal address in the order of the data packets with transmission errors.

[0011] Optionally, the method further includes: determining control data corresponding to each target device of the same type according to requirements of each target device of the same type; and sending the control data to each target device of the same type in sequence based on an independent address of each target device of the same type.

[0012] On the other hand, a firmware upgrade device is provided, which includes: a detection module, which is used to detect multiple devices of the same type connected through a serial bus, and determine multiple target devices of the same type that meet the firmware upgrade conditions; a configuration module, which is used to determine a general address and an independent address corresponding to each target device of the same type according to the multiple target devices of the same type; a sending module, which is used to send firmware upgrade data to the multiple target devices of the same type based on the general address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; and a receiving module, which is used to sequentially receive the firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses, and determine that the firmware upgrade of the multiple target devices of the same type is completed.

[0013] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: detecting multiple devices of the same type connected via a serial bus, and determining multiple target devices of the same type that meet firmware upgrade conditions; determining a universal address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; sending firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; and sequentially receiving the firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses, and determining that the firmware upgrade of the multiple target devices of the same type is completed.

[0014] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: detecting multiple devices of the same type connected via a serial bus, and determining multiple target devices of the same type that meet firmware upgrade conditions; determining a common address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; sending firmware upgrade data to the multiple target devices of the same type based on the common address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; and sequentially receiving the firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses, and determining that the firmware upgrade of the multiple target devices of the same type is completed.

[0015] The above-mentioned firmware upgrade method, device, equipment and storage medium, the method includes: detecting multiple devices of the same type connected through a serial bus, and determining multiple target devices of the same type that meet the firmware upgrade conditions; determining a universal address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; sending firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; sequentially receiving the firmware upgrade status sent by the multiple target devices of the same type based on the independent address, and determining that the firmware upgrade of the multiple target devices of the same type is completed; in this way, the firmware upgrade data is transmitted concurrently through the universal address, which significantly improves the efficiency of the device firmware upgrade, and realizes the concurrent firmware upgrade of multiple devices of the same type, which is particularly suitable for scenarios where large-scale devices of the same type are deployed. At the same time, the upgrade progress and status are monitored in real time through the unique address of the device, and problems that may arise during the upgrade process are discovered and resolved in a timely manner, thereby enhancing the stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flowchart of a firmware upgrade method in an embodiment;

[0017] Figure 2 A schematic diagram of address configuration of a firmware upgrade method in an embodiment;

[0018] Figure 3 A schematic diagram of upgrade status changes of a firmware upgrade method in an embodiment;

[0019] Figure 4 A schematic diagram of an upgrade process of a firmware upgrade method in an embodiment;

[0020] Figure 5 A schematic diagram of a system architecture of a firmware upgrade method in an embodiment;

[0021] Figure 6 is a structural block diagram of a firmware upgrade device in an embodiment;

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

[0023] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.

[0025] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0026] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.

[0027] In one embodiment, Figure 1 As shown, a firmware upgrade method is provided, comprising the following steps:

[0028] S101: Detect multiple devices of the same type connected via a serial bus, and determine multiple target devices of the same type that meet a firmware upgrade condition.

[0029] Here, a serial bus is a communication interface used to transmit data between devices. Its characteristic is that data is transmitted one bit by one on a line. Common serial buses include IIC, PCI (Peripheral Component Interconnect), USB (Universal Serial Bus) and SPI (Serial Peripheral Interface), etc.

[0030] Here, the same type of devices are devices with the same firmware upgrade data when performing firmware upgrade.

[0031] Among them, the firmware upgrade conditions may include the compatibility of the firmware version, the storage space of the device, the current status of the device, the power stability, the time window, the environmental conditions, etc.

[0032] Among them, the devices connected through the serial bus are embedded devices, which may include sensors, memories, PSUs (Power Supply Units), etc.

[0033] S102: Determine a universal address and an independent address corresponding to each target device of the same type according to the multiple target devices of the same type.

[0034] Here, the universal address corresponds to the same address for each device, and the independent address corresponds to a different address for each device.

[0035] Specifically, the serial bus is IIC, and the general address is GCA (General Call Address). Exemplarily, the general address may be 00x0.

[0036] In one embodiment, Figure 2 This is a schematic diagram of the address configuration in the embodiment of the present application, such as Figure 2 As shown, when the main device is a baseboard management controller and the same type of device is a PSU of the same model, three PSU devices of the same model are connected to one IIC link of the baseboard management controller: PSU1, PSU2 and PSU3. The universal addresses of PSU1, PSU2 and PSU3 are the same, which are all 0x00. Each PSU is configured with a different PSU independent address according to its different position. The independent address of PSU1 is 0xB0, the independent address of PSU2 is 0xB2, and the independent address of PSU3 is 0xB4.

[0037] S103: Sending firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same.

[0038] Specifically, the firmware upgrade data is sent once based on the universal address, and all target devices of the same type configured with the universal address independently receive and process the firmware data through the universal address.

[0039] S104: receiving firmware upgrade statuses sent by the multiple target devices of the same type based on independent addresses in sequence, and determining that firmware upgrades of the multiple target devices of the same type are completed.

[0040] Among them, the firmware upgrade status may include receiving data, integrity check, correctness check, executing upgrade, upgrade completion, upgrade failure, etc.

[0041] Here, when the firmware upgrade status of the device changes, the firmware upgrade status may be sent to the master device, or the master device may send a read instruction to the device at a preset interval to read the firmware upgrade status of the device.

[0042] It should be noted that the present application communicates with multiple devices of the same type at the same time through the universal call address mechanism of the IIC bus. By sending the firmware upgrade data once through this universal address, all devices of the same type can receive the firmware upgrade data. Through independent addresses, devices of the same type can perform status monitoring and fault-tolerant recovery on the transmission of firmware upgrade data of their respective devices.

[0043] In some specific implementations, detecting a plurality of devices of the same type connected via a serial bus and determining a plurality of target devices of the same type that meet the firmware upgrade condition includes:

[0044] Obtaining the operating status and current firmware version of the multiple devices of the same type;

[0045] According to the operating status and current firmware versions of the multiple devices of the same type, multiple target devices of the same type that meet the firmware upgrade conditions are determined, wherein the firmware upgrade conditions include being in an operating state of receiving solid-state upgrade data and the current firmware version matching the firmware upgrade data.

[0046] Here, the operating status can be idle, processing tasks, starting, stopping, fault, energy saving mode, etc.

[0047] Specifically, the running status of the device is obtained to determine whether the device can receive firmware upgrade data, the current firmware version of the device is obtained, and it is determined whether the environment of the current firmware version is compatible with the environment of the firmware upgrade data. When the device meets the running status to receive firmware upgrade data and the environment of the current firmware version of the device is compatible with the environment of the firmware upgrade data, the device meets the firmware upgrade conditions.

[0048] In this way, it can be ensured that the device can receive the firmware upgrade data and perform the firmware upgrade on the device.

[0049] In some specific implementations, after determining the universal address and the independent address corresponding to each target device of the same type according to the multiple target devices of the same type, the method further includes:

[0050] Determining a verification code of the firmware upgrade data according to the firmware upgrade data;

[0051] Based on the independent address, the identifier and the verification code of the firmware upgrade data are sent to the multiple target devices of the same type, so that the multiple target devices of the same type verify the received data according to the verification code and the identifier.

[0052] Here, the check code may be a CRC (Cyclic Redundancy Check), a parity check, a checksum, a Hamming code, a hash function, or the like.

[0053] The check code may be a check code for the entire firmware upgrade data, or a check code for each fragment after the firmware upgrade data is fragmented, or may include a check code for the entire data and a check code for each fragment.

[0054] Specifically, an identifier and a verification code are generated according to the firmware upgrade data and sent to multiple target devices of the same type, so that after receiving the data, the target devices of the same type can identify whether the received data is correct firmware upgrade data according to the identifier and the verification code.

[0055] In this way, by sending the verification code and the identifier of the firmware upgrade data to the target device of the same type, it can be ensured that the target device of the same type receives the correct firmware upgrade data.

[0056] In some specific implementations, sending the firmware upgrade data to the multiple target devices of the same type based on the universal address includes:

[0057] Determine the size of the data packet based on the transmission rate;

[0058] Dividing the firmware upgrade data into a plurality of data packets according to the size of the data packet, wherein each data packet includes the firmware upgrade data and a check code;

[0059] Based on the universal address, each data packet is sent to the multiple target devices of the same type in sequence.

[0060] Here, the data packet may also include an identifier, a command word, an offset address, a data packet length, a digital signature, a log record, version information, target device information, metadata, etc.

[0061] The transmission rate is the ideal transmission rate of the serial bus, and the actual transmission rate is obtained by removing the control data and adding the necessary delay. For example, the ideal transmission rate is 10KB / s and the actual transmission rate is 5KB / s.

[0062] Specifically, the firmware upgrade data is sent to all target devices of the same type through a universal address. Each device receives the data independently. After receiving the broadcast data packet, the device first checks the checksum to confirm the validity of the data packet. When the data packet is valid, the device reads the firmware upgrade data in the data packet and stores it in the local memory. When an erroneous data packet is received, the independent address of the target device of the same type is used to inform the master device to transmit the erroneous data packet, so that the master device can retransmit it.

[0063] For example, assuming that the size of the data packet is 74 bytes, the data packet may include the following contents, such as

[0064] As shown in Table 1:

[0065]

[0066] Table 1

[0067] Among them, BYTE 0-1 of the data packet is defined as Command, which contains the upgrade command word, BYTE2-BYTE5 of the data packet is defined as offset, which contains the offset address of the data packet in the firmware, BYTE6 of the data packet is defined as maxsize, which contains the maximum content of the data packet, BYTE7 of the data packet is defined as Realsize, which contains the data length of this data packet, BYTE8-BYTE71 of the data packet is defined as DATA, which contains 64 bytes of data, and BYTE 72-73 of the data packet is defined as Checksum, which contains the checksum of the data packet.

[0068] In this way, by dividing the firmware upgrade data into data packets, it is possible to avoid the situation where all data needs to be retransmitted once a firmware upgrade data transmission error occurs, thereby improving the efficiency of fault handling.

[0069] In some specific implementations, sequentially receiving the firmware upgrade statuses sent by the multiple target devices of the same type based on independent addresses includes:

[0070] Receiving firmware upgrade status sent by the plurality of target devices of the same type based on independent addresses, wherein the firmware upgrade status includes firmware upgrade success and firmware upgrade failure;

[0071] When the firmware upgrade status is firmware upgrade failure, determining the type of the firmware upgrade failure, wherein the type of the firmware upgrade failure includes data packet error and upgrade interruption;

[0072] When the type of the firmware upgrade failure is upgrade interruption, based on the independent address, sending a rollback instruction to the device corresponding to the upgrade interruption state, and receiving a rollback completion message returned by the device corresponding to the upgrade interruption state;

[0073] Based on the universal address, resending the firmware upgrade data to the device corresponding to the upgrade interruption state;

[0074] When the type of the firmware upgrade failure is a data packet error, determining one or more error data packets according to identifiers of the error data packets in the firmware upgrade status;

[0075] Based on the universal address, the one or more error data packets are sent to a device corresponding to the error status of the data packet.

[0076] Here, the upgrade interruption may be caused by firmware writing failure, device restart or freeze, service interruption and other problems; the rollback instruction is used to instruct the device to revert to the previous stable version.

[0077] The identifier of the error data packet may be a data packet sequence number, which is used to indicate a specific error data packet.

[0078] In one embodiment, data packet errors may also include data packet loss. After receiving all data packets, the device detects the integrity of the firmware upgrade data and finds that data packets are lost. The device sends an identifier of the lost data packet to the main device and receives the lost data packet retransmitted by the main device.

[0079] In this way, when faced with errors that may occur during concurrent firmware upgrades, there is a flexible and effective processing mechanism that can not only respond and solve problems quickly, but also ensure the stability and security of the entire system.

[0080] In some specific implementations, when the type of the firmware upgrade data transmission failure is a data packet transmission error, the method further includes:

[0081] Determine the number of transmission errors of each data packet according to the device whose firmware upgrade status is a data packet transmission error among the multiple target devices of the same type;

[0082] Determining the order of sending the data packets with transmission errors according to the number of transmission errors of the data packets;

[0083] The data packets with transmission errors are sent sequentially based on the universal address in the order of the data packets with transmission errors.

[0084] Furthermore, the order of sending the data packets may also be determined based on other factors, such as the order in which the erroneous data packets are received, the importance of the data packets, etc.

[0085] In this way, based on the universal address, a data packet with a transmission error can be sent once, and multiple devices can receive the data packet, thereby improving the efficiency of handling transmission errors.

[0086] In some embodiments, the method further comprises:

[0087] Determine the control data corresponding to each target device of the same type according to the requirements of each target device of the same type;

[0088] Based on the independent address of each target same-type device, the control data is sent to each target same-type device in turn.

[0089] Here, control data refers to data used to manage and direct device behavior, which may include commands (such as starting to receive data, stopping receiving data, verifying data, etc.), configuration settings, address information (such as the specific memory location or register address where firmware upgrade data is written), status requests, end signals, etc.

[0090] Furthermore, the control data may be burned-in.

[0091] Specifically, the control data corresponding to each target device of the same type is transmitted to each target device of the same type through the independent address of each target device of the same type.

[0092] In this way, by controlling the data, precise command of the equipment can be provided, while enhancing the stability and efficiency of the entire system.

[0093] In some embodiments, the method further comprises:

[0094] According to a preset rule, a target device of the same type holding the token is determined, and a start instruction is sent to the target device of the same type holding the token through an independent address, wherein the device holding the token is one of the multiple target devices of the same type;

[0095] According to the transmission order, the token is transmitted among multiple target devices of the same type in sequence;

[0096] Based on an independent address, receive the firmware upgrade status sent by the target device of the same type holding the token.

[0097] Here, the preset rules may be the device with the lowest address, the device with the highest address, random selection, and the like.

[0098] The order of token delivery may be determined statically, such as in ascending or descending order of addresses, or may be determined dynamically, such as based on a priority algorithm.

[0099] In this way, through token passing, multiple target devices of the same type report the firmware upgrade status one by one, which can avoid the situation where multiple target devices of the same type detect errors in the data packet at the same time and try to report to the master device through their respective independent addresses, resulting in concurrent conflicts on the bus.

[0100] In one embodiment, Figure 3 Schematic diagram of the upgrade status change in the embodiment of the present application, such as Figure 3 As shown, the upgrade status changes include: upgrade preparation, transmission request, data transmission, upgrade request, execution of upgrade, upgrade completion, and restart to take effect.

[0101] Exemplarily, the upgrade process state machine corresponding to the upgrade state change may include the following contents, such as

[0102] As shown in Table 2:

[0103]

[0104]

[0105] Table 2

[0106] Among them, the macro definition of upgrade preparation is SM_ISREADY, and its current state is: ready to enter the upgrade state, and its subsequent state is: respond to the command CMD_UPLOAD_START and enter the transfer request state; the macro definition of transfer request is SM_UPLOAD_REQUESTED, and its current state is: get the request to enter the data transmission state, pass in the file size, file checksum, allocate space, and its subsequent state is: receive uploaded data; the macro definition of data transmission is SM_UPLOADING, and its current state is: receive uploaded data, and its subsequent state is: receive data transmission completion instruction; the macro definition of upgrade request is SM_UPGRA DE_REQUESTED, its current state is: data transmission completed, file verification, and its subsequent state is: receiving upgrade instructions and upgrading; the macro definition for executing upgrade is SM_UPGRADING, its current state is: upgrading, opening a new thread for upgrading, and its subsequent state is: automatically modifying the state after the upgrade is completed; the macro definition for upgrade completion is SM_UPGRADE_END, its current state is: upgrade completed, space released, and its subsequent state is: the system can be restarted; the macro definition for restart effectiveness is SM_RESET, its current state is: passing the system AC / DC restart command, and its subsequent state is: after the system restarts, entering the next upgrade cycle.

[0107] In one embodiment, Figure 4 Schematic diagram of the upgrade process in the embodiment of the present application, such as Figure 4 As shown, the upgrade process in this application includes: an initialization phase, a data transmission phase, an upgrade execution phase and an upgrade completion phase.

[0108] Specifically, the initialization phase is used for the system to detect all devices connected to the IIC bus and initialize the devices, including configuring the devices to respond to the General Call Address command, as well as upgrade data packet size, checksum and other information, in preparation for receiving firmware upgrade data. The device status changes from upgrade preparation to transmission request status.

[0109] Specifically, the data transmission phase is used by the IIC master device to send the firmware upgrade data to all devices through GCA in packets, and each device receives the data independently and performs storage processing. The state of the device changes from the transmission request state to the data transmission state. At the same time, in order to ensure the reliability of data transmission, CRC check can be used in the data packet.

[0110] Specifically, the execution upgrade phase is used for the device to verify the incoming firmware upgrade data, such as CRC verification, after receiving the complete firmware upgrade data, to ensure the integrity of the firmware upgrade data and start the firmware upgrade operation. The execution upgrade phase may include steps such as erasing the old firmware, writing the new firmware, and verifying the new firmware. The status of the device changes from the upgrade request to the execution upgrade status.

[0111] Specifically, the upgrade completion phase is used to verify all devices after the upgrade is completed to ensure that the firmware versions are consistent. The device enters the upgrade completion state, releases the used resources, and enters the restart effective state if necessary, thus ending the entire upgrade process.

[0112] In one embodiment, Figure 5 Schematic diagram of the system architecture in the embodiment of the present application. Figure 5 As shown, the system architecture includes: an IIC master device, an IIC bus, and a slave device end.

[0113] Specifically, the IIC master device is used to manage and control the entire upgrade process, including initialization configuration, data transmission control, status monitoring, etc.

[0114] Specifically, the IIC bus is used to provide multi-device addressing capabilities and support concurrent data transmission.

[0115] Specifically, the slave device is used to independently receive and process firmware data through a general call address, and to support status reporting and fault recovery through an independent address.

[0116] It should be understood that although Figure 1-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0117] In one embodiment, Figure 6 As shown, a firmware upgrade device is provided, which includes: a detection module 601, which is used to detect multiple devices of the same type connected via a serial bus, and determine multiple target devices of the same type that meet the firmware upgrade conditions; a configuration module 602, which is used to determine a universal address and an independent address corresponding to each target device of the same type according to the multiple target devices of the same type; a sending module 603, which is used to send firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; a receiving module 604, which is used to sequentially receive the firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses, and determine that the firmware upgrade of the multiple target devices of the same type is completed.

[0118] As a preferred implementation, in an embodiment of the present application, the detection module 601 is specifically used to: obtain the operating status and current firmware version of the multiple devices of the same type; determine multiple target devices of the same type that meet the firmware upgrade conditions based on the operating status and current firmware version of the multiple devices of the same type, wherein the firmware upgrade conditions include being in an operating state of receiving solid-state upgrade data and the current firmware version matching the firmware upgrade data.

[0119] As a preferred implementation, in an embodiment of the present application, the device also includes: a first processing module, the first processing module being specifically used to: determine a verification code of the firmware upgrade data based on the firmware upgrade data; based on the independent address, send an identifier and a verification code of the firmware upgrade data to the multiple target devices of the same type, so that the multiple target devices of the same type can verify the received data based on the verification code and the identifier.

[0120] As a preferred implementation, in an embodiment of the present application, the sending module 603 is specifically used to: determine the size of the data packet according to the transmission rate; divide the firmware upgrade data into multiple data packets according to the size of the data packet, wherein each data packet includes the firmware upgrade data and a check code; and send each data packet to the multiple target devices of the same type in turn based on the universal address.

[0121] As a preferred implementation, in an embodiment of the present application, the receiving module 604 is specifically used to: receive the firmware upgrade status sent by the multiple target devices of the same type based on an independent address, wherein the firmware upgrade status includes firmware upgrade success and firmware upgrade failure; when the firmware upgrade status is firmware upgrade failure, determine the type of the firmware upgrade failure, wherein the type of firmware upgrade failure includes data packet error and upgrade interruption; when the type of the firmware upgrade failure is an upgrade interruption, based on the independent address, send a rollback instruction to the device corresponding to the upgrade interruption status, and receive a rollback completion message returned by the device corresponding to the upgrade interruption status; based on the universal address, resend the firmware upgrade data to the device corresponding to the upgrade interruption status; when the type of the firmware upgrade failure is a data packet error, determine one or more error data packets according to the identifier of the error data packet in the firmware upgrade status; based on the universal address, send the one or more error data packets to the device corresponding to the data packet error status.

[0122] As a preferred implementation, in an embodiment of the present application, the receiving module 604 is further specifically used to: determine the number of transmission errors of each data packet according to the device whose firmware upgrade status is a data packet transmission error among the multiple target devices of the same type; determine the order of sending the data packets with transmission errors according to the number of transmission errors of the data packets; and send the data packets with transmission errors in sequence based on the universal address in the order of the data packets with transmission errors.

[0123] As a preferred implementation manner, in an embodiment of the present application, the device also includes: a second processing module, the second processing module being specifically used to: determine the control data corresponding to each target device of the same type according to the needs of each target device of the same type; and send the control data to each target device of the same type in turn based on the independent address of each target device of the same type.

[0124] For the specific definition of the firmware upgrade device, please refer to the definition of the firmware upgrade method above, which will not be repeated here. Each module in the above-mentioned firmware upgrade device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0125] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a firmware upgrade method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

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

[0127] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the following steps are implemented when the processor executes the computer program: S1: detecting multiple devices of the same type connected via a serial bus, and determining multiple target devices of the same type that meet firmware upgrade conditions; S2: determining a universal address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; S3: sending firmware upgrade data to the multiple target devices of the same type based on the universal address, wherein the firmware upgrade data of the multiple target devices of the same type are the same; S4: receiving firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses in sequence, and determining that the firmware upgrade of the multiple target devices of the same type is completed.

[0128] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the operating status and current firmware version of the multiple devices of the same type; determining multiple target devices of the same type that meet the firmware upgrade conditions based on the operating status and current firmware version of the multiple devices of the same type, wherein the firmware upgrade conditions include being in an operating state of receiving solid-state upgrade data and the current firmware version matching the firmware upgrade data.

[0129] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a verification code of the firmware upgrade data based on the firmware upgrade data; and sending an identifier and a verification code of the firmware upgrade data to the multiple target devices of the same type based on the independent address, so that the multiple target devices of the same type can verify the received data based on the verification code and the identifier.

[0130] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the size of the data packet based on the transmission rate; dividing the firmware upgrade data into multiple data packets based on the size of the data packet, wherein each data packet includes the firmware upgrade data and a check code; and sending each data packet to the multiple target devices of the same type in sequence based on the universal address.

[0131] In one embodiment, when the processor executes the computer program, the following steps are also implemented: receiving the firmware upgrade status sent by the multiple target devices of the same type based on an independent address, wherein the firmware upgrade status includes firmware upgrade success and firmware upgrade failure; when the firmware upgrade status is firmware upgrade failure, determining the type of the firmware upgrade failure, wherein the type of the firmware upgrade failure includes data packet error and upgrade interruption; when the type of the firmware upgrade failure is upgrade interruption, based on the independent address, sending a rollback instruction to the device corresponding to the upgrade interruption status, and receiving a rollback completion message returned by the device corresponding to the upgrade interruption status; based on the universal address, resending the firmware upgrade data to the device corresponding to the upgrade interruption status; when the type of the firmware upgrade failure is data packet error, determining one or more error data packets according to the identifier of the error data packet in the firmware upgrade status; and sending the one or more error data packets to the device corresponding to the data packet error status based on the universal address.

[0132] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the devices whose firmware upgrade status is data packet transmission error among the multiple target devices of the same type, the number of transmission errors of each data packet is determined; according to the number of transmission errors of the data packets, the order of sending the data packets with transmission errors is determined; and according to the order of the data packets with transmission errors, the data packets with transmission errors are sent sequentially based on the universal address.

[0133] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the requirements of each target device of the same type, the control data corresponding to each target device of the same type is determined; based on the independent address of each target device of the same type, the control data is sent to each target device of the same type in turn.

[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: S1: Detect multiple devices of the same type connected via a serial bus, and determine multiple target devices of the same type that meet firmware upgrade conditions; S2: Determine a common address and an independent address corresponding to each target device of the same type based on the multiple target devices of the same type; S3: Based on the common address, send firmware upgrade data to the multiple target devices of the same type, wherein the firmware upgrade data of the multiple target devices of the same type are the same; S4: Sequentially receive the firmware upgrade status sent by the multiple target devices of the same type based on the independent addresses, and determine that the firmware upgrade of the multiple target devices of the same type is completed.

[0135] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the operating status and current firmware version of the multiple devices of the same type; determining multiple target devices of the same type that meet firmware upgrade conditions based on the operating status and current firmware version of the multiple devices of the same type, wherein the firmware upgrade conditions include being in an operating state of receiving solid-state upgrade data and the current firmware version matching the firmware upgrade data.

[0136] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a verification code of the firmware upgrade data based on the firmware upgrade data; and sending an identifier and a verification code of the firmware upgrade data to the multiple target devices of the same type based on the independent address, so that the multiple target devices of the same type can verify the received data based on the verification code and the identifier.

[0137] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the size of the data packet based on the transmission rate; dividing the firmware upgrade data into multiple data packets based on the size of the data packet, wherein each data packet includes the firmware upgrade data and a check code; and sending each data packet to the multiple target devices of the same type in sequence based on the universal address.

[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving the firmware upgrade status sent by the multiple target devices of the same type based on an independent address, wherein the firmware upgrade status includes firmware upgrade success and firmware upgrade failure; when the firmware upgrade status is firmware upgrade failure, determining the type of the firmware upgrade failure, wherein the type of the firmware upgrade failure includes data packet error and upgrade interruption; when the type of the firmware upgrade failure is upgrade interruption, based on the independent address, sending a rollback instruction to the device corresponding to the upgrade interruption status, and receiving a rollback completion message returned by the device corresponding to the upgrade interruption status; based on the universal address, resending the firmware upgrade data to the device corresponding to the upgrade interruption status; when the type of the firmware upgrade failure is data packet error, determining one or more error data packets according to the identifier of the error data packet in the firmware upgrade status; and sending the one or more error data packets to the device corresponding to the data packet error status based on the universal address.

[0139] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the number of transmission errors of each data packet based on the devices whose firmware upgrade status is data packet transmission error among the multiple target devices of the same type; determining the order of sending the data packets with transmission errors based on the number of transmission errors of the data packets; and sending the data packets with transmission errors in sequence based on the universal address in the order of the data packets with transmission errors.

[0140] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the control data corresponding to each target device of the same type according to the needs of each target device of the same type; and sending the control data to each target device of the same type in turn based on the independent address of each target device of the same type.

[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

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

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

Claims

1. A firmware upgrade method, characterized in that: It is characterized in that The method comprises: Detect multiple devices of the same type connected via a serial bus, and determine multiple target devices of the same type that meet a firmware upgrade condition; Determine, according to the multiple target devices of the same type, a universal address and an independent address corresponding to each target device of the same type; Based on the universal address, sending the firmware upgrade data to the multiple target devices of the same type, wherein the firmware upgrade data of the multiple target devices of the same type are the same; The firmware upgrade statuses sent by the multiple target devices of the same type based on independent addresses are received in sequence, and it is determined that the firmware upgrades of the multiple target devices of the same type are completed.

2. The firmware upgrade method according to claim 1, characterized in that: The detecting of a plurality of devices of the same type connected via the serial bus and determining a plurality of target devices of the same type that meet the firmware upgrade condition comprises: Obtaining the operating status and current firmware versions of the multiple devices of the same type; According to the operating status and current firmware versions of the multiple devices of the same type, multiple target devices of the same type that meet the firmware upgrade conditions are determined, wherein the firmware upgrade conditions include being in an operating state of receiving solid-state upgrade data and the current firmware version matching the firmware upgrade data.

3. The firmware upgrade method according to claim 1, characterized in that: After determining the universal address and the independent address corresponding to each target device of the same type according to the multiple target devices of the same type, the method further includes: Determining a verification code of the firmware upgrade data according to the firmware upgrade data; Based on the independent address, the identifier and the verification code of the firmware upgrade data are sent to the multiple target devices of the same type, so that the multiple target devices of the same type verify the received data according to the verification code and the identifier.

4. The firmware upgrade method according to claim 1, characterized in that: The sending of firmware upgrade data to the plurality of target devices of the same type based on the universal address includes: Determine the size of the data packet based on the transmission rate; Dividing the firmware upgrade data into a plurality of data packets according to the size of the data packet, wherein each data packet includes the firmware upgrade data and a check code; Based on the universal address, each data packet is sent to the multiple target devices of the same type in sequence.

5. The firmware upgrade method according to claim 4, characterized in that: The sequentially receiving the firmware upgrade statuses sent by the plurality of target devices of the same type based on independent addresses includes: Receiving firmware upgrade status sent by the plurality of target devices of the same type based on independent addresses, wherein the firmware upgrade status includes firmware upgrade success and firmware upgrade failure; When the firmware upgrade status is firmware upgrade failure, determining the type of the firmware upgrade failure, wherein the type of the firmware upgrade failure includes data packet error and upgrade interruption; When the type of the firmware upgrade failure is upgrade interruption, based on the independent address, sending a rollback instruction to the device corresponding to the upgrade interruption state, and receiving a rollback completion message returned by the device corresponding to the upgrade interruption state; Based on the universal address, resending the firmware upgrade data to the device corresponding to the upgrade interruption state; When the type of the firmware upgrade failure is a data packet error, determining one or more error data packets according to identifiers of the error data packets in the firmware upgrade status; Based on the universal address, the one or more error data packets are sent to a device corresponding to the error status of the data packet.

6. The firmware upgrade method according to claim 5, characterized in that: When the type of the firmware upgrade data transmission failure is a data packet transmission error, the method further includes: Determine the number of transmission errors of each data packet according to the device whose firmware upgrade status is a data packet transmission error among the multiple target devices of the same type; Determining the order of sending the data packets with transmission errors according to the number of transmission errors of the data packets; The data packets with transmission errors are sent sequentially based on the universal address in the order of the data packets with transmission errors.

7. The firmware upgrade method according to claim 1, characterized in that: The method further comprises: Determine the control data corresponding to each target device of the same type according to the requirements of each target device of the same type; Based on the independent address of each target same-type device, the control data is sent to each target same-type device in turn.

8. A firmware upgrade device, characterized in that: The device comprises: A detection module, used to detect multiple devices of the same type connected via a serial bus, and determine multiple target devices of the same type that meet the firmware upgrade conditions; A configuration module, used for determining a universal address and an independent address corresponding to each target device of the same type according to the multiple target devices of the same type; A sending module, configured to send the firmware upgrade data to the plurality of target devices of the same type based on the universal address, wherein the firmware upgrade data of the plurality of target devices of the same type are the same; The receiving module is used to sequentially receive the firmware upgrade status sent by the multiple target devices of the same type based on independent addresses, and determine that the firmware upgrade of the multiple target devices of the same type is completed.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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