Multi-device flashing method and device based on Ethernet and computer device

By obtaining device addresses and port numbers by sending probe broadcast packets over Ethernet and then sending firmware control packets using the Layer 2 Ethernet protocol, the problem of low efficiency in multi-device firmware flashing is solved, and efficient multi-device firmware flashing is achieved.

CN120935019APending Publication Date: 2025-11-11ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511175536.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Ethernet-based firmware flashing is inefficient for multiple devices. Existing technologies use different flashing tools and procedures for different types of devices, resulting in low flashing efficiency.

Method used

By sending probe broadcast packets to the device to be flashed, the target Ethernet physical address and port number in the response broadcast packet are obtained. Then, firmware control packets and flashing instructions are sent using the Layer 2 Ethernet protocol to achieve parallel flashing of multiple devices.

Benefits of technology

It significantly improves firmware flashing efficiency, reduces device location time and erroneous flashing, enables batch flashing, and fully utilizes the parallel transmission characteristics of Ethernet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935019A_ABST
    Figure CN120935019A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automobiles, and discloses a multi-device flashing method and device based on the Ethernet and computer equipment, and the method comprises the steps: determining a plurality of to-be-flashed devices in a complete machine, and transmitting a detection broadcast packet to the to-be-flashed devices; when response broadcast packets fed back by all the to-be-flashed devices in the complete machine based on the detection broadcast packets are received, switches connected with the to-be-flashed devices and target port numbers of the to-be-flashed devices on the corresponding switches are obtained based on target Ethernet physical addresses carried by the response broadcast packets; based on the target port number, a firmware control package and a flashing instruction are sent to the corresponding equipment to be flashed, and the equipment to be flashed executes flashing operation according to the flashing instruction and the firmware control package. Through the technical scheme of the invention, the problem of low firmware flashing efficiency based on multiple devices of the Ethernet in related technologies is solved, and the firmware flashing efficiency based on multiple devices of the Ethernet is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive technology, and more specifically to a method, apparatus, and computer device for flashing multiple devices based on Ethernet. Background Technology

[0002] With the widespread adoption of automotive Ethernet, different device modules are connected via Ethernet switches. During the initial stages of device function development or verification, firmware flashing is required. Ethernet can be used for firmware flashing, simplifying the process for the entire device. However, when there are multiple different types of devices in a single unit, the flashing efficiency is low due to the different flashing tools and procedures required for each type.

[0003] In summary, firmware flashing based on Ethernet across multiple devices in related technologies suffers from low flashing efficiency. Summary of the Invention

[0004] In view of this, the present invention provides a method, apparatus, computer device and storage medium for flashing firmware on multiple devices based on Ethernet, in order to solve the problem of low flashing efficiency in firmware flashing on multiple devices based on Ethernet in related technologies.

[0005] In a first aspect, the present invention provides a multi-device flashing method based on Ethernet, the method running on a host computer, the method comprising:

[0006] Identify multiple devices in the system that need to be flashed, and send probe broadcast packets to these devices.

[0007] When the system receives response broadcast packets from all devices to be flashed based on the probe broadcast packets, it obtains the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch based on the target Ethernet physical address carried in the response broadcast packets.

[0008] Based on the target port number, a firmware control package and flashing instructions are sent to the corresponding device to be flashed. The device to be flashed then performs the flashing operation according to the flashing instructions and the firmware control package.

[0009] In one alternative implementation, the method further includes, before sending a probe broadcast packet to the device to be flashed:

[0010] Detect the initial Ethernet physical address broadcast by each device to be flashed, where the initial Ethernet physical address is generated after the device enters flashing mode;

[0011] Check if the initial Ethernet physical address exists in the Ethernet physical address list, where the Ethernet physical address list includes at least one Ethernet physical address that has been generated by the device to be flashed;

[0012] If the initial Ethernet physical address does not exist in the Ethernet physical address list, a first broadcast packet is replied with, and the initial Ethernet physical address is identified as the target Ethernet physical address. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not being used by other devices within the same system. Alternatively...

[0013] If the initial Ethernet physical address exists in the Ethernet physical address list, then reply with a second broadcast packet and continuously listen for the Ethernet physical address broadcast by the device to be flashed until an Ethernet physical address not existing in the Ethernet physical address list is received, and that Ethernet physical address is used as the target Ethernet physical address. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by another device.

[0014] In one optional implementation, the switch connected to each device to be flashed, and the target port number of the device on the corresponding switch, are obtained based on the target Ethernet physical address carried in the response broadcast packet, including:

[0015] Obtain the port address forwarding table of the switch to which each device to be flashed is connected. The port address forwarding table includes the Ethernet physical address corresponding to each port number in the switch.

[0016] Traverse the port address forwarding table, select the switch corresponding to the port address forwarding table of the target Ethernet physical address as the target switch, and obtain the target port number from the port address forwarding table of the target switch.

[0017] Secondly, this invention provides a multi-device flashing method based on Ethernet, which is applied to the device to be flashed, and includes:

[0018] Listen for probe broadcast packets sent by the host computer;

[0019] Respond to the probe broadcast packet, obtain the target Ethernet physical address of the device to be flashed, and send a response broadcast packet to the host computer based on the target Ethernet physical address;

[0020] Based on the target port number of the target switch where the device to be flashed is located, the flashing command and firmware control packet sent by the host computer are received. The flashing command and firmware control packet are sent by the host computer after receiving the response broadcast packets of all devices to be flashed in the whole machine where the device to be flashed is located.

[0021] The flashing operation is performed according to the flashing instructions and firmware control package to obtain the flashing result of the device to be flashed.

[0022] In one alternative implementation, the method further includes:

[0023] When the device to be flashed enters flashing mode, an initial Ethernet physical address is generated and broadcast.

[0024] If a first broadcast packet is received from the host computer, the initial Ethernet physical address is determined as the target Ethernet physical address of the device to be flashed. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not being used by other devices within the same system. Alternatively...

[0025] If a second broadcast packet is received from the host computer, the Ethernet physical address is regenerated and broadcast. If the host computer still reports that the regenerated Ethernet physical address is occupied by another device, the process of generating the Ethernet physical address is repeated until the generated Ethernet physical address is used by the host computer. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by another device.

[0026] In one optional implementation, a flashing operation is performed according to the flashing command and firmware control package to obtain the flashing result of the device to be flashed, including:

[0027] Based on the flashing command, the firmware control packet is parsed to obtain the firmware flashing configuration and firmware integrity parameters, and a response packet is sent back to the host computer. The host computer sends a split firmware data packet to the device to be flashed based on the response packet. The firmware integrity parameters include the firmware size and firmware check value.

[0028] Receive firmware data packets sent by the host computer;

[0029] The firmware data packet is flashed according to the firmware flashing configuration, and the firmware integrity parameters are used to verify the firmware data packet to obtain the flashing result of the device to be flashed.

[0030] In one optional implementation, the firmware data packet is flashed according to the firmware flashing configuration, and the firmware data packet is verified using firmware integrity parameters to obtain the flashing result of the device to be flashed, including:

