Database disaster recovery switching method and device, equipment, medium and product

Generative AI technology automatically analyzes and reviews database disaster recovery and switching solutions, solving the problems of slow fault recovery and high risk caused by traditional manual operations, and achieving efficient and reliable database disaster recovery and switching.

CN118733347APending Publication Date: 2024-10-01CHINA MOBILE GROUP ZHEJIANG +3
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410919206.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing database disaster recovery switching solutions rely on manual operations, resulting in slow fault recovery, high risks, and easy irreparable losses caused by engineer errors.

Method used

Adopt a database disaster-tolerant switching method based on generative AI technology, analyze the database operating status in real time through the fault determination model, processing decision-making model and AI supervision model, automatically generate and review disaster-tolerant switching plans, reduce manual intervention and improve switching efficiency and reliability .

Benefits of technology

It improves the execution efficiency and reliability of database disaster recovery switching, reduces the risk caused by manual misoperation, and ensures business continuity and data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733347A_ABST
    Figure CN118733347A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing and databases, and provides a database disaster recovery switching method and device, equipment, a medium and a product. Inputting the operation data to a fault judgment model to obtain a fault judgment result and a fault judgment type of the database; if the fault judgment result is abnormal, inputting a fault judgment type into a processing decision model to obtain a disaster recovery switching scheme; inputting the disaster recovery switching scheme to the AI supervision model to obtain an audit result of the disaster recovery switching scheme; and if the audit result is not passed, repeatedly updating the disaster recovery switching scheme, and if the audit result is passed, executing the disaster recovery switching scheme. According to the method, the operation state of the database is analyzed and evaluated through the fault judgment model and the processing decision model, the potential fault is predicted, the disaster recovery switching scheme is generated according to the fault, the disaster recovery switching scheme is checked through the AI supervision model, and the efficiency and reliability of the disaster recovery switching scheme are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of cloud computing and database technology, and in particular to a database disaster recovery switching method, device, equipment, medium and product. Background Art

[0002] With the rapid development of information technology, databases, as core tools for data storage and management, have played an extremely important role in IT information systems. However, databases, like other IT systems, face the possibility of failure, and this situation cannot be completely avoided. Therefore, how to achieve fast and accurate disaster recovery switching when a database fails to ensure the continuity and stable operation of the information system has always been an important issue that the industry needs to solve.

[0003] At present, traditional database disaster recovery switching solutions mainly rely on manual operations. Operation and maintenance engineers evaluate the fault situation based on their experience, determine the database disaster recovery switching solution, and then manually execute the disaster recovery switching. Since fault assessment, disaster recovery switching solution formulation, and scheduling switching are all performed manually and heavily rely on the engineer's experience level, in actual operations, slow fault recovery or even irreparable losses often occur due to engineer errors, and the execution risk is high. Summary of the invention

[0004] The present application provides a database disaster recovery switching method, device, equipment, medium and product to solve the defects in the prior art that fault recovery is slow or even causes irreparable losses due to engineer errors, and the execution risk is high.

[0005] In a first aspect, the present application provides a database disaster recovery switching method, comprising: obtaining operating data of preset indicators of a database; inputting the operating data into a pre-trained fault judgment model to obtain a fault judgment result and a fault judgment type of the database; if the fault judgment result is abnormal, inputting the fault judgment type into a pre-trained processing decision model to obtain a disaster recovery switching plan; inputting the disaster recovery switching plan into a pre-trained AI supervision model to obtain an audit result of the disaster recovery switching plan; if the audit result is not passed, updating the disaster recovery switching plan based on the processing decision model, and evaluating the updated disaster recovery switching plan based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes; if the audit result is passed, executing the disaster recovery switching plan.

[0006] As an embodiment, the training steps of the AI ​​supervision model include: obtaining historical fault judgment types and corresponding historical disaster recovery switching plans to construct training data samples corresponding to the AI ​​supervision model; training a pre-trained language model according to the training data samples to obtain the AI ​​supervision model; wherein the pre-trained language model is an improved BERT model.

[0007] As an embodiment, the training step of the fault judgment model includes: obtaining historical operation data of the database, and constructing a sample set corresponding to the fault judgment model based on the historical operation data; encoding the samples in the sample set to obtain a sample vector; and training a preset random forest model based on the sample vector to obtain the fault judgment model.

[0008] As an embodiment, the training step of the processing decision model includes: constructing a prompt word sample corresponding to the processing decision model according to the business field of the database; encapsulating the prompt word sample based on a preset list format to obtain a packaged prompt word sample object; training a preset deep learning model according to the prompt word sample object to obtain the processing decision model.

[0009] As an embodiment, it also includes: if the audit result is failure, the processing decision model is trained according to the audit result fed back by the AI ​​supervision model to obtain an optimized processing decision model; based on the optimized processing decision model, the disaster recovery switching plan is updated, and the updated disaster recovery switching plan is evaluated based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes.

