Cloud micro-service health monitoring method and system
By using an isolated forest model in a cloud microservice environment to filter out abnormal data points and generate server portraits, the problem of difficulty in timely discovering faults and performance bottlenecks in the existing technology is solved, and more accurate health assessment and the effect of reducing false positives is achieved.
Patent Information
- Application Number
- CN202510185393.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing cloud microservice health monitoring methods are difficult to fully cope with the complexity in cloud computing and microservice environments, and cannot detect potential failures and performance bottlenecks in a timely manner, resulting in a high false alarm rate and missed alarm rate of health status.
The pre-configured isolated forest model is used to filter out abnormal data points from the current operating status data of the cloud server node, generate a second server image, and calculate the portrait distance by comparing it with the historical server image to judge the actual health of the cloud server node.
By reflecting the health status of the server in real time, discovering potential failures or performance bottlenecks in a timely manner, reducing false alarms and missed reports, ensuring the stable operation of the cloud microservice architecture and the high availability of key services.
Smart Images

Figure CN119669001A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a cloud microservice health monitoring method and system. Background Art
[0002] With the widespread application of cloud computing and microservice architecture, the complexity and dynamics of the system operating environment continue to increase; the microservice architecture splits the application system into multiple highly decoupled service modules, each of which can be deployed, expanded and run independently; however, the operating status of the service module is directly related to the stability and performance of the entire system, so health monitoring has become a key task in microservice management.
[0003] Traditional health monitoring methods usually use fixed thresholds to determine service status, such as thresholds based on preset CPU usage, response time, or error rate; however, fixed threshold methods face many challenges in practical applications; for example, the system operating load may change significantly over time, scenarios, or user behavior, and fixed thresholds cannot fully adapt to these dynamic changes.
[0004] In order to cope with the limitations of fixed thresholds, dynamic threshold methods have been introduced to adapt to real-time changes in service operation status. For example, a Chinese patent application with publication number CN116016276A discloses a server health status detection method and device. Although such methods can dynamically adjust monitoring standards by analyzing historical data or real-time indicators, and improve the adaptability and flexibility of monitoring to a certain extent, dynamic threshold methods are still difficult to fully cope with the complexity in cloud computing and microservice environments, and it is difficult to comprehensively evaluate the system health status. It is easy to ignore complex correlations and potential system risks, and it is impossible to detect potential faults and performance bottlenecks in time, resulting in high false positive and false negative rates of server health status, and it is difficult to ensure the reliability of the monitoring system. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a cloud microservice health monitoring method and system.
[0006] To achieve the above object, the present invention provides the following technical solutions: In a first aspect, a cloud microservice health monitoring method is provided, the method comprising: Get the current running status data of the cloud server node; A preconfigured isolation forest model is used to filter out first abnormal data points from the current operating state data, and a second server portrait about the cloud server node is generated based on all the first abnormal data points; the second server portrait includes an abnormal feature set of the cloud server node in the current state and a feature quantity of each abnormal feature item in the abnormal feature set, the abnormal feature set includes K abnormal features, and K is an integer greater than zero; Obtain a first server portrait about the cloud server node, and calculate a portrait distance between the first server portrait and the second server portrait; The actual health of the cloud server node is judged according to the size of the portrait distance to obtain a health judgment result; the health judgment result includes one of health, sub-health and failure.
[0007] Further, the using a preconfigured isolation forest model to filter out the first abnormal data point from the current operating status data includes: Input the current running status data into a preconfigured isolation forest model to obtain an anomaly score for each data point in the current running status data; The anomaly score is compared with a preset anomaly score threshold. If the anomaly score is greater than or equal to the anomaly score threshold, the corresponding data point is marked as a first anomaly data point; if the anomaly score is less than the anomaly score threshold, the corresponding data point is marked as a non-abnormal data point; The logic for obtaining the abnormality score is as follows: Extract the path length of each isolated tree in the isolation forest model, and calculate the mean of the path lengths of all isolated trees to obtain the average path length; Calculate the anomaly score for each data point based on the average path length; All first abnormal data points whose abnormal scores are greater than or equal to the abnormal score threshold are counted to obtain all first abnormal data points.
[0008] Furthermore, the generation method of the isolation forest model is as follows: Obtain historical operating status data about the cloud server node, and randomly select a feature item from the historical operating status data; For the selected feature item, a split value is randomly selected from all its value ranges for binary splitting to obtain two child nodes, namely the left child node and the right child node; Repeat the above steps for each child node until the preset stop condition is met, then stop dividing the child nodes and get a single isolated tree; The preset stop condition includes any one of the following: there is only one sample left in the node or the preset maximum segmentation depth has been reached; Repeat the above single isolated tree construction process to generate R isolated trees, and combine the R isolated trees to obtain the first isolation forest model, where R is an integer greater than zero.
[0009] Further, the obtaining of the first server portrait about the cloud server node includes: Obtain historical operating status data of the cloud server node, and use a preconfigured isolation forest model to filter out a second abnormal data point from the historical operating status data; Obtain historical representation data of the cloud server node, and calculate the Pearson correlation coefficient between each abnormal feature item in the second abnormal data point and the historical representation data; Wherein, the historical characterization data is one of a downtime rate or an error rate; The Pearson correlation coefficient is compared with a preset Pearson correlation coefficient threshold. If the Pearson correlation coefficient is greater than or equal to the Pearson correlation coefficient threshold, the corresponding abnormal feature item is marked as a fault feature item, and a feature quantity of the fault feature item is extracted; Count all fault feature items and feature quantities of the fault feature items, and combine all fault feature items into a fault feature set; The fault feature set and the feature quantity of each fault feature item in the fault feature set are used as the first server profile of the cloud server node.
[0010] Further, the calculating the portrait distance between the first server portrait and the second server portrait includes: Marking the set of fault features in the first server portrait as a first set, and marking the set of abnormal features in the second server portrait as a second set; Calculate the first set and the second set, and input them into a preset first similarity calculation model to obtain a first similarity coefficient; The expression of the first similarity calculation model is as follows: ; Where: S represents the first set of normalized vectors, T represents the second set of normalized vectors; represents the first similarity coefficient, ∈[0,1], the smaller the value, the more similar the two sets are, and the larger the value, the greater the difference; Extracting the same feature items in the first server portrait and the second server portrait, and respectively obtaining feature quantities of the same feature items in the first server portrait and the second server portrait, and inputting them into a preset second similarity calculation model to obtain a second similarity coefficient; The expression of the second similarity calculation model is as follows: ; Where: represents the second similarity coefficient, represents the feature quantity of the jth identical feature item in the first server portrait, represents the feature quantity of the jth identical feature item in the second server portrait, Indicates the number of identical feature items; Performing a comprehensive calculation based on the first similarity coefficient and the second similarity coefficient to obtain a portrait distance between the first server portrait and the second server portrait; The calculation formula of the image distance is as follows: ; Where: Indicates the image distance, and is a correction factor greater than zero, represents the first similarity coefficient, represents the second similarity coefficient, .
[0011] Furthermore, judging the actual health of the cloud server node according to the image distance includes: Setting a portrait distance threshold, the portrait distance threshold includes a first portrait distance threshold th1 and a second portrait distance threshold th2, th1>th2>0; Distance of image Compare with the image distance threshold; If D>th1, the actual health of the cloud server node is determined to be faulty and used as the health judgment result; If D≤th1 and D≥th2, the actual health level of the cloud server node is determined to be sub-healthy, and this is used as the health level judgment result; If D<th2, the actual health level of the cloud server node is determined to be healthy, and this is used as the health level determination result.
[0012] In a second aspect, a cloud microservice health monitoring system is provided, which is implemented based on the cloud microservice health monitoring method described above, and the system includes: A data acquisition module is used to obtain the current operating status data of the cloud server node; A portrait construction module, used to filter out first abnormal data points from current operating state data using a preconfigured isolation forest model, and generate a second server portrait about the cloud server node based on all first abnormal data points; the second server portrait includes an abnormal feature set of the cloud server node in the current state and a feature quantity of each abnormal feature item in the abnormal feature set, the abnormal feature set includes K abnormal features, and K is an integer greater than zero; A portrait distance calculation module, used to obtain a first server portrait about a cloud server node, and calculate a portrait distance between the first server portrait and a second server portrait; The health detection module is used to judge the actual health of the cloud server node according to the size of the portrait distance and obtain a health judgment result; the health judgment result includes one of health, sub-health and failure.
[0013] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the cloud microservice health monitoring method described in any one of the above items is implemented.
[0014] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, the cloud microservice health monitoring method described in any one of the above items is implemented.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present application discloses a cloud microservice health monitoring method and system, including: obtaining current operating status data of a cloud server node; using a preconfigured isolation forest model to filter out first abnormal data points from the current operating status data, and generating a second server portrait of the cloud server node based on all first abnormal data points; obtaining a first server portrait of the cloud server node, and calculating the portrait distance between the first server portrait and the second server portrait; judging the actual health of the cloud server node according to the portrait distance; based on the above characteristics, the present invention can reflect the health status of the server in real time by comparing the first server portrait and the second server portrait of the cloud server node, especially to promptly discover problems when potential faults or performance bottlenecks occur; through this method based on anomaly detection and portrait comparison, the present invention can effectively avoid the limitations of traditional fixed threshold methods, provide more accurate health assessments, and reduce false alarm rates and missed alarm rates, thereby ensuring the stable operation of the cloud microservice architecture and the high availability of key businesses. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of the cloud microservice health monitoring method provided by the present invention; Figure 2 A module structure diagram of the cloud microservice health monitoring system provided by the present invention; Figure 3 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Example 1 See also Figure 1 As shown, this embodiment discloses a cloud microservice health monitoring method, the method comprising: S101: Obtain current operating status data of the cloud server node; Specifically, the running status data includes multiple feature items and feature quantities of each feature item, wherein the multiple feature items include but are not limited to CPU usage, memory usage, disk I / O speed, throughput, and number of processes, etc.; the running status data is collected in real time through automated monitoring tools (such as Prometheus, Zabbix, Nagios, etc.); It should be noted that: the cloud server node acts on each business module under the microservice architecture. To further explain, under the microservice architecture, the business modules of the entire business system are split so that each service is responsible for a specific business function; for example, in an overall business system, including user registration service (processing user registration requests), user login service (processing login verification) and order management service (processing order creation, update and query), these services run on different cloud server nodes and interact with each other through lightweight communication protocols (usually HTTP / REST, gRPC or message queues), which can perform good fault isolation and prevent the failure of one service from affecting the operation of other services; however, although the overall impact of service failures is weakened by isolating single-point service failures, if the health of service nodes is not checked and processed in time, it may cause some functions of the business system to be paralyzed and key business cannot be completed. Therefore, it is necessary to perform real-time health monitoring of the cloud server nodes acting on each business module.
[0019] S102: Filter out first abnormal data points from current operating status data using a preconfigured isolation forest model, and generate a second server portrait about the cloud server node based on all first abnormal data points; the second server portrait includes an abnormal feature set of the cloud server node in the current state and a feature value of each abnormal feature item in the abnormal feature set, the abnormal feature set includes K abnormal features, and K is an integer greater than zero; In implementation, the method of using a preconfigured isolation forest model to filter out the first abnormal data point from the current operating status data includes: Input the current running status data into a preconfigured isolation forest model to obtain an anomaly score for each data point in the current running status data; It should be understood that Isolation Forest (iForest) is a tree-based anomaly detection algorithm, which is particularly suitable for anomaly detection in large-scale data sets. Unlike traditional anomaly detection methods based on distance and density, the core idea of Isolation Forest is to determine whether they are anomalies by "isolating" data points. Anomalies are usually easier to be isolated than normal points, so abnormal data can be effectively detected in this way. Among them, the model parameters of the Isolation Forest model are set in advance according to the experiment, for example: n_estimators: determines the number of trees in the forest, usually 100 trees are selected to ensure the accuracy and stability of the model; max_samples: the number of samples sampled from the data by each tree, usually set to 50% of the data set; contamination: specifies the proportion of anomalies in the data set, set to 0.01 (that is, 1% of the data is considered abnormal), which can be adjusted according to the operation of the system; Specifically, the generation method of the isolation forest model is as follows: Obtain historical operating status data about the cloud server node, and randomly select a feature item from the historical operating status data; For the selected feature item, a split value is randomly selected from all its value ranges for binary splitting to obtain two child nodes, namely the left child node and the right child node; Repeat the above steps for each child node until the preset stop condition is met, then stop dividing the child nodes and get a single isolated tree; The preset stop condition includes any one of the following: there is only one sample left in the node or the preset maximum segmentation depth has been reached; Repeat the above single isolated tree construction process to generate R isolated trees, and combine the R isolated trees to obtain the first isolation forest model, where R is an integer greater than zero; The anomaly score is compared with a preset anomaly score threshold. If the anomaly score is greater than or equal to the anomaly score threshold, the corresponding data point is marked as a first anomaly data point; if the anomaly score is less than the anomaly score threshold, the corresponding data point is marked as a non-abnormal data point; The logic for obtaining the abnormality score is as follows: Extract the path length of each isolated tree in the isolation forest model, and calculate the mean of the path lengths of all isolated trees to obtain the average path length; Calculate the anomaly score for each data point based on the average path length; The expression of the abnormal score is as follows: ; Where: is the abnormality score, is the average path length, is the expected path length, which is derived by technicians based on experiments, so that the path length of the isolation forest under different sample numbers is consistent; Count all first abnormal data points whose abnormality scores are greater than or equal to the abnormality score threshold to obtain all first abnormal data points; It should be understood that: all first abnormal data points include multiple abnormal feature items of the cloud server node in the current state and the feature value of each abnormal feature item. Therefore, when all first abnormal data points are obtained, the multiple abnormal feature items in the current state and the feature value of each abnormal feature item are used as the second server portrait of the cloud server node; for example, after the isolation forest model processes the current operating status data, it is found that the abnormal feature items of the cloud server node at the current moment include CPU usage and memory usage, and the CPU usage is 99% and the memory usage is 99%. Then the CPU usage, memory usage, CPU usage of 99% and memory usage of 99% are used as the second server portrait, which reveals the abnormal performance of the cloud server node at the current moment.
[0020] S103: Obtain a first server portrait about the cloud server node, and calculate a portrait distance between the first server portrait and the second server portrait; In implementation, the obtaining of a first server profile about a cloud server node includes: Obtain historical operating status data of the cloud server node, and use a preconfigured isolation forest model to filter out a second abnormal data point from the historical operating status data; It should be understood that: the second abnormal data point and the isolation forest model are the same as the above-mentioned content of step S102, please refer to the above for details, and will not be repeated here; Obtain historical representation data of the cloud server node, and calculate the Pearson correlation coefficient between each abnormal feature item in the second abnormal data point and the historical representation data; The historical characterization data is one of the downtime rate and the error rate; the error rate is usually used to measure the frequency of errors in the cloud server nodes, which can reflect the stability and health status of the cloud server nodes; the downtime rate describes the proportion of cloud server nodes that are unavailable within a certain period of time; Specifically, the expression of the Pearson correlation coefficient is as follows: ; Where: is the Pearson correlation coefficient; is the characteristic value of the ith abnormal characteristic item; n is the total number of data of the ith abnormal characteristic item; p is the value of the downtime rate or error rate, and are the means of X and Y respectively; The Pearson correlation coefficient is compared with a preset Pearson correlation coefficient threshold. If the Pearson correlation coefficient is greater than or equal to the Pearson correlation coefficient threshold, the corresponding abnormal feature item is marked as a fault feature item, and a feature quantity of the fault feature item is extracted; Count all fault feature items and feature quantities of the fault feature items, and combine all fault feature items into a fault feature set; The fault feature set and the feature quantity of each fault feature item in the fault feature set are used as the first server profile of the cloud server node; It is worth noting that: the second server portrait reflects the abnormal performance of the cloud server node at the current time / state, while the first server portrait emphasizes the abnormal performance of the cloud server node in a fault state. In implementation, the calculating of the portrait distance between the first server portrait and the second server portrait includes: Marking the set of fault features in the first server portrait as a first set, and marking the set of abnormal features in the second server portrait as a second set; Calculate the first set and the second set, and input them into a preset first similarity calculation model to obtain a first similarity coefficient; The expression of the first similarity calculation model is as follows: ; Where: S represents the first set of normalized vectors, T represents the second set of normalized vectors; represents the first similarity coefficient, ∈[0,1], the smaller the value, the more similar the two sets are, and the larger the value, the greater the difference; Extracting the same feature items in the first server portrait and the second server portrait, and respectively obtaining feature quantities of the same feature items in the first server portrait and the second server portrait, and inputting them into a preset second similarity calculation model to obtain a second similarity coefficient; Specifically, the expression of the second similarity calculation model is as follows: ; Where: represents the second similarity coefficient, represents the feature quantity of the jth identical feature item in the first server portrait, represents the feature quantity of the jth identical feature item in the second server portrait, Indicates the number of identical feature items; Performing a comprehensive calculation based on the first similarity coefficient and the second similarity coefficient to obtain a portrait distance between the first server portrait and the second server portrait; The calculation formula of the image distance is as follows: ; Where: Indicates the image distance, and is a correction factor greater than zero, represents the first similarity coefficient, represents the second similarity coefficient, .
[0021] S104: judging the actual health of the cloud server node according to the size of the portrait distance, and obtaining a health judgment result; the health judgment result includes one of health, sub-health and failure; In implementation, judging the actual health of the cloud server node according to the size of the portrait distance includes: Setting a portrait distance threshold, the portrait distance threshold includes a first portrait distance threshold th1 and a second portrait distance threshold th2, th1>th2>0; Distance of image Compare with the image distance threshold; If D>th1, the actual health of the cloud server node is determined to be faulty and used as the health judgment result; If D≤th1 and D≥th2, the actual health level of the cloud server node is determined to be sub-healthy, and this is used as the health level judgment result; If D < th2, the actual health of the cloud server node is determined to be healthy, and this is used as the health judgment result; It should be noted that: when the actual health of the cloud server node is in a fault state, the pending tasks of the corresponding business module of the cloud server node will be transferred to the standby cloud server node through the load balancer to ensure the normal operation of the corresponding business module; when the actual health of the cloud server node is healthy or sub-healthy, there is no need to perform task status on the cloud server node, and the status monitoring frequency can be adjusted according to the healthy or sub-healthy state. It is further explained that when the cloud server node is in a sub-healthy state, the health status monitoring frequency can be appropriately increased, and when the cloud server node is in a healthy state for a long time, the health status monitoring frequency can be appropriately reduced to avoid wasting monitoring resources; By acquiring multi-dimensional operating status data of cloud server nodes in real time and analyzing the data in combination with a pre-configured isolation forest model, an accurate assessment of the health status of cloud server nodes can be achieved; the present invention overcomes the limitation of traditional health monitoring that relies on fixed thresholds to judge service status, effectively reduces the risk of false alarms and missed alarms, and improves the adaptability and flexibility of the health monitoring system.
[0022] Example 2 See also Figure 2 As shown, based on the same inventive concept, this embodiment discloses a cloud microservice health monitoring system. For details not provided in this embodiment, please refer to the relevant parts of the above embodiment 1. The system includes: The data acquisition module 210 is used to acquire the current operation status data of the cloud server node; A portrait construction module 220 is used to filter out first abnormal data points from the current operating state data using a preconfigured isolation forest model, and generate a second server portrait about the cloud server node based on all the first abnormal data points; the second server portrait includes an abnormal feature set of the cloud server node in the current state and a feature value of each abnormal feature item in the abnormal feature set, the abnormal feature set includes K abnormal features, and K is an integer greater than zero; A portrait distance calculation module 230, used to obtain a first server portrait about a cloud server node, and calculate a portrait distance between the first server portrait and a second server portrait; The health detection module 240 is used to determine the actual health of the cloud server node according to the size of the portrait distance and obtain a health determination result; the health determination result includes one of health, sub-health and failure.
[0023] Example 3 See also Figure 3 As shown, this embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, it implements the cloud microservice health monitoring method provided by any one of the above methods.
[0024] Since the electronic device introduced in the content of this embodiment is an electronic device used to implement a cloud microservice health monitoring method in the embodiment of this application, based on the cloud microservice health monitoring method introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not introduced in detail here. As long as the technical personnel of this field implement the electronic device used in the cloud microservice health monitoring method in the embodiment of this application, it belongs to the scope of protection of this application.
[0025] Example 4 This embodiment discloses a computer-readable storage medium, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the cloud microservice health monitoring method provided by any one of the above methods is implemented.
[0026] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters, weights and thresholds in the formula are set by technicians in this field according to actual conditions.
[0027] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired network or a wireless network. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media sets. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD) or a semiconductor medium. The semiconductor medium may be a solid-state hard disk.
[0028] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0029] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0030] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0031] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0032] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0033] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0034] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A cloud microservice health monitoring method, characterized in that: The method comprises: Get the current running status data of the cloud server node; A preconfigured isolation forest model is used to filter out first abnormal data points from the current operating state data, and a second server portrait about the cloud server node is generated based on all the first abnormal data points; the second server portrait includes an abnormal feature set of the cloud server node in the current state and a feature quantity of each abnormal feature item in the abnormal feature set, the abnormal feature set includes K abnormal features, and K is an integer greater than zero; Obtain a first server portrait about the cloud server node, and calculate a portrait distance between the first server portrait and the second server portrait; The actual health of the cloud server node is judged according to the size of the portrait distance to obtain a health judgment result; the health judgment result includes one of health, sub-health and failure.
2. The cloud microservice health monitoring method according to claim 1, characterized in that: The method of using a preconfigured isolation forest model to filter out a first abnormal data point from the current operating status data includes: Input the current running status data into a preconfigured isolation forest model to obtain an anomaly score for each data point in the current running status data; The anomaly score is compared with a preset anomaly score threshold. If the anomaly score is greater than or equal to the anomaly score threshold, the corresponding data point is marked as a first anomaly data point; if the anomaly score is less than the anomaly score threshold, the corresponding data point is marked as a non-abnormal data point; The logic for obtaining the abnormality score is as follows: Extract the path length of each isolated tree in the isolation forest model, and calculate the mean of the path lengths of all isolated trees to obtain the average path length; Calculate the anomaly score for each data point based on the average path length; All first abnormal data points whose abnormal scores are greater than or equal to the abnormal score threshold are counted to obtain all first abnormal data points.
3. The cloud microservice health monitoring method according to claim 2, characterized in that: The generation method of the isolation forest model is as follows: Obtain historical operating status data about the cloud server node, and randomly select a feature item from the historical operating status data; For the selected feature item, a split value is randomly selected from all its value ranges for binary splitting to obtain two child nodes, namely the left child node and the right child node; Repeat the above steps for each child node until the preset stop condition is met, then stop dividing the child nodes and get a single isolated tree; The preset stop condition includes any one of the following: there is only one sample left in the node or the preset maximum segmentation depth has been reached; Repeat the above single isolated tree construction process to generate R isolated trees, and combine the R isolated trees to obtain the first isolation forest model, where R is an integer greater than zero.
4. The cloud microservice health monitoring method according to claim 3, characterized in that: The obtaining of a first server portrait about a cloud server node includes: Obtain historical operating status data of the cloud server node, and use a preconfigured isolation forest model to filter out a second abnormal data point from the historical operating status data; Obtain historical representation data of the cloud server node, and calculate the Pearson correlation coefficient between each abnormal feature item in the second abnormal data point and the historical representation data; Wherein, the historical characterization data is one of a downtime rate or an error rate; The Pearson correlation coefficient is compared with a preset Pearson correlation coefficient threshold. If the Pearson correlation coefficient is greater than or equal to the Pearson correlation coefficient threshold, the corresponding abnormal feature item is marked as a fault feature item, and a feature quantity of the fault feature item is extracted; Count all fault feature items and feature quantities of the fault feature items, and combine all fault feature items into a fault feature set; The fault feature set and the feature quantity of each fault feature item in the fault feature set are used as the first server profile of the cloud server node.
5. The cloud microservice health monitoring method according to claim 4, characterized in that: The calculating the portrait distance between the first server portrait and the second server portrait includes: Marking the set of fault features in the first server portrait as a first set, and marking the set of abnormal features in the second server portrait as a second set; Calculate the first set and the second set, and input them into a preset first similarity calculation model to obtain a first similarity coefficient; The expression of the first similarity calculation model is as follows: ; Where: S represents the first set of normalized vectors, T represents the second set of normalized vectors; represents the first similarity coefficient, ∈[0,1], the smaller the value, the more similar the two sets are, and the larger the value, the greater the difference; Extracting the same feature items in the first server portrait and the second server portrait, and respectively obtaining feature quantities of the same feature items in the first server portrait and the second server portrait, and inputting them into a preset second similarity calculation model to obtain a second similarity coefficient; The expression of the second similarity calculation model is as follows: ; Where: represents the second similarity coefficient, represents the feature quantity of the jth identical feature item in the first server portrait, represents the feature quantity of the jth identical feature item in the second server portrait, Indicates the number of identical feature items; Performing a comprehensive calculation based on the first similarity coefficient and the second similarity coefficient to obtain a portrait distance between the first server portrait and the second server portrait; The calculation formula of the image distance is as follows: ; Where: Indicates the image distance, represents the first similarity coefficient, represents the second similarity coefficient, and is a correction factor greater than zero, .
6. The cloud microservice health monitoring method according to claim 5, characterized in that: The determining of the actual health of the cloud server node according to the size of the portrait distance includes: Setting a portrait distance threshold, the portrait distance threshold includes a first portrait distance threshold th1 and a second portrait distance threshold th2, th1>th2>0; Distance of image Compare with the image distance threshold; If D>th1, the actual health of the cloud server node is determined to be faulty and used as the health judgment result; If D≤th1 and D≥th2, the actual health level of the cloud server node is determined to be sub-healthy, and this is used as the health level judgment result; If D<th2, the actual health level of the cloud server node is determined to be healthy, and this is used as the health level determination result.
7. A cloud microservice health monitoring system, characterized in that: The method is implemented based on the cloud microservice health monitoring method according to any one of claims 1 to 6, and the system comprises: A data acquisition module is used to obtain the current operating status data of the cloud server node; A portrait construction module, used to filter out first abnormal data points from current operating state data using a preconfigured isolation forest model, and generate a second server portrait about the cloud server node based on all first abnormal data points; the second server portrait includes an abnormal feature set of the cloud server node in the current state and a feature quantity of each abnormal feature item in the abnormal feature set, the abnormal feature set includes K abnormal features, and K is an integer greater than zero; A portrait distance calculation module, used to obtain a first server portrait about a cloud server node, and calculate a portrait distance between the first server portrait and a second server portrait; The health detection module is used to judge the actual health of the cloud server node according to the size of the portrait distance and obtain a health judgment result; the health judgment result includes one of health, sub-health and failure.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the cloud microservice health monitoring method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the cloud microservice health monitoring method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Server health state detection method and device
CN116016276A
Cloud data center server health degree assessment method
CN114860540A
Weak current control monitoring system and method based on Internet of Things
CN119010364A
Fault positioning system and method for intelligent terminal equipment
CN119396617A