CN117675572A - Firmware upgrading method of slave node equipment of master-slave system and storage medium - Google Patents

Firmware upgrading method of slave node equipment of master-slave system and storage medium Download PDF

Info

Publication number
CN117675572A
CN117675572A CN202211033296.8A CN202211033296A CN117675572A CN 117675572 A CN117675572 A CN 117675572A CN 202211033296 A CN202211033296 A CN 202211033296A CN 117675572 A CN117675572 A CN 117675572A
Authority
CN
China
Prior art keywords
firmware
slave node
fragment
node device
receiving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211033296.8A
Other languages
Chinese (zh)
Inventor
陈挺
陈金松
刘伟峰
张金珍
陈益民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yaxon Networks Co Ltd
Original Assignee
Xiamen Yaxon Networks Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Yaxon Networks Co Ltd filed Critical Xiamen Yaxon Networks Co Ltd
Priority to CN202211033296.8A priority Critical patent/CN117675572A/en
Publication of CN117675572A publication Critical patent/CN117675572A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a firmware upgrading method and a storage medium of slave node equipment of a master-slave system, wherein the method comprises the following steps: the method comprises the steps that a master node device segments an upgrade firmware file of a slave node device to obtain at least one firmware segment, numbers the firmware segments and calculates segment check codes of the firmware segments; broadcasting each firmware segment and the firmware segment information to each slave node device in turn; after broadcasting each firmware segment, sequentially sending a firmware segment receiving state query instruction corresponding to each slave node device; if receiving the receiving failure information returned by the slave node equipment, sequentially rebroadcasting each firmware segment with receiving failure to each slave node equipment with the receiving failure information; and otherwise, sending out a synchronous update command so that each slave node device carries out firmware update simultaneously. The invention can reduce the transmission interaction time and accelerate the upgrading progress.

Description