[0031] The firmware data package is flashed according to the firmware flashing configuration to obtain the firmware data package flashing status.

[0032] The firmware size is used to determine whether the currently received firmware data packet is the last firmware data packet;

[0033] If it is the last firmware data packet, then calculate the actual checksum of all received firmware data packets;

[0034] The verification result is obtained by comparing the actual verification value with the firmware verification value.

[0035] Based on the flashing status and verification status, the flashing result of the device to be flashed is determined; where, if the flashing status is flashing completed and the verification status is that the verification values ​​are the same, the flashing result is flashing successful; or, if the flashing status is flashing incomplete and / or the verification status is that the verification values ​​are different, the flashing result is flashing failed.

[0036] Thirdly, the present invention provides a multi-device flashing device based on Ethernet, which is applied to a host computer and includes:

[0037] The determination module is used to identify multiple devices to be flashed in the whole machine and send probe broadcast packets to the devices to be flashed;

[0038] The acquisition module is used to obtain the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch based on the target Ethernet physical address carried in the response broadcast packet when it receives the response broadcast packet from all devices to be flashed in the whole machine based on the response broadcast packet.

[0039] The sending module is used to send firmware control packets and flashing instructions to the corresponding device to be flashed based on the target port number. The device to be flashed then performs the flashing operation according to the flashing instructions and firmware control packets.

[0040] Fourthly, the present invention provides a multi-device flashing device based on Ethernet, which is applied to a device to be flashed, and the device includes:

[0041] The monitoring module is used to monitor the probe broadcast packets sent by the host computer.

[0042] The Ethernet physical address acquisition module is used to respond to probe broadcast packets, obtain the target Ethernet physical address of the device to be flashed, and send a response broadcast packet to the host computer based on the target Ethernet physical address.

[0043] The receiving module is used to receive the flashing command and firmware control packet sent by the host computer based on the target port number of the target switch where the device to be flashed is located. The flashing command and firmware control packet are sent by the host computer after receiving the response broadcast packets of all devices to be flashed in the whole machine where the device to be flashed is located.

[0044] The flashing module is used to perform flashing operations according to flashing instructions and firmware control packages to obtain the flashing results of the device to be flashed.

[0045] Fifthly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the Ethernet-based multi-device flashing method of any embodiment corresponding to the first or second aspect described above.

[0046] In a sixth aspect, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the Ethernet-based multi-device flashing method according to any embodiment of the first or second aspect described above.

[0047] In a seventh aspect, the present invention provides a computer program product, including computer instructions for causing a computer to execute the Ethernet-based multi-device flashing method according to any embodiment of the first or second aspect described above. Attached Figure Description

[0048] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0049] Figure 1 This is a flowchart of a multi-device flashing method based on Ethernet according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram of a multi-device flashing system based on Ethernet according to an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram illustrating a method for triggering a flashing mode according to an embodiment of the present invention;

[0052] Figure 4 This is a flowchart of another Ethernet-based multi-device flashing method according to an embodiment of the present invention;

[0053] Figure 5 This is a flowchart of an Ethernet-based multi-device flashing method for a device to be flashed, according to an embodiment of the present invention;

[0054] Figure 6 This is a flowchart illustrating the process of determining the Ethernet physical address of the device to be flashed according to an embodiment of the present invention;

[0055] Figure 7 This is a flowchart of a multi-device flashing method based on Ethernet according to an embodiment of the present invention;

[0056] Figure 8 This is a schematic diagram illustrating the automatic configuration of the Ethernet physical address of a device to be flashed according to an embodiment of the present invention;

[0057] Figure 9 This is a schematic diagram illustrating how to determine the Ethernet switch port number of the device to be flashed according to an embodiment of the present invention;

[0058] Figure 10 This is a schematic diagram illustrating firmware transmission and flashing of a device to be flashed according to an embodiment of the present invention;

[0059] Figure 11 This is a structural block diagram of a multi-device flashing device based on Ethernet applied to a host computer according to an embodiment of the present invention;

[0060] Figure 12 This is a structural block diagram of an Ethernet-based multi-device flashing device applied to a device to be flashed according to an embodiment of the present invention;

[0061] Figure 13 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] The Ethernet-based multi-device firmware flashing method proposed in this invention can be applied to numerous fields and scenarios. In automotive electronics manufacturing and data center and server cluster fields, it can be used for firmware updates of large-scale server racks, network devices, and storage devices. Utilizing existing data center Ethernet infrastructure, it allows for simultaneous firmware updates of an entire rack or row of devices without physical contact with each device, significantly shortening maintenance windows and improving efficiency. In industrial automation and intelligent manufacturing, it can be used for programmable logic controllers, human-machine interfaces, industrial gateways, sensor hubs, robot controllers, motion controllers, and other devices deployed in large numbers within factory workshops. Utilizing existing industrial Ethernet or standard Ethernet networks, it enables rapid and batch flashing of relevant devices during production line changes, equipment maintenance, and functional upgrades, reducing downtime. The above application scenarios or fields are merely examples and are not intended to limit the application scenarios of the technical solution of this invention.

[0064] When flashing multiple devices, the Ethernet physical address has not yet been written to the device's internal memory in the initial state. This requires writing the Ethernet physical address to the device via a host computer. When there are multiple different types of devices on the same machine, and each device uses different flashing tools and methods, the flashing process becomes cumbersome and inefficient.

[0065] In related technologies, firmware downloading based on Internet application layer protocols requires the device to obtain or configure an Internet Protocol (IP) address, and then download the firmware from the host computer for flashing via the application layer protocol. For statically configured firmware flashing, the device's Media Access Control (MAC) address needs to be statically configured beforehand to ensure no duplicate MAC addresses, and the device's IP address needs to be configured. Using the device's MAC address or IP address, different device requests are distinguished via the application layer protocol, and the corresponding firmware is selected for flashing. For dynamically configured firmware flashing, the host computer needs to use a dynamic configuration server, and the firmware needs to communicate with the host computer to obtain an IP address, increasing the complexity of communication between the host computer and the device firmware and reducing flashing efficiency.

[0066] According to an embodiment of the present invention, a method for flashing multiple devices based on Ethernet is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0067] This embodiment provides a multi-device flashing method based on Ethernet, which can be used in a host computer. Figure 1 This is a flowchart of a multi-device flashing method based on Ethernet according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0068] Step S101: Identify multiple devices to be flashed in the whole machine and send probe broadcast packets to the devices to be flashed.

[0069] Figure 2 This is a schematic diagram of a multi-device flashing system based on Ethernet according to an embodiment of the present invention. Figure 2 As shown, the complete machine is an integrated system including devices, switches, and other components, defining the deployment scope of the internal devices and switches. The host computer is independent of the complete machine and communicates with it through the network port (connected to P0 of J1). It is responsible for obtaining device location information, issuing firmware and flashing commands, and is the core of controlling the flashing process.

