A device firmware upgrade method, apparatus and electronic device
Patent Information
- Application Number
- CN202610919930.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-24
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]但现有方案存在技术缺陷,难以适配多设备总线组网、高波特率OTA升级场景
[0017]本申请中第二方面以及第三方面的描述,可以参考第一方面的详细描述;并且,第二方面以及第三方面的描述的有益效果,可以参考第一方面的有益效果分析,此处不再赘述。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of mobile Internet technology, and in particular to a device firmware upgrade method, apparatus and electronic device. Background Technology
[0002] With the rapid popularization of smart device bus networking and Over-the-Air (OTA) upgrade technology, remote firmware iteration updates have become the core method of smart device operation and maintenance, and data pass-through technology is the key foundation for ensuring stable transmission of OTA firmware data.
[0003] Currently, mainstream OTA data transmission in the industry adopts the traditional data pass-through mode. In this mode, the intermediate forwarding device does not parse, modify, or encrypt firmware service data; it only forwards the data unchanged at the physical and data link layers. Existing bus device OTA solutions are usually based on microcontrollers to implement byte pass-through, possessing only basic raw data forwarding capabilities. Due to its simple implementation, it is widely used in single-device firmware upgrade scenarios.
[0004] However, existing solutions have technical flaws and are difficult to adapt to multi-device bus networking and high-baud-rate OTA upgrade scenarios. Traditional byte pass-through lacks a buffer smoothing mechanism, which can easily lead to data congestion and buffer overflow problems when firmware data is continuously sent; at the same time, it cannot identify data frame boundaries, which can easily cause data frame sticking problems, significantly reducing the stability of bus device OTA upgrades and affecting the reliability of remote firmware upgrades. Summary of the Invention
[0005] This application provides a device firmware upgrade method, apparatus, and electronic device, which can improve the stability of OTA upgrades for bus devices and effectively enhance the reliability of remote firmware upgrades.
[0006] In a first aspect, this application provides a device firmware upgrade method, the method comprising: receiving an OTA upgrade command sent from a cloud and forwarding the OTA upgrade command to at least one terminal device mounted on a local bus; determining a device upgrade mode for the device firmware upgrade based on the number of response messages fed back by each of the terminal devices in response to the OTA upgrade command, the device upgrade mode including a single device upgrade mode and a batch upgrade mode; determining a corresponding target pass-through method based on the device upgrade mode, and pass-through corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method, the target pass-through method including at least one of byte pass-through and frame buffer pass-through.
[0007] To address the shortcomings of existing technologies, this application provides a device firmware upgrade method. This method offers the following advantages: by receiving the number of response messages from terminal devices, it accurately identifies the number of online devices on the bus and automatically determines whether a single-device upgrade or a batch upgrade of multiple devices is required, thus adapting to the remote OTA upgrade needs of complex bus devices. For different device upgrade modes, it selects a suitable target pass-through method from byte pass-through and frame buffer pass-through. This not only fully utilizes the low latency of byte pass-through and the high reliability of frame buffer pass-through, significantly improving reliability and scalability while ensuring low latency, achieving a balance between real-time performance and stability, and enhancing the stability of OTA upgrades for bus devices; it also solves problems such as data blocking, frame sticking, and overflow that easily occur with byte pass-through, effectively improving the reliability of remote firmware upgrades.
[0008] Furthermore, determining the device upgrade mode for firmware upgrade based on the number of response messages from each terminal device in response to the OTA upgrade command includes: when the number of response messages is one, determining the device upgrade mode as a single device upgrade mode; when the number of response messages is at least two, determining the device upgrade mode as a batch upgrade mode.
[0009] Furthermore, when the device upgrade mode is a single device upgrade mode, determining the corresponding target pass-through method based on the device upgrade mode includes: determining whether the communication link status between the relay node and the target terminal device is stable; if the communication link status is stable, then determining the target pass-through method corresponding to the target terminal device as the byte pass-through; if the communication link status is unstable, then determining the target pass-through method corresponding to the target terminal device as the frame buffer pass-through.
[0010] Furthermore, when the device upgrade mode is a batch upgrade mode, determining the corresponding target pass-through method based on the device upgrade mode includes: determining the target pass-through method as the frame buffer pass-through.
[0011] Furthermore, when the target pass-through method is the frame buffer pass-through, the step of passing through the corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method includes: receiving the current frame data of the device firmware of the target terminal device sent by the cloud, and performing a validity check on the current frame data; during the validity check, receiving the next frame data of the device firmware in parallel; adding the device code of the target terminal device to each frame data, the device code being obtained from the OTA upgrade command or the response message; after receiving all the frame data of the device firmware, obtaining the device firmware data, and passing through the device firmware data to the corresponding target terminal device.
[0012] Furthermore, after determining that the target transparent transmission method corresponding to the target terminal device is the byte transparent transmission, the method further includes: monitoring whether there is a communication abnormality event in the communication link between the relay node and the target terminal device; if so, switching the target transparent transmission method from the byte transparent transmission to the frame buffer transparent transmission, deleting the data transmitted through the byte transparent transmission, and retransmitting the device firmware data through the frame buffer transparent transmission.
[0013] Furthermore, the communication anomaly event includes at least one of the following: a preset number of consecutive validity verification errors, multiple packet losses, communication failure, or failure to receive a response message from the terminal device within a preset time period.
[0014] Furthermore, to determine whether the communication link status between the relay node and the target terminal device is stable, the following conditions must be met simultaneously: the communication verification results are all normal within a first preset number of consecutive times; the number of link failures is less than a second preset number of times; and the communication baud rate is less than a preset baud rate threshold.
[0015] Secondly, this application provides a device firmware upgrade apparatus, the apparatus comprising: The instruction delivery module is used to receive OTA upgrade instructions sent from the cloud and forward the OTA upgrade instructions to at least one terminal device connected to the local bus. The information determination module is used to determine the device upgrade mode of the device firmware upgrade based on the number of response messages fed back by each terminal device in response to the OTA upgrade command. The device upgrade mode includes a single device upgrade mode and a batch upgrade mode. The data pass-through module is used to determine the corresponding target pass-through method based on the device upgrade mode, and pass-through the corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method. The target pass-through method includes at least one of byte pass-through and frame buffer pass-through.
[0016] Thirdly, this application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the device firmware upgrade method described in any embodiment of this application.
[0017] The descriptions of the second and third aspects in this application can be referred to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second and third aspects can be referred to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description.
[0019] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained. Attached Figure Description
[0020] 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 accompanying 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.
[0021] Figure 1 A schematic flowchart illustrating a device firmware upgrade method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a device firmware upgrade apparatus provided in an embodiment of this application; Figure 3 This is a block diagram of an electronic device used to implement a device firmware upgrade method according to an embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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 should fall within the scope of protection of this application.
[0023] It should be noted that the terms "first," "second," "target," and "original," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprising," "having," and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] Figure 1 This is a flowchart illustrating a device firmware upgrade method provided in this application embodiment. This embodiment is applicable to scenarios involving multi-device bus networking and high-baud-rate OTA upgrades, where device firmware upgrades are performed based on an adaptive transparent transmission communication mechanism. The device firmware upgrade method provided in this embodiment can be executed by the device firmware upgrade device provided in this application embodiment. This device can be implemented through software and / or hardware and integrated into the electronic device executing the method. The main execution component of this method is a relay main control component (such as a display board main control). The relay main control component communicates with a gateway device (such as a WiFi module) and a local bus system. The gateway device communicates with the cloud. At least one terminal device (such as a target upgrade board to be updated) is mounted on the local bus system.
[0025] See Figure 1 The method in this embodiment includes, but is not limited to, the following steps: S110 receives OTA upgrade instructions sent from the cloud and forwards the OTA upgrade instructions to at least one terminal device connected to the local bus.
[0026] In this embodiment, a communication gateway (such as a WiFi module) can be used as a relay bridge between the cloud and the local bus system. It is responsible for receiving OTA upgrade tasks and firmware data packets remotely issued by the cloud, and forwarding the upgrade instructions to the local relay main control component to complete the data communication between the external network and the internal network.
[0027] In this embodiment, the OTA upgrade command can be a notification data frame generated by the cloud and sent through the communication gateway. The command can carry the device identification code (ID) of the terminal device to be upgraded, which can be used to inform the terminal device on the local bus that a firmware upgrade is about to be carried out. It is a pre-signal that triggers the terminal device to reply.
[0028] In this embodiment, the local bus can be a wired communication line that carries the relay master control component and multiple terminal devices. It can support one master and multiple slaves to connect multiple terminals and realize data broadcasting and point-to-point transmission between devices.
[0029] In this embodiment, the terminal device can be a target upgrade board connected to the local bus and waiting to receive firmware updates. It is the underlying terminal hardware that needs to perform OTA firmware upgrades. After receiving the broadcast upgrade command, it will send a response message back to the relay main control component.
[0030] In this embodiment, the relay main control component can be a display board main control unit, a control unit that can handle command forwarding and transparent transmission mode switching, or a data forwarding hub between a communication gateway and a terminal device.
[0031] In this embodiment, both the communication gateway and the cloud store device information for the target upgrade board. When the communication gateway receives a remote firmware update request from the cloud, it generates a standardized OTA upgrade command and sends it to the relay control component. The relay control component continuously monitors the data sent by the communication gateway. Upon receiving the OTA upgrade command, it forwards the unchanged original OTA upgrade command to all connected terminal devices on the local bus in a byte-transparent broadcast format. All online terminal devices on the local bus can receive this broadcast command, thus completing the global distribution of the upgrade notification.
[0032] In one embodiment, the OTA upgrade command may carry the ID of the target terminal device to specify which terminal device to upgrade. For example, the ID of terminal device 1 is 0x5A, the ID of terminal device 2 is 0x5B, and the ID of terminal device 3 is 0x5C.
[0033] S120. Based on the number of response messages from each terminal device to the OTA upgrade command, determine the device upgrade mode for the device firmware upgrade.
[0034] The device upgrade mode can include a single-device upgrade mode and a batch upgrade mode. In this embodiment, the single-device upgrade mode may have only one terminal device to be upgraded on the bus. The batch upgrade mode may have two or more terminal devices to be upgraded connected to the bus.
[0035] In this embodiment, the response message can be feedback byte data generated by the terminal device after receiving the OTA upgrade command. It can be used to inform the relay main control component that it is online and can receive firmware upgrades. Specifically, a single online terminal device will only send back one response message; an offline terminal device will not generate a response message.
[0036] In this embodiment, the device upgrade mode can be divided into upgrade service types based on the number of online terminal devices on the local bus, namely single device upgrade mode and batch upgrade mode. Different upgrade service types correspond to different firmware transparent transmission strategies.
[0037] In some embodiments, the device upgrade mode for device firmware upgrade is determined based on the number of response messages from each terminal device in response to the OTA upgrade command, including: when the number of response messages is one, the device upgrade mode is determined to be a single device upgrade mode; when the number of response messages is at least two, the device upgrade mode is determined to be a batch upgrade mode.
[0038] In this embodiment, after all terminal devices connected to the local bus receive the OTA upgrade command broadcast by the relay master control component, each terminal device that is online and communicating normally will actively generate a corresponding response message and send it back to the relay master control component. The relay master control component continuously counts all received response messages and determines the actual number of terminal devices to be upgraded by counting the number of valid response messages, thereby determining the device upgrade mode corresponding to the current firmware upgrade. If only one valid response message is collected, it is determined to be a single-device upgrade mode; if two or more valid response messages are collected, it is determined to be a batch upgrade mode.
[0039] S130. Determine the corresponding target pass-through method based on the device upgrade mode, and pass-through the corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method.
[0040] In this embodiment, the target pass-through method can be a data forwarding mechanism that adapts to bus upgrade scenarios and is adaptively matched by the relay master control component. The target pass-through method can include at least one of byte pass-through and frame buffer pass-through, which can be used to adapt to different network upgrade conditions and ensure stable firmware transmission.
[0041] In this embodiment, the byte pass-through can be a lightweight native forwarding mode. The relay main control component forwards the device firmware data in real time as soon as it receives it. It does not cache data, modify data, or attach device encoding. The forwarding latency is low and it is suitable for single device upgrade scenarios.
[0042] In this embodiment, the frame buffer pass-through can be a pre-processed whole frame forwarding mode. The relay main control component first buffers the complete firmware data frame, verifies the integrity of the frame data, binds the terminal device ID, and then sends it down frame by frame. This can isolate data interference, distinguish the identity of the terminal device, and adapt to batch device upgrades.
[0043] It should be noted that the existing conventional frame pass-through mode processes data as follows: for each frame, the validity of the current frame must be verified. Only after the verification result is deemed valid can the frame be forwarded to the corresponding terminal device. The next frame is only received after the processing of a single frame is completed. In contrast, the frame buffer pass-through mode of this application supports parallel processing logic: upon receiving a frame, the next frame is received while performing the verification operation for that frame, achieving synchronous frame reception and frame verification; after receiving all frame data, the terminal device code is added uniformly and the data is batch-sent to the target terminal. The advantage of this setup is that this parallel processing architecture significantly compresses the firmware data transmission time, effectively shortening the total OTA upgrade time and improving firmware upgrade transmission efficiency.
[0044] In this embodiment, the target terminal device to be upgraded can be an underlying terminal hardware that has online communication within the local bus, has firmware writing permissions, is specified by the OTA upgrade command, and needs to update the built-in program.
[0045] In this embodiment, the device firmware data can be compiled and generated in the cloud and forwarded through a communication gateway. It can be used to fix program vulnerabilities, expand device functions, and update the underlying program data packets of the device program.
[0046] In this embodiment, the relay control component establishes a dedicated firmware data transmission channel by matching the optimal target transparent transmission method based on the device upgrade mode. When the relay control component determines it is in single-device upgrade mode, the transmission logic is simple, and lightweight byte transparent transmission is matched as the target transparent transmission method, directly forwarding the device firmware data sent by the communication gateway as is. When the relay control component determines it is in batch upgrade mode, to avoid transmission errors that may occur during concurrent communication of multiple devices, frame buffer transparent transmission is matched as the target transparent transmission method. The firmware data is buffered in whole frames, bound to device encoding, and then forwarded. Relying on the selected target transparent transmission method, the relay control component transmits firmware data packets in a targeted manner, ensuring that only the target terminal device to be upgraded with the matched identity receives the firmware data, completing firmware reception and upgrade, and adapting to the differentiated transmission requirements of the two upgrade scenarios.
[0047] In some embodiments, when the device upgrade mode is a single device upgrade mode, determining the corresponding target pass-through method based on the device upgrade mode includes: determining whether the communication link status between the relay node and the target terminal device is stable; if the communication link status is stable, determining that the target pass-through method corresponding to the target terminal device is byte pass-through; if the communication link status is unstable, determining that the target pass-through method corresponding to the target terminal device is frame buffer pass-through.
[0048] In a one-to-one data pass-through scenario (i.e., single-device upgrade mode), firstly, the communication baud rate between the relay node and the target terminal device must be consistent. Then, when the communication link between the relay node and the target terminal device is stable, byte pass-through is prioritized, leveraging the real-time byte-by-byte forwarding characteristic to ensure minimal data transmission latency and rapid response. When the communication link between the relay node and the target terminal device is unstable, byte pass-through is prone to data blocking, frame sticking, and overflow issues. Frame buffer pass-through is then enabled, using whole-frame reception, buffer verification, and timing regularization to prevent transmission anomalies. The advantage of this setup is that the relay control component adopts an intelligent decision-making adaptive working mechanism, fully combining the low latency of byte pass-through with the high reliability of frame buffer pass-through, achieving an optimal balance between real-time performance and stability.
[0049] In one embodiment, the relay master control component determines whether the communication link status between the relay node and the target terminal device is stable, and the following conditions must be met simultaneously: the communication verification results are all normal within a first preset number of times (e.g., 3 times); the number of link failures is less than a second preset number of times; and the communication baud rate is less than a preset baud rate threshold.
[0050] Specifically, the higher the communication baud rate, the faster the data transmission rate, and the more stringent the requirements for bus timing, signal integrity, and level quality. At high baud rates, even slight program processing delays or external interference can easily cause packet loss, frame errors, and checksum errors, directly leading to abnormal pass-through. To address this issue, a preset baud rate threshold (e.g., 9600bps) can be set. When the communication baud rate is lower than the preset baud rate threshold (e.g., 9600bps), if the communication checksum results are normal for a first preset number of times (e.g., 3 times) and the number of link failures is less than a second preset number of times (e.g., 3 times), then byte pass-through is prioritized. Conversely, if neither condition is met, such as when the communication baud rate is higher than the preset baud rate threshold (e.g., 9600bps), the bus is determined to be timing-sensitive, and frame buffer pass-through is automatically enabled to reduce the strong timing dependence on the real-time byte stream and improve transmission stability at high baud rates.
[0051] In some embodiments, when the device upgrade mode is a batch upgrade mode, determining the corresponding target pass-through method based on the device upgrade mode includes: determining the target pass-through method as frame buffer pass-through.
[0052] In one-to-many data pass-through scenarios (i.e. batch upgrade mode), the relay main control component uniformly adopts frame buffer pass-through as the basic working mode. Relying on the whole frame reception and data recognition capabilities, it realizes accurate traffic distribution and independent forwarding of multiple terminals by a single pass-through device.
[0053] In some embodiments, after determining that the target transparent transmission method corresponding to the target terminal device is byte transparent transmission, the relay master control component further includes: monitoring whether there are any communication anomalies in the communication link between the relay node and the target terminal device; if so, immediately triggering a protection mechanism to switch the target transparent transmission method from byte transparent transmission to frame buffer transparent transmission until the communication quality returns to stability. Furthermore, after switching to frame buffer transparent transmission, to avoid duplicate data transmission, it is also necessary to delete the data already transmitted via byte transparent transmission and retransmit the device firmware data via frame buffer transparent transmission. The advantage of this setup is that the relay master control component adopts a dynamic switching adaptive working mechanism, which can dynamically adapt to communication requirements of different rates and link qualities without manual intervention, significantly improving the compatibility and reliability of the device under complex operating conditions.
[0054] Among them, communication abnormal events include at least one of the following: consecutive preset number of validity verification errors, multiple packet loss, communication failure, and failure to receive a response message from the terminal device within a preset time period.
[0055] Specifically, after the communication gateway sends data, the relay control component forwards it to the terminal devices on the local bus. Environmental issues such as external electromagnetic interference, power fluctuations, and bus signal reflection can cause data distortion, lost responses, or verification failures, thus compromising the stability of the transparent transmission. To address this, if frequent verification errors occur or a response is not received from the target terminal device for an extended period, it is determined that environmental interference is causing unreliable communication. In this case, the relay control component automatically switches to frame buffering transparent transmission mode. By buffering entire frames and verifying frame structures, it reduces the dependence on real-time timing and improves fault tolerance in harsh environments.
[0056] Compared to byte-level pass-through mode, frame-buffered pass-through mode offers the advantage of avoiding the inherent defects of byte-level forwarding from the data reception logic. It effectively optimizes data timing management, isolates abnormal data, reduces transmission error rate, and significantly improves data integrity and communication reliability in complex links. Furthermore, frame-buffered pass-through has strong scalability, supporting not only traditional one-to-one pass-through but also intelligent data splitting across multiple terminal devices on the same pass-through device through strategies such as frame header parsing, target address identification, and data type judgment. This meets the flexible deployment needs of multiple devices, channels, and protocols coexisting in industrial settings. The device firmware upgrade method in this application constructs an adaptive pass-through communication mechanism for dynamic scenarios, deeply integrating byte-level pass-through and frame-buffered pass-through, autonomously deciding and dynamically switching to the optimal mode based on real-time communication status.
[0057] In some embodiments, when the target pass-through method is frame buffer pass-through, the corresponding device firmware data is passed through to the target terminal device to be upgraded based on the target pass-through method, including: the relay main control component receiving the current frame data of the device firmware of the target terminal device sent by the cloud, and performing a validity check on the current frame data; during the validity check, receiving the next frame data of the device firmware in parallel; adding the device code of the corresponding target terminal device to each frame data, the device code being obtained from the OTA upgrade command or response message; after receiving all the frame data of the device firmware, obtaining the device firmware data, and passing through the device firmware data to the corresponding target terminal device.
[0058] After receiving a complete data frame, the relay control component first parses and identifies information such as the frame structure, target address, and function code to complete data validity verification and matching with the target terminal device. After receiving all frame data from the device firmware, it then forwards the device firmware data to the corresponding serial port output according to preset routing rules, avoiding data interference, crosstalk, and conflicts between multiple terminal devices. Compared to the limitations of traditional transparent transmission, which can only achieve point-to-point communication, this method supports the same relay control component to simultaneously connect to multiple heterogeneous terminals, enabling flexible construction of multi-node, multi-channel, and multi-protocol communication networks.
[0059] Through frame recognition and traffic splitting logic, the relay control component can isolate data from different sources and addresses, enabling multiple communication channels to operate in parallel without interference, effectively solving the data chaos problem when multiple terminal devices access the system concurrently. This highly flexible transparent transmission method is widely applicable to complex scenarios such as multi-device networking, multi-sensor acquisition, and multi-controller linkage in industry, significantly reducing system deployment costs and hardware complexity while improving communication efficiency.
[0060] In one embodiment, after the validity verification of each data frame is completed, the relay master control component sends a response message to the communication gateway. The response message includes the verification result and the frame data ID. For example, if the validity verification of frame data 1 fails, the response message sent to the communication gateway includes verification failure information and the frame data ID. At this time, frame data 2 (i.e., the next frame data) will continue to be received. Subsequently, the communication gateway will retransmit frame data 1. After the relay master control component receives frame data 1 again, it still needs to perform frame sorting operations. Since each frame data has an ID, the received frame data will not be disordered.
[0061] The technical solution provided in this embodiment receives an OTA upgrade command sent by a communication gateway and forwards the OTA upgrade command to at least one terminal device connected to the local bus. Based on the number of response messages from each terminal device in response to the OTA upgrade command, the device upgrade mode for firmware upgrade is determined. The device upgrade mode includes single-device upgrade mode and batch upgrade mode. Based on the device upgrade mode, the corresponding target transparent transmission method is determined, and the corresponding device firmware data is transparently transmitted to the target terminal device to be upgraded based on the target transparent transmission method. The target transparent transmission method includes at least one of byte transparent transmission and frame buffer transparent transmission. This application accurately identifies the number of online devices on the bus by receiving the number of response messages from terminal devices, and automatically determines the device upgrade mode for single-device upgrade or multi-device batch upgrade, which can adapt to the remote OTA upgrade needs of complex bus devices. For different device upgrade modes, the appropriate target pass-through method can be selected from byte pass-through and frame buffer pass-through. This not only makes full use of the low latency of byte pass-through and the high reliability of frame buffer pass-through, but also significantly improves reliability and scalability while ensuring low latency, achieving a balance between real-time performance and stability, and improving the stability of OTA upgrades for bus devices. It can also solve problems such as data blocking, frame sticking, and overflow that are prone to occur in byte pass-through, and can effectively improve the reliability of remote firmware upgrades.
[0062] Figure 2 This is a schematic diagram of a device firmware upgrade apparatus provided in an embodiment of this application, as shown below. Figure 2 As shown, the device 200 may include: The instruction issuing module 210 is used to receive OTA upgrade instructions sent from the cloud and forward the OTA upgrade instructions to at least one terminal device connected to the local bus. Information determination module 220 is used to determine the device upgrade mode of device firmware upgrade based on the number of response messages fed back by each terminal device in response to the OTA upgrade command. The device upgrade mode includes single device upgrade mode and batch upgrade mode. The data pass-through module 230 is used to determine the corresponding target pass-through method based on the device upgrade mode, and pass-through the corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method. The target pass-through method includes at least one of byte pass-through and frame buffer pass-through.
[0063] Furthermore, the aforementioned information determination module 220 can be specifically used to: determine the device upgrade mode as a single device upgrade mode when the number of response messages is one; and determine the device upgrade mode as a batch upgrade mode when the number of response messages is at least two.
[0064] Furthermore, the aforementioned data pass-through module 230 can be specifically used to: determine whether the communication link status between the relay node and the target terminal device is stable when the device upgrade mode is a single device upgrade mode; if the communication link status is stable, determine that the target pass-through method corresponding to the target terminal device is the byte pass-through; if the communication link status is unstable, determine that the target pass-through method corresponding to the target terminal device is the frame buffer pass-through.
[0065] Furthermore, the aforementioned data pass-through module 230 can be specifically used to: determine the target pass-through method as the frame buffer pass-through when the device upgrade mode is a batch upgrade mode.
[0066] Furthermore, the aforementioned data pass-through module 230 can be specifically used for: receiving the current frame data of the device firmware of the target terminal device sent by the cloud when the target pass-through method is the frame buffer pass-through, and performing a validity check on the current frame data; during the validity check, receiving the next frame data of the device firmware in parallel; adding the corresponding device code of the target terminal device to each frame data, the device code being obtained from the OTA upgrade command or the response message; after receiving all the frame data of the device firmware, obtaining the device firmware data, and pass-through the device firmware data to the corresponding target terminal device.
[0067] Furthermore, the aforementioned data pass-through module 230 can be specifically used to: after determining that the target pass-through method corresponding to the target terminal device is the byte pass-through, monitor whether there is a communication abnormality event in the communication link between the relay node and the target terminal device; if so, switch the target pass-through method from the byte pass-through to the frame buffer pass-through, delete the data that has been transmitted through the byte pass-through, and retransmit the device firmware data through the frame buffer pass-through.
[0068] Furthermore, the communication anomaly event includes at least one of the following: a preset number of consecutive validity verification errors, multiple packet losses, communication failure, or failure to receive a response message from the terminal device within a preset time period.
[0069] Furthermore, the aforementioned data pass-through module 230 can be specifically used in the following ways: checking whether the communication verification results within a first preset number of consecutive times are all normal; counting whether the number of link failures is less than a second preset number of times; and checking whether the communication baud rate is less than a preset baud rate threshold.
[0070] The device firmware upgrade apparatus provided in this embodiment can be applied to the device firmware upgrade method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0071] Figure 3 This is a block diagram of an electronic device used to implement a device firmware upgrade method according to an embodiment of this application. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0072] like Figure 3 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0073] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0074] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as device firmware upgrade methods.
[0075] In some embodiments, the device firmware upgrade method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the device firmware upgrade method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the device firmware upgrade method by any other suitable means (e.g., by means of firmware).
[0076] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0077] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0078] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0079] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0080] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0081] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0082] Note that the above are merely preferred embodiments and technical principles applied in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. For example, those skilled in the art can use the various forms of processes shown above to reorder, add, or delete steps; the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of this application can be achieved, and no limitations are imposed herein.
[0083] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A device firmware upgrade method, characterized in that, The method includes: Receive OTA upgrade instructions sent from the cloud and forward the OTA upgrade instructions to at least one terminal device connected to the local bus; Based on the number of response messages from each terminal device in response to the OTA upgrade command, the device upgrade mode for the device firmware upgrade is determined, and the device upgrade mode includes a single device upgrade mode and a batch upgrade mode. Based on the device upgrade mode, the corresponding target pass-through method is determined, and the corresponding device firmware data is passed through to the target terminal device to be upgraded based on the target pass-through method. The target pass-through method includes at least one of byte pass-through and frame buffer pass-through.
2. The device firmware upgrade method according to claim 1, characterized in that, The process of determining the device upgrade mode for firmware upgrade based on the number of response messages from each terminal device in response to the OTA upgrade command includes: When the number of response messages is one, the device upgrade mode is determined to be a single device upgrade mode; When the number of response messages is at least two, the device upgrade mode is determined to be a batch upgrade mode.
3. The device firmware upgrade method according to claim 2, characterized in that, When the device upgrade mode is a single device upgrade mode, determining the corresponding target transparent transmission method based on the device upgrade mode includes: Determine whether the communication link between the relay node and the target terminal device is stable; If the communication link is stable, then the target pass-through method corresponding to the target terminal device is determined to be the byte pass-through. If the communication link is unstable, the target pass-through method corresponding to the target terminal device is determined to be the frame buffer pass-through.
4. The device firmware upgrade method according to claim 2, characterized in that, When the device upgrade mode is a batch upgrade mode, determining the corresponding target transparent transmission method based on the device upgrade mode includes: The target pass-through method is determined to be the frame buffer pass-through.
5. The device firmware upgrade method according to claim 1, characterized in that, When the target pass-through method is the frame buffer pass-through, the step of passing through the corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method includes: Receive the current frame data of the device firmware of the target terminal device sent by the cloud, and perform a validity check on the current frame data; During the legality verification process, the next frame of data from the device firmware is received in parallel. Add the corresponding device code of the target terminal device to each frame of data. The device code is obtained from the OTA upgrade command or the response message. After receiving all frame data of the device firmware, the device firmware data is obtained and then transmitted to the corresponding target terminal device.
6. The device firmware upgrade method according to claim 3, characterized in that, After determining that the target pass-through method corresponding to the target terminal device is the byte pass-through, the method further includes: Monitor whether there are any abnormal communication events in the communication link between the relay node and the target terminal device; If it exists, the target pass-through method is switched from the byte pass-through to the frame buffer pass-through, the data already transmitted through the byte pass-through is deleted, and the device firmware data is retransmitted through the frame buffer pass-through.
7. The device firmware upgrade method according to claim 6, characterized in that, The communication anomaly event includes at least one of the following: a preset number of consecutive validity verification errors, multiple packet losses, communication failure, or no response message received from the terminal device within a preset time period.
8. The device firmware upgrade method according to claim 3, characterized in that, To determine whether the communication link status between the relay node and the target terminal device is stable, the following conditions must be met simultaneously: The communication verification results within the first preset number of consecutive iterations are all normal; The number of statistical link failures is less than the second preset number; The communication baud rate is less than the preset baud rate threshold.
9. A device firmware upgrade apparatus, characterized in that, The device includes: The instruction delivery module is used to receive OTA upgrade instructions sent from the cloud and forward the OTA upgrade instructions to at least one terminal device connected to the local bus. The information determination module is used to determine the device upgrade mode of the device firmware upgrade based on the number of response messages fed back by each terminal device in response to the OTA upgrade command. The device upgrade mode includes a single device upgrade mode and a batch upgrade mode. The data pass-through module is used to determine the corresponding target pass-through method based on the device upgrade mode, and pass-through the corresponding device firmware data to the target terminal device to be upgraded based on the target pass-through method. The target pass-through method includes at least one of byte pass-through and frame buffer pass-through.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that is executed by the at least one processor, which enables the at least one processor to perform the device firmware upgrade method according to any one of claims 1 to 8.