Firmware upgrading method of slave node equipment of master-slave system and storage medium
Technical Field
The present invention relates to the field of firmware upgrade technologies, and in particular, to a method for upgrading firmware of a slave node device of a master-slave system and a storage medium thereof.
Background
The bluetooth digital key is one of the hot technologies in recent years, integrates a car key function into mobile terminal equipment, and uses the bluetooth technology to connect a mobile phone with a car based on safety functions such as SE, TEE and the like, so as to realize control functions such as entering, starting, air conditioning, car windows, welcome and the like of the car.
According to positioning precision and coverage requirements, the existing scheme often adopts a deployment mode of 1 master node+N slave nodes, and the master node and the slave nodes communicate through LIN (Local Interconnect Network) or CAN (Controller Area Network) modes and the like. In the traditional scheme, the slave node firmware of the master-slave system is upgraded, each slave node is upgraded in a one-to-one mode or in a one-to-many mode, and a mode of transmitting one query once is adopted in the sub-packet transmission. In either way, the firmware transmission process is more interactive and the progress is slower. In addition, for the slave nodes, different firmware versions need to be written or the numbers need to be calibrated in advance, the target object of data transmission between the master node and the slave node can be determined, and the production and maintenance cost of the equipment is increased. Furthermore, for cluster upgrades of multi-slave nodes, a means of synchronous switching is lacking.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the firmware upgrading method of the slave node equipment of the master-slave system and the storage medium are provided, so that the transmission interaction time can be reduced, and the upgrading progress can be accelerated.
In order to solve the technical problems, the invention adopts the following technical scheme: a firmware upgrading method of slave node equipment of a master-slave system comprises the following steps:
the method comprises the steps that a master node device segments an upgrade firmware file of a slave node device according to a preset transmission segment length to obtain at least one firmware segment, numbers the firmware segments and calculates segment check codes of the firmware segments;
broadcasting each firmware segment and the firmware segment information thereof to each slave node device in turn, wherein the firmware segment information comprises the serial numbers of the firmware segments and segment check codes;
after broadcasting each firmware segment, sequentially sending a firmware segment receiving state query instruction corresponding to each slave node device;
if receiving the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, sequentially rebroadcasting the firmware fragments with receiving failure to the slave node equipment with the receiving failure information;
if the receiving failure information returned by the slave node equipment is not received, the master node equipment sends out a synchronous update command so that the slave node equipment can update the firmware simultaneously after receiving the synchronous update command.
The invention also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a method as described above.
The invention has the beneficial effects that: the one-to-many broadcast transmission is adopted when the firmware is upgraded, and the state inquiry is carried out once again after the broadcasting is finished, so that the time for transmission interaction can be reduced, the upgrading progress is accelerated, namely, the time consumed by the transmission state inquiry interaction is reduced in a mode of multiple transmission and one inquiry; meanwhile, the synchronization of the firmware updating and switching of each slave node device can be ensured through the synchronization updating command.
Drawings
FIG. 1 is a flow chart of a method for upgrading firmware of a slave node device of a master-slave system according to the present invention;
fig. 2 is a network topology diagram of a cluster according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a start-up procedure in accordance with a first embodiment of the present invention;
fig. 4 is a flowchart of a transmission flow in the first embodiment of the present invention;
fig. 5 is a flowchart of an update process according to a first embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a firmware upgrade method of a slave node device of a master-slave system includes:
the method comprises the steps that a master node device segments an upgrade firmware file of a slave node device according to a preset transmission segment length to obtain at least one firmware segment, numbers the firmware segments and calculates segment check codes of the firmware segments;
broadcasting each firmware segment and the firmware segment information thereof to each slave node device in turn, wherein the firmware segment information comprises the serial numbers of the firmware segments and segment check codes;
after broadcasting each firmware segment, sequentially sending a firmware segment receiving state query instruction corresponding to each slave node device;
if receiving the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, sequentially rebroadcasting the firmware fragments with receiving failure to the slave node equipment with the receiving failure information;
if the receiving failure information returned by the slave node equipment is not received, the master node equipment sends out a synchronous update command so that the slave node equipment can update the firmware simultaneously after receiving the synchronous update command.
From the above description, the beneficial effects of the invention are as follows: the time of transmission interaction can be reduced, the upgrading progress can be accelerated, and the synchronism of updating and switching of the firmware of each slave node device can be ensured.
Further, the master node device segments the upgrade firmware file of the slave node device according to a preset transmission segment length to obtain at least one firmware segment, numbers each firmware segment, and after calculating a segment check code of each firmware segment, further includes:
the master node device broadcasts the firmware information of the upgrade firmware file to each slave node device, wherein the firmware information comprises the total length of the upgrade firmware file, the transmission fragment length, the total number of the firmware fragments and the firmware check code of the upgrade firmware file.
As can be seen from the above description, by transmitting the firmware information, each slave node device can check again for the stored upgrade firmware file after receiving and storing the upgrade firmware file, and confirm the validity of the received upgrade firmware file.
Further, after broadcasting the firmware information of the updated firmware file to each slave node device, the master node device further includes:
the master node equipment sequentially sends a firmware information receiving state query instruction corresponding to each slave node equipment;
if a firmware information receiving failure message returned from the node equipment is received, judging whether the retransmission times reach the preset retransmission times or not;
if not, re-broadcasting the firmware information of the updated firmware file, adding one to the retransmission times, wherein the initial value of the retransmission times is zero, and continuously executing the step of sequentially sending the firmware information receiving state query instructions corresponding to the slave node devices;
if yes, recording the unique identification of the slave node equipment with the failed firmware information reception.
As is apparent from the above description, by querying the firmware information reception state of each slave node device, it is possible to confirm whether the slave node device has failed.
Further, before the master node device issues the synchronization update command, the method further includes:
each slave node device obtains an upgrade firmware file according to each received firmware fragment and the serial number thereof, and verifies the obtained upgrade firmware file according to the firmware information;
if the verification is successful, the method enters a state of waiting to be updated.
From the above description, the validity of the received upgrade firmware file is ensured by checking the received upgrade firmware file.
Further, broadcasting each firmware segment and its firmware segment information to each slave node device in turn, where the firmware segment information includes the serial number of the firmware segment and the segment check code, and then further includes:
after receiving a firmware fragment and firmware fragment information thereof from node equipment, verifying the firmware fragment according to a fragment verification code of the firmware fragment;
if the verification is successful, determining an offset position of the firmware fragment in the updated firmware file according to the serial number of the firmware fragment, the total length of the updated firmware file, the transmission fragment length and the total number of the firmware fragments, storing the firmware fragment in the corresponding firmware file offset position, and recording the serial number of the firmware fragment in a successful receiving fragment table.
As can be seen from the above description, the slave node device verifies the firmware fragments to ensure the validity of the received firmware fragments, and records the serial numbers of the successfully received firmware fragments to facilitate the subsequent determination of the firmware fragments with failed reception, i.e. the retransmission firmware fragments required by the slave node device.
Further, after each firmware segment is broadcasted, the method further includes the steps of:
when receiving a firmware fragment receiving state inquiry instruction corresponding to the slave node equipment, determining the number of the firmware fragment with failed receiving according to a successful receiving fragment table recorded by the slave node equipment, generating receiving failure information, and returning the receiving failure information to the master node equipment.
From the above description, the slave node device returns the serial number of the firmware fragment with failed reception to the master node device, so that the master node device can count the slave node device and the firmware fragment with failed reception conveniently.
Further, if receiving the reception failure information returned from the slave node device, where the reception failure information includes the number of the firmware segment that fails in reception, rebroadcast each firmware segment that fails in reception to each slave node device that returns the reception failure information in sequence, specifically:
if the master node equipment receives the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, updating a receiving failure node table according to the unique identification of the slave node equipment with the receiving failure information, and updating the receiving failure fragment table according to the receiving failure information returned by the slave node equipment;
determining a firmware fragment to be retransmitted as a retransmission firmware fragment according to the latest receiving failure fragment table, and rebroadcasting each retransmission firmware fragment and firmware fragment information thereof to each slave node device in sequence;
after re-broadcasting each retransmission firmware segment, sequentially sending a firmware segment receiving state query instruction corresponding to each slave node device in the latest receiving failure node table;
and if receiving the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, continuously executing the steps of updating the receiving failure node table according to the unique identification of the slave node equipment with the receiving failure information, and updating the receiving failure fragment table according to the receiving failure information returned by the slave node equipment.
As can be seen from the above description, as long as one firmware fragment is not successfully received by all non-faulty slave node devices, retransmission is performed until all firmware fragments are successfully received by all non-faulty slave node devices.
Further, after the re-broadcasting each retransmission firmware segment and the firmware segment information thereof to each slave node device in turn, the method further includes:
the slave node equipment determines retransmission firmware fragments required by the slave node equipment according to the self-recorded successful fragment table;
after receiving a retransmission firmware fragment and firmware fragment information thereof required by the slave node equipment, verifying the retransmission firmware fragment according to a fragment verification code of the retransmission firmware fragment;
if the verification is successful, determining the offset position of the retransmission firmware fragment in the upgrading firmware file according to the serial number of the retransmission firmware fragment, the total length of the upgrading firmware file, the transmission fragment length and the total number of the firmware fragments, storing the retransmission firmware fragment in the corresponding firmware file offset position, and recording the serial number of the retransmission firmware fragment in a receiving success fragment table.
Further, the master node device is respectively connected with each slave node device through a bus; the master node device broadcasts to each slave node device through the bus, and the slave node device returns the receiving failure information to the master node device through the bus.
Further, the master node device is respectively in communication connection with each slave node device through a general input/output port corresponding to each slave node device.
From the above description, by allocating independent GPIOs to each node, it is achieved that different slave nodes share the same firmware version, and the master node and the slave nodes can automatically determine the target object without calibration in advance.
Further, the master node device sends out a synchronization update command, so that each slave node device can update the firmware at the same time after receiving the synchronization update command, specifically:
the master node equipment simultaneously controls all the general input and output ports to send out synchronous update signals and continuously broadcasts a preset number of synchronous update instructions to the bus, so that all the slave node equipment simultaneously carries out firmware update after receiving the synchronous update signals or the synchronous update instructions.
As can be seen from the above description, the synchronization of the firmware update switching of each slave node device is further ensured by adopting the way of combining the hard-wire GPIO signal and the instruction message.
Further, the step of sequentially sending the firmware segment receiving state query instruction corresponding to each slave node device specifically includes:
the master node equipment sends a firmware fragment receiving state query instruction to each slave node equipment through a general input/output port corresponding to each slave node equipment.
As can be seen from the above description, the slave node device can determine whether the query command is a query command of the master node device for the node by detecting the corresponding GPIO signal.
Further, the firmware segment receiving status query instruction corresponding to each slave node device includes a unique identifier of each slave node device.
From the above description, the slave node device can determine whether the query instruction is a query instruction of the master node device for the own node through the slave node identification information carried in the query instruction.
The invention also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a method as described above.
Example 1
Referring to fig. 2-5, a first embodiment of the present invention is as follows: a firmware upgrading method of slave node equipment of a master-slave system can be applied to upgrading of Bluetooth digital keys.
As shown in fig. 2, the master-slave system of this embodiment includes a master node device and a plurality of slave node devices, where the master node device and the slave node devices are connected by a LIN, CAN, or other bus manner to form a network, and meanwhile, independent GPIOs (General-purpose input/output) are allocated between the master node device and each slave node device for connection control, and the slave node devices have the same functions and firmware. The master node device performs the number calibration and the communication object pointing of the target slave node device by controlling the GPIO signal.
The firmware upgrading method of the embodiment mainly comprises a starting flow, a transmission flow and an updating flow.
As shown in fig. 3, the start-up procedure includes the following steps:
s101: when the slave node equipment needs to carry out firmware upgrading, the master node equipment is used as a master, and the upgrading firmware file of the slave node equipment is obtained and stored in advance.
S102: the master node device segments the updated firmware file according to the preset transmission segment length to obtain at least one firmware segment, numbers each firmware segment and calculates the segment check code of each firmware segment.
In this embodiment, considering that the subsequent slave node device will also check the complete updated firmware file after receiving all the firmware fragments, the fragment check code is calculated by using an exclusive-or check algorithm.
S103: the master node device broadcasts the firmware information of the upgrade firmware file to each slave node device through a bus, wherein the firmware information comprises the total length of the upgrade firmware file, the transmission segment length, the total number of the firmware segments and the firmware check code of the upgrade firmware file.
The firmware check code may be an MD5 check code, i.e., a hash value of the upgraded firmware file is calculated by an MD5 message digest algorithm.
S104: the master node device sequentially sends a firmware information receiving state query instruction corresponding to each slave node device.
After the slave node equipment identifies the corresponding firmware information receiving state inquiry instruction, if the slave node equipment fails to receive the firmware information, a firmware information receiving failure message is returned to the master node equipment through the bus.
The slave node device pointed by the currently sent firmware information receiving state query instruction can be identified by controlling the corresponding GPIO signal by the master node device, and can also be identified by carrying the unique identification of the slave node device in the firmware information receiving state query instruction.
In this embodiment, the unique identifier of the slave node device is a number, and the slave node device identifies the execution object of the calibration instruction by detecting the GPIO signal of the master node device, so as to perform automatic calibration generation.
S105: and the master node equipment judges whether a firmware information receiving failure message returned by the slave node equipment is received, if yes, the step S106 is executed, if not, the fact that the slave node equipment successfully receives the firmware information is indicated, the firmware information is recorded and stored, and then the firmware downloading state is entered, namely, the transmission flow is entered.
S106: and judging whether the retransmission times reach the preset retransmission times, if so, executing the step S108, and if not, executing the step S107. In this embodiment, the number of preset retransmissions is 3 or less and less than the total number of slave node devices.
S107: and re-broadcasting the firmware information of the updated firmware file, adding one to the number of retransmission times, and returning to the step S104. Wherein the initial value of the retransmission number is 0.
S108: and recording the unique identification of the slave node equipment with failed firmware information reception, namely recording the serial number of the slave node equipment with failed firmware information reception, and generating corresponding fault information.
After the transmission of the firmware information is finished, the master node device starts a firmware transmission flow.
As shown in fig. 4, the transmission flow includes the steps of:
s201: the master node device broadcasts each firmware segment and the firmware segment information thereof to each slave node device in turn, namely, the master node device broadcasts and transmits all the firmware segments and the firmware segment information thereof to all the slave node devices through buses, wherein the firmware segment information comprises the serial numbers and segment check codes of the firmware segments.
S202: each slave node device receives each firmware fragment and the firmware fragment information thereof, checks the firmware fragments, stores the checked firmware fragments to the corresponding positions, and records the serial numbers of the successfully received firmware fragments.
Specifically, after receiving a firmware fragment and the firmware fragment information thereof from the node device, checking the firmware fragment according to the fragment check code of the firmware fragment, namely calculating to obtain the check code of the firmware fragment by adopting an exclusive or check algorithm, if the check code is consistent with the fragment check code in the firmware fragment information, judging that the check passes, otherwise, judging that the check fails.
If the verification is passed, determining an offset position of the firmware fragment in the updated firmware file according to the serial number of the firmware fragment, the total length of the updated firmware file, the transmission fragment length and the total number of the firmware fragments, storing the firmware fragment in the corresponding firmware file offset position, and recording the serial number of the firmware fragment in a successful fragment table.
S203: after the master node equipment broadcasts each firmware segment, the firmware segment receiving state inquiry instructions corresponding to each slave node equipment are sequentially sent out.
When receiving a state query instruction of a firmware segment corresponding to the slave node equipment, namely the slave node equipment receives the serial number of the slave node equipment carried in the state query instruction through a corresponding GPIO signal or the firmware segment, and confirms that the current state query instruction of the firmware segment is the query instruction of the master node equipment to the node, the serial number of the firmware segment with failed reception is determined according to a successful segment table recorded by the slave node equipment, receiving failure information is generated, and the receiving failure information is returned to the master node equipment through a bus.
S204: the master node device determines whether a reception failure message returned from the slave node device is received, if yes, step S205 is executed, and if no, each slave node device that is not faulty successfully receives all the firmware fragments, step S209 is executed. Wherein the reception failure information includes the number of the firmware fragment that failed to be received.
S205: the master node device updates the reception failure node table according to the unique identifier of the slave node device with the reception failure information returned, and updates the reception failure fragment table according to the reception failure information returned by the slave node device.
Specifically, the master node device counts and records the numbers of the slave node devices with failed responses, takes the numbers of the slave node devices as the latest receiving failure nodes to obtain the latest receiving failure node table, and meanwhile, de-duplicates the numbers of the firmware fragments with failed receiving returned by the slave node devices, takes the numbers of the firmware fragments after de-duplication as the latest receiving failure fragments to obtain the latest receiving failure fragment table.
S206: and the master node equipment determines the firmware fragments needing to be retransmitted according to the latest receiving failure fragment table to be used as retransmission firmware fragments, and rebroadcasts each retransmission firmware fragment and the firmware fragment information thereof to each slave node equipment through a bus in sequence.
That is, even if only one slave node device does not successfully receive a firmware fragment, the firmware fragment is rebroadcast to all slave node devices.
S207: the slave node equipment determines, receives and checks the retransmission firmware fragments required by the slave node equipment according to the self-recorded reception success fragment table, stores the retransmission firmware fragments which are checked to be successful to the corresponding positions, and records the numbers of the retransmission firmware fragments which are received successfully.
Specifically, the numbers of all the firmware fragments are compared with the numbers in the receiving success fragment table, and the numbers which are not recorded in the receiving success fragment table are the numbers of the required retransmission firmware fragments.
After receiving a retransmission firmware segment and its firmware segment information, which are required by the slave node device, the slave node device checks the retransmission firmware segment according to the segment check code of the retransmission firmware segment, and the check process may refer to step S202.
If the verification is successful, determining the offset position of the retransmission firmware fragment in the upgrading firmware file according to the serial number of the retransmission firmware fragment, the total length of the upgrading firmware file, the transmission fragment length and the total number of the firmware fragments, storing the retransmission firmware fragment in the corresponding firmware file offset position, and recording the serial number of the retransmission firmware fragment in a receiving success fragment table.
S208: and after the main node equipment rebroadcasts each retransmission firmware segment, sequentially sending a firmware segment receiving state inquiry instruction of each slave node equipment in the corresponding latest receiving failure node table.
When receiving a firmware fragment receiving state inquiry instruction corresponding to the slave node equipment in the latest receiving failure node table, determining the number of the firmware fragment with receiving failure according to the receiving success fragment table recorded by the slave node equipment, generating receiving failure information, and returning the receiving failure information to the master node equipment through a bus.
And then returns to step S204.
That is, as long as one firmware segment is not successfully received by all non-failed slave node devices, retransmission is performed until all firmware segments are successfully received by all non-failed slave node devices.
S209: and each slave node device obtains an upgrade firmware file according to each received firmware fragment and the serial number thereof, and verifies the obtained upgrade firmware file according to the firmware information.
Each slave node device is spliced to obtain an upgrade firmware file according to the received firmware fragments and the serial numbers thereof, and the obtained upgrade firmware file is checked according to the total length of the upgrade firmware file and the firmware check code, and if the check is successful, the slave node device enters a state waiting for updating.
And then enters the update flow.
As shown in fig. 5, the update flow includes the steps of:
s301: the master node device issues a synchronization update command.
Specifically, the master node device simultaneously controls the GPIO to send out synchronous update signals (such as outputting two continuous square wave signals), and then continuously broadcasts N synchronous update instructions to the bus, wherein N is more than or equal to 3 and less than the total number of slave node devices.
S302: and each slave node device simultaneously carries out firmware update after receiving the synchronous update command.
Specifically, after each slave node device receives the synchronization update signal or the synchronization update instruction, firmware update is performed simultaneously, that is, firmware update switching is started simultaneously.
According to the embodiment, by distributing independent GPIO for each node, different slave nodes share the same firmware version, calibration in advance is not needed, and a target object can be automatically determined among the master node and the slave nodes.
And the firmware versions of the slave node equipment are consistent, one-to-many broadcast transmission is adopted when the firmware is upgraded, and state inquiry is carried out once again after the broadcasting is finished, so that the transmission interaction time can be reduced, and the upgrading progress can be accelerated. For example, assuming that there are n slave nodes and M transmissions are performed in total, it takes time T to perform a status query every time, if a certain firmware segment is detected to be received and retransmitted immediately, the time spent for the query is nxmxt, but the method of this embodiment takes time to query only n×t, and if the manner of upgrading each slave node one to one is compared, this embodiment can save more time.
Meanwhile, the synchronization of the update and switching of the new firmware of each slave node device is further ensured by adopting a mode of combining a hard-wire GPIO signal and an instruction message.
Example two
The present embodiment is a computer-readable storage medium corresponding to the above embodiment, on which a computer program is stored, which when executed by a processor, implements the steps of the firmware upgrading method of the slave node device of the master-slave system as in the above embodiment, and can achieve the same technical effects, which will not be described here.
In summary, according to the firmware upgrading method and the storage medium for the slave node equipment of the master-slave system, by distributing independent GPIO for each node, different slave nodes share the same firmware version, and the target object can be automatically determined between the master node and the slave node without calibration in advance; by adopting one-to-many broadcast transmission when firmware is upgraded, and carrying out state inquiry again after broadcasting is finished, the transmission interaction time can be reduced, and the upgrading progress can be accelerated; the slave node equipment verifies the received firmware fragments to ensure the validity of the received firmware fragments; the master node equipment transmits the firmware information, so that each slave node equipment can check the stored upgrade firmware file again after receiving and storing the upgrade firmware file, and the validity of the received upgrade firmware file is confirmed; meanwhile, the synchronization of the update and switching of the new firmware of each slave node device is further ensured by adopting a mode of combining a hard-wire GPIO signal and an instruction message.
The invention continuously converges the bus data interaction times based on the communication mechanism of the master-slave system in a cluster concurrency mode, maximally reduces the total time of firmware updating of all slave node devices in the master-slave system, and simultaneously realizes synchronous updating and switching of the firmware of each node.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (14)