[0070] Ethernet switch 1 (J1) has ports P0-P5. P0 connects to the host computer, P1 connects to device 1 (D1), and P2 connects to device 2 (D2). It is responsible for forwarding communication data between the host computer and these two devices, establishing a channel for device access and data interaction. Ethernet switch 2 (J2) has ports P0-P3. P0 connects to P3 of J1, enabling cascading with J1 and the host computer; P1 connects to device 3 (D3), handling data forwarding between device 3 and the system.

[0071] Devices 1-3 (D1-D3) are devices to be flashed. They are connected to the network through P1 and P2 of J1 and P1 of J2, respectively. The host computer needs to identify the switch and port where they are located, determine the firmware, and complete the flashing process.

[0072] Figure 3 This is a schematic diagram illustrating a method for triggering a flashing mode according to an embodiment of the present invention. Specifically, after the device is powered on, during user operation, such as... Figure 3 As shown, press and hold the button.

[0073] While the button is pressed, the entire device is powered on (connected to power). At this time, the physical connection of the button will synchronously transmit electrical signals or trigger signals to Device 1, Device 2, and Device 3. After receiving the combined signal of button trigger and power-on, Devices 1-3 execute the preset program and uniformly enter the flashing mode, waiting for the subsequent firmware and flashing instructions from the host computer (if any), in preparation for the flashing process.

[0074] The host computer first determines the range of devices to be flashed using preset rules (such as unique device identifier ranges), and then constructs an Ethernet probe broadcast packet. This packet has a broadcast address as its destination, a custom Ethernet type, and carries an identification field to trigger a device response. The host computer sends the broadcast packet to the network through the connected Ethernet switch; all devices in flashing mode can receive the packet and prepare to respond.

[0075] Step S102: When the response broadcast packets from all devices to be flashed in the whole machine are received based on the probe broadcast packets, the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch are obtained based on the target Ethernet physical address carried in the response broadcast packets.

[0076] Specifically, the host computer receives the response broadcast packet returned by the device. This packet contains the target Ethernet physical address (such as the unique address confirmed by the declaration packet mechanism in step S10) randomly generated by the device and after collision detection. The host computer iterates through the port-Ethernet physical address forwarding tables of all Ethernet switches (obtaining forwarding table information by sending multicast packets with switch labels), matching the target physical address in the response packet with the forwarding table entries to determine the switch (such as J1 or J2) and corresponding port number (such as P1 or P2) of each device. If some device information is not obtained due to switch forwarding table capacity limitations, the host computer will repeatedly send probe broadcast packets until the switch and port number of all devices are confirmed.

[0077] Step S103: Based on the target port number, send a firmware control package and a flashing instruction to the corresponding device to be flashed, wherein the device to be flashed performs the flashing operation according to the flashing instruction and the firmware control package.

[0078] Specifically, the host computer constructs a unicast firmware control packet (containing firmware data segments, verification information, etc.) and flashing instructions (such as start flashing, segment confirmation, etc.) based on the determined switch port number where the device is located.

[0079] Data packets are sent to the corresponding switch port via Layer 2 Ethernet protocol. After receiving the data, the device parses the instructions, verifies the integrity of the firmware data (such as CRC check), and then sequentially writes the data into its internal memory. During the writing process, the device returns confirmation packets. The host computer controls the data transmission rhythm based on the status of the confirmation packets until the firmware writing is complete.

[0080] This application embodiment sends probe broadcast packets to the device to be flashed to obtain the target Ethernet physical address from the response broadcast packet, accurately locating the switch and target port number connected to each device. Compared to the traditional method of identifying devices one by one, this significantly reduces device location time. Simultaneously, based on the obtained port number, firmware control packets and flashing instructions are directly sent to the corresponding device, avoiding repetitive operations and erroneous flashing caused by device address confusion or network addressing errors, and reducing unnecessary interaction processes. Furthermore, it can perform targeted operations on multiple devices simultaneously, achieving batch flashing. This changes the previous single-device sequential flashing mode, fully utilizing the parallel transmission characteristics of Ethernet, greatly improving firmware flashing efficiency, and effectively solving the problem of low efficiency in multi-device firmware flashing over Ethernet.

[0081] This embodiment provides a multi-device flashing method based on Ethernet, which can be used for the aforementioned mobile terminals, such as mobile phones and tablets. Figure 4 This is a flowchart of another Ethernet-based multi-device flashing method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:

[0082] Step S401: Detect the initial Ethernet physical address broadcast by each device to be flashed, wherein the initial Ethernet physical address is generated by the device to be flashed after entering flashing mode.

