Financial operation fault path switching method and device, electronic equipment and program product
By parsing SQL statements in financial business systems and implanting quantum checkpoints, the problems of long processing times and low data consistency during the switching of heterogeneous financial environments have been solved, achieving real-time accurate data comparison and high availability in heterogeneous environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2026-02-04
- Publication Date
- 2026-05-12
AI Technical Summary
When switching between heterogeneous financial environments, existing technologies suffer from problems such as long processing times and low data consistency. In particular, with large data volumes and high real-time requirements, traditional consistency comparison solutions cannot meet the business's high requirements for real-time data consistency.
By parsing the SQL statements in the target financial transaction, a set of atomic operation units is obtained, and quantum checkpoints are embedded in each unit. The quantum checkpoints are used to verify the database operation, capture and compare the operation results, and calculate a comprehensive score by combining the fault type and the degree of difference, and select the optimal processing path for switching.
It enables real-time and accurate comparison of data status in heterogeneous environments, eliminating the latency problem of traditional consistency verification schemes and meeting the needs of financial businesses for high availability and data consistency.
Smart Images

Figure CN122019271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology or other related fields, and more specifically, to a method and apparatus for switching fault paths in financial operations, electronic equipment, and program products. Background Technology
[0002] In the field of information technology, especially in industries such as finance, high system availability and data consistency are crucial. With the continuous development of information technology, more and more institutions are migrating their business systems from traditional heterogeneous financial environments to domestically developed information technology environments. However, significant shortcomings exist in the process of dual-environment coexistence and data migration: Consistency verification schemes in related technologies typically employ table-level SQL comparisons, using full outer joins to compare the values of key fields in both environments. While this method is intuitive and easy to understand, it reveals significant limitations in the context of ever-increasing data volumes and real-time requirements. Specifically, a traditional consistency comparison scheme executed once daily at midnight takes approximately 45 minutes to complete for a table containing 100 million records, failing to meet the high demands of real-time data consistency. Furthermore, when performing large-scale data migrations and building dual-active architectures, related technologies do not consider the heterogeneous characteristics between the architectural environments, i.e., they do not consider differences in data types, computational precision, and database syntax compatibility.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, and program product for switching fault paths in financial operations, in order to at least solve the technical problems of long time consumption and low data consistency when switching heterogeneous environments in related technologies.
[0005] To achieve the above objectives, according to one aspect of this application, a method for switching financial operation fault paths is provided, applied to a financial business system comprising two different heterogeneous financial disaster recovery environments, each of which can independently process financial business requests. The method includes: parsing SQL statements in a target financial transaction to obtain a set of atomic operation units, wherein the SQL statements include database operations to be executed and pre-sent to a target database, and the set of atomic operation units includes N atomic operation units, where N is a positive integer; embedding quantum checkpoints in each atomic operation unit; using the quantum checkpoints to perform database operation verification, and determining the fault type based on the verification results; using the quantum checkpoints to capture and compare the operation results of the database operation in the two heterogeneous financial disaster recovery environments to obtain an operation difference degree; determining an operation fault event based on the fault type and the operation difference degree, calculating a comprehensive score for the operation fault event across multiple dimensions, selecting the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment based on the comprehensive score, and switching the processing path of the operation fault event to the optimal processing path in the target heterogeneous financial disaster recovery environment.
[0006] Optionally, the step of parsing the SQL statements in the target financial transaction to obtain a set of atomic operation units includes: intercepting the SQL statements to be executed sent to the target database through a preset monitoring interface before the database operation is executed; using an atomic transaction parser to decompose the SQL statements in the target financial transaction to obtain transaction parsing results; marking the SQL statements as balance update operation units if the operation type in the transaction parsing results indicates that the SQL statements contain balance update statements; marking the SQL statements as transaction creation operation units if the operation type in the transaction parsing results indicates that the SQL statements contain transaction creation statements; and combining the balance update operation units, the transaction creation operation units, and other atomic operation units to be executed to obtain the set of atomic operation units.
[0007] Optionally, after parsing the SQL statement in the target financial transaction to obtain the set of atomic operation units, the method further includes: in the case that the current operating environment is a first type of financial disaster recovery heterogeneous environment, performing data type conversion on the SQL statement to complete the heterogeneous environment database syntax adaptation processing.
[0008] Optionally, the step of implanting a quantum verification point in each of the atomic operation units includes: implanting a lightweight verification node into a critical node of the execution path in each of the atomic operation units to complete the operation of implanting the quantum verification point.
[0009] Optionally, the step of using the quantum verification point to verify database operations and determining the fault type based on the verification result includes: constructing a verification SQL statement; using the verification SQL statement to concatenate all fields of the target table in the databases of the two financial disaster recovery heterogeneous environments into strings according to a predetermined format, resulting in two strings; for each string, generating a checksum using a preset data transmission error detection algorithm; determining whether the operation data of the database operation is consistent based on the two generated checksums; if inconsistent, determining that the data fingerprints of the two financial disaster recovery heterogeneous environments detected by the quantum verification point do not match, and determining the fault type as data inconsistency; detecting the response time of the database operation; if the response time exceeds a preset response time threshold, determining the fault type as system performance degradation; sending a heartbeat detection command; if the duration of consecutive failed heartbeat detections exceeds a preset heartbeat detection threshold, determining the fault type as system downtime.
[0010] Optionally, the step of capturing and comparing the operation results of database operations in two heterogeneous financial disaster recovery environments to obtain the operation difference degree includes: obtaining a first operation result of the database operation in a first type of heterogeneous financial disaster recovery environment, and obtaining a second operation result of the database operation in a second type of heterogeneous financial disaster recovery environment; extracting the field values of a predetermined number of records in the first operation result and the field values of a predetermined number of records in the second operation result; comparing whether the field values of the predetermined number of records in the first operation result and the field values of the predetermined number of records in the second operation result are consistent to obtain a field value comparison result; calculating the absolute value of the difference for the field values of all records where the field value comparison result indicates inconsistency, summing all the absolute values of the difference to obtain the total field difference; and calculating the operation difference degree based on the total field difference and the maximum error benchmark value allowed by the system using a preset difference analysis algorithm.
[0011] Optionally, the step of determining an operational failure event based on the failure type and the operational difference degree, and calculating a comprehensive score of the operational failure event across multiple dimensions, includes: determining the severity of the failure in the failure dimension based on the failure type and the numerical range of the operational difference degree; obtaining the priority of the financial transaction type corresponding to the target financial transaction, and determining the transaction type weight value in the business dimension based on the priority; detecting the environmental health of the current operating environment, and determining a system environment score based on the environmental health; and calculating a comprehensive score of the operational failure event across multiple dimensions based on the failure severity and failure dimension ratio, the transaction type weight value and business dimension ratio, the system environment score and the environment dimension score.
[0012] Optionally, the step of selecting the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment based on the comprehensive score, and switching the processing path of the operation failure event to the optimal processing path in the target financial disaster recovery heterogeneous environment, includes: executing a full switch command when the comprehensive score is greater than a preset score threshold; switching the operating environment of the operation failure event from the first type of financial disaster recovery heterogeneous environment to the second type of financial disaster recovery heterogeneous environment when the current operating environment is a first type of financial disaster recovery heterogeneous environment; switching the processing path of the operation failure event to the optimal processing path; and calling a preset compensation framework to perform data compensation for incomplete transactions.
[0013] According to another aspect of the present invention, a financial operation fault path switching device is also provided, applied to a financial business system comprising two different heterogeneous financial disaster recovery environments, each of which can independently process financial business requests, comprising: a transaction parsing unit, used to parse SQL statements in a target financial transaction to obtain a set of atomic operation units, wherein the SQL statements include database operations to be executed and pre-sent to a target database, the set of atomic operation units comprising N atomic operation units, where N is a positive integer; a checkpoint implantation unit, used to implant quantum checkpoints in each of the atomic operation units; and a fault type determination unit, used to... The system utilizes the quantum verification point to perform database operation verification and determines the fault type based on the verification result. An operation difference calculation unit is used to capture and compare the database operation results in two heterogeneous financial disaster recovery environments using the quantum verification point to obtain the operation difference degree. A processing path switching unit is used to determine the operation fault event based on the fault type and the operation difference degree, calculate the comprehensive score of the operation fault event in multiple dimensions, select the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment based on the comprehensive score, and switch the processing path of the operation fault event to the optimal processing path in the target heterogeneous financial disaster recovery environment.
[0014] Optionally, the transaction parsing unit includes: an SQL statement interception module, used to intercept the SQL statement to be executed sent to the target database through a preset monitoring interface before the database operation is executed; an SQL statement decomposition module, used to decompose the SQL statement in the target financial transaction using an atomic transaction parser to obtain the transaction parsing result; a first atomic operation unit marking module, used to mark the SQL statement as a balance update operation unit if the operation type in the transaction parsing result indicates that the SQL statement contains a balance update statement; a second atomic operation unit marking module, used to mark the SQL statement as a transaction creation operation unit if the operation type in the transaction parsing result indicates that the SQL statement contains a transaction creation statement; and a unit set synthesis module, used to synthesize the balance update operation unit, the transaction creation operation unit, and other atomic operation units to be executed to obtain the atomic operation unit set.
[0015] Optionally, the financial operation fault path switching device further includes: a data type conversion module, which, after parsing the SQL statement in the target financial transaction to obtain a set of atomic operation units, performs data type conversion on the SQL statement in the case that the current operating environment is a first type of financial disaster recovery heterogeneous environment, and completes the heterogeneous environment database syntax adaptation processing.
[0016] Optionally, the verification point implantation unit includes: a verification node implantation module, used to implant lightweight verification nodes into key nodes of the execution path in each atomic operation unit, thereby completing the operation of implanting quantum verification points.
[0017] Optionally, the fault type determination unit includes: a verification SQL statement construction module, used to construct a verification SQL statement, which concatenates all fields of the target table in the databases of the two financial disaster recovery heterogeneous environments into strings according to a predetermined format, resulting in two strings; a verification code generation module, used to generate a verification code for each string using a preset data transmission error detection algorithm; a first type of fault type determination module, used to determine whether the operation data of the database operation is consistent based on the two generated verification codes, and if inconsistent, to determine that the data fingerprints of the two financial disaster recovery heterogeneous environments detected by the quantum verification point do not match, and to determine that the fault type is data inconsistency; a second type of fault type determination module, used to detect the response time of the database operation, and if the response time exceeds a preset response time threshold, to determine that the fault type is system performance degradation; and a third type of fault type determination module, used to send a heartbeat detection command, and if the duration of continuous heartbeat detection failures exceeds a preset heartbeat detection threshold, to determine that the fault type is system crash.
[0018] Optionally, the operation difference calculation unit includes: an operation result acquisition module, used to acquire a first operation result of the database operation in a first type of financial disaster recovery heterogeneous environment, and to acquire a second operation result of the database operation in a second type of financial disaster recovery heterogeneous environment; a field value extraction module, used to extract the field values of a predetermined number of records in the first operation result and the field values of a predetermined number of records in the second operation result; a field value comparison module, used to compare whether the field values of the predetermined number of records in the first operation result and the field values of the predetermined number of records in the second operation result are consistent, and to obtain a field value comparison result; an absolute difference calculation module, used to calculate the absolute difference of the field values of all records where the field value comparison result indicates inconsistency, and to accumulate all the absolute difference values to obtain the total field difference; and an operation difference calculation module, used to calculate the operation difference based on the total field difference and the maximum error benchmark value allowed by the system, using a preset difference analysis algorithm.
[0019] Optionally, the processing path switching unit includes: a fault dimension determination module, used to determine the fault severity in the fault dimension based on the fault type and the numerical range of the operation difference degree; a business dimension determination module, used to obtain the priority of the financial transaction type corresponding to the target financial transaction, and determine the transaction type weight value in the business dimension based on the priority; a system dimension determination module, used to detect the environmental health of the current operating environment, and determine the system environment score based on the environmental health; and a comprehensive score calculation module, used to calculate the comprehensive score of the operation fault event in multiple dimensions based on the fault severity and fault dimension ratio, the transaction type weight value and business dimension ratio, the system environment score and the environmental dimension score.
[0020] Optionally, the processing path switching unit includes: a switching instruction execution module, used to execute a full switching instruction when the comprehensive score is greater than a preset score threshold; a heterogeneous environment switching module, used to switch the operating environment of the operation failure event from a first-class financial disaster recovery heterogeneous environment to a second-class financial disaster recovery heterogeneous environment when the current operating environment is a first-class financial disaster recovery heterogeneous environment; a processing path switching module, used to switch the processing path of the operation failure event to the optimal processing path; and a transaction compensation module, used to call a preset compensation framework to perform data compensation for incomplete transactions.
[0021] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the financial operation fault path switching method described above.
[0022] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the financial operation fault path switching method described above.
[0023] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the financial operation fault path switching method described in any one of the above embodiments.
[0024] In this disclosure, SQL statements in a target financial transaction are parsed to obtain a set of atomic operation units. The SQL statements include database operations to be executed and pre-sent to the target database. The set of atomic operation units includes N atomic operation units, where N is a positive integer. Quantum checkpoints are embedded in each atomic operation unit. Database operation verification is performed using these quantum checkpoints, and the fault type is determined based on the verification results. The quantum checkpoints are used to capture and compare the operation results of database operations in two heterogeneous financial disaster recovery environments to obtain the operation difference degree. Based on the fault type and the operation difference degree, operation failure events are determined, and a comprehensive score for the operation failure event across multiple dimensions is calculated. Based on the comprehensive score, the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment are selected, and the processing path for the operation failure event is switched to the optimal processing path in the target heterogeneous financial disaster recovery environment.
[0025] Based on the above disclosure, quantum checkpoints can be embedded in each atomic operation unit. These checkpoints can then be used to verify database operations and compare the results of database operations in two heterogeneous financial disaster recovery environments to obtain the degree of operational difference. Combining the fault type and the degree of operational difference, operational fault events can be identified. Furthermore, a comprehensive score for the operational fault event across multiple dimensions can be calculated. Based on the comprehensive score, the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment can be selected. This ensures real-time and accurate comparison of data status in heterogeneous architecture environments, eliminating the latency problem of traditional consistency verification schemes. This solves the technical problems of long processing time and low data consistency when switching between heterogeneous environments in related technologies. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0027] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a fault path switching method for financial operations is shown.
[0028] Figure 2 This is a flowchart of an optional financial operation fault path switching method according to an embodiment of the present invention;
[0029] Figure 3 This is an architecture diagram of an optional financial dual-active disaster recovery system based on atomic transaction quantization verification and multi-dimensional decision-making according to an embodiment of the present invention;
[0030] Figure 4 This is a schematic diagram of an optional real-time comparison system for a dual-active disaster recovery environment according to an embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram of an optional financial operation fault path switching device according to an embodiment of the present invention;
[0032] Figure 6 This is a structural block diagram of an electronic device for performing a financial operation fault path switching method according to an embodiment of this application. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:
[0036] Consistency Verification (CV) ensures that data remains consistent between two environments after data synchronization or system switching.
[0037] An atomic transaction (AT) is an indivisible unit of work, meaning that all operations within a transaction either complete completely or fail to execute. AT guarantees the integrity and consistency of data operations, serving as a crucial safeguard for data consistency in distributed systems.
[0038] Quantum Checkpoint (QCP) is an innovative checkpoint mechanism used to set lightweight data fingerprints during transaction processing, monitor changes in data state in real time, and thus ensure data consistency in heterogeneous environments.
[0039] Atomic transaction quantum verification is a method to achieve millisecond-level transaction consistency guarantee in a domestically developed dual-active disaster recovery system. It decomposes atomic transactions into indivisible operation units and implants lightweight verification probes (quantum verification points) at key nodes in the execution path of each unit. It captures and compares the operation results across heterogeneous environments in real time, ensuring strong consistency of transactions in the dual-active system.
[0040] A load balancer, or LB for short, is responsible for distributing network load. It typically distributes client requests evenly across multiple servers to optimize resource utilization and improve system response speed and redundancy.
[0041] The StatementInterceptor interface, at the database operation level, provides a mechanism in SII to intercept and process SQL statements before they are executed. This allows the system to perform additional logic, such as syntax transformation, logging, and security checks, before sending SQL instructions to the database, ensuring the correctness and performance of data operations.
[0042] CRC32, or Cyclic Redundancy Check 32-bit, is an error detection algorithm that verifies data integrity and consistency by calculating a checksum for data blocks. In real-time comparison systems in active-active environments, CRC32 is used to quickly generate and compare data state fingerprints, promptly detecting data inconsistencies and is a key technology for ensuring data consistency.
[0043] The Saga Compensation Framework (SCF) is a distributed transaction management model primarily used to handle long-running business processes, especially those operations that span multiple service boundaries. When a partial operation failure is detected, SCF can automatically initiate compensation operations to roll back or correct affected data, restoring the system to a consistent state.
[0044] Multi-dimensional decision-making: The dual-active disaster recovery system of this application realizes a dynamic decision-making mechanism for intelligent fault response. By collecting three-dimensional data of transaction execution in real time, including fault dimension, business dimension and environment dimension, the system is driven to automatically select the optimal processing path (such as traffic switching / transaction compensation / service degradation) in fault scenarios.
[0045] It should be noted that the financial operation failure path switching method and device disclosed herein can be used in the financial technology field to achieve disaster recovery processing of financial dual-active heterogeneous environments based on atomic quantum verification and multi-dimensional decision-making. It can also be used in any field other than the financial technology field to achieve disaster recovery processing of financial dual-active heterogeneous environments based on atomic quantum verification and multi-dimensional decision-making. This disclosure does not limit the application field of the financial operation failure path switching method and device.
[0046] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) collected in this public disclosure are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of the relevant regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or organization.
[0047] It should be noted that in this disclosure, customer information is collected and analyzed, and users are provided with corresponding operation entry points to choose whether to agree to or reject the automated decision results; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0048] The following embodiments of the present invention can be applied to various financial operation failure path switching systems / applications / devices. The present invention is applicable to financial information processing scenarios and application scenarios with strict requirements for data consistency and system high availability. For example, in a dual-active disaster recovery system, the present invention can effectively solve the problems of data synchronization and consistency verification in a heterogeneous dual-active architecture environment.
[0049] In existing technologies, financial active-active disaster recovery systems suffer from several problems, including data inconsistency (defect asynchronous replication leads to the invisibility of intermediate transaction states (e.g., successful transfer deduction but no deposit execution)), low switching efficiency (verification time is consumed in fault detection, decision confirmation, command execution, and business recovery), and low verification dimensions (ignoring floating-point operation deviations caused by heterogeneous architecture differences between the two systems and not covering constraints of domestic databases).
[0050] This invention ensures real-time and accurate comparison of data states under heterogeneous architectures through "quantum checkpoint implantation" and an "atomic transaction decomposition engine," eliminating the latency issues of traditional consistency verification schemes. Utilizing an "automated routing decision engine," it intelligently adjusts routing strategies based on real-time monitoring of fault types, business impacts, and environmental health status, achieving second-level switchover to a backup environment and meeting financial-grade high availability requirements.
[0051] By using a pre-defined decision matrix and dynamic weighting algorithm, this invention can accurately assess the impact of faults on business operations, rationally allocate resources, and minimize business interruptions and data risks caused by faults.
[0052] The present invention will now be described in detail with reference to various embodiments.
[0053] Example 1
[0054] According to an embodiment of the present invention, an embodiment of a financial operation failure path switching method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0055] The financial operation fault path switching method embodiment provided in this application can be executed on a mobile terminal, computer terminal or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a fault path switching method in financial operations is shown. Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1The processor 102 (illustrated as 102a, 102b, ..., 102n) may include, but is not limited to, a microprocessor MCU (Microcontroller Unit) or a programmable gate array (FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0056] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0057] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the financial operation fault path switching method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned financial operation fault path switching method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0058] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0059] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0060] To achieve the above objectives, according to one aspect of this application, a financial operation fault path switching method is provided, which is applied to a financial business system containing two different financial disaster recovery heterogeneous environments, each of which can independently handle financial business requests.
[0061] Under the aforementioned operating environment, this application provides the following: Figure 2 The financial operation fault path switching method is shown. Figure 2 This is a flowchart of an optional financial operation failure path switching method according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps S201 to S205. The present invention will be described in detail below with reference to each implementation step.
[0062] Step S201: Parse the SQL statement in the target financial transaction to obtain a set of atomic operation units. The SQL statement includes database operations to be executed and sent to the target database. The set of atomic operation units includes N atomic operation units, where N is a positive integer.
[0063] Optionally, the step of parsing the SQL statements in the target financial transaction to obtain a set of atomic operation units includes: intercepting the SQL statements to be executed sent to the target database through a preset monitoring interface before the database operation is executed; using an atomic transaction parser to decompose the SQL statements in the target financial transaction to obtain transaction parsing results; marking the SQL statements containing balance update statements as balance update operation units if the operation type indication in the transaction parsing results indicates that the SQL statements contain transaction creation statements as transaction creation operation units; and combining the balance update operation units, transaction creation operation units, and other atomic operation units to be executed to obtain a set of atomic operation units.
[0064] Before the SQL statement of the target financial transaction is sent to the target database for execution, this embodiment intercepts it in real time through a preset monitoring interface (e.g., the StatementInterceptor interface) to perform a preliminary review of each database operation to be executed. The intercepted SQL statement is then passed to an atomic transaction parser, which is responsible for breaking it down into a series of smaller operation units, i.e., atomic operation units. Specifically, during the decomposition process, complex database operations can be broken down into the smallest units that can be processed and verified independently based on the structure and semantics of the SQL statement, which helps to improve the flexibility and accuracy of data processing.
[0065] During the decomposition process, the atomic transaction parser identifies the type of each operation unit. If the SQL statement contains a balance update statement, the operation unit is specifically marked as a balance update operation unit; if it contains a transaction creation statement, it is marked as a transaction creation operation unit. This type-based operation unit marking facilitates more targeted processing and decision-making in subsequent data verification and disaster recovery strategies, enhancing the system's responsiveness and control capabilities for specific types of operations. The atomic operation unit parsing process in this embodiment not only identifies and marks different types of database operations but also captures the essence of transactions in the form of atomic operation units. This enables refined management and control of financial transactions, helping to reduce the risk of data anomalies and improve the overall stability of the system and user experience.
[0066] Optionally, after parsing the SQL statements in the target financial transaction to obtain the set of atomic operation units, the method further includes: in the case that the current operating environment is a first-type financial disaster recovery heterogeneous environment, performing data type conversion on the SQL statements to complete the heterogeneous environment database syntax adaptation processing.
[0067] When the operating environment is detected to be a first-class heterogeneous environment (such as an information technology innovation environment), this embodiment can intelligently identify the data type in the SQL statement, such as the numeric field NUMBER(38), and convert it into a more suitable type in the target database, such as DECIMAL(38,0), which helps to eliminate data accuracy problems caused by architectural differences and can improve the accuracy of data processing.
[0068] It should be noted that database operations in heterogeneous environments often require fine-tuning of SQL statements to adapt to the syntax characteristics of different database management systems. This embodiment can automate this process through built-in conversion rules, avoiding unnecessary complexity and potential errors from manual intervention, and helping to improve the efficiency and reliability of data interaction.
[0069] In active-active or primary-backup failover scenarios, when the system needs to quickly migrate from one architecture to another, the data type conversion function in this embodiment can ensure that transaction execution is not affected even if the architecture changes, which helps to achieve smooth and efficient disaster recovery failover.
[0070] Step S202: Implant a quantum checkpoint in each atomic operation unit.
[0071] Optionally, the step of implanting a quantum verification point in each atomic operation unit includes: implanting a lightweight verification node into a critical node of the execution path in each atomic operation unit to complete the operation of implanting the quantum verification point.
[0072] This embodiment first performs a deep analysis of the execution path of each atomic operation unit to accurately locate those critical operation nodes that are sensitive to data state (critical nodes can refer to nodes involving data read, modification, or write operations). Then, lightweight verification nodes are implanted into these critical nodes as quantum verification points. These verification nodes are responsible for quickly calculating and storing the fingerprint information of the current data state before and after the operation unit execution, such as a checksum generated using the CRC32 algorithm. This helps to achieve real-time monitoring of data state changes without affecting transaction processing efficiency.
[0073] Step S203: Use quantum verification points to perform database operation verification, and determine the fault type based on the verification results.
[0074] Optionally, the steps of using quantum checkpoints to verify database operations and determining the fault type based on the verification results include: constructing a verification SQL statement; using the verification SQL statement to concatenate all fields of the target table in the databases of the two heterogeneous financial disaster recovery environments into strings according to a predetermined format, resulting in two strings; generating a checksum for each string using a preset data transmission error detection algorithm; determining whether the operation data of the database operation is consistent based on the two generated checksums; if inconsistent, determining that the data fingerprints of the two heterogeneous financial disaster recovery environments detected by the quantum checkpoints do not match, and determining the fault type as data inconsistency; detecting the response time of the database operation; if the response time exceeds a preset response time threshold, determining the fault type as system performance degradation; and sending a heartbeat detection command; if the duration of consecutive failed heartbeat detections exceeds a preset heartbeat detection threshold, determining the fault type as system downtime.
[0075] It should be noted that this embodiment focuses on the verification mechanism of database operations using quantum checkpoints. Based on the comparison results of the generated check codes, various fault types are determined, including but not limited to data inconsistency, system performance degradation, and system crash.
[0076] In this embodiment, before and after the execution of each atomic operation unit in the target table, a dedicated verification SQL statement can be constructed. This verification SQL statement can concatenate all fields in the table according to a predetermined format to form a string containing all key information, which can be used for subsequent data consistency comparison. For each string constructed from two heterogeneous environments, this embodiment uses a preset data transmission error detection algorithm (e.g., CRC32 algorithm) to generate a corresponding checksum.
[0077] By comparing the check codes generated in the two environments, this embodiment can detect the matching of data fingerprints in real time. If the check codes are inconsistent, it indicates that the database operation has caused a change in the data state, and this change has not been shared by the two environments at the same time. The fault type can be determined as data inconsistency, which helps to take immediate measures to correct the data or switch to an available environment.
[0078] In addition to data consistency verification, this embodiment also monitors the response time of database operations. If the response time of a certain operation significantly exceeds a preset threshold, this can be regarded as a signal of system performance degradation. This helps to adjust resource allocation or trigger disaster recovery switching in a timely manner when the system response is slow or timed out, so as to restore the normal level of service.
[0079] Furthermore, to address more severe system failures, this embodiment continuously sends heartbeat detection commands to check the operational status of each system component. If the duration of consecutive heartbeat detection failures exceeds a preset heartbeat detection threshold, it can be inferred that the system has crashed, facilitating the immediate initiation of emergency procedures, such as switching to a backup environment, to avoid service interruption.
[0080] Through the above verification mechanism, this embodiment can comprehensively monitor data and system status at different levels and points in time, which helps to make timely and appropriate responses when various types of failures occur, ensuring the smooth operation of financial transactions in heterogeneous environments, while minimizing the impact of data anomalies or system failures.
[0081] Step S204: Use quantum verification points to capture and compare the operation results of database operations in two heterogeneous financial disaster recovery environments to obtain the operation difference degree.
[0082] Optionally, the step of capturing and comparing the operation results of database operations in two heterogeneous financial disaster recovery environments using quantum checkpoints to obtain the operation difference degree includes: obtaining the first operation result of the database operation in the first type of heterogeneous financial disaster recovery environment, and obtaining the second operation result of the database operation in the second type of heterogeneous financial disaster recovery environment; extracting the field values of a predetermined number of records in the first operation result and the field values of a predetermined number of records in the second operation result; comparing whether the field values of the predetermined number of records in the first operation result and the field values of the predetermined number of records in the second operation result are consistent, and obtaining the field value comparison result; calculating the absolute value of the difference for the field values of records whose field value comparison results indicate inconsistency, summing all the absolute values of the difference to obtain the total field difference; and calculating the operation difference degree based on the total field difference and the maximum error benchmark value allowed by the system using a preset difference analysis algorithm.
[0083] This embodiment obtains the execution result of database operations from a first type of heterogeneous financial disaster recovery environment (e.g., a traditional database environment), defined as the first operation result. Then, it obtains the corresponding operation result from a second type of heterogeneous financial disaster recovery environment (e.g., an information technology innovation database), referred to as the second operation result. After obtaining the operation results, this embodiment can extract the field values of a predetermined number of records from the first and second operation results for detailed comparative analysis. By comparing the field values of records at the same position in the two operation results, this embodiment can obtain field value comparison results. The results may include the matching status of each record in the two environments. For inconsistent records, the absolute value of the difference will be calculated; this calculation process helps to quantify the degree of data difference.
[0084] Alternatively, the formula for the difference analysis algorithm can be:
[0085]
[0086] Symbol definition:
[0087] The field value of the i-th record in a traditional database environment;
[0088] The field value of the i-th record in the Information Technology Innovation Environment;
[0089] MaxErrorThreshold: The maximum error threshold allowed by the system (e.g., 0.01 yuan in a financial scenario).
[0090] ∑: Sum the absolute values of the differences in field values across all inconsistent records;
[0091] Dissimilarity: The normalized inconsistency ratio, used by the decision engine to trigger disaster recovery actions.
[0092] This embodiment calculates the total field difference by summing the absolute values of the differences in field values of all inconsistent records. Then, the total field difference is compared with the system's preset maximum error benchmark value. A preset difference analysis algorithm is used to calculate the operational difference degree, which reflects the difference in data state after database operations are executed in two heterogeneous environments. The quantum checkpoints in this embodiment can not only capture subtle changes in database operations but also perform real-time and accurate data comparisons, helping to immediately detect and quantify the degree of data inconsistency. The calculation mechanism for operational difference degree further enhances the intelligence level of the disaster recovery system, supporting more precise disaster recovery strategy planning and execution. It not only enhances the monitoring capability of data consistency but also provides more scientific data support for subsequent disaster recovery operations, helping to maintain the stability of the financial system and the continuity of services.
[0093] Step S205: Based on the fault type and operational difference, determine the operational fault event, calculate the comprehensive score of the operational fault event in multiple dimensions, select the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment based on the comprehensive score, and switch the processing path of the operational fault event to the optimal processing path in the target financial disaster recovery heterogeneous environment.
[0094] Optionally, the steps of determining operational failure events based on failure type and operational difference degree, and calculating the comprehensive score of operational failure events across multiple dimensions, include: determining the severity of failure in the failure dimension based on the numerical range of failure type and operational difference degree; obtaining the priority of the financial transaction type corresponding to the target financial transaction, and determining the transaction type weight value in the business dimension based on the priority; detecting the environmental health of the current operating environment, and determining the system environment score based on the environmental health; and calculating the comprehensive score of operational failure events across multiple dimensions based on failure severity and failure dimension ratio, transaction type weight value and business dimension ratio, system environment score and environmental dimension score.
[0095] Operational failure events are identified based on failure type and operational differences. Then, a comprehensive score for this event is calculated across different dimensions. Based on the score results, the optimal processing path and target financial disaster recovery heterogeneous environment are intelligently selected to achieve efficient failure response.
[0096] Specifically, this embodiment can achieve multi-dimensional decision processing through an automated routing decision engine, including comprehensive analysis of three dimensions: fault dimension, business dimension, and environmental dimension, to determine the operation to be executed. First, based on the fault types identified in the previous steps, such as data inconsistency, performance degradation, or system crash, and combined with the numerical range of operation difference, this embodiment can determine the severity of the fault in the fault dimension.
[0097] Furthermore, this embodiment then obtains the specific financial transaction type corresponding to the target financial firm, such as payment, inquiry, or management operations, and determines the weight value of the transaction type in the business dimension based on predefined priorities. This helps to give greater attention to failures that may affect business continuity when calculating the comprehensive score. In addition, in order to comprehensively assess the current operating status of the system, this embodiment detects the environmental health of the current operating environment, thereby determining the system environment score. This reflects the health level of the dual-active financial disaster recovery heterogeneous environment (including information technology innovation environment or traditional environment), and can serve as a reference for judging whether disaster recovery switching is needed, helping to adjust the data processing path in a timely manner when the environment becomes unstable.
[0098] Based on the above information, this embodiment calculates a comprehensive score for operational failure events across three dimensions: failure, business, and environment. A weighted summation method is used, combining the failure severity, transaction type weights, and environmental health score, allocating weights according to a preset ratio to arrive at a numerical value that comprehensively reflects the impact of the failure event. Calculating this comprehensive score contributes to the scientific and quantitative development of disaster recovery decisions, supporting more intelligent failure response strategies.
[0099] Optionally, the steps of selecting the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment based on the comprehensive score, and switching the processing path of the operational failure event to the optimal processing path in the target financial disaster recovery heterogeneous environment, include: executing a full switch command when the comprehensive score is greater than a preset score threshold; switching the operating environment of the operational failure event from the first type of financial disaster recovery heterogeneous environment to the second type of financial disaster recovery heterogeneous environment when the current operating environment is the first type of financial disaster recovery heterogeneous environment; switching the processing path of the operational failure event to the optimal processing path; and calling a preset compensation framework to perform data compensation for incomplete transactions.
[0100] After analyzing the comprehensive score of operational failure events, if the score exceeds a preset score threshold, this embodiment will trigger a full switchover command. This means that regardless of how many incomplete transactions or operations exist in the current operating environment, a switchover will be performed without discrimination. This ensures that in high-risk situations, the system can quickly migrate to a more stable environment to reduce potential business losses.
[0101] If the current operating environment is a Type I heterogeneous financial disaster recovery environment, this embodiment will switch the operating environment of the operational failure event to a Type II heterogeneous financial disaster recovery environment. This switching process not only resolves problems caused by a specific architecture but also helps balance the load between different environments, improving the overall stability and disaster recovery capabilities of the system. After determining the target heterogeneous financial disaster recovery environment, this embodiment can switch the processing path for the operational failure event to the optimal processing path. The selection of the optimal processing path is based on a comprehensive consideration of the failure type, operational differences, and the current state of the system, ensuring the accuracy of data operations and the efficiency of transaction processing during failure handling.
[0102] Considering that there may be incomplete or intermediate transactions during the switchover process, this embodiment invokes a preset compensation framework to perform data compensation for these transactions. Data compensation helps to correct data inconsistencies caused by faults or switchovers, ensuring the integrity and accuracy of business data, and contributing to maintaining the continuity of financial services and data security.
[0103] Through the above steps, the SQL statements in the target financial transaction can be parsed to obtain a set of atomic operation units. The SQL statements include database operations to be executed and pre-sent to the target database. The set of atomic operation units includes N atomic operation units, where N is a positive integer. Quantum checkpoints are embedded in each atomic operation unit. Database operation verification is performed using these quantum checkpoints, and the fault type is determined based on the verification results. The quantum checkpoints are used to capture and compare the operation results of the database operation in two heterogeneous financial disaster recovery environments to obtain the operation difference degree. Based on the fault type and the operation difference degree, operation failure events are determined, and a comprehensive score for the operation failure event is calculated across multiple dimensions. Based on the comprehensive score, the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment are selected, and the processing path for the operation failure event is switched to the optimal processing path in the target heterogeneous financial disaster recovery environment. In this embodiment, quantum verification points can be implanted in each atomic operation unit. These quantum verification points are then used to verify database operations and compare the results of database operations in two heterogeneous financial disaster recovery environments to obtain the operation difference degree. Combining the fault type and the operation difference degree, operation fault events are determined. Then, a comprehensive score of the operation fault event in multiple dimensions is calculated. Based on the comprehensive score, the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment are selected. This ensures real-time and accurate comparison of data status in heterogeneous architecture environments, eliminates the latency problem of traditional consistency verification schemes, and solves the technical problems of long time consumption and low data consistency when switching heterogeneous environments in related technologies.
[0104] The following describes in detail another optional implementation method.
[0105] Figure 3This is an architecture diagram of an optional financial dual-active disaster recovery system based on atomic transaction quantization verification and multi-dimensional decision-making according to an embodiment of the present invention, such as... Figure 3 As shown, it includes: an intelligent routing decision engine, a traffic distribution controller, a quantum verification platform (including an atomic transaction parser and a quantum verification engine), an information technology innovation production environment, a traditional production environment, a data compensation module, and an escape route actuator.
[0106] The following sections provide illustrative descriptions of the quantum verification platform, intelligent routing decision engine, and data compensation module, which provide new technological solutions.
[0107] The first part is the quantum verification platform, which includes an atomic entity analyzer and a quantum verification engine.
[0108] First, for the atomic transaction parser, its execution steps include:
[0109] Step 1: Parse the transaction SQL semantics.
[0110] For example, when analyzing SQL statements in a transaction, identify the operation type: 1. If it contains the UPDATE account SET balance statement, mark it as a balance update operation unit (BALANCE_UPDATE_OP); 2. If it contains the INSERT INTO journal statement, mark it as a journal creation operation unit (JOURNAL_CREATE_OP).
[0111] Step 2: Dynamically adapt to heterogeneous architectures.
[0112] If the current operating environment is an information technology innovation environment architecture (corresponding to the first financial disaster recovery heterogeneous environment mentioned above), the data type NUMBER(38) in the SQL statement will be automatically replaced with DECIMAL(38,0) to eliminate the difference in floating-point precision between the two environments. Atomic operation units are divided through semantic recognition, and the differences in database syntax of heterogeneous architectures are dynamically adapted.
[0113] Next, the execution steps of the quantum verification engine include:
[0114] Step 1: Intercept database operations.
[0115] Before database operations are executed, the SQL statements to be executed are intercepted by implementing the StatementInterceptor interface.
[0116] Step 2: Generate data fingerprint.
[0117] Construct the verification SQL: Concatenate all fields of the target table into a string using CONCAT_WS('|',...), and generate a 32-bit checksum using the CRC32 algorithm.
[0118] Step 3: Store the verification point.
[0119] The generated verification code is stored in the quantum verification point repository in real time with "PRE_" + transaction ID as the key.
[0120] The quantum verification point generates a verification code through two environmental analyses, which can detect in real time whether the data fingerprints of the dual-active heterogeneous environment match. If they do not match, it can determine the type of data inconsistency fault and trigger a disaster recovery environment switching command.
[0121] In addition, quantum checkpoints can also detect the response time of atomic transaction operation units. If the response time exceeds the transaction response threshold (such as baseline value + 30%), the fault type of performance degradation can be determined and a disaster recovery environment switchover command can be triggered.
[0122] In addition, the quantum verification point can also perform heartbeat detection. If the heartbeat detection fails continuously for more than 200ms, it can determine the type of system crash and trigger a disaster recovery environment switchover command.
[0123] Therefore, the quantum verification point in this embodiment refers to a lightweight verification node implanted in the critical path of transaction processing, which includes: 1) Data fingerprint: a 32-bit check code generated by the CRC32 algorithm; 2) Performance probe: response timestamp (accurate to microseconds); 3) Environment label: the identifier of the dual-active disaster recovery heterogeneous architecture (traffic coloring technology: implanting a 32-bit coloring identifier (0xEE) in the Options field of the TCP / IP packet header to realize the transparent tracking of requests in the dual environment. For example, the identifier includes: [1-bit environment identifier][15-bit transaction ID][16-bit sequence number]).
[0124] Figure 4 This is a schematic diagram of an optional real-time comparison system for a dual-active disaster recovery environment according to an embodiment of the present invention, as shown below. Figure 4 As shown, it can be achieved through a splitter (corresponding to...) Figure 3 The traffic distribution controller in the middle distributes financial business production traffic, resulting in multiple financial business transactions. These transactions are then parsed to obtain multiple atomic operation units. Atomic checkpoints are embedded in each atomic operation unit, and these checkpoints are used to analyze database operations in a dual-active disaster recovery heterogeneous environment (corresponding to...). Figure 4The system processes the results of traditional environmental processing and information technology innovation environmental processing, and then compares them with the results using a result comparator. If they match, a normal response is returned; if they do not match, an alarm is triggered, a log snapshot is generated, and the routing decision engine is activated to perform environmental switching and processing path switching.
[0125] Alternatively, the formula for the difference analysis algorithm can be:
[0126]
[0127] Symbol definition:
[0128] The field value of the i-th record in a traditional database environment;
[0129] The field value of the i-th record in the Information Technology Innovation Environment;
[0130] MaxErrorThreshold: The maximum error threshold allowed by the system (e.g., 0.01 yuan in a financial scenario).
[0131] ∑: Sum the absolute values of the differences in field values across all inconsistent records;
[0132] Dissimilarity: The normalized inconsistency ratio, used by the decision engine to trigger disaster recovery actions.
[0133] Part Three: Automated Routing Decision Engine.
[0134] Example of a decision matrix:
[0135]
[0136] In the parameter determination logic, among the fault types, data inconsistency refers to: the quantum verification point detects a mismatch between the data fingerprints of the two environments in real time; performance degradation refers to: the transaction response time exceeds the threshold (such as the baseline value + 30%); system crash refers to: the heartbeat detection fails continuously for more than 200ms.
[0137] For business weights, predefined transaction type priorities are: payment business = 10 (highest), query business = 3, management business = 1, and weight values are mapped according to the current transaction type.
[0138] Routing decision matrix: a three-dimensional decision model, with dimensions including:
[0139]
[0140] When making dynamic routing decisions, the steps include:
[0141] Step 1: Calculate the overall fault score.
[0142] Decision scores are dynamically calculated based on fault events:
[0143] The severity of the fault accounts for 60% (e.g., downtime = 100, performance degradation = 70).
[0144] Business weight (bizWeightMap mapping value) accounts for 30%;
[0145] The environmental health score (envHealthScore, 0-100) has a reverse weighting of 10%.
[0146] Step 2: Trigger disaster recovery actions.
[0147] If the overall score is greater than 80, a full switchover can be performed, transferring 100% of traffic to the traditional environment. Simultaneously, the SAGA compensation framework can be invoked to compensate for incomplete transactions. Integrating the SAGA compensation framework to compensate for incomplete transactions helps resolve data inconsistencies caused by system failures or switchovers, ensuring eventual data consistency.
[0148] This embodiment can integrate three dimensions of fault (severity, business impact, and environmental status) to achieve dynamic weighted decision-making.
[0149] In this embodiment of the invention, the atomic transaction quantum verification method can intercept and verify data in real time at the operation level, achieving millisecond-level data consistency interception, which helps ensure data synchronization and integrity in a dual-active environment. Utilizing quantum checkpoints and difference analysis algorithms, this invention can detect various fault types such as data inconsistency, performance degradation, and system crashes in real time, and quickly classify them according to preset rules, which helps to detect and respond to faults early and reduce business interruption time.
[0150] The automated routing decision engine described above dynamically calculates a comprehensive fault score based on multiple dimensions such as fault type, operational differences, business weight, and environmental health. This intelligently selects the optimal disaster recovery switching strategy and target environment, helping to make the best response under different fault scenarios and improve the accuracy and efficiency of disaster recovery switching.
[0151] Abandoning the traditional method of manually adjusting load balancing weights, this invention achieves automated switching through a decision matrix example and a dynamic routing API. It can meet the requirements of financial-grade, second-level switching, facilitating rapid switching to a backup environment in emergency situations and ensuring service continuity. Simultaneously, the use of predefined transaction type priorities and a transaction decomposition engine helps prioritize critical transactions based on business urgency and transaction type importance, minimizing the impact of failures on core business processes and ensuring the stable operation of critical businesses.
[0152] The following is a detailed description with reference to another embodiment.
[0153] Example 2
[0154] The financial operation fault path switching device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in the above embodiment one. The specific implementation method and beneficial effects can be referred to the aforementioned method embodiment, and will not be repeated here.
[0155] According to another aspect of the present invention, a financial operation fault path switching device is also provided, which is applied to a financial business system containing two different financial disaster recovery heterogeneous environments, each of which can independently process financial business requests.
[0156] Figure 5 This is a schematic diagram of an optional financial operation fault path switching device according to an embodiment of the present invention, such as... Figure 5 As shown, the financial operation fault path switching device may include: a transaction parsing unit 51, a verification point implantation unit 52, a fault type determination unit 53, an operation difference calculation unit 54, and a processing path switching unit 55.
[0157] Among them, the transaction parsing unit 51 is used to parse the SQL statement in the target financial transaction to obtain the atomic operation unit set. The SQL statement includes database operations to be executed that are to be sent to the target database. The atomic operation unit set includes N atomic operation units, where N is a positive integer.
[0158] The checkpoint implantation unit 52 is used to implant quantum checkpoints in each atomic operation unit;
[0159] The fault type determination unit 53 is used to perform database operation verification using quantum verification points and determine the fault type based on the verification results.
[0160] The operation difference calculation unit 54 is used to capture and compare the operation results of database operations in two heterogeneous financial disaster recovery environments using quantum verification points to obtain the operation difference.
[0161] The processing path switching unit 55 is used to determine the operation failure event based on the fault type and operation difference, calculate the comprehensive score of the operation failure event in multiple dimensions, select the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment based on the comprehensive score, and switch the processing path of the operation failure event to the optimal processing path in the target financial disaster recovery heterogeneous environment.
[0162] The aforementioned financial operation fault path switching device can parse the SQL statements in the target financial transaction through the transaction parsing unit 51 to obtain a set of atomic operation units. The SQL statements include database operations to be executed and pre-sent to the target database. The set of atomic operation units includes N atomic operation units. The verification point implantation unit 52 implants quantum verification points into each atomic operation unit. The fault type determination unit 53 uses the quantum verification points to verify the database operation and determines the fault type based on the verification results. The operation difference calculation unit 54 uses the quantum verification points to capture and compare the operation results of the database operation in two financial disaster recovery heterogeneous environments to obtain the operation difference. The processing path switching unit 55 determines the operation fault event based on the fault type and the operation difference, calculates the comprehensive score of the operation fault event in multiple dimensions, selects the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment based on the comprehensive score, and switches the processing path of the operation fault event to the optimal processing path in the target financial disaster recovery heterogeneous environment. In this embodiment, quantum verification points can be implanted in each atomic operation unit. These quantum verification points are then used to verify database operations and compare the results of database operations in two heterogeneous financial disaster recovery environments to obtain the operation difference degree. Combining the fault type and the operation difference degree, operation fault events are determined. Then, a comprehensive score of the operation fault event in multiple dimensions is calculated. Based on the comprehensive score, the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment are selected. This ensures real-time and accurate comparison of data status in heterogeneous architecture environments, eliminates the latency problem of traditional consistency verification schemes, and solves the technical problems of long time consumption and low data consistency when switching heterogeneous environments in related technologies.
[0163] Optionally, the transaction parsing unit includes: an SQL statement interception module, used to intercept the SQL statements to be executed sent to the target database through a preset monitoring interface before the database operation is executed; an SQL statement decomposition module, used to decompose the SQL statements in the target financial transaction using an atomic transaction parser to obtain the transaction parsing result; a first atomic operation unit marking module, used to mark the SQL statement containing a balance update statement as a balance update operation unit if the operation type indication in the transaction parsing result contains a transaction creation statement; a second atomic operation unit marking module, used to mark the SQL statement containing a transaction creation statement as a transaction creation operation unit if the operation type indication in the transaction parsing result contains a transaction creation statement; and a unit set synthesis module, used to synthesize the balance update operation unit, the transaction creation operation unit, and other atomic operation units to be executed to obtain an atomic operation unit set.
[0164] Optionally, the financial operation fault path switching device further includes: a data type conversion module, which, after parsing the SQL statement in the target financial transaction to obtain the set of atomic operation units, performs data type conversion on the SQL statement in the case that the current operating environment is a first-type financial disaster recovery heterogeneous environment, and completes the heterogeneous environment database syntax adaptation processing.
[0165] Optionally, the verification point implantation unit includes: a verification node implantation module, used to implant lightweight verification nodes into critical nodes of the execution path in each atomic operation unit, thereby completing the operation of implanting quantum verification points.
[0166] Optionally, the fault type determination unit includes: a verification SQL statement construction module, used to construct a verification SQL statement, which concatenates all fields of the target table in the databases of the two financial disaster recovery heterogeneous environments into strings according to a predetermined format, resulting in two strings; a verification code generation module, used to generate a verification code for each string using a preset data transmission error detection algorithm; a first type of fault type determination module, used to determine whether the operation data of the database operation is consistent based on the two generated verification codes. If inconsistent, it is determined that the data fingerprints of the two financial disaster recovery heterogeneous environments detected by the quantum verification point do not match, and the fault type is determined to be data inconsistency; a second type of fault type determination module, used to detect the response time of the database operation. If the response time exceeds a preset response time threshold, the fault type is determined to be system performance degradation; a third type of fault type determination module, used to send a heartbeat detection command. If the duration of consecutive heartbeat detection failures exceeds a preset heartbeat detection threshold, the fault type is determined to be system downtime.
[0167] Optionally, the operation difference calculation unit includes: an operation result acquisition module, used to acquire the first operation result of the database operation in a first type of financial disaster recovery heterogeneous environment, and to acquire the second operation result of the database operation in a second type of financial disaster recovery heterogeneous environment; a field value extraction module, used to extract the field values of a predetermined number of records in the first operation result and the field values of a predetermined number of records in the second operation result; a field value comparison module, used to compare whether the field values of the predetermined number of records in the first operation result and the field values of the predetermined number of records in the second operation result are consistent, and to obtain the field value comparison result; an absolute difference calculation module, used to calculate the absolute difference of the field values of all records whose field value comparison results indicate inconsistency, and to sum all the absolute difference values to obtain the total field difference; and an operation difference calculation module, used to calculate the operation difference based on the total field difference and the maximum error benchmark value allowed by the system, using a preset difference analysis algorithm.
[0168] Optionally, the processing path switching unit includes: a fault dimension determination module, used to determine the severity of the fault in the fault dimension based on the fault type and the numerical range of operational differences; a business dimension determination module, used to obtain the priority of the financial transaction type corresponding to the target financial transaction, and determine the transaction type weight value in the business dimension based on the priority; a system dimension determination module, used to detect the environmental health of the current operating environment, and determine the system environment score based on the environmental health; and a comprehensive score calculation module, used to calculate the comprehensive score of the operational fault event in multiple dimensions based on the fault severity and fault dimension ratio, transaction type weight value and business dimension ratio, system environment score and environmental dimension score.
[0169] Optionally, the processing path switching unit includes: a switching instruction execution module, used to execute a full switching instruction when the comprehensive score is greater than a preset score threshold; a heterogeneous environment switching module, used to switch the operating environment of the operation failure event from the first type of financial disaster recovery heterogeneous environment to the second type of financial disaster recovery heterogeneous environment when the current operating environment is the first type of financial disaster recovery heterogeneous environment; a processing path switching module, used to switch the processing path of the operation failure event to the optimal processing path; and a transaction compensation module, used to call a preset compensation framework to perform data compensation for incomplete transactions.
[0170] The aforementioned financial operation fault path switching device may also include a processor and a memory. The aforementioned transaction parsing unit 51, verification point implantation unit 52, fault type determination unit 53, operation difference calculation unit 54, and processing path switching unit 55 are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0171] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, disaster recovery in a dual-active heterogeneous financial environment can be achieved based on atomic-level quantum verification and multi-dimensional decision-making.
[0172] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0173] Example 3
[0174] Embodiments of this application may provide an electronic device. Figure 6 This is a structural block diagram of an electronic device for performing a financial operation fault path switching method according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6(Only one is shown) Processor 602, memory 604, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0175] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the financial operation fault path switching method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned financial operation fault path switching method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0176] The processor can access information and applications stored in memory via a transmission device to execute the following steps: Parse the SQL statements in the target financial transaction to obtain a set of atomic operation units, where the SQL statements include database operations to be executed and pre-sent to the target database. The set of atomic operation units includes N atomic operation units, where N is a positive integer; embed quantum checkpoints in each atomic operation unit; use the quantum checkpoints to verify the database operation and determine the fault type based on the verification results; use the quantum checkpoints to capture and compare the operation results of the database operation in two heterogeneous financial disaster recovery environments to obtain the operation difference degree; determine the operation fault event based on the fault type and the operation difference degree, calculate the comprehensive score of the operation fault event in multiple dimensions, select the optimal processing path to be switched and the target heterogeneous financial disaster recovery environment based on the comprehensive score, and switch the processing path of the operation fault event to the optimal processing path in the target heterogeneous financial disaster recovery environment.
[0177] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.
[0178] Those skilled in the art will understand that all or part of the steps in the various financial operation fault path switching methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0179] Example 4
[0180] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the financial operation fault path switching method provided in Embodiment 1.
[0181] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute any of the financial operation fault path switching methods in the first embodiment above.
[0182] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0183] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the financial operation fault path switching method described in various embodiments of this application.
[0184] This application also provides a computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the financial operation fault path switching method described in various embodiments of this application.
[0185] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0186] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0187] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0188] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0189] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0190] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0191] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for switching fault paths in financial operations, characterized in that, This is applied to a financial business system comprising two distinct heterogeneous financial disaster recovery environments, each capable of independently processing financial business requests, including: The SQL statements in the target financial transaction are parsed to obtain a set of atomic operation units. The SQL statements include database operations to be executed and sent to the target database. The set of atomic operation units includes N atomic operation units, where N is a positive integer. A quantum checkpoint is implanted in each of the atomic operation units; The quantum verification points are used to verify database operations, and the fault type is determined based on the verification results. The quantum verification point is used to capture and compare the operation results of database operations in two heterogeneous financial disaster recovery environments to obtain the degree of operation difference. Based on the fault type and the operational difference, an operational fault event is determined, and a comprehensive score of the operational fault event in multiple dimensions is calculated. Based on the comprehensive score, the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment are selected, and the processing path of the operational fault event is switched to the optimal processing path in the target financial disaster recovery heterogeneous environment.
2. The path switching method according to claim 1, characterized in that, The steps for parsing the SQL statements in a target financial transaction to obtain a set of atomic operation units include: Before the database operation is executed, the SQL statement to be executed sent to the target database is intercepted through a preset monitoring interface; The SQL statements in the target financial transaction are decomposed using an atomic transaction parser to obtain the transaction parsing results; If the operation type in the transaction parsing result indicates that the SQL statement contains a balance update statement, it is marked as a balance update operation unit; If the operation type in the transaction parsing result indicates that the SQL statement contains a pipeline creation statement, it is marked as a pipeline creation operation unit; The atomic operation unit set is obtained by combining the balance update operation unit, the transaction creation operation unit, and other atomic operation units to be executed.
3. The path switching method according to claim 2, characterized in that, After parsing the SQL statements in the target financial transaction to obtain the set of atomic operation units, the process also includes: In the current operating environment, which is a heterogeneous financial disaster recovery environment of type I, the data type of the SQL statement is converted to complete the heterogeneous environment database syntax adaptation process.
4. The path switching method according to claim 1, characterized in that, The step of embedding a quantum checkpoint in each of the atomic operation units includes: Lightweight verification nodes are implanted at key nodes of the execution path in each atomic operation unit to complete the operation of implanting quantum verification points.
5. The path switching method according to claim 1, characterized in that, The steps of performing database operation verification using the quantum verification point and determining the fault type based on the verification result include: Construct a verification SQL statement, and use the verification SQL statement to concatenate all fields of the target table in the databases of the two financial disaster recovery heterogeneous environments into a string according to a predetermined format, resulting in two strings; For each string, a checksum is generated using a preset data transmission error detection algorithm; Based on the two generated check codes, it is determined whether the operation data of the database operation is consistent. If they are inconsistent, it is determined that the data fingerprints of the two financial disaster recovery heterogeneous environments detected by the quantum check point do not match, and the fault type is determined to be data inconsistency. The response time of the database operation is detected, and if the response time exceeds a preset response time threshold, the fault type is determined to be system performance degradation. Send a heartbeat detection command, and if the duration of consecutive failed heartbeat detections exceeds a preset heartbeat detection threshold, determine that the fault type is system crash.
6. The path switching method according to claim 1, characterized in that, The step of capturing and comparing the operational results of database operations in two heterogeneous financial disaster recovery environments using the quantum verification point to obtain the operational difference includes: Obtain the first operation result of the database operation in a first type of financial disaster recovery heterogeneous environment, and obtain the second operation result of the database operation in a second type of financial disaster recovery heterogeneous environment; Extract the field values of a predetermined number of records from the first operation result and the field values of a predetermined number of records from the second operation result; Compare the field values of a predetermined number of records in the first operation result with the field values of a predetermined number of records in the second operation result to obtain the field value comparison result; For all records where the field values comparison results indicate inconsistencies, calculate the absolute value of the difference, sum all the absolute values of the difference, and obtain the total field difference. Based on the sum of the differences in the fields and the maximum error baseline value allowed by the system, the operational difference degree is calculated using a preset difference analysis algorithm.
7. The path switching method according to claim 1, characterized in that, The steps of determining operational failure events based on the failure type and the operational difference degree, and calculating a comprehensive score for the operational failure event across multiple dimensions, include: The severity of the fault in the fault dimension is determined based on the fault type and the numerical range of the operational difference. Obtain the priority of the financial transaction type corresponding to the target financial transaction, and determine the transaction type weight value in the business dimension based on the priority; Detect the current operating environment's health status and determine the system environment score based on the health status. Based on the severity of the fault and the proportion of the fault dimension, the weight value of the transaction type and the proportion of the business dimension, the system environment score and the environment dimension score, the comprehensive score of the operation failure event in multiple dimensions is calculated.
8. The path switching method according to claim 1, characterized in that, The steps of selecting the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment based on the comprehensive score, and switching the processing path of the operational failure event to the optimal processing path in the target financial disaster recovery heterogeneous environment, include: If the overall score is greater than a preset score threshold, execute a full switch command; If the current operating environment is a Class I financial disaster recovery heterogeneous environment, the operating environment of the operation failure event will be switched from the Class I financial disaster recovery heterogeneous environment to the Class II financial disaster recovery heterogeneous environment. Switch the processing path for the operational failure event to the optimal processing path; Invoke the preset compensation framework to perform data compensation for incomplete transactions.
9. A financial operation fault path switching device, characterized in that, This is applied to a financial business system comprising two distinct heterogeneous financial disaster recovery environments, each capable of independently processing financial business requests, including: The transaction parsing unit is used to parse the SQL statements in the target financial transaction to obtain a set of atomic operation units. The SQL statements include database operations to be executed and sent to the target database. The set of atomic operation units includes N atomic operation units, where N is a positive integer. A checkpoint implantation unit is used to implant quantum checkpoints in each of the atomic operation units; The fault type determination unit is used to perform database operation verification using the quantum verification point and determine the fault type based on the verification result. The operation difference calculation unit is used to capture and compare the operation results of database operations in two heterogeneous financial disaster recovery environments using the quantum verification point to obtain the operation difference. The processing path switching unit is used to determine the operation failure event based on the failure type and the operation difference degree, calculate the comprehensive score of the operation failure event in multiple dimensions, select the optimal processing path to be switched and the target financial disaster recovery heterogeneous environment according to the comprehensive score, and switch the processing path of the operation failure event to the optimal processing path in the target financial disaster recovery heterogeneous environment.
10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the financial operation fault path switching method according to any one of claims 1 to 8.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the financial operation fault path switching method according to any one of claims 1 to 8.