1. A method for upgrading firmware of a slave node device of a master-slave system, comprising:
the method comprises the steps that a master node device segments an upgrade firmware file of a slave node device according to a preset transmission segment length to obtain at least one firmware segment, numbers the firmware segments and calculates segment check codes of the firmware segments;
broadcasting each firmware segment and the firmware segment information thereof to each slave node device in turn, wherein the firmware segment information comprises the serial numbers of the firmware segments and segment check codes;
after broadcasting each firmware segment, sequentially sending a firmware segment receiving state query instruction corresponding to each slave node device;
if receiving the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, sequentially rebroadcasting the firmware fragments with receiving failure to the slave node equipment with the receiving failure information;
if the receiving failure information returned by the slave node equipment is not received, the master node equipment sends out a synchronous update command so that the slave node equipment can update the firmware simultaneously after receiving the synchronous update command.
2. The method for upgrading firmware of a slave node device of a master-slave system according to claim 1, wherein the master node device segments an upgrade firmware file of the slave node device according to a preset transmission segment length to obtain at least one firmware segment, numbers each firmware segment, and calculates a segment check code of each firmware segment, and further comprises:
the master node device broadcasts the firmware information of the upgrade firmware file to each slave node device, wherein the firmware information comprises the total length of the upgrade firmware file, the transmission fragment length, the total number of the firmware fragments and the firmware check code of the upgrade firmware file.
3. The method for upgrading firmware of slave node devices of a master-slave system according to claim 2, wherein after the master node device broadcasts the firmware information of the upgraded firmware file to each slave node device, further comprising:
the master node equipment sequentially sends a firmware information receiving state query instruction corresponding to each slave node equipment;
if a firmware information receiving failure message returned from the node equipment is received, judging whether the retransmission times reach the preset retransmission times or not;
if not, re-broadcasting the firmware information of the updated firmware file, adding one to the retransmission times, wherein the initial value of the retransmission times is zero, and continuously executing the step of sequentially sending the firmware information receiving state query instructions corresponding to the slave node devices;
if yes, recording the unique identification of the slave node equipment with the failed firmware information reception.
4. The firmware upgrade method of a slave node device of a master-slave system according to claim 2, further comprising, before the master node device issues a synchronization update command:
each slave node device obtains an upgrade firmware file according to each received firmware fragment and the serial number thereof, and verifies the obtained upgrade firmware file according to the firmware information;
if the verification is successful, the method enters a state of waiting to be updated.
5. The method for upgrading firmware of slave node devices of a master-slave system according to claim 1, wherein broadcasting each firmware segment and firmware segment information thereof to each slave node device in turn, the firmware segment information including a number of the firmware segment and a segment check code, further comprises:
after receiving a firmware fragment and firmware fragment information thereof from node equipment, verifying the firmware fragment according to a fragment verification code of the firmware fragment;
if the verification is successful, determining an offset position of the firmware fragment in the updated firmware file according to the serial number of the firmware fragment, the total length of the updated firmware file, the transmission fragment length and the total number of the firmware fragments, storing the firmware fragment in the corresponding firmware file offset position, and recording the serial number of the firmware fragment in a successful receiving fragment table.
6. The method for upgrading firmware of slave node devices of a master-slave system according to claim 5, wherein after broadcasting each firmware segment, sending a status query command to each firmware segment of the slave node device in turn, further comprises:
when receiving a firmware fragment receiving state inquiry instruction corresponding to the slave node equipment, determining the number of the firmware fragment with failed receiving according to a successful receiving fragment table recorded by the slave node equipment, generating receiving failure information, and returning the receiving failure information to the master node equipment.
7. The method for upgrading firmware of a slave node device of a master-slave system according to claim 5, wherein if receiving the reception failure information returned from the slave node device, the reception failure information includes the number of the firmware fragments that failed in reception, rebroadcast each firmware fragment that failed in reception to each slave node device that has the reception failure information returned in turn, specifically:
if the master node equipment receives the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, updating a receiving failure node table according to the unique identification of the slave node equipment with the receiving failure information, and updating the receiving failure fragment table according to the receiving failure information returned by the slave node equipment;
determining a firmware fragment to be retransmitted as a retransmission firmware fragment according to the latest receiving failure fragment table, and rebroadcasting each retransmission firmware fragment and firmware fragment information thereof to each slave node device in sequence;
after re-broadcasting each retransmission firmware segment, sequentially sending a firmware segment receiving state query instruction corresponding to each slave node device in the latest receiving failure node table;
and if receiving the receiving failure information returned by the slave node equipment, wherein the receiving failure information comprises the serial numbers of the firmware fragments with receiving failure, continuously executing the steps of updating the receiving failure node table according to the unique identification of the slave node equipment with the receiving failure information, and updating the receiving failure fragment table according to the receiving failure information returned by the slave node equipment.
8. The method for upgrading firmware of slave node devices of a master-slave system according to claim 7, wherein after sequentially rebroadcasting each retransmission firmware segment and its firmware segment information to each slave node device, further comprising:
the slave node equipment determines retransmission firmware fragments required by the slave node equipment according to the self-recorded successful fragment table;
after receiving a retransmission firmware fragment and firmware fragment information thereof required by the slave node equipment, verifying the retransmission firmware fragment according to a fragment verification code of the retransmission firmware fragment;
if the verification is successful, determining the offset position of the retransmission firmware fragment in the upgrading firmware file according to the serial number of the retransmission firmware fragment, the total length of the upgrading firmware file, the transmission fragment length and the total number of the firmware fragments, storing the retransmission firmware fragment in the corresponding firmware file offset position, and recording the serial number of the retransmission firmware fragment in a receiving success fragment table.
9. The firmware upgrading method of slave node devices of the master-slave system according to claim 1, wherein the master node device is connected with each slave node device respectively through a bus; the master node device broadcasts to each slave node device through the bus, and the slave node device returns the receiving failure information to the master node device through the bus.
10. The firmware upgrading method for slave node devices of the master-slave system according to claim 9, wherein the master node device is communicatively connected to each slave node device through a corresponding universal input/output port of each slave node device.
11. The method for upgrading firmware of slave node devices of a master-slave system according to claim 10, wherein the master node device issues a synchronization update command to enable each slave node device to simultaneously perform firmware update after receiving the synchronization update command, specifically:
the master node equipment simultaneously controls all the general input and output ports to send out synchronous update signals and continuously broadcasts a preset number of synchronous update instructions to the bus, so that all the slave node equipment simultaneously carries out firmware update after receiving the synchronous update signals or the synchronous update instructions.
12. The method for upgrading firmware of slave node devices of the master-slave system according to claim 10, wherein the sequentially issuing the firmware segment reception status query command corresponding to each slave node device specifically comprises:
the master node equipment sends a firmware fragment receiving state query instruction to each slave node equipment through a general input/output port corresponding to each slave node equipment.
13. The firmware upgrading method of slave node devices of the master-slave system according to claim 1, wherein the firmware segment reception status query instruction corresponding to each slave node device contains a unique identifier of each slave node device, respectively.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1-13.
CN202211033296.8A 2022-08-26 2022-08-26 Firmware upgrading method of slave node equipment of master-slave system and storage medium Pending CN117675572A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211033296.8A CN117675572A (en) 2022-08-26 2022-08-26 Firmware upgrading method of slave node equipment of master-slave system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211033296.8A CN117675572A (en) 2022-08-26 2022-08-26 Firmware upgrading method of slave node equipment of master-slave system and storage medium