[0083] Specifically, when the device is powered on by pressing and holding the button, after entering the flashing mode, the device first obtains its own 64-bit unique identifier (including information such as manufacturer and type), then randomly generates an initial Ethernet physical address, and then constructs an Ethernet broadcast packet (the source address is the initial address, the destination address is the broadcast address, the type is customized and carries the device's unique identifier) ​​and sends it.

[0084] The host computer enables network monitoring, captures broadcast packets from the devices to be flashed, and parses out the initial Ethernet physical address to detect the initial address broadcast by each device to be flashed.

[0085] Step S402: Query whether the initial Ethernet physical address exists in the Ethernet physical address list, wherein the Ethernet physical address list includes at least one Ethernet physical address generated by the device to be flashed.

[0086] Specifically, the host computer maintains a list of Ethernet physical addresses, which dynamically records the Ethernet physical addresses generated by the devices to be flashed. After receiving the initial Ethernet physical address broadcast by the device, the host computer searches the list to see if the initial address already exists, thus determining whether there is a risk of address duplication.

[0087] Step S403: If the initial Ethernet physical address does not exist in the Ethernet physical address list, reply with the first broadcast packet and determine the initial Ethernet physical address as the target Ethernet physical address. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not used by other devices to be flashed in the whole machine.

[0088] Specifically, if the initial Ethernet physical address is detected not to exist in the Ethernet physical address list, the host computer will perform the following operations: First, construct a first broadcast packet. The source address of the broadcast packet is the host computer's own Ethernet physical address, and the destination address is set to the broadcast address. The key information carried in the packet includes the initial Ethernet physical address and a status flag indicating that "this address is not used by other devices in the whole machine that are to be flashed".

[0089] After the configuration is complete, the host computer sends the first broadcast packet via the network interface. Upon receiving the broadcast packet, the network module of the device to be flashed parses the address information and status identifier within the packet to confirm that the initial Ethernet physical address it generated is not already in use. Simultaneously, the host computer removes the initial Ethernet physical address from the list of devices to be detected and adds it to the record field of the target Ethernet physical address. The address status is updated via a database or memory cache, thus officially designating the initial Ethernet physical address as the target Ethernet physical address, providing a unique address identifier for subsequent flashing operations.

[0090] Step S404: If the initial Ethernet physical address exists in the Ethernet physical address list, reply with a second broadcast packet and continuously listen for the Ethernet physical address broadcast by the device to be flashed until an Ethernet physical address not existing in the Ethernet physical address list is received, and this Ethernet physical address is used as the target Ethernet physical address. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by another device.

[0091] Specifically, if the query finds that the initial Ethernet physical address exists in the Ethernet physical address list, the host computer will perform the following operations: First, construct a second broadcast packet, with the source address being the host computer's own physical address and the destination address being the broadcast address. The packet carries the initial Ethernet physical address and a status flag indicating that "the address has been occupied by another device," and sends the broadcast packet through the network interface.

[0092] After the flashing device receives and parses the packet, it will recognize that the initial address it generated has been occupied. Then it will trigger the address regeneration mechanism—the device will reacquire a 64-bit unique identifier, randomly generate a new Ethernet physical address, and construct a new broadcast packet (the source address is the newly generated address, carrying the unique identifier) ​​and send it.

[0093] During this process, the host computer continuously monitors the network, capturing the Ethernet addresses rebroadcast by the device in real time and comparing the new addresses with the Ethernet physical address list. When a newly broadcast address is detected that does not exist in the list, the host computer stops monitoring the device, removes the address from the temporary detection queue, adds it to the target Ethernet physical address record, updates the address status through the data storage module, and finally identifies the unique address as the target Ethernet physical address, providing a unique identifier for the subsequent flashing process.

[0094] This application embodiment effectively avoids address conflicts by detecting the initial Ethernet physical address broadcast by the device to be flashed and comparing it with an existing address list. Depending on whether the address exists in the list, different broadcast packets are responded to for targeted processing: responding to the first broadcast packet quickly confirms an available address; responding to the second broadcast packet prompts the device to regenerate an address, ensuring that a unique target Ethernet physical address is ultimately obtained. Compared to traditional random allocation or manual address assignment methods, this scheme utilizes an automated detection and feedback mechanism, significantly reducing the time spent on repeated address checks and avoiding firmware flashing failures or device identification errors caused by address conflicts. Simultaneously, continuous monitoring until a unique address is obtained ensures that each device receives a unique network identifier, laying the foundation for subsequent efficient batch firmware flashing and improving the efficiency and accuracy of address management during multi-device flashing.

[0095] Step S405: Identify multiple devices to be flashed in the whole machine and send probe broadcast packets to the devices to be flashed.

[0096] Please see details Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0097] Step S406: When the response broadcast packets from all devices to be flashed in the whole machine are received based on the probe broadcast packets, the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch are obtained based on the target Ethernet physical address carried in the response broadcast packets.

[0098] Specifically, step S406 includes:

[0099] Step S4061: Obtain the port address forwarding table of the switch to which each device to be flashed is connected. The port address forwarding table includes the Ethernet physical address corresponding to each port number in the switch.

[0100] Specifically, the host computer sends query requests to all switches in the network via Simple Network Management Protocol (SMMP) or the switch's command-line interface. For switches supporting SMMP, the host computer constructs a request to retrieve management information base objects, including interface indexes and Media Access Control (MAC) address table entries, and sends it to the switch's SMMP agent process. If using the command-line interface, the host computer establishes a connection via Secure Shell or Remote Terminal Protocol (RTP) and then executes commands such as "Display Media Access Control (MAC) Address Table." Upon response, the switch returns a port address forwarding table, which contains the mapping between each physical port number and its corresponding Ethernet physical address.

[0101] After receiving the response data, the host computer parses the return results in different formats, extracts the correspondence between port numbers and media access control addresses, stores it as structured data, and finally forms a complete set of port address forwarding tables, providing a data foundation for subsequent steps.

[0102] Step S4062: Traverse the port address forwarding table, select the switch corresponding to the port address forwarding table where the target Ethernet physical address is matched as the target switch, and obtain the target port number from the port address forwarding table of the target switch.

[0103] The host computer iterates through the port address forwarding tables of all acquired switches, precisely comparing each target Ethernet physical address with the MAC address field in the table. When a record matching the target address is found in the forwarding table of a switch, that switch is immediately marked as the target switch. Then, the corresponding port number field is extracted from the matched record (e.g., through key-value mapping in a hash table or a database query result set), and this is identified as the target port number. To ensure accuracy, the system performs a secondary verification of the matching results, checking whether the VLAN information, aging time, and other attributes of the target address in the forwarding table meet expectations. Finally, the identification information of the target switch (such as IP address and device name) is associated and stored with the target port number, forming a "switch-port" mapping relationship, providing clear physical connection location for subsequent network configuration or fault diagnosis.

[0104] Step S407: Based on the target port number, send a firmware control packet and a flashing instruction to the corresponding device to be flashed, wherein the device to be flashed performs the flashing operation according to the flashing instruction and the firmware control packet.

[0105] Please see details Figure 1 Step S103 of the illustrated embodiment will not be described again here.

[0106] This embodiment provides a multi-device flashing method based on Ethernet, which can be used for devices to be flashed. Figure 5 This is a flowchart of a multi-device flashing method based on Ethernet for a device to be flashed according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps:

[0107] Step S501: Listen for the probe broadcast packets sent by the host computer.

[0108] In this embodiment, the device to be flashed listens for the detection broadcast packets sent by the host computer to all devices to be flashed.

[0109] Step S502: Respond to the probe broadcast packet, obtain the target Ethernet physical address of the device to be flashed, and send a response broadcast packet to the host computer based on the target Ethernet physical address.

[0110] In this embodiment, the device to be flashed receives a probe broadcast packet sent by the host computer and obtains its unique identifier. This identifier is fixed inside the device and includes the device manufacturer, device type, device version number, and device serial number. This identifier is a unique identifier for all devices to be flashed. Simultaneously, the target Ethernet physical address (MAC address) of the device to be flashed is obtained. Based on this MAC address, a response broadcast packet to the probe broadcast packet is sent to the host computer at the data link layer.

[0111] Step S503: Based on the target port number of the target switch where the device to be flashed is located, receive the flashing command and firmware control packet sent by the host computer. The flashing command and firmware control packet are sent by the host computer after receiving the response broadcast packets of all devices to be flashed in the whole machine where the device to be flashed is located.

[0112] In this embodiment, after the host computer receives the response broadcast packets from all the devices to be flashed in the entire system, it sends a flashing command and firmware control packet to the devices to be flashed according to the target port number of the target switch where the device to be flashed is located. The devices to be flashed receive the flashing command and firmware control packet.

[0113] Step S504: Perform the flashing operation according to the flashing command and firmware control package to obtain the flashing result of the device to be flashed.

[0114] Specifically, step S504 includes:

[0115] Step S5041: Based on the flashing command, the firmware control packet is parsed to obtain the firmware flashing configuration and firmware integrity parameters, and a response packet is sent back to the host computer. The host computer sends the split firmware data packet to the device to be flashed based on the response packet. The firmware integrity parameters include the firmware size and firmware checksum.

[0116] In this embodiment, the device to be flashed executes the flashing instructions one by one, parses the firmware control packet to obtain firmware flashing configuration information and firmware integrity parameters. These firmware integrity parameters characterize the integrity of the firmware data being flashed to the device, including firmware size and firmware checksum. Simultaneously, a response packet is sent to the host computer to obtain the firmware for the device to be flashed; this firmware is split into multiple firmware data packets.

[0117] Step S5042: Receive the firmware data packet sent by the host computer.

[0118] In this embodiment, the device to be flashed receives the split firmware data packet sent by the host computer.

[0119] Step S5043: Flash the firmware data packet according to the firmware flashing configuration, and verify the firmware data packet using firmware integrity parameters to obtain the flashing result of the device to be flashed.

[0120] Specifically, step S5043 above includes:

[0121] Step a1: Flash the firmware data package according to the firmware flashing configuration to obtain the firmware data package flashing status.

[0122] In this embodiment, the flashing command is executed according to the configuration information in the firmware flashing configuration, and the firmware data packet is flashed to the device to be flashed. The flashing status of the firmware data packet is recorded during the flashing process.

[0123] Step a2: Use the firmware size to determine whether the currently received firmware data packet is the last firmware data packet.

[0124] In this embodiment, the device to be flashed determines, based on the recorded firmware data packet flashing information, such as the size of the received split firmware data packets, whether the total capacity of the received split firmware data packets is equal to the total capacity of the firmware data packets.

[0125] Step a3: If it is the last firmware data packet, calculate the actual checksum of all received firmware data packets.

[0126] In this embodiment, if the currently received firmware data packet is the last firmware data packet, then the actual checksum of all firmware data packets received by the device to be flashed is calculated. If it is not the last firmware data packet, then the device to be flashed replies to the host computer with a response packet to obtain the next split firmware data packet.

[0127] Step a4: Compare the actual verification value with the firmware verification value to obtain the verification result.

[0128] In this embodiment, the firmware verification value in the firmware integrity parameter is compared with the actual verification value, and the comparison result is used as the verification result.

[0129] Step a5: Based on the flashing status and the verification status, determine the flashing result of the device to be flashed; wherein, if the flashing status is flashing completed and the verification status is the same, the flashing result is flashing successful; or, if the flashing status is flashing incomplete and / or the verification status is different, the flashing result is flashing failed.

[0130] In this embodiment, the success of the flashing process is determined based on the flashing and verification status of the split firmware data packets on the device to be flashed. Specifically, if the flashing status indicates that all split firmware data packets have been successfully flashed and the verification status shows that the checksums are the same, then the flashing result is considered successful. If either the flashing status is incomplete or the verification status shows that the checksums are different, then the flashing result is considered unsuccessful.

[0131] The technical solution of this embodiment splits, flashes, and verifies the firmware data package, ensuring the reliability and efficiency of the flashing process.

[0132] Figure 6 This is a flowchart illustrating the process of determining the Ethernet physical address of the device to be flashed according to an embodiment of the present invention. Figure 6 Yes Figure 5 Further explanation, such as Figure 6 As shown, the process includes the following steps:

[0133] Step S601: When the device to be flashed enters the flashing mode, an initial Ethernet physical address is generated and broadcast.

[0134] Specifically, once the device to be flashed enters flashing mode by pressing and holding the power button, the internal program immediately starts the address generation process. First, the device reads its own stored 64-bit unique identifier, which contains key information such as manufacturer and type. Based on this identifier, the device uses a random algorithm to generate an initial Ethernet physical address.

[0135] Subsequently, the device begins constructing an Ethernet broadcast packet, setting the newly generated initial Ethernet physical address as the source address and the destination address as the generic broadcast address. Simultaneously, it embeds its own 64-bit unique identifier in a custom packet type field to ensure the packet's identifiability. Once constructed, the device sends the broadcast packet to the network via its network interface, allowing a host computer on the same network to capture the packet and complete the broadcast operation of the initial Ethernet physical address.

[0136] Step S602: If a first broadcast packet is received from the host computer, the initial Ethernet physical address is determined as the target Ethernet physical address of the device to be flashed. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not being used by other devices within the same machine. Alternatively,

[0137] Specifically, the device to be flashed continuously monitors the network. Upon receiving the first broadcast packet from the host computer, it immediately parses the data packet. After confirming that the information carried in the first broadcast packet clearly indicates that the initial Ethernet physical address is not occupied by other devices within the same system, the device marks this initial Ethernet physical address as valid. The device stores this address in its designated storage area as the target Ethernet physical address for subsequent communication and flashing operations. The device will subsequently use this address to receive firmware control packets and flashing commands sent by the host computer, ensuring that data transmission accurately corresponds to this device.

[0138] In step S603, if a second broadcast packet is received from the host computer, the Ethernet physical address is regenerated and broadcast. If the host computer still reports that the regenerated Ethernet physical address is occupied by another device, the process of generating the Ethernet physical address is repeated until the generated Ethernet physical address is used by the host computer. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by another device.

[0139] Specifically, if the device to be flashed receives a second broadcast packet from the host computer and, after parsing, learns that the initial Ethernet physical address has been used by another device, the device will immediately trigger the address regeneration mechanism. The device will then read its own 64-bit unique identifier again, re-execute the operation of randomly generating an Ethernet physical address, generate a new address, construct a new Ethernet broadcast packet according to the above method, and send it.

[0140] If the device receives further feedback from the host computer, indicating that the newly generated Ethernet physical address is still in use, it will continuously repeat the process of generating a new address, constructing a broadcast packet, and sending it. The device will continue to cycle through this process until it receives confirmation of usability from the host computer. Finally, it will determine the Ethernet physical address recognized by the host computer as the target Ethernet physical address, preparing for the subsequent flashing process.

[0141] Figure 7 This is a flowchart of a multi-device flashing method based on Ethernet according to an embodiment of the present invention. This method can be used for devices to be flashed, such as… Figure 7 As shown, the method includes the following steps:

[0142] Step S701: The Ethernet physical address of the device to be flashed is automatically configured.

[0143] After the device enters the flashing mode, it randomly generates an Ethernet physical address. The host computer then checks whether the device's physical Ethernet address is duplicated with other devices. If it is duplicated, the device continues to randomly generate the next Ethernet physical address until the host computer confirms that the Ethernet physical address is unique.

[0144] In one example of this embodiment, Figure 8 This is a schematic diagram illustrating the automatic configuration of the Ethernet physical address of a device to be flashed according to an embodiment of the present invention. Figure 8 As shown, step S701 specifically includes the following interactive process:

[0145] 1) Obtain a 64-bit unique device identifier for the device to be flashed. This identifier is embedded in the device and includes the device manufacturer, device type, device version number, device serial number, etc. This identifier is unique to all devices.

[0146] 2) The device to be flashed will have a randomly generated Ethernet physical address.

[0147] 3) The device to be flashed sends a declaration packet, which is an Ethernet broadcast packet. The source address of the Ethernet packet is the address randomly generated in step 1), the destination address is the Ethernet broadcast address, the Ethernet type is custom, and the data carries the unique identifier of the device in step 2).

