CN113391891A - Load balancing resource scheduling method based on Rete and character string pattern matching algorithm - Google Patents

Load balancing resource scheduling method based on Rete and character string pattern matching algorithm Download PDF

Info

Publication number
CN113391891A
CN113391891A CN202110551965.XA CN202110551965A CN113391891A CN 113391891 A CN113391891 A CN 113391891A CN 202110551965 A CN202110551965 A CN 202110551965A CN 113391891 A CN113391891 A CN 113391891A
Authority
CN
China
Prior art keywords
node
resource
available
nodes
called
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
CN202110551965.XA
Other languages
Chinese (zh)
Other versions
CN113391891B (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.)
State Grid Jiangsu Electric Power Co Ltd
Global Energy Interconnection Research Institute
Anhui Jiyuan Software Co Ltd
Information and Telecommunication Branch of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
State Grid Jiangsu Electric Power Co Ltd
Global Energy Interconnection Research Institute
Anhui Jiyuan Software Co Ltd
Information and Telecommunication Branch of State Grid Jiangsu Electric Power 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 State Grid Jiangsu Electric Power Co Ltd, Global Energy Interconnection Research Institute, Anhui Jiyuan Software Co Ltd, Information and Telecommunication Branch of State Grid Jiangsu Electric Power Co Ltd filed Critical State Grid Jiangsu Electric Power Co Ltd
Priority to CN202110551965.XA priority Critical patent/CN113391891B/en
Publication of CN113391891A publication Critical patent/CN113391891A/en
Application granted granted Critical
Publication of CN113391891B publication Critical patent/CN113391891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • 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/5083Techniques for rebalancing the load in a distributed system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a load balancing resource scheduling method based on Rete and a character string pattern matching algorithm, for a Docker container, when a Pod is scheduled to a proper node of a cluster in a Kubernetes cluster, a character string pattern matching algorithm is firstly applied to screen out a batch of available nodes; and matching the resources to the optimal node by applying a Rete algorithm. The method of the invention finds out all objects and strategies matching each mode by a network screening method, and can fundamentally improve the strategy matching efficiency, thereby shortening the resource calling time.

Description

Load balancing resource scheduling method based on Rete and character string pattern matching algorithm
Technical Field
The invention relates to the technical field of resource scheduling, in particular to a load balancing resource scheduling method based on Rete and a character string pattern matching algorithm.
Background
Kubernets is an open source platform for automatic deployment, capacity expansion and operation and maintenance of container clusters, and through the Kubernets, user requirements can be responded quickly and effectively, applications can be deployed quickly and expectedly, applications can be expanded extremely quickly, new application functions can be connected seamlessly, resources can be saved, use of hardware resources is optimized, and a complete open source scheme is provided for container arrangement management.
Pod is made up of one or more containers (e.g., Docker containers) and has the capability to share storage/network/UTS/PIDs, as well as specifications to run the containers. And in kubernets Pod is the smallest atomic unit that can be scheduled. Briefly, a Pod is a collection of containers, and the containers within the Pod share the network/storage (kubernets implements a shared set of namespaces to replace each container's respective NS to achieve this capability), so they can communicate internally via Localhost.
The Rete algorithm is an efficient method for comparing a large number of pattern sets with a large number of object sets, and all objects and rules matched with the patterns are found out through a network screening method. And a Rete network is formed to realize the function of pattern matching, and the time redundancy and the structural similarity of the rules are utilized to improve the efficiency of system pattern matching. The Rete algorithm is well established and its applications are widespread.
The chinese invention patent publication No. CN111143059A, "an improved kubernets resource scheduling method", proposes an improved resource scheduling scheme, which mainly includes the following two steps: (1) the problem that the distribution of the QoS classes is not estimated sufficiently by using a QoS (quality of service) optimized scheduling BalancdQoSPriority improvement platform; (2) and weighting the pre-screening of the pre-selection algorithm Predicate and the preferential Priority screening to achieve the comprehensive realization of two optimization targets. However, the patent focuses on the research object of scoring and ordering the nodes. The chinese invention patent publication No. CN108108223A, "Kubernetes-based container management platform", proposes a Kubernetes-based container management platform, which manages bottom-layer arilocos resources and container resources through a unified platform, and manages user information through the contact between the platform and a unified rights management system. The existing resource scheduling method focuses on the service matching accuracy level, neglects the rapidity of service matching, and along with the sharp increase of manufacturing resources, the matching efficiency of the traditional service matching method is greatly reduced and the requirements are difficult to meet.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a load balancing resource scheduling method based on Rete and a character string pattern matching algorithm, which fundamentally improves the efficiency of resource calling and shortens the time of resource calling.
The technical scheme adopted by the invention is as follows:
the invention provides a load balancing resource scheduling method based on Rete and a character string pattern matching algorithm, which is suitable for scheduling Pod to nodes of a Kubernetes cluster and comprises the following steps:
forming a node main string according to the node resource table, and forming a pattern string to be matched according to the Pod resource scheduling request;
matching the pattern string to be matched with the node main string to obtain an available node;
selecting an optimal node for the obtained available nodes by adopting a Rete algorithm;
and deploying the Pod to the optimal node.
Further, in the above-mentioned case,
and maintaining a resource table for each node through a scheduler, wherein the resource table entry records each item of resource attribute state data of the node.
Further, the forming a node master string according to the node resource table includes:
and converting each item of resource attribute state data of the nodes into predefined characters, and arranging according to the fixed sequence of the resource table items to form a main string of each node.
Further, the forming a pattern string to be matched according to the Pod resource scheduling request includes:
converting each resource attribute request in the Pod resource scheduling request into corresponding characters, wherein the resource attribute request adopts xiIndicating that x is the resource attribute request, and subscript i is the position of the resource attribute in the resource table;
and converting all resource attribute requests into characters and arranging the characters according to the sequence in the resource table entries to form a pattern string to be matched.
Further, the matching the pattern string to be matched with the node main string to obtain an available node includes:
finding the position of the character in the node main string through the subscript of the character in the pattern string to be matched;
comparing the character in the pattern string to be matched with the character at the same position in the node main string;
and if all characters in the pattern string to be matched are consistent with the comparison in the node main string, the node belongs to the available node, and the node is output and stored in the list of the available node.
Further, in the above-mentioned case,
and if the available node is not matched, the Pod resource scheduling request waits until the next scheduling period to search the available node again.
Further, the selecting an optimal node for the obtained available node by using a Rete algorithm includes:
importing the available nodes into a fact set to construct a discrimination network;
matching facts, namely available nodes in a fact set;
and executing the connection operation until one rule matching is finished.
Further, the matching of the facts means that the attributes of the facts are judged, if the constraint conditions are met, the facts are continuously propagated to the subsequent nodes, otherwise, the subsequent propagation is abandoned, and the matching process is stopped;
the attributes of the fact are represented by reference number A, B, C:
a is 0, which indicates that after the resource is called into the available node k, the available node is full and the available node k is not available;
a is 1, which indicates that after the resource is called into the available node k, the available node is not full and the available node k is available;
b is 0, which means that all available nodes need to queue without idle nodes on the basis that the nodes are available after the resources are called into the available nodes;
b ═ 1, which means that all available nodes do not need to queue on the basis that the node is available after the resource is called into the available node;
b is 2, which means that on the basis that the nodes are available after the resources are called into the available nodes, part of the available nodes need to be queued, and the rest of the available nodes do not need to be queued;
c is 0, which means that the resource weight coefficient to be called is low;
c is 1, which means that the resource needing to be called has high weight coefficient and needs to be called preferentially;
the constraint conditions are as follows: the node is not fully loaded.
Further, the rules are as follows:
rule 1: when A is 0, after the resource is called into a node k, the node is fully loaded, and the node k is not available;
rule 2: a is 1, B is 0, C is 0, the weight coefficient of the resource needing to be called is low, no idle node exists, all the resources are queued from high to low according to the priority order of the weight, and the resource with the low weight coefficient is called after the other resources with the high weight coefficient are called;
rule 3: a is 1, B is 1, C is 0, the weight coefficient of the resource to be called is low, all nodes are all idle, and the resource is called to the idle node in sequence from high to low according to the priority of the resource weight;
rule 4: a is 1, B is 2, C is 0, the weight coefficient of the resource to be called is low, part of nodes need to queue, part of nodes are idle, the resource with low weight coefficient waits for the node needing to queue, and the resource with low weight coefficient is called again when the node finishes calling the resource to be idle;
rule 5: a is 1, B is 0, C is 1, the weight coefficient of the resource to be called is high, no idle node exists, all the resources are queued from high to low according to the priority order of the weight, and the resource with the high weight coefficient is called preferentially;
rule 6: a is 1, B is 1, C is 1, the weight coefficient of the resource to be called is high, all nodes are all idle, all idle nodes call the resource to the nodes in sequence from high to low according to the priority of the resource weight, and the resource with the high weight coefficient is called preferentially;
rule 7: a is 1, B is 2, C is 1, the weight coefficient of the resources to be called is high, part of the nodes need to queue, part of the nodes are idle, and the resources with high weight coefficients are preferentially called to the idle nodes.
The invention has the beneficial effects that:
the method of the invention uses a character string pattern matching algorithm, reduces the matching times of the pattern string and the main string as much as possible to achieve the purpose of fast matching, fast matches a batch of available nodes, and matches the screened available nodes with an optimal node by using a Rete algorithm. All objects and rules matched with each mode are found out through a network screening method, the strategy matching efficiency can be fundamentally improved, and the resource calling time is shortened.
Drawings
FIG. 1 is a flow chart of a load balancing resource scheduling method based on a Rete algorithm and a string pattern matching algorithm in the present invention;
fig. 2 is a schematic diagram of a node invocation rule in the present invention.
Detailed Description
The invention is further described below. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
The invention provides a load balancing resource scheduling method based on a Rete algorithm and a character string pattern matching algorithm.
Referring to fig. 1, the specific implementation process of the present invention is as follows:
forming a node main string according to a node resource table, and forming a pattern string to be matched according to a Pod resource scheduling request;
matching the pattern string with the node main string by adopting a character string pattern matching algorithm to obtain an available node;
selecting an optimal node for the obtained available nodes by adopting a Rete algorithm;
and deploying the Pod to the optimal node.
In the embodiment of the present invention, a scheduler maintains a resource table for each node and receives a resource scheduling request, and the resource table entry records various resource attribute state data corresponding to the node, specifically: whether GPU, CPU and internal memory are fully loaded or not, and the port is available.
In the embodiment of the invention, each item of resource attribute state data of the nodes is converted into corresponding characters, and the main strings s of each node are formed according to the fixed sequence arrangement of the resource table entries.
In the embodiment of the invention, according to the resource scheduling request of the Pod, the Pod resource scheduling request comprises a plurality of resource attribute requests, the resource attribute requests are converted into corresponding characters, and the positions of the resource attributes in the table are recorded, such as xiX is the resource attribute requirement, i is the position of the attribute in the resource table entry, and the pattern string t to be matched is formed by converting all the resource attribute requirements into corresponding characters and according to the sequence in the resource table entry.
In the embodiment of the invention, the pattern string t is matched with the node main string s, if all resources in the pattern string are contained in the main string, the matching is successful, and the node is output and stored in the list of the available node. If no available node exists, the Pod resource scheduling request waits until the next scheduling period to search for the available node again.
In the embodiment of the invention, in the pattern matching process of the character string of the available node, the position of the character in the main string is found through the subscript of the character in the pattern string, then the character in the pattern string is compared with the character in the main string, and if all the characters in the pattern string are consistent with the comparison in the main string, the node belongs to the available node.
In the embodiment of the invention, all nodes are quickly matched with available nodes which are screened and output, the available nodes are stored in the list, and the available node information in the list is imported into the Facts set to construct the discrimination network.
And traversing all fact e Facts and Facts, and entering the judgment network from the root node in the form of a triple. For example: (node k, whether the resource needs queuing, queuing value Q). And setting a code and a rule according to the judgment basis of whether the node is overloaded after being added into the resource, whether the node needs to queue and the weight priority of the resource, and matching the optimal node by using a Rete algorithm.
In the embodiment of the invention, three codes A, B and C are set for the situation after the nodes are added with resources, and all selectable nodes are represented by the three codes and the corresponding values to form an alpha network.
As shown in table 1, a is 0, which indicates that after the resource is called into node k, the node is full and node k is not available; when a is 1, after the resource is called into the node k, the node is not fully loaded, and the node k is available; b is 0, which indicates that the available nodes all need to queue without idle nodes on the basis that the nodes are available after the resource is called into the node; b is 1, which indicates that the available nodes do not need to be queued on the basis that the nodes are available after the resource is called into the node; b is 2, which indicates that on the basis that the node is available after the resource is called into the node, part of the nodes need to queue, and meanwhile, part of the nodes do not need to queue; c is 0, which indicates that the weight coefficient of the resource to be called is lower; and C is 1, which indicates that the resource needing to be called has a high weight coefficient and needs to be called preferentially.
Table 1 charging center matching number table
Figure BDA0003075847820000051
In the embodiment of the present invention, referring to fig. 2, setting a call rule specifically includes:
rule 1: when A is 0, after the resource is called into a node k, the node is fully loaded, and the node k is not available;
rule 2: a is 1, B is 0, C is 0, the weight coefficient of the resource needing to be called is lower, no idle node exists, all the resources are queued from high to low according to the priority order of the weight, and the resource with the lower weight coefficient is called after the other resources with the higher weight coefficient are called;
rule 3: a is 1, B is 1, C is 0, the weight coefficient of the resource to be called is lower, all nodes are all idle, all idle nodes call the resource to the nodes in sequence from high to low according to the priority of the resource weight, and the resource with the lower weight coefficient is called after waiting for the other resources with higher weight coefficients;
rule 4: a is 1, B is 2, C is 0, the weight coefficient of the resource to be called is lower, part of nodes need to queue, part of nodes are idle and do not need to queue, the resource with lower weight coefficient waits for the node needing to queue, and the resource with lower weight coefficient is called when the node finishes calling the resource and is idle;
rule 5: a is 1, B is 0, C is 1, the weight coefficient of the resource to be called is higher, no idle node exists, all the resources are queued from high to low according to the priority order of the weight, and the resource with the higher weight coefficient is called preferentially;
rule 6: a is 1, B is 1, C is 1, the weight coefficient of the resource to be called is higher, all nodes are all idle, all idle nodes call the resource to the nodes in sequence from high to low according to the priority of the resource weight, and the resource with the higher weight coefficient is called preferentially;
rule 7: the resource weight coefficient to be called is higher, part of nodes need to be queued, part of nodes are idle and do not need to be queued, and the resource with the higher weight coefficient is preferentially called to the idle node.
In the embodiment of the invention, a Rete algorithm is adopted, and the optimal node is selected based on a set rule as follows:
step a, importing nodes needing to be matched into a fact set, constructing a discrimination network, traversing all facts in the fact set, namely a batch of available nodes after matching is completed through a character string pattern matching algorithm.
The facts represent the multivariate relationships between objects and between object attributes, and are usually represented in the form of triples, which enter the discriminant network from the root node, for example: (node k, whether the resource needs queuing, queuing value Q). The root node represents a virtual node, is an entrance for constructing the whole Rete network, and can pass all facts and transmit the facts to the type node as a successor of the root node.
And b, if the fact set is not empty, selecting a fact for processing. Traversing the type node, if the fact is matched with the type node, transmitting the fact to a subsequent node of the node, judging the attribute of the fact (the state data of the node defined by the table 1, specifically, whether the node is fully loaded, whether the node needs to be queued, and the weight coefficient level of the node) by the selected node, if the constraint condition is met (for example, the node is not fully loaded), continuously transmitting the fact to the subsequent node, otherwise, abandoning the subsequent transmission, and stopping the matching process.
The type node is used for selecting the type of a fact, and propagating the fact which accords with the type of the node to a subsequent alpha node, and the type node in the embodiment of the invention is state data of the node, and specifically comprises the following steps: full load of the node, whether the node needs queuing, and the weight coefficient level of the node. Selecting a node is to filter each fact to get it along the Rete net to the appropriate alpha node.
Step c, selecting a first node (type node) of the alpha network to operate, selecting a type of a fact, and if the fact is that the node is fully loaded after a resource is called into a node k, setting a code number A to be 0 in an alpha node 1; if the fact is that after the resource is called into the node k, the node is not fully loaded, the code number a is set to 1 in the α node 2; if the fact is that the available nodes of the batch need to be queued and no idle node exists on the basis that the nodes are available after the resource is called into the node, setting the code number B in the alpha node 3 to be 0; if the fact is that no queue is needed for the available nodes in the batch on the basis that the nodes are available after the resource is called into the node, setting the code number B to be 1 in the α node 4; if the fact is that some nodes need to be queued and some nodes do not need to be queued on the basis that the nodes are available after the resource is called into the node, setting the code number B in the α node 5 to be 2; if the fact is that the resource weight coefficient to be called is low, the code number C is set to 0 in the α node 6; if it is determined that the resource to be called has a high weight coefficient and needs to be called preferentially, the α node 7 sets the code number C to 1. Through which the next node of the alpha net is entered until the alpha storage area is entered. Otherwise, jumping to the next judgment path.
The alpha network is a pattern network, which is formed by rules in a rule base and records the test conditions of each domain of each pattern, each test condition corresponds to a domain node of the network, and all the domains of each pattern are connected in sequence to form a matching chain of the pattern network.
And d, adding the result of the alpha storage area into the beta storage area, if the result is not the terminal node, detecting whether the fact that the condition is met exists in the other input set, if the fact that the condition is met exists, executing connection operation, and entering the next beta storage area to repeatedly execute c. When A is 0, indicating that after the resource is called into the node k, the node k is fully loaded and unavailable, and the fact that the condition is not met directly forms a rule 1; when A is 1, indicating that the node k is not fully loaded and available after the resource is called into the node k, and in fact, satisfying the condition, continuing to execute the connection operation, when B is 0 and C is 0; forming rule 2; when B ═ 1 and C ═ 0, rule 3 is formed; when B ═ 2 and C ═ 0, rule 4 is formed; when B is 0 and C is 1, rule 5 is formed; when B ═ 1 and C ═ 1, rule 6 is formed; when B is 2 and C is 1, rule 7 is formed. If another input set does not have the fact that the condition is satisfied, return to b. If the node is an end node, it is executed and added to the fact set.
Wherein the terminal node is the end node of the rule, which represents the end of a rule matching, and when a fact or tuple is transmitted to the terminal node, the fact or tuple indicates that the rule corresponding to the terminal node is activated. The beta memory region is part of a beta network, which has two types of node beta memory regions and connecting nodes. The former mainly stores the set after connection is completed; the latter comprises two input ports, two sets which need to be matched are respectively input, and are combined by a connecting node and transmitted to the next node. The connection node is a node used as a connection operation, and corresponds to a table connection operation of the database.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the same, and although the present invention is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.

Claims (9)

1. A load balancing resource scheduling method based on Rete and a character string pattern matching algorithm is suitable for scheduling Pod to nodes of a Kubernetes cluster, and is characterized by comprising the following steps:
forming a node main string according to the node resource table, and forming a pattern string to be matched according to the Pod resource scheduling request;
matching the pattern string to be matched with the node main string to obtain an available node;
selecting an optimal node for the obtained available nodes by adopting a Rete algorithm;
and deploying the Pod to the optimal node.
2. The method for scheduling load balancing resources based on Rete and string pattern matching algorithm according to claim 1,
and maintaining a resource table for each node through a scheduler, wherein the resource table entry records each item of resource attribute state data of the node.
3. The method for load balancing resource scheduling based on Rete and string pattern matching algorithm according to claim 2, wherein the forming of the node master string according to the node resource table comprises:
and converting each item of resource attribute state data of the nodes into predefined characters, and arranging according to the fixed sequence of the resource table items to form a main string of each node.
4. The method for load balancing resource scheduling based on Rete and string pattern matching algorithm according to claim 3, wherein the forming of the pattern string to be matched according to the Pod resource scheduling request comprises:
converting each resource attribute request in the Pod resource scheduling request into corresponding characters, wherein the resource attribute request adopts xiIndicating that x is the resource attribute request, and subscript i is the position of the resource attribute in the resource table;
and converting all resource attribute requests into characters and arranging the characters according to the sequence in the resource table entries to form a pattern string to be matched.
5. The method for load balancing resource scheduling based on Rete and string pattern matching algorithm according to claim 4, wherein the matching of the pattern string to be matched with the node master string to obtain the available node comprises:
finding the position of the character in the node main string through the subscript of the character in the pattern string to be matched;
comparing the character in the pattern string to be matched with the character at the same position in the node main string;
and if all characters in the pattern string to be matched are consistent with the comparison in the node main string, the node belongs to the available node, and the node is output and stored in the list of the available node.
6. The method for scheduling load balancing resources based on Rete and string pattern matching algorithm according to claim 5,
and if the available node is not matched, the Pod resource scheduling request waits until the next scheduling period to search the available node again.
7. The method for scheduling load balancing resources based on Rete and string pattern matching algorithm according to claim 1, wherein the selecting the best node for the obtained available nodes by using Rete algorithm comprises:
importing the available nodes into a fact set to construct a discrimination network;
matching facts, namely available nodes in a fact set;
and executing the connection operation until one rule matching is finished.
8. The method for scheduling load balancing resources based on Rete and string pattern matching algorithm according to claim 7, wherein the matching of the facts means that the attributes of the facts are judged, if the constraint conditions are met, the facts are continuously propagated to the subsequent nodes, otherwise, the subsequent propagation is abandoned, and the matching process is stopped;
the attributes of the fact are represented by reference number A, B, C:
a is 0, which indicates that after the resource is called into the available node k, the available node is full and the available node k is not available;
a is 1, which indicates that after the resource is called into the available node k, the available node is not full and the available node k is available;
b is 0, which means that all available nodes need to queue without idle nodes on the basis that the nodes are available after the resources are called into the available nodes;
b ═ 1, which means that all available nodes do not need to queue on the basis that the node is available after the resource is called into the available node;
b is 2, which means that on the basis that the nodes are available after the resources are called into the available nodes, part of the available nodes need to be queued, and the rest of the available nodes do not need to be queued;
c is 0, which means that the resource weight coefficient to be called is low;
c is 1, which means that the resource needing to be called has high weight coefficient and needs to be called preferentially;
the constraint conditions are as follows: the node is not fully loaded.
9. The method for scheduling load balancing resources based on Rete and string pattern matching algorithm according to claim 7, wherein the rules are as follows:
rule 1: when A is 0, after the resource is called into a node k, the node is fully loaded, and the node k is not available;
rule 2: a is 1, B is 0, C is 0, the weight coefficient of the resource needing to be called is low, no idle node exists, all the resources are queued from high to low according to the priority order of the weight, and the resource with the low weight coefficient is called after the other resources with the high weight coefficient are called;
rule 3: a is 1, B is 1, C is 0, the weight coefficient of the resource to be called is low, all nodes are all idle, and the resource is called to the idle node in sequence from high to low according to the priority of the resource weight;
rule 4: a is 1, B is 2, C is 0, the weight coefficient of the resource to be called is low, part of nodes need to queue, part of nodes are idle, the resource with low weight coefficient waits for the node needing to queue, and the resource with low weight coefficient is called again when the node finishes calling the resource to be idle;
rule 5: a is 1, B is 0, C is 1, the weight coefficient of the resource to be called is high, no idle node exists, all the resources are queued from high to low according to the priority order of the weight, and the resource with the high weight coefficient is called preferentially;
rule 6: a is 1, B is 1, C is 1, the weight coefficient of the resource to be called is high, all nodes are all idle, all idle nodes call the resource to the nodes in sequence from high to low according to the priority of the resource weight, and the resource with the high weight coefficient is called preferentially;
rule 7: a is 1, B is 2, C is 1, the weight coefficient of the resources to be called is high, part of the nodes need to queue, part of the nodes are idle, and the resources with high weight coefficients are preferentially called to the idle nodes.
CN202110551965.XA 2021-05-20 2021-05-20 Load balancing resource scheduling method based on Rete and character string pattern matching algorithm Active CN113391891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110551965.XA CN113391891B (en) 2021-05-20 2021-05-20 Load balancing resource scheduling method based on Rete and character string pattern matching algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110551965.XA CN113391891B (en) 2021-05-20 2021-05-20 Load balancing resource scheduling method based on Rete and character string pattern matching algorithm

Publications (2)

Publication Number Publication Date
CN113391891A true CN113391891A (en) 2021-09-14
CN113391891B CN113391891B (en) 2024-03-12

Family

ID=77618135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110551965.XA Active CN113391891B (en) 2021-05-20 2021-05-20 Load balancing resource scheduling method based on Rete and character string pattern matching algorithm

Country Status (1)

Country Link
CN (1) CN113391891B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377259A (en) * 2012-04-28 2013-10-30 北京新媒传信科技有限公司 Multiple-mode-string matching method and device
CN109960585A (en) * 2019-02-02 2019-07-02 浙江工业大学 A kind of resource regulating method based on kubernetes
CN110780998A (en) * 2019-09-29 2020-02-11 武汉大学 Kubernetes-based dynamic load balancing resource scheduling method
CN111694633A (en) * 2020-04-14 2020-09-22 新华三大数据技术有限公司 Cluster node load balancing method and device and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377259A (en) * 2012-04-28 2013-10-30 北京新媒传信科技有限公司 Multiple-mode-string matching method and device
CN109960585A (en) * 2019-02-02 2019-07-02 浙江工业大学 A kind of resource regulating method based on kubernetes
CN110780998A (en) * 2019-09-29 2020-02-11 武汉大学 Kubernetes-based dynamic load balancing resource scheduling method
CN111694633A (en) * 2020-04-14 2020-09-22 新华三大数据技术有限公司 Cluster node load balancing method and device and computer storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨杨;石晓丹;宋双;霍永华;陈连栋;: "基于Rete规则推理的告警关联性分析", 北京邮电大学学报, no. 02 *
汪成亮;黄心田;: "智能环境下基于雾计算的推理节点优化分配研究", 电子学报, no. 01 *

Also Published As

Publication number Publication date
CN113391891B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
CN107239335B (en) Job scheduling system and method for distributed system
WO2021208546A1 (en) Multi-dimensional resource scheduling method in kubernetes cluster architecture system
CN109960585A (en) A kind of resource regulating method based on kubernetes
US7779008B2 (en) Parallel partition-wise aggregation
CN104636204B (en) A kind of method for scheduling task and device
US8775622B2 (en) Computer-based cluster management system and method
CN103345514A (en) Streamed data processing method in big data environment
CN108427602B (en) Distributed computing task cooperative scheduling method and device
CN113157694A (en) Database index generation method based on reinforcement learning
CN108415912A (en) Data processing method based on MapReduce model and equipment
CN110084507A (en) The scientific workflow method for optimizing scheduling of perception is classified under cloud computing environment
CN109150759B (en) Progressive non-blocking opportunity resource reservation method and system
CN111414961A (en) Task parallel-based fine-grained distributed deep forest training method
US8667008B2 (en) Search request control apparatus and search request control method
CN111324429B (en) Micro-service combination scheduling method based on multi-generation ancestry reference distance
CN113391891B (en) Load balancing resource scheduling method based on Rete and character string pattern matching algorithm
CN112579319A (en) Service calling method and device based on LRU Cache optimization
CN104598567B (en) A kind of method of the data statistics re-scheduling based on Hadoop MapReduce programming frameworks
CN109889573A (en) Based on the Replica placement method of NGSA multiple target in mixed cloud
Guo et al. Handling data skew at reduce stage in Spark by ReducePartition
Wang et al. Multi-Granularity Decomposition for Componentized Multimedia Applications based on Graph Clustering
CN114978913A (en) Service function chain cross-domain deployment method and system based on chain cutting
CN114138484A (en) Resource allocation method, device and medium
CN114429195A (en) Performance optimization method and device for hybrid expert model training
CN107784032A (en) Gradual output intent, the apparatus and system of a kind of data query result

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