Publications (1)

Publication Number Publication Date
CN117675572A true CN117675572A (en) 2024-03-08

Family

ID=90079408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211033296.8A Pending CN117675572A (en) 2022-08-26 2022-08-26 Firmware upgrading method of slave node equipment of master-slave system and storage medium

Country Status (1)

Country Link
CN (1) CN117675572A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873536A (en) * 2024-03-11 2024-04-12 深圳优能新能源科技有限公司 Program synchronous updating method and system for energy storage power supply multistage network environment equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873536A (en) * 2024-03-11 2024-04-12 深圳优能新能源科技有限公司 Program synchronous updating method and system for energy storage power supply multistage network environment equipment

Similar Documents

Publication Publication Date Title
CN103095745B (en) Car-mounted terminal, electronic module, electronic module update device, system and method
CN103677946A (en) Method and system for updating elevator device control programs
US11722976B2 (en) Time code synchronization method
CN117675572A (en) Firmware upgrading method of slave node equipment of master-slave system and storage medium
CN105180378A (en) Air conditioner and upgrading control method and device thereof
CN111930020A (en) Equipment control system, method, device, terminal and readable storage medium
CN112114524A (en) Equipment control and access method based on centralized control network and equipment thereof
CN107015829B (en) Audio system upgrading method and device
CN110535733B (en) Control method and device of household appliance, computer equipment and storage medium
CN111399878A (en) Data transmission method and device and method and device for upgrading multi-connected cluster system unit
CN114979297A (en) Vehicle software version large-span OTA (over the air) upgrading method
CN111478816B (en) Method, system, device and medium for configuring Zigbee and ZigBee sub-equipment
CN113138788A (en) Air conditioner program upgrading method and air conditioner system
CN111722856B (en) Method and device for upgrading firmware in vehicle-mounted microcontroller
CN116679951A (en) Unreliable channel multi-device data synchronous upgrading method, device, equipment and medium
CN113949733B (en) Firmware upgrading method of electric energy meter
CN112767722B (en) Control method and device of traffic signal machine, computer equipment and storage medium
CN115622834A (en) Bus communication control method, device, equipment and storage medium
CN111787378B (en) Software upgrading method applied to remote control device and remote control device
CN113885923A (en) Vehicle ECU upgrading system and method
CN114679439A (en) Bluetooth BLE-based auxiliary upgrade package downloading method for Internet of things
CN113808304A (en) Asynchronous end-to-end digital key recovery method and system
US20070268057A1 (en) Methods and apparatus for applying changes to a group of objects
CN110737456B (en) Online upgrading method of wireless earphone and earphone equipment
CN117908923A (en) Bluetooth equipment upgrading method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 303-e, Zone C, innovation building, software park, torch hi tech Zone, Xiamen City, Fujian Province

Applicant after: Xiamen Yaxun Zhilian Technology Co.,Ltd.

Address before: 303-e, Zone C, innovation building, software park, torch hi tech Zone, Xiamen City, Fujian Province

Applicant before: XIAMEN YAXON NETWORK Co.,Ltd.

Country or region before: China