[0148] 4) The host computer receives the broadcast packet and parses out the source address of the Ethernet broadcast packet of the device to be flashed and the unique identifier of the device.

[0149] 4.1) If the host computer has not received a declaration packet for the Ethernet physical address, the host computer replies with a broadcast packet containing the Ethernet physical address and unique device identifier of the device to be flashed. The host computer then marks that the Ethernet physical address has been used.

[0150] 4.2) If the host computer has received a device declaration packet for the Ethernet address, it determines whether the device's unique identifier is consistent with the one received previously. If they are inconsistent, it means that the Ethernet address has already been used. The host computer replies with a broadcast packet containing the Ethernet physical address of the device to be flashed and the unique identifier of the device to be flashed that uses the Ethernet physical address.

[0151] 4.3) If the Ethernet physical address of the device to be flashed is the same as the Ethernet physical address stored in the host computer, then the host computer will reply with a broadcast packet containing the host computer's Ethernet physical address and the device's unique identifier, indicating that the Ethernet physical address has been used by the host computer.

[0152] 5) When the device receives a broadcast packet, it determines that the packet type is a declaration reply packet and parses out the device's Ethernet physical address and unique device identifier from the declaration reply packet.

[0153] 5.1 If the device Ethernet address in the declaration reply packet matches the Ethernet physical address of the device to be flashed, continue to determine the device's unique identifier.

[0154] 5.1.1 If the device unique identifiers are consistent, it means that the device to be flashed can use the Ethernet physical address.

[0155] 5.1.2 If there is a discrepancy, repeat step 2 for the equipment.

[0156] 5.2 If the device's Ethernet physical address in the declaration reply packet does not match the Ethernet physical address of the device to be flashed, the device to be flashed can record the already used Ethernet physical address. If a new random Ethernet physical address needs to be generated, the already used Ethernet physical address can be skipped. If the host computer does not receive a device declaration packet within a certain period of time, and all received device declaration packets contain Ethernet physical addresses that are confirmed to be unique, the entire device enters the Ethernet switch port and Ethernet physical address association stage. The host computer communicates with the Ethernet switch through special Ethernet multicast packets. The multicast packets contain the identifier of the Ethernet switch to be communicated with. Each Ethernet switch has a unique identifier, allowing the host computer to obtain the port and Ethernet address forwarding table information of a specific Ethernet switch. The Ethernet switch's forwarding table information includes the device's Ethernet physical address and the port where that Ethernet physical address is located. The host computer determines the Ethernet switch where the device is located and its port number within that Ethernet switch by querying the port-Ethernet physical address forwarding information of all Ethernet switches in the entire device.

[0157] Step S702: Determine the Ethernet switch port number where the device to be flashed is located.

[0158] The host computer obtains the switch where the device to be flashed is located, as well as the port number of the device on that switch, through the switch's port-Ethernet physical address forwarding table. Using the port number of the device, the host computer can determine the firmware required for flashing.

[0159] In one example of this embodiment, Figure 9 This is a schematic diagram illustrating how to determine the Ethernet switch port number of the device to be flashed according to an embodiment of the present invention. Figure 9 As shown, step S702 specifically includes the following interactive process:

[0160] 1. The host computer sends a probe broadcast packet.

[0161] 2. The device to be flashed receives the detection packet.

[0162] 2.1 If the device to be flashed does not receive the detection end packet, it will reply with a detection response broadcast packet.

[0163] 2.2 If the device to be flashed has received the probe end packet, it means that the host computer has obtained the Ethernet switch and port where the device to be flashed is located, and the device to be flashed does not need to reply with a probe response broadcast packet.

[0164] 3. After receiving the probe response broadcast packet from the device to be flashed, the host computer iterates through the port-Ethernet physical forwarding table information of all Ethernet switches in the entire machine. By comparing the Ethernet physical address of the device to be flashed with the port-Ethernet physical address forwarding table information of the switch, it determines the switch and port number where the device to be flashed is located.

[0165] 3.1 If the switch and port information of the device to be flashed are successfully obtained, a unicast packet of probe end packet is sent to the device. After receiving the probe end packet, the device does not need to respond to the subsequent probe broadcast packet from the host computer.

[0166] 4. After the host computer receives the probe response packets from all the devices to be flashed, due to the limited capacity of the switch's forwarding table, some devices may not be able to obtain the Ethernet switch and port number they are on. In this case, step 1 needs to be repeated. Since some devices have already obtained the port information, these devices that have obtained the port of their respective switch will not reply with probe packets, while the undetected devices will reply with probe packets. In this way, the Ethernet switch's forwarding table will only contain the port number and Ethernet information of the undetected devices, until the Ethernet switch and port number of all the devices to be flashed are obtained.

[0167] After the host computer obtains the Ethernet switch and port number of the device to be flashed, it can determine the firmware that needs to be flashed. The host computer communicates with the device directly through Layer 2 Ethernet unicast packets, sending flashing commands and firmware data to the device, and the device flashes according to the commands and firmware data.

[0168] Step S703: Transfer and flash firmware of the device to be flashed.

[0169] The host computer sends control commands and firmware data to the device to be flashed via a custom Ethernet Layer 2 protocol. After receiving the firmware data, the device to be flashed writes the data to its memory.

[0170] In one example of this embodiment, Figure 10 This is a schematic diagram illustrating firmware transmission and flashing of a device to be flashed according to an embodiment of the present invention, as shown below. Figure 10 As shown, step S703 specifically includes the following interactive process:

[0171] 1. The host computer sends a firmware control package to the device to be flashed, which includes firmware flashing configuration, firmware size, and firmware verification value.

[0172] 2. After the device to be flashed receives the firmware control packet, it replies with a firmware control response packet and enters firmware receiving mode.

[0173] 3. After receiving the response packet, the host computer splits the firmware packet according to the Ethernet frame size and sends firmware data packets, with the packet header containing the size of the data packet.

[0174] 4. When the device to be flashed receives the firmware data packet, it caches the data or writes it to the memory, and determines whether it is the last data packet based on its size.

[0175] 4.1 If it is the last data packet, calculate the checksum of all received data. If it is the same as the checksum in the firmware control packet and the flashing was successful, reply with a firmware flashing success packet. If they are different, reply with a firmware flashing failure packet.

[0176] 4.2 If this is not the last data packet, the device to be flashed will reply with a firmware data response packet.

[0177] 5. The host computer processes the received response packets accordingly:

[0178] 5.1 If it is a firmware data response packet, the host machine repeats step 3 to continue sending firmware data.

[0179] 5.2 If the firmware flashing failed, retry or report an error.

[0180] 5.3 If the firmware flashing package is successful, a success message will be returned and communication with the device to be flashed will end.

[0181] In this embodiment, Ethernet is used for firmware flashing of multiple devices. An Ethernet physical address is assigned to the device to be flashed, and the switch and port number connected to the device are obtained using this address. Firmware data packets from the host computer are transmitted to the device to be flashed via this switch and port number to complete the flashing process. This improves the flashing efficiency of different devices within the entire system.

[0182] This embodiment also provides a multi-device flashing device based on Ethernet, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0183] This embodiment provides a multi-device flashing device based on Ethernet, applicable to a host computer, such as... Figure 11 As shown, it includes:

[0184] The determination module 1101 is used to determine multiple devices to be flashed in the whole machine and send probe broadcast packets to the devices to be flashed;

[0185] The acquisition module 1102 is used to obtain the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch based on the target Ethernet physical address carried in the response broadcast packet when it receives the response broadcast packet fed back by all devices to be flashed in the whole machine based on the response broadcast packet.

[0186] The sending module 1103 is used to send a firmware control package and a flashing instruction to the corresponding device to be flashed based on the target port number. The device to be flashed performs the flashing operation according to the flashing instruction and the firmware control package.

[0187] In some alternative implementations, the determining module 1101 further includes, before sending a probe broadcast packet to the device to be flashed:

[0188] The detection unit is used to detect the initial Ethernet physical address broadcast by each device to be flashed, wherein the initial Ethernet physical address is generated by the device to be flashed after entering the flashing mode;

[0189] The query unit is used to query whether the initial Ethernet physical address exists in the Ethernet physical address list, wherein the Ethernet physical address list includes at least one Ethernet physical address generated by the device to be flashed;

[0190] The target Ethernet physical address determination unit is configured to: if the initial Ethernet physical address does not exist in the Ethernet physical address list, reply with a first broadcast packet and determine the initial Ethernet physical address as the target Ethernet physical address, wherein the first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not used by other devices to be flashed within the whole machine; or, if the initial Ethernet physical address exists in the Ethernet physical address list, reply with a second broadcast packet and continuously listen for the Ethernet physical addresses broadcast by the devices to be flashed until an Ethernet physical address not existing in the Ethernet physical address list is received, and this Ethernet physical address is used as the target Ethernet physical address, wherein the second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by other devices.

[0191] In some optional implementations, the acquisition module 1102 includes:

[0192] Obtain the port address forwarding table of the switch to which each device to be flashed is connected. The port address forwarding table includes the Ethernet physical address corresponding to each port number in the switch.

[0193] Traverse the port address forwarding table, select the switch corresponding to the port address forwarding table of the target Ethernet physical address as the target switch, and obtain the target port number from the port address forwarding table of the target switch.

[0194] This embodiment provides an Ethernet-based multi-device flashing device for use with devices to be flashed, such as... Figure 12 As shown, it includes:

[0195] The monitoring module 1201 is used to monitor the probe broadcast packets sent by the host computer;

[0196] The Ethernet physical address acquisition module 1202 is used to respond to probe broadcast packets, acquire the target Ethernet physical address of the device to be flashed, and send a response broadcast packet to the host computer based on the target Ethernet physical address.

[0197] The receiving module 1203 is used to receive the flashing command and firmware control packet sent by the host computer based on the target port number of the target switch where the device to be flashed is located. The flashing command and firmware control packet are sent by the host computer after receiving the response broadcast packets of all devices to be flashed in the whole machine where the device to be flashed is located.

[0198] The flashing module 1204 is used to perform flashing operations according to flashing instructions and firmware control packages to obtain the flashing results of the device to be flashed.

[0199] In some alternative embodiments, the apparatus further includes:

[0200] The broadcast module 1205 is used to generate an initial Ethernet physical address and broadcast the initial Ethernet physical address when the device to be flashed enters the flashing mode.

[0201] The Ethernet physical address determination module 1206 is used to determine the initial Ethernet physical address as the target Ethernet physical address of the device to be flashed if it receives a first broadcast packet from the host computer. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not used by other devices in the system. Alternatively, if it receives a second broadcast packet from the host computer, it regenerates the Ethernet physical address and broadcasts the regenerated Ethernet physical address. If the host computer still reports that the regenerated Ethernet physical address is occupied by other devices, the process of generating the Ethernet physical address is repeated until the generated Ethernet physical address is used by the host computer. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by other devices.

[0202] In some alternative implementations, the flashing module 1204 includes:

[0203] The parsing unit is used to parse the firmware control packet based on the flashing command to obtain the firmware flashing configuration and firmware integrity parameters, and reply to the host computer with a response packet. The host computer sends the split firmware data packet to the device to be flashed based on the response packet. The firmware integrity parameters include the firmware size and firmware check value.

[0204] Firmware receiving unit, used to receive firmware data packets sent by the host computer;

[0205] The flashing verification unit is used to flash the firmware data packet according to the firmware flashing configuration and to verify the firmware data packet using firmware integrity parameters to obtain the flashing result of the device to be flashed.

[0206] In some optional implementations, the write verification unit includes:

[0207] The flashing subunit is used to flash the firmware data packet according to the firmware flashing configuration and obtain the flashing status of the firmware data packet.

[0208] The receive completion judgment subunit is used to determine whether the currently received firmware data packet is the last firmware data packet based on the firmware size;

[0209] The receiving verification subunit is used to calculate the actual verification value of all received firmware data packets if it is the last firmware data packet.

[0210] The comparison subunit is used to compare the actual verification value with the firmware verification value to obtain the verification result.

[0211] The flashing result determination subunit is used to determine the flashing result of the device to be flashed based on the flashing status and the verification status; wherein, if the flashing status is flashing completed and the verification status is the same, the flashing result is flashing successful; or, if the flashing status is flashing incomplete and / or the verification status is verification different, the flashing result is flashing failed.

[0212] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0213] In this embodiment, the Ethernet-based multi-device flashing device is presented in the form of a functional unit. Here, a unit refers to an application-specific integrated circuit (ASIC) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0214] This invention also provides a computer device having the above-described features. Figure 11 or Figure 12 The image shows a multi-device flashing device based on Ethernet.

[0215] Please see Figure 13 , Figure 13 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 13As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 13 Take a processor 10 as an example.

[0216] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0217] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0218] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0219] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0220] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0221] This invention also provides a multi-device flashing system based on Ethernet. The system includes a host computer and a main unit, the main unit including multiple switches, and the switches connecting multiple devices to be flashed.

[0222] After the host computer identifies multiple devices to be flashed in the entire system, it sends a probe broadcast packet to the devices to be flashed.

[0223] The device to be flashed listens for probe broadcast packets sent by the host computer. After receiving the probe broadcast packet, it obtains the target Ethernet physical address of the device to be flashed and sends a response broadcast packet back to the host computer based on the target Ethernet physical address.

[0224] When the host computer receives the response broadcast packets from all the devices to be flashed in the whole machine based on the probe broadcast packets, it obtains the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch based on the target Ethernet physical address carried in the response broadcast packet; based on the target port number, it sends firmware control packets and flashing instructions to the corresponding device to be flashed.