[0010] As an embodiment, before training the preset deep learning model according to the prompt word sample object, it also includes: dividing the prompt word sample object based on a three-fold cross-validation method, dividing the prompt word sample object into a training set, a test set and a validation set; correspondingly, in the process of training the preset deep learning model according to the prompt word sample object, it also includes: optimizing the deep learning model by adjusting the hyperparameters of the deep learning model.

[0011] As an embodiment, the preset indicators include one or more of performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, log information, user and application behavior indicators, and error and exception indicators. The performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, user and application behavior indicators, and error and exception indicators are data-type indicators. After obtaining the operating data of the preset performance indicators of the database, it also includes: if the preset indicators are numerical indicators, converting the operating data into operating data in a tabular form; preprocessing the tabular operating data based on a preset data analysis tool set to obtain target operating data; correspondingly, inputting the operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database includes: inputting the target operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database.

[0012] In the second aspect, the present application also provides a database disaster recovery switching device, including: a data acquisition module, used to obtain the operating data of the preset indicators of the database; an AI decision module, used to input the operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault judgment type of the database; if the fault judgment result is abnormal, the fault judgment type is input into a pre-trained processing decision model to obtain a disaster recovery switching plan; an AI supervision module, used to input the disaster recovery switching plan into a pre-trained AI supervision model to obtain the review result of the disaster recovery switching plan; a disaster recovery switching module, used to update the disaster recovery switching plan based on the processing decision model if the review result is not passed, and evaluate the updated disaster recovery switching plan based on the AI ​​supervision model until the review result corresponding to the updated disaster recovery switching plan passes; if the review result is passed, execute the disaster recovery switching plan.

[0013] In a third aspect, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the database disaster recovery switching method described above is implemented.

[0014] In a fourth aspect, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described database disaster recovery switching methods.

[0015] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned database disaster recovery switching methods.

[0016] The database disaster recovery switching method, device, equipment, medium and product provided in the present application analyze and evaluate the operating status of the database through a fault judgment model and a processing decision model, predict potential faults, and generate a disaster recovery switching plan for the faults. The disaster recovery switching plan is then reviewed by an AI supervision model to improve the efficiency and reliability of the disaster recovery switching plan, thereby solving the defect of high execution risk caused by relying on the experience level of the operation and maintenance engineer. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is a schematic diagram of the architecture of the existing disaster recovery switching system.

[0019] Figure 2 The figure is a flowchart of the existing disaster recovery switching method.

[0020] Figure 3 It is a flowchart of the database disaster recovery switching method provided by the present application.

[0021] Figure 4 It is a schematic diagram of the training process of the fault judgment model provided in this application.

[0022] Figure 5 It is a schematic diagram of the operating mechanism of the deep learning model provided in this application.

[0023] Figure 6 It is a schematic diagram of the training process of the AI ​​supervision model provided in this application.

[0024] Figure 7 This is one of the structural schematic diagrams of the database disaster recovery switching device provided by the present application.

[0025] Figure 8 This is the second structural schematic diagram of the database disaster recovery switching device provided by the present application.

[0026] Fig. 9 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0029] Figure 1 This is a schematic diagram of the architecture of the existing disaster recovery switching system. Figure 2 This is a flowchart of the existing disaster recovery switching method, such as Figure 1 and Figure 2 As shown in the figure, the traditional database disaster recovery switching solution mainly relies on manual operation. The operation and maintenance engineer evaluates the fault situation based on his experience, determines the database disaster recovery switching solution, and then manually performs the disaster recovery switching. However, this method has obvious disadvantages. The first is the low processing efficiency. Relying on the experience and judgment of individual engineers may lead to a long response time, which slows down the speed of system recovery from faults. In addition, since manual operation is easily affected by subjective factors, the accuracy of disaster recovery switching also faces certain risks. More importantly, there is a potential risk of operational errors in traditional manual disaster recovery switching, which may cause data loss or business interruption. Even experienced engineers can hardly avoid tension and pressure in emergency situations, which increases the possibility of operational errors.

[0030] Since the operation and maintenance engineers need to first evaluate the fault situation and determine the disaster recovery switching plan based on experience, after the plan is determined, they need to dispatch database and application operation and maintenance personnel to execute the switch. The communication and scheduling are cumbersome and time-consuming, resulting in low efficiency of disaster recovery switching, affecting the recovery time of the application system and causing low efficiency of disaster recovery switching.

[0031] Since fault assessment, disaster recovery switching plan formulation and scheduling switching are all performed manually and heavily rely on the engineer's experience level, in actual operations, slow fault recovery or even irreparable losses often occur due to engineer errors, and the execution risk is high.

