A device remote batch upgrade method, system and distributed task scheduling method
By obtaining the upgrade file size and network conditions in the industrial Internet of Things, calculating the frequency of batch command issuance, and using the distributed task scheduling architecture to split and schedule the commands in tasks and batches, the problem of concurrent peak effect during batch upgrade of equipment is solved. , improving the efficiency and success rate of equipment upgrades.
Patent Information
- Application Number
- CN202211563426.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-12-07
AI Technical Summary
In the Industrial Internet of Things, when equipment is upgraded in batches, other services on the platform run abnormally due to the concurrent peak effect. How to implement batch upgrades and improve the efficiency and success rate of batch tasks in a limited resource environment is an urgent problem that needs to be solved.
By obtaining the size of the upgrade file installation package and network conditions, we can calculate the frequency of batch command issuance, use the distributed task scheduling architecture to split the commands into tasks and batches, control the issuance rate of each batch, and optimize platform resources and Utilize network resources to improve the efficiency and success rate of massive device upgrades.
The distributed task scheduling architecture based on microservices uses the distributed task scheduler to split and schedule installation commands into tasks and batches, control the issuance rate of each task and batch, and fit out the batch tasks under limited resources. Optimal parameter configuration improves the efficiency and success rate of massive equipment upgrades.
Smart Images

Figure CN117675574B
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for remote batch upgrading of equipment and a distributed task scheduling method, and belongs to the technical field of industrial Internet of Things. Background Art
[0002] Smart terminal devices in the industrial Internet of Things are an important part of the entire system and have the functions of data collection and processing. Various functional modules will be installed on them to enrich the functions of the equipment and enhance its data processing capabilities. With the update of business, the modules on the equipment need to be upgraded in time to adapt to the new needs in actual production.
[0003] However, in a limited resource environment, the concurrent capacity of the industrial Internet of Things platform at the upper layer of smart terminal devices is limited. When all (millions of) devices are upgraded at one time, the concurrent peak effect generated by the operation of pulling the upgrade file will cause abnormal operation of other business on the platform. Therefore, with the expansion of the scale of the industrial Internet of Things and the sharp increase in the number of device accesses, the device upgrade process has become more complicated, and it is necessary to disassemble and schedule the commands issued in batches. In the scenario of batch upgrade of devices, various influencing factors need to be comprehensively considered to determine the specific number of objects (devices) operated in each batch. If the number of devices operated in each batch is too large, it may still affect other functions of the platform and cause the success rate of this task to be too low; otherwise, it will greatly reduce the efficiency of the batch upgrade task and extend the overall upgrade cycle of the equipment.
[0004] In summary, in the production environment of the industrial Internet of Things, how to upgrade a large number of devices in batches and improve the efficiency and success rate of batch tasks by configuring command parameters is an urgent problem to be solved. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a method and system for remote batch upgrading of equipment and a distributed task scheduling method.
[0006] In order to solve the above technical problems, the present invention provides a method for remote batch upgrading of devices, comprising:
[0007] Obtain the size of the upgrade file installation package based on the industrial IoT device upgrade task;
[0008] Determine whether network conditions are limited based on the platform server;
[0009] If not, obtain the predetermined peak QPS of requests that a single file service node can handle per second. single The number of file service nodes in the file service cluster, n, and the frequency of batch command delivery, Freq command =QPSsystem , QPS system Indicates the maximum value of file downloads that the property management platform can handle, QPS system =n*QPS single ;
[0010] If yes, get the limited network card resources NET provided by the platform server output and the upgrade file installation package size Filesize, based on the limited network card resources NET output The maximum file download rate QPS that the network card can carry is calculated by using the upgrade file installation package size Filesize net ;
[0011] If r*QPS net ≥QPS system , then the batch command sending frequency Freq command =QPS system , r is the network card utilization rate;
[0012] If r*QPS net <QPS system , then the batch command sending frequency Freq command =r*QPS net .
[0013] Furthermore, the peak QPS of requests that a single file service node can process per second single The calculation formula is:
[0014]
[0015] Among them, λ1, λ2 and k1, k2 are all constants.
[0016] Furthermore, the limited network card resource NET output The calculation formula is:
[0017] NET output =F(Freq download ,Filesize)
[0018] Among them, the function F is an expansion of a two-variable quadratic polynomial, expressed as:
[0019] F(Freq download ,Filesize)=a*Freq download 2 +b*Filesize 2 +c*Freq download *Filesize+d*Freq download +e*Filesize+f
[0020] Where, Freq download It represents the actual download frequency of the file. a, b, c, d, e, and f are the coefficients of the expansion of a quadratic polynomial.
[0021] A remote batch upgrade system for equipment, comprising:
[0022] An acquisition module is used to obtain the size of the upgrade file installation package according to the industrial Internet of Things device upgrade task;
[0023] A judgment processing module, used to determine whether the network condition is limited according to the platform server;
[0024] If not, obtain the predetermined peak QPS of requests that a single file service node can handle per second. single The number of file service nodes in the file service cluster, n, and the frequency of batch command delivery, Freq command =QPS system , QPS system Indicates the maximum value of file downloads that the property management platform can handle, QPS system =n*QPS single ;
[0025] If yes, get the limited network card resources NET provided by the platform server output and the upgrade file installation package size Filesize, based on the limited network card resources NET output The maximum file download rate QPS that the network card can carry is calculated by using the upgrade file installation package size Filesize net ;
[0026] If r*QPS net ≥QPS system , then the batch command sending frequency Freq command =QPS system , r is the network card utilization rate;
[0027] If r*QPS net <QPS system , then the batch command sending frequency Freq command =r*QPS net
[0028] A distributed task scheduling method, comprising:
[0029] Get a pre-built microservices-based distributed task scheduling architecture;
[0030] All tasks are sent to the distributed task scheduling architecture based on microservices. The batch command sending frequency Freq is calculated by using the device remote batch upgrade method in the distributed task scheduling architecture based on microservices.command , according to the batch command to send the frequency Freq command The distributed task scheduler of each microservice node in the distributed task scheduling architecture based on microservices is used for unified scheduling, and then sent to the device through the executor; wherein each of the tasks is split and scheduled by task and batch through the distributed task scheduler, and then the sending rate of each task and each batch is controlled by the executor.
[0031] Furthermore, the microservice-based distributed task scheduling architecture includes:
[0032] Platform gateway, file service cluster and distributed task management service cluster;
[0033] The platform gateway is used to obtain the HTTPS file download data of the device and transmit it to the file service cluster for storage. The distributed task management service cluster obtains all tasks through the file service cluster and puts all tasks into the task cache queue;
[0034] The distributed task scheduler of the microservice node in the distributed task management service cluster uniformly schedules tasks from the task cache queue and then sends them to the device through the executor.
[0035] A computer-readable storage medium storing one or more programs, characterized in that the one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform any of the methods described.
[0036] A computing device comprising:
[0037] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods described.
[0038] The beneficial effects achieved by the present invention are:
[0039] Based on the distributed task scheduling architecture of microservices, the installation commands to be upgraded in batches are split and scheduled by tasks and batches through the distributed task scheduler, and then the delivery rate of each task and each batch is controlled by the executor; then, based on the QPS of platform resources, network resources and file downloads, the optimal values of configuration parameters in batch tasks under limited resources are fitted, thereby improving the efficiency and success rate of massive equipment upgrade operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a distributed task scheduling diagram for batch upgrade of equipment;
[0041] Figure 2It is a flow chart for quantitatively analyzing the factors affecting the command delivery rate. DETAILED DESCRIPTION
[0042] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0043] The present invention provides a remote batch upgrade method for industrial Internet of Things devices, designs a distributed task scheduling architecture based on microservices, splits and schedules installation commands to be upgraded in batches by tasks and batches through a distributed task scheduler, and then controls the delivery rate of each task and each batch through an executor; then, based on platform resources, network resources and QPS of file downloads, the optimal values of configuration parameters in batch tasks under limited resources are fitted, thereby improving the efficiency and success rate of massive equipment upgrade operations.
[0044] In order to determine which factors affect the parameter configuration of batch task delivery, this article needs to conduct experimental research on server resource items: CPU, memory, network I / O, and the size of the upgrade file. Through experiments and specific production practice experience, it is known that as the number of commands delivered in each batch increases, or the file size grows, the CPU and memory utilization rates hardly fluctuate.
[0045] Furthermore, we first need to determine the system QPS corresponding to the platform when the upgrade file size is different without considering the network environment. system (Specifically, it refers to the QPS of the file download interface provided by the platform file service. QPS stands for Query per Second, which refers to the peak number of requests that the program interface can process per second.) Secondly, it is necessary to comprehensively consider the network environment (network bandwidth) and file size to determine the QPS when pulling files of different sizes under different network bandwidth conditions—QPS net Finally, compare the two QPS values to get the parameter configuration Freq of each batch of commands. command (i.e. Freq command = Number of devices per batch operation).
[0046] Next, the invention content of this patent is introduced from three aspects:
[0047] 1. Distributed task scheduling architecture:
[0048] like Figure 1,The tasks issued by the industrial Internet of Things platform can be triggered at irregular intervals by different locations and different upper-level systems. This paper designs a distributed task scheduling architecture based on microservices for task scheduling in multiple scenarios. The issued tasks are uniformly entered into the task cache queue, uniformly scheduled by the distributed task scheduler of each microservice node, and then issued to the device through the executor. Each task may contain upgrade commands for hundreds of thousands or millions of devices. The distributed task scheduler splits and schedules the commands by tasks and batches, and then controls the issuance rate of each task and each batch through the executor. The design of distributed task scheduling can optimize the download capacity of the file service cluster under limited resources and improve the overall efficiency of batch upgrades of equipment.
[0049] 2. Quantitative analysis of the factors affecting the frequency of command issuance:
[0050] The method in this patent determines the relationship between the rate of issuing batch upgrade commands of (industrial Internet of Things platform) equipment and its influencing factors. The overall process is as follows Figure 2 shown.
[0051] The analysis process of factors affecting the rate of issuing batch task commands is as follows: (assuming that the number of file service nodes deployed on the platform is n, n ≥ 1).
[0052] (1) Relationship between file service QPS and file size:
[0053] ① For a single file service node, conduct experiments on enough files of different sizes (for example, from 0.1M to 100M), and test the interface QPS corresponding to different file sizes by sending a large number of requests to the file download interface;
[0054] ② By analyzing the experimental results obtained in ①, the data in the form of (Filesize, QPS) is fitted by the exponential fitting method, and the relationship between QPS and Filesize is obtained as follows:
[0055]
[0056] Among them, QPS and Filesize are the dependent variable and independent variable of the formula respectively, λ1, λ2 and k1, k2 are all constants, and the measured values of the four constants are:
[0057]
[0058] When using the above parameters, the goodness of fit R is calculated by mathematical formula 2 =0.9811, which is greater than 95%, proving that the fitting results are in line with expectations.
[0059] ③ Let the QPS of a single file service node be QPS singleIn cluster deployment mode, if there are n file service nodes, the overall file download QPS of the industrial IoT platform is QPS system =n*QPS single .
[0060] (2) Relationship between network speed, file size, and file download speed:
[0061] (Since file downloading is only related to the O value in network I / O, that is, the network output value, the following only considers the network output value, and the experiment is carried out when the network card bandwidth is large enough.)
[0062] ① Keep the file size unchanged (for example, fixed at 1M), and increase the file download frequency Freq in the range of 10 times / s to 1000 times / s download , and monitor the network output rate of the file service at the same time, so as to obtain the first set of experimental results data in the form of (NET output , Freq download , Filesize);
[0063] ② Keep the file download frequency unchanged (for example, fixed at 100 times / s), increase the file size Filesize in the range of 1M to 100M, and monitor the network output rate of the file service to obtain the second set of experimental results data in the form of (NET output , Freq download , Filesize);
[0064] ③By analyzing the experimental results and fitting the two sets of experimental data obtained in ① and ② using polynomial fitting, the network output rate NET is obtained. output and file pull frequency Freq download The common relationship expression among the three and the file size Filesize is:
[0065] NET output =F(Freq download ,Filesize)(Formula-2)
[0066] The function F is an expansion of a quadratic polynomial of two variables, as follows:
[0067] F(x,y)=a*x 2 +b*y 2 +c*xy+d*x+e*y+f
[0068] At the same time, let x→Freq download ,y→Filesize, the coefficient values in the above formula are:
[0069]
[0070] The goodness of fit calculated at this time is R 2 =0.984, greater than 95%, in line with expectations.
[0071] 3. Application of the present invention:
[0072] For the industrial IoT device upgrade task, if the size of the upgrade file installation package is known and the network conditions are not restricted, the QPS of a single file service can be calculated according to (Formula -1): single If the number of instances of the file service cluster is n, the maximum QPS of file downloads that the property management platform can support is system =n*QPS single , batch command sending frequency Freq command =QPS system .
[0073] If the platform server provides limited network card resources NET output , then NET output Substitute the value of FileSize into (Formula-2) to calculate the maximum file download rate QPS that the network card can carry net If r*QPS net >QPS system (where r is the network card utilization rate, ranging from (0,1), and different network environments have different r values), indicating that the file download frequency that the platform can carry does not exceed the upper limit of the network card, Freq command Still equal to QPS system If QPS net <QPS system , then take Freq command =r*QPS net , ensuring that the network bandwidth can carry the batch tasks issued by the platform, thereby improving the execution efficiency and success rate of batch upgrade tasks at the same time.
[0074] Correspondingly, the present invention also provides a device remote batch upgrade system, comprising:
[0075] An acquisition module is used to obtain the size of the upgrade file installation package according to the industrial Internet of Things device upgrade task;
[0076] A judgment processing module, used to determine whether the network condition is limited according to the platform server;
[0077] If not, obtain the predetermined peak QPS of requests that a single file service node can handle per second. single The number of file service nodes in the file service cluster, n, and the frequency of batch command delivery, Freq command =QPS system , QPS systemIndicates the maximum value of file downloads that the property management platform can handle, QPS system =n*QPS single ;
[0078] If yes, get the limited network card resources NET provided by the platform server output and the upgrade file installation package size Filesize, based on the limited network card resources NET output The maximum file download rate QPS that the network card can carry is calculated by using the upgrade file installation package size Filesize net ;
[0079] If r*QPS net ≥QPS system , then the batch command sending frequency Freq command =QPS system , r is the network card utilization rate;
[0080] If r*QPS net <QPS system , then the batch command sending frequency Freq command =r*QPS net
[0081] Correspondingly, the present invention also provides a distributed task scheduling method, comprising:
[0082] Get a pre-built microservices-based distributed task scheduling architecture;
[0083] All tasks are sent to the distributed task scheduling architecture based on microservices. The batch command sending frequency Freq is calculated by using the device remote batch upgrade method in the distributed task scheduling architecture based on microservices. command , according to the batch command to send the frequency Freq command The distributed task scheduler of each microservice node in the distributed task scheduling architecture based on microservices is used for unified scheduling, and then sent to the device through the executor; wherein each of the tasks is split and scheduled by task and batch through the distributed task scheduler, and then the sending rate of each task and each batch is controlled by the executor.
[0084] The microservice-based distributed task scheduling architecture includes:
[0085] Platform gateway, file service cluster and distributed task management service cluster;
[0086] The platform gateway is used to obtain the HTTPS file download data of the device and transmit it to the file service cluster for storage. The distributed task management service cluster obtains all tasks through the file service cluster and puts all tasks into the task cache queue;
[0087] The distributed task scheduler of the microservice node in the distributed task management service cluster uniformly schedules tasks from the task cache queue and then sends them to the device through the executor.
[0088] The present invention also provides a computer-readable storage medium storing one or more programs, characterized in that the one or more programs include instructions, which, when executed by a computing device, enable the computing device to perform any of the methods described.
[0089] The present invention also provides a computing device, comprising:
[0090] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods described.
[0091] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0092] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0093] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0094] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0095] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for remote batch upgrading of devices, characterized in that: include: Obtain the size of the upgrade file installation package based on the industrial IoT device upgrade task; Determine whether network conditions are limited based on the platform server; If not, obtain the peak number of requests that a single file service node can handle per second. QPS single The number of file service nodes in the file service cluster, n, and the frequency of batch command delivery Freq command = QPS system , QPS system Indicates the maximum value of the file download that the property management platform can handle. QPS system =n* QPS single ; If yes, obtain the limited network card resources provided by the platform server NET output and the size of the upgrade file installation package Filesize , based on limited network card resources NET output and the size of the upgrade file installation package Filesize Calculate the maximum file download rate that the network card can carry QPS net ; If r* QPS net ≥ QPS system , then the batch command sending frequency Freq command = QPS system , r is the network card utilization rate; If r* QPS net < QPS system , then the batch command sending frequency Freq command = r * QPS net ; The limited network card resources NET output The calculation formula is: (1); Among them, the function F is an expansion of a quadratic polynomial in two variables, expressed as: (2); In the formula, represents the actual download frequency of the file, a , b , c , d , e , f are the coefficients of the expansion of a quadratic polynomial of two variables; Will NET output and FileSize Substitute into formula (1) to calculate the maximum file download rate that the network card can carry QPS net .
2. The device remote batch upgrade method according to claim 1, characterized in that: The peak value of requests that a single file service node can handle per second QPS single The calculation formula is: ; in, λ 1. λ 2 and k 1. k 2 are constants.
3. A remote batch upgrade system for equipment, characterized in that: include: An acquisition module is used to obtain the size of the upgrade file installation package according to the industrial Internet of Things device upgrade task; A judgment processing module, used to determine whether the network condition is limited according to the platform server; If not, obtain the peak number of requests that a single file service node can handle per second. QPS single The number of file service nodes in the file service cluster, n, and the frequency of batch command delivery Freq command = QPS system , QPS system Indicates the maximum value of the file download that the property management platform can handle. QPS system =n* QPS single ; If yes, obtain the limited network card resources provided by the platform server NET output and the size of the upgrade file installation package Filesize , based on limited network card resources NET output and the size of the upgrade file installation package Filesize Calculate the maximum file download rate that the network card can carry QPS net ; If r* QPS net ≥ QPS system , then the batch command sending frequency Freq command = QPS system , r is the network card utilization rate; If r* QPS net < QPS system , then the batch command sending frequency Freq command = r * QPS net ; The limited network card resources NET output The calculation formula is: (1); Among them, the function F is an expansion of a quadratic polynomial in two variables, expressed as: (2); In the formula, represents the actual download frequency of the file, a , b , c , d , e , f are the coefficients of the expansion of a quadratic polynomial of two variables; Will NET output and FileSize Substitute into formula (1) to calculate the maximum file download rate that the network card can carry QPS net .
4. A distributed task scheduling method, characterized in that: include: Get a pre-built microservices-based distributed task scheduling architecture; All tasks issued are sent to a distributed task scheduling architecture based on microservices, and the frequency of issuing batch commands is calculated in the distributed task scheduling architecture based on microservices using the device remote batch upgrade method as claimed in claim 1. Freq command , according to the batch command sending frequency Freq command The distributed task scheduler of each microservice node in the distributed task scheduling architecture based on microservices is used for unified scheduling, and then sent to the device through the executor; wherein each of the tasks is split and scheduled by task and batch through the distributed task scheduler, and then the sending rate of each task and each batch is controlled by the executor.
5. The distributed task scheduling method according to claim 4, characterized in that: The microservice-based distributed task scheduling architecture includes: Platform gateway, file service cluster and distributed task management service cluster; The platform gateway is used to obtain the HTTPS file download data of the device and transmit it to the file service cluster for storage. The distributed task management service cluster obtains all tasks through the file service cluster and puts all tasks into the task cache queue; The distributed task scheduler of the microservice node in the distributed task management service cluster uniformly schedules tasks from the task cache queue and then sends them to the device through the executor.
6. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions which, when executed by a computing device, cause the computing device to perform any one of the methods according to claims 1 to 2.
7. A computing device, characterized in that include, One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods according to claims 1 to 2.
