Roll-back processing method and device, computer equipment and storage medium
By building a mapping table for operations and rollback commands, evaluating operational criticality and making multi-dimensional rollback necessity judgments, optimizing the rollback command sequence, solving the problems of low rollback efficiency and poor stability in the existing technology, and achieving more efficient rollback processing and system recovery.
Patent Information
- Application Number
- CN202411988833.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-31
AI Technical Summary
When handling configuration errors in distributed storage systems, it is difficult to effectively deal with complex dependencies and operational criticality, resulting in low rollback efficiency, slow recovery speed and poor stability.
By obtaining system business logic information, building a mapping table for operations and rollback commands, performing operation critical evaluation and hierarchical cache, comprehensively analyzing error information and system status to make multi-dimensional rollback necessity judgments, and optimizing the rollback command sequence based on dynamic rollback time.
It improves rollback efficiency, shortens the recovery time of distributed systems, improves the stability and recovery of the system, and avoids the negative impact of unnecessary rollback operations on system performance.
Smart Images

Figure CN119782049A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of system management, and in particular to a rollback processing method, apparatus, computer equipment and storage medium. Background Art
[0002] As distributed storage systems are increasingly used in various block scenario businesses, the configuration files and command operations involved are becoming more and more complex. These operations have strong sequential logic. Once an error occurs in a certain link, it may lead to incomplete cluster configuration information and abnormal status, which in turn affects the normal function of the cluster. Especially in a distributed environment, configuration errors may propagate among multiple nodes, causing the entire system to fail. When an error occurs, a set of rollback recovery methods is required.
[0003] In the prior art, the rollback of system configuration errors mainly relies on the configuration backup and restore method. Usually, the system status is backed up in advance, and if the operation fails, it is restored to the backup status. However, this method has many limitations. When the configuration is strongly related to the specific commands or processes executed in the system, the backup and restore method cannot solve these complex dependencies.
[0004] In addition, customized rollback for failed nodes of specific business processes is also a common supplementary means in the prior art. The customized rollback method usually requires manual writing of rollback commands related to failed operations based on specific business logic and operation processes. The workload is huge and the maintenance cost is high. Especially in large and complex systems, when there are many process nodes and they are closely dependent on each other, it is difficult to write customized rollback commands for each possible failure point. At the same time, manually customized rollback commands are prone to omissions or misoperations, further increasing the difficulty and risk of system recovery. Summary of the invention
[0005] Based on this, it is necessary to provide a rollback processing method, device, computer equipment and storage medium that can handle complex dependencies, combine intelligent evaluation of operation criticality and multi-dimensional judgment of the necessity of rollback, optimize the rollback command sequence, thereby improving rollback efficiency and enhancing the recovery speed and stability of distributed systems.
[0006] In one aspect, a rollback processing method is provided, the method comprising:
[0007] Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table;
[0008] Performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0009] In response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table;
[0010] In response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity judgment of multi-dimensional rollback is performed;
[0011] In response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, obtaining an initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table;
[0012] Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0013] Rollback processing is performed according to the optimized rollback command sequence.
[0014] In one embodiment, system business logic information is obtained, operation commands and rollback commands are obtained, and an operation rollback mapping table is constructed, including:
[0015] According to the system business logic information, all operations that affect the business logic are obtained;
[0016] Based on the functionality and scope of the operations, all the operations that affect the business logic are classified to obtain a number of business operations;
[0017] According to the plurality of business operations, obtaining corresponding execution instructions and dynamic parameters, wherein the execution instructions and the dynamic parameters constitute the operation command;
[0018] According to the operation command, define the rollback command and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and a rollback dynamic parameter;
[0019] In response to the rollback dynamic parameter being consistent with the dynamic parameter, the operation rollback mapping table is constructed based on the operation rollback mapping relationship.
[0020] In one embodiment, performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result includes:
[0021] Acquire the operation rollback mapping table to obtain the operation command and the rollback command;
[0022] Defining operation criticality assessment indicators, wherein the operation criticality assessment indicators include at least one of the following: business impact, operation dependency, data integrity, rollback difficulty, user impact, and operation frequency;
[0023] Acquire system historical data, combine the system business logic information, and set the impact coefficient of the operation criticality evaluation indicator;
[0024] According to the operation criticality evaluation index, combined with the rollback command, the operation command is evaluated to obtain an index score;
[0025] According to the indicator score, combined with the influence coefficient of the operation criticality evaluation indicator, the operation criticality score is obtained, wherein the operation criticality score is obtained based on the following formula: Where K represents the operation criticality score of the operation command, and F i represents the index score of the i-th operation criticality evaluation index of the operation command, ω i represents the influence coefficient of the i-th operation criticality evaluation indicator, and n represents the number of the operation criticality evaluation indicators;
[0026] A critical threshold is set, and in response to the operation criticality score being greater than the critical threshold, the operation criticality evaluation result is a critical operation, otherwise, the operation criticality evaluation result is a non-critical operation.
[0027] In one of the embodiments, in response to the operation command being executed, the operation information is obtained, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table, including:
[0028] In response to the operation command being executed, obtaining operation information of the operation command, wherein the operation information includes at least one of the following: operation type, operation object, operation time, and operation result;
[0029] In response to the operation command being executed, obtaining operation information of the operation command;
[0030] According to the operation criticality evaluation result of the operation command, a corresponding cache strategy is adopted for the operation information;
[0031] In response to the operation command being a critical operation, all the operation information of the operation command is cached to obtain a critical operation information table, wherein the critical operation information table is stored in the cache hardware;
[0032] In response to the operation command being a non-critical operation, only part of the operation information of the operation command is cached to obtain a non-critical operation information table, wherein the non-critical operation information table is stored in persistent storage hardware, wherein part of the operation information includes at least one of the following: operation type, operation object, operation time, and operation result;
[0033] Based on the information storage addresses of the critical operation information table and the non-critical operation information table, an index is constructed to generate a hierarchical operation information record table, wherein the hierarchical operation information record table is stored in the cache hardware.
[0034] In one of the embodiments, in response to an error occurring when the operation command is executed, error information and system status information are obtained, and a multi-dimensional rollback necessity determination is performed, including:
[0035] In response to an error occurring when the operation command is executed, based on an exception handling mechanism, capturing and recording error information, and at the same time, checking the current system state to obtain the system state information;
[0036] generating an error report by combining the error information and the system status information;
[0037] Based on the error report, a multi-dimensional judgment is performed to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment;
[0038] Based on the multi-dimensional judgment results, a multi-dimensional rollback necessity judgment is performed to obtain a multi-dimensional rollback necessity judgment result;
[0039] Wherein, based on the multi-dimensional judgment results, the multi-dimensional rollback necessity judgment further includes:
[0040] The data consistency judgment is performed to obtain a data consistency judgment result, wherein the data consistency judgment is based on the formula: Among them, D c Indicates the result of data consistency judgment. If D c =1, it means that there is data inconsistency, T represents the transaction status check result, C d Indicates the result of data integrity constraint check, B d Indicates the result of checking the correctness of business data;
[0041] The system stability judgment is performed to obtain the system stability judgment result, and the system stability judgment is based on the formula: Among them, S I Indicates the result of system stability judgment. If S I =1, it means that the system is unstable, R indicates the result of resource usage over limit check, D s Indicates the deadlock and zombie process check results;
[0042] Perform the business logic judgment to obtain the business logic judgment result, and the business logic judgment is based on the formula: Among them, B R Indicates the result of business logic judgment. If SI =1, it means that the business logic is affected. P Indicates the dependent operation execution result of the current operation, B r Indicates the integrity check result of business constraint rules;
[0043] The multi-dimensional rollback necessity judgment result is obtained by combining the data consistency judgment result, the system stability judgment result and the business logic judgment result, wherein the multi-dimensional rollback necessity judgment is based on the formula: RB need =D c ∨S I ∨B R , where RB need Indicates the result of the multi-dimensional rollback necessity judgment. If RB need =1, the result of the multi-dimensional rollback necessity judgment is that rollback is required.
[0044] In one of the embodiments, in response to the multi-dimensional rollback necessity judgment result being that rollback is required, an initial rollback command sequence is obtained according to the hierarchical operation information record table and the operation rollback mapping table, including:
[0045] Acquire the operation command that generates an error when being executed, and obtain the error operation command;
[0046] According to the erroneous operation command, relevant operation information is extracted from the hierarchical operation information record table to obtain rollback related parameters and operation dependency;
[0047] According to the operation rollback mapping table, based on the operation rollback mapping relationship, an error rollback command is obtained, wherein the error rollback command includes: an error rollback execution instruction, and the rollback related parameters, and the error rollback execution instruction and the execution instruction of the error operation command conform to the operation rollback mapping relationship;
[0048] According to the operation dependency, the execution order of several error rollback commands is established based on the reverse order principle to obtain an initial rollback command sequence.
[0049] In one embodiment, based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, including:
[0050] Acquire the initial rollback command sequence to obtain a number of the error rollback commands;
[0051] Based on the complexity of the operation, the current load of the system and the resource consumption, an estimated execution time of each of the error rollback commands is obtained;
[0052] Obtaining the operation dependency relationship and constructing an operation dependency graph;
[0053] According to the operation dependency graph, a parallel execution operation set is obtained;
[0054] According to the parallel execution operation set, the parallelism of each error rollback command is obtained;
[0055] Based on the estimated execution time and the degree of parallelism, the execution order of the plurality of erroneous rollback commands is rearranged and processed in parallel to obtain an optimized rollback command sequence.
[0056] In another aspect, a rollback processing device is provided, the device comprising:
[0057] The system business logic acquisition and mapping module is used to acquire system business logic information, obtain operation commands and rollback commands, and construct an operation rollback mapping table;
[0058] An operation criticality assessment module, used to perform an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0059] An operation information recording and caching module, for obtaining operation information in response to the operation command being executed, and caching the operation information hierarchically according to the operation criticality assessment result to obtain a hierarchical operation information recording table;
[0060] A rollback necessity judgment module, used to respond to an error when the operation command is executed, obtain error information and system status information, and perform multi-dimensional rollback necessity judgment;
[0061] An initial rollback command sequence generating module, configured to obtain an initial rollback command sequence according to the hierarchical operation information recording table and the operation rollback mapping table in response to the result of the multi-dimensional rollback necessity judgment being that rollback is required;
[0062] A rollback command sequence optimization module, used to reconstruct the initial rollback command sequence based on dynamic rollback time evaluation to obtain an optimized rollback command sequence;
[0063] The rollback execution module is used to perform rollback processing according to the optimized rollback command sequence.
[0064] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0065] Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table;
[0066] Performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0067] In response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table;
[0068] In response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity judgment of multi-dimensional rollback is performed;
[0069] In response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, obtaining an initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table;
[0070] Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0071] Rollback processing is performed according to the optimized rollback command sequence.
[0072] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0073] Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table;
[0074] Performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0075] In response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table;
[0076] In response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity judgment of multi-dimensional rollback is performed;
[0077] In response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, obtaining an initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table;
[0078] Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0079] Rollback processing is performed according to the optimized rollback command sequence.
[0080] The above-mentioned rollback processing method, device, computer equipment and storage medium, by acquiring system business logic information and constructing a mapping table of operations and rollback commands, realizes comprehensive tracking and rollback management of operation commands, can handle complex dependencies, and make rollback operations more targeted and systematic; by hierarchical caching of operation information according to the operation criticality assessment results, it optimizes data management and call efficiency, while avoiding excessive occupation of high-performance resources, it ensures that the required data can be quickly extracted when critical operation errors occur, which is conducive to shortening the rollback time; by comprehensively analyzing error information and system status to make multi-dimensional rollback necessity judgments, it effectively avoids the single judgment of excessive reliance on operation error information in traditional methods, improves the accuracy of rollback decisions, and prevents unnecessary rollback operations from affecting system performance and state consistency; through dynamic rollback time evaluation, the initial rollback command sequence is reconstructed and optimized, making rollback processing more efficient, significantly improving rollback efficiency, and improving system recovery and stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1 An application environment diagram of a rollback processing method in an embodiment;
[0082] Figure 2 A schematic diagram of a rollback processing method in one embodiment;
[0083] Figure 3 is a structural block diagram of a rollback processing device in an embodiment;
[0084] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0085] 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.
[0086] The rollback processing method provided by this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 issues an operation command, and the server 104 is responsible for executing the operation command and performing related rollback processing; when the operation command is executed, the server 104 will obtain the operation command and the rollback command according to the business logic and configuration file, and build an operation rollback mapping table. At the same time, the server 104 will evaluate the operation criticality of the operation command, cache the operation information in a hierarchical manner, and when an operation error occurs, decide whether to roll back through a multi-dimensional rollback necessity judgment. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers. Through this architecture, the rollback processing method provided in this application can flexibly adapt to the application environment of multiple terminals and multiple servers, ensuring that the system can efficiently perform rollback operations under complex operations and high concurrency conditions, and ensuring the stable operation and data consistency of the cluster.
[0087] In one embodiment, Figure 2 As shown, a rollback processing method is provided, which is applied to Figure 1 Taking the server 102 in the example as an example, the following steps are included:
[0088] Step 201, obtain system business logic information, obtain operation commands and rollback commands, and construct an operation rollback mapping table.
[0089] The system business logic information includes the business logic rules during the operation of the distributed storage system.
[0090] Specifically, based on the system business logic information, all operations that affect the business logic are obtained; all operations that affect the business logic are classified based on functionality and scope to obtain a number of business operations; based on the several business operations, operation commands are obtained; based on the operation commands, the rollback command is defined, and an operation rollback mapping relationship is established; based on the operation rollback mapping relationship, the operation rollback mapping table is constructed.
[0091] Step 202: Perform an operation criticality assessment on the operation command to obtain an operation criticality assessment result.
[0092] Specifically, the operation rollback mapping table is obtained to obtain the operation command and the rollback command; an operation criticality assessment indicator is defined; system historical data is obtained, and the influence coefficient of the operation criticality assessment indicator is set in combination with the system business logic information; according to the operation criticality assessment indicator, in combination with the rollback command, an indicator evaluation is performed on the operation command to obtain an indicator score; according to the indicator score, in combination with the influence coefficient of the operation criticality assessment indicator, an operation criticality score is obtained; a critical threshold is set, and an operation criticality assessment result is obtained based on the comparison relationship between the critical threshold and the operation criticality score.
[0093] Step 203, in response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table.
[0094] Specifically, in response to the operation command being executed, operation information of the operation command is obtained; according to the operation criticality assessment result of the operation command, a corresponding caching strategy is adopted for the operation information; in response to the operation command being a critical operation, all the operation information of the operation command is cached in the cache hardware; in response to the operation command being a non-critical operation, only part of the operation information of the operation command is cached in the persistent storage hardware; the operation information in the cache hardware and the operation information in the persistent storage hardware are combined to obtain a hierarchical operation information record table.
[0095] Step 204, in response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity determination of a multi-dimensional rollback is performed.
[0096] Specifically, in response to an error occurring when the operation command is executed, error information is captured and recorded; the current system status is checked to obtain the system status information; an error report is generated by combining the error information and the system status information; based on the error report, a multi-dimensional judgment is performed to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment; based on the multi-dimensional judgment results, a multi-dimensional rollback necessity judgment is performed to obtain a multi-dimensional rollback necessity judgment result.
[0097] Step 205 , in response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, an initial rollback command sequence is obtained according to the hierarchical operation information record table and the operation rollback mapping table.
[0098] Specifically, the operation command that generates an error when being executed is obtained to obtain an erroneous operation command; based on the erroneous operation command, relevant operation information is extracted from the hierarchical operation information record table to obtain rollback related parameters and operation dependencies; based on the operation rollback mapping table, an erroneous rollback command is obtained based on the operation rollback mapping relationship; based on the operation dependency, the execution order of several erroneous rollback commands is established based on the reverse order principle to obtain an initial rollback command sequence.
[0099] Step 206: reconstruct the initial rollback command sequence based on the dynamic rollback time evaluation to obtain an optimized rollback command sequence.
[0100] Specifically, the initial rollback command sequence is obtained to obtain a number of the error rollback commands; based on the operation complexity, the current system load and resource consumption, the estimated execution time of each of the error rollback commands is obtained; the operation dependency is obtained, an operation dependency graph is constructed, and the parallelism of each of the error rollback commands is obtained by analysis; based on the estimated execution time and the parallelism, the execution order of the several error rollback commands is rearranged and parallelized to obtain an optimized rollback command sequence.
[0101] Step 207: Perform rollback processing according to the optimized rollback command sequence.
[0102] Specifically, according to the optimized rollback command sequence, the error rollback commands are executed in sequence to perform system data recovery and status rollback, thereby ensuring business continuity and data consistency and stabilizing the system status.
[0103] In the above rollback processing method, by obtaining system business logic information and building a mapping table of operations and rollback commands, comprehensive tracking and rollback management of operation commands are achieved, and complex dependencies can be handled to make rollback operations more targeted and systematic; by caching operation information in a hierarchical manner according to the results of operation criticality assessment, data management and call efficiency are optimized, while avoiding excessive occupation of high-performance resources, it ensures that required data can be quickly extracted when critical operation errors occur, which is conducive to shortening the rollback time; by comprehensively analyzing error information and system status to make multi-dimensional rollback necessity judgments, it effectively avoids the single judgment of excessive reliance on operation error information in traditional methods, improves the accuracy of rollback decisions, and prevents unnecessary rollback operations from affecting system performance and state consistency; through dynamic rollback time evaluation, the initial rollback command sequence is reconstructed and optimized, making rollback processing more efficient, significantly improving rollback efficiency, and improving system recovery and stability.
[0104] In one embodiment, the system business logic information is obtained, the operation command and the rollback command are obtained, and an operation rollback mapping table is constructed, including:
[0105] According to the system business logic information, all operations that affect the business logic are obtained;
[0106] Based on the functionality and scope of the operations, all the operations that affect the business logic are classified to obtain a number of business operations;
[0107] According to the plurality of business operations, obtaining corresponding execution instructions and dynamic parameters, wherein the execution instructions and the dynamic parameters constitute the operation command;
[0108] According to the operation command, define the rollback command and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and a rollback dynamic parameter;
[0109] In response to the rollback dynamic parameter being consistent with the dynamic parameter, the operation rollback mapping table is constructed based on the operation rollback mapping relationship.
[0110] Specifically, this embodiment obtains the business logic information of the system, classifies all operations that affect the business logic, and establishes a mapping table of operations and rollback commands. It can effectively track the execution and rollback path of each operation in the system, thereby deriving the correspondence between operation commands and rollback commands, ensuring that when an error occurs, the command that needs to be rolled back can be quickly located, and the rollback operation can be performed in a targeted manner. This is conducive to solving the problem of dependency complexity in the rollback process in the prior art and improving the accuracy and efficiency of the rollback operation.
[0111] In one embodiment, the operation command is subjected to an operation criticality assessment to obtain an operation criticality assessment result, including:
[0112] Acquire the operation rollback mapping table to obtain the operation command and the rollback command;
[0113] Defining operation criticality assessment indicators, wherein the operation criticality assessment indicators include at least one of the following: business impact, operation dependency, data integrity, rollback difficulty, user impact, and operation frequency;
[0114] Acquire system historical data, combine the system business logic information, and set the impact coefficient of the operation criticality evaluation indicator;
[0115] According to the operation criticality evaluation index, combined with the rollback command, the operation command is evaluated to obtain an index score;
[0116] According to the indicator score, combined with the influence coefficient of the operation criticality evaluation indicator, the operation criticality score is obtained, wherein the operation criticality score is obtained based on the following formula: Where K represents the operation criticality score of the operation command, and F i represents the index score under the i-th operation criticality evaluation index of the operation command, ω represents the influence coefficient of the i-th operation criticality evaluation index, and n represents the number of the operation criticality evaluation indexes;
[0117] A critical threshold is set, and in response to the operation criticality score being greater than the critical threshold, the operation criticality evaluation result is a critical operation, otherwise, the operation criticality evaluation result is a non-critical operation.
[0118] It is worth noting that the specific method of indicator scoring can be set according to the actual status of the system or evaluated with reference to the experience of system managers.
[0119] This embodiment provides an evaluation example: under the business impact index, if the operation involves core business, such as payment, order management, the score is set to 9-10, and the non-core business is set to 3-5; under the operation dependency index, if the operation depends on multiple systems or subsystems, the score is set to 8-10, and the independent operation score is 1-3; under the data integrity index, if the operation affects the consistency of key data, the score is set to 8-10, and the non-key data operation score is 1-3; under the rollback difficulty index, if the rollback is very complicated or involves a large number of steps, the score is set to 7-9, and the simple rollback operation score is 1-3; under the user impact index, the operation that affects a large number of users is scored 8-10, and the operation that only affects a few users is scored 1-3; under the operation frequency index, high-frequency operations are scored 8-10; low-frequency operations are scored 1-3.
[0120] It is worth noting that the setting of the critical threshold is also based on the selected operation criticality evaluation index, according to the system historical data performance and actual needs, and is preferably 5-7.
[0121] Specifically, this embodiment quantifies the criticality of each operation by performing a criticality assessment on operation commands, combining multiple assessment indicators such as business impact, operation dependency, and data integrity, and determines whether an operation is a critical operation. It can identify operations that require special attention and rollback, avoid redundant rollbacks of non-critical operations, and significantly improve the intelligence and pertinence of rollback decisions.
[0122] In one embodiment, in response to the operation command being executed, the operation information is obtained, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table, including:
[0123] In response to the operation command being executed, obtaining operation information of the operation command;
[0124] According to the operation criticality evaluation result of the operation command, a corresponding cache strategy is adopted for the operation information;
[0125] In response to the operation command being a critical operation, all the operation information of the operation command is cached to obtain a critical operation information table, wherein the critical operation information table is stored in the cache hardware;
[0126] In response to the operation command being a non-critical operation, only part of the operation information of the operation command is cached to obtain a non-critical operation information table, wherein the non-critical operation information table is stored in persistent storage hardware, wherein part of the operation information includes at least one of the following: operation type, operation object, operation time, and operation result;
[0127] Based on the information storage addresses of the critical operation information table and the non-critical operation information table, an index is constructed to generate a hierarchical operation information record table, wherein the hierarchical operation information record table is stored in the cache hardware.
[0128] Specifically, this embodiment manages the operation commands in a hierarchical cache according to their criticality assessment results, thereby ensuring that the information of critical operations can be stored in the cache for easy and quick call, while non-critical operations only record part of the information and store it in persistent hardware, reducing the occupancy of high-performance resources, thereby optimizing resource utilization and reducing the demand for high-performance storage hardware. At the same time, critical operation information can be quickly accessed during the rollback process, significantly reducing the system recovery time and improving rollback efficiency.
[0129] In one embodiment, in response to an error occurring when the operation command is executed, error information and system status information are obtained, and a multi-dimensional rollback necessity determination is performed, including:
[0130] In response to an error occurring when the operation command is executed, based on an exception handling mechanism, capturing and recording error information, and at the same time, checking the current system state to obtain the system state information;
[0131] generating an error report by combining the error information and the system status information;
[0132] Based on the error report, a multi-dimensional judgment is performed to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment;
[0133] Based on the multi-dimensional judgment results, a multi-dimensional rollback necessity judgment is performed to obtain a multi-dimensional rollback necessity judgment result;
[0134] Wherein, based on the multi-dimensional judgment results, the multi-dimensional rollback necessity judgment further includes:
[0135] The data consistency judgment is performed to obtain a data consistency judgment result, wherein the data consistency judgment is based on the formula: Among them, D c Indicates the result of data consistency judgment. If D c =1, it means that there is data inconsistency, T represents the transaction status check result, C d Indicates the result of data integrity constraint check, B d Indicates the result of checking the correctness of business data;
[0136] It is worth noting that T represents the transaction status check result. If the transaction is not committed, T = 0, otherwise, T = 1; C d Indicates the result of the data integrity constraint check. If the data does not meet the constraint, then C d =0, otherwise, C d =1; B d Indicates the result of the business data correctness check. If the data conforms to the business logic, then B d =1, otherwise, B d =0;
[0137] The system stability judgment is performed to obtain the system stability judgment result, and the system stability judgment is based on the formula: Among them, S I Indicates the result of system stability judgment. If S I =1, it means that the system is unstable, R indicates the result of resource usage over limit check, D s Indicates the deadlock and zombie process check results;
[0138] It is worth noting that R represents the resource usage over-limit check result. If the system resource usage exceeds the system resource limit threshold, R = 0, otherwise, R = 1; D s Indicates the deadlock and zombie process check results. If the system detects a deadlock or zombie process, D s =0, otherwise, D s =1;
[0139] Perform the business logic judgment to obtain the business logic judgment result, and the business logic judgment is based on the formula: Among them, B R Indicates the result of business logic judgment. If S I =1, it means that the business logic is affected. P Indicates the dependent operation execution result of the current operation, B r Indicates the integrity check result of business constraint rules;
[0140] It is worth noting that DP Indicates the result of the dependent operation of the current operation. If the dependent operation fails, D P =0, otherwise, D P =1; B r Indicates the integrity check result of the business constraint rules. If the business rules are violated, then B r =0, otherwise, B r =1;
[0141] The multi-dimensional rollback necessity judgment result is obtained by combining the data consistency judgment result, the system stability judgment result and the business logic judgment result, wherein the multi-dimensional rollback necessity judgment is based on the formula: RB need =D c ∨S I ∨B R , where RB need Indicates the result of the multi-dimensional rollback necessity judgment. If RB need =1, the result of the multi-dimensional rollback necessity judgment is that rollback is required.
[0142] It is worth noting that in the above multi-dimensional rollback necessity judgment process, the symbol "∨" in the calculation formula involved represents the "OR" operation, the symbol "∧" represents the "AND" operation, and the symbol Represents the NOT operation.
[0143] Specifically, this embodiment captures error information and system status information, and judges the necessity of rollback based on multiple dimensions such as data consistency, system stability, and business logic. It can more comprehensively analyze the current status of the system and ensure that rollback operations are performed only when necessary. The introduced multi-dimensional judgment mechanism avoids the one-sidedness of traditional rollback decisions that rely solely on single error information, improves the accuracy of rollback decisions and system stability, and prevents the negative impact of unnecessary rollback operations on the system.
[0144] In one embodiment, in response to the multi-dimensional rollback necessity judgment result being that rollback is required, an initial rollback command sequence is obtained according to the hierarchical operation information record table and the operation rollback mapping table, including:
[0145] Acquire the operation command that generates an error when being executed, and obtain the error operation command;
[0146] According to the erroneous operation command, relevant operation information is extracted from the hierarchical operation information record table to obtain rollback related parameters and operation dependency;
[0147] According to the operation rollback mapping table, based on the operation rollback mapping relationship, an error rollback command is obtained, wherein the error rollback command includes: an error rollback execution instruction, and the rollback related parameters, and the error rollback execution instruction and the execution instruction of the error operation command conform to the operation rollback mapping relationship;
[0148] According to the operation dependency, the execution order of several error rollback commands is established based on the reverse order principle to obtain an initial rollback command sequence.
[0149] Specifically, this embodiment can obtain operation dependencies based on the hierarchical operation information record table, ensuring that the rollback operation can be executed in reverse order based on the dependencies, avoiding further errors caused by improper rollback order, and improving the orderliness of the rollback operation and the integrity of system recovery. At the same time, constructing the initial rollback command sequence according to the operation rollback mapping table can not only improve the accuracy of the rollback, but also reduce the generation time of erroneous rollback commands, further improving the efficiency of the rollback processing.
[0150] In one embodiment, based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, including:
[0151] Acquire the initial rollback command sequence to obtain a number of the error rollback commands;
[0152] Based on the complexity of the operation, the current load of the system and the resource consumption, an estimated execution time of each of the error rollback commands is obtained;
[0153] Obtaining the operation dependency relationship and constructing an operation dependency graph;
[0154] According to the operation dependency graph, a parallel execution operation set is obtained;
[0155] According to the parallel execution operation set, the parallelism of each error rollback command is obtained;
[0156] Based on the estimated execution time and the degree of parallelism, the execution order of the plurality of erroneous rollback commands is rearranged and processed in parallel to obtain an optimized rollback command sequence.
[0157] It is worth noting that, based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, further comprising:
[0158] Get the initial rollback command sequence, denoted as C = {C1, C2, C3, ..., C i}, where C is a set of error rollback commands, C i Roll back the command for the ith error;
[0159] Based on the complexity of the operation, the current system load and resource consumption, the estimated execution time of each error rollback command is obtained based on the formula:
[0160]
[0161] , where Δ i represents the estimated execution time of the i-th error rollback command, O i represents the operational complexity of the i-th error rollback command, P i is the amount of resources available in the system when the i-th error rollback command is executed; where P i Affected by the current system load, L represents the current system load rate, and ρ represents the total amount of resources in the system that can be used to perform the rollback task; the operation complexity of the error rollback command is based on the complexity function f(d i ,m i ) get, d i is the data volume of the ith error rollback command, is the computing resources required for the ith error rollback command, the complexity function can be obtained based on empirical data or performance test results, and is preferably an exponential function;
[0162] Obtain the operation dependency, and construct an operation dependency graph based on a topological sorting algorithm, wherein the operation dependency graph is a directed acyclic graph, denoted as G = (V, E), wherein V is equal to C, representing a set of error rollback commands, and E = {(c i ,c j )} indicates a dependency relationship. If there is an error, the rollback command c i Must precede the error rollback command c j Execute, then there is a dependency relationship between the two, then there is a path from c in the directed acyclic graph i to c j The directed edges of
[0163] According to the topological sorting results, all nodes with in-degree 0 are removed from the operation dependency graph, and the in-degree of the remaining graph is updated until all nodes are processed. The breadth-first search algorithm is used to generate a parallel execution operation set, which is denoted as S k ={c∈V|indegree(c)=0 and not executed}, where S k represents the set of operations that can be performed simultaneously in the k-th level topological sort;
[0164] According to the parallel execution operation set, the parallelism of each error rollback command is obtained, wherein the parallelism refers to the number of rollback commands that can be executed simultaneously at the same time, denoted as D k , D k Equal to each layer S k The number of rollback commands included;
[0165] Estimated execution time Δ based on the i-th error rollback command i and the degree of parallelism D k , the execution order is reallocated through the task scheduling algorithm, the total execution time is optimized, and the optimized rollback command sequence is obtained, wherein the task scheduling algorithm is preferably the critical path method.
[0166] Specifically, this embodiment performs a dynamic rollback time evaluation on the initial rollback command sequence, reconstructs the execution order of the rollback commands in combination with the system load and operation complexity, and realizes parallel processing of the rollback commands, thereby effectively shortening the execution time during the rollback process. In particular, in scenarios with complex dependencies and multiple rollback operations, the system's recovery speed and concurrent processing capabilities can be further improved, avoiding the inefficiency caused by sequential execution in the traditional rollback mechanism.
[0167] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0168] In one embodiment, Figure 3 As shown, a rollback processing device is provided, including: a system business logic acquisition and mapping module, an operation criticality assessment module, an operation information recording and caching module, a rollback necessity judgment module, an initial rollback command sequence generation module, a rollback command sequence optimization module and a rollback execution module, wherein:
[0169] The system business logic acquisition and mapping module is used to acquire system business logic information, obtain operation commands and rollback commands, and construct an operation rollback mapping table;
[0170] An operation criticality assessment module, used to perform an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0171] An operation information recording and caching module, for obtaining operation information in response to the operation command being executed, and caching the operation information hierarchically according to the operation criticality assessment result to obtain a hierarchical operation information recording table;
[0172] A rollback necessity judgment module, used to respond to an error when the operation command is executed, obtain error information and system status information, and perform multi-dimensional rollback necessity judgment;
[0173] An initial rollback command sequence generating module, configured to obtain an initial rollback command sequence according to the hierarchical operation information recording table and the operation rollback mapping table in response to the result of the multi-dimensional rollback necessity judgment being that rollback is required;
[0174] A rollback command sequence optimization module, used to reconstruct the initial rollback command sequence based on dynamic rollback time evaluation to obtain an optimized rollback command sequence;
[0175] The rollback execution module is used to perform rollback processing according to the optimized rollback command sequence.
[0176] The system business logic acquisition and mapping module is also used to obtain all operations that affect the business logic based on the system business logic information; classify all operations that affect the business logic based on the functionality and scope of the operation to obtain a number of business operations; obtain corresponding execution instructions and dynamic parameters based on the several business operations, wherein the execution instructions and the dynamic parameters constitute the operation command; define the rollback command based on the operation command, and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and a rollback dynamic parameter; in response to the rollback dynamic parameter being consistent with the dynamic parameter, construct the operation rollback mapping table based on the operation rollback mapping relationship.
[0177] The operation criticality assessment module is also used to obtain the operation rollback mapping table to obtain the operation command and the rollback command; define an operation criticality assessment indicator; obtain system historical data, and set the influence coefficient of the operation criticality assessment indicator in combination with the system business logic information; perform an indicator assessment on the operation command according to the operation criticality assessment indicator and in combination with the rollback command to obtain an indicator score; obtain an operation criticality score according to the indicator score and in combination with the influence coefficient of the operation criticality assessment indicator; set a critical threshold, and in response to the operation criticality score being greater than the critical threshold, the operation criticality assessment result is a critical operation, otherwise, the operation criticality assessment result is a non-critical operation.
[0178] The operation information recording and caching module is also used to respond to the operation command being executed and obtain the operation information of the operation command; adopt a corresponding caching strategy for the operation information according to the operation criticality assessment result of the operation command; in response to the operation command being a critical operation, cache all the operation information of the operation command to obtain a critical operation information table, wherein the critical operation information table is stored in the cache hardware; in response to the operation command being a non-critical operation, only cache part of the operation information of the operation command to obtain a non-critical operation information table, wherein the non-critical operation information table is stored in the persistent storage hardware, wherein part of the operation information includes at least one of the following: operation type, operation object, operation time and operation result; based on the information storage address of the critical operation information table and the non-critical operation information table, construct an index and generate a hierarchical operation information recording table, wherein the hierarchical operation information recording table is stored in the cache hardware.
[0179] The rollback necessity judgment module is also used to respond to an error when the operation command is executed, capture and record error information based on the exception handling mechanism, and at the same time, check the current system status to obtain the system status information; generate an error report based on the error information and the system status information; based on the error report, perform a multi-dimensional judgment to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment; based on the multi-dimensional judgment results, perform a multi-dimensional rollback necessity judgment to obtain a multi-dimensional rollback necessity judgment result.
[0180] The initial rollback command sequence generation module is also used to obtain the operation command that generates an error when being executed, and obtain an error operation command; according to the error operation command, extract the relevant operation information from the hierarchical operation information record table, and obtain rollback related parameters and operation dependency relationships; according to the operation rollback mapping table, based on the operation rollback mapping relationship, obtain an error rollback command, wherein the error rollback command includes: an error rollback execution instruction, and the rollback related parameters, and the error rollback execution instruction and the execution instruction of the error operation command conform to the operation rollback mapping relationship; according to the operation dependency relationship, build the execution order of several error rollback commands based on the reverse principle to obtain an initial rollback command sequence.
[0181] The rollback command sequence optimization module is also used to obtain the initial rollback command sequence to obtain a number of the error rollback commands; based on the operation complexity, the current system load and resource consumption, obtain the estimated execution time of each of the error rollback commands; obtain the operation dependency and construct an operation dependency graph; according to the operation dependency graph, obtain a parallel execution operation set; according to the parallel execution operation set, obtain the parallelism of each of the error rollback commands; based on the estimated execution time and the parallelism, rearrange and parallelize the execution order of a number of the error rollback commands to obtain an optimized rollback command sequence.
[0182] For the specific definition of the rollback processing device, please refer to the definition of the rollback processing method above, which will not be repeated here. Each module in the above rollback processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0183] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, 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 rollback processing data. The network 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 rollback processing method is implemented.
[0184] Those skilled in the art will understand that Figure 4 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.
[0185] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0186] Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table;
[0187] Performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0188] In response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table;
[0189] In response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity judgment of multi-dimensional rollback is performed;
[0190] In response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, obtaining an initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table;
[0191] Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0192] Rollback processing is performed according to the optimized rollback command sequence.
[0193] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0194] Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table;
[0195] Performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result;
[0196] In response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table;
[0197] In response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity judgment of multi-dimensional rollback is performed;
[0198] In response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, obtaining an initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table;
[0199] Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0200] Rollback processing is performed according to the optimized rollback command sequence.
[0201] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods 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 memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0202] 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 specification.
[0203] The above-mentioned 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 invention patent. 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 patent of the present application shall be subject to the attached claims.
Claims
1. A rollback processing method, characterized in that: include: Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table; Performing an operation criticality assessment on the operation command to obtain an operation criticality assessment result; In response to the operation command being executed, the operation information is acquired, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table; In response to an error occurring when the operation command is executed, error information and system status information are obtained, and necessity judgment of multi-dimensional rollback is performed; In response to the result of the multi-dimensional rollback necessity judgment being that rollback is required, obtaining an initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table; Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence; Rollback processing is performed according to the optimized rollback command sequence.
2. A rollback processing method according to claim 1, characterized in that: Obtain system business logic information, obtain operation commands and rollback commands, and build an operation rollback mapping table, including: According to the system business logic information, all operations that affect the business logic are obtained; Based on the functionality and scope of the operations, all the operations that affect the business logic are classified to obtain a number of business operations; According to the plurality of business operations, obtaining corresponding execution instructions and dynamic parameters, wherein the execution instructions and the dynamic parameters constitute the operation command; According to the operation command, define the rollback command and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and a rollback dynamic parameter; In response to the rollback dynamic parameter being consistent with the dynamic parameter, the operation rollback mapping table is constructed based on the operation rollback mapping relationship.
3. A rollback processing method according to claim 1, characterized in that: The operation command is subjected to an operation criticality assessment to obtain an operation criticality assessment result, including: Acquire the operation rollback mapping table to obtain the operation command and the rollback command; Define operational criticality assessment indicators; Acquire system historical data, combine the system business logic information, and set the impact coefficient of the operation criticality evaluation indicator; According to the operation criticality evaluation index, combined with the rollback command, the operation command is evaluated to obtain an index score; According to the indicator score, combined with the influence coefficient of the operation criticality evaluation indicator, the operation criticality score is obtained, wherein the operation criticality score is obtained based on the following formula: Where K represents the operation criticality score of the operation command, and F i represents the index score of the i-th operation criticality evaluation index of the operation command, ω i represents the influence coefficient of the i-th operation criticality evaluation indicator, and n represents the number of the operation criticality evaluation indicators; A critical threshold is set, and in response to the operation criticality score being greater than the critical threshold, the operation criticality evaluation result is a critical operation, otherwise, the operation criticality evaluation result is a non-critical operation.
4. A rollback processing method according to claim 3, characterized in that: In response to the operation command being executed, the operation information is obtained, and according to the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table, including: In response to the operation command being executed, obtaining operation information of the operation command; According to the operation criticality evaluation result of the operation command, a corresponding cache strategy is adopted for the operation information; In response to the operation command being a critical operation, all the operation information of the operation command is cached to obtain a critical operation information table, wherein the critical operation information table is stored in the cache hardware; In response to the operation command being a non-critical operation, only part of the operation information of the operation command is cached to obtain a non-critical operation information table, wherein the non-critical operation information table is stored in persistent storage hardware, wherein part of the operation information includes at least one of the following: operation type, operation object, operation time, and operation result; Based on the information storage addresses of the critical operation information table and the non-critical operation information table, an index is constructed to generate a hierarchical operation information record table, wherein the hierarchical operation information record table is stored in the cache hardware.
5. A rollback processing method according to claim 1, characterized in that: In response to an error occurring when the operation command is executed, error information and system status information are obtained, and a multi-dimensional rollback necessity determination is performed, including: In response to an error occurring when the operation command is executed, capturing and recording error information based on an exception handling mechanism; Check the current system status and obtain the system status information; generating an error report by combining the error information and the system status information; Based on the error report, a multi-dimensional judgment is performed to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment; Based on the multi-dimensional judgment results, a multi-dimensional rollback necessity judgment is performed to obtain a multi-dimensional rollback necessity judgment result; Based on the multi-dimensional judgment results, the necessity judgment of multi-dimensional rollback also includes: The data consistency judgment is performed to obtain a data consistency judgment result, wherein the data consistency judgment is based on the formula: Among them, D c Indicates the result of data consistency judgment. If D c =1, it means that there is data inconsistency, T represents the transaction status check result, C d Indicates the result of data integrity constraint check, B d Indicates the result of checking the correctness of business data; The system stability judgment is performed to obtain the system stability judgment result, and the system stability judgment is based on the formula: Among them, S I Indicates the result of system stability judgment. If S I =1, it means that the system is unstable, R indicates the result of resource usage over limit check, D s Indicates the deadlock and zombie process check results; Perform the business logic judgment to obtain the business logic judgment result, and the business logic judgment is based on the formula: Among them, B R Indicates the result of business logic judgment. If S I =1, it means that the business logic is affected. P Indicates the dependent operation execution result of the current operation, B r Indicates the integrity check result of business constraint rules; The multi-dimensional rollback necessity judgment result is obtained by combining the data consistency judgment result, the system stability judgment result and the business logic judgment result, wherein the multi-dimensional rollback necessity judgment is based on the formula: RB need =D c ∨S I ∨B R , where RB need Indicates the result of the multi-dimensional rollback necessity judgment. If RB need =1, the result of the multi-dimensional rollback necessity judgment is that rollback is required.
6. A rollback processing method according to claim 2, characterized in that: In response to the multi-dimensional rollback necessity judgment result being that rollback is required, an initial rollback command sequence is obtained according to the hierarchical operation information record table and the operation rollback mapping table, including: Acquire the operation command that generates an error when being executed, and obtain the error operation command; According to the erroneous operation command, relevant operation information is extracted from the hierarchical operation information record table to obtain rollback related parameters and operation dependency; According to the operation rollback mapping table, based on the operation rollback mapping relationship, an error rollback command is obtained, the error rollback command comprising: an error rollback execution instruction, and the rollback related parameters, wherein the error rollback execution instruction and the execution instruction of the error operation command conform to the operation rollback mapping relationship; According to the operation dependency, the execution order of several error rollback commands is established based on the reverse order principle to obtain an initial rollback command sequence.
7. A rollback processing method according to claim 6, characterized in that: Based on the dynamic rollback time evaluation, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, including: Acquire the initial rollback command sequence to obtain a number of the error rollback commands; Based on the complexity of the operation, the current load of the system and the resource consumption, an estimated execution time of each of the error rollback commands is obtained; Obtaining the operation dependency relationship and constructing an operation dependency graph; According to the operation dependency graph, a parallel execution operation set is analyzed and obtained; According to the parallel execution operation set, the parallelism of each error rollback command is obtained; Based on the estimated execution time and the degree of parallelism, the execution order of the plurality of erroneous rollback commands is rearranged and processed in parallel to obtain an optimized rollback command sequence.
8. A rollback processing device, characterized in that: The device comprises: The system business logic acquisition and mapping module is used to acquire system business logic information, obtain operation commands and rollback commands, and construct an operation rollback mapping table; An operation criticality assessment module, used to perform an operation criticality assessment on the operation command to obtain an operation criticality assessment result; An operation information recording and caching module, for obtaining operation information in response to the operation command being executed, and caching the operation information hierarchically according to the operation criticality assessment result to obtain a hierarchical operation information recording table; A rollback necessity judgment module, used to respond to an error when the operation command is executed, obtain error information and system status information, and perform multi-dimensional rollback necessity judgment; An initial rollback command sequence generating module, configured to obtain an initial rollback command sequence according to the hierarchical operation information recording table and the operation rollback mapping table in response to the result of the multi-dimensional rollback necessity judgment being that rollback is required; A rollback command sequence optimization module, used to reconstruct the initial rollback command sequence based on dynamic rollback time evaluation to obtain an optimized rollback command sequence; The rollback execution module is used to perform rollback processing according to the optimized rollback command sequence.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. 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 7 are implemented.
Citation Information
Patent Citations
Distributed flow reverse rollback method and system
CN115658380A
Business logic configuration method, system and equipment for process visualization and medium
CN117076026A
Photovoltaic power station data operation and maintenance management system and management method thereof
CN119211266A
Digest picture information creating method, digest picture information creating program, and picture apparatus
JP2009004994A
System and method to evaluate code importance via graph centralities
US20240427577A1