[0032] To this end, the present application provides a database disaster recovery switching solution based on generative AI technology, which aims to improve the execution efficiency of database disaster recovery switching and reduce the switching risk. It uses generative AI technology to analyze and evaluate the operating status of the database in real time, predict potential failures, and use AI supervision models to manage and execute disaster recovery switching processes, thereby improving the efficiency and reliability of switching execution.

[0033] The following is attached to the instruction manual Figure 3-Figure 9 The database disaster recovery switching method, device, equipment, medium and product provided in this application are described in detail.

[0034] Figure 3 It is a flowchart of the database disaster recovery switching method provided by this application, such as Figure 3 As shown, the present application provides a database disaster recovery switching method, including the following steps S100 to S600.

[0035] Step S100, obtain the operation data of the preset indicators of the database; specifically, the operation data of the preset indicators of the database and / or application system can be obtained regularly or in real time, and the preset indicators include key performance indicators of the database such as CPU occupancy, memory usage, and disk I / O. To improve accuracy, the operation data can be cleaned and processed in a preferred embodiment to ensure the accuracy and consistency of the data. Provide high-quality input for subsequent generative AI models such as fault judgment models and processing decision models, and provide reliable data support.

[0036] Step S200, input the operation data into the pre-trained fault judgment model to obtain the fault judgment result and fault judgment type of the database; the fault judgment model is used to obtain the characteristics of the operation data and judge the operation status of the database. The characteristics of the operation data are used to characterize at least one aspect of the performance indicators of the database, including but not limited to CPU occupancy, memory usage, disk I / O, network delay, etc. The fault judgment model is used to analyze the characteristics of the operation data and make a comprehensive judgment on the operation status of the database according to the analysis results. The judgment target includes two aspects. First, it is judged whether the operation status of the database is normal. Specifically, the benchmark value of each feature is set and compared with the historical data to determine whether the database is in a healthy state. The second is the abnormal type judgment. The fault judgment model obtains the fault judgment result of the database according to the operation data. The fault judgment result includes the existence of fault and no fault. If the fault judgment result indicates that the operation data corresponding to a preset performance indicates that the database has a fault in the preset performance, then continue to judge the fault type. The fault types of the database are different, such as performance bottlenecks, connection problems, resource exhaustion, etc. The fault judgment model further analyzes the operation data of the preset performance to determine the specific type of the abnormality. By accurately identifying the fault type, corresponding countermeasures can be taken more quickly and accurately.

[0037] Step S300: If the fault determination result is abnormal, the fault determination type is input into the pre-trained processing decision model to obtain a disaster recovery switching plan; the processing decision model is used to generate reasonable solutions for each fault type, thereby replacing or assisting manual operation to formulate a database disaster recovery switching plan. It can not only reduce the burden of manual operation, but also provide immediate and professional solutions in emergency situations, effectively ensuring business continuity. Its advantages lie in timeliness, degree of automation, and adaptability to complex database environments, providing a more intelligent and efficient solution for database disaster recovery switching.

[0038] Step S400, input the disaster recovery switching plan into the pre-trained AI supervision model to obtain the audit result of the disaster recovery switching plan; the AI ​​supervision model is used to supervise and audit the disaster recovery switching plan before executing it. Specifically, based on existing experience and historical case data, the disaster recovery switching plan is evaluated to verify its correctness. The audit results are divided into two options: pass and fail. The disaster recovery switching plan that passes the audit will be deemed trustworthy and can be executed. Auditing through the AI ​​supervision model is not only an additional verification layer for the disaster recovery switching plan, but also to establish a loop feedback system. The audit results will be used to train the processing decision model to improve its accuracy and adaptability. In this way, it is expected that the processing decision model can continuously optimize itself, better adapt to various complex situations, and improve performance and stability.

[0039] Step S500, if the audit result is not passed, the disaster recovery switching plan is updated based on the processing decision model, and the updated disaster recovery switching plan is evaluated based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes.

[0040] Step S600, if the audit result is passed, execute the disaster recovery switching plan. While executing the disaster recovery switching plan, the database and / or application system can also be switched from the faulty database to the backup database to ensure business continuity, quickly respond to potential failure situations, and minimize the possibility of business interruption. During the switching process, data synchronization and alarm notification steps can also be performed. Data synchronization refers to ensuring data synchronization between the primary database and the backup database during the switching process to prevent data loss or inconsistency, and ensure that after the switch, the backup system can continue to provide the latest data consistent with the primary system. Alarm notification refers to the automatic generation of alarm notifications during the disaster recovery switching process to notify relevant operation and maintenance personnel and teams, ensuring manual intervention and review, so as to gain a deeper understanding of the cause of the failure and conduct further investigation.

[0041] It can be understood that the present application detects the operating status of the database in real time through a fault judgment model and a processing decision model. Once a fault is detected, disaster recovery switching is automatically performed, potential faults are predicted, and a disaster recovery switching plan is generated for the fault. The disaster recovery switching plan is then reviewed by the AI ​​supervision model. Measures can be taken before potential problems occur, thereby minimizing the time of business interruption, improving the efficiency and reliability of the disaster recovery switching plan, and solving the defect of higher execution risk caused by relying on the experience level of the operation and maintenance engineer.

[0042] Based on the above embodiments, as an optional embodiment, the preset indicators include one or more of performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, log information, user and application behavior indicators, and error and exception indicators, and the performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, user and application behavior indicators, and error and exception indicators are data type indicators.

[0043] Performance indicators are used to determine whether the database is facing performance bottlenecks or excessive resource consumption, including information such as CPU usage, memory usage, disk I / O, and network bandwidth. Transaction and query indicators are used to evaluate the responsiveness and processing capabilities of the database, including transaction processing speed, query response time, and execution plans for complex queries. Data consistency and integrity indicators are used to reflect the reliability and integrity of data, including data verification errors, the number of data loss or corruption, etc. System and resource indicators are used to characterize the status of the database system environment, including information such as system load, disk space usage, and network latency. Log information is used to analyze potential problems and failures of the database, including error logs and audit logs. User and application behavior indicators are used to reflect the usage and load distribution of the database, including user access volume, application request volume, and number of active sessions. Error and exception indicators are used to reflect the health status and potential failures of the database, including error codes returned by the database, exception information returned by the database, and the number of SQL statement execution failures.

[0044] After obtaining the operating data of the preset performance indicators of the database, it also includes: if the preset indicator is a numerical indicator, converting the operating data into operating data in a tabular form; preprocessing the operating data in the tabular form based on a preset data analysis tool set to obtain target operating data.

[0045] Specifically, the running data of the numerical indicators of this application are converted into a table format, and the Pandas library is used to remove records with many missing values ​​and duplicate data in the table. Pandas is a data processing and analysis library based on the Python programming language, which provides a large number of functions and data structures for data manipulation and analysis. The core is DataFrame, which is similar to a spreadsheet or SQL database table and can easily process various data formats. Pandas also provides data structures such as Series and Panel, as well as various data manipulation functions, such as data filtering, querying, aggregation, merging, etc.

[0046] The preprocessing of tabular operational data also includes detecting and removing invalid, erroneous or abnormal data that may affect data quality based on preset algorithms and rules, such as filling missing values, processing outliers, and normalizing the data format to ensure that the data remains consistent throughout the entire processing process.

[0047] If the number of running data samples is small, the missing values ​​of the preset indicators can be filled based on the mean method. The filling steps include calculating the first 10 and last 10 values ​​of each sample on the feature column, adding them up, and then dividing them by 20. The obtained mean is used as the filling number for the missing value. Filling with the mean method can effectively handle missing values ​​and ensure the integrity and accuracy of the data on key features.

[0048] Examples of target operation data obtained after preprocessing are shown in the following table.

[0049]

[0050] Correspondingly, the inputting of the operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database includes: inputting the target operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database.

[0051] It can be understood that the present application provides types of preset indicators and preprocessing solutions, which can ensure data consistency, completeness and accuracy and provide reliable data support.

[0052] Figure 4 is a schematic diagram of the training process of the fault judgment model provided by this application, such as Figure 4 As shown, based on the above embodiment, as an optional embodiment, the training step of the fault judgment model includes steps S011 to S013.

[0053] Step S011, obtain the historical operation data of the database, and construct the sample set corresponding to the fault judgment model according to the historical operation data; specifically, the historical operation data includes the historical operation data of preset indicators, including fault operation data and normal operation data, and the sample set corresponding to the fault judgment model is constructed according to the historical operation data, that is, the historical operation data is labeled to indicate whether it is fault operation data or normal operation data, and the sample set is constructed according to no less than 200 historical operation data. It should be noted that in order to improve the accuracy of the fault judgment model, the historical operation data is preprocessed after being obtained, and the preprocessing process refers to the preprocessing step of the operation data.

[0054] Step S012, encode the samples in the sample set to obtain a sample vector; specifically, the samples in the sample set may be one-hot encoded to convert the samples into a vector form. One-hot encoding is a commonly used data preprocessing technology used to convert categorical variables into a form that is more suitable for processing by machine learning algorithms. When performing machine learning tasks, it is usually necessary to convert categorical variables into digital form, and using one-hot encoding can avoid introducing incorrect size relationships between different values ​​of categorical variables.

[0055] Step S013: training a preset random forest model according to the sample vector to obtain the fault judgment model.

[0056] Specifically, based on the business scenario of the database, the infrastructure of the fault judgment model adopts the random forest in machine learning. The random forest is an algorithm that integrates multiple trees through the idea of ​​ensemble learning. The basic unit is the decision tree. The essence of the random forest belongs to a major branch of machine learning - the ensemble learning method. The random forest adopts a voting mechanism to further learn and classify based on the decision tree, which can better ensure the accuracy of the model. Secondly, the randomness of the random forest helps to prevent overfitting. Since each tree is trained on a different data subset and feature subset, the model can better adapt to different variances and reduce the risk of overfitting.

[0057] In the process of training the preset random forest model according to the sample vector, the present application improves the performance and generalization ability of the model by selecting hyperparameters, randomly selects 10 data sets with replacement from the original historical operation data, and then selects m features based on strong business correlation, which play a strong correlation role in the fault judgment results of the database. Then, 10 decision tree models are constructed based on these 10 data sets, and then the random forest ensemble learning training is performed based on the classification results of the decision trees.

[0058] Optionally, the fault judgment model is used to predict faults of the database's operating data. Two major types of results can be set with numbers. The number 0 represents normal, and the numbers 1, 2, 3... represent the fault type. If the fault judgment result is abnormal, the fault judgment type is encapsulated and pushed to the processing decision model.

[0059] It can be understood that the present application provides a training scheme for the fault judgment model. By encoding the samples in the sample set, it avoids the introduction of incorrect size relationships between different values ​​of the classification variables, and then trains the random forest model to obtain a fault judgment model that can adapt to different variances and reduce the risk of overfitting.

[0060] Based on the above embodiment, as an optional embodiment, the training step of the processing decision model includes steps S021 to S023.

[0061] Step S021, constructing prompt word samples corresponding to the processing decision model according to the business domain of the database; the processing decision model is a generative model, and prompt word materials need to be constructed in combination with the business domain of the database to train the processing decision model.

[0062] Step S022, encapsulating the prompt word sample based on a preset list format to obtain an encapsulated prompt word sample object; an example of encapsulating the prompt word sample based on a preset list format is as follows. [

[0064] {

[0065] “prompId”: “2”,

[0066] "prompType": "string",

[0067] "collectTime": "20XX-09-01 22:02:28",

[0068] “content”: “Insufficient memory space###dsdsfdghftwewr”,

[0069] "output": "It is recommended to increase memory"

[0070] },

[0071] {

[0072] “prompId”: “3”,

[0073] "prompType": "string",

[0074] "collectTime": "20XX-10-01 12:04:38",

[0075] “content”: “Response speed is too long###ertsadftsddsf”,

[0076] "output": "It is recommended to check the network and CPU index"

[0077] } ]

[0079] The above diagram shows that the sample objects are encapsulated in the form of a list. There are two objects. In each object, prompId represents the ID of the prompt sample, prompType represents the data type, collectTime represents the collection time, and content represents the prompt word content, including the prediction results of the fault judgment model and the core content of the database log. They are separated by three # characters "###" and concatenated as the input of the model. Output represents the label.

[0080] Step S023: training a preset deep learning model according to the prompt word sample object to obtain the processing decision model.

[0081] According to the database business scenario, this application uses the deep learning model seq2seq to train the generative model as a decision-making processing model. In the database business fault scenario, the fault description can be used as an input sequence to let the Seq2Seq model generate corresponding solution suggestions. The model training process will rely on the fault description and the corresponding suggestion pair to learn the mapping relationship between the fault description and the corresponding suggestion pair.

[0082] As an optional embodiment, if the audit result is failure, the processing decision model is trained according to the audit result fed back by the AI ​​supervision model to obtain an optimized processing decision model; the disaster recovery switching plan is updated based on the optimized processing decision model, and the updated disaster recovery switching plan is evaluated based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes.

[0083] It can be understood that the present application uses the AI ​​supervision model as an additional verification layer and can also be used to establish a circular feedback mechanism. The AI ​​supervision model obtains the audit result of the disaster recovery switching plan. If the audit result is failure, the audit result will also be used to optimize the training of the decision-making model to improve the accuracy and adaptability of the decision-making model. The model provided by the present application can continuously optimize itself, better adapt to various complex situations, and improve performance and stability.

[0084] As an optional embodiment, before training the preset deep learning model according to the prompt word sample object, it also includes: dividing the prompt word sample object based on the three-fold cross-validation method, and dividing the prompt word sample object into a training set, a test set and a validation set. For example, the ratio is 7:2:1, the training set accounts for 70% of the total data, the test set and the validation set account for 20% and 10% of the total data respectively.

[0085] Figure 5 This is a schematic diagram of the operating mechanism of the deep learning model provided in this application, such as Figure 5 As shown in the figure, the seq2seq model first reads the content and output in the prompt word sample object, and then embeds the word, and inputs the word vectorized content into the encoder of the seq2seq model. The seq2seq model is a temporal model based on , , ...... The learning mode of features at different moments. For example, the three words "slow speed" are input respectively, and the weight W output by the encoder at the last moment is the learned text information feature. The encoder passes the weight W to the decoder, and the decoder concatenates this W with the value input by the horizontal C, and outputs the words "expand memory" in time sequence.

[0086] Correspondingly, in the process of training the preset deep learning model according to the prompt word sample object, it also includes: optimizing the deep learning model by adjusting the hyperparameters of the deep learning model.

