Multi-node intelligent scheduling service segmentation collaborative control method and system

CN119210992BActive Publication Date: 2026-09-18HUIYOU TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411323484.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2026-09-18
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

[0004]传统的故障节点处理方法在节点故障发生时,通常采取简单的业务转移策略,无法根据故障的特征进行灵活决策,缺乏根据故障类型动态决策是否需要更换主控节点的机制

Benefits of technology

[0062] This application proposes a fine-grained business splitting and resource matching method, which can flexibly split and allocate the unfinished business of a faulty node to other available nodes, thereby achieving continuous execution of business and minimizing business losses caused by failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119210992B_ABST
    Figure CN119210992B_ABST
Patent Text Reader

Abstract

This application relates to a multi-node intelligent scheduling service segmentation collaborative control method and system in the field of Internet technology. It employs a heartbeat detection mechanism to periodically send and listen to heartbeat signals, identifying abnormal signals. Nodes displaying abnormal signals are marked as faulty nodes, and their resource indicators are obtained to identify the fault type. Fault notifications are sent to other nodes based on the fault type, and a new master node agent is elected based on the notifications. The master node reads the service execution information of the faulty node, breaks down unfinished services into sub-services, obtains the remaining available resources of available nodes and the resource requirements of the sub-services, and allocates them to available nodes according to the resource requirements of the sub-services. The faulty node is repaired; if repair is successful, the master node returns the service; if repair fails, the service is reallocated and replaced. This achieves fault node handling and load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a business segmented collaborative control method and system for multi-node intelligent scheduling. Background Technology

[0002] In modern large-scale distributed systems, such as cloud computing, the Internet of Things, and large-scale industrial control systems, the intelligent scheduling and control of multiple nodes is a challenge. These nodes may be located in different geographical locations or in different subsystems, each handling different business tasks. To improve the overall efficiency, reliability, and responsiveness of the system, intelligent scheduling of these nodes is required, along with collaborative control at the business level.

[0003] Chinese patent CN110430071A discloses a method, apparatus, computer device, and storage medium for self-healing of service node faults. The method includes acquiring monitoring data of service nodes, load balancing devices, and service distribution to form data to be analyzed; performing intelligent analysis based on the data to be analyzed to determine whether a fault exists; if so, acquiring the fault point corresponding to the fault and sending the corresponding alarm information; performing self-healing repair on the fault point to obtain the repair result; and confirming the repair result.

[0004] Traditional fault node handling methods typically employ simple business transfer strategies when a node failure occurs. They cannot make flexible decisions based on the characteristics of the fault and lack a mechanism to dynamically decide whether to replace the master control node based on the fault type. Summary of the Invention

[0005] This application aims to at least partially address one of the technical problems in related technologies. To this end, one objective of this application is to propose a multi-node intelligent scheduling service segmentation collaborative control method and system, which realizes the handling of faulty nodes and the allocation of service segments.

[0006] One aspect of this application provides a service segmentation collaborative control method for multi-node intelligent scheduling, including:

[0007] Step S100: Deploy a heartbeat detection mechanism in each node agent to periodically send heartbeat signals to other node agents and listen to the heartbeat signals of other node agents to identify abnormal signals;

[0008] Step S200: Mark the node agent that sends the abnormal signal as the faulty node agent, obtain the resource indicators of the faulty node agent, and identify the fault type of the faulty node agent based on the resource indicator classification model.

[0009] Step S300: The faulty node agent sends a fault notification to other node agents according to the fault type. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected.

[0010] Step S400: The master control node intelligent agent reads the business execution information of the faulty node intelligent agent, breaks down the unfinished business into m sub-businesses, obtains the remaining available resources of the available node intelligent agents and the resource requirements of the sub-businesses, and allocates them to the available node intelligent agents according to the resource requirements of the sub-businesses;

[0011] Step S500: Repair the faulty node agent. If the repair is successful, the master node agent will return the service. If the repair fails, the faulty node agent will be reassigned and replaced.

[0012] Specifically, the method for deploying a heartbeat detection mechanism in each node agent, periodically sending heartbeat signals to other node agents and listening to their heartbeat signals, and identifying abnormal signals is as follows:

[0013] Step S110: Define the node information of the node agent, including node ID, node role, resource information, node status, and business execution information. The node role includes master node agent and non-master node agent. The node status includes normal, fault, and unavailable. Register the node information of the node agent in the global node status table.

[0014] Step S120: Deploy a heartbeat detection mechanism in each node agent. The heartbeat detection mechanism includes a heartbeat transmitter and a heartbeat listener. The heartbeat transmitter sends a heartbeat signal to all other node agents every a1 unit of time. The heartbeat listener continuously listens to the heartbeat signals sent by other node agents and records the timestamp of the most recent heartbeat signal received from each node agent. The heartbeat signal includes the node ID of the sender and the timestamp.

[0015] Step S130: The heartbeat listener checks the timestamp of each heartbeat signal every a2 units of time. If the time difference between the timestamp of the heartbeat signal of the node agent and the current timestamp is greater than the time difference threshold, the heartbeat signal is marked as an abnormal signal.

[0016] Specifically, the method for marking the node agent that sends the abnormal signal as a faulty node agent, obtaining the resource indicators of the faulty node agent, and identifying the fault type of the faulty node agent based on the resource indicator classification model is as follows:

[0017] Step S210: When the heartbeat listener detects an abnormal heartbeat signal from a node agent for a3 consecutive times, a fault alarm is triggered, the node status of the node agent that sent the abnormal signal is obtained, the node status is changed to fault in the node status table, and the node agent is marked as a faulty node agent.

[0018] Step S220: Collect abnormal resource indicators and their fault characteristics of historical fault node agents, extract feature vectors, construct n1 training samples, and train a resource indicator classification model containing K categories.

[0019] The specific training process of the resource index classification model is as follows:

[0020] Step S221: Collect abnormal resource indicators of historical fault node agents to form a time series of abnormal resource indicators;

