Multi-task scheduling-based capacity expansion and shrinkage control method, system and device and medium

Through the multi-task scheduling method, dynamically adjusting the expansion and shrinking capacity of drilling ship equipment, solving the problems of manual observation dependence and single parameter evaluation in the prior art, achieving more efficient resource utilization and accurate task scheduling.

CN119938258APending Publication Date: 2025-05-06GUANGZHOU MARINE GEOLOGICAL SURVEY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411827078.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, the expansion and shrinkage of drilling ship equipment mainly relies on manual observation, resulting in inefficiency; at the same time, single parameter evaluation leads to inaccurate task scheduling, affecting resource utilization.

Method used

The scaling control method based on multi-task scheduling is adopted to determine the status of the device and task by obtaining information such as CPU usage, memory usage, round trip delay and packet loss rate of the device, and dynamically adjust it according to the scaling strategy to achieve scaling or scaling of the device.

Benefits of technology

By updating the status information of equipment and tasks in real time, the accuracy of evaluation is improved; at the same time, scheduling is carried out based on the actual use of the equipment, improving resource utilization and improving the efficiency and effect of expansion and expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938258A_ABST
    Figure CN119938258A_ABST
Patent Text Reader

Abstract

The invention discloses a capacity expansion and shrinkage control method, system and device based on multi-task scheduling and a medium. The method comprises the following steps: acquiring first information of each device; determining a first state of each device; determining a second state of each task; if the first task of which the second state is to be scheduled exists, judging whether to carry out capacity expansion operation on the equipment based on a capacity expansion strategy according to the first information; or, if the second equipment set with the first state being in work exists, carrying out capacity reduction operation on the second equipment according to a capacity reduction strategy, and updating the state of the second equipment to be in capacity reduction; and if the second equipment has the task in scheduling or execution, after the second equipment completes the capacity reduction operation, updating the state of the second equipment to be in work. The embodiment of the invention is beneficial to improving the resource utilization rate. The method can be widely applied to the technical field of task scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of task scheduling, and in particular to a method, system, device and medium for controlling expansion and contraction based on multi-task scheduling. Background Art

[0002] Drilling ships are ships specially used for drilling operations on submarine geological structures, and are vital to the protection of the ocean. There are a large number of sensor devices, camera devices, infrared devices and other professional equipment involved in the work on the drilling ship, and these devices are distributed in large numbers in different operating areas. Due to the complex offshore operating environment and high work intensity, equipment is generally more easily damaged than on land and has a shorter life cycle; therefore, the equipment on the drilling ship is usually designed with redundancy. In daily work, it is necessary to expand and shrink the equipment to ensure the orderly progress of work and maximize the utilization of resources. In related technologies, the expansion and shrinkage of equipment is usually achieved through manual observation, which affects the expansion and shrinkage effect. At the same time, related technologies also use a single parameter to evaluate and schedule a single task, resulting in low accuracy of the evaluation results, which affects the scheduling accuracy. Summary of the invention

[0003] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.

[0004] To this end, an object of the present invention is to provide an efficient expansion and contraction control method, system, device and medium based on multi-task scheduling.

[0005] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:

[0006] On the one hand, an embodiment of the present invention provides a method for controlling expansion and contraction based on multi-task scheduling, comprising the following steps:

[0007] The method for controlling capacity expansion and contraction based on multi-task scheduling of an embodiment of the present invention comprises: obtaining first information of each device; the first information comprises CPU usage, memory usage, round-trip delay and packet loss rate; determining the first state of each device; the first state comprises working, idle, offline, expanding and shrinking; determining the second state of each task; the second state comprises waiting for scheduling, scheduling, executing and completed; if there is a first task in the second state waiting for scheduling, judging whether to perform capacity expansion operation on the device based on the first information and the capacity expansion strategy; if it is necessary to perform capacity expansion operation on the first device, updating the state of the first task and the state of the first device; the first device is used to characterize the device in the working or idle state; or, if there is a second device set in the working state, performing capacity reduction operation on the second device according to the capacity reduction strategy, and updating the state of the second device to shrinking; if there is still a task in scheduling or executing on the second device, after the second device completes the capacity reduction operation, updating the state of the second device to working; the second device set comprises the second device, and the capacity reduction strategy is used to characterize whether to perform capacity reduction operation on the second device according to the first information of the second device. The embodiment of the present application marks the status of devices and tasks, and performs expansion or reduction operations according to the status marks; it can achieve real-time update of status information and improve the accuracy of evaluation. At the same time, the embodiment of the present application schedules multiple tasks in the same way, and can schedule them according to the actual usage of the device to improve resource utilization.

[0008] In addition, the expansion and contraction control method based on multi-task scheduling according to the above embodiment of the present invention may also have the following additional technical features:

[0009] Furthermore, in the capacity expansion and contraction control method based on multi-task scheduling of an embodiment of the present invention, the step of judging whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information includes:

[0010] If the second state is that the total number of tasks being scheduled or executed is greater than the first threshold, the capacity expansion operation is not performed;

[0011] Alternatively, if the second state is that the sum of the tasks being scheduled or executed is greater than a second threshold, randomly determine whether to perform a capacity expansion operation; wherein the first threshold is the maximum number of devices required to execute the first task, and the second threshold is the minimum number of devices required to execute the first task;

[0012] Alternatively, if the second state is that the total number of tasks being scheduled or executed is less than or equal to the second threshold, it is determined to perform a capacity expansion operation.

[0013] Furthermore, in one embodiment of the present invention, the method determines the first device through the following expansion strategy:

[0014] According to the first information, filtering operations are performed on devices in a first device set to update the first device set; the first device set is used to represent a collection of devices in a working state;

[0015] Determine, according to the first information, an updated weight of each device in the first device set;

[0016] According to the weights, mutually exclusive random processing is performed on the devices in the first device set to determine the first device.

[0017] Further, in one embodiment of the present invention, the weight of each device includes a round-trip delay weight, and the method determines the round-trip delay weight by the following steps:

[0018] Receive heartbeat information sent by the device at the current moment; the heartbeat information includes a device number and a serial number; the serial number increases according to the number of heartbeats;

