CN115379019A - Service scheduling method, device, equipment and storage medium - Google Patents

Service scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN115379019A
CN115379019A CN202211000224.3A CN202211000224A CN115379019A CN 115379019 A CN115379019 A CN 115379019A CN 202211000224 A CN202211000224 A CN 202211000224A CN 115379019 A CN115379019 A CN 115379019A
Authority
CN
China
Prior art keywords
node
resource
sub
nodes
target node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211000224.3A
Other languages
Chinese (zh)
Other versions
CN115379019B (en
Inventor
周文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202211000224.3A priority Critical patent/CN115379019B/en
Publication of CN115379019A publication Critical patent/CN115379019A/en
Application granted granted Critical
Publication of CN115379019B publication Critical patent/CN115379019B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a service scheduling method, a device, equipment and a storage medium, which relate to the technical field of computers and comprise the following steps: receiving a trap message which is sent by each node and contains the self resource information collected by the node; summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all nodes are over-occupation states or not; if not, determining that the resource occupation state is the first target node with the over-high occupation state, and scheduling the service operated in the first target node to a second target node with the non-over-high occupation state. According to the method and the device, the trap messages sent by the nodes are received, namely, the nodes report the resource information in the trap message mode, so that resource monitoring is conveniently carried out on all nodes in the distributed cluster, the service operated in the first target node with the excessively high resource occupation is dispatched to the second target node with the non-excessively high resource occupation, and therefore the intelligentization of service dispatching management of the distributed cluster is improved.

Description

Service scheduling method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service scheduling method, apparatus, device, and storage medium.
Background
Currently, the application of distributed clusters is becoming more and more popular based on the requirements on system reliability, high concurrency and the like. In a multi-node distributed cluster, the resource states of various nodes are different, and when a new request comes, which node is selected to execute needs to be responsible for a special scheduling service, which is indispensable to any cluster. Therefore, how to schedule services becomes an increasingly important issue.
To achieve a reasonable scheduling service, first, the resource usage of each node, for example, the resources such as a Central Processing Unit (CPU), a Memory (MEM), a hard disk, and a bandwidth of each node need to be monitored, which is the basis for performing service scheduling, otherwise, if the resource of a node is allocated with a new request under the condition of too high occupancy, a request failure may be caused, and even a shutdown may be caused to the whole cluster; secondly, a reasonable scheduling method is needed, each new request is guaranteed to be executed on the node with the most abundant resources, quick response of the request is guaranteed, and load balance of the cluster is achieved. However, in the existing mature distributed cluster architecture, the elements for resource monitoring are integrated, but the disadvantages are also obvious, and firstly, the monitored contents are more focused on services rather than nodes; secondly, the expansibility is not strong, only the specified fixed index can be monitored, and the customized monitoring is almost impossible.
Disclosure of Invention
In view of this, the present invention provides a service scheduling method, apparatus, device and storage medium, which can improve the intelligence of service scheduling management of a distributed cluster. The specific scheme is as follows:
in a first aspect, the present application discloses a service scheduling method, including:
receiving a trap message sent by each node, wherein the trap message comprises own resource information collected by the node;
summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are overhigh occupation states;
if not, determining the first target node with the resource occupation state being the over-high occupation state, and scheduling the service operated in the first target node to a second target node with the resource occupation state being the non-over-high occupation state.
Optionally, before receiving the trap message sent by each node, the method further includes:
encrypting the trap message by using a preset encryption algorithm to obtain an encrypted trap message;
correspondingly, the receiving the trap message sent by each node includes:
and receiving the encrypted trap message sent by each node.
Optionally, the encrypting the trap message by using a preset encryption algorithm to obtain an encrypted trap message includes:
and encrypting the group name and the protocol data unit in the preset message format corresponding to the trap message by using a preset encryption algorithm to obtain the encrypted trap message.
Optionally, before scheduling the service running in the first target node to the second target node whose resource occupation state is not too high, the method further includes:
sequencing the nodes according to the available resource conditions of the sub-resource indexes corresponding to the nodes to obtain node sequencing results corresponding to the sub-resource indexes;
selecting a third target node corresponding to each sub-resource index at a preset sorting position according to the node sorting result;
judging whether the same node exists in the third target node corresponding to each sub-resource index;
if the same node exists in the third target nodes corresponding to the sub-resource indexes, determining the same node from the third target nodes corresponding to the sub-resource indexes, and determining the same node as a second target node of which the resource occupation state is not an overhigh state.
Optionally, after determining whether the same node exists in the third target node corresponding to each sub-resource indicator, the method further includes:
if the same node does not exist in the third target node corresponding to each sub-resource index, performing weighted operation on each sub-resource index corresponding to each node to obtain a calculation result corresponding to each node;
and determining the node corresponding to the calculation result with the highest numerical value as a second target node of which the resource occupation state is not in an overhigh state.
Optionally, the performing a weighted operation on each sub-resource indicator corresponding to each node to obtain a calculation result corresponding to each node includes:
determining a request type corresponding to a scheduling request, and determining the dependence degree of the request type on each sub-resource index; the scheduling request is a corresponding request for scheduling the service operated in the first target node to a second target node of which the resource occupation state is not too high;
determining a weighted value corresponding to each sub-resource index of each node based on the dependency degree;
determining the actual value of each sub-resource index corresponding to each node based on the total number of the nodes corresponding to each sub-resource index and the node sequencing result;
and carrying out weighting operation on the actual value of each sub-resource index by using the weighting value to obtain a calculation result corresponding to each node.
Optionally, after the collecting and analyzing the resource information in the trap message to determine whether the resource occupation states of all the nodes are the over-occupied state, the method further includes:
and if the resource occupation states of all the nodes are the over-occupation state, judging that the current cluster service volume is too large, and generating alarm information for prompting the capacity expansion of the current cluster.
In a second aspect, the present application discloses a service scheduling apparatus, including:
a message receiving module, configured to receive a trap message sent by each node, where the trap message includes resource information of the node itself collected by the node;
the information analysis module is used for summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are over-occupation states or not;
and the service scheduling module is used for determining a first target node with the resource occupation state being the over-occupied state when the resource occupation states of all the nodes are not in the over-occupied state, and scheduling the service operated in the first target node to a second target node with the resource occupation state being not in the over-occupied state.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the service scheduling method disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program realizes the steps of the service scheduling method disclosed in the foregoing when being executed by a processor.
As can be seen, the present application provides a service scheduling method, including: receiving a trap message sent by each node, wherein the trap message contains own resource information collected by the node; summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are over-occupation states or not; if not, determining the first target node with the resource occupation state being the over-high occupation state, and scheduling the service operated in the first target node to a second target node with the resource occupation state being the non-over-high occupation state. Therefore, the service scheduling method and the system receive the trap message sent by each node, namely, the resource information is reported in the trap message mode, so that resource monitoring is more conveniently carried out on all nodes in the distributed cluster, whether the resource occupation of all the nodes is too high is further judged, if part of the first target nodes are too high in resource occupation, the service running in the first target nodes with the too high resource occupation is scheduled to the second target nodes with the not too high resource occupation, and therefore the intelligence of service scheduling management of the distributed cluster is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a service scheduling method disclosed herein;
FIG. 2 is a schematic diagram of a specific distributed cluster networking disclosed herein;
FIG. 3 is a schematic diagram of message encryption disclosed herein;
fig. 4 is a schematic diagram illustrating resource information reporting disclosed in the present application;
fig. 5 is a schematic diagram illustrating a node resource occupation status determination disclosed in the present application;
FIG. 6 is a flow chart of a specific service scheduling method disclosed herein;
FIG. 7 is a schematic diagram of a resource split and node ordering disclosed herein;
FIG. 8 is a schematic diagram of a sub-resource indicator expansion disclosed in the present application;
FIG. 9 is a flowchart of a specific service scheduling method disclosed herein;
fig. 10 is a schematic structural diagram of a service scheduling apparatus disclosed in the present application;
fig. 11 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, in the prior art, resource monitoring elements are integrated in existing mature distributed cluster architectures, but the disadvantages are also obvious, and firstly, monitored contents are more focused on services rather than nodes; secondly, the expansibility is not strong, only the specified fixed index can be monitored, and the customized monitoring is almost impossible. Therefore, the service scheduling scheme is provided, and the intelligence of service scheduling management of the distributed cluster is improved.
The embodiment of the invention discloses a service scheduling method, which is shown in figure 1 and comprises the following steps:
step S11: and receiving a trap message sent by each node, wherein the trap message comprises the resource information of the node collected by the node.
In this embodiment, the master node receives a trap message sent by another node, where the trap message includes resource information collected by the node itself. For example, as shown in fig. 2, in a distributed cluster, other nodes except a master node are used as clients (i.e., agent terminals) to collect resource information of the nodes and report the resource information to the master node, and the master node is a node where a cluster service is located and is used as a server terminal (i.e., server terminal), and when receiving the resource information reported by other nodes, the master node also monitors and reports the resource information of the node.
It should be noted that, SNMP (Simple Network Management Protocol) has been developed for many years and becomes a commonly used standard Protocol accepted in the industry, and there is no problem in adaptation, and in addition, the trap mode is mostly used for reporting an alarm in an active reporting mode, and is more suitable for reporting system resources.
In this embodiment, before receiving a trap message sent by each node, that is, after other nodes collect their own resource information to generate a corresponding trap message, each other node encrypts the trap message by using a preset encryption algorithm to obtain an encrypted trap message; and then reporting the encrypted trap message to the main node, namely receiving the encrypted trap message sent by each node by the main node. It can be understood that, the SNMP trap V2 transmits a message in a plaintext manner, which has a large potential safety hazard, and therefore, a method of encrypting a trap message by using a preset encryption algorithm is introduced, so that while the security is ensured, the trap message can be prevented from being forged, that is, both a group name and a PDU (Protocol Data Unit) are encrypted. Specifically, a group name and a protocol data unit in a preset message format corresponding to the trap message are encrypted by using a preset encryption algorithm, so as to obtain an encrypted trap message. For example, as shown in fig. 3, both the group name and the PDU are encrypted by using an AES (Advanced Encryption Standard) symmetric Encryption algorithm, if only the group name is encrypted, it may cause the message to be forged, the group name to be moved, and the PDU to be modified at will, so the group name and the PDU are encrypted separately to ensure security, but the AES key needs to be preset for each node in advance and kept properly to prevent theft. Namely, the SNMP trap message is subjected to certain safety optimization, so that the safety of the message can be improved.
Step S12: and summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are overhigh occupation states.
In this embodiment, after receiving a trap message sent by another node, the master node performs a summary analysis on the resource information in the trap message, and then determines whether the resource occupation states of all the nodes are in an over-occupied state, that is, the server end parses the received trap message, summarizes all agent information, and performs an analysis. For example, as shown in fig. 4, an agent node of an agent end is triggered at regular time, the agent end collects resource information of itself and sends a trap message to a server end, the trap message includes resource information of itself, then the server end analyzes the received trap message, collects trap information collected by all agent ends and analyzes the trap information, that is, a master node of the server end collects the trap message through analysis, and determines whether resource occupancy of all nodes is high, that is, whether resource occupancy states of all the nodes are over-occupied.
Step S13: if not, determining the first target node with the resource occupation state being the over-high occupation state, and scheduling the service operated in the first target node to a second target node with the resource occupation state being the non-over-high occupation state.
In this embodiment, when determining whether the resource occupation states of all the nodes are the over-occupied state, if the resource occupation states of all the nodes are not the over-occupied state, determining that the resource occupation state is the first target node in the over-occupied state, scheduling the service running in the first target node to the second target node in the non-over-occupied state, and if the resource occupation states of all the nodes are in the over-occupied state, determining that the current cluster traffic is too large, and generating an alarm message prompting to expand the current cluster. For example, as shown in fig. 5, it is determined whether the resource occupancy of all nodes is too high, and if the resource occupancy of all the nodes is high, it indicates that the traffic of each node is too large and the overall resource of the current cluster is insufficient, and then an alarm is generated to prompt that the resource occupancy of all the nodes is too high, and capacity expansion is performed, that is, the number of nodes is increased to reduce the resource occupancy of each node; if the resource occupation of all the nodes is not all high, then the single node is judged, whether the resource occupation of the single node is too high is judged, if the resource occupation of the current single node is too high, the service volume of the single node is too large, warning information for prompting that the resource occupation of the current single node is too high is generated, then resource scheduling is carried out in the distributed cluster, namely, the service operated in the node with too high resource occupation is scheduled to the node with not too high resource occupation, so that the resource occupation of the node is reduced.
Therefore, in the embodiment of the present application, the trap message sent by each node is received, that is, the resource information is reported in a trap message manner, so that it is more convenient to perform resource monitoring on all nodes in the distributed cluster, and further determine whether resource occupancy of all nodes is too high, and if there is too high resource occupancy of a part of the first target nodes, the service running in the first target nodes with too high resource occupancy is scheduled to the second target nodes with not too high resource occupancy, thereby improving intelligence of service scheduling management of the distributed cluster.
Referring to fig. 6, the embodiment of the present invention discloses a specific service scheduling method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S21: receiving a trap message sent by each node, wherein the trap message contains own resource information collected by the node.
Step S22: and summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are overhigh occupation states.
Step S23: if not, determining that the resource occupation state is the first target node with the over-high occupation state.
Step S24: and sequencing the nodes according to the available resource conditions of the sub-resource indexes corresponding to the nodes to obtain node sequencing results corresponding to the sub-resource indexes.
In this embodiment, when the resource occupation states of all the nodes are not the over-occupied state, after determining that the resource occupation state is the first target node in the over-occupied state, the second target node in which the resource occupation state of the service scheduling running in the first target node is the non-over-occupied state needs to be determined, and therefore, the second target nodes need to be determined. It can be understood that all the resources are split to determine each sub-resource index, the available resource status of each sub-resource index corresponding to each node can be analyzed and determined according to the resource information in the trap, and then each node is sorted according to the available resource status of each sub-resource index of each node to obtain a node sorting result corresponding to each sub-resource index.
Step S25: and selecting a third target node corresponding to each sub-resource index at a preset sorting position according to the node sorting result.
In this embodiment, after the nodes are sorted according to the available resource states of the sub-resource indexes of the nodes, the third target node corresponding to each sub-resource index at a preset sorting position is selected according to the node sorting result. It can be understood that each sub-resource index corresponds to a node sorting result, that is, under each sub-resource index, sorting is performed according to the available resource condition of the node corresponding to the sub-resource index, so as to obtain a sorting result of each node under the sub-resource index, and then some nodes at preset sorting positions in each sub-resource index are selected, so that the node is determined as a third target node.
Step S26: and judging whether the same node exists in the third target node corresponding to each sub-resource index.
In this embodiment, after the third target node corresponding to each sub-resource indicator in the preset sorting position is selected according to the node sorting result, it is further determined whether the same node exists in the third target node corresponding to each sub-resource indicator. For example, an intersection operation is performed on the third target nodes corresponding to the selected sub-resources at the preset sorting position to determine whether the same node exists in the third target nodes corresponding to the sub-resource indexes.
Step S27: if the same node exists in the third target nodes corresponding to the sub-resource indexes, determining the same node from the third target nodes corresponding to the sub-resource indexes, and determining the same node as a second target node of which the resource occupation state is not an overhigh state.
In this embodiment, when performing intersection-taking operation on a third target node corresponding to each sub-resource at a selected preset sorting position, if an intersection can be taken, it indicates that there is a same node in the third target nodes corresponding to each sub-resource indicator, and then the same node is determined as a second target node whose resource occupancy state is a non-too-high state, where the number of the second target nodes may be one or more, and the second target node is an optimal node for receiving a service in an intra-node operation in which resource occupancy is too high in a current distributed cluster.
For example, as shown in fig. 7, all resources are split to obtain four sub-resource indexes of a CPU, MEM, a hard disk space, and a bandwidth, then, according to resource information in a trap message, the nodes are sorted according to available resource states corresponding to the sub-resource indexes of the nodes, then, the nodes with the top three sorting positions are selected from the node sorting results corresponding to each sub-resource index, the nodes with the top three preset sorting positions corresponding to the sub-resource indexes are third target nodes corresponding to each sub-resource index, then, the third target nodes between the sub-resource indexes take an intersection, and if the intersection can be taken, that is, the same node exists in the third target nodes between the sub-resource indexes, the same node can be used as an optimal solution node for receiving a new request. If a plurality of same nodes exist, one of the nodes is randomly selected to receive a new request. That is to say, the method and the device split all the resources of the node through the divide-and-conquer algorithm, and obtain the node of the optimal solution under the condition of single resource.
It should be noted that the sub-resource indicator may also be re-extended, as shown in fig. 8, the resource indicator may be arbitrarily extended by adding an OID (Object Identifier), where an actual value of the OID needs to be actually allocated with a globally unique value according to an international rule, for example, the OID-CPU: obtaining CPU utilization, OID-MEM: obtaining the memory usage rate, and OID-DISK: acquiring occupancy rate of a hard disk, and obtaining an OID-BAND: and acquiring the bandwidth utilization rate. Or the resource index type is expanded according to the requirement of the actual service, that is, the sub-resource indexes are convenient to increase or decrease by adding the OID or according to the mode of the actual service requirement. And the bottom acquisition commands corresponding to the sub-resource indexes can be respectively as follows: the acquisition command corresponding to the CPU is top, the acquisition command corresponding to the MEM is free, the acquisition command corresponding to the hard disk is df, and the acquisition command corresponding to the bandwidth is iftop.
Step S28: and scheduling the service operated in the first target node to the second target node of which the resource occupation state is the non-overhigh state.
For the details of the steps S21 to S23 and S28, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
It can be seen that, in the embodiment of the present application, a trap message sent by each node is received, that is, resource information is reported in a trap message manner, so that it is more convenient to perform resource monitoring on all nodes in a distributed cluster, and further determine whether resource occupancy of all nodes is too high, if there is too high resource occupancy of a part of first target nodes, a service running in a first target node with too high resource occupancy is scheduled to a second target node with not too high resource occupancy, and according to a divide-and-conquer algorithm and weighted calculation, a resource condition is analyzed and processed to obtain a node with an optimal solution, thereby improving intelligence of service scheduling management of the distributed cluster, improving expandability of functions, and increasing and decreasing indexes more conveniently.
Referring to fig. 9, the embodiment of the present invention discloses a specific service scheduling method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
Step S31: and receiving a trap message sent by each node, wherein the trap message comprises the resource information of the node collected by the node.
Step S32: and summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are over-occupation states.
Step S33: if not, determining that the resource occupation state is the first target node with the over-high occupation state.
Step S34: sorting the nodes according to the available resource conditions of the sub-resource indexes corresponding to the nodes to obtain node sorting results corresponding to the sub-resource indexes; .
Step S35: and selecting a third target node corresponding to each sub-resource index at a preset sorting position according to the node sorting result.
Step S36: and judging whether the same node exists in the third target node corresponding to each sub-resource index.
Step S37: and if the same node does not exist in the target node corresponding to each sub-resource index, performing weighted operation on each sub-resource index corresponding to each node to obtain a calculation result corresponding to each node.
In this embodiment, when determining whether a same node exists in the third target node corresponding to each sub-resource indicator, if the same node does not exist in the target node corresponding to each sub-resource indicator, performing a weighted operation on each sub-resource indicator corresponding to each node to obtain a calculation result corresponding to each node, specifically, determining a request type corresponding to a scheduling request, and determining a degree of dependence of the request type on each sub-resource indicator; the scheduling request is a corresponding request for scheduling the service operated in the first target node to a second target node of which the resource occupation state is not too high; determining a weighted value corresponding to each sub-resource index of each node based on the dependency degree; determining the actual value of each sub-resource index corresponding to each node based on the total number of the nodes corresponding to each sub-resource index and the node sequencing result; and performing weighting operation on the actual value of each sub-resource index by using the weighted value to obtain a calculation result corresponding to each node. For example, there is currently a scheduling request for scheduling a service running in the first target node to a second target node whose resource occupation state is not too high, then the request type of the invocation request is determined, then the degree of dependence of the request type on the sub-resource index is determined, and based on the degree of dependence, the degree of dependence is determinedThe weighted value corresponding to each sub-resource index of each node is given, for example, the weighted value corresponding to the sub-resource index CPU is Weight cpu The weighted value corresponding to the child resource index MEM is Weight mem The weighted value corresponding to the sub-resource index hard disk space is Weight dis The weighted value corresponding to the sub-resource index bandwidth is Weight bandwidth Wherein, the sum of the weighted values corresponding to each sub-resource index is 1, such as: weigh tcpu +Weight mem +Weight disk +Weight bandwidth =100%. When calculating the actual Value of each sub-resource index corresponding to the current node, assuming that the total number of the nodes corresponding to each sub-resource index of the current node is N, in the ranking of the sub-resource index CPU, the ranking of the current node is No. 2, the Value of the current node for the CPU sub-resource index is N-2, thereby calculating the actual Value of each sub-resource index corresponding to each node, e.g., the actual Value of the CPU is Value cpu Actual Value of MEM mem Actual Value of hard disk space disk Actual Value of bandwidth bandwidth And then determining that the weighted value of the current node is as follows according to the weighted value and the actual value of each sub-resource index of the current node: value cpu *Weight cpu +Value mem *Weight mem +Value disk *Weight disk +Value bandwidth *Weight bandwidth After the weighted calculation results of all the nodes are calculated according to the mode, all the nodes are sequenced according to the numerical value of the calculation result, and the node with the highest numerical value in sequencing is determined as the optimal solution node, namely the second target node
Step S38: and determining the node corresponding to the calculation result with the highest numerical value as a second target node of which the resource occupation state is not in an overhigh state.
In this embodiment, when the same node does not exist in the target node corresponding to each sub-resource indicator, and then the weighted operation is performed on each sub-resource indicator corresponding to each node to obtain a calculation result corresponding to each node, the node corresponding to the calculation result with the highest numerical value is determined as the second target node in which the resource occupation state is not in the too high state. That is to say, all nodes are sorted according to the value of the calculation result, and the node with the highest value in the sorting is determined as the optimal solution node, that is, the second target node in which the resource occupation state is in a non-too-high state.
Step S39: and scheduling the service operated in the first target node to the second target node of which the resource occupation state is the non-overhigh state.
For the specific contents of the steps S31 to S36 and S39, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
It can be seen that, in the embodiment of the present application, a trap message sent by each node is received, that is, resource information is reported in a trap message manner, so that it is more convenient to perform resource monitoring on all nodes in a distributed cluster, and further determine whether resource occupancy of all nodes is too high, if there is too high resource occupancy of a part of first target nodes, a service running in a first target node with too high resource occupancy is scheduled to a second target node with not too high resource occupancy, and according to a divide and conquer algorithm and weighted calculation, a resource condition is analyzed and processed to obtain a node with an optimal solution, thereby improving intelligence of service scheduling management of the distributed cluster, improving expandability of functions, and increasing and decreasing indexes more conveniently.
Correspondingly, an embodiment of the present application further discloses a service scheduling apparatus, as shown in fig. 10, the apparatus includes:
a message receiving module 11, configured to receive a trap message sent by each node, where the trap message includes resource information of the node itself collected by the node;
the information analysis module 12 is configured to perform summary analysis on the resource information in the trap message to determine whether resource occupation states of all the nodes are an over-occupation state;
and the service scheduling module 13 is configured to determine, when the resource occupation states of all the nodes are not in the over-occupied state, that the resource occupation state is the first target node in the over-occupied state, and schedule a service running in the first target node to a second target node in the non-over-occupied state.
As can be seen from the above, in the embodiment of the present application, the trap message sent by each node is received, that is, the resource information is reported in the form of the trap message, so that it is more convenient to perform resource monitoring on all nodes in the distributed cluster, and further determine whether resource occupancy of all nodes is too high, if there is too high resource occupancy of a part of the first target nodes, the service running in the first target nodes with too high resource occupancy is scheduled to the second target nodes with not too high resource occupancy, thereby improving intelligence of service scheduling management of the distributed cluster.
In some specific embodiments, the service scheduling apparatus may specifically include:
the message encryption module is used for encrypting the trap message by using a preset encryption algorithm to obtain an encrypted trap message;
in some specific embodiments, the message receiving module 11 may specifically include:
and the message receiving unit is used for receiving the encrypted trap message sent by each node.
In some specific embodiments, the message encryption module may specifically include:
and the message encryption unit is used for encrypting the group name and the protocol data unit in the preset message format corresponding to the trap message by using a preset encryption algorithm to obtain the encrypted trap message.
In some specific embodiments, the service scheduling apparatus may specifically include:
the node sorting module is used for sorting the nodes according to the available resource conditions of the sub-resource indexes corresponding to the nodes to obtain node sorting results corresponding to the sub-resource indexes;
the target node selection module is used for selecting a third target node corresponding to each sub-resource index in a preset sequencing position according to the node sequencing result;
a judging module, configured to judge whether the third target node corresponding to each of the sub-resource indicators has a same node;
and the identical node determining module is configured to determine, when an identical node exists in the third target nodes corresponding to the sub-resource indicators, the identical node from the third target nodes corresponding to the sub-resource indicators, and determine the identical node as a second target node whose resource occupation state is not an excessively high state.
In some specific embodiments, after the determining whether the same node exists in the third target node corresponding to each of the sub-resource indicators, the determining may specifically include:
the weighted operation module is used for performing weighted operation on each sub-resource index corresponding to each node to obtain a calculation result corresponding to each node when the same node does not exist in the target node corresponding to each sub-resource index;
and the target node determining module is used for determining the node corresponding to the calculation result with the highest numerical value as a second target node of which the resource occupation state is not in an overhigh state.
In some specific embodiments, the weighting operation module may specifically include:
a request type determining unit, configured to determine a request type corresponding to the scheduling request;
a dependency degree determining unit, configured to determine a dependency degree of the request type on each of the sub-resource indicators; the scheduling request is a corresponding request for scheduling the service operated in the first target node to a second target node of which the resource occupation state is a non-overhigh state;
a weighted value determining unit, configured to determine, based on the dependency degree, a weighted value corresponding to each of the sub-resource indicators of each of the nodes;
an actual value determination unit, configured to determine an actual value of each sub-resource index corresponding to each node based on the total number of nodes corresponding to each sub-resource index and the node ordering result;
and the weighting operation unit is used for carrying out weighting operation on the actual value of each sub-resource index by using the weighting value to obtain a calculation result corresponding to each node.
In some specific embodiments, the service scheduling apparatus may specifically include:
and the alarm generating unit is used for judging that the current cluster traffic is overlarge when the resource occupation states of all the nodes are the overhigh occupation states, and generating alarm information for prompting the capacity expansion of the current cluster.
Furthermore, the embodiment of the application also provides electronic equipment. FIG. 11 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and nothing in the figure should be taken as a limitation on the scope of use of the present application.
Fig. 11 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the service scheduling method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage manner may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20 and the computer program 222, and may be Windows Server, netware, unix, linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the service scheduling method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored, and when the computer program is loaded and executed by a processor, the steps of the service scheduling method disclosed in any of the foregoing embodiments are implemented.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The service scheduling method, apparatus, device and storage medium provided by the present invention are described in detail above, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for scheduling services, comprising:
receiving a trap message sent by each node, wherein the trap message comprises own resource information collected by the node;
summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are over-occupation states or not;
if not, determining the first target node with the resource occupation state being the over-high occupation state, and scheduling the service operated in the first target node to a second target node with the resource occupation state being the non-over-high occupation state.
2. The service scheduling method according to claim 1, wherein before receiving the trap message sent by each node, the method further comprises:
encrypting the trap message by using a preset encryption algorithm to obtain an encrypted trap message;
correspondingly, the receiving the trap message sent by each node includes:
and receiving the encrypted trap message sent by each node.
3. The service scheduling method according to claim 2, wherein the encrypting the trap message by using a preset encryption algorithm to obtain an encrypted trap message comprises:
and encrypting the group name and the protocol data unit in the preset message format corresponding to the trap message by using a preset encryption algorithm to obtain the encrypted trap message.
4. The method of claim 1, wherein before scheduling the service running in the first target node to the second target node whose resource occupancy state is not too high, the method further comprises:
sequencing the nodes according to the available resource conditions of the sub-resource indexes corresponding to the nodes to obtain node sequencing results corresponding to the sub-resource indexes;
selecting a third target node corresponding to each sub-resource index at a preset sorting position according to the node sorting result;
judging whether the same node exists in the third target node corresponding to each sub-resource index;
if the same node exists in the third target node corresponding to each sub-resource index, determining the same node from the third target node corresponding to each sub-resource index, and determining the same node as a second target node of which the resource occupation state is not too high.
5. The service scheduling method according to claim 4, wherein after determining whether the same node exists in the third target node corresponding to each of the sub-resource indicators, the method further comprises:
if the same node does not exist in the third target node corresponding to each sub-resource index, performing weighted operation on each sub-resource index corresponding to each node to obtain a calculation result corresponding to each node;
and determining the node corresponding to the calculation result with the highest numerical value as a second target node of which the resource occupation state is in a non-overhigh state.
6. The service scheduling method according to claim 5, wherein the performing a weighted operation on each of the sub-resource indicators corresponding to each of the nodes to obtain a calculation result corresponding to each of the nodes includes:
determining a request type corresponding to a scheduling request, and determining the dependence degree of the request type on each sub-resource index; the scheduling request is a corresponding request for scheduling the service operated in the first target node to a second target node of which the resource occupation state is not too high;
determining a weighted value corresponding to each sub-resource index of each node based on the dependency degree;
determining the actual value of each sub-resource index corresponding to each node based on the total number of the nodes corresponding to each sub-resource index and the node sequencing result;
and carrying out weighting operation on the actual value of each sub-resource index by using the weighting value to obtain a calculation result corresponding to each node.
7. The service scheduling method according to any one of claims 1 to 6, wherein after the performing the aggregate analysis on the resource information in the trap message to determine whether the resource occupation states of all the nodes are the over-occupation state, further comprises:
and if the resource occupation states of all the nodes are the over-occupation state, judging that the current cluster service volume is too large, and generating alarm information for prompting the capacity expansion of the current cluster.
8. A service scheduling apparatus, comprising:
a message receiving module, configured to receive a trap message sent by each node, where the trap message includes resource information of the node itself collected by the node;
the information analysis module is used for summarizing and analyzing the resource information in the trap message to judge whether the resource occupation states of all the nodes are over-occupation states or not;
and the service scheduling module is used for determining a first target node with the resource occupation state being the over-occupied state when the resource occupation states of all the nodes are not in the over-occupied state, and scheduling the service operated in the first target node to a second target node with the resource occupation state being not in the over-occupied state.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program for carrying out the steps of the service scheduling method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program realizes the steps of the service scheduling method according to any one of claims 1 to 7 when executed by a processor.
CN202211000224.3A 2022-08-19 2022-08-19 Service scheduling method, device, equipment and storage medium Active CN115379019B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211000224.3A CN115379019B (en) 2022-08-19 2022-08-19 Service scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211000224.3A CN115379019B (en) 2022-08-19 2022-08-19 Service scheduling method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115379019A true CN115379019A (en) 2022-11-22
CN115379019B CN115379019B (en) 2024-07-09

Family

ID=84066482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211000224.3A Active CN115379019B (en) 2022-08-19 2022-08-19 Service scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115379019B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009091A (en) * 2023-10-07 2023-11-07 浪潮(山东)计算机科技有限公司 Resource adjustment method, device, equipment and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109167835A (en) * 2018-09-13 2019-01-08 重庆邮电大学 A kind of physics resource scheduling method and system based on kubernetes
CN110213358A (en) * 2019-05-23 2019-09-06 深圳壹账通智能科技有限公司 Method, node, equipment and the storage medium of cluster resource scheduling
CN112232834A (en) * 2020-09-29 2021-01-15 中国银联股份有限公司 Resource account determination method, device, equipment and medium
CN112469133A (en) * 2020-11-27 2021-03-09 中国联合网络通信集团有限公司 Carrier resource scheduling method and device
CN113382077A (en) * 2021-06-18 2021-09-10 广西电网有限责任公司 Micro-service scheduling method and device, computer equipment and storage medium
WO2022048357A1 (en) * 2020-09-03 2022-03-10 深圳壹账通智能科技有限公司 Transaction endorsement method and apparatus, and storage medium
US20220083375A1 (en) * 2019-05-30 2022-03-17 Huawei Technologies Co., Ltd. Method and apparatus for scheduling task processing entity
CN114281479A (en) * 2021-12-27 2022-04-05 深圳前海微众银行股份有限公司 Container management method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109167835A (en) * 2018-09-13 2019-01-08 重庆邮电大学 A kind of physics resource scheduling method and system based on kubernetes
CN110213358A (en) * 2019-05-23 2019-09-06 深圳壹账通智能科技有限公司 Method, node, equipment and the storage medium of cluster resource scheduling
US20220083375A1 (en) * 2019-05-30 2022-03-17 Huawei Technologies Co., Ltd. Method and apparatus for scheduling task processing entity
WO2022048357A1 (en) * 2020-09-03 2022-03-10 深圳壹账通智能科技有限公司 Transaction endorsement method and apparatus, and storage medium
CN112232834A (en) * 2020-09-29 2021-01-15 中国银联股份有限公司 Resource account determination method, device, equipment and medium
CN112469133A (en) * 2020-11-27 2021-03-09 中国联合网络通信集团有限公司 Carrier resource scheduling method and device
CN113382077A (en) * 2021-06-18 2021-09-10 广西电网有限责任公司 Micro-service scheduling method and device, computer equipment and storage medium
CN114281479A (en) * 2021-12-27 2022-04-05 深圳前海微众银行股份有限公司 Container management method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009091A (en) * 2023-10-07 2023-11-07 浪潮(山东)计算机科技有限公司 Resource adjustment method, device, equipment and readable storage medium
CN117009091B (en) * 2023-10-07 2023-12-19 浪潮(山东)计算机科技有限公司 Resource adjustment method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN115379019B (en) 2024-07-09

Similar Documents

Publication Publication Date Title
US9246777B2 (en) Computer program and monitoring apparatus
CN108370341B (en) Resource allocation method, virtual network function manager and network element management system
US9438515B2 (en) Method and apparatus for network element resource utilization tracking
CN113709048A (en) Routing information sending and receiving method, network element and node equipment
JP3812236B2 (en) Network management system with event control means
CN109995669B (en) Distributed current limiting method, device, equipment and readable storage medium
JP2002505060A (en) Telecommunications performance management system
CN101617501B (en) Method, product and system for operating a communications network
WO2004102386A2 (en) Autonomic failover in the context of distributed web services
CN111190794A (en) Operation and maintenance monitoring and management system
CN109271243B (en) Cluster task management system
CN111200526B (en) Monitoring system and method of network equipment
CN106100868B (en) A kind of project operation and maintenance device, system and method
CN113742066A (en) Load balancing system and method for server cluster
CN111026606A (en) Alarm method and device based on hystrix fuse monitoring and computer equipment
US20010052010A1 (en) Method for controlling trap generation of SNMP
CN112698952A (en) Unified management method and device for computing resources, computer equipment and storage medium
CN113596150A (en) Message pushing method and device, computer equipment and storage medium
CN115379019A (en) Service scheduling method, device, equipment and storage medium
CN115796844A (en) Dynamic updating method of alarm threshold, terminal equipment and system
CN213876703U (en) Resource pool management system
KR20150049850A (en) Apparatus and Method for Changing Resource Using Pattern Information, and Recording Medium Using the Same
CN114817134B (en) Snapshot task monitoring method, device, equipment and medium
CN115114316A (en) Processing method, device, cluster and storage medium for high-concurrency data
CN113190347A (en) Edge cloud system and task management method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant