A server node priority scheduling method, system, device and storage medium
By calculating the average response time and task scheduling times of the server node, updating the real-time weight, and selecting the node with the smallest real-time weight for scheduling, the problem of unreasonable resource allocation in the distributed system is solved and the system performance is improved.
Patent Information
- Application Number
- CN202211038799.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2024-11-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In large distributed systems, changes in network and performance of server nodes lead to unreasonable resource allocation and scheduling, affecting the overall performance of the system.
By calculating the average response time of each server node in the target time period, calculating the initial weight, and updating the real-time weight based on the number of task scheduling times, selecting the node with the smallest real-time weight for scheduling.
More reasonable server node scheduling is achieved, system performance is improved, and the task scheduling is ensured that the node with the best performance is selected for task scheduling in each time period.
Smart Images

Figure CN115484262B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to server scheduling, and in particular to a method, system, device and storage medium for priority scheduling of server nodes. Background Art
[0002] As the number of service modules in large-scale distributed systems increases, the network and performance of each distributed server node will change at different times after operation. In this distributed service environment, more reasonable resource allocation and scheduling are needed to maximize the overall performance of the system. Summary of the invention
[0003] Additional aspects and advantages of the present invention will be given in part in the following description, and in part will become apparent from the following description, or learned through the practice of the present invention. The present invention provides a method, system, device and storage medium for prioritizing scheduling of server nodes, which can reasonably select server nodes for scheduling and maximize the performance of the system.
[0004] A first aspect of the present invention provides a method for prioritizing scheduling of server nodes, the method comprising:
[0005] Obtaining the average response time of each server node in the server cluster that has completed task scheduling within a target time period; wherein the target time period is a time period within the current time period, or a time period within a historical time period before the current time period, or a time period that is continuous in time between the historical time period and the current time period;
[0006] Calculate the initial weight of each of the server nodes in the current time period according to the average response time of each of the server nodes in the target time period, the minimum average response time among all the average response times, and the maximum average response time among all the average response times;
[0007] Calculate the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task scheduling completed by each server node in the current time period;
[0008] A server node having the smallest real-time weight at the current moment is selected from the server cluster for scheduling.
[0009] The server node priority scheduling method provided in the first aspect of the present invention has at least the following beneficial effects:
[0010] This method first calculates the average response time of the server node for task scheduling within a period of time; then uses the average response time, the maximum average response time and the minimum average response time to calculate the initial weight of the server node in the current time period. The initial weight calculated using these three parameters comprehensively considers the average response time of the server cluster, making the calculated initial weight more reasonable and providing a basis for the subsequent calculation and comparison of real-time weights; then uses the initial weight and the number of task schedulings completed by the server node in the current time period to update the real-time weight of the server node in real time, and selects the server node with the smallest real-time weight to perform the task, which is conducive to more reasonable scheduling of the server nodes.
[0011] According to some embodiments of the present invention, obtaining the average response time of each server node in the server cluster that has completed task scheduling within the target time period includes:
[0012] Collecting the response time of each task scheduling completed by each server node within the target time period, and forming a response time set according to each response time;
[0013] According to the response time set, the average response time of each server node is calculated by the following formula:
[0014]
[0015] Wherein, AT represents the average response time of the server node, X t represents the response time of the server node completing the tth task scheduling, and n represents the number of task scheduling times that the server node has completed within the target time period.
[0016] According to some embodiments of the present invention, the average response time of each server node is also calculated by the following formula:
[0017] AT=K,(n=0)
[0018] Among them, K is a constant.
[0019] According to some embodiments of the present invention, calculating the initial weight of each of the server nodes in the current time period according to the average response time of each of the server nodes in the target time period, the minimum average response time among all the average response times, and the maximum average response time among all the average response times includes:
[0020] Calculate a first difference between the average response time of the server node and the minimum average response time among all average response times;
[0021] calculating a second difference between a maximum average response time among all the average response times and a minimum average response time among all the average response times;
[0022] A ratio of the first difference to the second difference is calculated, and the ratio is used as an initial weight of the server node.
[0023] According to some embodiments of the present invention, calculating the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task scheduling completed by each server node in the current time period includes:
[0024] When the number of task scheduling completed by the server node in the current time period is less than one, the real-time weight of the server node at the current moment is calculated to be equal to the initial weight of the server node;
[0025] When the number of task scheduling completed by the server node in the current time period is greater than one, the real-time weight of the server node after completing the first task scheduling in the current time period is set equal to the initial weight of the server node, and the real-time weight of the server node at the current moment is calculated by the following formula:
[0026]
[0027]
[0028] Wherein, AT(i) represents the average response time of the i-th server node, AvgAT represents the average response time of all the server nodes in the server cluster, m represents the number of all the server nodes in the server cluster; a is a preset value and different AvgATs correspond to different a values, W(i) j represents the real-time weight of the i-th server node after completing the j-th task scheduling within the current time period, W(i) j-1 It represents the real-time weight of the i-th server node after completing the j-1-th task scheduling within the current time period, where j is an integer greater than or equal to 2.
[0029] According to some embodiments of the present invention, the value of a includes: when AvgAT is a k-bit number, a=10 k-1 .
[0030] According to some embodiments of the present invention, the priority scheduling method of the server node further includes:
[0031] When the scheduling of the server cluster in the current time period is completed and the next time period is entered, the initial weight of each of the server nodes in the server cluster is initialized.
[0032] A second aspect of the present invention provides a priority scheduling system for a server node, the priority scheduling system for a server node comprising:
[0033] A response time acquisition unit, used to acquire the average response time of each server node in the server cluster that has completed task scheduling within a target time period; wherein the target time period is a time period within the current time period, or a time period within a historical time period before the current time period, or a time period that is continuous in time between the historical time period and the current time period;
[0034] an initial weight calculation unit, configured to calculate an initial weight of each of the server nodes in the current time period according to an average response time of each of the server nodes in the target time period, a minimum average response time among all the average response times, and a maximum average response time among all the average response times;
[0035] A real-time weight calculation unit, used to calculate the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task scheduling completed by each server node in the current time period;
[0036] The priority scheduling unit is used to select the server node with the smallest real-time weight at the current moment from the server cluster for scheduling.
[0037] The third aspect of the present invention provides an electronic device, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute a priority scheduling method for a server node as described above.
[0038] A fourth aspect of the present invention provides a computer-readable storage medium, characterized in that: the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a priority scheduling method for a server node as described above.
[0039] It can be understood that the beneficial effects of the second to fourth aspects compared with the related art are the same as the beneficial effects of the first aspect compared with the related art. Please refer to the relevant description in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0041] Figure 1 It is a flow chart of a method for priority scheduling of server nodes provided by one embodiment of the present invention;
[0042] Figure 2 yes Figure 1 Schematic diagram of the process of step S101;
[0043] Figure 3 yes Figure 1 Schematic diagram of the process of step S102;
[0044] Figure 4 yes Figure 1 Schematic diagram of the process of step S103;
[0045] Figure 5 It is a structural diagram of a priority scheduling system for server nodes provided by one embodiment of the present invention;
[0046] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] Embodiments of the present invention are described in detail below, examples of which 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 cannot be understood as limiting the present invention.
[0048] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0050] Reference Figure 1An embodiment of the present invention provides a method for prioritizing scheduling of server nodes. As an example, the method for prioritizing scheduling of server nodes is applied to a server cluster. It should be noted that in this embodiment, each server node in the server cluster is assumed to be available by default. Specifically, the method includes the following steps S101 to S104:
[0051] Step S101: Obtain the average response time of each server node in the server cluster that has completed task scheduling within a target time period.
[0052] The purpose of this method embodiment is to make the server cluster always select the most reasonable server node for scheduling in each task scheduling within the current time period. This embodiment uses "minimum weight" as the basis for selecting the server node for scheduling.
[0053] In order to calculate the real-time weight of the server node at the current moment in the current time period (the real-time weight of the server node is continuously updated with the number of task scheduling completions, which will be introduced later), in step S101 of this embodiment, the average response time of the server node to complete task scheduling in a time period is first obtained, and the average response time calculated in the time period is used as a factor for calculating the initial weight of the server node in the current time period. The initial weight is used as a factor for calculating the real-time weight of the server node at the current moment. Because the length of the average response time comprehensively reflects a series of comprehensive performances of the server node such as the network, CPU, I\0, etc. in a period of time, this embodiment uses the average response time of each server node to complete task scheduling in a time period as an important factor for selecting the server node scheduling at the current moment.
[0054] It is worth mentioning that the relationship between the target time period, the current time period and the current moment is briefly listed here:
[0055] For example: T(i) is the current time period (the i-th time period). The current moment occurs within the time period T(i); T(i-1), T(i-2)... are historical time periods, T(i-1) is the i-1th time period, and T(i-1) and T(i) are continuous in time. The target time period is the time period used to calculate the initial weight of the time period T(i) (that is, the time period used to calculate the average response time of the node. Only after the average response time is obtained can the initial weight of T(i) be further calculated). The target time period includes the following three situations:
[0056] The first case: the target time period is a period of time in the historical time period, such as a period of time in the time period T(i-1). The server node also performs task scheduling in the time period T(i-1). The average response time of each server node in a period of time in the time period T(i-1) can be calculated.
[0057] The second case: the target time period is a period of time in the current time period T(i), for example, the current time period is 100 seconds, the target time period is the first 10 seconds of the current time period, and the current time is any time in the last 90 seconds of the time period T(i);
[0058] The third case: the target time period is a period of time between the historical time period and the current time period, such as: a time period is 100 seconds, and the target time period includes 100 seconds in the time period T(i-1) and 10 seconds in the current time period T(i).
[0059] It should be noted that the subsequent embodiments preferably use the first case as the target time period, such as when transitioning from time period T(i-1) to time period T(i), the average response time of the server node for task scheduling within a period of time in time period T(i-1) is calculated. In this way, when time period T(i) just begins, an initial weight corresponding to a server node can be obtained (each server node in the current time period has only one initial weight), and the obtained initial weight can fully reflect the comprehensive performance of the server node in the previous time period, such as network, CPU, I\0, etc.
[0060] Reference Figure 2 In some embodiments, obtaining the average response time of each server node in the server cluster that has completed task scheduling within the target time period in step S101 includes the following steps S1011 and S1012:
[0061] Step S1011: collect the response time of each task scheduling completed by each server node within the target time period, and form a response time set according to each response time. For example: server node A completes n task scheduling within the target time period, and the response time set {X1, X2, X3, ..., X4, ..., X5, ..., X6, ..., X7, ..., X8, ..., X9, ..., X10, ..., X11, ..., X21, ..., X3, ..., X9, ..., X10, ..., X11, ..., X21, ..., X3, ..., X4, ..., X9, ..., X10, ..., X11, ..., X21, ..., X3 ... n}.
[0062] Step S1012: Calculate the average response time of each server node according to the response time set using the following formula:
[0063]
[0064] Among them, AT represents the average response time of the server node, X t It indicates the response time of the server node to complete the tth task scheduling, and n indicates the number of task schedulings completed by the server node within the target time period. K is a constant. If there is no task call on server node A within the target time period, a constant K is assigned to the AT of server node A. It should be noted that the value of the constant K can be set manually and is not specifically limited here.
[0065] Step S102: Calculate the initial weight of each server node in the current time period according to the average response time of each server node in the target time period, the minimum average response time among all average response times, and the maximum average response time among all average response times.
[0066] Step S102 is to assign an initial weight to each server node in the current time period, and the initial weight is used as a factor for calculating the real-time weight of each server node at the current moment in step S103. Figure 3 In some embodiments, step S102 specifically includes the following steps S1021 to S1023:
[0067] Step S1021: Calculate a first difference between the average response time of the server node and the minimum average response time among all average response times.
[0068] Step S1022: Calculate a second difference between the maximum average response time among all the average response times and the minimum average response time among all the average response times.
[0069] Step S1023: Calculate the ratio of the first difference to the second difference, and use the ratio as the initial weight of the server node.
[0070] In steps S1021 to S1023 of this embodiment, the initial weight of a server node is calculated based on the average response time of a server node, the maximum average response time (maximum average response time) and the minimum average response time (minimum average response time). The initial weight calculated using these three parameters comprehensively considers the average response time of the server cluster. At this time, the smaller the average response time, the smaller the initial weight of the server node. When the initial weight is reset regularly in each time period, the server node with the best performance will be scheduled first. For example, if three time periods are set, the initial weight of each server node will be reset at the end of the first time period and enter the second time period, and when the initial weight of the second time period is set, the server node with the best performance will also be scheduled first; the same applies from the second time period to the third time period. Moreover, when the average response time of two server nodes is not much different, the calculated initial weight value will also be very small. When the average response time is greatly different, the initial weight will also be greatly different. This provides a basis for the calculation and comparison of the real-time weight in the subsequent step S103.
[0071] Step S103: Calculate the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task scheduling completed by each server node in the current time period.
[0072] Reference Figure 4 In some embodiments, step S103 specifically includes the following steps S1031 and S1032:
[0073] Step S1031: When the number of task scheduling completed by the server node in the current time period is less than one, the real-time weight of the server node at the current moment is calculated to be equal to the initial weight of the server node.
[0074] Step S1032: When the number of task schedulings completed by the server node in the current time period is greater than one, the real-time weight of the server node after completing the first task scheduling in the current time period is set equal to the initial weight of the server node, and the real-time weight of the server node at the current moment is calculated by the following formula:
[0075]
[0076]
[0077] Where AT(i) represents the average response time of the i-th server node, AvgAT represents the average response time of all server nodes in the server cluster, m represents the number of all server nodes in the server cluster; a is a pre-set value and different AvgATs correspond to different a values. W(i) j represents the real-time weight of the i-th server node after completing the j-th task scheduling in the current time period, W(i) j-1 It represents the real-time weight of the i-th server node after completing the j-1-th task scheduling in the current time period, where j is an integer greater than or equal to 2.
[0078] According to the above step S1031, assuming that server node A is scheduling a task for the first time in the current time period, the real-time weight of the server node is equal to the initial weight of the server node; otherwise, according to the formula of the above step S1032, the real-time weight of the current task scheduling of server node A is the real-time weight of the previous task scheduling and sum.
[0079] This embodiment adopts As a constant value for iteration (iterating according to the number of completions of the task schedule), compared to a constant, It is calculated in each time period based on the actual task scheduling. In different time periods, the response time is different. will be different, which is conducive to reasonable scheduling within the current time period.
[0080] In some embodiments, the value of a includes: when AvgAT is a k-bit number, a=10 k-1 Since the response time is different in different time periods, In this embodiment, the value of a varies with AvgAT, which is more conducive to reasonable scheduling in the current time period.
[0081] For example, there are server nodes A, B, and C. The average response time of server nodes A, B, and C in a target time period is 10ms, 20ms, and 30ms respectively. Then we can know that the initial weights of server nodes A, B, and C in the current time period are 0, 1 / 2, and 1 respectively; then At this time, when A is scheduled by the task for the first time, the real-time weight of A is W=0+1 / 2=1 / 2, and the real-time weights of A, B, and C are 1 / 2, 1 / 2, and 1. By analogy, it can be found that the embodiment of the method makes good use of the response time of the server node for scheduling, and the scheduling is more reasonable.
[0082] Step S104: Select a server node with the smallest real-time weight at the current moment from the server cluster for scheduling. In step S104, when it is necessary to select a node for scheduling in the server cluster, select the server node with the smallest real-time weight for scheduling.
[0083] An embodiment of the present invention provides a method for prioritizing scheduling of server nodes. The method for prioritizing scheduling of server nodes includes the following steps S201 to S206:
[0084] Step S201: In the server cluster, the response time of each server node within the T(i) time period is recorded. Each time a task is scheduled, the response time t of each server node to complete the task scheduling is recorded by a timer. Where T(i) represents the i-th time period.
[0085] Step S202: Calculate the average response time AT of each server node within the T(i) time period. For a certain server node, the timer first collects the scheduling time set of the server node completing n task scheduling within a time period T: {X1, X2, X3, ..., X n}. And calculate the average response time AT of the server node; if the server node has no call within the T(i) time period, assign a constant K to the AT of the server node.
[0086]
[0087] Step S203: Calculate and obtain the initial weight CW of each server node within the time period T(i). According to the calculated average response time AT, use the quasi-extreme line mode algorithm to calculate the initial weight CW of each server point within the time period T. The calculation formula of the initial weight CW includes:
[0088]
[0089] Among them, CW represents the initial weight of the server node, AT represents the average response time of the server node, MinAT represents the minimum average response time, and MaxAT represents the maximum average response time.
[0090] In step S203 of this embodiment, the calculation formula of the initial weight CW is used, which has the following advantages:
[0091] (1) The length of the average response time comprehensively reflects the comprehensive performance of the server node in terms of network, CPU, I / O, etc. within a period of time. The stronger the performance of the server node within this period of time, the shorter the average response time, and the smaller the initial weight of the server node.
[0092] (2) The calculated CW comprehensively considers the average response time of a group of server nodes. The smaller the average response time, the smaller the CW of the server node. In this way, when the CW is reset regularly in each time period, the server node with the best performance will be scheduled first;
[0093] (3) When the average response time of the two server nodes is not much different, the calculated initial weight CW will also be very different. When the average response time is greatly different, CW will also be greatly different. This provides a basis for the calculation and comparison of the real-time weight W in the subsequent step S204.
[0094] Step S204: Calculate and obtain the real-time weight W of each server node within the time period T(i). If a server node is scheduled for the first time within this time period, W=CW; otherwise, the formula of the real-time weight W is:
[0095] W = W + (1 / average response time of all nodes AvgAT) * a (a is a dynamic number obtained according to AvgAT. When AvgAT is a single digit, a is 1; when AvgAT is a double digit, a is 10; when AvgAT is a triple digit, a is 100, and so on); that is:
[0096]
[0097] Among them, W j-1 represents the real-time weight of a server node after completing the j-1th task scheduling; W j Similarly, AvgAT is calculated as follows, where m is the number of server nodes in the time period:
[0098]
[0099] Compared to using a constant, It is calculated based on the actual task scheduling in each time period. In different time periods, the response time is different. It will be different, which is more conducive to reasonable scheduling within this time period.
[0100] Assume that the average response time of server nodes A, B, and C in a time period is 10ms, 20ms, and 30ms respectively. Then we can know that the initial weights CW of A, B, and C are 0, 1 / 2, and 1 respectively. 1 / 2, when A is scheduled for the first time, its real-time weight is W=0+1 / 2=1 / 2, and the real-time weights of A, B, and C are 1 / 2, 1 / 2, and 1. Similarly, it can be found that this method makes good use of the response time of the server node for scheduling.
[0101] Step S205: Each time a task is scheduled, the server node with the smallest real-time weight W is selected for scheduling. During scheduling, step S201 is performed to record the response time t of the scheduling completion. After the scheduling is completed, the real-time weight W is reset using the formula of step S204.
[0102] Step S206: When a time period T(i) ends, the timer restarts to perform steps S202 and S203 to recalculate the initial weight CW of a new time period T(i+1).
[0103] This method first calculates the average response time of the server node for task scheduling within a period of time; then uses the average response time, the maximum average response time and the minimum average response time to calculate the initial weight of the server node in the current time period. The initial weight calculated using these three parameters comprehensively considers the average response time of the server cluster, making the calculated initial weight more reasonable and providing a basis for the subsequent calculation and comparison of real-time weights; then uses the initial weight and the number of task schedulings completed by the server node in the current time period to update the real-time weight of the server node in real time, and selects the server node with the smallest real-time weight to perform the task, which is conducive to more reasonable scheduling of the server nodes.
[0104] Reference Figure 5 One embodiment of the present invention provides a priority scheduling system for server nodes. The priority scheduling system for server nodes includes a response time acquisition unit, an initial weight calculation unit, a real-time weight calculation unit and a priority scheduling unit, wherein:
[0105] The response time acquisition unit 1001 is used to acquire the average response time of each server node in the server cluster to complete task scheduling within the current time period; wherein the current time period is a time period before the current moment and continuous with the current moment in time.
[0106] The initial weight calculation unit 1002 is used to calculate the initial weight of each server node according to the average response time of each server node, the minimum average response time among all average response times, and the maximum average response time among all average response times.
[0107] The real-time weight calculation unit 1003 is used to calculate the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task scheduling of each server node in the current time period.
[0108] The priority scheduling unit 1004 is used to select a server node with the smallest real-time weight from the server cluster for scheduling.
[0109] It should be noted that the present system embodiment and the above method embodiment are based on the same inventive concept, so the relevant contents of the above embodiment are also applicable to the present system embodiment and will not be repeated here.
[0110] Reference Figure 6 The embodiment of the present application further provides an electronic device, the electronic device comprising:
[0111] at least one memory;
[0112] at least one processor;
[0113] at least one program;
[0114] The program is stored in the memory, and the processor executes at least one program to implement the priority scheduling method of the server node implemented in the present disclosure.
[0115] The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.
[0116] The electronic device of the embodiment of the present application is used to execute the priority scheduling method of the above-mentioned server nodes, and utilizes the idea of isolating and forwarding control flows through in-band channels. According to the task requirements of multiple perception tasks, a number of perception nodes are selected from multiple perception nodes as control nodes as needed, and the selected control nodes are connected to build a control network to specifically forward control flows, thereby building a highly reliable in-band control network, solving the transmission conflict problem between control flows and data flows, and greatly improving the timeliness and reliability of control flow transmission in the perception layer.
[0117] Electronic equipment includes:
[0118] The processor 1600 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure;
[0119] The memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1700 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1700, and the processor 1600 calls and executes the priority scheduling method of the server node in the embodiment of the present disclosure.
[0120] Input / output interface 1800, used to implement information input and output;
[0121] The communication interface 1900 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0122] Bus 2000 , which transmits information between various components of the device (e.g., processor 1600 , memory 1700 , input / output interface 1800 , and communication interface 1900 );
[0123] The processor 1600 , the memory 1700 , the input / output interface 1800 , and the communication interface 1900 are connected to each other in communication within the device via the bus 2000 .
[0124] The embodiment of the present disclosure further provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned priority scheduling method for server nodes.
[0125] The storage medium of the embodiment of the present application is used to execute the priority scheduling method of the above-mentioned server nodes, and utilizes the idea of isolating the forwarding control flow through the in-band channel. According to the task requirements of multiple perception tasks, a number of perception nodes are selected from multiple perception nodes as control nodes as needed, and the selected control nodes are connected to build a control network to specifically forward the control flow, thereby building a highly reliable in-band control network, solving the transmission conflict problem between the control flow and the data flow, and greatly improving the timeliness and reliability of the control flow transmission in the perception layer.
[0126] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0127] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0128] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present disclosure and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0129] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store programs.
[0134] The above is a specific description of the preferred implementation of the embodiments of the present application, but the embodiments of the present application are not limited to the above-mentioned implementation methods. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the embodiments of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the embodiments of the present application.
Claims
1. A priority scheduling method for server nodes, It is characterized in that The priority scheduling method of the server node includes: Obtaining the average response time of each server node in the server cluster that has completed task scheduling within a target time period; wherein the target time period is a time period within a current time period, or a time period within a historical time period before the current time period, or a time period that is continuous in time between the historical time period and the current time period; Calculating the initial weight of each server node in the current time period according to the average response time of each server node in the target time period, the minimum average response time among all average response times, and the maximum average response time among all average response times; Calculating the initial weight of each server node in the current time period according to the average response time of each server node in the target time period, the minimum average response time among all average response times, and the maximum average response time among all average response times, comprises: Calculate a first difference between the average response time of the server node and the minimum average response time among all average response times; calculating a second difference between a maximum average response time among all the average response times and a minimum average response time among all the average response times; Calculating a ratio of the first difference to the second difference, and using the ratio as an initial weight of the server node; Calculating the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task schedulings completed by each server node in the current time period; Calculating the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task schedulings completed by each server node in the current time period comprises: When the number of task scheduling completed by the server node in the current time period is less than one, the real-time weight of the server node at the current moment is calculated to be equal to the initial weight of the server node; When the number of task scheduling completed by the server node in the current time period is greater than one, the real-time weight of the server node after completing the first task scheduling in the current time period is set equal to the initial weight of the server node, and the real-time weight of the server node at the current moment is calculated by the following formula: in, Indicates The average response time of the server nodes, represents the average response time of all the server nodes in the server cluster, Indicates the number of all the server nodes in the server cluster; is a preset value and different Corresponding to different settings value, Indicates The server node completes the The real-time weight after task scheduling, Indicates The server node completes the The real-time weight after task scheduling, is an integer and Greater than or equal to 2; A server node having the smallest real-time weight at the current moment is selected from the server cluster for scheduling.
2. The method for prioritizing scheduling of server nodes according to claim 1, It is characterized in that The step of obtaining the average response time of each server node in the server cluster that has completed task scheduling within the target time period includes: Collecting the response time of each task scheduling completed by each server node within the target time period, and forming a response time set according to each response time; According to the response time set, the average response time of each server node is calculated by the following formula: in, represents the average response time of the server node, Indicates that the server node completes the The response time of the task scheduling, Indicates the number of task schedulings that the server node has completed within the target time period.
3. The method for prioritizing scheduling of server nodes according to claim 2, It is characterized in that The average response time of each server node is also calculated by the following formula: in, Is a constant.
4. The method for prioritizing scheduling of server nodes according to claim 1, It is characterized in that The values of include: for When the number of digits is .
5. The method for prioritizing scheduling of server nodes according to claim 1, It is characterized in that The priority scheduling method of the server node also includes: When the scheduling of the server cluster in the current time period is completed and the next time period is entered, the initial weight of each of the server nodes in the server cluster is initialized.
6. A priority scheduling system for server nodes, It is characterized in that The priority scheduling system of the server node includes: A response time acquisition unit, used to acquire the average response time of each server node in the server cluster that has completed task scheduling within a target time period; wherein the target time period is a time period within the current time period, or a time period within a historical time period before the current time period, or a time period that is continuous in time between the historical time period and the current time period; The initial weight calculation unit is used to calculate the initial weight of each server node in the current time period according to the average response time of each server node in the target time period, the minimum average response time among all the average response times, and the maximum average response time among all the average response times; the calculation of the initial weight of each server node in the current time period according to the average response time of each server node in the target time period, the minimum average response time among all the average response times, and the maximum average response time among all the average response times includes: Calculate a first difference between the average response time of the server node and the minimum average response time among all average response times; calculating a second difference between a maximum average response time among all the average response times and a minimum average response time among all the average response times; Calculating a ratio of the first difference to the second difference, and using the ratio as an initial weight of the server node; A real-time weight calculation unit is used to calculate the real-time weight of each server node at the current moment according to the initial weight of each server node and the number of task schedulings completed by each server node in the current time period; the real-time weight of each server node at the current moment is calculated according to the initial weight of each server node and the number of task schedulings completed by each server node in the current time period, including: When the number of task scheduling completed by the server node in the current time period is less than one, the real-time weight of the server node at the current moment is calculated to be equal to the initial weight of the server node; When the number of task scheduling completed by the server node in the current time period is greater than one, the real-time weight of the server node after completing the first task scheduling in the current time period is set equal to the initial weight of the server node, and the real-time weight of the server node at the current moment is calculated by the following formula: in, Indicates The average response time of the server nodes, represents the average response time of all the server nodes in the server cluster, Indicates the number of all the server nodes in the server cluster; is a preset value and different Corresponding to different settings value, Indicates The server node completes the The real-time weight after task scheduling, Indicates The server node completes the The real-time weight after task scheduling, is an integer and Greater than or equal to 2; The priority scheduling unit is used to select the server node with the smallest real-time weight at the current moment from the server cluster for scheduling.
7. An electronic device, Features: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the priority scheduling method for the server node as described in any one of claims 1 to 5.
8. A computer-readable storage medium, Features: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the priority scheduling method for server nodes as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Low-power job schedule calculating method
CN101539800A
Task scheduling method and device, storage medium and electronic device
CN111026546A
Service request processing method and system, readable storage medium and computer equipment
CN114338815A
Temporal task scheduling in a hybrid system
US20180136976A1
Scheduling method and apparatus, electronic device, and storage medium
WO2021093248A1