[0087] Specifically, in model training, this application optimizes the model by adjusting hyperparameters, including learning rate and step size, to ensure the robust performance of the model on different data sets and improve its generalization ability on unseen data. The tuning of hyperparameters is accomplished through a feedback mechanism during iterative training to obtain the best model effect.

[0088] Optionally, the processing decision model is used to generate a disaster recovery switching plan based on the database fault type information. The generated disaster recovery switching plan will be spliced ​​into a text segment together with the content in the prompt word, that is, the database fault type and log description, and pushed to the AI ​​supervision model for final plan review.

[0089] It is understandable that the present application provides a training scheme for processing decision models. By encapsulating the prompt word samples in a list form, it can adapt to various data structures, facilitate traversal, and pass multiple data or objects at a time, simplifying the parameter passing and calling process, and facilitating unified processing and management. Through the three-fold cross-validation method, it is easy to determine the optimal sample set partitioning strategy, and the model is optimized by adjusting the hyperparameters to ensure that the performance of the model on different data sets is robust and improve its generalization ability on unseen data.

[0090] Figure 6 This is a schematic diagram of the training process of the AI ​​supervision model provided in this application, such as Figure 6 As shown, based on the above embodiment, as an optional embodiment, the training steps of the AI ​​supervision model include steps S031-S032.

[0091] Step S031, obtain the historical fault judgment type and the corresponding historical disaster recovery switching solution to construct the training data sample corresponding to the AI ​​supervision model; process the text content transmitted by the processing decision model, splice the content in the prompt word and the solution suggestion output by the processing decision model, and use <seg>The symbols are segmented and spliced ​​into a long text segment as the input of the model. The labels are marked as "pass" and "fail". The training data samples corresponding to the AI ​​supervision model can be insufficient memory space###dsdsfdghftwewr <seg>It is recommended to increase the memory, the response speed is too long###ertsadftsddsf <seg>It is recommended to check the network and CPU index, and query returns abnormality###ertsadftsddsf <seg>It is recommended to check the network, etc. The labels of the above three samples are passed, passed, and failed respectively.

[0092] Step S032: training the pre-trained language model according to the training data sample to obtain the AI ​​supervision model; wherein the pre-trained language model is an improved BERT model.

[0093] Optionally, the RoBERTa model can be used to build a supervised model. The RoBERTa model is based on the Transformer model architecture and is a deep neural network with a self-attention mechanism. The Transformer model performs well in processing long-distance dependencies and capturing global context, enabling RoBERTa to better understand and represent the complex structure of language.

[0094] The samples are vectorized and then input into the pre-trained language model. The pre-trained language model is fine-tuned to train a binary classification model. During the training process, it is necessary to note the historical fault judgment types and the corresponding historical disaster recovery switching solutions. If the number of samples is too small, the samples can be expanded by data enhancement. The training data samples corresponding to the AI ​​supervision model are divided into training set, test set, and validation set in a ratio of 8:1:1. The pre-trained language model is trained based on the training set until the number of iterations is reached or the model reaches the optimal value.

[0095] It can be understood that this application fully controls the execution of database disaster recovery switching based on self-decision-making, self-assessment, and self-supervision mode, which can effectively solve the problem of manual error operation and greatly reduce the risk of disaster recovery switching. At the same time, this method can adapt to disaster recovery needs in different scenarios.

[0096] The following is a description of the database disaster recovery switching device provided by the present application. The database disaster recovery switching device described below and the database disaster recovery switching method described above can be referenced to each other.

[0097] Figure 7 This is one of the structural diagrams of the database disaster recovery switching device provided by the present application, such as Figure 7 As shown, the present application also provides a database disaster recovery switching device, including a data acquisition module 710, an AI decision module 720, an AI supervision module 730 and a disaster recovery switching module 740.

[0098] The data collection module 710 is used to obtain the operation data of the preset indicators of the database.

[0099] The AI ​​decision module 720 is used to input the operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault judgment type of the database; if the fault judgment result is abnormal, the fault judgment type is input into a pre-trained processing decision model to obtain a disaster recovery switching plan.

[0100] The AI ​​supervision module 730 is used to input the disaster recovery switching plan into a pre-trained AI supervision model to obtain the review result of the disaster recovery switching plan.

[0101] The disaster recovery switching module 740 is used to update the disaster recovery switching plan based on the processing decision model if the audit result is not passed, and evaluate the updated disaster recovery switching plan based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes; if the audit result is passed, execute the disaster recovery switching plan.

[0102] As an embodiment, the AI ​​supervision module 730 is also used to: obtain historical fault judgment types and corresponding historical disaster recovery switching plans to construct training data samples corresponding to the AI ​​supervision model; train the pre-trained language model according to the training data samples to obtain the AI ​​supervision model; wherein the pre-trained language model is an improved BERT model.

