A security clearing cross-mode abnormal rollback method and device
By implementing system isolation, data backup, and differentiated migration in the event of an anomaly in the in-memory clearing mode, a smooth rollback from the in-memory clearing mode to the over-the-counter clearing mode is achieved. This solves the security and efficiency issues of cross-mode rollback in existing technologies, ensuring the stability of securities clearing business and meeting regulatory requirements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGJIANG SECURITIES
- Filing Date
- 2026-06-30
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies cannot achieve safe, efficient, and low-risk cross-mode rollback when the memory liquidation mode is abnormal. They cannot adapt to abnormal scenarios on any trading day after the switch. Furthermore, traditional rollback solutions are time-consuming, have a wide impact, and pose risks of data loss and system conflicts.
By pre-judging the memory liquidation mode, isolating the system, backing up data, migrating data differently, and decoupling the architecture, a smooth rollback from the memory liquidation mode to the counter liquidation mode can be achieved, ensuring data security and system stability, and supporting rollback operations at any point in time.
It enables safe, efficient, and low-risk cross-mode rollback in the event of memory clearing anomalies, ensuring the continuity and stability of securities clearing operations, meeting the timeliness requirements of financial regulation, and reducing system transformation and maintenance costs.
Smart Images

Figure CN122492349A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of securities data processing technology, and in particular to a method and apparatus for cross-mode abnormal rollback in securities clearing. Background Technology
[0002] In the securities trading market, the clearing system is the core infrastructure for ensuring the settlement of funds and shares. Its operational stability is directly related to the rights and interests of investors and the order of the financial market. Currently, the securities industry generally adopts a business model of intraday trading and end-of-day clearing. During the day, investors initiate transactions and generate transaction data through various channels. At the end of the day, the clearing system completes the offsetting, settlement, and clearing of funds and shares based on the settlement documents issued by the exchange and China Securities Depository and Clearing Corporation Limited, and completes the reporting of regulatory data.
[0003] To address the pressure on clearing efficiency brought about by the expansion of trading volume and the diversification of business products, the industry is gradually upgrading from the traditional over-the-counter (OTC) clearing model to an in-memory clearing model. The OTC clearing model completes the clearing logic entirely in the physical database, a mature and stable technology, but its clearing efficiency is limited by database read / write performance. The in-memory clearing model, on the other hand, synchronizes basic data to an in-memory database, completes the clearing logic entirely in memory, and then writes the results back to the physical database after clearing. This can improve clearing efficiency several times over the OTC model and has become the mainstream direction for technological upgrades in the industry. However, after the switch to the clearing model, the in-memory clearing model may encounter problems in actual operation, such as hardware failures, software program anomalies, middleware failures, and database connection anomalies, which may prevent the clearing process from proceeding normally. If these issues are not addressed promptly, they will directly affect the daily clearing loop, the deadline for regulatory data reporting, and may even prevent the market from opening normally on the next trading day. Existing rollback solutions for clearing anomalies have three major flaws: First, traditional full database rollback solutions are time-consuming and have a wide impact, easily leading to the loss of cross-time business data such as after-hours trading and 24 / 7 bank-securities transfers, resulting in a very high risk of business interruption; Second, existing solutions only support rollback on the day of clearing mode switch, and cannot adapt to memory clearing anomaly scenarios on any trading day after the switch, resulting in limited emergency measures; Third, there is no adaptation mechanism designed for the heterogeneous architecture of counter and memory clearing, and there are no clear safe rollback boundaries, so forced rollback can easily cause data chaos, system conflicts, and other problems.
[0004] In summary, existing technologies cannot solve the problem of smooth, low-risk rollback when memory liquidation anomalies occur after liquidation mode switching. There is an urgent need for a cross-mode anomaly rollback solution that is adaptable to heterogeneous architectures, does not affect normal business operations, and can be executed at any time after the switch. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the above-mentioned background technology and provide a method and apparatus for cross-mode anomaly rollback in securities clearing, enabling safe, efficient and low-risk cross-mode rollback when memory clearing mode is abnormal, enriching the emergency handling means for memory clearing anomalies, ensuring the continuity and stability of securities clearing business, and meeting the timeliness requirements of financial supervision for clearing data reporting and transaction settlement.
[0006] This invention provides a cross-mode anomaly rollback method for securities clearing, comprising the following steps: S1. Preliminary judgment on whether there are anomalies in the in-memory clearing mode. If so, further verification is performed to determine whether it is within the rollback window period. If it is within the rollback window period, the rollback operation is executed; S2. Isolation of the in-memory clearing system from other securities systems, and backup of the core business data tables of the securities clearing system to ensure data security; S3. Migration operation of the in-transit data in the in-memory clearing mode, migrating all data in the in-transit data tables involved in the in-memory clearing process to the corresponding in-transit data tables involved in the counter clearing mode, ensuring that the counter clearing mode obtains complete clearing basic data after the rollback; S4. Decoupling the overall architecture of the in-memory clearing system from the securities clearing system and restoring the core clearing logic of the securities clearing system to the counter clearing mode.
[0007] In the above technical solution, the specific steps of step S1 are as follows: S11, if the memory liquidation mode simultaneously meets the two conditions of severe abnormality and ineffective conventional repair, the subsequent rollback program is started if the conditions are met; otherwise, the fault is investigated and repaired in memory liquidation mode, and the liquidation for the day is completed. S12, if the memory liquidation mode has executed the liquidation and accounting steps and completed the update of the core physical database table, the rollback program is terminated if it has been executed; if it has not been executed, it is determined that the rollback window period is available for subsequent rollback operations.
[0008] In the above technical solution, the logic for determining whether the memory clearing mode has executed the clearing and accounting steps and completed the update of the core physical database table in step S12 is as follows: First, determine whether all operations of the memory clearing mode are in the preprocessing or trial calculation stage; Second, no update operation has been performed on the core physical database table of the counter system.
[0009] In the above technical solution, the specific steps of step S2 are as follows: S21, close all access interfaces between the memory clearing system and other securities systems to achieve isolation between the memory clearing system and other securities systems; S22, perform a full backup operation on the core business data tables of the securities clearing system to form a complete and persistent backup file.
[0010] In the above technical solution, in step S21, the core business data table includes an in-transit data table, a clearing flow table, an intraday trading table, an account table, and a holding data table that store investors' transaction data, fund information, key shareholding data.
[0011] In the above technical solution, the specific process of step S3 is to classify the data in transit into three categories based on the structural differences between the in-memory clearing mode and the counter clearing mode: automatic reuse, configuration adaptation, and script migration. Differentiated migration strategies are adopted to ensure the accuracy and completeness of data migration. The specific migration strategies are as follows: Automatic reuse: For in-transit data with completely identical table structures, field definitions, and data storage formats between the in-memory clearing mode and the counter clearing mode, no processing is required, and it can be directly reused by the counter clearing mode. Configuration adaptation: For in-transit data with basically identical table structures, requiring only adjustments to some data formats, field values, or return rules for reuse, a unified configuration through a rollback program is used to automate data format conversion and rule adaptation. Script migration: For in-transit data with significant differences in table structures but clear mapping relationships between fields, a developed general migration script is used to extract and transform data based on the field mapping relationships to achieve cross-table migration.
[0012] In the above technical solution, the specific steps of step S4 are as follows: S41: Decouple the memory clearing mode from all binding relationships between the core securities business library and other securities systems, thereby decoupling the memory clearing mode from the overall architecture of the securities clearing system; S42: Disable the configuration set of the memory clearing system and enable the configuration set of the counter clearing mode. The switching of the clearing logic is completed by switching the configuration set, so that the core clearing logic of the securities clearing system is restored to the counter clearing mode.
[0013] In the above technical solution, the specific operations of removing the binding relationship between the memory clearing mode and the securities core business database and other securities systems in step S41 include: deleting all system deployment records of the memory clearing mode in the securities core business database; unbinding all interface association configurations between the memory clearing mode and other securities systems; clearing all running processes of the memory clearing mode and releasing system resources; and disconnecting the dedicated data synchronization link between the memory clearing mode and the securities core business database.
[0014] The above technical solution also includes step S5, which initiates the counter clearing mode and serves as the target clearing mode. The counter clearing mode completes the settlement of securities funds, share settlement and clearing results verification for the day, as well as the reporting of regulatory data to the stock exchange, China Securities Depository and Clearing Corporation Limited (CSDC) and financial regulatory agencies.
[0015] The present invention also provides a securities clearing cross-mode abnormal rollback device, which has a computer program that can execute the securities clearing cross-mode abnormal rollback method.
[0016] The cross-mode abnormal rollback method and apparatus for securities clearing of the present invention have the following beneficial effects: 1. Breaking through the limitations of rollback scenarios and covering the entire lifecycle of mode switching, it not only supports rollback on the same day of switching, but can also adapt to memory liquidation anomaly scenarios on any trading day after the switch is completed, completely solving the core pain point of limited rollback scenarios in existing technologies; 2. Accurately define the safe rollback window period, and only perform the rollback before the core data is written to the physical database. The core business database tables are not modified throughout the process, which avoids the risk of full database rollback from the root and ensures that cross-time business such as night market entrustment and 24 / 7 bank-securities transfer is not affected. 3. Adapts to heterogeneous clearing architectures, achieving a smooth transition from in-memory clearing to counter clearing through differentiated in-transit data migration strategies and a comprehensive system decoupling solution, without data interference or system conflicts; 4. Adopting a configurable and modular design, it can adapt to the personalized clearing architecture of different securities firms without requiring code or architecture modifications to the core systems of counter clearing and in-memory clearing, greatly reducing system modification and maintenance costs, and has broad industry applicability. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall process of Embodiment 1 of the cross-mode abnormal rollback method for securities clearing of the present invention; Figure 2 This is a hardware structure diagram of Embodiment 2 of the cross-mode abnormal rollback method for securities clearing of the present invention; Figure 3 This is a logical diagram of the counter clearing mode and the memory clearing mode in Embodiment 2 of the cross-mode abnormal rollback method for securities clearing of the present invention; Figure 4 This is a schematic diagram of the main process of the memory clearing mode in Embodiment 2 of the cross-mode abnormal rollback method for securities clearing of the present invention; Figure 5 This is a schematic diagram of the overall process of Embodiment 2 of the cross-mode abnormal rollback method for securities clearing of the present invention; Figure 6 This is a schematic diagram of the architecture of the securities clearing cross-mode abnormal rollback device of the present invention; Figure 7 This is a schematic diagram of the architecture of the securities clearing cross-mode abnormal rollback device of the present invention; Figure 8 This is a schematic diagram of the architecture of the storage medium of the present invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments, but these embodiments should not be construed as limiting the present invention.
[0019] Based on its primary objective, this invention proposes a method, apparatus, device, and storage medium for cross-mode anomaly rollback in securities clearing. It aims to address the problems of existing clearing systems, which, when switching from counter clearing mode to in-memory clearing mode, only support rollback to counter clearing mode on the day of the switch and cannot adapt to anomaly rollback requirements on any trading day after the switch. Furthermore, traditional rollback solutions are time-consuming, risky, and have poor adaptability to heterogeneous architectures. This invention achieves safe, efficient, and low-risk cross-mode rollback in case of anomalies in in-memory clearing mode, enriches emergency handling methods for in-memory clearing anomalies, ensures the continuity and stability of securities clearing operations, and meets the timeliness requirements of financial regulators for clearing data reporting and transaction settlement.
[0020] Another objective of this invention is to precisely define the safe rollback window period for the in-memory clearing mode, thereby avoiding modifications to core business data during the rollback process and fundamentally mitigating the risk of a full database rollback. This ensures that normal business operations such as night trading and 24 / 7 bank-securities transfers are not affected. Simultaneously, through a configurable and modular design, it is possible to adapt to the personalized clearing system architecture of different securities firms without modifying the core code and architecture of the counter clearing and in-memory clearing systems, significantly reducing the system modification and maintenance costs for securities firms.
[0021] Example 1 See Figure 1 To achieve the aforementioned objectives, this invention provides a method for cross-mode anomaly rollback in securities clearing. Based on the architectural characteristics of the in-memory clearing mode, this method defines safe rollback conditions through a two-layer anomaly scenario verification process. Then, through steps such as system decoupling, data backup, data migration, and configuration switching, it achieves a smooth rollback from the in-memory clearing mode to the over-the-counter clearing mode. The entire process does not modify core business database tables, does not affect normal cross-time business, and can be executed on any trading day after the mode switch. Specifically, it includes the following steps: Step 1: Memory liquidation mode anomaly detection Determine whether the in-memory clearing mode is unable to start or advance the clearing process normally due to hardware failure, software anomaly, middleware failure, database connection anomaly, etc., and whether the problem cannot be resolved after conventional repair methods such as backup machine switching, configuration adjustment, and program rollback. This anomaly may affect the completion of the securities clearing loop on the same day and the normal opening of the next trading day.
[0022] The rollback process will be initiated only if both of the above conditions of severity of the anomaly and failure of conventional repair are met simultaneously; otherwise, the fault will be investigated and repaired in memory liquidation mode first, and the liquidation for the day will continue.
[0023] Step 2: Rollback Window Verification If step 1 determines that the memory clearing mode meets the preconditions for abnormal rollback, then it is further determined whether all operations in the memory clearing mode are in the preprocessing or trial calculation stage and no update operations are performed on the core daytime transaction table, account table and other physical database tables of the counter system.
[0024] If the memory liquidation has completed the liquidation and accounting steps and updated the core physical database tables, the rollback process will be terminated; if the above operations have not been performed, it is determined that it is in a safe rollback window and the rollback operation can be performed.
[0025] Step 3: Shut down the access interface and isolate the fallback environment. If step 2 determines that a rollback operation can be performed, first shut down all access interfaces between the memory clearing mode and the securities peripheral system to avoid interference from newly added business data during the rollback process, and to ensure the stability and independence of the rollback environment.
[0026] This step completely isolates the memory clearing mode from the securities peripheral system by shutting down all access interfaces, ensuring that the rollback process is carried out in an independent environment free from new data interference, thus guaranteeing the smooth execution of the rollback operation from the source.
[0027] Step 4: Back up core business data tables to ensure data security. Before performing the formal rollback operation, a full backup operation is performed on the core business data tables of the securities clearing system to form a complete backup file and store it persistently to fully ensure the security of clearing data.
[0028] Core business data tables refer to the core data carriers of securities clearing operations. These include the in-transit data table (recording funds and shares not yet settled during the clearing process), the clearing log table (recording all operational flows and processing records during the clearing process), the intraday trading table, the account table, and the position data table. These data tables store key data such as investors' trading data, fund information, and shareholdings, serving as the core guarantee for clearing operations and investor rights. During the rollback process, even after a defined safe rollback window, a full backup of the core business data tables is still required. This is to prevent data loss or corruption due to human error, system anomalies, or other unforeseen circumstances during the rollback operation; and to ensure that core data can be quickly restored from the backup files in case of problems during the rollback operation, minimizing business risks.
[0029] Step 5: Migrate and clear in-transit data to achieve data adaptation. Migrate the data in transit for the memory clearing mode, accurately migrate all data in the data in transit tables involved in the memory clearing process to the corresponding data in transit tables involved in the counter clearing mode, and ensure that the counter clearing mode can obtain complete clearing basic data after rollback.
[0030] Based on the structural differences between in-memory clearing and counter clearing data tables, this invention categorizes in-transit data into three types and employs differentiated migration strategies to ensure the accuracy and integrity of data migration. The specific migration strategies are as follows: Automatic Reuse Class: For in-transit data with completely identical table structure, field definitions, and data storage formats between the in-memory clearing mode and the counter clearing mode, no additional processing is required, and the data can be directly reused by the counter clearing mode; Configuration adaptation type: For data in transit with basically the same data table structure, only some data format, field values or return rules need to be adjusted for reuse, a unified configuration is performed through the rollback program, and the system automatically completes the data format conversion and rule adaptation to achieve automated processing; Script-based migration: For data in transit with significant differences in table structure but clear mapping relationships between fields, a general migration script can be developed to extract and transform the data based on the field mapping relationship, achieving accurate cross-table migration.
[0031] Through the aforementioned differentiated migration strategy, this invention can ensure that all in-transit data in memory clearing is completely and accurately migrated to the corresponding data table in counter clearing, providing complete data support for the normal start-up and accurate clearing of the counter clearing mode.
[0032] Step 6: Decouple the system binding relationship to achieve memory clearing and decoupling. The memory clearing mode is decoupled from the core securities business database and peripheral systems, ensuring that the memory clearing mode is completely decoupled from the overall architecture of the securities clearing system and no longer affects any operation of the system.
[0033] The unbinding operation in this step specifically includes: deleting all system deployment records for the memory clearing mode from the core business database; unbinding all interface association configurations between the memory clearing mode and surrounding systems; clearing all running processes of the memory clearing mode and releasing system resources; and disconnecting the dedicated data synchronization link between the memory clearing mode and the core business database. Through the above operations, the memory clearing mode and the securities clearing system are completely decoupled, clearing the way for the launch of the over-the-counter clearing mode.
[0034] Step 7: Switch the liquidation configuration set to complete the liquidation logic switch. Disable all relevant configuration sets for memory clearing mode and enable configuration sets for counter clearing mode. By switching configuration sets, the clearing logic is completely switched, and the core clearing logic of the securities clearing system is restored to counter clearing mode.
[0035] The configuration sets for in-memory clearing mode and counter clearing mode are independent of each other, each corresponding to its own clearing logic and operational requirements. This step ensures that the in-memory clearing configuration set is no longer called by the clearing system by disabling it; at the same time, it enables the counter clearing configuration set, so that all operations of the clearing system follow the configuration requirements and clearing logic of counter clearing, thus achieving a complete switch of clearing modes at the configuration level.
[0036] Step 8: Activate counter clearing mode to complete the normal clearing process. After completing all the above-mentioned rollback preparation operations, the over-the-counter clearing mode will be officially launched and used as the target clearing mode. The over-the-counter clearing mode will complete all business on the same day, including securities fund settlement, share settlement, clearing result verification, and reporting of regulatory data to the stock exchange, China Securities Depository and Clearing Corporation Limited (CSDC), and financial regulatory agencies, in accordance with the normal clearing process of the securities industry. This will ensure the closed-loop completion of the clearing business on the same day and guarantee the normal opening of the market on the next trading day.
[0037] Example 2 Reference Figure 2 , Figure 2 This is a schematic diagram of the liquidation and rollback device structure of the hardware operating environment involved in the embodiments of the present invention.
[0038] like Figure 2 As shown, the liquidation rollback device may include: a processor, such as a central processing unit (CPU), a communication bus, peripheral interfaces, a network interface, and memory.
[0039] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.
[0040] Peripheral interfaces may include a display screen, input units such as a keyboard, and may also include standard wired and wireless interfaces. Network interfaces may optionally include standard wired and wireless interfaces (such as Wireless-Fidelity (Wi-Fi) interfaces).
[0041] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0042] The processor can be a general-purpose processor, which can call the clearing rollback program stored in memory and execute the clearing rollback method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the clearing rollback program is called can be referred to in the various embodiments of the transaction volume anomaly detection method of this application, and will not be repeated here.
[0043] Those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the liquidation rollback equipment and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0044] Figure 3 This is a logical diagram of counter clearing and memory clearing. These two systems are the main components of our implementation. For ease of explanation, only the parts relevant to this embodiment are shown.
[0045] See Figure 3 As shown, counter clearing and in-memory clearing are relatively independent. Before clearing, daytime transaction data is synchronized to in-memory clearing via data synchronization, and the relevant clearing logic is completed in in-memory clearing. Finally, the result data is written back to counter clearing and merged with the result data from other modules in counter clearing for processing. Functionally, in-memory clearing can replace some processes of counter clearing. In this embodiment, after switching from counter clearing to in-memory clearing, the original securities clearing process, margin trading clearing process, and over-the-counter clearing process are replaced.
[0046] Furthermore, the clearing process can be divided into several sub-modules, mainly including: securities clearing process, margin trading clearing process, over-the-counter clearing process, options clearing process, securities lending and borrowing clearing process, account clearing process, market close processing, historical data return, and initialization. All the above business data are customer behavior data generated during the day. At the end of the day, the data recorded in the system needs to be compared with the data from the exchange and the clearing and settlement company. Once the comparison is consistent, the actual settlement of customer funds and assets is completed.
[0047] Figure 4 This is a schematic diagram of the main workflow at the end of the in-memory liquidation day, which mainly includes the following steps: liquidation preparation, data synchronization, file transfer, liquidation processing, liquidation posting, and post-liquidation processing. Among them, the liquidation posting step is the key node for determining whether cross-mode rollback can be performed: before this step is executed, all operations of in-memory liquidation are completed in the in-memory database, and no data is written to the physical database of the counter system, which is within the safe rollback window. Once this step is executed, the physical database will be updated, and the rollback operation cannot be performed.
[0048] This invention provides a method for cross-mode abnormal rollback in securities clearing, referring to... Figure 5 , Figure 5 This is a flowchart illustrating Example 2 of the cross-mode abnormal rollback implementation of the securities clearing method of the present invention.
[0049] In this embodiment, T-1 is the official switchover day from counter clearing mode to memory clearing mode. After the switchover on T-1, the clearing and settlement of T-1 day's data has been completed through memory clearing, and the intraday trading session on T day runs normally.
[0050] Step 1: After the market closes on day T, the in-memory liquidation process is officially initiated. After completing the liquidation preparation, data synchronization, and file transfer steps, a node in the in-memory database cluster crashes during the liquidation processing, causing the liquidation process to be interrupted and unable to proceed. The operations and maintenance personnel immediately performed routine repairs: first restarting the crashed node, then performing a standby switch, but found that the routine repair methods were ineffective. With the approval of the liquidation manager, the cross-mode rollback process of this invention was initiated. Step 2: Perform window period verification. Confirm that the in-memory clearing is currently in the clearing process stage and the clearing posting step has not been executed by using the clearing process node marker. At the same time, retrieve the operation logs of the core business database and check to confirm that there are no write operations from the in-memory clearing system in the core physical database tables such as the intraday transaction table, customer account table, and fund holding table. The verification passes and it is confirmed that the system is in the safe rollback window period.
[0051] Step 3: Close the peripheral access of the memory clearing system and the trading system, and confirm that no new data is flowing in; at the same time, perform snapshot backups on the 9 core business data tables of the core business database.
[0052] Step 4: Perform tiered migration of in-transit data according to the pre-configured migration rules. There is one data table for automatic reuse, with a completely consistent table structure and fields. It is directly marked as reused and does not require migration. There are two data tables for configuration adaptation, which only require adjustment of the back-to-database configuration. The format conversion is automatically completed through the pre-configured rules. There are six data tables for script migration, with different table structures. Field mapping and data migration are completed through the pre-configured migration scripts.
[0053] Step 5: Delete the deployment record for memory liquidation in the core business database, unbind all interface association configurations, terminate all running processes of memory liquidation, release system ports and resources, and disconnect the synchronization link between the memory database and the core business database. Simultaneously execute the configuration set switch, disabling the full configuration set of memory liquidation mode in the configuration management center and enabling the standard production configuration set of counter liquidation mode.
[0054] Step 6: Officially launch the over-the-counter clearing mode. Based on the original core business data and the migrated in-transit data, execute a standardized end-of-day clearing process to complete full clearing, fund settlement, and share settlement. The clearing results are consistent with the settlement documents issued by the exchange and China Securities Depository and Clearing Corporation Limited (CSDC), with a 100% reconciliation pass rate. All regulatory data reporting is completed, and the daily clearing business is closed-loop. There is no data loss or any data anomalies in the rollback process for night market orders and 24 / 7 bank-securities transfers.
[0055] Example 3 See Figure 6 To achieve the aforementioned objectives, this invention also proposes a cross-mode anomaly rollback device for securities clearing. Based on a modular design concept, this device comprises multiple functional modules that cooperate and work together to achieve cross-mode rollback functionality in case of anomalies in the memory clearing mode. It can be directly deployed on the server of a securities clearing system, adapting to the existing IT system architecture of the securities industry without requiring modification of the core system code. Specifically, the device includes four core modules: a counter clearing module, a memory clearing module, a clearing anomaly judgment module, and a clearing rollback module. The functions and working principles of each module are as follows: Over-the-counter clearing module: Used to perform end-of-day clearing of intraday transaction data using the over-the-counter clearing mode; In-memory clearing module: Used to perform end-of-day clearing using in-memory clearing mode on intraday transaction data; Liquidation Anomaly Detection Module: Used to perform memory liquidation anomaly detection in step 1 and rollback window period verification in step 2, and output the result of whether the rollback process can be started; The liquidation rollback module is used to perform the full rollback operation from step 3 to step 8 after determining that a rollback is feasible, thus completing the switch from memory liquidation mode to counter liquidation mode.
[0056] Example 4 See Figure 7 To achieve the aforementioned objectives, this invention also proposes a securities clearing cross-mode anomaly rollback device. This device is a dedicated hardware device for a securities clearing system and serves as the hardware carrier for the cross-mode anomaly rollback method and apparatus described in this invention. It can realize functions such as running the clearing rollback program, storing clearing data, and interacting with the clearing system. Specifically, the device includes a memory, a processor, and a clearing rollback program stored in the memory and capable of running on the processor. The clearing rollback program is configured to implement all the steps of the securities clearing cross-mode anomaly rollback method described above.
[0057] Example 5 In addition, see Figure 8To achieve the above objectives, the present invention also proposes a storage medium storing a liquidation rollback program, wherein the liquidation rollback program, when executed by a processor, implements the steps of the liquidation rollback method as described above.
[0058] The securities clearing cross-mode anomaly rollback method, apparatus, equipment, and storage medium proposed in this invention address the core defects of existing technologies and combine the architectural characteristics of the in-memory clearing mode with the business needs of the securities industry. It achieves a smooth and low-risk cross-mode rollback of the securities clearing mode from in-memory clearing to over-the-counter clearing, and has significant technical advantages and business value.
[0059] Moreover, compared with existing technologies, this invention significantly improves the efficiency of emergency handling of clearing anomalies, reducing the original operation time of several hours for full database rollback to minutes. At the same time, it completely solves the pain point that existing technologies only support rollback on the same day, realizing abnormal rollback on any trading day. This provides reliable emergency protection for securities firms' clearing business, while significantly reducing the system transformation and maintenance costs of securities firms, and has significant practical application value.
[0060] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0061] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
Claims
1. A method for cross-mode abnormal rollback in securities clearing, characterized in that: Includes the following steps: S1. Make a preliminary judgment on whether there are any abnormal issues in the memory liquidation mode. If there are, further verify whether it is in the rollback window period. If it is in the rollback window period, execute the rollback operation. S2. Isolate the in-memory clearing system from other securities systems and back up the core business data tables of the securities clearing system to ensure data security; S3. Perform a migration operation on the in-transit data of the memory clearing mode, and migrate all the data in the in-transit data table involved in the memory clearing process to the corresponding in-transit data table involved in the counter clearing mode, so as to ensure that the counter clearing mode obtains complete clearing basic data after rollback. S4. Decouple the memory clearing system from the overall architecture of the securities clearing system and restore the core clearing logic of the securities clearing system to the counter clearing mode.
2. The cross-mode abnormal rollback method for securities clearing according to claim 1, characterized in that: The specific steps of step S1 are as follows: S11. If the memory liquidation mode simultaneously meets the two conditions of severe abnormality and ineffective conventional repair, the subsequent rollback procedure will be started if the conditions are met. Otherwise, the fault will be investigated and repaired in memory liquidation mode, and the liquidation of the day will continue to be completed. S12. Determine whether the memory liquidation mode has executed the liquidation and accounting steps and completed the update of the core physical database table. If it has, terminate the rollback process. If it has not, determine that it is a rollback window period and subsequent rollback operations can be performed.
3. The cross-mode abnormal rollback method for securities clearing according to claim 2, characterized in that: In step S12, the logic for determining whether the memory clearing mode has executed the clearing and accounting steps and completed the update of the core physical database table is as follows: First, determine whether all operations of the memory clearing mode are in the preprocessing or trial calculation stage; Second, no update operation has been performed on the core physical database table of the counter system.
4. The cross-mode abnormal rollback method for securities clearing according to claim 3, characterized in that: The specific steps of step S2 are as follows: S21. Close all access interfaces between the memory clearing system and other securities systems to achieve isolation between the memory clearing system and other securities systems; S22. Perform a full backup operation on the core business data tables of the securities clearing system to form a complete and persistent backup file.
5. The cross-mode abnormal rollback method for securities clearing according to claim 4, characterized in that: In step S21, the core business data table includes an in-transit data table, a clearing flow table, an intraday trading table, an account table, and a holding data table that store investors' transaction data, fund information, key shareholding data.
6. The cross-mode abnormal rollback method for securities clearing according to claim 5, characterized in that: The specific process of step S3 involves classifying the data in transit into three categories—automatic reuse, configuration adaptation, and script migration—based on the structural differences between the in-memory clearing mode and the counter clearing mode. A differentiated migration strategy is then employed to ensure the accuracy and integrity of the data migration. The specific migration strategy is as follows: Automatic Reuse Class: For in-transit data with completely identical table structure, field definitions, and data storage formats in both in-memory clearing mode and counter clearing mode, no processing is required and the data can be directly reused by counter clearing mode; Configuration adaptation class: For data in transit with basically the same data table structure, only some data format, field values or return rules need to be adjusted for reuse, the rollback program can be uniformly configured to realize the automated processing of data format conversion and rule adaptation; Script-based migration: For data in transit with significant differences in table structure but clear mapping relationships between fields, a general migration script can be developed to extract and transform data based on the field mapping relationships, thus achieving cross-table migration.
7. The cross-mode abnormal rollback method for securities clearing according to claim 6, characterized in that: The specific steps of step S4 are as follows: S41: Decouple the in-memory clearing mode from the core securities business database and other securities systems, thus decoupling the in-memory clearing mode from the overall architecture of the securities clearing system; S42: Disable the configuration set of the memory clearing system and enable the configuration set of the counter clearing mode. The clearing logic is switched by switching the configuration set, so that the core clearing logic of the securities clearing system is restored to the counter clearing mode.
8. The cross-mode abnormal rollback method for securities clearing according to claim 7, characterized in that: In step S41, the specific operations for removing the binding relationship between the memory clearing mode and the securities core business database and other securities systems include: deleting all system deployment records of the memory clearing mode in the securities core business database; unbinding all interface association configurations between the memory clearing mode and other securities systems; clearing all running processes of the memory clearing mode and releasing system resources; and disconnecting the dedicated data synchronization link between the memory clearing mode and the securities core business database.
9. The cross-mode abnormal rollback method for securities clearing according to claim 8, characterized in that: It also includes step S5, initiating the over-the-counter clearing mode as the target clearing mode, whereby the over-the-counter clearing mode completes the settlement of securities funds, share settlement and clearing results verification for the day, as well as the reporting of regulatory data to the stock exchange, China Securities Depository and Clearing Corporation Limited (CSDC) and financial regulatory agencies.
10. A securities clearing cross-mode abnormal rollback device, comprising a computer program, characterized in that: The computer program is capable of executing the securities clearing cross-mode abnormal rollback method as described in any one of claims 1 to 9.