[0021] Step S222: Define the length of the time window, extract features from the abnormal resource indicators of each time window to obtain feature vectors, and use the sliding window technique to divide the time series of abnormal resource indicators into n1 training samples.

[0022] Step S223: Set the target number of clusters K, and randomly select K training samples as the initial cluster centers;

[0023] Step S224: For each training sample's feature vector, calculate its Euclidean distance to the feature vector of each cluster center, and assign the training sample to the category of the cluster center that is closest to it;

[0024] Step S225: Recalculate the mean vector of the feature vectors of all training samples in each category, and use the mean vector as the new cluster center;

[0025] Step S226: Repeat steps S224 to S225 until the training samples in each category no longer change, and obtain the trained resource index classification model.

[0026] Step S230: Calculate the mean vector μ of the training samples in each category. k The covariance matrix C k ;

[0027] Step S240: The corresponding fault labels are manually marked according to the fault characteristics of the cluster centers in each category. The fault labels include, but are not limited to, node downtime, resource exhaustion, software failure, load fluctuation, network jitter and security events.

[0028] Step S250: Real-time acquisition of resource indicators and feature vectors of the fault node agent, calculation of Mahalanobis distance between the resource indicators of the fault node agent and each category, and obtaining the similarity measure between the resource indicators of the fault node agent and each category based on the Mahalanobis distance.

[0029] Step S260: Based on the resource indicators of the faulty node agent and the Mahalanobis distance and covariance matrix C between each category... k Calculate the probability of the resource indicators of the faulty node agent belonging to each category of anomalies;

[0030] Step S270: Weight the similarity measure and the anomaly probability to obtain the anomaly diagnosis score between the resource indicators of the faulty node agent and each category, and obtain the fault label of the category with the smallest anomaly diagnosis score between the resource indicators of the faulty node agent. The fault label is the fault type of the faulty node agent.

[0031] The formula for calculating the abnormal diagnostic score is: s k =α1×q k +β1×p k , where q k p represents the similarity measure between the resource metrics of the faulty node agent and the k-th category. k This represents the probability that the resource indicators of the faulty node agent belong to the k-th category of anomalies.

[0032] The formula for calculating the similarity between the resource indicators of the faulty node agent and the k-th category is as follows: Where, d k The Mahalanobis distance between the resource index of the faulty node agent and the cluster center of the k-th category;

[0033] The formula for calculating the Mahalanobis distance between the resource indicators of the faulty node agent and the cluster center of the k-th category is: Where x represents the feature vector of the resource indicators of the faulty node agent, μ k Let T represent the mean vector of the training samples in the k-th category, and let T be the transpose. This represents the inverse of the covariance matrix of the training samples in the k-th category;

[0034] The formula for calculating the probability of anomalies in the resource indicators of the faulty node agent in the k-th category is as follows: Where n represents the feature dimension of the feature vector, |C k | represents the covariance matrix C k The determinant of , exp(·) represents the exponential function.

[0035] Specifically, the faulty node agent sends a fault notification to other node agents based on the fault type. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, the specific method for electing a new master node agent is as follows:

[0036] Step S310: The faulty node agent constructs a fault notification based on its fault type, node role, and timestamp, and sends the fault notification to other node agents;

[0037] Step S320: After receiving the fault notification, other node agents mark the node status of the faulty node agent as unavailable in the node status table;

[0038] Step S330: Other node agents determine whether a new master node agent needs to be elected based on the node role in the fault notification. If the faulty node agent is a non-master node agent, then a new master node agent does not need to be elected. If the faulty node agent is the master node agent and the fault type is any one of node crash, resource exhaustion, software failure, or security event, then a new master node agent is elected. Otherwise, a new master node agent does not need to be elected.

[0039] Step S340: For each node agent in a normal state, calculate the stability index S of the heartbeat signals it sends over the past time period T1. success Obtain the number n of nodes directly connected to each node agent in the network topology. neib And the resource index y over the past time period T1, and calculate the average resource index based on the resource index over the past time period T1. Based on stability metrics, number of nodes, and average resource metrics, calculate the comprehensive score for each node agent.

[0040] Step S350: Each node agent packages its comprehensive score and node ID into a voting message and sends it to all other non-faulty node agents. Each node agent is sorted in descending order based on its comprehensive score, and the node agent with the highest comprehensive score is selected as the master node agent.

[0041] Specifically, the master control node intelligent agent reads the service execution information of the faulty node intelligent agent, breaks down the unfinished service into m sub-services, obtains the remaining available resources of the available node intelligent agents and the resource requirements of the sub-services, and allocates the resources to the available node intelligent agents according to the resource requirements of the sub-services. The specific method is as follows:

[0042] Step S410: The master control node agent reads the business execution information of the faulty node agent, the business execution information including: business logic, business priority and business execution progress;

[0043] Step S420: The master control node intelligent agent sorts the unfinished business according to the business priority from high to low, and based on the priority order, breaks down the unfinished business into m sub-businesses according to the business logic;

[0044] Step S430: Obtain the resource requirements of each sub-service. The master control node agent constructs a list of available node agents based on all node agents in the current node status table that are in normal status.

[0045] Step S440: The master control node agent traverses the unfinished sub-services. For each sub-service, the available node agent with the highest remaining available resources is selected as the node agent to execute the sub-service.

[0046] Step S450: If the remaining available resources of all available node agents are insufficient to handle the sub-service, the sub-service will be further broken down until an available node agent that meets the resource requirements of the sub-service is found.

[0047] Step S460: The master node agent assigns the sub-service to the selected available node agent.

[0048] Specifically, the method for repairing the faulty node agent, where the master node agent returns the service if the repair is successful, and the service is reallocated and replaced if the repair fails, is as follows:

[0049] Step S510: The master control node agent repairs the faulty node agent. During the repair process, the master control node agent monitors the node status of the faulty node agent in real time and sets a first duration t1 as the time limit for repair.

[0050] Step S520: If the repair is successful within the first time period t1, the master control node agent will return the transferred services to the repaired node agent and update the node status table.