[0103] As an embodiment, the AI ​​decision module 720 is also used to: obtain historical operation data of the database, and construct a sample set corresponding to the fault judgment model based on the historical operation data; encode the samples in the sample set to obtain a sample vector; and train a preset random forest model based on the sample vector to obtain the fault judgment model.

[0104] As an embodiment, the AI ​​decision module 720 is also used to: construct a prompt word sample corresponding to the processing decision model according to the business field of the database; encapsulate the prompt word sample based on a preset list format to obtain a packaged prompt word sample object; train a preset deep learning model according to the prompt word sample object to obtain the processing decision model.

[0105] As an embodiment, the AI ​​decision module 720 is also used for: if the audit result is failure, training the processing decision model according to the audit result fed back by the AI ​​supervision model to obtain an optimized processing decision model; updating the disaster recovery switching plan based on the optimized processing decision model, and evaluating the updated disaster recovery switching plan based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes.

[0106] As an embodiment, the AI ​​decision module 720 is also used to: divide the prompt word sample object based on the three-fold cross-validation method, and divide the prompt word sample object into a training set, a test set and a validation set; correspondingly, in the process of training the preset deep learning model according to the prompt word sample object, it also includes: optimizing the deep learning model by adjusting the hyperparameters of the deep learning model.

[0107] As an embodiment, the preset indicators include one or more of performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, log information, user and application behavior indicators, and error and exception indicators. The performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, user and application behavior indicators, and error and exception indicators are data-type indicators. After obtaining the operating data of the preset performance indicators of the database, it also includes: if the preset indicators are numerical indicators, converting the operating data into operating data in a tabular form; preprocessing the tabular operating data based on a preset data analysis tool set to obtain target operating data; correspondingly, inputting the operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database includes: inputting the target operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database.

[0108] Figure 8 This is the second structural diagram of the database disaster recovery switching device provided by the present application, such as Figure 8 As shown, in the face of hardware failures, network problems or other abnormal situations, the present application can quickly and intelligently switch to the backup database to ensure business continuity and stability, minimizing potential revenue losses. The automated decision-making process reduces the burden of manual operations and reduces the need for intervention by operation and maintenance personnel. Generative AI technology can monitor the database status in real time, accurately predict potential failures, reduce the time and complexity of troubleshooting, and enable the operation and maintenance team to focus more on system optimization and innovative work, thereby improving overall operation and maintenance efficiency. Through intelligent disaster recovery switching strategies, the risks of business caused by failures can be effectively reduced. Compared with traditional manual switching, automated decision-making reduces the possibility of human error and further reduces potential business risks. In long-term operations, maintenance costs and manual intervention expenses are also reduced. The adaptability of generative AI technology enables the system to flexibly adapt to disaster recovery needs in different scenarios and complex environments. Whether facing large-scale failures or local problems, the present application can intelligently adjust the disaster recovery strategy to provide a more flexible and customizable disaster recovery solution.

[0109] The database disaster recovery switching device provided in the present application is used to implement the database disaster recovery switching method provided in any of the above embodiments, and has the technical effect corresponding to the database disaster recovery switching method, which will not be described in detail.

[0110] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 complete mutual communication through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the database disaster recovery switching method, which includes: obtaining the operation data of the preset index of the database; inputting the operation data into the pre-trained fault judgment model to obtain the fault judgment result and fault judgment type of the database; if the fault judgment result is abnormal, inputting the fault judgment type into the pre-trained processing decision model to obtain the disaster recovery switching plan; inputting the disaster recovery switching plan into the pre-trained AI supervision model to obtain the audit result of the disaster recovery switching plan; if the audit result is not passed, updating the disaster recovery switching plan based on the processing decision model, and evaluating the updated disaster recovery switching plan based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes; if the audit result is passed, executing the disaster recovery switching plan.

[0111] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0112] On the other hand, the present application also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the database disaster recovery switching method provided by the above methods, the method including: obtaining the operating data of the preset indicators of the database; inputting the operating data into a pre-trained fault judgment model to obtain the fault judgment result and fault judgment type of the database; if the fault judgment result is abnormal, inputting the fault judgment type into a pre-trained processing decision model to obtain a disaster recovery switching plan; inputting the disaster recovery switching plan into a pre-trained AI supervision model to obtain the review result of the disaster recovery switching plan; if the review result is not passed, updating the disaster recovery switching plan based on the processing decision model, and evaluating the updated disaster recovery switching plan based on the AI ​​supervision model until the review result corresponding to the updated disaster recovery switching plan passes; if the review result is passed, executing the disaster recovery switching plan.

