A rollback processing method and device, computer equipment and a storage medium
By constructing an operation rollback mapping table and optimizing the rollback command sequence through multi-dimensional judgment, the problem of recovery difficulties caused by complex dependencies in distributed storage systems is solved, achieving efficient and accurate rollback processing and improving system stability and recovery speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2024-12-31
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies struggle to effectively handle complex dependencies when dealing with configuration errors in distributed storage systems, leading to difficulties in system recovery and high maintenance costs and risks. This is especially true in large and complex systems, where customized rollback commands are labor-intensive and prone to omissions or misoperations.
By acquiring system business logic information, constructing an operation rollback mapping table, conducting operation criticality assessment and hierarchical caching, and combining multi-dimensional rollback necessity judgment and dynamic rollback time assessment, the rollback command sequence is optimized to achieve comprehensive tracking and efficient rollback of operation commands.
It improves rollback efficiency, enhances system recovery speed and stability, avoids excessive consumption of high-performance resources, and ensures the accuracy of rollback decisions and the consistency of system state.
Smart Images

Figure CN119782049B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of system management, and in particular to a rollback processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] As distributed storage systems are increasingly used in various block-based business scenarios, the configuration files and command operations involved are becoming more and more complex. These operations have strong sequential logic. If a certain link fails, it may lead to incomplete cluster configuration information or abnormal status, which in turn affects the normal function of the cluster. Especially in a distributed environment, configuration errors may propagate between multiple nodes, causing the entire system to fail. When an error occurs, a rollback and recovery method is needed.
[0003] In the existing technology, the rollback of handling system configuration errors mainly relies on configuration backup and restore methods. Usually, the system state is backed up in advance, and if the operation fails, it is restored to the backup state. 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 resolve these complex dependencies.
[0004] In addition, customized rollback for failure points in specific business processes is a common supplementary method in existing technologies. Customized rollback methods usually require manually writing rollback commands related to the failed operation based on specific business logic and operation procedures. This is a huge workload and has high maintenance costs. Especially in large and complex systems with many process nodes that are closely interdependent, it is difficult to write customized rollback commands for every possible failure point. At the same time, manually customizing rollback commands is prone to omissions or misoperations, which further increases the difficulty and risk of system recovery. Summary of the Invention
[0005] Therefore, it is necessary to provide a rollback processing method, device, computer equipment, and storage medium that can handle complex dependencies, combine intelligent assessment of operational criticality and multi-dimensional judgment of rollback necessity, optimize the rollback command sequence, thereby improving rollback efficiency and enhancing the recovery speed and stability of distributed systems.
[0006] On the one hand, a rollback processing method is provided, the method comprising:
[0007] Obtain system business logic information, get operation commands and rollback commands, and construct an operation rollback mapping table;
[0008] The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result;
[0009] In response to the execution of the operation command, operation information is obtained, and the operation information is cached hierarchically according to the operation criticality evaluation result 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 a multi-dimensional rollback necessity judgment is performed;
[0011] In response to the result of the multi-dimensional rollback necessity judgment that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table.
[0012] Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0013] Perform rollback processing based on the optimized rollback command sequence.
[0014] In one embodiment, system business logic information is obtained, operation commands and rollback commands are acquired, and an operation rollback mapping table is constructed, including:
[0015] Based on 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 several business operations.
[0017] Based on the aforementioned business operations, corresponding execution instructions and dynamic parameters are obtained, wherein the execution instructions and the dynamic parameters constitute the operation command;
[0018] Based on the operation command, define the rollback command and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and rollback dynamic parameters;
[0019] In response to the rollback dynamic parameters being consistent with the dynamic parameters, the operation rollback mapping table is constructed based on the operation rollback mapping relationship.
[0020] In one embodiment, the operation command is subjected to an operation criticality assessment to obtain an operation criticality assessment result, including:
[0021] Obtain the operation rollback mapping table to obtain the operation command and the rollback command;
[0022] Define operational criticality assessment metrics, wherein the operational criticality assessment metrics shall include at least one of the following: business impact, operational dependency, data integrity, rollback difficulty, user impact, and operation frequency;
[0023] Obtain historical system data and, in conjunction with the system's business logic information, set the impact coefficients of the operational criticality evaluation indicators;
[0024] Based on the operational criticality assessment indicators and the rollback command, the operational command is evaluated to obtain an indicator score.
[0025] Based on the indicator scores and the influence coefficients of the operational criticality assessment indicators, an operational criticality score is obtained, wherein the operational criticality score is derived based on the following formula: Where K represents the operational criticality score of the operation command, and F i ω represents the index score under the i-th critical evaluation index of the operation command. i represents the influence coefficient of the i-th operational criticality assessment indicator, and n represents the number of operational criticality assessment indicators;
[0026] A critical threshold is set. If the criticality score of an operation is greater than the critical threshold, the operation is considered a critical operation. Otherwise, the operation is considered a non-critical operation.
[0027] In one embodiment, in response to the execution of the operation command, operation information is acquired, and based on 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 execution of the operation command, the operation information of the operation command is obtained, 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 execution of the operation command, the operation information of the operation command is obtained;
[0030] Based on the operational criticality evaluation results of the operation command, a corresponding caching strategy is adopted for the operation information;
[0031] If the operation command is a critical operation, then 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 a portion 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, and the portion 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 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 assessment is performed, including:
[0035] In response to an error occurring when the operation command is executed, the error information is captured and recorded based on the exception handling mechanism. At the same time, the current system status is checked to obtain the system status information.
[0036] An error report is generated 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 combined results of the multi-dimensional judgments, a multi-dimensional rollback necessity judgment is performed to obtain the multi-dimensional rollback necessity judgment results;
[0039] The multi-dimensional rollback necessity assessment, based on the combined results of the multi-dimensional assessments, also includes:
[0040] The data consistency judgment is performed to obtain the data consistency judgment result, which is based on the formula: Among them, D c This indicates the result of the data consistency judgment. If D c =1 indicates data inconsistency. T represents the transaction status check result, and C... d B represents the result of the data integrity constraint check. d This indicates the results of the business data correctness check;
[0041] The system stability assessment is performed to obtain the system stability assessment result, which is based on the formula: Among them, S I This indicates the system stability judgment result. If S I =1 indicates system instability. R represents the result of the resource usage exceeding limit check. D s This indicates the results of deadlock and zombie process checks;
[0042] The business logic judgment is performed to obtain the business logic judgment result, which is based on the formula: Among them, B R This represents the result of the business logic judgment. If SI =1 indicates that business logic is affected, D P B represents the result of the dependent operations of the current operation. r This indicates the result of the business constraint rule integrity check;
[0043] By combining the data consistency judgment results, the system stability judgment results, and the business logic judgment results, the multi-dimensional rollback necessity judgment result is obtained, wherein the multi-dimensional rollback necessity judgment is based on the formula: RB need =D c ∨S I ∨B R , among which, RB need This indicates the result of the multi-dimensional rollback necessity judgment. If RB need If the result is 1, then the multi-dimensional rollback necessity judgment result is that a rollback is required.
[0044] In one embodiment, in response to the multi-dimensional rollback necessity judgment result indicating that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table, including:
[0045] Obtain the operation command that encountered an error during execution, and obtain the erroneous operation command;
[0046] Based on the erroneous operation command, the relevant operation information is extracted from the hierarchical operation information record table to obtain rollback-related parameters and operation dependencies;
[0047] Based on the operation rollback mapping table and the operation rollback mapping relationship, an error rollback command is obtained. The error rollback command includes an error rollback execution instruction and rollback-related parameters. The error rollback execution instruction and the execution instruction of the error operation command conform to the operation rollback mapping relationship.
[0048] Based on the operational dependencies, the execution order of several error rollback commands is constructed according to the reverse order principle to obtain the initial rollback command sequence.
[0049] In one embodiment, based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, including:
[0050] Obtain the initial rollback command sequence to obtain several error rollback commands;
[0051] Based on operational complexity, current system load, and resource consumption, the estimated execution time of each error rollback command is obtained.
[0052] Obtain the operation dependencies and construct the operation dependency graph;
[0053] Based on the operation dependency graph, a set of operations to be executed in parallel is obtained;
[0054] The degree of parallelism of each error rollback command is obtained based on the set of parallel execution operations.
[0055] Based on the estimated execution time and the degree of parallelism, the execution order of several error rollback commands is rearranged and parallelized to obtain an optimized rollback command sequence.
[0056] On the other hand, a rollback processing apparatus is provided, the apparatus 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] The operation criticality assessment module is used to perform an operation criticality assessment on the operation command and obtain the operation criticality assessment result.
[0059] The operation information recording and caching module is used to respond to the execution of the operation command, obtain operation information, and cache the operation information in a hierarchical manner according to the operation criticality evaluation result to obtain a hierarchical operation information recording table.
[0060] The rollback necessity judgment module is used to respond to errors that occur when the operation command is executed, obtain error information and system status information, and perform multi-dimensional rollback necessity judgment.
[0061] The initial rollback command sequence generation module is used to respond to the result of the multi-dimensional rollback necessity judgment that rollback is required, and to obtain the initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table.
[0062] The rollback command sequence optimization module is 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 based on the optimized rollback command sequence.
[0064] In another aspect, 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 executes the computer program to perform the following steps:
[0065] Obtain system business logic information, get operation commands and rollback commands, and construct an operation rollback mapping table;
[0066] The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result;
[0067] In response to the execution of the operation command, operation information is obtained, and the operation information is cached hierarchically according to the operation criticality evaluation result 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 a multi-dimensional rollback necessity judgment is performed;
[0069] In response to the result of the multi-dimensional rollback necessity judgment that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table.
[0070] Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0071] Perform rollback processing based on the optimized rollback command sequence.
[0072] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0073] Obtain system business logic information, get operation commands and rollback commands, and construct an operation rollback mapping table;
[0074] The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result;
[0075] In response to the execution of the operation command, operation information is obtained, and the operation information is cached hierarchically according to the operation criticality evaluation result 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 a multi-dimensional rollback necessity judgment is performed;
[0077] In response to the result of the multi-dimensional rollback necessity judgment that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table.
[0078] Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0079] Perform rollback processing based on the optimized rollback command sequence.
[0080] The aforementioned rollback processing method, apparatus, computer equipment, and storage medium, by acquiring system business logic information and constructing a mapping table between operations and rollback commands, achieve comprehensive tracking and rollback management of operation commands. This enables the handling of complex dependencies, making rollback operations more targeted and systematic. By hierarchically caching operation information based on operation criticality assessment results, data management and retrieval efficiency are optimized. This avoids excessive consumption of high-performance resources while ensuring rapid retrieval of required data in the event of critical operation errors, thus shortening rollback time. Through comprehensive analysis of error information and system status to perform multi-dimensional rollback necessity judgments, the excessive reliance on single judgments of operation error information in traditional methods is effectively avoided, improving the accuracy of rollback decisions and preventing unnecessary rollback operations from affecting system performance and state consistency. Dynamic rollback time assessment reconstructs and optimizes the initial rollback command sequence, making rollback processing more efficient, significantly improving rollback efficiency, and enhancing system recoverability and stability. Attached Figure Description
[0081] Figure 1 This is a diagram illustrating the application environment of a rollback processing method in one embodiment.
[0082] Figure 2 This is a flowchart illustrating a rollback process in one embodiment;
[0083] Figure 3 This is a structural block diagram of the rollback processing device in one embodiment;
[0084] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0085] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0086] This application provides a rollback processing method that can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 issues operation commands, and server 104 is responsible for executing the operation commands and performing related rollback processing. When an operation command is executed, server 104 obtains the operation command and rollback command according to business logic and configuration files, constructs an operation rollback mapping table, and simultaneously performs an operation criticality assessment on the operation command, caches operation information hierarchically, and determines whether to perform a rollback when an error occurs through multi-dimensional rollback necessity judgment. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and server 104 can be implemented using a standalone server or a server cluster composed of multiple servers. Through this architecture, the rollback processing method provided in this application can flexibly adapt to multi-terminal, multi-server application environments, ensuring that the system can efficiently perform rollback operations under complex operations and high concurrency, ensuring the stable operation of the cluster and data consistency.
[0087] In one embodiment, such as Figure 2 As shown, a rollback processing method is provided, which is applied to... Figure 1 Taking server 102 as an example, the explanation includes the following steps:
[0088] Step 201: Obtain system business logic information, get 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 affecting the business logic are obtained; all operations affecting the business logic are classified based on functionality and scope to obtain several business operations; based on the several business operations, operation commands are obtained; based on the operation commands, rollback commands are defined, and operation rollback mapping relationships are established; based on the operation rollback mapping relationships, the operation rollback mapping table is constructed.
[0091] Step 202: Perform an operational criticality assessment on the operation command to obtain the operational criticality assessment result.
[0092] Specifically, the operation rollback mapping table is obtained to acquire the operation command and the rollback command; operation criticality evaluation indicators are defined; historical system data is acquired, and combined with the system business logic information, the influence coefficient of the operation criticality evaluation indicators is set; based on the operation criticality evaluation indicators and the rollback command, the operation command is evaluated to obtain an indicator score; based on the indicator score and the influence coefficient of the operation criticality evaluation indicators, an operation criticality score is obtained; a critical threshold is set, and based on the comparison relationship between the critical threshold and the operation criticality score, the operation criticality evaluation result is obtained.
[0093] Step 203: In response to the execution of the operation command, obtain operation information, and cache the operation information in a hierarchical manner according to the operation criticality evaluation result to obtain a hierarchical operation information record table.
[0094] Specifically, in response to the execution of the operation command, the operation information of the operation command is obtained; based on 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, obtain error information and system status information, and perform a multi-dimensional rollback necessity judgment.
[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 system status information; an error report is generated by combining the error information and the system status information; based on the error report, multi-dimensional judgments are performed to obtain multi-dimensional judgment results, wherein the multi-dimensional judgments include: data consistency judgment, system stability judgment, and business logic judgment; and by comprehensively considering 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 that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table.
[0098] Specifically, the operation command that malfunctioned during execution is obtained to obtain the erroneous operation command; based on the erroneous operation command, the 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 and the operation rollback mapping relationship, the erroneous rollback command is obtained; based on the operation dependencies and the reverse order principle, the execution order of several erroneous rollback commands is constructed to obtain the initial rollback command sequence.
[0099] Step 206: Based on the dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence.
[0100] Specifically, the initial rollback command sequence is obtained to obtain several error rollback commands; based on the operation complexity, current system load, and resource consumption, the estimated execution time of each error rollback command is obtained; the operation dependencies are obtained, an operation dependency graph is constructed, and the parallelism of each error rollback command is analyzed; 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, based on the optimized rollback command sequence, error rollback commands are executed sequentially to restore system data and roll back the status, ensuring business continuity and data consistency, and stabilizing the system state.
[0103] The aforementioned rollback processing method achieves comprehensive tracking and rollback management of operation commands by acquiring system business logic information and constructing a mapping table between operations and rollback commands. This enables the handling of complex dependencies, making rollback operations more targeted and systematic. By caching operation information hierarchically based on the operation criticality assessment results, data management and retrieval efficiency are optimized. This avoids excessive consumption of high-performance resources while ensuring rapid retrieval of required data in the event of critical operation errors, thus shortening rollback time. By comprehensively analyzing error information and system status to make multi-dimensional judgments on the necessity of rollback, the method effectively avoids excessive reliance on single judgments of operation error information in traditional methods, improving the accuracy of rollback decisions and preventing unnecessary rollback operations from affecting system performance and state consistency. By reconstructing and optimizing the initial rollback command sequence through dynamic rollback time assessment, the rollback processing becomes more efficient, significantly improving rollback efficiency and enhancing system recoverability and stability.
[0104] In one embodiment, system business logic information is obtained, operation commands and rollback commands are acquired, and an operation rollback mapping table is constructed, including:
[0105] Based on 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 several business operations.
[0107] Based on the aforementioned business operations, corresponding execution instructions and dynamic parameters are obtained, wherein the execution instructions and the dynamic parameters constitute the operation command;
[0108] Based on the operation command, define the rollback command and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and rollback dynamic parameters;
[0109] In response to the rollback dynamic parameters being consistent with the dynamic parameters, the operation rollback mapping table is constructed based on the operation rollback mapping relationship.
[0110] Specifically, this embodiment acquires the system's business logic information, classifies all operations that affect the business logic, and establishes a mapping table between operations and rollback commands. This effectively tracks the execution and rollback path of each operation in the system, thereby deriving the correspondence between operation commands and rollback commands. This ensures that when an error occurs, the command that needs to be rolled back can be quickly located, and a targeted rollback operation can be performed. This helps to solve the problem of the complexity of dependencies in the rollback process in the prior art, and improves the accuracy and efficiency of rollback operations.
[0111] In one embodiment, the operation command is subjected to an operation criticality assessment to obtain an operation criticality assessment result, including:
[0112] Obtain the operation rollback mapping table to obtain the operation command and the rollback command;
[0113] Define operational criticality assessment metrics, wherein the operational criticality assessment metrics shall include at least one of the following: business impact, operational dependency, data integrity, rollback difficulty, user impact, and operation frequency;
[0114] Obtain historical system data and, in conjunction with the system's business logic information, set the impact coefficients of the operational criticality evaluation indicators;
[0115] Based on the operational criticality assessment indicators and the rollback command, the operational command is evaluated to obtain an indicator score.
[0116] Based on the indicator scores and the influence coefficients of the operational criticality assessment indicators, an operational criticality score is obtained, wherein the operational criticality score is derived based on the following formula: Where K represents the operational criticality score of the operation command, and F i ω represents the index score under the i-th critical evaluation index of the operation command, ω represents the influence coefficient of the i-th critical evaluation index of the operation, and n represents the number of critical evaluation indicators of the operation.
[0117] A critical threshold is set. If the criticality score of an operation is greater than the critical threshold, the operation is considered a critical operation. Otherwise, the operation is considered a non-critical operation.
[0118] It is worth noting that the specific methods for scoring the indicators can be set according to the actual state of the system or evaluated with reference to the experience of system administrators.
[0119] This embodiment provides an evaluation example as follows: Under the business impact indicator, if the operation involves core business, such as payment or order management, the score is set to 9-10, and for non-core business, it is set to 3-5; under the operation dependency indicator, if the operation depends on multiple systems or subsystems, the score is set to 8-10, and for independent operations, the score is 1-3; under the data integrity indicator, if the operation affects the consistency of critical data, the score is set to 8-10, and for non-critical data operations, the score is 1-3; under the rollback difficulty indicator, if the rollback is very complex or involves a large number of steps, the score is set to 7-9, and for simple rollback operations, the score is 1-3; under the user impact indicator, operations affecting a large number of users are scored to 8-10, and operations affecting only a few users are scored to 1-3; under the operation frequency indicator, high-frequency operations are scored to 8-10, and low-frequency operations are scored to 1-3.
[0120] It is worth noting that the setting of the key threshold is also based on the selected operational key evaluation index, and is set according to the system's historical data performance and actual needs, preferably 5-7.
[0121] Specifically, this embodiment quantifies the criticality of each operation by performing a criticality assessment on the 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 need to be focused on and rolled back, avoid redundant rollback of non-critical operations, and significantly improve the intelligence and targeting of rollback decisions.
[0122] In one embodiment, in response to the execution of the operation command, operation information is obtained, and based on 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 execution of the operation command, the operation information of the operation command is obtained;
[0124] Based on the operational criticality evaluation results of the operation command, a corresponding caching strategy is adopted for the operation information;
[0125] If the operation command is a critical operation, then 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 a portion 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, and the portion 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 based on their criticality assessment results. This ensures that information about critical operations can be stored in a high-speed cache for easy and quick retrieval, while non-critical operations only record partial information and store it in persistent hardware, reducing the occupation of high-performance resources. This optimizes resource utilization, reduces the demand for high-performance storage hardware, and enables rapid access to critical operation information during rollback, significantly reducing 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 assessment is performed, including:
[0130] In response to an error occurring when the operation command is executed, the error information is captured and recorded based on the exception handling mechanism. At the same time, the current system status is checked to obtain the system status information.
[0131] An error report is generated 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 combined results of the multi-dimensional judgments, a multi-dimensional rollback necessity judgment is performed to obtain the multi-dimensional rollback necessity judgment results;
[0134] The multi-dimensional rollback necessity assessment, based on the combined results of the multi-dimensional assessments, also includes:
[0135] The data consistency judgment is performed to obtain the data consistency judgment result, which is based on the formula: Among them, D c This indicates the result of the data consistency judgment. If D c =1 indicates data inconsistency. T represents the transaction status check result, and C... d B represents the result of the data integrity constraint check. d This indicates the results of the business data correctness check;
[0136] It's worth noting that T represents the transaction status check result; if the transaction has not been committed, then T = 0, otherwise T = 1; C d This indicates the result of the data integrity constraint check. If the data does not meet the constraints, then C... d =0, otherwise C d =1; B d This 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 assessment is performed to obtain the system stability assessment result, which is based on the formula: Among them, S I This indicates the system stability judgment result. If S I =1 indicates system instability. R represents the result of the resource usage exceeding limit check. D s This indicates the results of deadlock and zombie process checks;
[0138] It is worth noting that R represents the result of the resource usage exceeding the limit check. If the system resource usage exceeds the system resource limit threshold, then R = 0; otherwise, R = 1. s This indicates the results of deadlock and zombie process checks. If the system detects a deadlock or zombie process, then D... s =0, otherwise D s =1;
[0139] The business logic judgment is performed to obtain the business logic judgment result, which is based on the formula: Among them, B R This represents the result of the business logic judgment. If S I =1 indicates that business logic is affected, D P B represents the result of the dependent operations of the current operation. r This indicates the result of the business constraint rule integrity check;
[0140] It is worth noting that DP This indicates the execution result of the dependent operations of the current operation. If the dependent operations fail, then D... P =0, otherwise D P =1; B r This indicates the result of the business constraint rule integrity check. If a business rule is violated, then B... r =0, otherwise B r =1;
[0141] By combining the data consistency judgment results, the system stability judgment results, and the business logic judgment results, the multi-dimensional rollback necessity judgment result is obtained, wherein the multi-dimensional rollback necessity judgment is based on the formula: RB need =D c ∨S I ∨B R , among which, RB need This indicates the result of the multi-dimensional rollback necessity judgment. If RB need If the result is 1, then the multi-dimensional rollback necessity judgment result is that a rollback is required.
[0142] It is worth noting that in the above multi-dimensional rollback necessity judgment process, the symbol "∨" in the calculation formulas involved represents the "OR" operation, the symbol "∧" represents the "AND" operation, and the symbol... It represents the "NOT" operation.
[0143] Specifically, this embodiment captures error information and system status information, and combines multiple dimensions such as data consistency, system stability, and business logic to determine the necessity of rollback. This enables a more comprehensive analysis of the current system status, ensuring that rollback operations are only performed when necessary. The introduced multi-dimensional judgment mechanism avoids the one-sidedness of relying solely on a single error message in traditional rollback decisions, 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 indicating that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table, including:
[0145] Obtain the operation command that encountered an error during execution, and obtain the erroneous operation command;
[0146] Based on the erroneous operation command, the relevant operation information is extracted from the hierarchical operation information record table to obtain rollback-related parameters and operation dependencies;
[0147] Based on the operation rollback mapping table and the operation rollback mapping relationship, an error rollback command is obtained. The error rollback command includes an error rollback execution instruction and rollback-related parameters. The error rollback execution instruction and the execution instruction of the error operation command conform to the operation rollback mapping relationship.
[0148] Based on the operational dependencies, the execution order of several error rollback commands is constructed according to the reverse order principle to obtain the initial rollback command sequence.
[0149] Specifically, this embodiment can obtain the operation dependency relationship based on the hierarchical operation information record table, ensuring that the rollback operation can be executed in reverse order based on the dependency relationship, avoiding further errors caused by improper rollback order, improving the orderliness of the rollback operation and the integrity of system recovery. At the same time, the construction of the initial rollback command sequence based on 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 rollback processing.
[0150] In one embodiment, the initial rollback command sequence is reconstructed based on a dynamic rollback time assessment to obtain an optimized rollback command sequence, including:
[0151] Obtain the initial rollback command sequence to obtain several error rollback commands;
[0152] Based on operational complexity, current system load, and resource consumption, the estimated execution time of each error rollback command is obtained.
[0153] Obtain the operation dependencies and construct the operation dependency graph;
[0154] Based on the operation dependency graph, a set of operations to be executed in parallel is obtained;
[0155] The degree of parallelism of each error rollback command is obtained based on the set of parallel execution operations.
[0156] Based on the estimated execution time and the degree of parallelism, the execution order of several error rollback commands is rearranged and parallelized to obtain an optimized rollback command sequence.
[0157] It is worth noting that, based on the dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, which further includes:
[0158] Obtain the initial rollback command sequence, denoted as C = {C1, C2, C3, ..., C...} i}, where C is the set of error rollback commands, C i This is the i-th error rollback command;
[0159] Based on operational complexity, 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 O represents the estimated execution time of the i-th error rollback command. i Let P represent the operation complexity of the i-th error rollback command. i It is the amount of system resources available 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 available in the system for executing rollback tasks; where the operational complexity of the error rollback command is based on the complexity function f(d i ,m i ) to obtain, d i is the data volume of the i-th error rollback command, and is the computational resources required for the i-th 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 dependencies, and construct an operation dependency graph based on the topological sorting algorithm. This operation dependency graph is a directed acyclic graph, denoted as G = (V, E), where V is equivalent to C, representing the set of error rollback commands, and E = {(c...}. i ,c j )} represents a dependency relationship. If there is an error rollback command c i It must precede the error rollback command c j If execution is performed correctly, then there is a dependency between the two, and therefore there exists a path from c in the directed acyclic graph. i to c j The directed edges;
[0163] Based on the topological sorting results, remove all nodes with an in-degree of 0 from the operation dependency graph and update the in-degree of the remaining graph until all nodes have been processed. A breadth-first search algorithm is then used to generate a set of operations to be executed in parallel, denoted as S. k ={c∈V|indegree(c)=0 and not executed}, where, S k This represents the set of operations that can be executed simultaneously in the k-th level topological sorting.
[0164] Based on the set of parallel execution operations, the degree of parallelism of each error rollback command is obtained, where the degree of 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 S per layer k The number of rollback commands included;
[0165] Based on the estimated execution time Δ of the i-th error rollback command i and the parallelism D k The execution order is reallocated by the task scheduling algorithm to optimize the total execution time and obtain an optimized rollback command sequence. The preferred task scheduling algorithm is the critical path method.
[0166] Specifically, this embodiment dynamically evaluates the rollback time of the initial rollback command sequence and reconstructs the execution order of the rollback commands based on system load and operational complexity, thereby achieving parallel processing of rollback commands. This effectively shortens the execution time during the rollback process. Especially in scenarios with complex dependencies and multiple rollback operations, it can further improve the system's recovery speed and concurrent processing capabilities, avoiding the inefficiency caused by sequential execution in traditional rollback mechanisms.
[0167] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed 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 some of the sub-steps or stages of other steps.
[0168] In one embodiment, such as 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] The operation criticality assessment module is used to perform an operation criticality assessment on the operation command and obtain the operation criticality assessment result.
[0171] The operation information recording and caching module is used to respond to the execution of the operation command, obtain operation information, and cache the operation information in a hierarchical manner according to the operation criticality evaluation result to obtain a hierarchical operation information recording table.
[0172] The rollback necessity judgment module is used to respond to errors that occur when the operation command is executed, obtain error information and system status information, and perform multi-dimensional rollback necessity judgment.
[0173] The initial rollback command sequence generation module is used to respond to the result of the multi-dimensional rollback necessity judgment that rollback is required, and to obtain the initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table.
[0174] The rollback command sequence optimization module is 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 based on the optimized rollback command sequence.
[0176] The system's business logic acquisition and mapping module is further configured to: obtain all operations affecting the business logic based on the system's business logic information; classify all operations affecting the business logic based on their functionality and scope to obtain several business operations; acquire corresponding execution instructions and dynamic parameters based on the several business operations, wherein the execution instructions and 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 rollback dynamic parameters; and construct the operation rollback mapping table based on the operation rollback mapping relationship, in response to the consistency between the rollback dynamic parameters and the dynamic parameters.
[0177] The operation criticality assessment module is further configured to: obtain the operation rollback mapping table to obtain the operation command and the rollback command; define operation criticality assessment indicators; obtain historical system data and, in conjunction with the system business logic information, set the influence coefficient of the operation criticality assessment indicators; evaluate the operation command based on the operation criticality assessment indicators and the rollback command to obtain an indicator score; obtain an operation criticality score based on the indicator score and, in conjunction with the influence coefficient of the operation criticality assessment indicators; and set a critical threshold, wherein if the operation criticality score is 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 further configured to: obtain operation information of the operation command in response to the execution of the operation command; adopt a corresponding caching strategy for the operation information based on the operation criticality evaluation result of the operation command; cache all operation information of the operation command to obtain a critical operation information table, wherein the critical operation information table is stored in high-speed cache hardware; cache only 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 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; construct an index based on the information storage addresses of the critical operation information table and the non-critical operation information table to generate a hierarchical operation information record table, wherein the hierarchical operation information record table is stored in the high-speed cache hardware.
[0179] The rollback necessity judgment module is also used to respond to errors that occur when the operation command is executed. Based on the exception handling mechanism, it captures and records error information, and at the same time checks the current system status to obtain the system status information. Combining the error information and the system status information, it generates an error report. Based on the error report, it performs multi-dimensional judgment to obtain multi-dimensional judgment results. The multi-dimensional judgments include: data consistency judgment, system stability judgment, and business logic judgment. Combining the multi-dimensional judgment results, it performs a multi-dimensional rollback necessity judgment to obtain a multi-dimensional rollback necessity judgment result.
[0180] The initial rollback command sequence generation module is further configured to: obtain the operation command that erroneously occurred during execution, and obtain the erroneous operation command; extract relevant operation information from the hierarchical operation information record table based on the erroneous operation command, and obtain rollback-related parameters and operation dependencies; obtain the erroneous rollback command based on the operation rollback mapping table and the operation rollback mapping relationship, wherein the erroneous rollback command includes: an erroneous rollback execution instruction and the rollback-related parameters, and the erroneous rollback execution instruction and the execution instruction of the erroneous operation command conform to the operation rollback mapping relationship; and construct the execution order of several erroneous rollback commands based on the operation dependencies and the reverse order principle to obtain the initial rollback command sequence.
[0181] The rollback command sequence optimization module is further configured to: obtain the initial rollback command sequence to obtain several erroneous rollback commands; obtain the estimated execution time of each erroneous rollback command based on operation complexity, current system load, and resource consumption; obtain the operation dependencies and construct an operation dependency graph; obtain a set of parallel execution operations based on the operation dependency graph; obtain the parallelism of each erroneous rollback command based on the set of parallel execution operations; and rearrange and parallelize the execution order of the several erroneous rollback commands based on the estimated execution time and the parallelism to obtain an optimized rollback command sequence.
[0182] Specific limitations regarding the rollback processing apparatus can be found in the limitations of the rollback processing method described above, and will not be repeated here. Each module in the aforementioned rollback processing apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.
[0183] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores rollback processing data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a rollback processing method.
[0184] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[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 executes the computer program to perform the following steps:
[0186] Obtain system business logic information, get operation commands and rollback commands, and construct an operation rollback mapping table;
[0187] The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result;
[0188] In response to the execution of the operation command, operation information is obtained, and the operation information is cached hierarchically according to the operation criticality evaluation result 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 a multi-dimensional rollback necessity judgment is performed;
[0190] In response to the result of the multi-dimensional rollback necessity judgment that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table.
[0191] Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0192] Perform rollback processing based on the optimized rollback command sequence.
[0193] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0194] Obtain system business logic information, get operation commands and rollback commands, and construct an operation rollback mapping table;
[0195] The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result;
[0196] In response to the execution of the operation command, operation information is obtained, and the operation information is cached hierarchically according to the operation criticality evaluation result 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 a multi-dimensional rollback necessity judgment is performed;
[0198] In response to the result of the multi-dimensional rollback necessity judgment that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table.
[0199] Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence;
[0200] Perform rollback processing based on the optimized rollback command sequence.
[0201] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, 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. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0202] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method of rollback processing, the method comprising: include: Obtain system business logic information, get operation commands and rollback commands, and build an operation rollback mapping table; The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result; In response to the execution of the operation command, operation information is obtained, and the operation information is cached hierarchically according to the operation criticality evaluation result to obtain a hierarchical operation information record table. In response to an error occurring during the execution of the operation command, error information and system status information are obtained, and a multi-dimensional rollback necessity judgment is performed, including: in response to an error occurring during the execution of the operation command, capturing and recording error information based on an exception handling mechanism; checking the current system status to obtain the system status information; generating an error report by combining the error information and the system status information; performing multi-dimensional judgment based on the error report to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment; and comprehensively judging the multi-dimensional rollback necessity based on the multi-dimensional judgment results to obtain a multi-dimensional rollback necessity judgment result. In response to the result of the multi-dimensional rollback necessity judgment that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table. Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence; Perform rollback processing based on the optimized rollback command sequence.
2. The method of claim 1, wherein, Obtain system business logic information, retrieve operation commands and rollback commands, and construct an operation rollback mapping table, including: Based on 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 several business operations. Based on the aforementioned business operations, corresponding execution instructions and dynamic parameters are obtained, wherein the execution instructions and the dynamic parameters constitute the operation command; Based on the operation command, define the rollback command and establish an operation rollback mapping relationship, wherein the rollback command includes a rollback execution instruction and rollback dynamic parameters; In response to the rollback dynamic parameters being consistent with the dynamic parameters, the operation rollback mapping table is constructed based on the operation rollback mapping relationship.
3. The method of claim 1, wherein: The operation command is subjected to an operation criticality assessment to obtain the operation criticality assessment result, including: Obtain the operation rollback mapping table to obtain the operation command and the rollback command; Define key performance indicators for operations; Obtain historical system data and, in conjunction with the system's business logic information, set the impact coefficients of the operational criticality evaluation indicators; Based on the operational criticality assessment indicators and the rollback command, the operational command is evaluated to obtain an indicator score. According to the index score, combined with the influence coefficient of the operation criticality evaluation index, an operation criticality score is obtained, wherein the operation criticality score is obtained based on the following formula: Wherein K represents the operation criticality score of the operation command, 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 operation criticality evaluation indexes. A critical threshold is set. If the criticality score of an operation is greater than the critical threshold, the operation is considered a critical operation. Otherwise, the operation is considered a non-critical operation.
4. The rollback processing method according to claim 3, characterized in that, In response to the execution of the operation command, operation information is acquired. Based on the operation criticality assessment result, the operation information is cached hierarchically to obtain a hierarchical operation information record table, including: In response to the execution of the operation command, the operation information of the operation command is obtained; Based on the operational criticality evaluation results of the operation command, a corresponding caching strategy is adopted for the operation information; If the operation command is a critical operation, then 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 a portion 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, and the portion 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. The rollback processing method according to claim 1, characterized in that, The multi-dimensional rollback necessity determination, which integrates the multi-dimensional judgment results, also includes: The data consistency judgment is performed to obtain the data consistency judgment result, which is based on the formula: ,in, This indicates the result of the data consistency judgment. This indicates that there is data inconsistency, where T represents the transaction status check result. This indicates the results of the data integrity constraint check. This indicates the results of the business data correctness check; The system stability assessment is performed to obtain the system stability assessment result, which is based on the formula: ,in, This indicates the result of the system stability assessment. This indicates that the system is unstable. This indicates the result of the resource usage exceeding limit check. This indicates the results of deadlock and zombie process checks; The business logic judgment is performed to obtain the business logic judgment result, which is based on the formula: ,in, This indicates the result of the business logic judgment. This indicates that business logic is affected. This indicates the execution result of the dependent operations of the current operation. This indicates the result of the business constraint rule integrity check; By combining the data consistency judgment results, the system stability judgment results, and the business logic judgment results, the multi-dimensional rollback necessity judgment results are obtained, wherein the multi-dimensional rollback necessity judgment is based on the formula: ,in, This indicates the result of the multi-dimensional rollback necessity judgment. If the result of the multi-dimensional rollback necessity judgment is that a rollback is required; in, OR operation, AND operation, Indicates NOT operation.
6. The rollback processing method according to claim 2, characterized in that, In response to the multi-dimensional rollback necessity judgment result indicating that a rollback is required, an initial rollback command sequence is obtained based on the hierarchical operation information record table and the operation rollback mapping table, including: Obtain the operation command that encountered an error during execution, and obtain the erroneous operation command; Based on the erroneous operation command, the 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 and the operation rollback mapping relationship, an error rollback command is obtained. The error rollback command includes 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. Based on the operational dependencies, the execution order of several error rollback commands is constructed according to the reverse order principle to obtain the initial rollback command sequence.
7. The rollback processing method according to claim 6, characterized in that, Based on dynamic rollback time assessment, the initial rollback command sequence is reconstructed to obtain an optimized rollback command sequence, including: Obtain the initial rollback command sequence to obtain several error rollback commands; Based on operational complexity, current system load, and resource consumption, the estimated execution time of each error rollback command is obtained. Obtain the operation dependencies and construct the operation dependency graph; Based on the operation dependency graph, a set of operations to be executed in parallel is obtained. The degree of parallelism of each error rollback command is obtained based on the set of parallel execution operations. Based on the estimated execution time and the degree of parallelism, the execution order of several error rollback commands is rearranged and parallelized to obtain an optimized rollback command sequence.
8. A rollback processing apparatus, characterized in that, The device includes: 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. The operation criticality assessment module is used to perform an operation criticality assessment on the operation command and obtain the operation criticality assessment result. The operation information recording and caching module is used to respond to the execution of the operation command, obtain operation information, and cache the operation information in a hierarchical manner according to the operation criticality evaluation result to obtain a hierarchical operation information recording table. The rollback necessity judgment module is used to respond to an error occurring when the operation command is executed, obtain error information and system status information, and perform a multi-dimensional rollback necessity judgment, including: in response to an error occurring when the operation command is executed, capturing and recording error information based on an exception handling mechanism; checking the current system status to obtain the system status information; combining the error information and the system status information to generate an error report; performing multi-dimensional judgment based on the error report to obtain a multi-dimensional judgment result, wherein the multi-dimensional judgment includes: data consistency judgment, system stability judgment, and business logic judgment; and comprehensively considering the multi-dimensional judgment results to perform a multi-dimensional rollback necessity judgment to obtain a multi-dimensional rollback necessity judgment result. The initial rollback command sequence generation module is used to respond to the result of the multi-dimensional rollback necessity judgment that rollback is required, and to obtain the initial rollback command sequence according to the hierarchical operation information record table and the operation rollback mapping table. The rollback command sequence optimization module is 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 based on 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, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.