[0225] The device to be flashed receives the flashing command and firmware control packet sent by the host computer based on the target port number of the target switch where the device is located, and performs the flashing operation according to the flashing command and firmware control packet to obtain the flashing result of the device to be flashed.

[0226] The system's technical solution improves the efficiency of firmware flashing for multiple devices via Ethernet.

[0227] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0228] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0229] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A multi-device flashing method based on Ethernet, characterized in that, The method runs on the host computer, and the method includes: Identify multiple devices in the entire machine that need to be flashed, and send probe broadcast packets to the devices to be flashed; When the system receives response broadcast packets from all devices to be flashed in the whole machine based on the probe broadcast packet, the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch are obtained based on the target Ethernet physical address carried in the response broadcast packet. Based on the target port number, a firmware control package and a flashing instruction are sent to the corresponding device to be flashed, wherein the device to be flashed performs a flashing operation according to the flashing instruction and the firmware control package.

2. The method according to claim 1, characterized in that, Before sending a probe broadcast packet to the device to be flashed, the method further includes: Detect the initial Ethernet physical address broadcast by each of the devices to be flashed, wherein the initial Ethernet physical address is generated by the device to be flashed after entering flashing mode; Query whether the initial Ethernet physical address exists in the Ethernet physical address list, wherein the Ethernet physical address list includes at least one Ethernet physical address generated by the device to be flashed; If the initial Ethernet physical address does not exist in the Ethernet physical address list, a first broadcast packet is replied, and the initial Ethernet physical address is identified as the target Ethernet physical address. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not being used by other devices within the system to be flashed; or... If the initial Ethernet physical address exists in the Ethernet physical address list, a second broadcast packet is replied, and the device continuously listens for the Ethernet physical address broadcast by the device to be flashed until an Ethernet physical address not existing in the Ethernet physical address list is received, and that Ethernet physical address is used as the target Ethernet physical address. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by another device.

3. The method according to claim 1, characterized in that, The step of obtaining the switch connected to each device to be flashed, and the target port number of the device to be flashed on the corresponding switch, based on the target Ethernet physical address carried in the response broadcast packet, includes: Obtain the port address forwarding table of the switch connected to each of the devices to be flashed, wherein the port address forwarding table includes the Ethernet physical address corresponding to each port number in the switch; Traverse the port address forwarding table, select the switch corresponding to the port address forwarding table where the target Ethernet physical address is matched as the target switch, and obtain the target port number from the port address forwarding table of the target switch.

4. A multi-device flashing method based on Ethernet, characterized in that, The method is applied to a device to be flashed, and the method includes: Listen for probe broadcast packets sent by the host computer; In response to the probe broadcast packet, the target Ethernet physical address of the device to be flashed is obtained, and a response broadcast packet is sent back to the host computer based on the target Ethernet physical address; Based on the target port number of the target switch where the device to be flashed is located, the host computer sends a flashing command and a firmware control packet. The flashing command and the firmware control packet are sent by the host computer after receiving the response broadcast packets of all devices to be flashed in the whole machine where the device to be flashed is located. The flashing operation is performed according to the flashing command and the firmware control package to obtain the flashing result of the device to be flashed.

5. The method according to claim 4, characterized in that, The method further includes: When the device to be flashed enters the flashing mode, an initial Ethernet physical address is generated and broadcast. If the first broadcast packet from the host computer is received, the initial Ethernet physical address is determined as the target Ethernet physical address of the device to be flashed. The first broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address is not being used by other devices within the same system. Alternatively... If the host computer receives the second broadcast packet, it regenerates the Ethernet physical address and broadcasts the regenerated Ethernet physical address. If the host computer still reports that the regenerated Ethernet physical address is occupied by another device, the process of generating the Ethernet physical address is repeated until the generated Ethernet physical address is used by the host computer. The second broadcast packet is used to notify the device to be flashed that the initial Ethernet physical address has been occupied by another device.

6. The method according to claim 4, characterized in that, The step of performing a flashing operation according to the flashing command and the firmware control package to obtain the flashing result of the device to be flashed includes: Based on the flashing command, the firmware control packet is parsed to obtain the firmware flashing configuration and firmware integrity parameters, and a response packet is sent back to the host computer. The host computer sends a split firmware data packet to the device to be flashed based on the response packet. The firmware integrity parameters include firmware size and firmware checksum. Receive firmware data packets sent by the host computer; The firmware data packet is flashed according to the firmware flashing configuration, and the firmware data packet is verified using the firmware integrity parameters to obtain the flashing result of the device to be flashed.

7. The method according to claim 6, characterized in that, The process of flashing the firmware data packet according to the firmware flashing configuration and verifying the firmware data packet using the firmware integrity parameters to obtain the flashing result of the device to be flashed includes: The firmware data packet is flashed according to the firmware flashing configuration to obtain the flashing status of the firmware data packet; The firmware size is used to determine whether the currently received firmware data packet is the last firmware data packet; If it is the last firmware data packet, then calculate the actual checksum of all received firmware data packets; By comparing the actual verification value with the firmware verification value, the verification result is obtained; Based on the flashing status and the verification status, the flashing result of the device to be flashed is determined; wherein, if the flashing status is flashing completed and the verification status is the same, the flashing result is flashing successful; or, if the flashing status is flashing incomplete and / or the verification status is different, the flashing result is flashing failed.

8. A multi-device flashing device based on Ethernet, characterized in that, The device is used in a host computer, and the device includes: The determination module is used to determine multiple devices to be flashed in the whole machine and send probe broadcast packets to the devices to be flashed; The acquisition module is used to, when receiving response broadcast packets from all devices to be flashed in the whole machine based on the probe broadcast packet, obtain the switch connected to each device to be flashed and the target port number of the device to be flashed on the corresponding switch based on the target Ethernet physical address carried in the response broadcast packet; The sending module is used to send a firmware control package and a flashing instruction to the corresponding device to be flashed based on the target port number, wherein the device to be flashed performs a flashing operation according to the flashing instruction and the firmware control package.

9. A multi-device flashing device based on Ethernet, characterized in that, The device is used on a device to be flashed, and the device includes: The monitoring module is used to monitor the probe broadcast packets sent by the host computer. The Ethernet physical address acquisition module is used to respond to the probe broadcast packet, acquire the target Ethernet physical address of the device to be flashed, and send a response broadcast packet back to the host computer based on the target Ethernet physical address; The receiving module is used to receive the flashing command and firmware control packet sent by the host computer based on the target port number of the target switch where the device to be flashed is located. The flashing command and firmware control packet are sent by the host computer after receiving the response broadcast packets of all devices to be flashed in the whole machine where the device to be flashed is located. The flashing module is used to perform flashing operations according to the flashing instructions and the firmware control package to obtain the flashing result of the device to be flashed.

10. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the computer instructions to perform the Ethernet-based multi-device flashing method according to any one of claims 1 to 7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the Ethernet-based multi-device flashing method according to any one of claims 1 to 7.

12. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the Ethernet-based multi-device flashing method as described in any one of claims 1 to 7.