[0113] On the other hand, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the database disaster recovery switching method provided by the above-mentioned methods, the method comprising: obtaining operating data of preset indicators of the database; inputting the operating data into a pre-trained fault judgment model to obtain a fault judgment result and a fault judgment type of the database; if the fault judgment result is abnormal, inputting the fault judgment type into a pre-trained processing decision model to obtain a disaster recovery switching plan; inputting the disaster recovery switching plan into a pre-trained AI supervision model to obtain an audit result of the disaster recovery switching plan; if the audit result is not passed, updating the disaster recovery switching plan based on the processing decision model, and evaluating the updated disaster recovery switching plan based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes; if the audit result is passed, executing the disaster recovery switching plan.

[0114] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.< / seg> < / seg> < / seg> < / seg>

Claims

1. A database disaster recovery switching method, characterized in that: include: Obtain the operating data of the preset indicators of the database; Inputting the operation data into a pre-trained fault determination model to obtain a fault determination result and a fault determination type of the database; If the fault determination result is abnormal, the fault determination type is input into a pre-trained processing decision model to obtain a disaster recovery switching solution; Input the disaster recovery switching plan into the pre-trained AI supervision model to obtain the review result of the disaster recovery switching plan; If the audit result is not passed, the disaster recovery switching plan is updated based on the processing decision model, and the updated disaster recovery switching plan is evaluated based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes; If the audit result is passed, the disaster recovery switching plan is executed.

2. The database disaster recovery switching method according to claim 1, characterized in that: The training steps of the AI ​​supervision model include: Obtaining historical fault determination types and corresponding historical disaster recovery switching solutions to construct training data samples corresponding to the AI ​​supervision model; The pre-trained language model is trained according to the training data sample to obtain the AI ​​supervision model; wherein the pre-trained language model is an improved BERT model.

3. The database disaster recovery switching method according to claim 1, characterized in that: The training step of the fault judgment model includes: Acquire historical operation data of the database, and construct a sample set corresponding to the fault determination model according to the historical operation data; Encoding the samples in the sample set to obtain a sample vector; The preset random forest model is trained according to the sample vector to obtain the fault judgment model.

4. The database disaster recovery switching method according to claim 1, characterized in that: The training step of processing the decision model includes: Constructing prompt word samples corresponding to the processing decision model according to the business field of the database; Encapsulating the prompt word sample based on a preset list form to obtain an encapsulated prompt word sample object; The preset deep learning model is trained according to the prompt word sample object to obtain the processing decision model.

5. The database disaster recovery switching method according to claim 1, characterized in that: Also includes: If the audit result is failure, the processing decision model is trained according to the audit result fed back by the AI ​​supervision model to obtain an optimized processing decision model; The disaster recovery switching plan is updated based on the optimized processing decision model, and the updated disaster recovery switching plan is evaluated based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan is passed.

6. The database disaster recovery switching method according to claim 4, characterized in that: Before training the preset deep learning model according to the prompt word sample object, it also includes: Dividing the prompt word sample objects into a training set, a test set and a validation set based on a three-fold cross validation method; Correspondingly, in the process of training the preset deep learning model according to the prompt word sample object, it also includes: The deep learning model is optimized by adjusting the hyperparameters of the deep learning model.

7. The database disaster recovery switching method according to any one of claims 1 to 6, characterized in that: The preset indicators include one or more of performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, log information, user and application behavior indicators, and error and exception indicators. The performance indicators, transaction and query indicators, data consistency and integrity indicators, system and resource indicators, user and application behavior indicators, and error and exception indicators are data indicators. After obtaining the operation data of the preset performance indicators of the database, it also includes: If the preset indicator is a numerical indicator, converting the operating data into operating data in a tabular form; Preprocess the tabular operation data based on the preset data analysis tool set to obtain the target operation data; Correspondingly, the inputting of the operation data into the pre-trained fault determination model to obtain the fault determination result and fault type of the database includes: The target operation data is input into a pre-trained fault judgment model to obtain the fault judgment result and fault type of the database.

8. A database disaster recovery switching device, characterized in that: include: A data collection module is used to obtain the operating data of preset indicators of the database; An AI decision module, used for inputting the operation data into a pre-trained fault judgment model to obtain a fault judgment result and a fault judgment type of the database; If the fault determination result is abnormal, the fault determination type is input into a pre-trained processing decision model to obtain a disaster recovery switching solution; An AI supervision module is used to input the disaster recovery switching plan into a pre-trained AI supervision model to obtain a review result of the disaster recovery switching plan; The disaster recovery switching module is used to update the disaster recovery switching plan based on the processing decision model if the audit result is not passed, and evaluate the updated disaster recovery switching plan based on the AI ​​supervision model until the audit result corresponding to the updated disaster recovery switching plan passes; if the audit result is passed, execute the disaster recovery switching plan.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the database disaster recovery switching method as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the database disaster recovery switching method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the database disaster recovery switching method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Disaster recovery switching method and device, equipment, storage medium and product

    CN120017493A

  • Disaster recovery switchover methods, devices, equipment, storage media and products

    CN120017493B

  • Data query method and device, computer equipment and storage medium

    CN121705331A