Fault-tolerant virtual machine resource configuration method and device, equipment, storage medium and program product
By performing redundant backup and automatic failover based on timing tasks in a cloud computing environment, the failure log is analyzed to determine resource configuration strategies, and the problem of inefficient processing of fault-tolerant virtual machines is solved, achieving rapid recovery and efficient resource allocation.
Patent Information
- Application Number
- CN202411127836.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
In the cloud computing environment, the traditional real-time file synchronization method has a time delay in real-time file synchronization due to the resource limitations of the fault-tolerant virtual machine system, which reduces the processing efficiency of the fault-tolerant virtual machine.
By performing redundant backups based on timing tasks, we automatically switch to the backup host when a fault-tolerant virtual machine fails, and record the fault log for analysis. We determine resource configuration policies based on the analysis results and automatically adjust resource allocation to improve the processing efficiency of fault-tolerant virtual machines. .
It reduces the impact of a single point of failure, shortens the failure recovery time, improves the processing efficiency of fault-tolerant virtual machines, reduces manual intervention, and realizes the automation and flexibility of resource allocation.
Smart Images

Figure CN119127470A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual machine technology, and in particular to a fault-tolerant virtual machine resource configuration method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] In a cloud computing environment, large-scale virtualization technology makes virtual machines the basic unit for running applications. The goal of fault-tolerant virtual machine management is to improve the reliability and availability of the system and ensure that virtual machines can be quickly switched and restored when a physical host failure or other unforeseen errors occur.
[0003] In traditional technology, the ReadDirectoryChanges method is used to monitor source files to achieve real-time synchronization. At the same time, a complete synchronization method is adopted to traverse query files, establish file record tables through memory mapping, and compare tables in a perfect hash manner to check for omissions in real-time synchronization. At the same time, a fault-tolerant mechanism using a snapshot method is established to remedy special files.
[0004] However, the current real-time file synchronization method has a certain time delay in real-time file synchronization due to the limitation of system resources of the fault-tolerant virtual machine, resulting in low efficiency when the fault-tolerant virtual machine processes files and data. Summary of the invention
[0005] Based on this, it is necessary to provide a fault-tolerant virtual machine resource configuration method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the processing efficiency of fault-tolerant virtual machines in response to the above technical problems.
[0006] In a first aspect, the present application provides a fault-tolerant virtual machine resource configuration method, the method comprising:
[0007] Based on the scheduled task, redundantly back up the data to be backed up to obtain target backup data; and save the target backup data to a backup storage location;
[0008] In the event of a fault-tolerant virtual machine failure, the fault-tolerant virtual machine is switched from the failed host to the standby host, the target backup data of the backup storage location is stored in the standby host, and the process from the failure to the storage of the target backup data in the standby host is recorded to obtain a fault log;
[0009] Analyze the fault log to obtain analysis results;
[0010] Based on the analysis result, a resource configuration strategy is determined, and the resource configuration strategy is used to perform resource configuration on the fault-tolerant virtual machine.
[0011] In one of the embodiments, when a fault-tolerant virtual machine fails, the fault-tolerant virtual machine is switched from the failed host to the standby host to restore the target backup data in the backup storage location, and the restoration process is recorded, before obtaining the fault log, the method further includes:
[0012] When the CPU usage safety rate of the fault-tolerant virtual machine is less than the preset CPU usage rate threshold, it indicates that the fault-tolerant virtual machine fails;
[0013] When the CPU usage safety rate of the fault-tolerant virtual machine is less than the memory utilization threshold, it indicates that the fault-tolerant virtual machine fails.
[0014] In one embodiment, before analyzing the fault log to obtain the analysis result, the method further includes:
[0015] Extract key fields of the fault log, and match the key fields through regular expressions;
[0016] Obtaining a first fault log based on the key field matched by the regular expression;
[0017] Filtering the first fault log according to a filtering condition to obtain a second fault log, wherein the filtering condition is obtained based on the key field;
[0018] Converting the second fault log into target structured format data to obtain a third fault log;
[0019] Analyze the fault log to obtain analysis results, including:
[0020] At least one of abnormality detection and data association is performed on the third fault log to obtain an analysis result.
[0021] In one embodiment, the performing abnormality detection on the third fault log includes:
[0022] Obtaining a first target number of detection point data in the third fault log;
[0023] For each detection point data, the abnormal score of each detection point data is calculated based on the isolation forest algorithm;
[0024] When the abnormality score of the detection point data is greater than the abnormality score threshold, the data point data is determined to be abnormal point data.
[0025] In one embodiment, data association is performed on the third fault log, including:
[0026] Obtain a second target number of fault log records in the third fault log as a data set; the fault log record includes at least one of a request message, a request method, a status code, and a source IP address;
[0027] Calculate the actual support of each item in the data set;
[0028] Get items whose actual support is greater than the preset support threshold as frequent items;
[0029] Based on each of the frequent items, a plurality of association rules are generated, and the actual confidence of each of the association rules is calculated; the association rules include the relationship between the condition item and the conclusion item, and the confidence indicates the probability of the conclusion item occurring when the condition item occurs; the condition item and the conclusion item are obtained based on the frequent items;
[0030] The actual confidence of each of the association rules is compared with a preset confidence threshold, and the association rules whose actual confidence is greater than the preset confidence threshold are obtained.
[0031] In one embodiment, determining a resource configuration strategy based on the analysis result includes:
[0032] In the case where the data point data is outlier data, the resource allocation strategy includes allocating a third target amount of resources to the fault-tolerant virtual machine corresponding to the outlier data;
[0033] In any of the following cases: the number of occurrences of the association rule is greater than a number threshold, the business growth rate indicated by the association rule is greater than a growth threshold, and the relevance of the association rule is greater than a relevance threshold, the resource allocation strategy includes allocating a fourth target number of resources to the fault-tolerant virtual machine corresponding to the association rule.
[0034] In a second aspect, the present application further provides a fault-tolerant virtual machine resource configuration device, the device comprising:
[0035] A redundant backup module is used to perform redundant backup of the backup data based on a scheduled task to obtain target backup data; and save the target backup data to a backup storage location;
[0036] a detection and recovery module, configured to, in the event of a fault in the fault-tolerant virtual machine, switch the fault-tolerant virtual machine from the faulty host to the standby host, store the target backup data at the backup storage location to the standby host, and record the process from the occurrence of the fault to the storage of the target backup data to the standby host, to obtain a fault log;
[0037] The elastic resource scheduling module is used to analyze the fault log to obtain an analysis result; based on the analysis result, determine a resource configuration strategy, and use the resource configuration strategy to perform resource configuration on the fault-tolerant virtual machine.
[0038] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0040] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0041] The above-mentioned fault-tolerant virtual machine resource configuration method, device, computer equipment, computer-readable storage medium and computer program product perform redundant backup of the backup data based on a scheduled task to obtain target backup data; save the target backup data to a backup storage location; thereby improving fault tolerance and reducing the impact of single point failures; in the event of a fault in the fault-tolerant virtual machine, the fault-tolerant virtual machine is switched from the faulty host to the backup host, and the target backup data at the backup storage location is stored in the backup host, and fast switching and recovery are performed through an automated fault recovery strategy, thereby reducing manual intervention and shortening fault recovery time; the process from the occurrence of the fault to the storage of the target backup data in the backup host is recorded to obtain a fault log; the fault log is analyzed to obtain an analysis result; based on the analysis result, a resource configuration strategy is determined, and the resource configuration strategy is used to configure the resources of the fault-tolerant virtual machine, which can automatically adjust the resource allocation of the fault-tolerant virtual machine, run the fault-tolerant virtual machine according to the resource configuration, and provide more resource configurations to the fault-tolerant machine that needs more resources, thereby reducing the restrictions on resource configuration and improving the processing efficiency of the fault-tolerant virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 An application environment diagram of a fault-tolerant virtual machine resource configuration method in an embodiment;
[0044] Figure 2 A schematic diagram of a process flow of a fault-tolerant virtual machine resource configuration method in one embodiment;
[0045] Figure 3 A schematic diagram of a flow chart of a fault-tolerant virtual machine fault determination method in one embodiment;
[0046] Figure 4 A schematic diagram of a process of preprocessing and analyzing a fault log in one embodiment;
[0047] Figure 5 is a schematic diagram of a process for detecting anomalies in a third fault log in one embodiment;
[0048] Figure 6 is a schematic diagram of a process of correlation analysis of third fault log data in another embodiment;
[0049] Figure 7 A schematic diagram of a process for determining a resource configuration strategy based on an analysis result in one embodiment;
[0050] Figure 8 It is a structural block diagram of a fault-tolerant virtual machine resource configuration device in one embodiment;
[0051] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The fault-tolerant virtual machine resource configuration method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the virtual machine host 102 and the standby virtual machine host 104 communicate with the server 106 through the network. The virtual machine host 102 transmits the information to the standby virtual machine host 104 through the log recording channel. The server 106 backs up the backup data based on the scheduled task to obtain the target backup data; saves the target backup data to the backup storage location; in the case of a fault-tolerant virtual machine failure, the fault-tolerant virtual machine is switched from the faulty host to the standby host, the target backup data at the backup storage location is stored in the standby host, and the process from the failure to the target backup data being stored in the standby host is recorded to obtain a fault log; the fault log is analyzed to obtain an analysis result; based on the analysis result, a resource configuration strategy is determined, and the resource configuration strategy is used to configure resources for the fault-tolerant virtual machine. Among them, the virtual machine host 102, the standby virtual machine host 104 and the server 106 can be independent physical machines, or a cluster or distributed system composed of multiple physical machines.
[0054] In an exemplary embodiment, Figure 2 As shown, a fault-tolerant virtual machine resource configuration method is provided, and the method is applied to Figure 1 The server 106 in the example is used as an example to illustrate the method, which includes the following steps S202 to S208. Among them:
[0055] Step S202: based on the scheduled task, perform redundant backup on the data to be backed up to obtain target backup data; and save the target backup data to a backup storage location.
[0056] Among them, redundant backup means preparing one or more copies. The server will back up the data to be backed up by at least one copy, which can be one or more copies, to obtain the target backup data.
[0057] Optionally, the server includes a master station deployment module, a redundant backup module, a detection and recovery module, and an elastic resource scheduling module. The redundant backup module controlled by the master station deployment module sets a scheduled task to automatically start the virtual machine host backup process. Assuming that the scheduled task is once a day, the goal is to store the data to be backed up in the local server corresponding to the virtual machine host. The scheduled task can also be once a week, once a month, or once every 5 hours.
[0058] Furthermore, the automated backup script is pre-written, and Python can be used to write a script to perform redundant backup operations. The folder where the data to be backed up is located is selected, and the folder includes all subfolders under the folder. Use Python's related library (shutil) to copy the data to be backed up to save the data to be backed up to the backup storage location. Set up a scheduled task in the operating system. The server uses the Windows Task Scheduler through the redundant backup module to create a new backup task and specify the pre-written automated backup script to run; save the target backup data to the backup storage location. The automated backup script can also record key events, errors, and warning information in the backup, use Python's logging module to make log records, and regularly check the generated log files; the redundant backup module can also detect the integrity verification of the target backup data, as well as perform recovery tests on the target backup data, and restore the target backup data to the test environment to ensure that the data is restored and consistent with the source data.
[0059] Step S204, when a fault-tolerant virtual machine fails, the fault-tolerant virtual machine is switched from the failed host to the standby host, the target backup data at the backup storage location is stored in the standby host, and the process from the failure to the storage of the target backup data in the standby host is recorded to obtain a fault log.
[0060] Optionally, the server monitors and determines the health status of the fault-tolerant virtual machine. When the fault-tolerant virtual machine fails, that is, when the virtual machine host fails, an automated fault recovery process is triggered. The automated fault recovery process may include switching the fault-tolerant virtual machine from the failed host to the standby host, restarting, and restarting the fault-tolerant virtual machine on the standby host. The target backup data of the backup storage location can be stored in the target storage location of the standby host through the log recording channel. The automated backup script will record the log file of the process from the failure to storing the target backup data to the standby host, and generate a fault log. The fault log includes information such as the time when the fault occurred, the recovery start time, and the recovery end time.
[0061] Step S206: Analyze the fault log to obtain analysis results.
[0062] Optionally, the server passes the fault log to the elastic resource scheduling module through the redundant backup module and the detection and recovery module. The elastic resource scheduling module conducts a comprehensive analysis of the fault log to obtain analysis results such as potential failure modes, resource bottlenecks and optimization opportunities, and optimizes resource allocation and scheduling strategies based on the analysis results.
[0063] Step S208: Determine a resource configuration strategy based on the analysis result, and use the resource configuration strategy to perform resource configuration on the fault-tolerant virtual machine.
[0064] Optionally, the server formulates resource configuration strategies such as resource allocation, capacity planning and performance optimization strategies based on the analysis results, and uses the resource configuration strategies to automatically configure resources for the fault-tolerant virtual machines to achieve load balancing and enhance the fault tolerance capabilities of the fault-tolerant virtual machines, thereby improving the processing efficiency of the fault-tolerant virtual machines.
[0065] In the above-mentioned fault-tolerant virtual machine resource configuration method, redundant backup of the backup data is performed based on a scheduled task to obtain target backup data; the target backup data is saved to a backup storage location; thereby improving fault tolerance and reducing the impact of single point failures; in the event of a fault in the fault-tolerant virtual machine, the fault-tolerant virtual machine is switched from the faulty host to the backup host, and the target backup data at the backup storage location is stored in the backup host, and fast switching and recovery are performed through an automated fault recovery strategy, thereby reducing manual intervention and shortening fault recovery time; the process from the occurrence of the fault to the storage of the target backup data in the backup host is recorded to obtain a fault log; the fault log is analyzed to obtain an analysis result; based on the analysis result, a resource configuration strategy is determined, and the resource configuration strategy is used to configure the resources of the fault-tolerant virtual machine, which can automatically adjust the resource allocation of the fault-tolerant virtual machine, run the fault-tolerant virtual machine according to the resource configuration, and provide more resource configurations to the fault-tolerant machine that needs more resources, thereby reducing the restrictions on resource configuration and improving the processing efficiency of the fault-tolerant virtual machine.
[0066] In an exemplary embodiment, Figure 3 As shown, in the case of a fault-tolerant virtual machine failure, the fault-tolerant virtual machine is switched from the faulty host to the standby host to restore the target backup data in the backup storage location, and the recovery process is recorded before obtaining the fault log, including steps S302 to S304. Among them:
[0067] Step S302: When the CPU usage safety rate of the fault-tolerant virtual machine is less than a preset CPU usage rate threshold, it indicates that a fault occurs in the fault-tolerant virtual machine.
[0068] Among them, cpu refers to the central processing unit (CPU for short).
[0069] Optionally, the server monitors and determines the health status of the fault-tolerant virtual machine through a detection and recovery module. The CPU usage safety rate of the fault-tolerant virtual machine is detected in real time according to the detection and recovery module, where the CPU usage safety rate is recorded as HI in percentage. The preset CPU usage threshold is recorded as J, and the value range is from 1% to 99%.
[0070] If HI<J, and J=90%, the detection and recovery module determines that the fault detection threshold is reached, indicating that the fault-tolerant virtual machine fails.
[0071] Step S304: When the CPU usage safety rate of the fault-tolerant virtual machine is less than the memory utilization threshold, it indicates that the fault-tolerant virtual machine fails.
[0072] The memory utilization threshold is denoted as B, and its value range is from 1% to 99%.
[0073] Optionally, if HI<B, and B=80%, the detection and recovery module determines that the fault detection threshold is reached, indicating that the fault-tolerant virtual machine fails.
[0074] Furthermore, in the detection and recovery module, the fault-tolerant virtual machine is switched from the faulty host to the backup host, and the virtualization management platform (Microsoft Hyper-V) is used to migrate and switch the fault-tolerant virtual machine. By setting the high availability (HighAvailability) function, the fault-tolerant virtual machine is automatically switched to the backup host when a failure occurs.
[0075] In this embodiment, by comparing the CPU of the fault-tolerant virtual machine with the preset CPU usage threshold and memory utilization threshold, it is possible to accurately determine whether the fault-tolerant virtual machine has a fault, so that the fault-tolerant virtual machine can be migrated and switched when a fault occurs.
[0076] In an exemplary embodiment, Figure 4 As shown, the fault log is analyzed and before the analysis result is obtained, steps S402 to S406 are included. Among them:
[0077] Step S402: extract key fields of the fault log and match the key fields using regular expressions.
[0078] Optionally, the server parses the fault log through the elastic resource scheduling module controlled by the master station deployment module, including extraction of key fields and information, and uses a regular expression pattern matching algorithm through the log parsing tool to match the date and time, log level, and error code using regular expressions.
[0079] Step S404: obtaining a first fault log based on key fields matched by the regular expression.
[0080] Optionally, the server obtains the first fault log based on the key field matched by the regular expression based on the elastic resource scheduling module.
[0081] Step S406: Filter the first fault log according to the filtering condition to obtain a second fault log.
[0082] Among them, the filtering conditions are obtained based on the key fields.
[0083] Optionally, the server filters the first fault log through a filtering condition through the elastic resource scheduling module, where the filtering condition includes a log level, a keyword, a time range, etc., to obtain a second fault log.
[0084] Step S408: convert the second fault log into target structured format data to obtain a third fault log.
[0085] Optionally, the server converts the data of the second fault log into a structured format, such as JSON format, through the elastic resource scheduling module to obtain a third fault log.
[0086] Analyze the fault log and obtain the analysis results, including:
[0087] Step S410: performing at least one of abnormality detection and data association on the third fault log to obtain an analysis result.
[0088] Optionally, the server analyzes the collected third fault log through the analysis function of the elastic resource scheduling module, including anomaly detection, data association, trend analysis, etc., and understands the cause and frequency of the fault and the fault repair according to the analysis results.
[0089] Optionally, the server can also monitor the load of the fault-tolerant virtual machine, and determine the current load according to the determination of the preset CPU usage safety rate recorded as HI in the detection and recovery module. The elastic resource scheduling module combines the third fault log and the current load of the fault-tolerant virtual machine for comprehensive analysis.
[0090] In this embodiment, by performing a preprocessing operation on the fault log, the efficiency of analyzing the fault log can be improved.
[0091] In an exemplary embodiment, Figure 5 As shown, performing abnormality detection on the third fault log includes steps S502 to S506. Among them:
[0092] Step S502: Acquire a first target number of detection point data in the third fault log.
[0093] Optionally, the server uses a learning algorithm to analyze the collected third fault log through the analysis function of the elastic resource scheduling module, including anomaly detection through an isolation forest algorithm and data association analysis through association rule mining.
[0094] Further, anomaly detection via isolation forest algorithm is used to detect and identify outliers.
[0095] Optionally, the server obtains the first target data monitoring point data from the third fault log through the elastic resource scheduling module as the first data set. For example, the first data set is: [2, 4, 6, 8, 10, 100, 102, 104], the number of the first data set: n = 8, the maximum number of iterations: T = 100, and the maximum height of each isolated tree: h = 3.
[0096] Step S504: for each detection point data, an abnormality score of each detection point data is calculated based on the isolation forest algorithm.
[0097] Optionally, the server creates an isolation forest through the elastic resource scheduling module, with an initial height of 0, and selects a random sample as the root node; for each child node, randomly selects a feature and a split value to split the first data set; repeats the above steps until the maximum height h is reached or the split cannot be continued; for each detection point data, calculate the average path length (APL) of the detection point data. The APL calculation is shown in formula (1):
[0098] E(h,n) = 2 * (H(h-1) + log(n-1)) - 2 * (n-1) / n Formula (1)
[0099] Among them, E() is the function for calculating the average path length; n is the number of the first data set; h is the maximum height of each isolated tree; H is the harmonic number function.
[0100] Furthermore, the server converts the APL value into an anomaly score using formula (2) through the elastic resource scheduling module.
[0101] anomaly_score = 2^(-APL / E(h,n)) Formula (2)
[0102] Among them, anomaly_score is the anomaly score; E() is the function for calculating the average path length; APL is the average path length.
[0103] Step S506: when the abnormal score of the detection point data is greater than the abnormal score threshold, the data point data is determined to be abnormal point data.
[0104] Optionally, when the abnormality score of the detection point data is greater than the abnormality score threshold, the server determines that the data point data is abnormal point data through the elastic resource scheduling module.
[0105] In this embodiment, the abnormal point data in the fault log is judged by using the isolation forest algorithm, which can improve the accuracy of the abnormal point data judgment.
[0106] In an exemplary embodiment, Figure 6 As shown, data association is performed on the third fault log, including steps S602 to S610. Among them:
[0107] Step S602, obtaining a second target number of fault log records in the third fault log as a data set; the fault log record includes at least one of a request message, a request method, a status code, and a source IP address.
[0108] Here, an item may refer to a piece of information in a fault log record.
[0109] Optionally, if the data set is a network log data set, such as the network log data set includes log records A to D.
[0110] Log record A: {HTTP request, GET method, 200 status code};
[0111] Log record B: {HTTP request, POST method, 404 status code};
[0112] Log record C: {HTTP request, GET method, 200 status code, source IP address: 192.168.0.1};
[0113] Log record D: {HTTPS request, POST method, 500 status code};
[0114] Step S604, calculating the actual support of each item in the data set.
[0115] Among them, support is the frequency of occurrence in the data set. It is calculated by formula (3):
[0116] Support(X -> Y) = (Number of occurrences of X intersecting Y) / (Total number of log records) Formula (3)
[0117] Among them, support (Support), X is the condition item, and Y is the conclusion item.
[0118] The server calculates the actual support of each item in the data set through the elastic resource scheduling module. The support of the request message being an HTTP request can be recorded as 3, and the number of HTTP requests appearing in 4 message requests can be recorded as 3 times, which is 75%; the support of the request message being an HTTPS request can be recorded as 1; the number of HTTPs requests appearing in 4 message requests can be recorded as 1 time, which is 25%; the request method, status code, and source IP address can be calculated in turn to obtain the corresponding support.
[0119] Step S606: Items whose actual support is greater than a preset support threshold are obtained as frequent items.
[0120] Optionally, if the preset support threshold is 50%, then the number of HTTP requests is 3, which is recorded as 75%, which is greater than the support threshold. Therefore, the message being an HTTP request can be used as a frequent item. All frequent items in the data set are calculated in sequence. For example, {HTTP request} and {GET method} are both frequent items.
[0121] Step S608: Generate a number of association rules based on each frequent item, and calculate the actual confidence of each association rule.
[0122] Among them, the association rules include the relationship between the condition items and the conclusion items, and the confidence level indicates the probability of the conclusion item occurring when the condition item occurs; the condition items and the conclusion items are obtained based on the frequent items.
[0123] Optionally, for each frequent item, {HTTP request}, {GET method}, the server uses one of the target frequent items as a condition item and other frequent items as conclusion items, and generates association rules by permutations and combinations, such as {HTTP request}->{GET method}, {GET method}->{HTTP request}.
[0124] Furthermore, the server calculates the probability of the conclusion item occurring when the condition item in each association rule occurs through formula (4).
[0125] Confidence(X -> Y) = Support(X -> Y) / Support(X) Formula (4)
[0126] Among them, Confidence() is the confidence; Support() is the support; X is the condition item, and Y is the conclusion item.
[0127] Step S610: compare the actual confidence of each association rule with a preset confidence threshold, and obtain association rules whose actual confidence is greater than the preset confidence threshold.
[0128] Optionally, according to the confidence threshold, the association rules that meet the requirements are screened out, and only the association rules with confidence higher than the threshold are retained as the final result; the confidence threshold can be set to 60% or other values. Through the above process, the association rules that meet the support and confidence thresholds are mined.
[0129] In this embodiment, by mining association rules, data associations in the fault logs can be accurately obtained, thereby improving the accuracy of analysis.
[0130] In another exemplary embodiment, the server uses algorithms and methods through the elastic resource scheduling module to identify potential failure modes, resource bottlenecks and optimization opportunities. The process is as follows: the calculation formula is [failure frequency = (failure times / observation time) * 100]; if the number of failures: 20, observation time: 1000 hours; the obtained failure frequency = (20 / 1000) *100 = 2%; combined with the comprehensive analysis of the failure history data and monitoring data, the potential failure modes, resource bottlenecks and optimization opportunities are identified; 2% failure frequency indicates the existence of potential failure modes and resource bottlenecks. Further analysis may include the following aspects: study the time and location factors of the failure to discover potential failure modes, etc. Combined with other monitoring data (such as load) for comprehensive analysis to further identify optimization opportunities.
[0131] In an exemplary embodiment, Figure 7 As shown, based on the analysis results, determining the resource configuration strategy includes steps S702 to S704. Among them:
[0132] Step S702: when the data point data is abnormal point data, the resource configuration strategy includes allocating a third target amount of resources to the fault-tolerant virtual machine corresponding to the abnormal point data.
[0133] Among them, resource configuration strategies include resource allocation strategies, capacity planning strategies, and performance optimization strategies.
[0134] Optionally, for the resource allocation strategy, dynamically adjust the resource allocation according to the anomaly analysis results, and allocate the third target quantity X1 of resources to the fault-tolerant virtual machine corresponding to the anomaly point data. For the capacity planning strategy, identify the capacity bottleneck and expand the capacity of the relevant resources in a targeted manner according to the anomaly analysis results; if the anomaly analysis shows that the utilization rate of a certain resource is abnormally high, it is necessary to increase the capacity of the resource to avoid performance degradation and system crash, and allocate the third target quantity Y1 of resources to the fault-tolerant virtual machine corresponding to the anomaly point data. For the performance optimization strategy, based on the anomaly analysis results, identify and resolve the abnormal conditions that cause system performance degradation; if for the data point identified as abnormal, locate the cause of the problem and allocate the third target quantity Z1 of resources to the fault-tolerant virtual machine corresponding to the anomaly point data.
[0135] Step S704, in any of the following cases, the resource allocation strategy includes allocating a fourth target number of resources to the fault-tolerant virtual machine corresponding to the association rule, in which case the number of occurrences of the association rule is greater than the number threshold, the business growth rate indicated by the association rule is greater than the growth threshold, and the correlation of the association rule is greater than the correlation threshold.
[0136] Optionally, for resource allocation strategy, when the number of occurrences of the association rule is greater than the number threshold, that is, the association rule appears frequently, the allocation of related resources is increased accordingly, such as allocating the fourth target quantity X2 of resources to the fault-tolerant virtual machine corresponding to the abnormal point data. For capacity planning strategy, when the business growth rate indicated by the association rule is greater than the growth threshold, it indicates that the business is growing, and the system capacity is adjusted accordingly to meet future needs; such as allocating the fourth target quantity Y2 of resources to the fault-tolerant virtual machine corresponding to the abnormal point data. For performance optimization strategy, when the correlation of the association rule is greater than the correlation threshold, it indicates that strong association rules are found between certain operation sequences, and the fourth target quantity Z2 of resources is allocated to the fault-tolerant virtual machine corresponding to the abnormal point data to improve execution efficiency.
[0137] In this embodiment, the corresponding resource configuration strategy is obtained through exception analysis and data association analysis, and the resources of the fault-tolerant virtual machine are configured using the resource configuration strategy so that the fault-tolerant virtual machine can obtain resources that meet the needs, thereby improving the efficiency of the fault-tolerant virtual machine.
[0138] In an exemplary embodiment, based on a scheduled task, the data to be backed up is backed up to obtain target data to be backed up; and the target data to be backed up is saved to a redundant storage location.
[0139] When the CPU usage safety rate of the fault-tolerant virtual machine is less than the preset CPU usage threshold, it indicates that the fault-tolerant virtual machine has a fault; when the CPU usage safety rate of the fault-tolerant virtual machine is less than the memory utilization threshold, it indicates that the fault-tolerant virtual machine has a fault.
[0140] In the event of a fault-tolerant virtual machine failure, the fault-tolerant virtual machine is switched from the failed host to the standby host, the target data to be backed up in the redundant storage location is stored in the standby host, and the process from the failure to the storage of the target data to be backed up in the standby host is recorded to obtain a fault log.
[0141] Extract key fields of the fault log and match the key fields through regular expressions; obtain a first fault log based on the key fields matched by the regular expressions; filter the first fault log according to a filtering condition to obtain a second fault log, wherein the filtering condition is obtained based on the key fields; convert the second fault log into target structured format data to obtain a third fault log.
[0142] A first target number of detection point data in the third fault log is obtained; for each detection point data, an abnormality score of each detection point data is calculated based on the isolation forest algorithm; when the abnormality score of the detection point data is greater than the abnormality score threshold, the data point data is determined to be an abnormal point data.
[0143] A second target number of fault log records in a third fault log is obtained as a data set; the fault log record includes at least one of a request message, a request method, a status code, and a source IP address; the actual support of each item in the data set is calculated; items whose actual support is greater than a preset support threshold are obtained as frequent items; based on each frequent item, a number of association rules are generated, and the actual confidence of each association rule is calculated; the association rule includes a relationship between a condition item and a conclusion item, and the confidence indicates the probability of the conclusion item occurring when the condition item occurs; the condition item and the conclusion item are obtained based on the frequent items; the actual confidence of each association rule is compared with a preset confidence threshold, and the association rule whose actual confidence is greater than the preset confidence threshold is obtained.
[0144] In the case where the data point data is an outlier data, the resource allocation strategy includes allocating a third target number of resources to the fault-tolerant virtual machine corresponding to the outlier data; in any of the following cases: the number of occurrences of the association rule is greater than the number threshold, the business growth rate indicated by the association rule is greater than the growth threshold, and the correlation of the association rule is greater than the correlation threshold, the resource allocation strategy includes allocating a fourth target number of resources to the fault-tolerant virtual machine corresponding to the association rule. And the resource allocation strategy is used to configure resources for the fault-tolerant virtual machine.
[0145] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0146] Based on the same inventive concept, the embodiment of the present application also provides a fault-tolerant virtual machine resource configuration device for implementing the fault-tolerant virtual machine resource configuration method involved above. The implementation solution for solving the problem provided by the device is similar to the implementation solution recorded in the above method, so the specific limitations in one or more embodiments of the fault-tolerant virtual machine resource configuration device provided below can refer to the limitations of the fault-tolerant virtual machine resource configuration method above, and will not be repeated here.
[0147] In an exemplary embodiment, Figure 8As shown, a fault-tolerant virtual machine resource configuration device is provided, including: a redundant backup module 801, a detection and recovery module 802 and an elastic resource scheduling module 803, wherein:
[0148] The redundant backup module 801 is used to perform redundant backup of the data to be backed up based on a scheduled task to obtain target backup data; and save the target backup data to a backup storage location.
[0149] The detection and recovery module 802 is used to switch the fault-tolerant virtual machine from the faulty host to the backup host when a fault-tolerant virtual machine fails, store the target backup data at the backup storage location to the backup host, and record the process from the failure to the storage of the target backup data to the backup host to obtain a fault log.
[0150] The elastic resource scheduling module 803 is used to analyze the fault log to obtain the analysis result; determine the resource configuration strategy based on the analysis result, and use the resource configuration strategy to configure resources for the fault-tolerant virtual machine.
[0151] In an exemplary embodiment, a fault-tolerant virtual machine resource configuration device is provided, further comprising:
[0152] The fault judgment module is used to indicate that the fault-tolerant virtual machine has a fault when the CPU usage safety rate of the fault-tolerant virtual machine is less than a preset CPU usage threshold; when the CPU usage safety rate of the fault-tolerant virtual machine is less than a memory utilization threshold, it indicates that the fault-tolerant virtual machine has a fault.
[0153] In an exemplary embodiment, a fault-tolerant virtual machine resource configuration device is provided, further comprising:
[0154] The first fault log generating module is used to extract key fields of the fault log and match the key fields through regular expressions; and obtain the first fault log based on the key fields matched by the regular expressions.
[0155] The second fault log generating module is used to filter the first fault log according to the filtering condition to obtain the second fault log, wherein the filtering condition is obtained based on the key field.
[0156] The third fault log generating module is used to convert the second fault log into target structured format data to obtain a third fault log.
[0157] The elastic resource scheduling module also includes:
[0158] The analysis unit is used to perform at least one of abnormality detection and data association on the third fault log to obtain an analysis result.
[0159] In an exemplary embodiment, the analysis unit further comprises:
[0160] The anomaly analysis subunit is used to obtain a first target number of detection point data in the third fault log; for each detection point data, the anomaly score of each detection point data is calculated based on the isolation forest algorithm; when the anomaly score of the detection point data is greater than the anomaly score threshold, the data point data is determined to be anomaly point data.
[0161] In an exemplary embodiment, the analysis unit further comprises:
[0162] A data association subunit is used to obtain a second target number of fault log records in a third fault log as a data set; the fault log record includes at least one of a request message, a request method, a status code and a source IP address; the actual support of each item in the data set is calculated; items whose actual support is greater than a preset support threshold are obtained as frequent items; based on each frequent item, a number of association rules are generated, and the actual confidence of each association rule is calculated; the association rule includes a relationship between a condition item and a conclusion item, and the confidence indicates the probability of the conclusion item occurring when the condition item occurs; the condition item and the conclusion item are obtained based on the frequent items; the actual confidence of each association rule is compared with a preset confidence threshold, and the association rule whose actual confidence is greater than the preset confidence threshold is obtained.
[0163] In an exemplary embodiment, the elastic resource scheduling module is also used for, when the data point data is anomaly point data, the resource allocation strategy includes allocating a third target number of resources to the fault-tolerant virtual machine corresponding to the anomaly point data; in any of the following cases: the number of occurrences of the association rule is greater than the number threshold, the business growth rate indicated by the association rule is greater than the growth threshold, and the correlation of the association rule is greater than the correlation threshold, the resource allocation strategy includes allocating a fourth target number of resources to the fault-tolerant virtual machine corresponding to the association rule.
[0164] Each module in the above-mentioned fault-tolerant virtual machine resource configuration device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0165] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store fault log data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a fault-tolerant virtual machine resource configuration method is implemented.
[0166] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0167] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0168] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0169] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0170] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0171] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0172] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A fault-tolerant virtual machine resource configuration method, characterized in that: The method comprises: Based on the scheduled task, redundantly back up the data to be backed up to obtain target backup data; and save the target backup data to a backup storage location; In the event of a fault-tolerant virtual machine failure, the fault-tolerant virtual machine is switched from the failed host to the standby host, the target backup data of the backup storage location is stored in the standby host, and the process from the failure to the storage of the target backup data in the standby host is recorded to obtain a fault log; Analyze the fault log to obtain analysis results; Based on the analysis result, a resource configuration strategy is determined, and the resource configuration strategy is used to perform resource configuration on the fault-tolerant virtual machine.
2. The method according to claim 1, characterized in that In the case where a fault-tolerant virtual machine fails, the fault-tolerant virtual machine is switched from the failed host to the standby host to restore the target backup data in the backup storage location, and the restoration process is recorded before obtaining the fault log, and the method further includes: When the CPU usage safety rate of the fault-tolerant virtual machine is less than a preset CPU usage rate threshold, it indicates that the fault-tolerant virtual machine fails; When the CPU usage safety rate of the fault-tolerant virtual machine is less than the memory utilization threshold, it indicates that the fault-tolerant virtual machine fails.
3. The method according to claim 1, characterized in that Before analyzing the fault log to obtain the analysis result, the method further includes: Extract key fields of the fault log, and match the key fields through regular expressions; Obtaining a first fault log based on the key field matched by the regular expression; Filtering the first fault log according to a filtering condition to obtain a second fault log, wherein the filtering condition is obtained based on the key field; Converting the second fault log into target structured format data to obtain a third fault log; Analyze the fault log to obtain analysis results, including: At least one of abnormality detection and data association is performed on the third fault log to obtain an analysis result.
4. The method according to claim 3, characterized in that The performing abnormality detection on the third fault log includes: Obtaining a first target number of detection point data in the third fault log; For each detection point data, the abnormal score of each detection point data is calculated based on the isolation forest algorithm; When the abnormality score of the detection point data is greater than the abnormality score threshold, the data point data is determined to be abnormal point data.
5. The method according to claim 3, characterized in that: Performing data association on the third fault log includes: Obtain a second target number of fault log records in the third fault log as a data set; the fault log record includes at least one of a request message, a request method, a status code, and a source IP address; Calculate the actual support of each item in the data set; Get items whose actual support is greater than the preset support threshold as frequent items; Based on each of the frequent items, a plurality of association rules are generated, and the actual confidence of each of the association rules is calculated; the association rules include the relationship between the condition item and the conclusion item, and the confidence indicates the probability of the conclusion item occurring when the condition item occurs; the condition item and the conclusion item are obtained based on the frequent items; The actual confidence of each of the association rules is compared with a preset confidence threshold, and the association rules whose actual confidence is greater than the preset confidence threshold are obtained.
6. The method according to claim 5, characterized in that Determining a resource allocation strategy based on the analysis result includes: In the case where the data point data is outlier data, the resource allocation strategy includes allocating a third target amount of resources to the fault-tolerant virtual machine corresponding to the outlier data; In any of the following cases: the number of occurrences of the association rule is greater than a number threshold, the business growth rate indicated by the association rule is greater than a growth threshold, and the relevance of the association rule is greater than a relevance threshold, the resource allocation strategy includes allocating a fourth target number of resources to the fault-tolerant virtual machine corresponding to the association rule.
7. A fault-tolerant virtual machine resource configuration device, characterized in that: The device comprises: A redundant backup module is used to perform redundant backup of the backup data based on a scheduled task to obtain target backup data; and save the target backup data to a backup storage location; a detection and recovery module, configured to, in the event of a fault in the fault-tolerant virtual machine, switch the fault-tolerant virtual machine from the faulty host to the standby host, store the target backup data at the backup storage location to the standby host, and record the process from the occurrence of the fault to the storage of the target backup data to the standby host, to obtain a fault log; The elastic resource scheduling module is used to analyze the fault log to obtain an analysis result; based on the analysis result, determine a resource configuration strategy, and use the resource configuration strategy to perform resource configuration on the fault-tolerant virtual machine.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Virtualization platform recovery method and device, computer equipment and storage medium
CN120723380A