[0051] Step S530: If the repair cannot be completed within the first time period t1, the master control node agent will allocate the remaining services of the faulty node agent to other available node agents.

[0052] Step S540: Set a second duration t2 as the time limit for node replacement. If the faulty node agent still cannot be repaired within the second duration t2, the master node agent sends a replacement notification to the administrator, notifying the administrator to replace the faulty node agent with a new node agent.

[0053] One aspect of this application provides a multi-node intelligent scheduling service segmentation collaborative control system, including:

[0054] The abnormal signal identification module is used to deploy a heartbeat detection mechanism in each node agent, periodically send heartbeat signals to other node agents and listen to the heartbeat signals of other node agents, and identify abnormal signals.

[0055] The fault type identification module is used to mark the node agent that sends abnormal signals as a faulty node agent, obtain the resource indicators of the faulty node agent, and identify the fault type of the faulty node agent based on the resource indicator classification model.

[0056] The master node election module is used to send fault notifications to other node agents based on the fault type of the faulty node agent. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected.

[0057] The node service allocation module is used by the master control node agent to read the service execution information of the faulty node agent, split the unfinished service into m sub-services, obtain the remaining available resources of the available node agents and the resource requirements of the sub-services, and allocate them to the available node agents according to the resource requirements of the sub-services.

[0058] The fault node processing module is used to repair the faulty node intelligent agent. If the repair is successful, the master node intelligent agent will return the business; if the repair fails, the faulty node intelligent agent will be reassigned and replaced.

[0059] One aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement steps in a multi-node intelligent scheduling service segment collaborative control method.

[0060] One aspect of this application provides a readable storage medium storing a computer program adapted for loading by a processor to execute steps in a multi-node intelligent scheduling service segmentation collaborative control method.

[0061] The multi-node intelligent scheduling service segmentation collaborative control method and system proposed in this application have the following advantages over existing technologies:

[0062] This application proposes a fine-grained business splitting and resource matching method, which can flexibly split and allocate the unfinished business of a faulty node to other available nodes, thereby achieving continuous execution of business and minimizing business losses caused by failure.

[0063] This application proposes a mechanism for decision-making node switching based on fault type. For a failure of the master node, switching is only triggered under severe faults, while switching is not triggered for relatively minor faults. This strategy of differentiating treatment based on fault severity helps to achieve a balance between system availability and switching costs.

[0064] The dynamic decision-making mechanism proposed in this application avoids unnecessary and frequent master node switching, reduces system jitter and service interruption caused by switching, and makes switching decisions more intelligent. It adaptively selects whether to switch and which node to switch to based on the fault scenario, rather than simply switching to the backup node according to a fixed process.

[0065] This application shifts from a passive fault response to a proactive risk control approach, promptly assessing and adjusting based on the severity and scope of the fault to improve the system's ability to cope with complex faults. Attached Figure Description

[0066] Figure 1 A flowchart of the service segment collaborative control method for multi-node intelligent scheduling provided in this application;

[0067] Figure 2 A flowchart of the method for identifying fault types of faulty node agents provided in this application;

[0068] Figure 3 A flowchart illustrating the dynamic decision-making method for master node switching provided in this application;

[0069] Figure 4 Functional module diagram of the multi-node intelligent scheduling business segment collaborative control system provided in this application;

[0070] Figure 5 A schematic diagram of the structure of an electronic device provided in this application;

[0071] Figure 6 This is a schematic diagram of a readable storage medium structure provided in this application. Detailed Implementation

[0072] To better understand this application, various aspects of this application will be described in more detail with reference to the accompanying drawings. It should be understood that these detailed descriptions are merely illustrative of exemplary embodiments of this application and are not intended to limit the scope of this application in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.

[0073] In the accompanying drawings, the size, dimensions, and shapes of the elements have been slightly adjusted for ease of illustration. The drawings are for illustrative purposes only and are not strictly to scale. As used herein, the terms “approximately,” “about,” and similar terms are used to indicate approximation, not degree, and are intended to illustrate inherent deviations in measured or calculated values ​​that will be recognized by one of ordinary skill in the art. Furthermore, the order in which the steps are described in this application does not necessarily indicate the order in which these steps occur in actual operation, unless otherwise expressly defined or deduced from the context.

[0074] It should also be understood that expressions such as "comprising," "including," "having," "containing," and / or "comprising" are open-ended rather than closed-ended expressions in this specification, indicating the presence of the stated features, elements, and / or components, but not excluding the presence of one or more other features, elements, components, and / or combinations thereof. Furthermore, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire list of features, not just individual elements in the list. Additionally, when describing embodiments of this application, the word "may" is used to mean "one or more embodiments of this application." And the term "exemplary" is intended to refer to examples or illustrations.

[0075] Unless otherwise specified, all terms used herein (including engineering and technical terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that, unless expressly stated herein, terms defined in common dictionaries shall be interpreted as having the meaning consistent with their meaning in the context of the relevant art, and not as having an idealized or overly formalized meaning.

[0076] It should be noted that, where there is no conflict, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0077] Example 1

[0078] like Figure 1 As shown, the multi-node intelligent scheduling service segmentation collaborative control method provided in this application includes:

[0079] Step S100: Deploy a heartbeat detection mechanism in each node agent to periodically send heartbeat signals to other node agents and listen to the heartbeat signals of other node agents to identify abnormal signals.

[0080] The specific method for deploying a heartbeat detection mechanism in each node agent, periodically sending heartbeat signals to other node agents and listening to their heartbeat signals, and identifying abnormal signals is as follows:

[0081] Step S110: Define the node information of the node agent, including node ID, node role, resource information, node status, and business execution information. The node role includes master node agent and non-master node agent. The node status includes normal, fault, and unavailable. Register the node information of the node agent in the global node status table.

[0082] The master node agent is a special node in the system that is responsible for coordinating and managing other node agents, and has higher privileges and a more comprehensive system view.

[0083] The master node intelligent agent has a coordinator-coordinated relationship with other node intelligent agents. The master node intelligent agent is responsible for managing and scheduling the cluster's resources and services, while other node intelligent agents register node information in the global node status table.

[0084] Centralized state management provides the master node with a global perspective, making it easier to grasp the operation status of the entire cluster and providing a basis for making global decisions. Non-master node agents then execute specific business logic according to the instructions of the master node agents.

[0085] Step S120: Deploy a heartbeat detection mechanism in each node agent. The heartbeat detection mechanism includes a heartbeat transmitter and a heartbeat listener. The heartbeat transmitter sends a heartbeat signal to all other node agents every a1 unit of time. The heartbeat listener continuously listens to the heartbeat signals sent by other node agents and records the timestamp of the most recent heartbeat signal received from each node agent. The heartbeat signal includes the node ID of the sender and the timestamp.

[0086] The timestamp refers to the timestamp when the sending node agent sends the heartbeat signal;

[0087] Step S130: The heartbeat listener checks the timestamp of each heartbeat signal every a2 units of time. If the time difference between the timestamp of the heartbeat signal of the node agent and the current timestamp is greater than the time difference threshold, the heartbeat signal is marked as an abnormal signal.

[0088] The unit duration is 1 second;

[0089] The values ​​of a1, a2, and the time difference threshold are set by those skilled in the art based on experience and actual needs;

[0090] Preferably, a1 equals 5, a2 equals 10, and the time difference threshold is 30 seconds.

[0091] The heartbeat detection mechanism proposed in step S100 is the foundation and prerequisite for solving the dynamic decision-making of subsequent master node switching. By deploying a heartbeat transmitter and a heartbeat listener in each node agent and exchanging heartbeat signals periodically, mutual perception and synchronization of the state between nodes are achieved.

[0092] Step S200: Mark the node agent that sends the abnormal signal as the faulty node agent, obtain the resource indicators of the faulty node agent, and identify the fault type of the faulty node agent based on the resource indicator classification model.

[0093] like Figure 2 The diagram shown is a flowchart of the method for identifying the fault type of a faulty node agent provided in this application.

[0094] The specific method for marking the node agent that sends abnormal signals as a faulty node agent, obtaining the resource indicators of the faulty node agent, and identifying the fault type of the faulty node agent based on the resource indicator classification model is as follows:

[0095] Step S210: When the heartbeat listener detects an abnormal heartbeat signal from a node agent for a3 consecutive times, a fault alarm is triggered, the node status of the node agent that sent the abnormal signal is obtained, the node status is changed to fault in the node status table, and the node agent is marked as a faulty node agent.

[0096] The value of a3 is set by those skilled in the art based on experience and actual needs; preferably, a3 equals 3;

[0097] Step S220: Collect abnormal resource indicators and their fault characteristics of historical fault node agents, extract feature vectors, construct n1 training samples, and train a resource indicator classification model containing K categories.

[0098] The resource indicator refers to the resources already used by the node agent;

[0099] The specific training process of the resource index classification model is as follows:

[0100] Step S221: Collect abnormal resource indicators of historical fault node agents to form a time series of abnormal resource indicators;

[0101] The abnormal resource indicators of the historical fault node agents include, but are not limited to, six types of faults: node crash, resource exhaustion, software failure, load fluctuation, network jitter, and security incident.

[0102] Step S222: Define the length of the time window, extract features from the abnormal resource indicators of each time window to obtain feature vectors, and use the sliding window technique to divide the time series of abnormal resource indicators into n1 training samples.

[0103] The feature vector is an n-dimensional feature vector;

[0104] Step S223: Set the target number of clusters K, and randomly select K training samples as the initial cluster centers;

[0105] Step S224: For each training sample's feature vector, calculate its Euclidean distance to the feature vector of each cluster center, and assign the training sample to the category of the cluster center that is closest to it;

[0106] Step S225: Recalculate the mean vector of the feature vectors of all training samples in each category, and use the mean vector as the new cluster center;

[0107] Step S226: Repeat steps S224 to S225 until the training samples in each category no longer change, and obtain the trained resource index classification model.

[0108] Step S230: Calculate the mean vector μ of the training samples in each category. k The covariance matrix C k ;

[0109] Step S240: The corresponding fault labels are manually marked according to the fault characteristics of the cluster centers in each category. The fault labels include, but are not limited to, node downtime, resource exhaustion, software failure, load fluctuation, network jitter and security events.

[0110] The fault labels include, but are not limited to, the six fault labels mentioned above, which are common fault types. When this application is applied to actual situations, the fault labels for each cluster category are labeled by those skilled in the art based on the characteristics of the samples in that category.

[0111] For example, suppose that after clustering, two categories are obtained. The fault characteristics of the cluster centers of category 1 are CPU utilization of 90% and memory utilization of 30%, and the fault characteristics of the cluster centers of category 2 are CPU utilization of 30% and memory utilization of 90%. Then, according to the fault characteristics of category 1, the fault label of category 1 is CPU resource exhaustion, and according to the fault characteristics of category 2, the fault label of category 2 is memory resource exhaustion.

[0112] Step S250: Real-time acquisition of resource indicators and feature vectors of the fault node agent, calculation of Mahalanobis distance between the resource indicators of the fault node agent and each category, and obtaining the similarity measure between the resource indicators of the fault node agent and each category based on the Mahalanobis distance.

[0113] Step S260: Based on the resource indicators of the faulty node agent and the Mahalanobis distance and covariance matrix C between each category...k Calculate the probability of the resource indicators of the faulty node agent belonging to each category of anomalies;

[0114] Step S270: Weight the similarity measure and the anomaly probability to obtain the anomaly diagnosis score between the resource indicators of the faulty node agent and each category, and obtain the fault label of the category with the smallest anomaly diagnosis score between the resource indicators of the faulty node agent. The fault label is the fault type of the faulty node agent.

[0115] The formula for calculating the abnormal diagnostic score is: s k =α1×q k +β1×p k , where q k p represents the similarity measure between the resource metrics of the faulty node agent and the k-th category. k The probability that the resource index of the faulty node agent belongs to the k-th category is abnormal. α1 and β1 are the weight coefficients of similarity measure and abnormal probability, respectively, which are set by those skilled in the art based on experience.

[0116] The formula for calculating the similarity between the resource indicators of the faulty node agent and the k-th category is as follows: Where, d k The Mahalanobis distance between the resource index of the faulty node agent and the cluster center of the k-th category;

[0117] The formula for calculating the Mahalanobis distance between the resource indicators of the faulty node agent and the cluster center of the k-th category is: Where x represents the feature vector of the resource indicators of the faulty node agent, μ k Let T represent the mean vector of the training samples in the k-th category, and let T be the transpose. This represents the inverse of the covariance matrix of the training samples in the k-th category;

[0118] The formula for calculating the probability of anomalies in the resource indicators of the faulty node agent in the k-th category is as follows: Where n represents the feature dimension of the feature vector, and C k Represents the covariance matrix C k The determinant of exp(·) represents the exponential function;

[0119] The smaller the Mahalanobis distance, the greater the similarity metric, indicating that the resource indicators of the faulty node agent are more similar to the k-th category;

[0120] The higher the probability that the resource indicators of the faulty node agent belong to the k-th category, the more similar the resource indicators of the faulty node agent are to the k-th category.

[0121] For the establishment of a dynamic decision-making mechanism for master node switching, the resource index classification model established in the above steps is the foundation for the decision-making mechanism. One of the decision-making factors is the fault type, which is obtained based on the resource index classification model. By applying the resource index of the actual faulty node to the trained resource index classification model, the faulty node is determined to belong to which category based on the abnormal diagnosis score between the resource index of the faulty node and each category, thereby determining its fault type. The above steps introduce intelligent diagnostic technology based on clustering algorithms. By automatically generating fault type diagnostic rules, rapid fault diagnosis and accurate fault location are achieved, greatly improving the efficiency and accuracy of diagnosis.

[0122] Step S300: The faulty node agent sends a fault notification to other node agents according to the fault type. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected.

[0123] The faulty node agent sends a fault notification to other node agents based on the fault type. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, the specific method for electing a new master node agent is as follows:

[0124] Step S310: The faulty node agent constructs a fault notification based on its fault type, node role, and timestamp, and sends the fault notification to other node agents;

[0125] Step S320: After receiving the fault notification, other node agents mark the node status of the faulty node agent as unavailable in the node status table;

[0126] Step S330: Other node agents determine whether a new master node agent needs to be elected based on the node role in the fault notification. If the faulty node agent is a non-master node agent, then a new master node agent does not need to be elected. If the faulty node agent is the master node agent and the fault type is any one of node crash, resource exhaustion, software failure, or security event, then a new master node agent is elected. Otherwise, a new master node agent does not need to be elected.

[0127] Step S340: For each node agent in a normal state, calculate the stability index S of the heartbeat signals it sends over the past time period T1. success Obtain the number n of nodes directly connected to each node agent in the network topology. neib And the resource index y over the past time period T1, and calculate the average resource index based on the resource index over the past time period T1. Based on stability metrics, number of nodes, and average resource metrics, calculate the comprehensive score for each node agent.

[0128] The formula for calculating the stability index is: Where count represents the number of times a heartbeat signal was successfully sent within the past duration T1. This represents the number of times a heartbeat signal was theoretically successfully sent within the past duration T1.

[0129] The formula for calculating the average resource index is as follows: Where Δt is the sampling interval for resource indicators;

[0130] Preferably, Δt equals 5 seconds;

[0131] The formula for calculating the overall score is as follows: Where, α S , α y These are the weighting coefficients for stability metrics, number of nodes, and average resource metrics, respectively.

[0132] The weighting coefficients of the stability index, number of nodes, and average resource index are set by those skilled in the art based on actual needs and experience.

[0133] Step S350: Each node agent packages its comprehensive score and node ID into a voting message and sends it to all other non-faulty node agents. Each node agent is sorted in descending order based on its comprehensive score, and the node agent with the highest comprehensive score is selected as the master node agent.

[0134] Figure 3 A flowchart illustrating the dynamic decision-making method for master node switching provided in this application.

[0135] The above steps dynamically determine whether a new master node needs to be elected based on the role of the faulty node (master / non-master) and the type of fault (node ​​crash, resource exhaustion, software failure, load fluctuation, network jitter, and security incidents, etc.), enabling more refined fault handling. For non-master node failures, there is no need to switch master nodes, reducing unnecessary election overhead; master node switching is only triggered when the master node experiences a serious failure, avoiding frequent master node switching; when a new master node needs to be elected, a comprehensive score is calculated considering factors such as node stability, connectivity, and resource metrics to select a superior new master node, ensuring that the new master node has sufficient capabilities to take over the work of the original master node.

[0136] Step S400: The master control node intelligent agent reads the business execution information of the faulty node intelligent agent, breaks down the unfinished business into m sub-businesses, obtains the remaining available resources of the available node intelligent agents and the resource requirements of the sub-businesses, and allocates them to the available node intelligent agents according to the resource requirements of the sub-businesses.

[0137] The master control node intelligent agent reads the service execution information of the faulty node intelligent agent, breaks down the unfinished service into m sub-services, obtains the remaining available resources of the available node intelligent agents and the resource requirements of the sub-services, and allocates the resources of the sub-services to the available node intelligent agents according to their resource requirements. The specific method is as follows:

[0138] Step S410: The master control node agent reads the business execution information of the faulty node agent, the business execution information including: business logic, business priority and business execution progress;

[0139] Step S420: The master control node intelligent agent sorts the unfinished business according to the business priority from high to low, and based on the priority order, breaks down the unfinished business into m sub-businesses according to the business logic;

[0140] For a data processing business, it can be divided into m sub-businesses according to the data partitioning and processing stages; for a mathematical calculation business, it can be divided into m sub-businesses according to the sub-problems of the calculation.

[0141] Step S430: Obtain the resource requirements of each sub-service. The master control node agent constructs a list of available node agents based on all node agents in the current node status table that are in normal status.

[0142] Step S440: The master control node agent traverses the unfinished sub-services. For each sub-service, the available node agent with the highest remaining available resources is selected as the node agent to execute the sub-service.

[0143] Step S450: If the remaining available resources of all available node agents are insufficient to handle the sub-service, the sub-service will be further broken down until an available node agent that meets the resource requirements of the sub-service is found.

[0144] Step S460: The master node agent assigns the sub-service to the selected available node agent.

[0145] Breaking down unfinished tasks into multiple sub-tasks based on business logic and priority allows for finer-grained task allocation. This breakdown better matches the resource capabilities of available nodes, improves resource utilization efficiency, and accelerates business recovery.

[0146] If the available node resources are insufficient, the business can be further split into sub-businesses until a suitable node is found. This recursive splitting method can cope with complex resource constraint scenarios.

[0147] When the original master node fails, the new master node can seamlessly take over the business orchestration responsibilities of the original master node, ensuring the continuity of business orchestration work.

[0148] Step S500: Repair the faulty node agent. If the repair is successful, the master node agent will return the service. If the repair fails, the faulty node agent will be reassigned and replaced.

[0149] The specific method for repairing the faulty node agent, where the master node agent returns the service if the repair is successful, and the service is reallocated and replaced if the repair fails, is as follows:

[0150] Step S510: The master control node agent repairs the faulty node agent. During the repair process, the master control node agent monitors the node status of the faulty node agent in real time and sets a first duration t1 as the time limit for repair.

[0151] Step S520: If the repair is successful within the first time period t1, the master control node agent will return the transferred services to the repaired node agent and update the node status table.

[0152] Step S530: If the repair cannot be completed within the first time period t1, the master control node agent will allocate the remaining services of the faulty node agent to other available node agents.

[0153] When the master node agent distributes the remaining services of the failed node agent to other available node agents, it takes into account the priority of the services and the resource indicators of the nodes, and gives priority to distributing the services to node agents with normal resource indicators and closer network distance.

[0154] Step S540: Set a second duration t2 as the time limit for node replacement. If the faulty node agent still cannot be repaired within the second duration t2, the master node agent sends a replacement notification to the administrator, notifying the administrator to replace the faulty node agent with a new node agent.

[0155] The first duration t1 and the second duration t2 are set by those skilled in the art according to the fault type and actual needs; for example, t1 can be set to 30 minutes to 2 hours, and t2 can be set to 2 hours to 24 hours.

[0156] This step, by restoring the services of the recoverable nodes, can quickly restore the service division of each node after the master node switch, reducing the impact of the master node switch on services.

[0157] Timely removal of unrepairable faulty nodes and introduction of new nodes as replacements ensures that the system always has sufficient computing resources, providing resource guarantees for master node switching and enabling the new master node to realize its scheduling potential.

[0158] Example 2

[0159] like Figure 4 As shown, the system of service segmented collaborative control method for multi-node intelligent scheduling provided in this application includes:

[0160] The abnormal signal identification module is used to deploy a heartbeat detection mechanism in each node agent, periodically send heartbeat signals to other node agents and listen to the heartbeat signals of other node agents, and identify abnormal signals.

[0161] The fault type identification module is used to mark the node agent that sends abnormal signals as a faulty node agent, obtain the resource indicators of the faulty node agent, and identify the fault type of the faulty node agent based on the resource indicator classification model.

[0162] The master node election module is used to send fault notifications to other node agents based on the fault type of the faulty node agent. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected.

[0163] The node service allocation module is used by the master control node agent to read the service execution information of the faulty node agent, split the unfinished service into m sub-services, obtain the remaining available resources of the available node agents and the resource requirements of the sub-services, and allocate them to the available node agents according to the resource requirements of the sub-services.

[0164] The fault node processing module is used to repair the faulty node intelligent agent. If the repair is successful, the master node intelligent agent will return the business; if the repair fails, the faulty node intelligent agent will be reassigned and replaced.

[0165] Example 3

[0166] Figure 5 This is a schematic diagram of an electronic device structure provided in one embodiment of this application. Figure 5As shown, according to another aspect of this application, an electronic device is also provided. This electronic device may include one or more processors and one or more memories. The memories store computer-readable code, which, when executed by the one or more processors, can perform the multi-node intelligent scheduling service segmentation collaborative control method described above.

[0167] The method or system according to the embodiments of this application can also be used by means of Figure 5 The architecture of the electronic device shown is used to implement this. For example... Figure 5 As shown, the electronic device may include a bus, one or more CPUs, read-only memory (ROM), random access memory (RAM), a communication port connected to a network, input / output components, a hard disk, etc. The storage device in the electronic device, such as ROM or hard disk, may store the multi-node intelligent scheduling service segmentation collaborative control method provided in this application. A multi-node intelligent scheduling service segmentation and collaborative control method may include, for example, deploying a heartbeat detection mechanism in each node agent to periodically send heartbeat signals to other node agents and listen to their heartbeat signals to identify abnormal signals; marking node agents sending abnormal signals as faulty node agents, obtaining their resource indicators, and identifying their fault type based on a resource indicator classification model; the faulty node agent sending a fault notification to other node agents according to the fault type, and all node agents determining whether a new master node agent needs to be elected based on the fault notification; if so, electing a new master node agent; the master node agent reading the service execution information of the faulty node agent, splitting the unfinished service into m sub-services, obtaining the remaining available resources of available node agents and the resource requirements of the sub-services, and allocating them to available node agents according to the resource requirements of the sub-services; repairing the faulty node agent; if the repair is successful, the master node agent returns the service; if the repair fails, the faulty node agent is reassigned and replaced. Furthermore, the electronic device may also include a user interface. Of course, Figure 5 The architecture shown is merely exemplary and can be omitted as needed when implementing different devices. Figure 5 One or more components in the illustrated electronic device.

[0168] Example 4

[0169] Figure 6 This is a schematic diagram of a readable storage medium structure provided in one embodiment of this application. For example... Figure 6The diagram illustrates a readable storage medium according to one embodiment of this application. The computer-readable storage medium stores computer-readable instructions. When executed by a processor, the computer-readable instructions can perform the multi-node intelligent scheduling service segmentation collaborative control method according to an embodiment of this application, as described with reference to the above figures. The storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0170] Furthermore, according to the embodiments of this application, the process described in the above-mentioned flowchart can be implemented as a computer software program. For example, this application provides a non-transitory machine-readable storage medium storing machine-readable instructions that can be executed by a processor to perform instructions corresponding to the method steps provided in this application. For example: deploying a heartbeat detection mechanism in each node agent, periodically sending heartbeat signals to other node agents and listening to the heartbeat signals of other node agents to identify abnormal signals; marking the node agent that sends abnormal signals as a faulty node agent, obtaining the resource indicators of the faulty node agent, identifying the fault type of the faulty node agent based on a resource indicator classification model; the faulty node agent according to... The fault type sends a fault notification to other node agents. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected. The master node agent reads the service execution information of the faulty node agent, breaks down the unfinished service into m sub-services, obtains the remaining available resources of available node agents and the resource requirements of the sub-services, and allocates them to available node agents according to the resource requirements of the sub-services. The master node agent then attempts to repair the faulty node agent. If the repair is successful, the master node agent returns the service; if the repair fails, the master node agent reallocates and replaces the faulty node agent. When this computer program is executed by the central processing unit (CPU), it performs the functions defined in the method of this application.

[0171] The methods, apparatus, and devices of this application may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the method is for illustrative purposes only, and the steps of the method of this application are not limited to the order specifically described above, unless otherwise specifically stated. Furthermore, in some embodiments, this application may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the method according to this application. Thus, this application also covers recording media storing programs for performing the method according to this application.

[0172] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.

[0173] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for multi-node intelligent scheduling of traffic segmentation and cooperative control, characterized in that, include: Deploy a heartbeat detection mechanism in each node agent to periodically send heartbeat signals to other node agents and listen to their heartbeat signals to identify abnormal signals; The node agent that sends abnormal signals is marked as a faulty node agent. The resource indicators of the faulty node agent are obtained, and the fault type of the faulty node agent is identified based on the resource indicator classification model. The faulty node agent sends a fault notification to other node agents based on the fault type. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected. The master control node agent reads the business execution information of the faulty node agent, breaks down the unfinished business into m sub-businesses, sorts the unfinished businesses in descending order of business priority, obtains the remaining available resources of available node agents and the resource requirements of the sub-businesses, and allocates them to available node agents according to the resource requirements of the sub-businesses; the master control node agent iterates through the unfinished sub-businesses, and for each sub-business, selects the available node agent with the highest remaining available resources as the node agent to execute the sub-business; if the remaining available resources of all available node agents are insufficient to handle the sub-business, the sub-business is further broken down until an available node agent that meets the resource requirements of the sub-business is found; Repair the faulty node agent and set a first duration t1 as the repair time limit. If the repair is successful, the master node agent will return the service. If the repair fails, the faulty node agent will be reassigned and replaced, with a second duration t2 set as the time limit for node replacement. The specific method for marking the node agent that sends abnormal signals as a faulty node agent, obtaining the resource indicators of the faulty node agent, and identifying the fault type of the faulty node agent based on the resource indicator classification model is as follows: When the heartbeat listener detects an abnormal heartbeat signal from a node agent for a3 consecutive times, it triggers a fault alarm, obtains the node status of the node agent that sent the abnormal signal, changes its node status to fault in the node status table, and marks the node agent as a faulty node agent. Collect abnormal resource indicators and their fault characteristics of historical fault node agents, extract feature vectors, construct n1 training samples, and train a resource indicator classification model containing K categories. Statistically average the mean vector of the training samples in each class and covariance matrix ; The fault labels are manually assigned based on the fault characteristics of the cluster centers in each category. These fault labels include, but are not limited to, node downtime, resource exhaustion, software failure, load fluctuation, network jitter, and security incidents. The resource indicators and feature vectors of the fault node agent are acquired in real time. The Mahalanobis distance between the resource indicators of the fault node agent and each category is calculated. Based on the Mahalanobis distance, the similarity measure between the resource indicators of the fault node agent and each category is obtained. Mahalanobis distance between the resource indicators of the failed node agent and each category and a covariance matrix , calculate the abnormal probability of the resource indicators of the failed node agent belonging to each category; The similarity metric and the anomaly probability are weighted and summed to obtain the anomaly diagnosis score between the resource index of the fault node agent and each category. The fault label of the category with the smallest anomaly diagnosis score between the resource index of the fault node agent is obtained, and the fault label is the fault type of the fault node agent. The formula for calculating the abnormal diagnostic score is as follows: ,in, The similarity metric between the resource indicators of the faulty node agent and the k-th category. This represents the probability that the resource indicators of the faulty node agent belong to the k-th category of anomalies. The formula for calculating the similarity between the resource indicators of the faulty node agent and the k-th category is as follows: ,in, The Mahalanobis distance between the resource metrics of the faulty node agent and the cluster center of the k-th category; The faulty node agent sends a fault notification to other node agents based on the fault type. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, the specific method for electing a new master node agent is as follows: The faulty node agent constructs a fault notification based on its fault type, node role, and timestamp, and sends the fault notification to other node agents. After receiving the fault notification, other node agents mark the node status of the faulty node agent as unavailable in the node status table. Other node agents determine whether a new master node agent needs to be elected based on the node role in the fault notification. If the faulty node agent is a non-master node agent, then there is no need to elect a new master node agent. If the faulty node agent is the master node agent and the fault type is any one of node crash, resource exhaustion, software failure, or security event, then a new master node agent is elected. Otherwise, there is no need to elect a new master node agent. For each node agent in a normal state, calculate the stability index of its heartbeat signals sent over the past time period T1. Obtain the number of nodes directly connected to each node agent in the network topology. And the resource index y over the past time period T1, and calculate the average resource index based on the resource index over the past time period T1. Based on stability metrics, number of nodes, and average resource metrics, the comprehensive score of each node agent is calculated. Each node agent packages its comprehensive score and node ID into a voting message and sends it to all other non-faulty node agents. Each node agent is sorted in descending order based on its comprehensive score, and the node agent with the highest comprehensive score is selected as the master node agent.

