Slave upgrading method and system based on host multi-union communication
Through the slave upgrade method of host multi-connection communication, broadcast distribution and on-demand distribution strategies are adopted to solve the problem of cumbersome and time-consuming upgrade process of multi-device, and efficient and reliable slave software upgrades are achieved, and the stability and maintenance efficiency of the system are improved.
Patent Information
- Application Number
- CN202510403250.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-18
AI Technical Summary
The multi-equipment upgrade process is cumbersome and time-consuming, especially when the equipment installation location is not easy to access, resulting in a large maintenance work burden and affecting the normal operation of the system.
The slave upgrade method based on host multi-connection communication is adopted, the first upgrade file is distributed through broadcast, feedback information is received to determine the size of the second upgrade file, and distributed as needed, and sent to the slave one by one for upgrading.
It realizes an efficient, reliable and flexible slave software upgrade process, improves the upgrade operation efficiency and success rate, reduces operation complexity and resource consumption, and ensures the long-term and stable operation of the system.
Smart Images

Figure CN120335834A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-connected unit system upgrades, and particularly to a slave unit upgrade method and system based on host multi-connected communication. Background Art
[0002] A multi-connected unit system is often composed of numerous devices, which are closely connected through an efficient bus communication method to form a huge network system. The number of devices can reach dozens or even hundreds, covering a wide area. At the same time, these devices vary in capacity, model, and function, and this diversity results in different programs for each controller in the system, posing quite a challenge to the management and maintenance of the system.
[0003] In the product design and development stage, although the team invests a lot of effort in testing and optimization, there are inevitably some design flaws that are difficult to detect initially or new functions that need to be added later. With the continuous progress of technology and the continuous change of user needs, the repair of product problems and the implementation of new requirements become increasingly frequent, which puts forward higher requirements for product upgrades and maintenance.
[0004] However, despite the many advantages of remote update technology, when using the single-machine method for program updates, it is still necessary to use a specific burner to connect to the devices to be upgraded one by one. Although this one-by-one upgrade method is stable and reliable in operation, due to the large number of devices and the fact that some device installation locations are not easily accessible, such as high altitudes, narrow spaces, or hidden corners, the entire update process is both cumbersome and inefficient. This not only increases the workload of maintenance personnel but also may lead to an extended update cycle, affecting the normal operation of the system and user satisfaction. Summary of the Invention
[0005] Aiming at the above defects, the purpose of the present invention is to propose a slave unit upgrade method and system based on host multi-connected communication to solve the problems of long upgrade cycles and heavy workloads for multiple devices.
[0006] To achieve this purpose, the present invention adopts the following technical solutions: A slave unit upgrade method based on host multi-connected communication includes the following steps:
[0007] Step S1: Generate a corresponding unique first upgrade file and at least one second upgrade file based on the upgrade information;
[0008] Step S2: The host sends the first upgrade file to the slave units in a broadcast form;
[0009] Step S3: After waiting for the threshold time, receive the feedback information from the slave units, and determine the size of the second upgrade file based on the average duration of the feedback information;
[0010] Step S4: Send the second upgrade file to the slave based on the feedback information;
[0011] Step S5: The slave that has obtained the second upgrade file performs the upgrade.
[0012] Preferably, the first upgrade file includes the host address, the upgrade identifier, and the total number of blocks;
[0013] The second upgrade file includes the slave address, the upgrade identifier, the current upgrade block number, the current upgrade block size, and the upgrade block content.
[0014] Preferably, the feedback information of the receiving slave is generated as follows:
[0015] Parse the first upgrade file or the second upgrade file to obtain the upgrade identifier;
[0016] Judge whether the upgrade identifier is consistent with the current version of the slave. If it is consistent, no feedback information is generated;
[0017] If it is inconsistent, calculate the remaining block numbers based on the current block number and the total number of blocks, and generate the feedback information based on the remaining block numbers and the slave address.
[0018] Preferably, the step of sending the second upgrade file to the slave based on the feedback information is as follows:
[0019] Parse the feedback information, and use the slave address in the feedback information as the sending destination;
[0020] Judge whether the number of remaining block numbers is 1. If the number is 1, use the remaining block number as the current block number, generate the second upgrade file, and send the second upgrade file to the destination;
[0021] If the number is not unique, use any remaining block number as the current upgrade block number, generate the second upgrade file based on the upgrade block content of the current upgrade block number, send the second upgrade file to the destination, and re-execute step S3.
[0022] Preferably, when multiple slaves need to be upgraded, the following steps are performed:
[0023] Step A: Obtain the receiving order of the feedback information, and use the first slave as the first slave based on the receiving order;
[0024] Step B: Send the second upgrade file to the first slave;
[0025] Step C: When the first slave has received the second upgrade file, delete the first slave from the receiving order, and update the next slave in the receiving order as the first slave;
[0026] Repeat steps B to C until all the second upgrade files are sent to each slave in the receiving order.
[0027] A slave upgrade system based on host multi-link communication, using the above-mentioned slave upgrade method based on host multi-link communication, includes: a generation module, a broadcast module, a receiving module, a sending module, and an upgrade module;
[0028] The generation module generates a corresponding unique first upgrade file and at least one second upgrade file based on the upgrade information;
[0029] The broadcast module is used for the host to send the first upgrade file to the slaves in a broadcast form;
[0030] The receiving module is used to wait for a threshold time and then receive the feedback information from the slaves, and determine the size of the second upgrade file based on the average duration of the feedback information;
[0031] The sending module sends the second upgrade file to the slaves based on the feedback information;
[0032] The upgrade module is used to upgrade the slaves that have obtained the second upgrade file.
[0033] Preferably, it further includes a feedback information generation module;
[0034] The feedback information generation module is used to parse the first upgrade file or the second upgrade file to obtain an upgrade identifier;
[0035] Judge whether the upgrade identifier is consistent with the current version of the slave. If it is consistent, no feedback information is generated;
[0036] If it is inconsistent, calculate the remaining block numbers based on the current block number and the total number of blocks, and generate the feedback information based on the remaining block numbers and the slave address.
[0037] Preferably, the sending module includes a first sub-module and a judgment and processing sub-module;
[0038] The first sub-module is used to parse the feedback information, and use the slave address in the feedback information as the sending destination;
[0039] The judgment and processing sub-module is used to judge whether the number of remaining block numbers is 1. If the number is 1, use the remaining block number as the current block number, generate a second upgrade file, and send the second upgrade file to the destination;
[0040] If the number is not unique, use any remaining block number as the current block number, generate a second upgrade file, send the second upgrade file to the destination, and re-invoke the receiving module.
[0041] Preferably, it further includes a sequence module;
[0042] The sequential module is used to perform the following steps when multiple slave devices need to be upgraded:
[0043] Step A: Obtain the receiving order of the feedback information, and based on the receiving order, take the first slave device as the first slave device;
[0044] Step B: Send the second upgrade file to the first slave device;
[0045] Step C: After the first slave device finishes receiving the second upgrade file, delete the first slave device from the receiving order, and update the next slave device in the receiving order to the first slave device;
[0046] Repeat steps B to C until all the second upgrade files are sent to each slave device in the receiving order.
[0047] One of the above technical solutions has the following advantages or beneficial effects: Through strategies such as broadcast distribution, feedback monitoring, and on-demand distribution, the present invention realizes an efficient, reliable, and flexible software upgrade process for slave devices. It not only improves the efficiency and success rate of the upgrade operation, but also reduces the operation complexity and resource consumption, providing a strong guarantee for the long-term stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flowchart of a method according to an embodiment of the present invention.
[0049] Figure 2 is a schematic structural diagram of a system according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] The following details the embodiments of the present invention. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals indicate the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for explaining the present invention and should not be construed as limiting the present invention.
[0051] In the description of the embodiments of the present invention, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of the present invention, "a plurality" means two or more unless otherwise specifically defined.
[0052] In addition, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0053] As Figures 1 to 2 shown, a slave upgrade method based on host multi-link communication includes the following steps:
[0054] Step S1: Generate a corresponding unique first upgrade file and at least one second upgrade file based on the upgrade information;
[0055] Step S2: The host sends the first upgrade file to the slaves in a broadcast form;
[0056] Step S3: After waiting for the threshold time, receive the feedback information from the slaves, and determine the size of the second upgrade file based on the average duration of the feedback information;
[0057] Step S4: Send the second upgrade file to the slaves based on the feedback information;
[0058] Step S5: The slaves that obtain the second upgrade file perform the upgrade.
[0059] In the present invention, a host is electrically connected to multiple slaves through a half-duplex RS485 link communication. When an upgrade is required, the upgrade information is generated into a corresponding first upgrade file. The first upgrade file is transmitted to each slave in a broadcast manner. At this time, the host does not need to confirm the status information of each slave and does not need to establish a connection with each slave one by one, so as to quickly distribute the first upgrade file, greatly improving the efficiency of the upgrade operation. After receiving the first upgrade file, the slave will determine whether an upgrade is required according to its own version requirements. If an upgrade is required, it will return feedback information to the host. Due to the influence of different configurations of each slave and different network communication qualities, etc., the time to receive the first upgrade file and the time to return the feedback information are different. Therefore, a threshold time needs to be set. After waiting for the threshold time to end, the number of feedback information received is the number of slaves that need to be upgraded, and the number of slaves to be upgraded is determined. At this time, the size of the second upgrade file can be determined based on the average duration of the feedback information. The specific method for calculating the size of the second upgrade file is as follows:
[0060] Obtain the theoretical optimal transmission time through the size of the first upgrade file and the minimum transmission time;
[0061] T b is the optimal transmission time, where F is the size of the first upgrade file, and B t is the baud rate, and T S is the minimum transmission time;
[0062] Then use T b as the optimal transmission time to compare with the average duration of the feedback information, select the time with the larger time value as the first time, and then divide the total size of the program in the upgrade information by the first time to obtain the size of the second upgrade file. The present invention ensures the maximization of transmission efficiency by calculating the theoretical optimal transmission time, because the theoretical optimal transmission time usually reflects the fastest transmission speed that can be achieved under given conditions (such as network bandwidth, server load, etc.). Finally, by comparing the calculated theoretical optimal transmission time with the average transmission duration of the feedback information and selecting the larger time value as the first time, this solution takes into account the possible delays or uncertainties in actual transmission. This adaptability makes the solution more robust and able to cope with changing network environments.
[0063] After confirming the size of the second upgrade file, send the second upgrade file to the slave according to the slave address in the feedback information. After the slave receives all the second upgrade files, it can perform remote upgrade.
[0064] The present invention realizes an efficient, reliable and flexible software upgrade process for slaves through strategies such as broadcast distribution, feedback monitoring and on-demand distribution. It not only improves the efficiency and success rate of upgrade operations, but also reduces the operation complexity and resource consumption, providing a strong guarantee for the long-term stable operation of the system.
[0065] Preferably, the first upgrade file includes a host address, an upgrade identifier and the total number of blocks;
[0066] The second upgrade file includes a slave address, an upgrade identifier, the current upgrade block number, the current upgrade block size and the upgrade block content.
[0067] Among them, the content of the first upgrade file is relatively simple, including a host address, an upgrade identifier and the total number of blocks. After broadcast transmission, the slave can judge whether it needs to be upgraded according to the upgrade identifier, and the total number of blocks can clearly know how many second upgrade files (each second upgrade file) need to be received during the upgrade. After the need for upgrade, feedback information can be returned to the host according to the host address.
[0068] The transmission of the second upgrade file is not in a broadcast manner. Therefore, the slave address needs to be added to the second upgrade file to accurately send the upgrade block content of the second upgrade file to the corresponding slave. The current upgrade block number is added to the second upgrade file to ensure that the slave does not receive duplicate second upgrade files.
[0069] Preferably, the feedback information generation method of the receiving slave is as follows:
[0070] Parse the first upgrade file or the second upgrade file to obtain the upgrade identifier;
[0071] Judge whether the upgrade identifier is consistent with the current version of the slave. If it is consistent, no feedback information is generated;
[0072] If it is inconsistent, calculate the remaining block numbers based on the current block number and the total number of blocks, and generate the feedback information based on the remaining block numbers and the slave address.
[0073] By parsing the first upgrade file or the second upgrade file, the upgrade identifier is accurately obtained. This step ensures that the slave can quickly identify the current upgrade package being processed, laying a solid foundation for subsequent judgments and processing. By precisely matching the upgrade identifier with the current version of the slave, the scheme can quickly judge whether feedback information needs to be generated, avoiding unnecessary resource waste and improving the overall processing efficiency. In addition, the feedback information generated based on the remaining block numbers and the slave address provides detailed upgrade progress and status information for the system. This enables the host to monitor the upgrade process of the slave in real time, promptly discover and solve potential problems. At the same time, the feedback information also provides strong support for the abnormal handling during the upgrade process of the slave, enhancing the reliability and stability of the system.
[0074] Preferably, the step of sending the second upgrade file to the slave based on the feedback information is as follows:
[0075] Parse the feedback information, and use the slave address in the feedback information as the sending destination;
[0076] Judge whether the number of remaining block numbers is 1. If the number is 1, use the remaining block number as the current block number, generate the second upgrade file, and send the second upgrade file to the destination;
[0077] If the number is not unique, use any remaining block number as the current upgrade block number, generate the second upgrade file based on the upgrade block content of the current upgrade block number, send the second upgrade file to the destination, and re-execute step S3.
[0078] Based on the remaining block numbers, it is possible to determine the remaining quantity of the second upgrade file received by the slave device. When the number of remaining block numbers is 1, it indicates that the current second upgrade file is the last second upgrade file. At this time, it only needs to be sent to the slave device. When the number of remaining block numbers is not 1, it means that the slave device still needs to receive at least two or more second upgrade files to meet the upgrade requirements. At this time, any remaining block number is used as the current upgrade block number, and a second upgrade file is generated based on the upgrade block content corresponding to the current upgrade block number. After the slave device receives the second upgrade file, the generated feedback information will update the remaining block numbers. Therefore, by re-executing step S3, the newly generated feedback information of the slave device can be obtained, so as to send non-repetitive second upgrade files to the slave device.
[0079] Preferably, when multiple slave devices need to be upgraded, the following steps are executed:
[0080] Step A: Obtain the receiving order of the feedback information, and based on the receiving order, take the first slave device as the first slave device;
[0081] Step B: Send the second upgrade file to the first slave device;
[0082] Step C: After the first slave device receives the second upgrade file, delete the first slave device from the receiving order, and update the next slave device in the receiving order as the first slave device;
[0083] Repeat steps B to C until all second upgrade files are sent to each slave device in the receiving order.
[0084] By obtaining the receiving order of the feedback information, the priority of each slave device in the upgrade process is clarified. This orderly arrangement ensures that the upgrade process can proceed in a predetermined order, avoiding chaos and conflicts. Each slave device will have a clear waiting queue before receiving the upgrade file, thus ensuring the orderliness and predictability of the upgrade process. In addition, the method of sending the second upgrade file one by one is adopted, and the file is sent to only one slave device each time. This strategy avoids problems such as network congestion and excessive server load that may be caused by multiple slave devices requesting upgrade files simultaneously. At the same time, since only one slave device's upgrade request is processed each time, the system can more efficiently utilize limited resources such as network bandwidth and server processing capabilities, thereby improving the upgrade efficiency.
[0085] A slave device upgrade system based on host multi-link communication, using the above-mentioned slave device upgrade method based on host multi-link communication, includes: a generation module, a broadcast module, a receiving module, a sending module, and an upgrade module;
[0086] The generation module generates a corresponding unique first upgrade file and at least one second upgrade file based on the upgrade information;
[0087] The broadcast module is used for the host to send the first upgrade file to the slave in a broadcast manner;
[0088] The receiving module is used to wait for the threshold time and then receive the feedback information from the slave, and determine the size of the second upgrade file based on the average duration of the feedback information;
[0089] The sending module sends the second upgrade file to the slave based on the feedback information;
[0090] The upgrade module is used to upgrade the slave that has obtained the second upgrade file.
[0091] Preferably, it further includes a feedback information generation module;
[0092] The feedback information generation module is used to parse the first upgrade file or the second upgrade file to obtain an upgrade identifier;
[0093] Judge whether the upgrade identifier is consistent with the current version of the slave. If it is consistent, no feedback information is generated;
[0094] If it is inconsistent, calculate the remaining block numbers based on the current block number and the total number of blocks, and generate the feedback information based on the remaining block numbers and the slave address.
[0095] Preferably, the sending module includes a first sub-module and a judgment and processing sub-module;
[0096] The first sub-module is used to parse the feedback information, and use the slave address in the feedback information as the sending destination;
[0097] The judgment and processing sub-module is used to judge whether the number of remaining block numbers is 1. If the number is 1, use the remaining block number as the current block number, generate the second upgrade file, and send the second upgrade file to the destination;
[0098] If the number is not unique, use any remaining block number as the current block number, generate the second upgrade file, send the second upgrade file to the destination, and re-invoke the receiving module.
[0099] Preferably, it further includes a sequence module;
[0100] The sequence module is used to perform the following steps when multiple slaves need to be upgraded:
[0101] Step A: Obtain the receiving order of the feedback information, and use the first slave as the first slave based on the receiving order;
[0102] Step B: Send the second upgrade file to the first slave;
[0103] Step C: After the first slave device finishes receiving the second upgrade file, delete the first slave device from the receiving sequence, and update the next slave device in the receiving sequence as the first slave device;
[0104] Repeat steps B to C until all the second upgrade files are sent to each slave device in the receiving sequence.
[0105] In the description of this specification, the descriptions referring to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0106] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the claims and their equivalents.
Claims
1. A slave upgrade method based on host multi-link communication, characterized in that, It includes the following steps: Step S1: Generate a corresponding unique first upgrade file and at least one second upgrade file based on the upgrade information; Step S2: The host sends the first upgrade file to the slave in a broadcast form; Step S3: After waiting for the threshold time, receive the feedback information from the slave, and determine the size of the second upgrade file based on the average duration of the feedback information; Step S4: Send the second upgrade file to the slave based on the feedback information; Step S5: The slave that obtains the second upgrade file performs the upgrade.
2. The slave upgrade method based on host multi-link communication according to claim 1, characterized in that The first upgrade file includes the host address, upgrade identifier, and total number of blocks; The second upgrade file includes the slave address, upgrade identifier, current upgrade block number, current upgrade block size, and upgrade block content.
3. The slave device upgrade method based on host multi-link communication according to claim 2, wherein The generation method of the feedback information received from the slave is as follows: Parse the first upgrade file or the second upgrade file to obtain the upgrade identifier; Judge whether the upgrade identifier is consistent with the current version of the slave. If it is consistent, no feedback information is generated; If it is inconsistent, calculate the remaining block numbers based on the current block number and the total number of blocks, and generate the feedback information based on the remaining block numbers and the slave address.
4. The slave upgrade method based on host multi-link communication according to claim 3, characterized in that, The steps of sending the second upgrade file to the slave based on the feedback information are as follows: Parse the feedback information, and use the slave address in the feedback information as the sending destination; Judge whether the number of remaining block numbers is 1. If the number is 1, use the remaining block number as the current block number, generate the second upgrade file, and send the second upgrade file to the destination; If the number is not unique, use any remaining block number as the current upgrade block number, generate the second upgrade file based on the upgrade block content of the current upgrade block number, send the second upgrade file to the destination, and re-execute step S3.
5. A slave upgrade method based on host multi-link communication according to claim 1, characterized in that, When multiple slaves need to be upgraded, the following steps are executed: Step A: Obtain the receiving order of the feedback information, and use the first slave in the receiving order as the first slave; Step B: Send the second upgrade file to the first slave; Step C: After the first slave receives the second upgrade file, delete the first slave from the receiving order, and update the next slave in the receiving order as the first slave; Repeat steps B to C until all the second upgrade files are sent to each slave in the receiving order.
6. A slave device upgrade system based on host multi-link communication, using the method for upgrading a slave device based on host multi-link communication according to any one of claims 1 to 5, characterized in that, It includes: A generation module, a broadcast module, a receiving module, a sending module, and an upgrade module; The generation module generates a corresponding unique first upgrade file and at least one second upgrade file based on the upgrade information; The broadcast module is used for the host to send the first upgrade file to the slave in a broadcast form; The receiving module is used for receiving the feedback information from the slave after waiting for the threshold time, and determining the size of the second upgrade file based on the average duration of the feedback information; The sending module sends the second upgrade file to the slave based on the feedback information; The upgrade module is used for the slave that obtains the second upgrade file to perform the upgrade.
7. The slave upgrade system based on host multi-link communication according to claim 6, wherein It also includes a feedback information generation module; The feedback information generation module is used for parsing the first upgrade file or the second upgrade file to obtain the upgrade identifier; Judge whether the upgrade identifier is consistent with the current version of the slave. If it is consistent, no feedback information is generated; If they are inconsistent, calculate the remaining block numbers based on the current block number and the total number of blocks, and generate the feedback information based on the remaining block numbers and the slave address.
8. The slave upgrade system based on host multi-link communication according to claim 6, wherein The sending module includes a first sub-module and a judgment and processing sub-module; The first sub-module is used to parse the feedback information, and use the slave address in the feedback information as the sending destination; The judgment and processing sub-module is used to judge whether the number of remaining block numbers is 1. If the number is 1, use the remaining block number as the current block number, generate a second upgrade file, and send the second upgrade file to the destination; If the number is not unique, use any remaining block number as the current block number, generate a second upgrade file, send the second upgrade file to the destination, and re-invoke the receiving module.
9. The slave upgrade system based on host multi-link communication according to claim 6, characterized in that, It further includes a sequencing module; The sequencing module is used to perform the following steps when multiple slaves need to be upgraded: Step A: Obtain the receiving order of the feedback information, and use the first slave as the first slave based on the receiving order; Step B: Send the second upgrade file to the first slave; Step C: When the first slave finishes receiving the second upgrade file, delete the first slave from the receiving order, and update the next slave in the receiving order to the first slave; Repeat steps B to C until all the second upgrade files are sent to each slave in the receiving order.