[0019] Determine the round-trip delay of the device based on the heartbeat information in the first time;

[0020] If the round-trip delay is less than a third threshold, determining the round-trip delay weight to be 1;

[0021] Alternatively, if the round-trip delay is greater than or equal to the third threshold, a round-trip delay weight is determined according to the third threshold and the round-trip delay.

[0022] Furthermore, in one embodiment of the present invention, the method further comprises:

[0023] If the device continues to be under high load or works abnormally, the round-trip delay weight is updated; the updating of the round-trip delay weight includes the following steps:

[0024] Determine a difference between the round-trip delay weight and the penalty coefficient as a third value;

[0025] If the third value is greater than zero, updating the round trip delay weight to the third value;

[0026] If the third value is less than or equal to zero, the round trip delay weight is updated to zero.

[0027] Furthermore, in one embodiment of the present invention, the method calculates the packet loss rate by the following steps:

[0028] Determine the number of packets sent and the number of packets received; if the number of packets received is greater than the number of packets sent, update the value of the number of packets sent to be equal to the value of the number of packets received;

[0029] Determine that the sum of the number of received packets and a fourth value is a first ratio; determine that the sum of the number of sent packets and a fifth value is a second ratio; the fifth value is greater than the fourth value;

[0030] The packet loss rate is determined according to a quotient of the first ratio and the second ratio.

[0031] Furthermore, in one embodiment of the present invention, the method further comprises:

[0032] Determine that the device in the second device set whose CPU usage is greater than the fourth threshold is the second device; or determine that the device in the second device set whose memory usage is greater than the fifth threshold is the second device; update the status of the second task and the third task to waiting for scheduling; the second task is the task that was most recently scheduled to the second device and the second status is the task being scheduled; the third task is the task that was most recently scheduled to the second device and the second status is the task being executed;

[0033] Alternatively, if the second device is in an offline state, the state of each task in the first task set is updated to wait for scheduling; the first task set is all tasks scheduled to the second device.

[0034] On the other hand, an embodiment of the present invention proposes a capacity expansion and contraction control system based on multi-task scheduling, including:

[0035] The first module is used to obtain first information of each device; the first information includes CPU usage, memory usage, round-trip delay and packet loss rate;

[0036] The second module is used to determine the first state of each device; the first state includes working, idle, offline, expanding and shrinking;

[0037] The third module is used to determine the second status of each task; the second status includes waiting for scheduling, scheduling, executing and completed;

[0038] A fourth module is used to determine whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information if there is a first task whose second status is waiting for scheduling; if the capacity expansion operation is required for the first device, update the status of the first task and the status of the first device; the first device is used to indicate that the status is working or idle;

[0039] The fifth module is used to, if there is a second device set whose first status is working, perform a scaling-down operation on the second device according to the scaling-down strategy, and update the status of the second device to shrinking; if there are tasks being scheduled or executed on the second device, after the second device completes the scaling-down operation, update the status of the second device to working; the second device set includes the second device, and the scaling-down strategy is used to characterize whether to perform a scaling-down operation on the second device based on the first information of the second device.

[0040] On the other hand, an embodiment of the present invention provides a capacity expansion and contraction control device based on multi-task scheduling, comprising:

[0041] at least one processor;

[0042] at least one memory for storing at least one program;

[0043] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned expansion and contraction control method based on multi-task scheduling.

[0044] On the other hand, an embodiment of the present invention provides a storage medium storing a program executable by a processor, wherein the program executable by the processor is used to implement the above-mentioned expansion and contraction control method based on multi-task scheduling when executed by the processor.

[0045] The method provided by the embodiment of the present invention includes: obtaining first information of each device; the first information includes CPU usage, memory usage, round-trip delay and packet loss rate; determining the first state of each device; the first state includes working, idle, offline, expanding and shrinking; determining the second state of each task; the second state includes waiting for scheduling, scheduling, executing and completed; if there is a first task waiting for scheduling in the second state, judging whether to perform an expansion operation on the device based on the expansion strategy according to the first information; if the expansion operation is required for the first device, updating the state of the first task and the state of the first device; the first device is used to characterize the device in the working or idle state; or, if there is a second device set in the working state, shrinking the second device according to the shrinking strategy, updating the state of the second device to shrinking; if there is still a task in scheduling or executing on the second device, after the shrinking operation is completed on the second device, the state of the second device is updated to working; the second device set includes the second device, and the shrinking strategy is used to characterize whether to perform a shrinking operation on the second device according to the first information of the second device. The embodiment of the present application marks the status of devices and tasks, and performs expansion or reduction operations according to the status marks; it can achieve real-time update of status information and improve the accuracy of evaluation. At the same time, the embodiment of the present application schedules multiple tasks in the same way, and can schedule them according to the actual usage of the device to improve resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the embodiments of the present invention or the drawings of related technical solutions in the prior art are introduced below. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 A flow chart of an embodiment of a method for controlling expansion and contraction based on multi-task scheduling provided by the present invention;

[0048] Figure 2 A flow chart of another embodiment of the expansion and contraction control method based on multi-task scheduling provided by the present invention;

[0049] Figure 3 A flowchart of an embodiment of the capacity expansion process and the capacity reduction process provided by the present invention executing each other;

[0050] Figure 4 A schematic diagram of an embodiment of device state switching provided by the present invention;

[0051] Figure 5 A schematic diagram of a flow chart of an embodiment of a capacity expansion process provided by the present invention;

[0052] Figure 6 A schematic diagram of a flow chart of another embodiment of the capacity expansion process provided by the present invention;

[0053] Figure 7 A schematic diagram of an embodiment of task state switching provided by the present invention;

[0054] Figure 8 A schematic diagram of an embodiment of the device state combined with the task state switching provided by the present invention;

[0055] Fig. 9 A schematic diagram of the structure of an embodiment of a capacity expansion and contraction control system based on multi-task scheduling provided by the present invention;

[0056] Fig.10 A schematic structural diagram of an embodiment of a capacity expansion and contraction control device based on multi-task scheduling provided by the present invention. DETAILED DESCRIPTION

[0057] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limitations of the present invention. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0058] First, the concepts involved in this application are explained:

[0059] A drilling vessel is a vessel specially used for drilling seabed geological structures and is mainly used for marine geological exploration.

[0060] RTT (Round-Trip Time), round-trip delay. It is an important performance indicator in computer networks, indicating the total delay from the start of sending data to the sender receiving confirmation from the receiver (the receiver sends confirmation immediately after receiving the data). The round-trip delay (RTT) is determined by three parts: the propagation time of the link, the processing time of the end system, and the queuing and processing time in the router's cache. Among them, the values ​​of the first two parts are relatively fixed as a TCP connection, and the queuing and processing time in the router's cache will change with the change of the congestion level of the entire network. Therefore, the change of RTT reflects the change of network congestion level to a certain extent.

[0061] Laplace's probability of the sun rising: In probability theory, the succession rule is a formula proposed in the treatment of the sunrise problem. The formula is still used, especially when there are few observations, or in (limited) sample data, to estimate the probability of an event that has not been observed at all.

[0062] Capacity expansion refers to the process of increasing capacity or scale according to business needs. For the services provided by applications, as user needs increase, existing devices or applications cannot provide services that meet the expected quality due to high load, so capacity expansion is needed to ensure service quality. Capacity expansion here can be simply understood as adding devices and applications.

[0063] Scaling refers to the process of reducing capacity or scale according to business needs. For the services provided by applications, as user demand decreases, existing devices or applications have low loads and do not need too many devices to be in working state. In order to save resources and reduce energy consumption, it is necessary to reduce capacity to ensure service quality. Here, scaling can be simply understood as adding devices and applications.

[0064] Background of expansion and contraction of drilling equipment: During the normal operation of a drilling ship, a large number of professional equipment such as sensors, cameras, infrared equipment, etc. are usually required to participate in the work. These devices usually have certain storage and computing capabilities, and are distributed in large quantities on the operating equipment, such as drilling racks, workbenches, etc. There are a large number of devices installed in places such as drilling racks. The reasons for doing this are: first, to obtain the operation status from multiple angles, and second, to back up each other, that is, if a certain device is suddenly damaged, it will not delay the operation of other devices. There are extreme conditions such as typhoons and waves in offshore operations. Equipment is generally more easily damaged than on land and has a shorter life cycle. At the same time, the intensity of offshore operations is usually very high, and it is not realistic to replace and repair equipment after it breaks down, such as in drilling operations. Therefore, most of them are arranged in advance. A large number of equipment (with redundancy). At the same time, offshore operations are characterized by short-term and high-frequency work, such as working continuously for 1 day after determining the drilling station. Considering that the power supply resources of drilling ships are very scarce and tight, if all equipment (sensors, cameras, infrared equipment, etc.) are involved in each operation, it will consume huge power resources. The ideal situation is to set a fixed number of devices to participate in the operation according to the needs, but considering the intensity of different operations and the performance of the equipment, it becomes difficult to manually maintain the number of devices.

[0065] It should be noted that the current technical solution mainly evaluates device performance based on CPU usage and memory usage, and mainly performs scaling operations based on a single task, which is inefficient and prone to scheduling unfairness and imbalance. A large number of tests have shown that relying solely on CPU usage and memory usage to evaluate performance still results in scheduling unfairness. It is possible to consider introducing more evaluation dimensions to evaluate device performance from multiple dimensions. At the same time, the solutions in related technologies cannot support the scheduling of multiple tasks: currently a single device can only be scheduled according to one task. Considering the heterogeneity of different devices and the different performance of different devices, some higher-performance devices can undertake multiple tasks. For devices with abnormal performance, the scaling process lacks evaluation and processing of the last scheduling results, which may lead to scheduling imbalance.

[0066] The following describes in detail a scaling control method and system based on multi-task scheduling according to an embodiment of the present invention with reference to the accompanying drawings. First, the scaling control method based on multi-task scheduling according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0067] Reference Figure 1In an embodiment of the present invention, a capacity expansion and contraction control method based on multi-task scheduling is provided. The capacity expansion and contraction control method based on multi-task scheduling in the embodiment of the present invention can be applied to a terminal, or to a server, or can be software running in a terminal or a server, etc. The terminal can be a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The capacity expansion and contraction control method based on multi-task scheduling in the embodiment of the present invention mainly includes the following steps:

[0068] S100: Acquire first information of each device; the first information includes CPU usage, memory usage, round-trip delay, and packet loss rate;

[0069] S200: Determine a first state of each device; the first state includes working, idle, offline, expanding, and shrinking;

[0070] S300: Determine the second status of each task; the second status includes waiting for scheduling, scheduling, executing and completed;

[0071] S400: If there is a first task in the second state of waiting for scheduling, determine whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information; if the capacity expansion operation needs to be performed on the first device, update the state of the first task and the state of the first device; the first device is used to represent the device in the working or idle state;

[0072] S500: If there is a second device set whose first status is working, the second device is scaled down according to the scaling-down strategy, and the status of the second device is updated to being scaled down; if there are tasks being scheduled or executed on the second device, after the scaling-down operation is completed on the second device, the status of the second device is updated to being working; the second device set includes the second device, and the scaling-down strategy is used to characterize whether to perform a scaling-down operation on the second device according to the first information of the second device.

[0073] In some possible implementations, the method proposed in the embodiments of the present application includes the following aspects:

[0074] 1) The drilling equipment actively registers its equipment information with the dispatch server;

[0075] 2) The scheduling server evaluates the real-time performance of drilling equipment based on multiple dimensions;

[0076] 3) The scheduling server dynamically expands and shrinks capacity based on multi-task scheduling to ensure that tasks are completed as expected.

[0077] Specifically, refer to Figure 2 As shown, the method provided in the embodiment of the present application is used between the device and the dispatch server. First, the dispatch server broadcasts a notification of device registration. Whenever a new device is added, the dispatch server on the ship will record the information of the newly added device in the database. Then the newly added device or the reconnected device registers the device information with the dispatch server. Specifically, the newly added device will configure the IP of the dispatch server when it is started, so the device can confirm the information of the dispatch server. Whenever the device is turned on (eg restart scenario) or receives a broadcast message notifying registration, it will actively register its own information with the dispatch server. The registered information includes its own MAC address, LAN IP address, geographic location information, etc. After receiving the registration request, the dispatch server will check and compare based on the MAC address and the information in the database. If the information is consistent, it will reply that the registration is successful, otherwise it will notify the operation and maintenance personnel that the device may be configured incorrectly or there is a fault. Of course, the embodiment of the present application can also be set to periodically check the device registration status, and the period can be set according to actual needs.