2. The multi-node intelligent scheduling service segmentation collaborative control method as described in claim 1, characterized in that, The specific method for deploying a heartbeat detection mechanism in each node agent, periodically sending heartbeat signals to other node agents and listening to their heartbeat signals, and identifying abnormal signals is as follows: Define the node information of the node agent, including node ID, node role, resource information, node status, and business execution information. The node role includes master node agent and non-master node agent. The node status includes normal, fault, and unavailable. Register the node information of the node agent in the global node status table. A heartbeat detection mechanism is deployed in each node agent. The heartbeat detection mechanism includes a heartbeat transmitter and a heartbeat listener. The heartbeat transmitter sends a heartbeat signal to all other node agents every a1 unit of time. The heartbeat listener continuously listens to the heartbeat signals sent by other node agents and records the timestamp of the most recent heartbeat signal received from each node agent. The heartbeat signal includes the node ID of the sender and the timestamp. The heartbeat listener checks the timestamp of each heartbeat signal every a2 units of time. If the time difference between the timestamp of the node agent's heartbeat signal and the current timestamp is greater than the time difference threshold, the heartbeat signal is marked as an abnormal signal.

3. The multi-node intelligent scheduling service segmentation collaborative control method as described in claim 2, characterized in that, The specific training process of the resource index classification model is as follows: Step S221: Collect abnormal resource indicators of historical fault node agents to form a time series of abnormal resource indicators; Step S222: Define the length of the time window, extract features from the abnormal resource indicators of each time window to obtain feature vectors, and use the sliding window technique to divide the time series of abnormal resource indicators into n1 training samples. Step S223: Set the target number of clusters K, and randomly select K training samples as the initial cluster centers; Step S224: For each training sample's feature vector, calculate its Euclidean distance to the feature vector of each cluster center, and assign the training sample to the category of the cluster center that is closest to it; Step S225: Recalculate the mean vector of the feature vectors of all training samples in each category, and use the mean vector as the new cluster center; Step S226: Repeat steps S224 to S225 until the training samples in each category no longer change, and obtain the trained resource index classification model.

4. The multi-node intelligent scheduling service segmentation collaborative control method as described in claim 3, characterized in that, The master control node intelligent agent reads the service execution information of the faulty node intelligent agent, breaks down the unfinished service into m sub-services, obtains the remaining available resources of the available node intelligent agents and the resource requirements of the sub-services, and allocates the resources of the sub-services to the available node intelligent agents according to the resource requirements of the sub-services. The specific method is as follows: The master control node intelligent agent reads the business execution information of the faulty node intelligent agent, which includes: business logic, business priority, and business execution progress. Based on priority order, unfinished business tasks are divided into m sub-business tasks according to business logic; The resource requirements of each sub-business are obtained, and the master control node intelligent agent constructs a list of available node intelligent agents based on all node intelligent agents whose node status is normal in the current node status table. The master node agent assigns the sub-service to the selected available node agents.

5. The multi-node intelligent scheduling service segmentation collaborative control method as described in claim 4, characterized in that, The specific method for repairing the faulty node agent, where the master node agent returns the service if the repair is successful, and the service is reallocated and replaced if the repair fails, is as follows: The master control node agent repairs the faulty node agent. During the repair process, the master control node agent monitors the node status of the faulty node agent in real time. If the repair is successful within the first time interval t1, the master control node agent will return the transferred services to the repaired node agent and update the node status table. If the repair cannot be completed within the first time period t1, the master control node agent will distribute the remaining services of the failed node agent to other available node agents. If the faulty node agent still cannot be repaired within the second time period t2, the master node agent sends a replacement notification to the administrator, notifying the administrator to replace the faulty node agent with a new node agent.

6. A multi-node intelligent scheduling service segment collaborative control system, used to implement the multi-node intelligent scheduling service segment collaborative control method according to any one of claims 1-5, characterized in that, include: The abnormal signal identification module is used to deploy a heartbeat detection mechanism in each node agent, periodically send heartbeat signals to other node agents and listen to the heartbeat signals of other node agents, and identify abnormal signals. The fault type identification module is used to mark the node agent that sends abnormal signals as a faulty node agent, obtain the resource indicators of the faulty node agent, and identify the fault type of the faulty node agent based on the resource indicator classification model. The master node election module is used to send fault notifications to other node agents based on the fault type of the faulty node agent. All node agents determine whether a new master node agent needs to be elected based on the fault notification. If so, a new master node agent is elected. The node service allocation module is used by the master control node agent to read the service execution information of the faulty node agent, split the unfinished service into m sub-services, obtain the remaining available resources of the available node agents and the resource requirements of the sub-services, and allocate them to the available node agents according to the resource requirements of the sub-services. The fault node processing module is used to repair the fault node intelligent agent. If the repair is successful, the master node intelligent agent will return the business. If the repair fails, the faulty node's intelligent agent will be reassigned and replaced.

7. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the service segment collaborative control method for multi-node intelligent scheduling as described in any one of claims 1-5.

8. A readable storage medium, characterized in that, The readable storage medium stores a computer program adapted for loading by a processor to execute the steps in the multi-node intelligent scheduling service segmentation collaborative control method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Service node fault self-healing method, device, computer equipment and storage medium

    CN110430071A

  • Multi-mode process quality related fault diagnosis method based on sparse GMM

    CN109491338A

  • Heartbeat detection method of high-availability cluster, storage medium and computing node

    CN113595836A

  • Database disaster recovery management and control method and device

    CN117076196A