Firmware upgrade method and related device, equipment and medium
By adopting the firmware upgrade method of the tree-level system in FPGA equipment, analyzing and encapsulating upgrade information, the parallel upgrade of units at all levels is solved, and the problems of long upgrade time and low security in traditional upgrade methods are improved, and the upgrade efficiency and security are improved sex.
Patent Information
- Application Number
- CN202411121792.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-15
AI Technical Summary
In the prior art, the upgrade time is long during the firmware upgrade process of FPGA equipment, which affects efficiency and security.
The firmware upgrade method based on the tree-level system is adopted to analyze and encapsulate upgrade information and broadcast communication frames to achieve parallel upgrades at all levels to ensure accuracy and security.
Improve the efficiency and security of firmware upgrades, avoid failures and equipment failures caused by misinformation of upgrades, and shorten the upgrade time.
Smart Images

Figure CN118642740B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a firmware upgrade method and related devices, equipment and media. Background Art
[0002] With the rapid development of electronic information technology, the complexity of related equipment in industries and other fields is also increasing. Taking the use of FPGA (Field-Programmable Gate Array) as the processing circuit in related equipment as an example, due to its rapid function update and iteration, it brings severe challenges to the firmware upgrade of large quantities of FPGA.
[0003] At present, traditional upgrade methods, such as the main control chip directly programming the upgrade firmware into non-volatile storage media such as flash memory, or using pipeline upgrades, all have technical problems such as serious upgrade time consumption, which restricts the upgrade efficiency and even affects the upgrade security. In view of this, how to improve the upgrade efficiency and upgrade security has become an urgent problem to be solved. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a firmware upgrade method and related devices, equipment and media, which can improve the upgrade efficiency and upgrade security.
[0005] In order to solve the above problems, the first aspect of the present application provides a firmware upgrade method, including: based on the firmware data for upgrading the tree-like hierarchical system, parsing to obtain the upgrade information of each unit at each level in the tree-like hierarchical system; wherein the local unit is the top-level unit as the root node in the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware; based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, encapsulating to obtain a first communication frame corresponding to the secondary unit; wherein the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system; broadcasting the first communication frame corresponding to the secondary unit in the tree-like hierarchical system, the secondary unit receives and parses the first communication frame to obtain the upgrade information of the secondary unit; performing a local upgrade based on the upgrade information of the top-level unit, and broadcasting a second communication frame representing the initiation of the upgrade in the tree-like hierarchical system to instruct the secondary unit to upgrade.
[0006] In order to solve the above-mentioned problem, the second aspect of the present application provides a firmware upgrade method, including: receiving a first communication frame broadcast from a top-level unit in a tree-like hierarchical system to a secondary unit; wherein the top-level unit serves as the root node of each level of units in the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit, and the first communication frame is encapsulated by the top-level unit based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, and the upgrade information is obtained by the top-level unit based on the firmware data parsed for upgrading the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware; parsing is performed based on the first communication frame to obtain the upgrade information of the local unit; in response to receiving a second communication frame broadcasted from the top-level unit and indicating the initiation of the upgrade, performing a local upgrade based on the upgrade information of the local unit.
[0007] In order to solve the above problems, the third aspect of the present application provides a firmware upgrade device, including: a data parsing module, an information encapsulation module, a system broadcast module and an upgrade indication module, the data parsing module is used to parse the firmware data for upgrading the tree-like hierarchical system to obtain the upgrade information of each unit at each level in the tree-like hierarchical system; wherein the local unit is the top-level unit as the root node in the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware; the information encapsulation module is used to encapsulate the first communication frame corresponding to the secondary unit based on the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system; wherein the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system; the system broadcast module is used to broadcast the first communication frame corresponding to the secondary unit in the tree-like hierarchical system, the secondary unit receives and parses the first communication frame to obtain the upgrade information of the secondary unit; the upgrade indication module is used to perform local upgrade based on the upgrade information of the top-level unit, and broadcast the second communication frame representing the start of the upgrade in the tree-like hierarchical system to instruct the secondary unit to upgrade.
[0008] In order to solve the above problems, the fourth aspect of the present application provides a firmware upgrade device, including: a broadcast receiving module, a receiving and parsing module and a local upgrade module, the broadcast receiving module is used to receive a first communication frame broadcast from a top-level unit to a secondary unit in a tree-like hierarchical system; wherein the top-level unit serves as the root node of each level of units in the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit, the first communication frame is encapsulated by the top-level unit based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, the upgrade information is parsed by the top-level unit based on firmware data for upgrading the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware; the receiving and parsing module is used to parse based on the first communication frame to obtain the upgrade information of the local unit; the local upgrade module is used to perform a local upgrade based on the upgrade information of the local unit in response to receiving a second communication frame broadcasted from the top-level unit and indicating the start of the upgrade.
[0009] In order to solve the above problems, the fifth aspect of the present application provides an electronic device, including a storage medium and a processing circuit coupled to each other, the storage medium stores program instructions, and the processing circuit is used to execute the program instructions to implement the firmware upgrade method in the above aspect.
[0010] In order to solve the above-mentioned problem, the sixth aspect of the present application provides an electronic device, which at least includes a tree-like hierarchical system, and each level unit in the tree-like hierarchical system is the electronic device in the fifth aspect.
[0011] In order to solve the above-mentioned problem, the seventh aspect of the present application provides a computer-readable storage medium, which stores program instructions that can be executed by a processor, and the program instructions are used to implement the firmware upgrade method in the above-mentioned first aspect.
[0012] The above scheme is based on the firmware data for upgrading the tree-like hierarchical system, and the upgrade information of each unit at each level in the tree-like hierarchical system is parsed, and the local unit is the top-level unit as the root node in the tree-like hierarchical system. The upgrade information at least includes the upgraded firmware. Then, based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, the first communication frame corresponding to the secondary unit is encapsulated, and the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system, so that the first communication frame corresponding to the secondary unit is broadcast in the tree-like hierarchical system, the secondary unit receives and parses the first communication frame, obtains the upgrade information of the secondary unit, and then performs the local scheme based on the upgrade information of the top-level unit. The secondary unit is upgraded and the second communication frame representing the start of the upgrade is broadcasted in the tree-like hierarchical system to instruct the secondary unit to upgrade. Therefore, on the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels and causing adverse effects such as upgrade failure or even equipment failure, which helps to improve the security of the upgrade. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a flowchart of an embodiment of a firmware upgrade method of the present application;
[0014] Figure 2a It is a schematic diagram of a framework of an embodiment of a tree-like hierarchical system;
[0015] Figure 2b is a schematic diagram of a framework of another embodiment of a tree-like hierarchical system;
[0016] Figure 2cIt is a schematic diagram of a framework of an embodiment of each level unit in a tree-like hierarchical system;
[0017] Figure 2d is a schematic diagram of the format of firmware data in an embodiment;
[0018] Figure 2e is a schematic diagram of an embodiment of a frame format of the Aurora bus protocol;
[0019] Figure 2f It is a schematic diagram of the format of an embodiment of a destination address in the Aurora bus protocol;
[0020] Figure 3 It is a flowchart of another embodiment of the firmware upgrade method of the present application;
[0021] Figure 4 It is a flowchart of another embodiment of the firmware upgrade method of the present application;
[0022] Figure 5 It is a schematic diagram of the framework of an embodiment of a firmware upgrade device of the present application;
[0023] Figure 6 It is a schematic diagram of the framework of another embodiment of the firmware upgrade device of the present application;
[0024] Figure 7 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0025] Figure 8 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0026] Fig. 9 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0027] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0028] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0029] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0030] See also Figure 1 , Figure 1 1 is a flowchart of an embodiment of a firmware upgrade method of the present application. Specifically, the embodiment of the present disclosure may include the following steps:
[0031] Step S11: Based on the firmware data for upgrading the tree-like hierarchical system, the upgrade information of each unit at each level in the tree-like hierarchical system is parsed and obtained.
[0032] In the disclosed embodiment, the local unit is a top-level unit that serves as a root node in a tree-like hierarchical system. It should be noted that the tree-like hierarchical system may include two-level units, three-level units, or more than three-level units, etc., and the total number of levels of the tree-like hierarchical system is not limited here. In addition, there may be one first-level unit (i.e., the top-level unit) in the tree-like hierarchical system, and there may be one, two, or three or more units in each subsequent level, and the total number of levels after the first-level unit is not limited here. That is to say, except for the first-level unit (i.e., the top-level unit) and the last-level unit in the tree-like hierarchical system, any first-level unit may be communicatively connected to one, two, or more than three subordinate units, or may not even be communicatively connected to the subordinate units. In addition, for different units at the same level, they may be communicatively connected to the same number of subordinate units, and of course, they may also be communicatively connected to different numbers of subordinate units. Please refer to Figure 2a , Figure 2a Schematic diagram of a tree-like hierarchical system. Figure 2a As shown, the tree-like hierarchical system may include a first-level unit (i.e., top-level unit), which is connected to the first-level unit (i.e., top-level unit) for communication, and two third-level units are connected to each second-level unit for communication. Figure 2a The tree-like hierarchical system shown is only a possible example in actual application, and does not limit the specific structure of the tree-like hierarchical system. Figure 2b , Figure 2b FIG. 1 is a schematic diagram of another embodiment of a tree-like hierarchical system. Figure 2b As shown, the tree-like hierarchical system may include a first-level unit (i.e., a top-level unit), and two second-level units communicatively connected to the first-level unit. The specific structure of the tree-like hierarchical system will not be given one by one here. In addition, the upgrade information may at least include upgraded firmware. Of course, the upgrade information may also include other content, which can be specifically referred to in the following related descriptions, which will not be repeated here for the time being. In addition, in the embodiments disclosed in the present application, "upgrade" specifically refers to firmware update, which can be "update from low version firmware to high version firmware" which usually occurs in the actual application process, and the possible "rollback from high version firmware to low version firmware" is not excluded, which is not limited here.
[0033] In an implementation scenario, please refer to Figure 2c , Figure 2cSchematic diagram of a framework of an embodiment of each level unit in a tree-like hierarchical system. Figure 2c As shown, each level of units may include a processing circuit, and a volatile storage medium and a non-volatile storage medium electrically connected to the processing circuit. Exemplarily, the processing circuit may include, but is not limited to: FPGA, ASIC (Application Specific Integrated Circuit), etc., and the specific type of the processing circuit is not limited here. The volatile storage medium may include, but is not limited to, memory, etc., and the non-volatile storage medium may include flash memory, etc., which are not limited here. For the specific functions of the volatile storage medium and the non-volatile storage medium, please refer to the following related description, which will not be repeated here. In addition, units at the same level can be exactly the same, that is, the firmware running by the units at the same level can be exactly the same. Of course, Figure 2c The architecture shown is only a possible example, and the architecture design of each level of the tree-like hierarchical system is not limited.
[0034] In one implementation scenario, the units at each level in the tree-like hierarchical system can be connected to each other based on a preset bus protocol, that is, the units at each level can communicate with each other through a preset bus protocol. Exemplarily, the preset bus protocol may include at least the Aurora bus protocol. Of course, the preset bus protocol may also include other bus protocols, which are not limited here.
[0035] In an implementation scenario, the firmware data may include first header information, second header information, and content information. The first header information may include the firmware size of each unit at each level, the second header information may include the first firmware verification code of each unit at each level, and the content information may include the upgrade firmware of each unit at each level. Figure 2d , Figure 2d FIG. 1 is a schematic diagram of the format of an embodiment of firmware data. Figure 2d As shown, taking the tree-like hierarchical system including three levels of units as an example, the first header information may include the firmware size of each level of units, i.e., the firmware size size1 of the first level unit, the firmware size size2 of the second level unit, and the firmware size size3 of the third level unit; the second header information may include the first firmware verification code of each level of units, i.e., the first firmware verification code code1 of the first level unit, the first firmware verification code code2 of the second level unit, and the first firmware verification code code3 of the third level unit; the content information may include the upgraded firmware of each level of units, i.e., the upgraded firmware 1 of the first level unit, the upgraded firmware 2 of the second level unit, and the upgraded firmware 3 of the third level unit. Of course, Figure 2d The format shown is only one possible format of the firmware data, and the specific format of the firmware data is not limited thereby.
[0036] In one implementation scenario, as a possible implementation, the firmware data may be sent from a cloud server; or, as another possible implementation, the firmware data may be downloaded from a cloud server by a device where the tree-like hierarchical system is located; or, as another possible implementation, the firmware data may be downloaded by users such as administrators and operation and maintenance personnel and then imported into the device where the tree-like hierarchical system is located. Of course, the above examples are only several possible ways to obtain firmware data, and the ways to obtain firmware data are not limited here.
[0037] In one implementation scenario, after obtaining the firmware data, the firmware data can be parsed to obtain a number of upgrade firmware and the firmware size and first firmware verification code of each level unit. On this basis, the upgrade firmware of each level unit can be determined based on at least one of the firmware size and the first firmware verification code of each level unit, and the upgrade information of each level unit can be obtained based on the first firmware verification code and upgrade attachment of each level unit. The above method separates the upgrade firmware of each level unit by parsing the firmware size and the first firmware verification code obtained from the firmware data, which helps to improve the accuracy of firmware separation.
[0038] In a specific implementation scenario, the upgrade firmware of each unit at each level can be determined based on the firmware size of each unit at each level. Figure 2d , taking a tree-like hierarchical system including three-level units as an example, the firmware size of the first-level unit is size1, the firmware size of the second-level unit is size2, and the firmware size of the third-level unit is size3. Then, after parsing and obtaining a number of upgraded firmwares, the firmware size of each upgraded firmware can be measured. If it is the same as any of the aforementioned size1, size2, and size3, the upgraded firmware of each level of unit can be determined. For example, if a firmware size of an upgraded firmware is measured to be equal to size1, it can be determined that the upgraded firmware belongs to the first-level unit; or, if a firmware size of an upgraded firmware is measured to be equal to size2, it can be determined that the upgraded firmware belongs to the second-level unit; or, if a firmware size of an upgraded firmware is measured to be equal to size3, it can be determined that the upgraded firmware belongs to the third-level unit. Of course, the above example is only a possible example in actual application, and other situations can be deduced by analogy, and no examples are given here one by one.
[0039] In a specific implementation scenario, the upgrade firmware of each unit at each level can be determined based on the first firmware verification code of each unit at each level. Figure 2d, taking the tree-like hierarchical system including three-level units as an example, the first firmware verification code of the first-level unit is code1, the first firmware verification code of the second-level unit is code2, and the first firmware verification code of the third-level unit is code3. Then, when a number of upgraded firmwares are obtained through parsing, each upgraded firmware can be verified to obtain the second firmware verification code of the upgraded firmware. If it is the same as any of the aforementioned code1, code2, and code3, the upgraded firmware of each level of unit can be determined. For example, if the second firmware verification code of a certain upgraded firmware is the same as code1 after verification, it can be determined that the upgraded firmware belongs to the first-level unit; or, if the second firmware verification code of a certain upgraded firmware is the same as code2 after verification, it can be determined that the upgraded firmware belongs to the second-level unit; or, if the second firmware verification code of a certain upgraded firmware is the same as code3 after verification, it can be determined that the upgraded firmware belongs to the third-level unit. Of course, the above example is only a possible example in the actual application process, and other situations can be deduced by analogy, and no examples are given here one by one.
[0040] In a specific implementation scenario, the upgrade firmware of each unit at each level can be determined in combination with the firmware size of each unit at each level and the first firmware verification code. Specifically, for each upgrade firmware, its firmware size can be measured first. If it is equal to one of the firmware sizes parsed from the firmware data, the unit level to which the upgrade firmware belongs can be directly determined based on this; or, if it is equal to more than one of the firmware sizes parsed from the firmware data (such as two, three, or more than three), then the upgrade firmware is verified again to obtain a second firmware verification code, and then these multiple sizes are compared with the first firmware verification code respectively. If they are the same as one of them, the unit level to which the upgrade firmware belongs can be determined. For example, please refer to Figure 2d , taking the tree-like hierarchical system including three-level units as an example, for any upgraded firmware, its firmware size can be measured first. If it is equal to size1, it is determined that the upgraded firmware belongs to the first-level unit. If it is equal to size2, it is determined that the upgraded firmware belongs to the second-level unit. If it is size3, it is determined that the upgraded firmware belongs to the third-level unit; or, if it is equal to size1 and size2, the upgraded firmware can be verified again to obtain the second firmware verification code, and then compared with code1 and code2. If it is equal to code1, it can be determined that the upgraded firmware belongs to the first-level unit. If it is equal to code2, it can be determined that the upgraded firmware belongs to the second-level unit. Of course, the above examples are only possible examples of actual application processes, and no one will be given here.
[0041] In a specific implementation scenario, after obtaining the first firmware verification code and the upgrade firmware of each level of units, for each level of units, the first firmware verification code and the upgrade firmware can be combined into the upgrade information of the level of units.
[0042] Step S12: Based on the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system, encapsulate and obtain a first communication frame corresponding to the secondary unit.
[0043] In the embodiment of the present disclosure, the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system. Figure 2a , under the level of the first-level unit (i.e., the top-level unit), the second-level unit and the third-level unit are all secondary units. Other situations can be deduced by analogy, and no examples are given here one by one.
[0044] In one implementation scenario, the first identifier representing the level at which the secondary unit is located and the second identifier representing that the frame type is a broadcast frame can be encapsulated in the first byte area representing the destination address in the first communication frame, and the upgrade firmware of the secondary unit can be encapsulated in the second byte area representing the valid data in the first communication frame. In the above method, the first identifier and the second identifier are encapsulated in the first byte area representing the destination address, and the upgrade firmware is encapsulated in the second byte area representing the valid data. After receiving the first communication frame, the secondary unit can clearly know that the first communication frame belongs to a broadcast frame based on the first identifier, and use the first identifier to determine whether the destination level of the first communication frame is the level at which it is located, so as to determine whether to take out the upgrade firmware from the third byte area representing the valid data for upgrading. Therefore, it can avoid the wrong transmission of the upgrade firmware as much as possible, and effectively improve the accuracy of transmitting the upgrade firmware.
[0045] In a specific implementation scenario, taking the Aurora bus protocol as an example, please refer to Figure 2e , Figure 2e FIG. 1 is a schematic diagram of an embodiment of a frame format of the Aurora bus protocol. Figure 2e As shown, the first row byte 0 in the communication frame of the Aurora bus protocol represents the first byte area of the destination address, and the second byte area of the valid data is represented from the third row to the second last row. In addition, byte 3 to byte 0 in the last row represent the third byte area of the check code, which can be used to load the first firmware check code. Of course, in the case of adopting other preset bus protocols, this can be deduced by analogy, and no more examples are given here.
[0046] In a specific implementation scenario, still taking the Aurora bus protocol as an example, please refer to Figure 2f , Figure 2f 1 is a schematic diagram of the format of an embodiment of a destination address in the Aurora bus protocol. Figure 2fAs shown, bit[7:6] indicates the level, which is used to load the first identifier, and bit[5:0] indicates the frame type, which is used to load the second identifier. In the Aurora bus protocol, if bit[5:0] is 0x3f, it represents a broadcast frame, that is, the second identifier representing the frame type as a broadcast frame can be 0x3f. In addition, taking the first identifier representing the level of the secondary unit as 0x1 as an example, the destination address in the first communication frame can be 0x7f. Of course, the above example is only a possible example in actual application, and does not limit other situations.
[0047] In another implementation scenario, as another possible implementation, as mentioned above, a third byte area representing a check code may also be provided in the first communication frame. In this case, the first firmware check code corresponding to the secondary unit may be encapsulated in the third byte area representing the check code in the first communication frame. On this basis, the secondary unit may perform a check based on the received upgraded firmware to obtain a second firmware check code. Exemplarily, in the case where the first firmware check code is a CRC check code, a CRC check may be performed based on the received upgraded firmware to obtain a second firmware check code which is also a CRC check code. Of course, other check methods may also be used, which are not limited here. Furthermore, the secondary unit may determine whether the received upgraded firmware is usable based on the comparison result between the second firmware check code and the received first firmware check code. For details, please refer to the relevant description in the following public embodiments, which will not be repeated here.
[0048] Step S13: broadcasting a first communication frame corresponding to the secondary unit in the tree-like hierarchical system, and the secondary unit receives and parses the first communication frame to obtain upgrade information of the secondary unit.
[0049] Specifically, after encapsulating the first communication frames corresponding to each secondary unit, the first communication frames can be broadcasted in the tree-like hierarchical system, and the secondary unit receives and parses the first communication frames to obtain the upgrade information required by the secondary unit. The specific process can be referred to the relevant description in the following public embodiment, which will not be repeated here.
[0050] Step S14: Perform local upgrade based on the upgrade information of the top-level unit, and broadcast a second communication frame indicating the start of the upgrade in the tree-like hierarchical system to instruct the secondary units to perform the upgrade.
[0051] In one implementation scenario, for the top-level unit, since the aforementioned process steps such as parsing firmware data are executed locally in the top-level unit, from the perspective of efficiency, it is not necessary to encapsulate the corresponding first communication frame for the top-level unit, but the local upgrade can be performed directly based on the upgrade information of the top-level unit. Of course, the top-level unit can also perform relevant verifications before using the upgraded firmware for upgrading. Exemplarily, as mentioned above, the upgrade information can also include a first firmware verification code. Then, before using the upgraded firmware for local upgrading, it can also be verified based on the upgraded firmware of the top-level unit (such as the aforementioned CRC verification) to obtain the second firmware verification code of the top-level unit, and then based on the comparison results between the first firmware verification code and the second firmware verification code corresponding to the top-level unit, determine whether the upgraded firmware of the top-level unit is available. On this basis, in response to the determination that the upgraded firmware of the top-level unit is available, the step of performing local upgrading based on the upgrade information of the top-level unit can be executed. Specifically, the top-level unit can perform local upgrading based on its upgraded firmware.
[0052] In a specific implementation scenario, please refer to Figure 2c , the processing circuit in the top-level unit can first read its first firmware verification code from its volatile storage medium, and then compare the calculated second firmware verification code with the first firmware verification code. If they are the same, a subsequent local upgrade can be performed. Otherwise, the upgrade state of failed upgrade can be returned. In other words, the volatile storage medium can at least be used to cache the upgrade firmware. Of course, it can also be used to cache the first firmware verification code, which is not limited here.
[0053] In a specific implementation scenario, please refer to Figure 2c ,During the local upgrade process, the processing circuit in the top unit can first erase its non-volatile storage medium, then program the upgrade firmware into the non-volatile storage medium, and return the upgrade status of successful upgrade.,That is, the upgrade firmware can be programmed into the non-volatile storage medium to achieve firmware upgrade of the processing circuit.
[0054] In one implementation scenario, the top-level unit can start to perform a local upgrade based on its upgrade information and broadcast the second communication frame at the same time. Alternatively, the former can start to execute before the latter, or the latter can start to execute before the former. The order in which the two start to execute is not limited here. As a preferred implementation method in the actual application process, the top-level unit can broadcast the first communication frame to the secondary unit while upgrading based on its upgrade information. After the secondary unit parses the first communication frame to obtain the upgrade information of the secondary unit, it can start to upgrade based on its upgrade information in response to the second communication frame. Since the data transmission time between units at each level is very short, it can be ignored compared to the time to burn the firmware into the storage space. Therefore, from a macro perspective, units at each level can be regarded as being upgraded at the same time. Of course, units at the same level can be upgraded based on the upgrade information of the units at that level at the same time.
[0055] In one implementation scenario, the specific process of the secondary unit starting the upgrade after receiving the second communication frame can refer to the specific process of the local upgrade of the top-level unit mentioned above, which will not be repeated here. Alternatively, you can also refer to the relevant description in the following public embodiments, which will not be repeated here.
[0056] In one implementation scenario, an upgrade status of at least one of the secondary unit and the top-level unit may also be obtained, and the upgrade status indicates whether the upgrade is successful.
[0057] It should be noted that, as mentioned above, the frame formats of the first communication frame and the second communication frame conform to the preset bus protocol adopted by the communication connection between the units at each level. For example, when the communication connection between the units at each level adopts the Aurora bus protocol, the frame formats of the first communication frame and the second communication frame conform to the Aurora bus protocol (such as Figure 2e Of course, when other preset bus protocols are adopted, the same can be applied and no further examples are given here.
[0058] The above scheme is based on the firmware data for upgrading the tree-like hierarchical system, and the upgrade information of each unit at each level in the tree-like hierarchical system is parsed, and the local unit is the top-level unit as the root node in the tree-like hierarchical system. The upgrade information at least includes the upgraded firmware. Then, based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, the first communication frame corresponding to the secondary unit is encapsulated, and the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system, so that the first communication frame corresponding to the secondary unit is broadcast in the tree-like hierarchical system, the secondary unit receives and parses the first communication frame, obtains the upgrade information of the secondary unit, and then performs the local scheme based on the upgrade information of the top-level unit. The secondary unit is upgraded and the second communication frame representing the start of the upgrade is broadcasted in the tree-like hierarchical system to instruct the secondary unit to upgrade. Therefore, on the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels and causing adverse effects such as upgrade failure or even equipment failure, which helps to improve the security of the upgrade. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0059] See also Figure 3 , Figure 3 This is a flowchart of another embodiment of the firmware upgrade of the present application. Specifically, it may include the following steps:
[0060] Step S31: receiving a first communication frame broadcasted from a top-level unit to secondary units in a tree-like hierarchical system.
[0061] In the disclosed embodiment, different from the aforementioned disclosed embodiment, the local unit is a secondary unit in the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit. The top-level unit serves as the root node of each level of the unit in the tree-like hierarchical system. The first communication frame is encapsulated by the top-level unit based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system. The upgrade information is parsed by the top-level unit based on the firmware data for upgrading the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware. For details, please refer to the relevant description in the aforementioned disclosed embodiment, which will not be repeated here.
[0062] Step S32: performing analysis based on the first communication frame to obtain the upgrade information of the local unit.
[0063] Specifically, for any sub-unit at any level in the tree-like hierarchical system, after receiving the first communication frame, it can first be determined whether the destination level of the first communication frame is a local unit based on the first identifier loaded in the first byte area of the first communication frame, the first byte area represents the destination address, and the first identifier represents the destination level. It should be noted that the specific meaning of the first byte area and the first identifier can be found in the relevant description in the aforementioned public embodiment, which will not be repeated here. On this basis, in response to the determination that the destination level of the first communication frame is a local unit, parsing based on the first communication frame can be performed to obtain upgrade information of the local unit, so as to facilitate subsequent local upgrades.
[0064] In one implementation scenario, as a possible example, taking the local unit as a secondary unit in a tree-like hierarchical system, if the first identifier loaded in the first byte area of the received first communication frame is 0x1 (for details, please refer to the relevant description in the aforementioned public embodiment), it can be determined that the destination level of the first communication frame is exactly the local unit, so it can be parsed based on the first communication frame to obtain the upgrade information of the local unit; conversely, if the first identifier loaded in the first byte area of the received first communication frame is not 0x1, it can be determined that the destination level of the first communication frame is not the local unit. Of course, the above example is only a possible example in the actual application process, and does not limit other possible situations, so it will not be given one by one here.
[0065] In one implementation scenario, in response to the destination level of the first communication frame not being a local unit, the first communication frame can be forwarded to the next level so that the first communication frame can be broadcast in the tree-like hierarchical system, and then each secondary unit in the tree-like hierarchical system that needs to be upgraded can receive the corresponding first communication frame to perform subsequent local upgrades.
[0066] Step S33: In response to receiving a second communication frame broadcasted from the top-level unit and indicating the start of the upgrade, perform a local upgrade based on the upgrade information of the local unit.
[0067] In one implementation scenario, such as the aforementioned disclosed embodiment, the upgrade information may also include a first firmware verification code (for details, please refer to the aforementioned disclosed embodiment), that is, after the local unit receives the corresponding first communication frame, or after receiving the second communication frame, the upgrade firmware of the local unit and its first firmware verification code may be obtained. On this basis, the upgrade firmware of the local unit may be verified first to obtain the second firmware verification code, and then based on the comparison result between the first firmware verification code and the second firmware verification code corresponding to the local unit, it is determined whether the upgrade firmware of the local unit is available. In response to the determination that the upgrade firmware of the local unit is unavailable, an upgrade status indicating the failure of the upgrade may be fed back to the top-level unit, and the subsequent steps of performing local upgrades based on the upgrade information of the local unit may be skipped. In the above method, before the formal upgrade, a firmware verification is first performed to compare and verify the verification code obtained by calculation with the verification code in the upgrade information, so as to determine whether the received upgrade firmware is available, which can help improve the security of the firmware upgrade.
[0068] In an implementation scenario, please refer to Figure 2c After receiving the second communication frame, in response to the upgrade firmware of the local unit being determined to be available, the non-volatile storage medium (e.g., flash memory) in the local unit can be erased, and then the upgrade firmware of the local unit can be programmed into the non-volatile storage medium to implement firmware upgrade of the processing circuit (e.g., FPGA, ASIC, etc.) in the local unit.
[0069] In one implementation scenario, after the upgrade information of the local unit is parsed, or after the local upgrade is performed based on the upgrade information of the local unit, the upgrade status can be fed back to the top-level unit, and the upgrade status indicates whether the upgrade is successful, so that the top-level unit can be informed of the upgrade status of the secondary unit in a timely manner. It should be noted that after the top-level unit learns the upgrade status, if it finds that there is any unit that has failed to upgrade, it can perform operations such as reminding relevant personnel to check and resending the first communication frame, which is not limited here.
[0070] The above scheme receives a first communication frame broadcasted from a top-level unit in a tree-like hierarchical system to a secondary unit. The top-level unit is the root node of each level of the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit. The first communication frame is encapsulated by the top-level unit based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system. The upgrade information is parsed by the top-level unit based on the firmware data for upgrading the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware. The upgrade information of the local unit is then parsed based on the first communication frame to obtain the upgrade information of the local unit in response to receiving the broadcast from the top-level unit and indicating the start of the upgrade. The second communication frame is used to perform a local upgrade based on the upgrade information of the local unit. Therefore, on the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels, causing upgrade failures or even equipment failures and other adverse effects as much as possible, which helps to improve the upgrade security. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0071] See also Figure 4 , Figure 4 FIG. 1 is a flowchart of another embodiment of the firmware upgrade method of the present application. As a possible example, in the tree-like hierarchical system, Figure 2b When the architecture is shown, the firmware upgrade can be performed specifically by including but not limited to the following steps.
[0072] Step S401: The user issues an upgrade instruction.
[0073] Specifically, the user can communicate with the device where the tree-like hierarchical system is located through a mobile phone, a tablet computer, a microcomputer and other devices to send an upgrade instruction to it.
[0074] Step S402: The primary unit obtains firmware data and caches it in a local volatile storage medium.
[0075] Step S403: The primary unit reads the first header information and the second header information of the firmware data, obtains the firmware size and the first firmware verification code of the primary unit, and the firmware size and the first firmware verification code of the secondary unit, and accordingly separates the upgraded firmware of the primary unit and the upgraded firmware of the secondary unit from the content information of the firmware data.
[0076] Specifically, after executing the above step S403, step S404 and step S411 may be entered simultaneously to be executed in parallel, thereby shortening the upgrade time as much as possible.
[0077] Step S404: the primary unit reads the upgrade firmware and the first firmware verification code of the secondary unit from its volatile storage medium, and sends them to the secondary unit in a broadcast frame via a preset bus protocol.
[0078] Step S405: the secondary unit caches the received upgrade firmware and the first firmware verification code into its volatile storage medium.
[0079] Step S406: The primary unit sends an upgrade instruction to the secondary unit via a broadcast frame.
[0080] Step S407: the secondary unit reads the upgraded firmware from its volatile storage medium, performs verification, and calculates a second firmware verification code.
[0081] Step S408: The secondary unit compares the second firmware verification code with the received first firmware verification code.
[0082] Step S409: When the second-level unit compares the first firmware verification code and the second firmware verification code and finds that they are consistent, it erases its non-volatile storage medium and programs the upgraded firmware into its non-volatile storage medium.
[0083] Step S410: The secondary unit feeds back the upgrade status to the primary unit.
[0084] Step S411: the primary unit reads its upgraded firmware from its volatile storage medium, performs verification, and calculates a second firmware verification code.
[0085] Step S412: the first level unit compares its second firmware verification code with the first firmware verification code.
[0086] Step S413: When the first firmware verification code is compared with the second firmware verification code and they are consistent, the first-level unit erases its non-volatile storage medium and programs the upgraded firmware into its non-volatile storage medium.
[0087] Step S414: the primary unit obtains the upgrade status of the primary unit and the secondary unit.
[0088] It should be noted that if it is found that all units at all levels are upgraded successfully, the upgrade process can be terminated. On the contrary, if it is found that any unit fails to upgrade, operations such as reminding relevant personnel to check and resending broadcast frames can be performed, which are not limited here. Figure 2b The illustrated architecture is a possible example, and other processes are not limited thereby. For example, referring to the related operations in the aforementioned disclosed embodiments, the primary unit (ie, the top unit) and the secondary unit can respectively perform the upgrade locally after broadcasting the upgrade instruction.
[0089] The above solution, after parsing and obtaining the upgrade information, executes the related process steps in parallel, which can shorten the upgrade time as much as possible and help improve the upgrade efficiency.
[0090] See also Figure 5 , Figure 5 : is a schematic diagram of a framework of an embodiment of a firmware upgrade device 50 of the present application. The firmware upgrade device 50 may include: a data parsing module 51, an information encapsulation module 52, a system broadcast module 53 and an upgrade indication module 54. The data parsing module 51 is used to parse and obtain the upgrade information of each unit at each level in the tree-like hierarchical system based on the firmware data for upgrading the tree-like hierarchical system; wherein the local unit is the top-level unit as the root node in the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware; the information encapsulation module 52 is used to encapsulate and obtain the first communication frame corresponding to the secondary unit based on the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system; wherein the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system; the system broadcast module 53 is used to broadcast the first communication frame corresponding to the secondary unit in the tree-like hierarchical system, and the secondary unit receives and parses the first communication frame to obtain the upgrade information of the secondary unit; the upgrade indication module 54 is used to perform a local upgrade based on the upgrade information of the top-level unit, and broadcast a second communication frame representing the start of the upgrade in the tree-like hierarchical system to instruct the secondary unit to upgrade.
[0091] In the above scheme, the firmware upgrade device 50 parses the firmware data for upgrading the tree-like hierarchical system to obtain the upgrade information of each unit at each level in the tree-like hierarchical system, and the local unit is the top-level unit as the root node in the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware. Then, based on the upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, the first communication frame corresponding to the secondary unit is encapsulated, and the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system, so that the first communication frame corresponding to the secondary unit is broadcast in the tree-like hierarchical system, the secondary unit receives and parses the first communication frame, obtains the upgrade information of the secondary unit, and then based on the upgrade information of the top-level unit The information is locally upgraded, and the second communication frame representing the start of the upgrade is broadcasted in the tree-like hierarchical system to instruct the secondary unit to upgrade. Therefore, on the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels, causing upgrade failures or even equipment failures and other adverse effects as much as possible, which helps to improve the upgrade security. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help to improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0092] In some disclosed embodiments, the information encapsulation module 52 includes a first encapsulation submodule, which is used to encapsulate a first identifier representing the layer of the secondary unit and a second identifier representing that the frame type is a broadcast frame in a first byte area representing the destination address in the first communication frame; the information encapsulation module 52 includes a second encapsulation submodule, which is used to encapsulate the upgraded firmware of the secondary unit in a second byte area representing valid data in the first communication frame.
[0093] In some disclosed embodiments, the upgrade information also includes a first firmware verification code, and the information encapsulation module 52 includes a third encapsulation sub-module, which is used to encapsulate the first firmware verification code corresponding to the secondary unit in the third byte area representing the verification code in the first communication frame; wherein the secondary unit verifies based on the received upgraded firmware to obtain a second firmware verification code, and determines whether the received upgraded firmware is available based on a comparison result between the second firmware verification code and the received first firmware verification code.
[0094] In some disclosed embodiments, the data analysis module 51 includes a firmware analysis submodule, which is used to perform analysis based on firmware data to obtain a number of upgraded firmware and the firmware size and first firmware verification code of each unit at each level; the data analysis module 51 includes a firmware determination submodule, which is used to determine the upgraded firmware of each unit at each level based on the firmware size of each unit at each level and at least one of the first firmware verification code; the data analysis module 51 includes an information acquisition submodule, which is used to obtain the upgrade information of each unit at each level based on the first firmware verification code and upgraded firmware of each unit at each level.
[0095] In some disclosed embodiments, the upgrade information also includes a first firmware verification code, and the firmware upgrade device 50 also includes a firmware verification module, which is used to perform verification based on the upgraded firmware of the top-level unit to obtain a second firmware verification code of the top-level unit; the firmware upgrade device 50 also includes an available determination module, which is used to determine whether the upgraded firmware of the top-level unit is available based on a comparison result between the first firmware verification code and the second firmware verification code corresponding to the top-level unit respectively; the upgrade indication module 54 is specifically used to execute the step of performing a local upgrade based on the upgrade information of the top-level unit in response to the upgraded firmware of the top-level unit being determined to be available.
[0096] In some disclosed embodiments, the firmware upgrade device 50 further includes a status acquisition module for acquiring an upgrade status of at least one of the secondary unit and the top-level unit; wherein the upgrade status indicates whether the upgrade is successful.
[0097] In some disclosed embodiments, the firmware data includes first header information, second header information, and content information, the first header information includes the firmware size of each level of the unit, the second header information includes the first firmware verification code of each level of the unit, and the content information includes the upgraded firmware of each level of the unit;
[0098] In some disclosed embodiments, units at each level in the tree-like hierarchical system are connected to each other for communication based on a preset bus protocol, and the frame formats of the first communication frame and the second communication frame conform to the preset bus protocol, which at least includes the Aurora bus protocol.
[0099] In some disclosed embodiments, each level of the unit includes a processing circuit, and a non-volatile storage medium and a volatile storage medium electrically connected to the processing circuit, respectively, and the volatile storage medium is at least used to cache upgrade firmware, and the upgrade firmware is programmed into the non-volatile storage medium to implement firmware upgrade of the processing circuit.
[0100] See also Figure 6 , Figure 6 It is a schematic diagram of the framework of another embodiment of the firmware upgrade device 60 of the present application. The firmware upgrade device 60 includes: a broadcast receiving module 61, a receiving and parsing module 62 and a local upgrade module 63. The broadcast receiving module 61 is used to receive a first communication frame broadcasted from a top-level unit to a secondary unit in a tree-like hierarchical system; wherein the top-level unit is the root node of each level of the unit in the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit. The first communication frame is obtained by the top-level unit based on the upgrade information of the secondary unit and the level encapsulation of the secondary unit in the tree-like hierarchical system. The upgrade information is obtained by the top-level unit based on the firmware data parsed for upgrading the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware; the receiving and parsing module 62 is used to parse based on the first communication frame to obtain the upgrade information of the local unit; the local upgrade module 63 is used to perform a local upgrade based on the upgrade information of the local unit in response to receiving a second communication frame broadcasted from the top-level unit and indicating the start of the upgrade.
[0101] In the above scheme, the firmware upgrade device 60 receives a first communication frame broadcasted from a top-level unit in a tree-like hierarchical system to a secondary unit. The top-level unit is the root node of each level of the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit. The first communication frame is obtained by the top-level unit based on the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system. The upgrade information is obtained by parsing the firmware data for upgrading the tree-like hierarchical system by the top-level unit, and the upgrade information at least includes the upgraded firmware. The upgrade information of the local unit is then parsed based on the first communication frame to obtain the upgrade information of the local unit in response to receiving the broadcast from the top-level unit and representing The second communication frame for starting the upgrade is based on the upgrade information of the local unit for local upgrade. Therefore, on the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels, causing upgrade failures or even equipment failures and other adverse effects as much as possible, which helps to improve the security of the upgrade. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help to improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0102] In some disclosed embodiments, the firmware upgrade device 60 includes a hierarchy determination module for determining whether the destination hierarchy of the first communication frame is a local unit based on a first identifier loaded in a first byte area within the first communication frame; wherein the first byte area represents a destination address, and the first identifier represents a destination hierarchy; the receiving and parsing module 62 is specifically used to execute a step of parsing based on the first communication frame to obtain upgrade information of the local unit in response to the destination hierarchy of the first communication frame being determined to be a local unit.
[0103] In some disclosed embodiments, the firmware upgrade device 60 includes an information forwarding module for continuing to forward the first communication frame to a next level in response to determining that the destination level of the first communication frame is not a local unit.
[0104] In some disclosed embodiments, the upgrade information also includes a first firmware verification code, and the firmware upgrade device 60 includes a firmware verification module for performing verification based on the upgraded firmware of the local unit to obtain a second firmware verification code of the local unit; the firmware upgrade device 60 includes an available determination module for determining whether the upgraded firmware of the local unit is available based on a comparison result between the first firmware verification code and the second firmware verification code respectively corresponding to the local unit; the firmware upgrade device 60 includes a feedback skip module for, in response to the upgraded firmware of the local unit being determined to be unavailable, feeding back an upgrade status indicating an upgrade failure to the top-level unit, and skipping the step of performing a local upgrade based on the upgrade information of the local unit.
[0105] In some disclosed embodiments, the firmware upgrade device 60 includes a status feedback module for feeding back the upgrade status to the top-level unit; wherein the upgrade status indicates whether the upgrade is successful.
[0106] See also Figure 7 , Figure 7 It is a schematic diagram of the framework of an embodiment of an electronic device 70 of the present application. The electronic device 70 includes a storage medium 71 and a processing circuit 72 coupled to each other, the storage medium 71 stores program instructions, and the processing circuit 72 is used to execute the program instructions to implement the steps in any of the above-mentioned firmware upgrade method embodiments. For details, please refer to the aforementioned disclosed embodiments, which will not be repeated here. Specifically, the processing circuit 72 can be an integrated circuit chip with signal processing capabilities. The processing circuit 72 can also be a dedicated integrated circuit, a field programmable gate array, etc., which is not limited here. In addition, the storage medium 71 can be provided with multiple or multiple types, such as volatile storage media, non-volatile storage media, etc. As a possible implementation method, please refer to Figure 2c The frame structure shown is not limited here.
[0107] In the above scheme, the processing circuit 72 in the electronic device 70 implements the steps in any of the above firmware upgrade method embodiments. On the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels, causing upgrade failure, or even equipment failure and other adverse effects, which helps to improve the upgrade security. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help to improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0108] See also Figure 8 , Figure 8 80 is a schematic diagram of a framework of an embodiment of an electronic device 80 of the present application. The electronic device 80 at least includes a tree-like hierarchical system 81, and each unit (not shown) in the tree-like hierarchical system 81 is an electronic device in the above-mentioned electronic device embodiment. As a possible implementation, each unit communicates with each other based on a preset bus protocol, and the preset bus protocol at least includes an Aurora bus protocol. It should be noted that the specific architecture of the tree-like hierarchical system 81 can be found in Figure 2a , Figure 2b In addition, the electronic device 80 may specifically include but is not limited to a security door, a camera, etc., and the specific type of the electronic device 80 is not limited here.
[0109] In the above scheme, the electronic device 80 at least includes a tree-like hierarchical system 81, and the units at each level in the tree-like hierarchical system 81 are the electronic devices in the above electronic device embodiment. On the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels, causing upgrade failure, or even equipment failure and other adverse effects, which helps to improve the upgrade security. On the other hand, the top-level unit can achieve parallel upgrades of units at each level as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help to improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0110] See also Fig. 9 , Fig. 9 1 is a schematic diagram of a framework of an embodiment of a computer-readable storage medium 90 of the present application. The computer-readable storage medium 90 stores program instructions 91 executable by a processor, and the program instructions 91 can be executed to implement the steps in any of the above firmware upgrade method embodiments.
[0111] In the above scheme, the computer-readable storage medium 90 implements the steps in any of the above firmware upgrade method embodiments. On the one hand, the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system are encapsulated in the first communication frame corresponding to the secondary unit, which can avoid the secondary unit mistakenly upgrading with the upgrade information of other levels, causing upgrade failures, or even equipment failures and other adverse effects as much as possible, which helps to improve the upgrade security. On the other hand, the top-level unit can achieve parallel upgrades of units at all levels as much as possible by broadcasting the first communication frame corresponding to the secondary unit and the second communication frame representing the start of the upgrade, which can shorten the upgrade time as much as possible and help to improve the upgrade efficiency. Therefore, the upgrade efficiency and upgrade security can be improved.
[0112] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0115] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0116] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. A firmware upgrade method, characterized in that: Applies to top-level units in a tree hierarchy, including: Based on the firmware data for upgrading the tree-like hierarchical system, the upgrade information of each unit at each level in the tree-like hierarchical system is obtained by parsing; wherein the local unit is the top-level unit as the root node in the tree-like hierarchical system, and the upgrade information at least includes the upgraded firmware, and the units at each level in the tree-like hierarchical system are connected to each other in communication based on a preset bus protocol; Based on the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system, encapsulate and obtain a first communication frame corresponding to the secondary unit; wherein the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system; Broadcasting a first communication frame corresponding to the secondary unit in the tree-like hierarchical system, the secondary unit receiving and parsing the first communication frame to obtain upgrade information of the secondary unit; wherein the frame format of the first communication frame complies with the preset bus protocol; A local upgrade is performed based on the upgrade information of the top-level unit, and a second communication frame representing the start of the upgrade is broadcast in the tree-like hierarchical system to instruct each level of the unit to perform a parallel upgrade; wherein the frame format of the second communication frame complies with the preset bus protocol.
2. The method according to claim 1, characterized in that The step of encapsulating the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system to obtain a first communication frame corresponding to the secondary unit includes: encapsulate a first identifier representing the level of the secondary unit and a second identifier representing that the frame type is a broadcast frame in a first byte area representing a destination address in the first communication frame; The upgraded firmware of the secondary unit is encapsulated in the second byte area representing valid data in the first communication frame.
3. The method according to claim 1 or 2, characterized in that: The upgrade information also includes a first firmware verification code, and the method further includes: Encapsulating the first firmware check code of the secondary unit in the third byte area representing the check code in the first communication frame; The secondary unit verifies the received upgrade firmware to obtain a second firmware verification code, and determines whether the received upgrade firmware is usable based on a comparison result between the second firmware verification code and the received first firmware verification code.
4. The method according to claim 1, characterized in that: The firmware data for upgrading the tree-like hierarchical system is parsed to obtain the upgrade information of each unit at each level in the tree-like hierarchical system, including: Parsing the firmware data to obtain a number of upgrade firmwares and the firmware sizes and first firmware verification codes of the respective units at each level; Determine the upgrade firmware of each of the units at each level based on at least one of the firmware size of each of the units at each level and the first firmware verification code; Based on the first firmware verification code and the upgrade firmware of each of the units at each level, the upgrade information of each of the units at each level is obtained.
5. The method according to claim 1, characterized in that The upgrade information further includes a first firmware verification code. Before performing the local upgrade based on the upgrade information of the top-level unit, the method further includes: Perform verification based on the upgraded firmware of the top-level unit to obtain a second firmware verification code of the top-level unit; Determining whether the upgraded firmware of the top-level unit is available based on a comparison result between the first firmware verification code and the second firmware verification code of the top-level unit; Performing a local upgrade based on the upgrade information of the top-level unit includes: In response to determining that the upgraded firmware of the top-level unit is available, the step of performing the local upgrade based on the upgrade information of the top-level unit is performed.
6. The method according to claim 1, characterized in that The method further comprises: The upgrade status of at least one of the secondary unit and the top-level unit is obtained; wherein the upgrade status indicates whether the upgrade is successful.
7. The method according to claim 1, characterized in that The firmware data includes first header information, second header information and content information, wherein the first header information includes the firmware size of each of the units at each level, the second header information includes the first firmware verification code of each of the units at each level, and the content information includes the upgraded firmware of each of the units at each level; And / or, the preset bus protocol includes at least the Aurora bus protocol; And / or, each level of the unit includes a processing circuit, and a non-volatile storage medium and a volatile storage medium electrically connected to the processing circuit, respectively, and the volatile storage medium is at least used to cache the upgrade firmware, and the upgrade firmware is programmed into the non-volatile storage medium to realize firmware upgrade of the processing circuit.
8. A firmware upgrade method, characterized in that: Applicable to sub-units in a tree-like hierarchical system, including: Receiving a first communication frame broadcasted from a top-level unit to a secondary unit in a tree-like hierarchical system; wherein the top-level unit is a root node of units at each level in the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit, and the first communication frame is encapsulated by the top-level unit based on upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system, and the upgrade information is parsed by the top-level unit based on firmware data for upgrading the tree-like hierarchical system, and the upgrade information at least includes upgraded firmware; Parsing based on the first communication frame to obtain upgrade information of the local unit; wherein the local unit is the secondary unit; In response to receiving a second communication frame broadcasted from the top-level unit and indicating the start of an upgrade, a local upgrade is performed based on the upgrade information of the local unit so that each level of units is upgraded in parallel; wherein the units at each level in the tree-like hierarchical system are communicatively connected to each other based on a preset bus protocol, and the frame formats of the first communication frame and the second communication frame comply with the preset bus protocol.
9. The method according to claim 8, characterized in that Before parsing based on the first communication frame to obtain the upgrade information of the local unit, the method further includes: Determining whether a destination level of the first communication frame is a local unit based on a first identifier loaded in a first byte area in the first communication frame; wherein the first byte area represents a destination address, and the first identifier represents the destination level; The parsing based on the first communication frame to obtain the upgrade information of the local unit includes: In response to the destination level of the first communication frame being determined to be the local unit, the step of parsing based on the first communication frame to obtain upgrade information of the local unit is performed.
10. The method according to claim 9, characterized in that The method further comprises: In response to determining that the destination layer of the first communication frame is not the local unit, the first communication frame continues to be forwarded to a next layer.
11. The method according to claim 8, characterized in that The upgrade information also includes a first firmware verification code, and the method further includes: Perform verification based on the upgraded firmware of the local unit to obtain a second firmware verification code of the local unit; Determining whether the upgraded firmware of the local unit is available based on a comparison result between the first firmware verification code and the second firmware verification code of the local unit; In response to the upgrade firmware of the local unit being determined to be unavailable, an upgrade status indicating upgrade failure is fed back to the top-level unit, and the step of performing local upgrade based on the upgrade information of the local unit is skipped.
12. The method according to claim 8, characterized in that The method further comprises: Feedback the upgrade status to the top-level unit; wherein the upgrade status indicates whether the upgrade is successful.
13. A firmware upgrade device, characterized in that: Applies to top-level units in a tree hierarchy, including: A data parsing module, for parsing the firmware data for upgrading the tree-like hierarchical system to obtain upgrade information of each level unit in the tree-like hierarchical system; wherein the local unit is the top-level unit as the root node in the tree-like hierarchical system, and the upgrade information at least includes the upgrade firmware, and the units at each level in the tree-like hierarchical system are connected to each other in communication based on a preset bus protocol; An information encapsulation module, configured to encapsulate a first communication frame corresponding to the secondary unit based on the upgrade information of the secondary unit and the level of the secondary unit in the tree-like hierarchical system; wherein the secondary unit is located below the level of the top-level unit in the tree-like hierarchical system; A system broadcast module, used for broadcasting a first communication frame corresponding to the secondary unit in the tree-like hierarchical system, wherein the secondary unit receives and parses the first communication frame to obtain upgrade information of the secondary unit; wherein the frame format of the first communication frame complies with the preset bus protocol; An upgrade indication module is used to perform local upgrade based on the upgrade information of the top-level unit, and broadcast a second communication frame representing the start of the upgrade in the tree-like hierarchical system to instruct each level of the unit to perform parallel upgrade; wherein the frame format of the second communication frame conforms to the preset bus protocol.
14. A firmware upgrade device, characterized in that: Applicable to sub-units in a tree-like hierarchical system, including: A broadcast receiving module, configured to receive a first communication frame broadcasted from a top-level unit to a secondary unit in a tree-like hierarchical system; wherein the top-level unit is a root node of units at each level in the tree-like hierarchical system, and the secondary unit is located below the level of the top-level unit; the first communication frame is encapsulated by the top-level unit based on upgrade information of the secondary unit and the level at which the secondary unit is located in the tree-like hierarchical system; the upgrade information is parsed by the top-level unit based on firmware data for upgrading the tree-like hierarchical system, and the upgrade information at least includes upgraded firmware; a receiving and parsing module, configured to perform parsing based on the first communication frame to obtain upgrade information of a local unit; wherein the local unit is the secondary unit; A local upgrade module is used to respond to receiving a second communication frame broadcasted from the top-level unit and indicating the start of the upgrade, and perform a local upgrade based on the upgrade information of the local unit, so that the units at each level are upgraded in parallel; wherein the units at each level in the tree-like hierarchical system are communicatively connected to each other based on a preset bus protocol, and the frame formats of the first communication frame and the second communication frame comply with the preset bus protocol.
15. An electronic device, characterized in that: It comprises a storage medium and a processing circuit coupled to each other, the storage medium stores program instructions, and the processing circuit is used to execute the program instructions to implement the firmware upgrade method according to any one of claims 1 to 12.
16. An electronic device, characterized in that: At least includes a tree-like hierarchical system, and each level unit in the tree-like hierarchical system is the electronic device according to claim 15.
17. The electronic device according to claim 16, characterized in that: The units at each level are communicatively connected to each other based on a preset bus protocol, and the preset bus protocol at least includes an Aurora bus protocol.
18. A computer-readable storage medium, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the firmware upgrade method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Firmware upgrading method and distributed multilayer system
CN107329784A
Firmware upgrading method, terminal and firmware upgrading system
CN107465539A
Household appliance multi-MCU system online upgrading method, electronic equipment and medium
CN111142917A