[0078] It is understandable that the server sends heartbeat information and determines the round-trip delay through the heartbeat information. The scheduling server uses the UDP protocol to send heartbeat request information to the device every second (this can be configured, the default is 1s). The request information includes the device ID and sequenceID (i.e., sequence number) to obtain the real-time operation information of the device. Among them, sequenceID is a uint32-bit number. Each time the sequenceID is sent, it is the received sequenceID+1. If it exceeds the maximum value of uint32, it will restart from 0. The scheduling server will also count the number of data packets sent to each device in the past 30s (SendDataNum) and the number of data packets received (RecvDataNum). Here, the data packets mainly include heartbeat packet request replies, data packet request replies, and other packets. Whenever the scheduling server receives a data packet, SendDataNum = SendDataNum+1. Similarly, whenever the scheduling server sends a data packet, RecvDataNum = RecvDataNum+1. Then, the device replies with the heartbeat information. After the device receives the heartbeat request information, it will use the UDP protocol to reply the heartbeat information to the scheduling server. The heartbeat information includes the average CPU usage in the past 30 seconds (this can be configured, the default is 30 seconds), the current memory usage, the number of data packets received in the past 30 seconds RecvDataNum, the number of data packets sent in the past 30 seconds SendDataNum, and sequenceID+1. The data packets here mainly include heartbeat packet request replies, data packet request replies, and other packets. Whenever the device receives a data packet, SendDataNum=SendDataNum+1. Similarly, whenever the device sends a data packet, RecvDataNum=RecvDataNum+1. The scheduling server obtains the real-time operation information of the device (i.e., the first information) based on the heartbeat information. Specifically, in the embodiment of the present application, the first information includes CPU usage, memory usage, round-trip delay, and packet loss rate. The specific acquisition method is as follows:

[0079] CPU usage: can be obtained directly from the heartbeat reply packet.

[0080] Memory usage: can be obtained directly from the heartbeat reply packet.

[0081] RTT: Since the heartbeat does not have complex logic processing, the present invention takes a request reply of the heartbeat as RTT, and the RTT of each heartbeat can be calculated according to the device ID and sequenceID. The present invention calculates the average of all RTTs in the past 30s.

[0082] Packet loss rate: Assume that the number of packets sent by the scheduling server is SendDataNum1 and the number of packets received is RecvDataNum1 (if it is found that RecvDataNum1>SendDataNum1, then SendDataNum1=RecvDataNum1). The present invention uses Laplace's sun rise probability to calculate the packet loss rate, and the calculation formula is as follows: Packet loss rate LossRate=1-(RecvDataNum1+1) / (SendDataNum1+2). For example, if SendDataNum1 is 1000 and RecvDataNum1 is 998, then LossRate=1-(28+1) / (30+2)=0.3%. This formula can also avoid the initial situation where SendDataNum1 is 0.

[0083] It should be noted that CPU and memory indicators can be used as basic indicators to evaluate the real-time performance of the device, and cannot be used to evaluate the network conditions. A high CPU load or a large memory usage does not necessarily mean that the network environment is necessarily poor. Therefore, the present invention proposes a multi-angle device performance evaluation method, which feeds back device performance from the CPU and memory usage, feeds back the network environment from the RTT and packet loss rate dimensions (in fact, it can also feed back device performance), analyzes the current status of the device from multiple angles, and introduces a scoring and mutually exclusive probability random mechanism to ensure the fairness and balance of scheduling as much as possible.

[0084] In general, the scheduling server has the real-time operation information of all online devices (CPU usage, memory usage, RTT, packet loss rate, etc.). The scheduling server can confirm offline devices by comparing the device operation information with the database information. For offline devices, fault information can be issued so that the staff can handle the fault as soon as possible. Of course, the subtasks deployed by offline devices will be reset to the unscheduled state, waiting for subsequent scheduling arrangements to execute the tasks.

[0085] When the server obtains the operation information and status information of the device, the expansion and contraction task is started. Whenever an operation is needed at sea, professional technicians will set the task in advance, and only need to formulate the minimum number of minNeedDevice and the maximum number of maxNeedDevice that the task occupies. Those skilled in the art can set the specific values ​​of the minimum number of minNeedDevice and the maximum number of maxNeedDevice according to actual needs, and this application does not make specific limitations.

[0086] See also Figure 2As shown, after the scheduling is turned on, the embodiment of the present application can expand the equipment according to the task requirements. After the task is set successfully, after the start time is reached, the scheduling server divides the task into several subtasks according to the task information. Then, the equipment expansion operation is actively requested according to the subtask. When the task requires an expansion operation, the expansion is notified and the equipment is assigned to execute the subtask. The expansion process will select the best equipment to execute the subtask according to the real-time operation status. Similarly, the embodiment of the present application can shrink the equipment according to the task requirements. According to the task execution status and the real-time operation information of the equipment, the equipment shrinking operation is performed on demand. Notify the shrinking, stop the current subtask, and stop allocating new subtasks to the equipment. If the equipment confirms the shrinking, it will actively stop allocating new subtasks and stop the currently executed subtask. After the shrinking is completed, continue to execute the unfinished subtasks. When all subtasks are completed, it means that the task has been completed and the scheduling work is completed.

[0087] It is understandable that, referring to Figure 3 The expansion and contraction in the embodiment of the present application are continuously executed in rotation. After the task starts, it will continuously check whether the capacity needs to be expanded or contracted until the task is completed, so that the expansion and contraction can be guaranteed in seconds.

[0088] It should be noted that the device in the embodiment of the present application has a total of 5 states. Figure 4 As shown, specifically:

[0089] Offline: When the dispatch server cannot receive information from a device within a certain period of time, it will be considered offline. Offline devices may be faulty, and an alarm message needs to be issued.

[0090] Idle: The device is in idle state when the initial state, subtask or capacity reduction is completed. At this time, the device will enter standby state and wait for the assigned subtask to wake up (in standby state, the heartbeat request replies normally).

[0091] Expansion: The state when requesting device expansion. The embodiment of the present application can expand the capacity of idle devices or working devices, so that capable devices can run multiple tasks at the same time, thereby improving device utilization.

[0092] Working: The state when the expansion is completed. Because a single device may execute multiple subtasks at the same time, when a single subtask is expanded, the device will switch to the expanding state, and finally switch to the working state. Similarly, when a single subtask is reduced, if the device is still running other subtasks at this time, it will switch to the reducing state at this time, and switch to the working state after the reduction is completed.

[0093] Scaling down: the state when requesting the device to scale down. In the embodiment of the present application, the next state during scaling down can be either working or idle, which is determined according to the number of tasks executed in the device.

[0094] It is understandable that the embodiment of the present application determines whether to perform an expansion operation or a reduction operation based on the information and status of the device, combined with the status of each task. And according to different statuses, the status after the expansion operation or the reduction operation is determined. The scheduling server of the embodiment of the present application evaluates the real-time performance of the drilling equipment based on multiple dimensions, which not only includes CPU and memory usage, but also introduces new perspectives such as RTT and packet loss rate to ensure the fairness of scheduling. The scheduling server of the embodiment of the present application dynamically performs expansion and reduction operations based on multi-task scheduling, and supports a single device to schedule multiple tasks. The embodiment of the present application improves the expansion and reduction process, adds an evaluation system for historical expansion and reduction results, and ensures the balance of scheduling.

[0095] Optionally, in one embodiment of the present invention, referring to Figure 5 , judging whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information, including:

[0096] Step S410: If the second state is that the total number of tasks being scheduled or executed is greater than the first threshold, the capacity expansion operation is not performed;

[0097] Alternatively, step S420: if the second state is that the total number of tasks being scheduled or executed is greater than a second threshold, randomly determine whether to perform a capacity expansion operation; wherein the first threshold is the maximum number of devices required to execute the first task, and the second threshold is the minimum number of devices required to execute the first task;

[0098] Alternatively, step S430: if the second state is that the total number of tasks being scheduled or executed is less than or equal to the second threshold, determine to perform a capacity expansion operation.

[0099] In some possible implementations, the expansion strategy in the embodiments of the present application is also used to determine whether to perform expansion operations on the device, that is, to select the best device. It is understandable that devices in the states of expansion, shrinking, offline, etc. will not schedule new subtasks, so it is necessary to select the best devices in idle and working states, and appropriately allocate multiple tasks to execute according to the real-time performance of the devices. It should be noted that devices that are expanding or shrinking are not taken into consideration. This is because the task has not yet started to execute, and the real-time performance at this time cannot represent the performance at work, so these are not taken into consideration. For specific expansion operations, please refer to Figure 6 As shown:

[0100] a) Filtering high-load devices: Based on the CPU usage and memory usage of each device, devices with excessively high CPU usage and devices with excessively high memory usage can be filtered out. That is, for devices with excessively high usage, it is not suitable to add new tasks. Therefore, the embodiment of the present application will not schedule high-load devices.

[0101] b) Filter abnormal network devices: For devices whose RTT in the past 30 seconds is greater than the threshold RttMax (this can be configured, the default is 100ms) or the packet loss rate LossRate is greater than the threshold LossRateMax (this can be configured, the default is 20%), abnormal network devices will not be scheduled this time. The ship's network is actually a local area network. The RTT should theoretically be within 50ms, and the packet loss rate will be within 10% under normal circumstances. Therefore, devices with RTT of 100ms or more and packet loss rate of 20% or more are judged as abnormal network devices. Abnormality of these indicators may be caused by device problems or the device network load is indeed large. This part will be specifically determined in the reduction process.

[0102] It can be understood that after screening out devices with excessive utilization and failures, the embodiment of the present application judges the task execution status. If there are many tasks currently being executed, it is not suitable to expand the capacity to execute new tasks, thereby alleviating the problem of excessive consumption of equipment resources.

[0103] Optionally, in one embodiment of the present invention, the method determines the first device by the following expansion strategy:

[0104] According to the first information, filtering operations are performed on devices in a first device set to update the first device set; the first device set is used to represent a collection of devices in a working state;

[0105] Determine, according to the first information, an updated weight of each device in the first device set;

[0106] According to the weights, mutually exclusive random processing is performed on the devices in the first device set to determine the first device.

[0107] In some possible implementations, when selecting a specific scheduling device, the embodiments of the present application may assign a score, ie, a weight, to each device, and select the first device based on the weight score.

[0108] Optionally, in one embodiment of the present invention, the weight of each device includes a round-trip delay weight, and the method determines the round-trip delay weight by the following steps:

[0109] Receive the heartbeat information sent by the device at the current moment; the heartbeat information includes the device number and serial number; the serial number increases according to the number of heartbeats;

[0110] Determine the round-trip delay of the device based on the heartbeat information in the first time;

[0111] If the round-trip delay is less than the third threshold, the round-trip delay weight is determined to be 1;

[0112] Alternatively, if the round-trip delay is greater than or equal to the third threshold, a round-trip delay weight is determined according to the third threshold and the round-trip delay.

[0113] Optionally, in one embodiment of the present invention, the method further includes:

[0114] If the device continues to be highly loaded or works abnormally, the round-trip delay weight is updated; the updating of the round-trip delay weight comprises the following steps:

[0115] Determine the difference between the round-trip delay weight and the penalty coefficient as a third value;

[0116] If the third value is greater than zero, updating the round trip delay weight to the third value;

[0117] If the third value is less than or equal to zero, the round trip delay weight is updated to zero.

[0118] Specifically, after the equipment is screened, the embodiment of the present application classifies the remaining equipment into two categories: one is the equipment in operation, and the other is the equipment in idle state. The equipment in operation is scheduled first, followed by the equipment in idle state. The purpose of this consideration is to extend the use time of the equipment. For the equipment in operation, the core idea is to select the optimal equipment based on the scoring form. The calculation formula is as follows:

[0119] The score Score = (exp(-1*CPUUsePercent)+exp(-1*MemUsePercent)+RttScore+exp(-1*LossRate)) / 4. RttScore (i.e., round-trip delay weight) indicates the score calculated by RTT (i.e., round-trip delay), RttScore = min(1, exp(-1*(RTT-45))). That is, if RTT is less than 45ms (i.e., the third threshold), RttScore = 1, otherwise RttScore = exp(-1*(RTT-45)). If the reason for the recent (within 180s, configurable) reduction in capacity is due to device abnormality (Case 1 to Case 4 of the reduction in capacity, see the subsequent introduction), Score = max(0, Score-0.5), where 0.5 is the penalty coefficient, which is configurable and defaults to 0.5. This will reduce the probability of this scheduling, in order to prevent abnormal devices from being repeatedly scheduled for expansion.

[0120] It is understandable that the larger the score, the smaller the current comprehensive load; the smaller the score, the larger the current comprehensive load. For multiple working devices, calculate the corresponding scores and select the largest one as the device for this scheduling. If the scheduling device cannot be selected this time, select from the idle devices. If there is no idle device, the current expansion ends directly.

[0121] For example, suppose some device information is as follows:

[0122] Device 1: CPU usage is 95%, memory usage is 40%, RTT is 41ms, and LossRate is 0.09. It is a high-load device and will not be scheduled this time.

[0123] Device 2: CPU usage is 30%, memory usage is 89%, RTT is 37ms, and LossRate is 0.02. It is a high-load device and will not be scheduled this time.

[0124] Device 3: CPU usage is 35%, memory usage is 23%, RTT is 103ms, LossRate=0.05. It is an abnormal network device and will not be scheduled this time.

[0125] Device 4: CPU usage 47%, memory usage 41%, RTT 37ms, LossRate = 0.22. It is an abnormal network device and will not be scheduled this time.

[0126] Device 5: CPU utilization 23%, memory utilization 21%, RTT 57ms, LossRate = 0.05, Score5 = (exp(-1*0.23)+exp(-1*0.21)+exp(-1*(57-45))+exp(-1*0.05)) / 4 = 0.639.

[0127] Device 6: CPU utilization 36%, memory utilization 31%, RTT 27ms, LossRate = 0.01, Score6 = (exp(-1*0.36)+exp(-1*0.31)+1+exp(-1*0.01)) / 4 = 0.855.

[0128] Device 7: CPU usage is 13%, memory usage is 37%, RTT is 17 ms, LossRate = 0, Score7 = (exp(-1*0.13)+exp(-1*0.37)+1+exp(-1*0)) / 4 = 0.892. Assuming that the device has experienced abnormal capacity reduction recently, Score7 = 0.892-0.5 = 0.392.

[0129] That is, device 5 participates in the scheduling with a score of 0.639, device 6 with a score of 0.855, and device 7 with a score of 0.392. Device 6 has the highest score, so device 6 is selected for this expansion scheduling.

[0130] The embodiment of the present application can also use a scoring mechanism to select devices for devices in an idle state. If no scheduling device is selected in the device set in the working state (i.e., the first device set), it is selected from the device set in the idle state. The core idea is to select the optimal device based on the weight score and the randomness of the mutual exclusion probability. Weight Priority = (exp(-1*CPUUsePercent)+exp(-1*MemUsePercent)+RttScore+exp(-1*LossRate)) / 4. If the reason for the recent (within 180s, configurable) shrinkage is due to device abnormality, then Score = max(0, Score-0.5), where 0.5 is the penalty coefficient, which is configurable and defaults to 0.5. This will reduce the probability of this scheduling, in order to prevent abnormal devices from being repeatedly scheduled for expansion.

[0131] Similarly, the larger the weight, the smaller the current overall load; the smaller the weight, the larger the current overall load. For multiple idle devices, calculate the corresponding weight Priority, and perform mutually exclusive probability randomness based on the probability set. The larger the weight, the easier it is to select the device. Here is an explanation of why the best device is selected based on mutually exclusive probability: the current devices are all idle devices, and the current device load may be the basic load of the system. In order to increase a certain degree of randomness, mutually exclusive random probability random selection is adopted. For example, suppose some device information is as follows:

[0132] Device 5: CPU utilization 23%, memory utilization 21%, RTT 57ms, LossRate = 0.05, Score5 = (exp(-1*0.23)+exp(-1*0.21)+exp(-1*(57-45))+exp(-1*0.05)) / 4 = 0.639.

[0133] Device 6: CPU utilization 36%, memory utilization 31%, RTT 27ms, LossRate = 0.01, Score6 = (exp(-1*0.36)+exp(-1*0.31)+1+exp(-1*0.01)) / 4 = 0.855.

[0134] Device 7: CPU usage is 13%, memory usage is 37%, RTT is 17 ms, LossRate = 0, Score7 = (exp(-1*0.13)+exp(-1*0.37)+1+exp(-1*0)) / 4 = 0.892. Assuming that the device has experienced abnormal capacity reduction recently, Score7 = 0.892-0.5 = 0.392.

[0135] That is, device 5 participates in the mutually exclusive random selection with a weight of 0.639, device 6 with a weight of 0.855, and device 7 with a score of 0.392. The probability of device 6 being selected randomly is the highest, and the probability of device 7 being selected randomly is the lowest.

[0136] Optionally, in one embodiment of the present invention, the method calculates the packet loss rate by the following steps:

[0137] Determine the number of packets sent and received; if the number of packets received is greater than the number of packets sent, update the value of the number of packets sent to be equal to the value of the number of packets received;

[0138] Determine that the sum of the number of received packets and the fourth value is a first ratio; determine that the sum of the number of sent packets and the fifth value is a second ratio; the fifth value is greater than the fourth value;

[0139] The packet loss rate is determined according to the quotient of the first ratio and the second ratio.

[0140] Optionally, in one embodiment of the present invention, the method further comprises:

[0141] Determine that a device in the second device set whose CPU usage is greater than a fourth threshold is the second device; or determine that a device in the second device set whose memory usage is greater than a fifth threshold is the second device; update the status of the second task and the third task to waiting for scheduling; the second task is the task that was most recently scheduled to the second device and the second status is the task being scheduled; the third task is the task that was most recently scheduled to the second device and the second status is the task being executed;

