Firmware upgrade method, device and equipment for nodes in controller area network
By introducing a combination of Ethernet and CAN bus network into the controller LAN, remote firmware upgrades to the upgrade nodes are realized, solving the problems of cumbersome and high cost in the existing technology, and significantly saving time and labor costs.
Patent Information
- Application Number
- CN202211193955.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-09-28
AI Technical Summary
In the prior art, the node firmware upgrade operation in the controller local area network is cumbersome and time-consuming, and requires after-sales personnel to operate on the spot, resulting in high time and labor costs.
By establishing an Ethernet connection between the host computer and the controller and using the controller's local area network, remote firmware upgrades to the upgrade nodes are realized. The specific steps include analyzing the firmware information selected by the user, determining the node to be upgraded, transmitting the firmware information and data to the controller, and then transmitting the node to the node to be upgraded through the CAN bus network, and performing firmware upgrades.
Simplified firmware upgrade operations, save time and labor costs, and realize remote firmware upgrades to controller LAN nodes.
Smart Images

Figure CN115529238B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of firmware upgrade, and in particular to a method, device and equipment for upgrading the firmware of a node in a controller area network. Background Art
[0002] Firmware is hardware with software functions of electronic devices. After leaving the factory, electronic products will gradually expose more and more problems as users use them and the actual application scenarios vary. At this time, it is necessary to upgrade the firmware of the electronic equipment to fix bugs (defects) or meet various actual needs of users.
[0003] Currently, when it is necessary to upgrade the firmware of nodes (devices) in a Controller Area Network (CAN), after-sales personnel are often required to perform the firmware upgrade on site, which is cumbersome and time-consuming, and the upgrade is troublesome. Summary of the invention
[0004] The purpose of the present application is to provide a method, device and equipment for upgrading the firmware of nodes in a controller area network in order to address the deficiencies in the above-mentioned prior art, so as to simplify the upgrading operation and save time and manpower costs.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for upgrading the firmware of a node in a controller area network, the method being applied to a host computer in a firmware upgrade system, the firmware upgrade system comprising the host computer, a controller, and at least one node, the host computer being communicatively connected to the controller via Ethernet, and the controller being communicatively connected to each of the nodes via the controller area network; the method comprising:
[0007] Parse the upgrade firmware selected by the user to obtain firmware information and firmware data, wherein the firmware information includes the model of the node to which the firmware is applied, the firmware length, and firmware verification information;
[0008] Determine the node to be upgraded according to the firmware information and the model of each node;
[0009] Transmitting the firmware information, the firmware data and the identifier of the node to be upgraded to the controller via the Ethernet;
[0010] After the firmware information, the firmware data, and the identifier of the node to be upgraded are transmitted, prompt information is sent to the controller, where the prompt information is used to prompt the controller to start upgrading the node to be upgraded.
[0011] Optionally, determining the node to be upgraded according to the firmware information and the model of each of the nodes includes:
[0012] Determine at least one optional node according to the firmware information and the model of each of the nodes;
[0013] Determine at least one optional node to be selected according to the online information of each optional node reported by the controller;
[0014] In response to a user's selection operation on the at least one selectable node to be selected, the node to be upgraded is determined.
[0015] Optionally, the transmitting the firmware information, the firmware data, and the identifier of the node to be upgraded to the controller through the Ethernet includes:
[0016] Transmitting the firmware information and the identifier of the node to be upgraded to a first storage module in the controller via the Ethernet;
[0017] The firmware data is transmitted to a second storage module in the controller via Ethernet.
[0018] Optionally, the method further comprises:
[0019] Monitoring first progress information of transmitting the firmware information, the firmware data, and the identifier of the node to be upgraded to the controller;
[0020] The first progress information is displayed.
[0021] In a second aspect, an embodiment of the present application further provides a method for upgrading the firmware of a node in a controller area network, the method being applied to a controller in a firmware upgrade system, the firmware upgrade system comprising a host computer, the controller, and at least one node, the host computer being communicatively connected to the controller via Ethernet, and the controller being communicatively connected to each of the nodes via the controller area network; the method comprising:
[0022] Receiving firmware information, firmware data and an identifier of a node to be upgraded sent by the host computer through the Ethernet, wherein the firmware information includes firmware length and firmware verification information;
[0023] After receiving the prompt information sent by the host computer, the firmware information and the firmware data are transmitted to the node to be upgraded through the controller local area network according to the identification of the node to be upgraded, so that the node to be upgraded performs firmware upgrade based on the firmware information and the firmware data, wherein the prompt information is used to prompt the controller to start the upgrade of the node to be upgraded.
[0024] Optionally, the transmitting the firmware information and the firmware data to the node to be upgraded through the controller area network includes:
[0025] Transmitting the firmware information to the first storage unit of the node to be upgraded through the controller area network;
[0026] Acquire storage information of a second storage unit of the node to be upgraded through the controller area network;
[0027] According to the storage information of the second storage unit, the firmware data is divided to obtain a plurality of firmware sub-packet data;
[0028] The firmware sub-packet data are transmitted to the second storage unit in the node to be upgraded through the controller local area network.
[0029] Optionally, the method further comprises:
[0030] Monitoring second progress information of transmitting the firmware information and the firmware data to the node to be upgraded;
[0031] The second progress information is transmitted to the host computer via the Ethernet, so that the host computer displays the second progress information.
[0032] In a third aspect, an embodiment of the present application further provides a method for upgrading the firmware of a node in a controller area network, the method being applied to a node to be upgraded in a firmware upgrade system, the firmware upgrade system comprising a host computer, a controller, and a node to be upgraded, the host computer being connected to the controller via Ethernet, and the controller being connected to the node to be upgraded via a controller area network; the method comprising:
[0033] receiving firmware information and firmware data transmitted by the controller through the controller area network, wherein the firmware information includes firmware length and firmware verification information;
[0034] After the firmware data is received, restart the node to be upgraded, read the firmware data based on the firmware length in the firmware information through a boot loader, and verify the firmware data according to the firmware verification information in the firmware information;
[0035] If the verification passes, the original firmware of the node to be upgraded is replaced with the firmware data.
[0036] Optionally, reading the firmware data based on the firmware length in the firmware information by the boot loader, and verifying the firmware data according to firmware verification information in the firmware information, includes:
[0037] Reading firmware verification information and firmware length in the firmware information from the first storage unit of the node to be upgraded through the boot loader;
[0038] Reading, by the boot loader, firmware data corresponding to the firmware length from the second storage unit of the node to be upgraded based on the firmware length in the firmware information, and obtaining a first true check value according to the firmware data;
[0039] Determine, by the boot loader, whether the first true verification value and the firmware verification information in the firmware information are consistent.
[0040] Optionally, the firmware data includes a plurality of firmware sub-packet data; the firmware information and firmware data transmitted by the receiving controller through the controller area network include:
[0041] receiving firmware information transmitted by the controller via the controller area network;
[0042] The receiving controller currently transmits firmware sub-package data through the controller local area network and firmware sub-verification information corresponding to the firmware sub-package data, and verifies the firmware sub-package data according to a second true verification value obtained from the firmware sub-package data and the firmware sub-verification information corresponding to the firmware sub-package data.
[0043] In a fourth aspect, an embodiment of the present application provides a firmware upgrade device for a node in a controller area network, the device being applied to a host computer in a firmware upgrade system, the firmware upgrade system comprising the host computer, a controller, and at least one node, the host computer being communicatively connected to the controller via Ethernet, and the controller being communicatively connected to each of the nodes via the controller area network; the device comprising:
[0044] A parsing module, used to parse the upgrade firmware selected by the user to obtain firmware information and firmware data, wherein the firmware information includes the model of the node to which the firmware is applied, the firmware length and firmware verification information;
[0045] A determination module, used to determine the node to be upgraded according to the firmware information and the model of each node;
[0046] A first transmission module, configured to transmit the firmware information, the firmware data and the identifier of the node to be upgraded to the controller via the Ethernet;
[0047] The sending module is used to send prompt information to the controller after the firmware information, the firmware data and the identifier of the node to be upgraded are transmitted, wherein the prompt information is used to prompt the controller to start the upgrade of the node to be upgraded.
[0048] Optionally, the determination module is specifically used to determine at least one optional node based on the firmware information and the model of each of the nodes; determine at least one optional node to be selected based on the online information of each of the optional nodes reported by the controller; and determine the node to be upgraded in response to the user's selection operation for the at least one optional node to be selected.
[0049] Optionally, the first transmission module is specifically used to transmit the firmware information and the identifier of the node to be upgraded to the first storage module in the controller via the Ethernet; and transmit the firmware data to the second storage module in the controller via the Ethernet.
[0050] Optionally, the device further comprises: a display module;
[0051] The display module is used to monitor the first progress information of transmitting the firmware information, the firmware data and the identifier of the node to be upgraded to the controller; and display the first progress information.
[0052] In a fifth aspect, an embodiment of the present application provides a firmware upgrade device for a node in a controller area network, the device being applied to a controller in a firmware upgrade system, the firmware upgrade system comprising a host computer, the controller, and at least one node, the host computer being communicatively connected to the controller via Ethernet, and the controller being communicatively connected to each of the nodes via the controller area network; the device comprising:
[0053] A first receiving module is used to receive firmware information, firmware data and an identifier of a node to be upgraded sent by the host computer through the Ethernet, wherein the firmware information includes firmware length and firmware verification information;
[0054] The second transmission module is used to transmit the firmware information and the firmware data to the node to be upgraded through the controller local area network according to the identification of the node to be upgraded after receiving the prompt information sent by the upper computer, so that the node to be upgraded performs firmware upgrade based on the firmware information and the firmware data, wherein the prompt information is used to prompt the controller to start the upgrade of the node to be upgraded.
[0055] Optionally, the second transmission module is specifically used to transmit the firmware information to the first storage unit of the node to be upgraded through the controller local area network; obtain the storage information of the second storage unit of the node to be upgraded through the controller local area network; divide the firmware data according to the storage information of the second storage unit to obtain multiple firmware sub-package data; and transmit each firmware sub-package data to the second storage unit in the node to be upgraded through the controller local area network.
[0056] Optionally, the second transmission module is further used to monitor second progress information of transmitting the firmware information and the firmware data to the node to be upgraded; and transmit the second progress information to the host computer via the Ethernet so that the host computer displays the second progress information.
[0057] In a sixth aspect, an embodiment of the present application provides a firmware upgrade device for a node in a controller area network, the device being applied to a node to be upgraded in a firmware upgrade system, the firmware upgrade system comprising a host computer, a controller, and a node to be upgraded, the host computer being communicatively connected to the controller via Ethernet, and the controller being communicatively connected to the node to be upgraded via a controller area network; the device comprising:
[0058] A second receiving module, used to receive firmware information and firmware data transmitted by the controller through the controller local area network, wherein the firmware information includes firmware length and firmware verification information;
[0059] A verification module, configured to restart the node to be upgraded after the firmware data is received, read the firmware data based on the firmware length in the firmware information through the boot loader, and verify the firmware data according to the firmware verification information in the firmware information;
[0060] The replacement module is used to replace the original firmware of the node to be upgraded with the firmware data if the verification passes.
[0061] Optionally, the verification module is specifically used to read, through the boot loader, the firmware verification information and the firmware length in the firmware information from the first storage unit of the node to be upgraded; read, through the boot loader based on the firmware length in the firmware information, the firmware data corresponding to the firmware length from the second storage unit of the node to be upgraded, and obtain a first true verification value based on the firmware data; and determine, through the boot loader, whether the first true verification value and the firmware verification information in the firmware information are consistent.
[0062] Optionally, the firmware data includes a plurality of firmware sub-package data;
[0063] Correspondingly, the second receiving module is also used to receive firmware information transmitted by the controller through the controller local area network; receive firmware subpackage data currently transmitted by the controller through the controller local area network and firmware sub-verification information corresponding to the firmware subpackage data, and verify the firmware subpackage data based on a second true verification value obtained from the firmware subpackage data and the firmware subpackage data corresponding to the firmware subpackage data.
[0064] In the seventh aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the steps of the firmware upgrade method of the node in the controller local area network of the first aspect, the second aspect and the third aspect above.
[0065] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the firmware upgrade method for a node in a controller local area network of the first aspect, the second aspect and the third aspect are executed.
[0066] The beneficial effects of this application are:
[0067] The embodiment of the present application provides a method, device and equipment for firmware upgrade of nodes in a controller local area network. The method is applied to a host computer in a firmware upgrade system. The firmware upgrade system includes a host computer, a controller and at least one node. The host computer is connected to the controller through Ethernet, and the controller is connected to each node through the controller local area network. The method includes: parsing the upgrade firmware selected by the user to obtain firmware information and firmware data, the firmware information includes the model of the node to which the firmware is applied, the firmware length and firmware verification information; determining the node to be upgraded according to the firmware information and the model of each node; transmitting the firmware information, firmware data and the identification of the node to be upgraded to the controller through Ethernet; after the firmware information, firmware data and the identification of the node to be upgraded are transmitted, sending a prompt message to the controller, the prompt message is used to prompt the controller to start the upgrade of the node to be upgraded.
[0068] The firmware upgrade method for nodes in the controller area network provided by the embodiment of the present application is adopted. Based on the connection relationship between the host computer and the controller through Ethernet communication connection, and the controller and each node through the controller area network communication connection, the host computer matches the model of the node to which the firmware in the firmware information obtained by parsing with the model of each node to obtain the node to be upgraded. First, the firmware information, firmware data and the identifier of the node to be upgraded are transmitted to the controller through Ethernet, and then the controller can start the upgrade of the node to be upgraded through the controller area network based on the received firmware information and firmware data. It can be seen that the present application can remotely upgrade the firmware of the node to be upgraded through Ethernet, simplify the upgrade operation, and save time and labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0070] Figure 1 A schematic diagram of a scenario of a firmware upgrade system for nodes in a controller area network provided in an embodiment of the present application;
[0071] Figure 2 A flowchart of a method for upgrading the firmware of a node in a controller area network provided by an embodiment of the present application;
[0072] Figure 3 A flowchart of another method for upgrading the firmware of a node in a controller area network provided by an embodiment of the present application;
[0073] Figure 4 A flowchart of another method for upgrading the firmware of a node in a controller area network provided in an embodiment of the present application;
[0074] Figure 5 A flowchart of a firmware upgrade method for a node in a controller area network provided in another embodiment of the present application;
[0075] Figure 6 A schematic diagram of the structure of a storage module of a node to be upgraded provided in an embodiment of the present application;
[0076] Figure 7 A flowchart of another method for upgrading the firmware of a node in a controller area network provided by an embodiment of the present application;
[0077] Figure 8 A flowchart of another method for upgrading the firmware of a node in a controller area network provided in an embodiment of the present application;
[0078] Fig. 9 A schematic diagram of a process flow of firmware upgrade interaction between a host computer, a controller and a node to be upgraded provided in an embodiment of the present application;
[0079] Fig.10 A schematic diagram of the structure of a firmware upgrade device for a node in a controller area network provided by an embodiment of the present application;
[0080] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0082] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0083] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0084] Before explaining the embodiments of the present application in detail, the application scenario of the present application is first introduced. The application scenario may specifically be a scenario of performing firmware upgrade on a node in a controller area network (CAN), wherein the node may be referred to as a CAN device, and it is understood that a CAN device is a device that needs to perform firmware upgrade using a CAN bus network, wherein the CAN device may specifically be an external expansion module of a controller, and it should be noted that the present application does not limit the specific form of the CAN device. Figure 1 A schematic diagram of a scenario of a firmware upgrade system for nodes in a controller area network provided in an embodiment of the present application, such as Figure 1 As shown, the system may include: a host computer 101, a controller 102 and at least one node 103, the host computer 101 is connected to the controller 102 via Ethernet, and the controller 102 is connected to each node 103 via a controller area network, namely a CAN bus network.
[0085] Among them, the host computer 101 is connected to the controller 102 through an Ethernet switching device, and the relevant information (such as firmware information and firmware data) of the firmware upgrade selected by the user on the host computer 101 can be transmitted to the controller 102 through the Ethernet switching device, and then the controller 102 can send the received firmware information and firmware data to the node 103 (i.e., the node to be upgraded) that needs to be upgraded through the CAN bus network, and the node to be upgraded performs firmware upgrade according to the acquired firmware information and firmware data. The host computer 101, the controller 102, and the node to be upgraded can be specifically processed in the following example, so that the CAN device can be remotely upgraded with firmware through Ethernet, simplifying the upgrade operation and saving time and labor costs.
[0086] The firmware upgrade method of a node in a controller area network mentioned in the present application is illustrated as follows with reference to the accompanying drawings. Figure 2 1 is a flowchart of a method for upgrading the firmware of a node in a controller area network provided by an embodiment of the present application. The method is applied to the host computer 101 in the firmware upgrade system mentioned above, such as Figure 2 As shown, the method may include:
[0087] S201: parse the upgrade firmware selected by the user to obtain firmware information and firmware data.
[0088] The firmware information includes the model of the node to which the firmware is applied, the firmware length and the firmware verification information. It can be understood that the firmware information is equivalent to the header data in the parsed upgrade file (a binary file for upgrade, ie, a bin file).
[0089] For example, the user can select the upgrade firmware that needs to be upgraded through the host computer interface according to actual needs. The host computer responds to the selection operation for the upgrade firmware, that is, parses the selected upgrade firmware to obtain the above-mentioned upgrade file, which includes firmware information and firmware data.
[0090] S202: Determine the node to be upgraded according to the firmware information and the model of each node.
[0091] S203: Transmit the firmware information, firmware data, and the identifier of the node to be upgraded to the controller via Ethernet.
[0092] After parsing the firmware information, the host computer may match the model of the node to which the firmware in the firmware information is applied with the model of each node, and may use the successfully matched node as the node to be upgraded.
[0093] It is understandable that the host computer pre-stores the identification of each node, and the identification of the node is the ID of the node in CAN. After the node to be upgraded is determined, the host computer can bind the upper file with the identification of the node to be upgraded, and then transmit the firmware information, firmware data and the identification of the node to be upgraded to the controller connected to it through Ethernet and Ethernet switching equipment.
[0094] In an exemplary embodiment, the host computer may first send the firmware information and the identifier of the node to be upgraded to the controller via Ethernet, and then send the firmware data to the controller via Ethernet.
[0095] S204: After the firmware information, firmware data, and the identifier of the node to be upgraded are transmitted, a prompt message is sent to the controller.
[0096] The prompt information is used to prompt the controller to start the upgrade of the node to be upgraded. That is, after receiving the prompt information sent by the host computer, the controller sends the firmware information and firmware data to the node to be upgraded.
[0097] In an exemplary embodiment, the host computer may first send the firmware information and the identifier of the node to be upgraded to the controller via Ethernet, and then send the firmware data to the controller via Ethernet. After the firmware data is transmitted, the host computer may generate prompt information and transmit the prompt information to the controller via Ethernet, and then the controller may start the upgrade of the node to be upgraded based on the received firmware information and firmware data.
[0098] In summary, in the firmware upgrade method for nodes in the controller local area network provided by the present application, based on the connection relationship between the host computer and the controller through Ethernet communication connection, and the controller and each node through the controller local area network communication connection, the host computer matches the model of the node to which the firmware in the firmware information obtained by parsing with the model of each node to obtain the node to be upgraded, and first transmits the firmware information, firmware data and the identifier of the node to be upgraded to the controller through Ethernet, and then the controller can start the upgrade of the node to be upgraded through the controller local area network based on the received firmware information and firmware data. It can be seen that the present application can remotely upgrade the firmware of the node to be upgraded through Ethernet, simplify the upgrade operation, and save time and labor costs.
[0099] Figure 3 A flowchart of another method for upgrading the firmware of a node in a controller area network provided by an embodiment of the present application. Figure 3 As shown, optionally, the above-mentioned determining the node to be upgraded according to the firmware information and the model of each node includes:
[0100] S301: Determine at least one optional node according to firmware information and a node model.
[0101] S302: Determine at least one optional node to be selected according to the online information of each optional node reported by the controller.
[0102] Exemplarily, the host computer uses nodes whose models are consistent with the models of nodes to which the firmware included in the firmware information is applied as optional nodes. If there is one optional node, then the optional node is directly used as the node to be upgraded. If there are multiple optional nodes (such as 3), then the host computer also needs to determine the optional node to be selected based on the online information of the node.
[0103] It is understandable that the controller will feed back the online information of each node to the host computer in advance, that is, the host computer pre-stores the online information of each optional node, wherein the online information includes the online state and the offline state. Exemplarily, the host computer uses the optional node whose online information is the online state as the optional node to be selected.
[0104] S303: In response to the user's selection operation on at least one selectable node to be selected, determine a node to be upgraded.
[0105] Exemplarily, if there is only one optional node to be selected, the optional node to be selected can be directly used as the node to be upgraded. If there are multiple optional nodes to be selected, the host computer needs to operate according to the user's selection. Assuming that the user selects optional node A to be selected, then optional node A to be selected is used as the node to be upgraded.
[0106] Optionally, the above-mentioned transmission of firmware information, firmware data and identification of the node to be upgraded to the controller via Ethernet includes: transmitting the firmware information and identification of the node to be upgraded to the first storage module in the controller via Ethernet; transmitting the firmware data to the second storage module in the controller via Ethernet.
[0107] Wherein, the controller includes a first storage module and a second storage module. In an exemplary embodiment, the first storage module and the second storage module are the same storage module, such as RAM (Random Access Memory). In another exemplary embodiment, the first storage module may be RAM, and the second storage module may be a Flash memory that communicates using SPI (Serial Peripheral interface), namely SPIFlash. The storage space in SPIFlash may include its own business space, temporary storage space, and remaining unused space. The firmware data may be stored in the temporary storage space in SPIFlash, and the own business space is usually used to store relevant parameters of the controller.
[0108] Optionally, the method may further include: monitoring first progress information of transmitting firmware information, firmware data, and identifiers of nodes to be upgraded to the controller; and displaying the first progress information.
[0109] In a feasible embodiment, the host computer monitors in real time the current amount of data transmitted corresponding to the firmware information, firmware data and the identification of the node to be upgraded transmitted to the controller, and uses the ratio between the current amount of data transmitted and the total amount of data of the firmware information, firmware data and the identification of the node to be upgraded as the first progress information. The ratio can be displayed in real time using a transmission progress bar displayed on the host computer.
[0110] It can be seen that in this way, the user can timely and intuitively understand the progress of the host computer transmitting the firmware information, the firmware data and the identification of the node to be upgraded to the controller via Ethernet.
[0111] The following example describes the firmware upgrade method for nodes in a controller area network. Figure 1 The controller in the firmware upgrade system shown, wherein the connection relationship between the host computer, the controller and each node in the firmware upgrade system can be referred to the relevant part description and will not be explained here.
[0112] Figure 4 A flowchart of another method for upgrading the firmware of a node in a controller area network provided in an embodiment of the present application is shown below. Figure 4 As shown, the method may include:
[0113] S401. Receive firmware information, firmware data, and an identifier of a node to be upgraded sent by the host computer via Ethernet.
[0114] The firmware information includes firmware length and firmware verification information. In an exemplary embodiment, the controller stores the firmware information and the identifier of the node to be upgraded in the first storage module, and stores the firmware data in the second storage module.
[0115] S402: after receiving the prompt information sent by the host computer, the firmware information and firmware data are transmitted to the node to be upgraded through the controller local area network according to the identification of the node to be upgraded, so that the node to be upgraded performs firmware upgrade based on the firmware information and firmware data.
[0116] The prompt information is used to prompt the controller to start the upgrade of the node to be upgraded. That is, after receiving the prompt information sent by the host computer, the controller sends the firmware information and firmware data to the node to be upgraded.
[0117] In an exemplary embodiment, the host computer first sends the firmware information and the identifier of the node to be upgraded to the controller, and then sends the firmware data to the controller. After all the firmware data are sent to the controller, the host computer sends a prompt message to the controller. After receiving the prompt message sent by the host computer, the controller may first transmit the firmware information to the node to be upgraded corresponding to the identifier of the node to be upgraded through the CAN bus network, and then transmit the firmware data to the node to be upgraded through the CAN bus network, so that the node to be upgraded performs a firmware upgrade according to the firmware information and the firmware data.
[0118] It can be seen that based on the communication connection between the controller and the host computer through Ethernet, and the communication connection between the controller and the node to be upgraded through the CAN bus network, the controller can receive the firmware information, firmware data and the identification of the node to be upgraded sent from the host computer through Ethernet, and then send the received firmware information and firmware data to the node to be upgraded corresponding to the identification of the node to be upgraded based on the controller local area network, so that the node to be upgraded can perform firmware upgrade based on the firmware information and firmware data. In other words, remote firmware upgrade can be performed in this way, avoiding the phenomenon that after-sales personnel need to perform firmware upgrade on site.
[0119] At the same time, the controller sends firmware information and firmware data to the node to be upgraded only after receiving the prompt information sent by the host computer. In this way, the data transmission between the host computer, the controller and the node to be upgraded can be divided into two separate stages, which can stagger the high speed of Ethernet and the low rate of the CAN bus network, thereby improving the success rate of firmware upgrades for the nodes to be upgraded.
[0120] Figure 5 A flowchart of a method for upgrading the firmware of a node in a controller area network provided in another embodiment of the present application is shown below. Figure 5 As shown, optionally, the above-mentioned transmitting the firmware information and the firmware data to the node to be upgraded through the controller local area network includes:
[0121] S501: Transmit firmware information to a first storage unit of a node to be upgraded via a controller area network.
[0122] S502: Acquire storage information of a second storage unit of a node to be upgraded through a controller area network.
[0123] The controller can communicate with the node to be upgraded through the CANopen protocol. CANopen is a high-level communication protocol based on CAN. The SDO (Service Data Object) protocol in the CANopen protocol includes two protocols, such as the SDO Segment protocol and the SDO Block protocol.
[0124] Figure 6 A schematic diagram of the structure of a storage module of a node to be upgraded provided in an embodiment of the present application. Figure 6 As shown, the storage module of the node to be upgraded includes a Bootloader unit, an application unit, a second storage unit, a first storage unit and remaining unused units, wherein the Bootloader unit is used to store the Bootloader (boot loader) space, the application unit is a unit for firmware upgrade, that is, the firmware data on the application unit is the firmware data for upgrading the node to be upgraded, the second storage unit is a space for storing firmware data, and the first storage unit is a space for storing firmware information.
[0125] Combination Figure 6 For explanation, the controller can use the SDO Segment protocol to transmit the firmware information to the first storage unit of the node to be upgraded through the CAN bus network. It is understandable that the second storage unit can be composed of multiple Flash sectors. For example, the storage space length of each Flash sector is 8 bytes. It should be noted that this application does not limit the length of the Flash sector. The controller can obtain the storage information of the second storage unit of the node to be upgraded through the SDO Segment protocol, that is, the length of the Flash sector in the second storage unit.
[0126] S503: Segment the firmware data according to the storage information of the second storage unit to obtain a plurality of firmware sub-packet data.
[0127] S504 , transmitting each firmware sub-package data to the second storage unit in the node to be upgraded through the controller local area network.
[0128] Continuing with the above example, after the controller obtains the length of the Flash sector in the second storage unit, the firmware data can be segmented based on the length of the Flash sector to obtain multiple firmware sub-package data, and the length of the last segmented firmware sub-package data is less than or equal to the length of the Flash sector, such as 8 bytes.
[0129] After obtaining multiple firmware sub-packet data, the controller can obtain the storage address of each firmware sub-packet data in the second storage unit. The controller uses the SDO Block protocol to store each firmware sub-packet data in the second storage unit according to the storage address in the second storage unit through the CAN bus network.
[0130] It can be seen that the firmware information and firmware data sent by the controller to the node to be upgraded can be pre-stored in the first storage unit and the second storage unit, so that the data transmission process does not affect the normal operation of the node to be upgraded.
[0131] Optionally, the method may further include: monitoring second progress information of transmitting firmware information and firmware data to the node to be upgraded; transmitting the second progress information to a host computer via Ethernet, so that the host computer displays the second progress information.
[0132] In a feasible embodiment, the controller monitors in real time the amount of data currently transmitted corresponding to the firmware information and firmware data transmitted to the node to be upgraded, takes the ratio between the amount of data currently transmitted and the total amount of data corresponding to the firmware information and firmware data as the second progress information, and transmits the second progress information to the host computer via Ethernet, so that the host computer can display the ratio in real time on the transmission progress bar displayed on its interface.
[0133] It can be seen that this allows the user to timely and intuitively understand the progress of the host computer sending firmware information and firmware data to the node to be upgraded through the CAN bus network.
[0134] The following example describes the firmware upgrade method for nodes in a controller area network. Figure 1 The nodes (nodes to be upgraded) in the firmware upgrade system shown, wherein the connection relationship between the host computer, the controller and each node in the firmware upgrade system can be referred to the relevant part description and will not be described here.
[0135] Figure 7 A flowchart of another method for upgrading the firmware of a node in a controller area network provided by an embodiment of the present application. Figure 7 As shown, the method may include:
[0136] S701: Receive firmware information and firmware data transmitted by a controller via a controller area network.
[0137] The firmware information includes the firmware length and firmware verification information. Figure 6 To illustrate, the firmware information sent by the controller through the CAN bus network can be first received, and the firmware information can be stored in the first storage unit of its own storage module, and then the firmware data sent by the controller through the CAN bus network can be received, and the firmware data can be stored in the second storage unit of the storage module.
[0138] S702: After receiving the firmware data, restart the node to be upgraded, read the firmware data based on the firmware length in the firmware information through the boot loader, and verify the firmware data according to the firmware verification information in the firmware information.
[0139] S703: If the verification passes, the original firmware of the node to be upgraded is replaced with the firmware data.
[0140] In an exemplary embodiment, the node to be upgraded can determine whether the complete firmware data has been received according to the firmware length in the received firmware information. If the node to be upgraded determines that the complete firmware data has been received, it can be restarted and then run the boot loader. The boot loader reads the firmware data corresponding to the firmware length from the storage unit storing the firmware data according to the firmware length in the firmware information, and then verifies the firmware data according to the firmware data corresponding to the firmware length and the firmware verification information in the firmware information to determine whether an error occurs in the process of the controller sending the firmware data to the node to be upgraded. If the verification passes, that is, it is determined that no error occurs in the process of the controller sending the firmware data to the node to be upgraded, the original firmware of the node to be upgraded is replaced with the firmware data, and the firmware of the node to be upgraded is upgraded.
[0141] It can be seen that the node to be upgraded can automatically receive firmware information and firmware data transmitted from the controller through the controller local area network, and then perform firmware upgrades. This allows remote firmware upgrades and avoids the need for after-sales personnel to perform firmware upgrades on site.
[0142] Optionally, the above-mentioned reading of firmware data based on the firmware length in the firmware information by a boot loader, and verifying the firmware data according to the firmware verification information in the firmware information, include: reading the firmware verification information and the firmware length in the firmware information from the first storage unit of the node to be upgraded through the boot loader; reading the firmware data corresponding to the firmware length from the second storage unit of the node to be upgraded based on the firmware length in the firmware information through the boot loader, and obtaining a first true verification value according to the firmware data; determining whether the first true verification value and the firmware verification information in the firmware information are consistent through the boot loader.
[0143] Combination Figure 6 To explain, if it is determined that complete firmware data is stored in the second storage unit, the node to be upgraded is restarted, and the boot loader in the Bootloader unit is run, and then the firmware verification information and the firmware length in the firmware information are read from the first storage unit through the boot loader, and the boot loader reads the firmware data corresponding to the firmware length from the second storage unit based on the read firmware length, and then calculates the first true verification value according to the firmware data corresponding to the firmware length.
[0144] After the first true check value is obtained, the first true check value can be compared with the firmware check information. In an exemplary embodiment, if the first true check value is inconsistent with the firmware check information, it proves that an error occurs when the controller sends firmware data to the node to be upgraded, and then the node to be upgraded can send a retransmission instruction to the controller, and delete the firmware information stored in the first storage unit and the firmware data stored in the second storage unit.
[0145] If the first true verification value is consistent with the firmware verification information, the relevant data of the original firmware in the application area is deleted through the boot loader, and the firmware data corresponding to the firmware length in the second storage unit is copied to the application area, that is, the firmware of the node to be upgraded is upgraded.
[0146] Furthermore, after the firmware data corresponding to the firmware length in the second storage unit is copied to the application area, it can also be verified according to the firmware verification information and the real verification value calculated according to the firmware data corresponding to the firmware length to avoid errors during the copying process.
[0147] It can be seen that this can improve the efficiency and accuracy of upgrading the nodes to be upgraded.
[0148] Figure 8 A flowchart of another method for upgrading the firmware of a node in a controller area network provided in an embodiment of the present application is shown below. Figure 8 As shown, optionally, the firmware information and firmware data transmitted by the receiving controller through the controller area network include:
[0149] S801. Receive firmware information transmitted by a controller via a controller area network.
[0150] S802. Receive the firmware sub-package data currently transmitted by the controller through the controller local area network and the firmware sub-verification information corresponding to the firmware sub-package data, and verify the firmware sub-package data according to the second true verification value obtained from the firmware sub-package data and the firmware sub-verification information corresponding to the firmware sub-package data.
[0151] Exemplary, combined Figure 6 To illustrate, the node to be upgraded stores the firmware information transmitted by the controller through the CAN bus network in the first storage unit.
[0152] According to the above description, the controller can divide the firmware data into multiple firmware sub-package data according to the storage information of the second storage unit of the node to be upgraded, and can also calculate the firmware sub-check information corresponding to each firmware sub-package data according to each firmware sub-package data.
[0153] Based on this, the node to be upgraded can store the currently received firmware subpackage data in the second storage unit, and store the firmware sub-verification information corresponding to the firmware subpackage data in the first storage unit, and then calculate the second true verification value based on the firmware subpackage data in the second storage unit, compare the second true verification value with the firmware subpackage data corresponding to the firmware subpackage data, and determine whether to continue to receive other firmware subpackage data sent by the controller based on the comparison result.
[0154] It can be seen that the controller divides the firmware data into multiple firmware sub-packet data, and sends the firmware sub-packet data and the firmware sub-verification information corresponding to the firmware sub-packet data to the node to be upgraded. The node to be upgraded can perform verification based on the firmware sub-packet data and the firmware sub-verification information corresponding to the firmware sub-packet data. In this way, transmission errors can be discovered as early as possible, thereby improving the efficiency of firmware upgrades.
[0155] Fig. 9 A schematic diagram of a process flow of firmware upgrade interaction between a host computer, a controller, and a node to be upgraded provided in an embodiment of the present application. Fig. 9 Said method may include:
[0156] S901. The host computer parses the upgrade firmware selected by the user to obtain firmware information and firmware data.
[0157] S902: The host computer transmits the firmware information, firmware data, and the identifier of the node to be upgraded to the controller via Ethernet.
[0158] S903: The controller receives firmware information, firmware data, and an identifier of the node to be upgraded sent by the host computer via Ethernet.
[0159] S904: After the firmware information, firmware data, and the identifier of the node to be upgraded are transmitted, the host computer sends a prompt message to the controller.
[0160] S905. After receiving the prompt information sent by the host computer, the controller transmits the firmware information and firmware data to the node to be upgraded through the controller local area network according to the identification of the node to be upgraded, so that the node to be upgraded performs firmware upgrade based on the firmware information and firmware data.
[0161] S906: The node to be upgraded receives firmware information and firmware data transmitted by the controller via the controller area network.
[0162] S907. After receiving the firmware data, the node to be upgraded restarts the node to be upgraded, reads the firmware data based on the firmware length in the firmware information through the boot loader, and verifies the firmware data according to the firmware verification information in the firmware information.
[0163] S908: If the verification passes, the node to be upgraded replaces the original firmware of the node to be upgraded with the firmware data.
[0164] For the specific contents of the method, please refer to the relevant parts of the aforementioned method embodiment, and this application will not go into details here.
[0165] Fig.10A schematic diagram of the structure of a firmware upgrade device for a node in a controller area network provided in an embodiment of the present application. The device is applied to a host computer in a firmware upgrade system, the firmware upgrade system includes a host computer, a controller and at least one node, the host computer is connected to the controller via Ethernet, and the controller is connected to each node via the controller area network; the device includes:
[0166] The parsing module 1001 is used to parse the upgrade firmware selected by the user to obtain firmware information and firmware data. The firmware information includes the model of the node to which the firmware is applied, the firmware length and firmware verification information;
[0167] A determination module 1002 is used to determine the node to be upgraded according to the firmware information and the model of each node;
[0168] The first transmission module 1003 is used to transmit the firmware information, firmware data and the identification of the node to be upgraded to the controller via Ethernet;
[0169] The sending module 1004 is used to send prompt information to the controller after the firmware information, firmware data and the identifier of the node to be upgraded are transmitted. The prompt information is used to prompt the controller to start upgrading the node to be upgraded.
[0170] Optionally, the determination module 1002 is specifically used to determine at least one optional node based on the firmware information and the model of each node; determine at least one optional node to be selected based on the online information of each optional node reported by the controller; and determine the node to be upgraded in response to the user's selection operation for at least one optional node to be selected.
[0171] Optionally, the first transmission module 1003 is specifically configured to transmit the firmware information and the identifier of the node to be upgraded to the first storage module in the controller via Ethernet; and transmit the firmware data to the second storage module in the controller via Ethernet.
[0172] Optionally, the device further comprises: a display module;
[0173] The display module is used to monitor the first progress information of transmitting firmware information, firmware data and identification of nodes to be upgraded to the controller; and display the first progress information.
[0174] The embodiment of the present application provides a firmware upgrade device for a node in a controller area network, the device is applied to a controller in a firmware upgrade system, the firmware upgrade system includes a host computer, a controller and at least one node, the host computer is connected to the controller via Ethernet, and the controller is connected to each node via the controller area network; the device includes:
[0175] The first receiving module is used to receive firmware information, firmware data and the identification of the node to be upgraded sent by the host computer through Ethernet, wherein the firmware information includes firmware length and firmware verification information;
[0176] The second transmission module is used to transmit the firmware information and firmware data to the node to be upgraded through the controller local area network according to the identification of the node to be upgraded after receiving the prompt information sent by the upper computer, so that the node to be upgraded can perform firmware upgrade based on the firmware information and firmware data, wherein the prompt information is used to prompt the controller to start the upgrade of the node to be upgraded.
[0177] Optionally, the second transmission module is specifically used to transmit firmware information to the first storage unit of the node to be upgraded through the controller local area network; obtain storage information of the second storage unit of the node to be upgraded through the controller local area network; divide the firmware data according to the storage information of the second storage unit to obtain multiple firmware sub-package data; and transmit each firmware sub-package data to the second storage unit in the node to be upgraded through the controller local area network.
[0178] Optionally, the second transmission module is further used to monitor second progress information of transmitting firmware information and firmware data to the node to be upgraded; and transmit the second progress information to the host computer via Ethernet so that the host computer displays the second progress information.
[0179] The embodiment of the present application provides a firmware upgrade device for a node in a controller area network, the device is applied to a node to be upgraded in a firmware upgrade system, the firmware upgrade system includes a host computer, a controller and a node to be upgraded, the host computer is connected to the controller via Ethernet, and the controller is connected to the node to be upgraded via the controller area network; the device includes:
[0180] A second receiving module is used to receive firmware information and firmware data transmitted by the controller through a controller area network, wherein the firmware information includes firmware length and firmware verification information;
[0181] A verification module is used to restart the node to be upgraded after the firmware data is received, and read the firmware data based on the firmware length in the firmware information through a boot loader, and verify the firmware data according to the firmware verification information in the firmware information;
[0182] The replacement module is used to replace the original firmware of the node to be upgraded with the firmware data if the verification passes.
[0183] Optionally, the verification module is specifically used to read firmware verification information and firmware length in the firmware information from the first storage unit of the node to be upgraded through a boot loader; read firmware data corresponding to the firmware length from the second storage unit of the node to be upgraded based on the firmware length in the firmware information through the boot loader, and obtain a first true verification value based on the firmware data; determine whether the first true verification value and the firmware verification information in the firmware information are consistent through the boot loader.
[0184] Optionally, the firmware data includes a plurality of firmware sub-package data;
[0185] Correspondingly, the second receiving module is also used to receive firmware information transmitted by the controller through the controller local area network; receive firmware subpackage data currently transmitted by the controller through the controller local area network and firmware subpackage data corresponding to the firmware subpackage data, and verify the firmware subpackage data based on the second true verification value obtained from the firmware subpackage data and the firmware subpackage data corresponding to the firmware subpackage data.
[0186] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0187] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0188] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.11As shown, the electronic device may include: a processor 1101, a storage medium 1102 and a bus 1103, the storage medium 1102 stores machine-readable instructions executable by the processor 1101, when the electronic device is running, the processor 1101 communicates with the storage medium 1102 via the bus 1103, and the processor 1101 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0189] Optionally, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method embodiment are executed.
[0190] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the 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, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0191] 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 solution of this embodiment.
[0192] 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 hardware plus software functional units.
[0193] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0194] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0195] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for upgrading the firmware of a node in a controller area network, characterized in that: The method is applied to a host computer in a firmware upgrade system, wherein the firmware upgrade system includes the host computer, a controller, and at least one node, wherein the host computer is communicatively connected to the controller via Ethernet, and the controller is communicatively connected to each of the nodes via a controller area network; the method includes: Parse the upgrade firmware selected by the user to obtain firmware information and firmware data, wherein the firmware information includes the model of the node to which the firmware is applied, the firmware length, and firmware verification information; Determine the node to be upgraded according to the firmware information and the model of each node; Transmitting the firmware information, the firmware data and the identifier of the node to be upgraded to the controller via the Ethernet; After the firmware information, the firmware data and the identifier of the node to be upgraded are transmitted, a prompt message is sent to the controller, where the prompt message is used to prompt the controller to send the firmware information and the firmware data to the node to be upgraded and start the upgrade of the node to be upgraded; The step of determining the node to be upgraded according to the firmware information and the model of each node includes: Determine at least one optional node according to the firmware information and the model of each of the nodes; Determine at least one optional node to be selected according to the online information of each optional node reported by the controller; In response to a user's selection operation on the at least one selectable node to be selected, the node to be upgraded is determined.
2. The method according to claim 1, characterized in that The transmitting the firmware information, the firmware data, and the identifier of the node to be upgraded to the controller via the Ethernet includes: Transmitting the firmware information and the identifier of the node to be upgraded to a first storage module in the controller via the Ethernet; The firmware data is transmitted to a second storage module in the controller via Ethernet.
3. The method according to claim 1, characterized in that The method further comprises: Monitoring first progress information of transmitting the firmware information, the firmware data, and the identifier of the node to be upgraded to the controller; The first progress information is displayed.
4. A method for upgrading the firmware of a node in a controller area network, characterized in that: The method is applied to a controller in a firmware upgrade system, wherein the firmware upgrade system includes a host computer, the controller, and at least one node, wherein the host computer is connected to the controller via Ethernet, and the controller is connected to each node via a controller area network; the method includes: Receiving firmware information, firmware data and an identifier of a node to be upgraded sent by the host computer through the Ethernet, wherein the firmware information includes a firmware length and firmware verification information, the host computer determining at least one optional node for the node to be upgraded according to the firmware information and the model of each of the nodes, determining at least one optional node to be selected according to the online information of each of the optional nodes reported by the controller, and determining the node to be upgraded in response to a selection operation of a user on the at least one optional node to be selected; After receiving the prompt information sent by the host computer, the firmware information and the firmware data are transmitted to the node to be upgraded through the controller local area network according to the identification of the node to be upgraded, so that the node to be upgraded performs firmware upgrade based on the firmware information and the firmware data, wherein the prompt information is used to prompt the controller to start the upgrade of the node to be upgraded.
5. The method according to claim 4, characterized in that The transmitting the firmware information and the firmware data to the node to be upgraded through the controller local area network includes: Transmitting the firmware information to the first storage unit of the node to be upgraded through the controller area network; Acquire storage information of a second storage unit of the node to be upgraded through the controller area network; According to the storage information of the second storage unit, the firmware data is divided to obtain a plurality of firmware sub-packet data; The firmware sub-packet data are transmitted to the second storage unit in the node to be upgraded through the controller local area network.
6. The method according to claim 4, characterized in that The method further comprises: Monitoring second progress information of transmitting the firmware information and the firmware data to the node to be upgraded; The second progress information is transmitted to the host computer via the Ethernet, so that the host computer displays the second progress information.
7. A method for upgrading the firmware of a node in a controller area network, characterized in that: The method is applied to a node to be upgraded in a firmware upgrade system, wherein the firmware upgrade system includes a host computer, a controller and a node to be upgraded, wherein the host computer is connected to the controller through Ethernet, the host computer determines at least one optional node for the node to be upgraded according to the firmware information and the model of each node, determines at least one optional node to be selected according to the online information of each optional node reported by the controller, determines the node to be upgraded in response to a user's selection operation on the at least one optional node to be selected, and the controller is connected to the node to be upgraded through a controller local area network; the method includes: Receiving firmware information and firmware data transmitted by the controller through the controller local area network, the firmware information including firmware length and firmware verification information, wherein the controller sends the firmware information and the firmware data based on the prompt information sent by the host computer, and starts the upgrade of the node to be upgraded; After the firmware data is received, restart the node to be upgraded, read the firmware data based on the firmware length in the firmware information through a boot loader, and verify the firmware data according to the firmware verification information in the firmware information; If the verification passes, the original firmware of the node to be upgraded is replaced with the firmware data.
8. The method according to claim 7, characterized in that The reading the firmware data based on the firmware length in the firmware information by the boot loader, and verifying the firmware data according to the firmware verification information in the firmware information, comprises: Reading firmware verification information and firmware length in the firmware information from the first storage unit of the node to be upgraded through the boot loader; Reading, by the boot loader, firmware data corresponding to the firmware length from the second storage unit of the node to be upgraded based on the firmware length in the firmware information, and obtaining a first true check value according to the firmware data; Determine, by the boot loader, whether the first true verification value and the firmware verification information in the firmware information are consistent.
9. The method according to claim 7, characterized in that: The firmware data includes a plurality of firmware sub-package data; The receiving controller transmits firmware information and firmware data via the controller area network, including: receiving firmware information transmitted by the controller via the controller area network; The receiving controller currently transmits firmware sub-package data through the controller local area network and firmware sub-verification information corresponding to the firmware sub-package data, and verifies the firmware sub-package data according to a second true verification value obtained from the firmware sub-package data and the firmware sub-verification information corresponding to the firmware sub-package data.
10. A firmware upgrade device for a node in a controller area network, characterized in that: The device is applied to a host computer in a firmware upgrade system, wherein the firmware upgrade system includes the host computer, a controller and at least one node, the host computer is connected to the controller via Ethernet, and the controller is connected to each node via a controller area network; the device includes: A parsing module, used to parse the upgrade firmware selected by the user to obtain firmware information and firmware data, wherein the firmware information includes the model of the node to which the firmware is applied, the firmware length and firmware verification information; A determination module, used to determine the node to be upgraded according to the firmware information and the model of each node; A transmission module, used for transmitting the firmware information, the firmware data and the identifier of the node to be upgraded to the controller via the Ethernet; A sending module, configured to send prompt information to the controller after the firmware information, the firmware data and the identifier of the node to be upgraded are transmitted, wherein the prompt information is used to prompt the controller to send the firmware information and the firmware data to the node to be upgraded and start the upgrade of the node to be upgraded; The determination module is specifically used for: Determine at least one optional node according to the firmware information and the model of each of the nodes; Determine at least one optional node to be selected according to the online information of each optional node reported by the controller; In response to a user's selection operation on the at least one selectable node to be selected, the node to be upgraded is determined.
11. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the firmware upgrade method for a node in a controller local area network as described in any one of claims 1-9.
Citation Information
Patent Citations
Remote upgrade method and remote upgrade device for wireless sensor network node
CN105573810A