[0142] Alternatively, if the second device is in an offline state, the state of each task in the first task set is updated to wait for scheduling; the first task set is all tasks scheduled to the second device.

[0143] In some possible implementations, the embodiments of the present application perform scaling down operations based on the utilization rate of the device. For devices with higher utilization rates, after scaling down, the tasks running on the device need to be reduced, so the most recently scheduled tasks can be removed.

[0144] Specifically, the possible reduction situations of the embodiments of the present application are as follows:

[0145] Case 1: The device is continuously overloaded: The CPU or memory of the device is continuously overloaded, that is, the performance of the device cannot support the execution of the currently assigned subtasks. Specifically, a specific threshold can be set to judge the overload. At the same time, a time attribute can be added. When the load lasts for a long time, the capacity reduction operation is performed to prevent misjudgment. It is understandable that the specific values ​​of time and threshold can be set according to actual needs, and this application does not impose specific restrictions. Reference Figure 7 The device status diagram shown in the figure changes the status of the most recently assigned subtask to unscheduled, changes the device status to shrinking or working, and notifies the device to immediately stop executing the most recently assigned task.

[0146] Case 2: The device cannot enter the working state due to abnormal environment. For example, when the device is in the state of expansion, it needs to prepare to download the parameters and necessary resources required for the execution of the subtask. If the network fluctuates or the terminal occurs, the device will be unable to enter the working state for a long time. This is easy to happen when the ship is sailing in bad sea conditions. Figure 8 As shown, the status is modified for different situations. Specifically, in this case, the status of the subtask that was last assigned is modified to unscheduled, the device status is modified to shrinking or working, and the device is notified to immediately stop executing the last assigned task.

[0147] Case 3: Device abnormality. That is, the device is abnormal due to bad sea conditions, long-term high-intensity use, or unknown factors, resulting in physical failure. If the heartbeat message reply of the device is not received for a long time, it can be determined that the device is abnormal. Change the status of all assigned subtasks to unscheduled, change the device status to offline, and notify the device to immediately stop all assigned tasks (do your best, the device may not receive it).

[0148] Case 4: Continuous network anomaly of the device: The RTT or packet loss rate of the device is extremely high, that is, the performance of the device cannot support the execution of the currently assigned subtask. Specifically, if the device is found to have an extremely high load of RTT>=100ms, or an extremely high load of packet loss rate LossRate>-20%, if the duration exceeds MaxDuration1 (this can be configured, the default is 60s), the device is considered to be in a high-load situation. Of course, the specific value can be set according to actual needs. Change the status of the most recently assigned subtask to unscheduled, change the device status to shrinking or working, and notify the device to immediately stop the execution of the most recently assigned task.

[0149] It should be noted that the capacity reduction process of the present invention does not need to consider the capacity reduction of low-load devices. This is because for low-load devices, the capacity expansion process will automatically schedule more subtasks, so the capacity reduction process does not need to be considered. The embodiment of the present application records the equipment capacity reduction status and modifies the status of the corresponding equipment and tasks. At the same time, the device ID and the reason for the reduction are recorded.

[0150] If the device executes multiple tasks at the same time, then after stopping the tasks, the device status is working; if only one subtask is executed, after stopping it, the device status is idle. It should be noted here that multiple subtasks may be running on a device at the same time. If the device is scaled down, the practice of the present invention is to stop the most recently scheduled task, and only stop one task at a time. For example, assume that device 1 is executing subtask 1 (scheduled for execution at 2023-03-12 09:02:34), subtask 2 (scheduled for execution at 2023-03-1210:02:34), and subtask 3 (scheduled for execution at 2023-03-12 08:02:34). Since subtask 2 was the most recently scheduled for execution, subtask 2 is stopped this time.

[0151] In summary, the scheduling server of the embodiment of the present application evaluates the real-time performance of the drilling equipment based on multiple dimensions, which not only includes the CPU and memory usage, but also introduces new angles such as RTT and packet loss rate to ensure the fairness of scheduling. The scheduling server of the embodiment of the present application dynamically expands and shrinks capacity based on multi-task scheduling, and supports a single device to schedule multiple tasks. The embodiment of the present application improves the expansion and shrinking process, adds an evaluation system for historical expansion and shrinking results, and ensures the balance of scheduling.

[0152] Secondly, refer to the attached Fig. 9 A capacity expansion and contraction control system based on multi-task scheduling proposed according to an embodiment of the present invention is described.

[0153] Fig. 9 1 is a schematic diagram of a capacity expansion and contraction control system based on multi-task scheduling according to an embodiment of the present invention. The system specifically includes:

[0154] The first module 910 is used to obtain first information of each device; the first information includes CPU usage, memory usage, round-trip delay and packet loss rate;

[0155] The second module 920 is used to determine the first state of each device; the first state includes working, idle, offline, expanding and shrinking;

[0156] The third module 930 is used to determine the second status of each task; the second status includes waiting for scheduling, scheduling, executing and completed;

[0157] The fourth module 940 is used to determine whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information if there is a first task whose second state is waiting for scheduling; if the capacity expansion operation is required for the first device, update the state of the first task and the state of the first device; the first device is used to indicate that the state is working or idle;

[0158] The fifth module 950 is used to, if there is a second device set whose first status is working, perform a scaling-down operation on the second device according to the scaling-down strategy, and update the status of the second device to shrinking; if there are tasks being scheduled or executed on the second device, after the second device completes the scaling-down operation, update the status of the second device to working; the second device set includes the second device, and the scaling-down strategy is used to characterize whether to perform a scaling-down operation on the second device based on the first information of the second device.

[0159] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0160] Reference Fig.10 The embodiment of the present invention provides a capacity expansion and contraction control device based on multi-task scheduling, comprising:

[0161] at least one processor 410;

[0162] At least one memory 420, used to store at least one program;

[0163] When the at least one program is executed by the at least one processor 410, the at least one processor 410 implements the scaling control method based on multi-task scheduling.

[0164] Similarly, the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0165] An embodiment of the present invention further provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to execute the above-mentioned expansion and contraction control method based on multi-task scheduling.

[0166] Similarly, the contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0167] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0168] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0169] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several programs to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0170] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable programs for implementing the logical functions, and may be embodied in any computer-readable medium for use by a program execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch and execute a program from a program execution system, device or apparatus), or in conjunction with such program execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by a program execution system, device or apparatus, or in conjunction with such program execution systems, devices or apparatuses.

[0171] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0172] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable program execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0173] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0174] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0175] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for controlling expansion and contraction based on multi-task scheduling, characterized in that: The method comprises the following steps: Acquire first information of each device; the first information includes CPU usage, memory usage, round-trip delay and packet loss rate; Determine a first state of each device; the first state includes working, idle, offline, expanding, and shrinking; Determine a second state of each task; the second state includes waiting for scheduling, scheduling, executing and completed; If there is a first task in the second state waiting for scheduling, determine whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information; if the capacity expansion operation needs to be performed on the first device, update the state of the first task and the state of the first device; the first device is used to represent a device in a working or idle state; Alternatively, if there is a second device set whose first status is working, the second device is scaled down according to the scaling-down strategy, and the status of the second device is updated to shrinking; if there are tasks being scheduled or executed on the second device, after the second device completes the scaling-down operation, the status of the second device is updated to working; the second device set includes the second device, and the scaling-down strategy is used to characterize whether to perform a scaling-down operation on the second device based on the first information of the second device.

2. The method for controlling capacity expansion and contraction based on multi-task scheduling according to claim 1, characterized in that: The determining whether to perform a capacity expansion operation on the device based on the capacity expansion strategy according to the first information includes: If the second state is that the total number of tasks being scheduled or executed is greater than the first threshold, the capacity expansion operation is not performed; Alternatively, if the second state is that the sum of the tasks being scheduled or executed is greater than a second threshold, randomly determine whether to perform a capacity expansion operation; wherein the first threshold is the maximum number of devices required to execute the first task, and the second threshold is the minimum number of devices required to execute the first task; Alternatively, if the second state is that the total number of tasks being scheduled or executed is less than or equal to the second threshold, it is determined to perform a capacity expansion operation.

3. The method for controlling capacity expansion and contraction based on multi-task scheduling according to claim 1, characterized in that: The method determines the first device through the following expansion strategy: According to the first information, filtering operations are performed on devices in a first device set to update the first device set; the first device set is used to represent a collection of devices in a working state; Determine, according to the first information, an updated weight of each device in the first device set; According to the weights, mutually exclusive random processing is performed on the devices in the first device set to determine the first device.

4. The method for controlling capacity expansion and contraction based on multi-task scheduling according to claim 3, characterized in that: The weight of each device includes a round trip delay weight, and the method determines the round trip delay weight by the following steps: Receive heartbeat information sent by the device at the current moment; the heartbeat information includes a device number and a serial number; the serial number increases according to the number of heartbeats; Determine the round-trip delay of the device based on the heartbeat information in the first time; If the round-trip delay is less than a third threshold, determining the round-trip delay weight to be 1; Alternatively, if the round-trip delay is greater than or equal to the third threshold, a round-trip delay weight is determined according to the third threshold and the round-trip delay.

5. The method for controlling expansion and contraction based on multi-task scheduling according to claim 4, characterized in that: The method further comprises: If the device continues to be highly loaded or works abnormally, the round-trip delay weight is updated; the updating of the round-trip delay weight comprises the following steps: Determine a difference between the round-trip delay weight and the penalty coefficient as a third value; If the third value is greater than zero, updating the round trip delay weight to the third value; If the third value is less than or equal to zero, the round trip delay weight is updated to zero.

6. The method for controlling expansion and contraction based on multi-task scheduling according to claim 1, characterized in that: The method calculates the packet loss rate by the following steps: Determine the number of packets sent and the number of packets received; if the number of packets received is greater than the number of packets sent, update the value of the number of packets sent to be equal to the value of the number of packets received; Determine that the sum of the number of received packets and a fourth value is a first ratio; determine that the sum of the number of sent packets and a fifth value is a second ratio; the fifth value is greater than the fourth value; The packet loss rate is determined according to a quotient of the first ratio and the second ratio.

7. The method for controlling expansion and contraction based on multi-task scheduling according to claim 1, characterized in that: The method further comprises: Determine that the device in the second device set whose CPU usage is greater than the fourth threshold is the second device; or determine that the device in the second device set whose memory usage is greater than the fifth threshold is the second device; update the status of the second task and the third task to waiting for scheduling; the second task is the task that was most recently scheduled to the second device and the second status is the task being scheduled; the third task is the task that was most recently scheduled to the second device and the second status is the task being executed; Alternatively, if the second device is in an offline state, the state of each task in the first task set is updated to wait for scheduling; the first task set is all tasks scheduled to the second device.

8. A capacity expansion and contraction control system based on multi-task scheduling, characterized in that: include: The first module is used to obtain first information of each device; the first information includes CPU usage, memory usage, round-trip delay and packet loss rate; The second module is used to determine the first state of each device; the first state includes working, idle, offline, expanding and shrinking; The third module is used to determine the second status of each task; the second status includes waiting for scheduling, scheduling, executing and completed; A fourth module is used to determine whether to perform capacity expansion operation on the device based on the capacity expansion strategy according to the first information if there is a first task in the second state waiting for scheduling; if the capacity expansion operation is required for the first device, update the state of the first task and the state of the first device; The first device is used to represent a device in a working or idle state; The fifth module is used to, if there is a second device set whose first status is working, perform a scaling-down operation on the second device according to the scaling-down strategy, and update the status of the second device to shrinking; if there are tasks being scheduled or executed on the second device, after the second device completes the scaling-down operation, update the status of the second device to working; the second device set includes the second device, and the scaling-down strategy is used to characterize whether to perform a scaling-down operation on the second device based on the first information of the second device.

9. A capacity expansion and contraction control device based on multi-task scheduling, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the scaling control method based on multi-task scheduling as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the expansion and contraction control method based on multi-task scheduling as described in any one of claims 1 to 7 when executed by the processor.