Memory data isolation storage method, distributed transaction system and program product
By using a tag allocation component and a business identifier routing mechanism in the transaction engine within a distributed transaction system, the problem of high hardware resource consumption caused by physical isolation of memory data is solved. This achieves logical isolation and efficient management, supports business expansion, and ensures data consistency and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-04-07
AI Technical Summary
In distributed transaction systems, the physical isolation of memory data leads to high hardware resource consumption and makes it difficult to manage and locate errors.
By adding business identifiers to external transaction requests through the tag allocation component, the transaction engine routes the requests to the corresponding business processing instance based on the identifiers, thereby achieving in-memory data logical isolation for different business types, and ensuring data consistency through monitoring and rollback components.
It enables requests from different business types to share physical devices and system environments, reducing resource waste, improving system scalability and data management efficiency, and ensuring data security and consistency.
Smart Images

Figure CN121233345B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to in-memory data isolation storage methods, distributed transaction systems, and application products. Background Technology
[0002] In distributed trading systems, to meet the latency requirements of rapid transactions, in-memory data structures are commonly used to manage and manipulate data during intraday trading. However, errors in in-memory data processing are difficult to observe intuitively. Unlike disk data, changes in in-memory data are instantaneous and lack intuitive visualization methods. Once an error occurs, it is difficult to quickly locate the problem. Furthermore, in financial transactions, the accurate recording of assets and the compliance of transactions are crucial. If in-memory data is accidentally tampered with, it may lead to problems such as asset overdraft and erroneous transaction execution, causing huge economic losses to investors and financial institutions.
[0003] Currently, physical isolation is commonly used to handle different business operations in order to solve the above problems. For example, spot trading and credit business are deployed on different physical component instances. However, the physical isolation method requires each business to have independent physical devices and system environments. Independent physical components need to be equipped with corresponding computing resources, storage resources and network resources. With the continuous expansion and innovation of financial business, new business types such as options and proprietary trading have emerged, making the memory data management architecture of distributed trading systems bloated and resource-intensive.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a memory data isolation storage method, a distributed trading system and program product, which aims to solve the technical problem of high hardware resource consumption caused by the use of memory data physical isolation in distributed trading systems.
[0006] To achieve the above objectives, this application proposes a memory-based data isolation storage method, which is applied to a distributed trading system. The distributed trading system includes a tag allocation component and a trading engine. The memory-based data isolation storage method includes:
[0007] The tag allocation component receives external transaction requests, adds a business identifier to the external transaction request based on the business type of the external transaction request to obtain a target transaction request, and sends the target transaction request to the transaction engine.
[0008] The transaction engine reads the account data corresponding to the account of the external transaction request from the target memory partition, and generates a transaction order carrying the business identifier based on the account data; wherein, the target memory partition is the memory partition corresponding to the business identifier among the various memory partitions of the business database;
[0009] The transaction engine executes the transaction orders according to the multi-level pipeline of the transaction orders, and obtains the transaction results based on the memory data in the target memory partition;
[0010] The transaction engine updates the memory data of the target memory partition based on the transaction results.
[0011] In one embodiment, the step of obtaining a target transaction request by adding a business identifier to the external transaction request based on the business type of the external transaction request through the tag allocation component includes:
[0012] The tag allocation component parses the field values of the preset encoded fields in the external transaction request and maps the field values to business identifiers according to the preset encoding rules.
[0013] The target transaction request is obtained by embedding the business identifier into the external transaction request through the tag allocation component.
[0014] In one embodiment, the step of executing the transaction order through the transaction engine according to the multi-level pipeline of the transaction order and obtaining the transaction result based on the memory data in the target memory partition includes:
[0015] The transaction engine assigns a unique serial number to the transaction order and binds the unique serial number to a message string instance.
[0016] The transaction order is executed based on the memory data in the target memory partition by following the order of the multi-level pipeline corresponding to the transaction order through the message string instance.
[0017] In one embodiment, the distributed transaction system further includes a monitoring and rollback component;
[0018] After the step of updating the memory data of the target memory partition based on the transaction result through the transaction engine, the method further includes:
[0019] The transaction engine obtains asset change data of the target memory partition and sends the asset change data to an external system.
[0020] When the monitoring and rollback component detects that the memory data in the target memory partition is inconsistent with the system data of the external system, it triggers a memory data rollback.
[0021] In one embodiment, the monitoring and rollback component includes a snapshot generation module and a data rollback module;
[0022] The memory data isolation storage method further includes:
[0023] The snapshot generation module generates data snapshots for each memory partition in the business database according to a preset period, and stores the data snapshots in the log storage area corresponding to each memory partition.
[0024] The step of triggering memory data rollback when the monitoring and rollback component detects inconsistencies between memory data in the target memory partition and system data of the external system includes:
[0025] When the data rollback module detects that the memory data in the target memory partition is inconsistent with the system data of the external system, it retrieves the most recent timestamp data snapshot from the log storage area corresponding to the business identifier and loads the most recent timestamp data snapshot into the target memory partition.
[0026] In one embodiment, the distributed transaction system further includes a business expansion component;
[0027] The memory data isolation storage method further includes:
[0028] When a new service type is detected, the new service identifier for the new service type is registered in the tag allocation component through the service extension component.
[0029] The business extension component creates a new memory partition in the business database that is bound to the new identifier, and registers the mapping relationship between the new identifier and the new memory partition in the transaction engine.
[0030] In addition, to achieve the above objectives, this application also provides a distributed trading system, which includes a token allocation component and a trading engine;
[0031] The tag allocation component is used to receive external transaction requests, add a business identifier to the external transaction request based on the business type of the external transaction request to obtain a target transaction request, and send the target transaction request to the transaction engine;
[0032] The transaction engine is used to read the account data corresponding to the account of the external transaction request from the target memory partition, and generate a transaction order carrying the business identifier based on the account data; wherein, the target memory partition is the memory partition corresponding to the business identifier in each memory partition of the business database;
[0033] The transaction engine is also used to execute the transaction order according to the multi-level pipeline of the transaction order, based on the memory data in the target memory partition, to obtain the transaction result;
[0034] The transaction engine is also used to update the memory data of the target memory partition based on the transaction results.
[0035] In one embodiment, the distributed transaction system further includes a monitoring and rollback component;
[0036] The transaction engine is also used to acquire asset change data of the target memory partition and send the asset change data to an external system;
[0037] The monitoring and rollback component is used to trigger memory data rollback when it is detected that the memory data in the target memory partition is inconsistent with the system data of the external system.
[0038] In one embodiment, the distributed transaction system further includes a business expansion component;
[0039] The business extension component is used to register a new business identifier for the new business type in the tag allocation component when a new business type is detected.
[0040] The business extension component is also used to create a new memory partition bound to the new identifier in the business database, and to register the mapping relationship between the new identifier and the new memory partition in the transaction engine.
[0041] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the memory data isolation storage method described above.
[0042] This application proposes a memory data isolation storage method. The method involves receiving an external transaction request through a tag allocation component, adding a business identifier to the external transaction request based on its business type to obtain a target transaction request, and sending the target transaction request to a transaction engine. The transaction engine then reads account data corresponding to the account in the external transaction request from a target memory partition and generates a transaction order carrying the business identifier based on the account data. The target memory partition is the memory partition in the business database corresponding to the business identifier. The transaction engine executes the transaction order according to a multi-level pipeline based on the memory data in the target memory partition to obtain a transaction result. Finally, the transaction engine updates the memory data in the target memory partition based on the transaction result.
[0043] Compared to physically isolating different services, this application's solution adds a service identifier to external transaction requests through a tag allocation component. The transaction engine routes the request to the corresponding service processing instance based on the identifier. Requests of different service types can share physical devices and system environments. The transaction engine reads data from the target memory partition corresponding to the service identifier, achieving logical isolation and efficient management of memory data for different services. There is no need to equip each service with independent physical resources. When expanding and innovating services, it is only necessary to register relevant information and create new memory partitions through the service extension component. This can support the addition of new service types, avoid resource waste, and make the system architecture simpler. Attached Figure Description
[0044] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a flowchart illustrating an embodiment of the memory data isolation storage method of this application.
[0047] Figure 2 This is a flowchart illustrating Embodiment 2 of the memory data isolation storage method of this application;
[0048] Figure 3 A schematic diagram illustrating a scenario of a memory data isolation storage method provided in an embodiment of this application;
[0049] Figure 4 This is a schematic diagram of the structure of a distributed transaction system according to an embodiment of this application;
[0050] Figure 5 This is a schematic diagram of the structure of a distributed transaction system according to another embodiment of this application.
[0051] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0052] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0053] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0054] Currently, physical isolation is commonly used to handle different business operations in order to solve the above problems. For example, spot trading and credit business are deployed on different physical component instances. However, the physical isolation method requires each business to have independent physical devices and system environments. Independent physical components need to be equipped with corresponding computing resources, storage resources and network resources. With the continuous expansion and innovation of financial business, new business types such as options and proprietary trading have emerged, making the memory data management architecture of distributed trading systems bloated and resource-intensive.
[0055] This application proposes a memory data isolation storage method. The method involves receiving an external transaction request through a tag allocation component, adding a business identifier to the external transaction request based on its business type to obtain a target transaction request, and sending the target transaction request to a transaction engine. The transaction engine then reads account data corresponding to the account in the external transaction request from a target memory partition and generates a transaction order carrying the business identifier based on the account data. The target memory partition is the memory partition in the business database corresponding to the business identifier. The transaction engine executes the transaction order according to a multi-level pipeline based on the memory data in the target memory partition to obtain a transaction result. Finally, the transaction engine updates the memory data in the target memory partition based on the transaction result.
[0056] Compared to physically isolating different services, this application's solution adds a service identifier to external transaction requests through a tag allocation component. The transaction engine routes the request to the corresponding service processing instance based on the identifier. Requests of different service types can share physical devices and system environments. The transaction engine reads data from the target memory partition corresponding to the service identifier, achieving logical isolation and efficient management of memory data for different services. There is no need to equip each service with independent physical resources. When expanding and innovating services, it is only necessary to register relevant information and create new memory partitions through the service extension component to support the addition of new service types, avoiding resource waste and making the system architecture simpler.
[0057] Based on this, embodiments of this application provide a memory data isolation storage method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the memory data isolation storage method of this application.
[0058] In this embodiment, the memory data isolation storage method includes steps S10 to S40:
[0059] Step S10: Receive an external transaction request through the tag allocation component; add a business identifier to the external transaction request based on the business type of the external transaction request to obtain a target transaction request; and send the target transaction request to the transaction engine.
[0060] External transaction requests are business transaction requests initiated by external systems or users, such as user-initiated transfer or recharge requests. Business identifiers are codes or numbers used to uniquely identify different business types and can be used to distinguish different business transactions. The tag assignment component is responsible for receiving external transaction requests and adding business identifiers according to the business type. The transaction engine is the component used to route target transaction requests to the corresponding business processing instance.
[0061] The tag allocation component listens for requests from external systems. When it receives an external transaction request, it parses the business type information in the request, assigns a corresponding business identifier to the request according to the preset mapping relationship between business types and business identifiers, and adds the business identifier to the external transaction request to form the target transaction request.
[0062] Understandably, by preprocessing external transaction requests and adding business identifiers to them, it is easier to route and process them according to business type, which improves the accuracy and efficiency of transaction processing. The business identifiers can quickly locate the corresponding processing flow, avoid confusion between requests of different business types, and reduce processing errors.
[0063] Step S20: Read the account data corresponding to the account of the external transaction request from the target memory partition through the transaction engine, and generate a transaction order carrying the business identifier based on the account data, wherein the target memory partition is the memory partition corresponding to the business identifier in each memory partition of the business database;
[0064] After receiving a target transaction request, the transaction engine extracts the business identifier. Based on the preset mapping relationship between business identifiers and business processing instances, it finds the corresponding business processing instance and sends the target transaction request to that instance. In essence, by accurately routing the target transaction request to a business processing instance capable of handling that business type, it achieves a division of labor in business processing, improving system scalability and processing efficiency. Different business processing instances can process different types of business requests in parallel, avoiding processing conflicts.
[0065] The target memory partition is the memory partition within the business database that corresponds to the business identifier. It is used to store account data for a specific business type. Account data is data related to the account in external transaction requests, such as account balance and transaction records. The transaction engine is the component responsible for managing the execution of transaction orders and message passing.
[0066] After receiving a target transaction request, the transaction engine determines the corresponding target memory partition based on the business identifier, reads the account data corresponding to the account of the external transaction request from the target memory partition, generates a transaction order carrying the business identifier based on the account data and business requirements, and submits the transaction order to the business processing instance.
[0067] Understandably, separating business processing from data storage improves data security and processing efficiency. Storing different types of data in memory partitions reduces data access conflicts.
[0068] Step S30: The transaction engine executes the transaction order according to the multi-level pipeline of the transaction order, based on the memory data in the target memory partition, to obtain the transaction result;
[0069] After receiving a transaction order, the transaction engine assigns it a unique message string instance. This instance reads memory data from the target memory partition according to the order's requirements and executes the transaction to generate the result. In essence, by executing transaction orders according to certain rules using message string instances, the engine ensures the correctness and consistency of transactions, achieving orderly execution. Managing transaction orders through message string instances also avoids conflicts and improves reliability.
[0070] Step S40: The transaction engine updates the memory data of the target memory partition based on the transaction result.
[0071] After receiving the transaction results, the trading engine parses the information within them and updates the corresponding account data in the target memory partition accordingly. This process of reflecting transaction results in memory ensures data consistency, guarantees the real-time nature and accuracy of the memory data, and provides a reliable data foundation for subsequent transaction processing.
[0072] In this embodiment, an external transaction request is received by the tag allocation component. Based on the business type of the external transaction request, the tag allocation component adds a business identifier to the external transaction request to obtain a target transaction request, which is then sent to the transaction engine. The transaction engine reads the account data corresponding to the account in the external transaction request from the target memory partition and generates a transaction order carrying the business identifier based on the account data. The target memory partition is the memory partition in the business database that corresponds to the business identifier. The transaction engine executes the transaction order according to the multi-level pipeline of the transaction order, based on the memory data in the target memory partition, to obtain a transaction result. The transaction engine updates the memory data in the target memory partition based on the transaction result.
[0073] Compared to physically isolating different services, this embodiment adds a service identifier to external transaction requests through a tag allocation component. The transaction engine routes the request to the corresponding service processing instance based on the identifier. Requests of different service types can share physical devices and system environments. The transaction engine reads data from the target memory partition corresponding to the service identifier, achieving logical isolation and efficient management of memory data for different services. There is no need to equip each service with independent physical resources. When expanding and innovating services, it is only necessary to register relevant information and create new memory partitions through the service extension component. This can support the addition of new service types, avoid resource waste, and make the system architecture simpler.
[0074] In one feasible embodiment, step S10, which involves adding a business identifier to the external transaction request based on the business type of the external transaction request by the tag allocation component to obtain the target transaction request, includes:
[0075] Step S101: The field value of the preset encoding field in the external transaction request is parsed by the tag allocation component, and the field value is mapped to a business identifier according to the preset encoding rule;
[0076] The preset encoding field is a predefined field in the external transaction request used to represent the business type; the preset encoding rule is a rule used to map the field value of the preset encoding field to the business identifier, which can be set according to actual needs and is not limited here. In this embodiment, after receiving the external transaction request, the tag allocation component extracts the field value of the preset encoding field and maps the field value to the corresponding business identifier according to the preset encoding rule.
[0077] Step S102: The target transaction request is obtained by embedding the business identifier into the external transaction request through the tag allocation component;
[0078] The tag assignment component embeds the obtained business identifier into the external transaction request to generate the target transaction request. This ensures that the target transaction request contains identification information of the business type, facilitating subsequent processing to accurately identify and process different types of business requests.
[0079] In one feasible embodiment, step S40, which involves the transaction engine executing the transaction order according to the multi-level pipeline of the transaction order and obtaining the transaction result based on the memory data in the target memory partition, includes:
[0080] Step S401: Assign a unique serial number to the transaction order through the transaction engine, and bind the unique serial number to the message string instance;
[0081] A unique serial number is used to uniquely identify each transaction order, facilitating the tracking and management of these orders. In this embodiment, after receiving a transaction order, the transaction engine generates a unique serial number, which is bound to a message string instance. This unique serial number allows for easy tracking of the transaction order's execution status, improving traceability, facilitating monitoring and management, and reducing the possibility of order confusion.
[0082] Step S402: Execute the transaction order based on the memory data in the target memory partition according to the order of the multi-level pipeline corresponding to the transaction order through the message string instance;
[0083] A multi-level pipeline is a series of processing stages divided in a specific order during the execution of a transaction order, with each stage responsible for completing a specific task. In this embodiment, the message string instance reads memory data from the target memory partition sequentially according to the order of the multi-level pipeline corresponding to the transaction order. At each pipeline stage, the memory data is processed according to business rules. After completing all pipeline stages, the transaction result is obtained.
[0084] Understandably, parallel processing through multi-stage pipelines reduces transaction processing time, increases system throughput, and improves processing efficiency and parallelism.
[0085] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. In addition, the distributed transaction system further includes monitoring and rollback components; please refer to... Figure 2 After step S40, which involves the transaction engine updating the memory data of the target memory partition based on the transaction result, the method further includes:
[0086] Step S50: Obtain the asset change data of the target memory partition through the transaction engine, and send the asset change data to an external system;
[0087] Asset change data refers to data showing changes in account assets in the target memory partition due to transaction execution. In this embodiment, after updating the memory data of the target memory partition, the trading engine extracts the asset change data and sends it to an external system.
[0088] Understandably, by synchronizing transaction results to external systems, ensuring data consistency between the external systems and the distributed trading system, data synchronization between the distributed trading system and external systems is achieved, improving data consistency and accuracy, and facilitating related business processing and supervision by the external systems.
[0089] Step S60: When the monitoring and rollback component detects that the memory data in the target memory partition is inconsistent with the system data of the external system, it triggers a memory data rollback.
[0090] The monitoring and rollback component is responsible for monitoring the consistency between memory data and external system data, and triggering memory data rollback when inconsistencies are detected. In this embodiment, the monitoring and rollback component periodically or in real time compares the memory data in the target memory partition with the system data of the external system. When data inconsistency is detected, a memory data rollback operation is triggered.
[0091] Understandably, when data inconsistency occurs, a rollback operation restores the memory data to the correct state, improving data reliability and consistency and avoiding business errors and risks caused by data inconsistency.
[0092] In one feasible embodiment, the monitoring and rollback component includes a snapshot generation module and a data rollback module; the memory data isolation storage method further includes:
[0093] Step S01: The snapshot generation module generates data snapshots for each memory partition in the business database according to a preset period, and stores the data snapshots in the log storage area corresponding to each memory partition.
[0094] The snapshot generation module is used to generate data snapshots. A data snapshot is a record of the state of each memory partition in the business database at a specific point in time. The log storage area is used to store data snapshots. The log storage area can be a storage partition within the business database or a storage area within other external databases; there are no restrictions here.
[0095] In this embodiment, the snapshot generation module scans each memory partition in the business database according to a preset period, generates a data snapshot of the current state of each memory partition, and stores the data snapshot in the log storage area corresponding to each memory partition. It can be understood that by periodically backing up the state of the memory partitions, a basis for data recovery is provided. When data errors occur or rollback is needed, the data snapshot can be used to restore the memory data to its previous state, improving the system's fault tolerance.
[0096] In this embodiment, step S60, which involves the monitoring and rollback component triggering a memory data rollback when it detects inconsistencies between the memory data in the target memory partition and the system data of the external system, includes:
[0097] Step S601: When the data rollback module detects that the memory data in the target memory partition is inconsistent with the system data of the external system, it obtains the data snapshot with the most recent timestamp from the log storage area corresponding to the business identifier and loads the data snapshot with the most recent timestamp into the target memory partition.
[0098] The data rollback module is responsible for performing in-memory data rollback operations. The most recent timestamped data snapshot is the most recent timestamped data snapshot in the log storage area, representing the most recent normal state of the memory partition.
[0099] When the data rollback module detects inconsistencies between the memory data in the target memory partition and the system data of the external system, it retrieves the most recent timestamped data snapshot from the log storage area corresponding to the business identifier, loads this snapshot into the target memory partition, and overwrites the current memory data. By loading the most recent timestamped data snapshot, the memory data in the target memory partition is restored to its previous state, restoring data consistency, reducing the business impact caused by data inconsistency, and improving the stability and reliability of the system.
[0100] In one feasible embodiment, the distributed transaction system further includes a business expansion component; the memory data isolation storage method further includes:
[0101] Step S70: When a new service type is detected, the new service identifier of the new service type is registered in the tag allocation component through the service extension component;
[0102] Business extension components are used to extend the business types of a distributed trading system. A new business type is a new business type added to the system, such as a new financial product trading type. A new business identifier is an identifier used to uniquely identify a new business type. A new business instance is a business processing instance used to handle the new business type.
[0103] In this embodiment, after the service extension component detects a new service type, it assigns a new service identifier to it and registers the new service identifier in the tag allocation component so that it can identify and process requests of the new service type, ensuring that requests of the service type can be correctly routed to the new service instance.
[0104] Step S80: Create a new memory partition in the business database bound to the new identifier through the business extension component, and register the mapping relationship between the new identifier and the new memory partition in the transaction engine through the business extension component.
[0105] The business extension component creates a new memory partition in the business database and binds it to the new business identifier. It registers the mapping relationship between the new business identifier and the new memory partition in the transaction engine to ensure that the transaction results can be correctly updated to the new memory partition.
[0106] In this embodiment, by registering relevant information through the business extension component, the new business type is integrated into the system, enabling the distributed transaction system to support the new business type. This ensures the data independence and manageability of the new business type, improves the scalability of the system, and allows the system to quickly adapt to new business needs without requiring large-scale system modifications.
[0107] For example, to help understand the implementation process of the memory data isolation storage method obtained by combining this embodiment with the above embodiment one, please refer to... Figure 3 , Figure 3 A schematic diagram illustrating a memory-based data isolation storage method is provided, specifically:
[0108] Figure 3The document showcases the architecture of ATP (ATP Cash and Margin Integration System A). It primarily comprises the following components: an Operations and Maintenance Management System (OSS) responsible for system maintenance; a Spot Operations Management System (BOS) and a Margin Trading Operations Management System (BOS) for managing spot trading and margin trading operations, respectively; non-core spot trading components (such as DGX and TVS); non-core margin trading components (such as DGX and TVS); and a business database for storing various business-related data, such as... Figure 3 The diagram shows the memory partitions for spot trading data and margin trading data.
[0109] based on Figure 3 The architecture shown illustrates a specific business transaction process as follows: The spot or margin trading operation management system sends an external transaction request. The tag allocation component parses the preset encoded field values in the request, maps them to business identifiers according to rules, embeds them into the request, forming a target transaction request, and then sends it to the transaction engine. After receiving the target transaction request, the transaction engine reads account data from the corresponding target memory partition in the database and generates a transaction order carrying the business identifier. The transaction engine assigns a unique serial number to the transaction order and binds it to a message string instance. The message string instance executes the transaction order based on the target memory partition's memory data in a multi-level pipeline sequence, i.e., sequentially through different pipeline workers and the data manager, to obtain the transaction result. The transaction engine updates the target memory partition's memory data according to the transaction result, and simultaneously obtains asset change data and sends it to the external system. The snapshot generation module of the monitoring and rollback component periodically generates data snapshots for each partition of the database and stores them in the log storage area. When the data rollback module of the monitoring and rollback component detects inconsistencies between the memory data and the external system data, it retrieves the most recent timestamp snapshot from the corresponding log storage area to restore the target memory partition data. The business expansion component is similar to the system's expansion planner. When a new business type is detected, it registers the new business identifier in the tag allocation component, creates a new memory partition in the business database and binds it to the new identifier, and registers the mapping relationship between the two in the transaction engine, so that the system can process the new business.
[0110] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the memory data isolation storage method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0111] This application also provides a distributed trading system; please refer to [reference needed]. Figure 4 The distributed trading system includes a token allocation component and a trading engine;
[0112] The tag allocation component is used to receive external transaction requests, add a business identifier to the external transaction request based on the business type of the external transaction request to obtain a target transaction request, and send the target transaction request to the transaction engine;
[0113] The transaction engine is used to read the account data corresponding to the account of the external transaction request from the target memory partition, and generate a transaction order carrying the business identifier based on the account data; wherein, the target memory partition is the memory partition corresponding to the business identifier in each memory partition of the business database;
[0114] The transaction engine is also used to execute the transaction order according to the multi-level pipeline of the transaction order, based on the memory data in the target memory partition, to obtain the transaction result;
[0115] The transaction engine is also used to update the memory data of the target memory partition based on the transaction results.
[0116] In one feasible embodiment, the tag allocation component is further configured to parse the field value of the preset encoded field in the external transaction request and map the field value to a business identifier according to the preset encoding rule;
[0117] The tag allocation component is also used to embed the business identifier in the external transaction request to obtain the target transaction request.
[0118] In one feasible embodiment, the transaction engine is further configured to assign a unique serial number to the transaction order and bind the unique serial number to a message string instance;
[0119] The message string instance is used to execute the transaction order based on the memory data in the target memory partition, according to the order of the multi-level pipeline corresponding to the transaction order.
[0120] In one feasible embodiment, please refer to Figure 5 The distributed transaction system also includes monitoring and rollback components;
[0121] The transaction engine is also used to acquire asset change data of the target memory partition and send the asset change data to an external system;
[0122] The monitoring and rollback component is used to trigger memory data rollback when it is detected that the memory data in the target memory partition is inconsistent with the system data of the external system.
[0123] In one feasible embodiment, the monitoring and rollback component includes a snapshot generation module and a data rollback module;
[0124] The snapshot generation module is used to generate data snapshots for each memory partition in the business database according to a preset period, and store the data snapshots in the log storage area corresponding to each memory partition.
[0125] The data rollback module is used to obtain a data snapshot with the most recent timestamp from the log storage area corresponding to the business identifier when it detects that the memory data in the target memory partition is inconsistent with the system data of the external system, and load the data snapshot with the most recent timestamp into the target memory partition.
[0126] In one feasible embodiment, the distributed transaction system further includes a business expansion component;
[0127] The business extension component is used to register a new business identifier for the new business type in the tag allocation component when a new business type is detected.
[0128] The business extension component is also used to create a new memory partition bound to the new identifier in the business database, and to register the mapping relationship between the new identifier and the new memory partition in the transaction engine.
[0129] The distributed trading system provided in this application employs the memory data isolation storage method described in the above embodiments, which solves the technical problem of high hardware resource consumption caused by the physical isolation of memory data in distributed trading systems. Compared with the prior art, the beneficial effects of the distributed trading system provided in this application are the same as those of the memory data isolation storage method provided in the above embodiments, and other technical features of the distributed trading system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0130] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the memory data isolation storage method in the above embodiments.
[0131] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM, in this embodiment, e.g., e.g., read-only memory or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0132] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the distributed trading system, enable the distributed trading system to implement the memory data isolation storage method of the above embodiments.
[0133] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0136] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described memory data isolation storage method. This solves the technical problem of high hardware resource consumption caused by the use of physical memory data isolation in distributed transaction systems. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the memory data isolation storage method provided in the above embodiments, and will not be repeated here.
[0137] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the memory data isolation storage method described above.
[0138] The computer program product provided in this application can solve the technical problem of high hardware resource consumption caused by the use of physical isolation of memory data in distributed transaction systems. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the memory data isolation storage method provided in the above embodiments, and will not be repeated here.
[0139] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A memory-based data isolation storage method, characterized in that, The memory-based data isolation storage method is applied to a distributed trading system, which includes a tag allocation component, a trading engine, and message string instances. The memory-based data isolation storage method includes: The tag allocation component receives external transaction requests, parses the field values of preset encoded fields in the external transaction requests, maps the field values to business identifiers according to preset encoding rules, embeds the business identifiers in the external transaction requests to obtain target transaction requests, and sends the target transaction requests to the transaction engine. The transaction engine receives the target transaction request, determines the corresponding target memory partition based on the business identifier, reads the account data corresponding to the account of the external transaction request from the target memory partition, and generates a transaction order carrying the business identifier based on the account data. The target memory partition is a logically isolated storage area in each memory partition of the business database that is uniquely bound to the business identifier. The transaction engine assigns a unique serial number to the transaction order and binds the unique serial number to a message string instance. The message string instance is used to execute the pipeline operations at each level in sequence according to the order of the multi-level pipeline corresponding to the transaction order, based on the memory data in the target memory partition, in order to obtain the transaction result; The transaction engine updates the memory data of the target memory partition based on the transaction results.
2. The memory data isolation storage method as described in claim 1, characterized in that, The distributed transaction system also includes monitoring and rollback components; After the step of updating the memory data of the target memory partition based on the transaction result through the transaction engine, the method further includes: The transaction engine obtains asset change data of the target memory partition and sends the asset change data to an external system. When the monitoring and rollback component detects that the memory data in the target memory partition is inconsistent with the system data of the external system, it triggers a memory data rollback.
3. The memory data isolation storage method as described in claim 2, characterized in that, The monitoring and rollback components include a snapshot generation module and a data rollback module; The memory data isolation storage method further includes: The snapshot generation module generates data snapshots for each memory partition in the business database according to a preset period, and stores the data snapshots in the log storage area corresponding to each memory partition. The step of triggering memory data rollback when the monitoring and rollback component detects inconsistencies between memory data in the target memory partition and system data of the external system includes: When the data rollback module detects that the memory data in the target memory partition is inconsistent with the system data of the external system, it retrieves the most recent timestamp data snapshot from the log storage area corresponding to the business identifier and loads the most recent timestamp data snapshot into the target memory partition.
4. The method according to any one of claims 1 to 3, characterized in that, The distributed transaction system also includes business expansion components; The memory data isolation storage method further includes: When a new service type is detected, the new service identifier for the new service type is registered in the tag allocation component through the service extension component. The business extension component creates a new memory partition in the business database that is bound to the new identifier, and registers the mapping relationship between the new identifier and the new memory partition in the transaction engine.
5. A distributed trading system, characterized in that, The distributed transaction system includes a tag allocation component, a transaction engine, and message string instances; The tag allocation component is used to receive external transaction requests, parse the field values of preset encoded fields in the external transaction requests, map the field values to business identifiers according to preset encoding rules, embed the business identifiers in the external transaction requests to obtain target transaction requests, and send the target transaction requests to the transaction engine; The transaction engine is used to receive the target transaction request, determine the corresponding target memory partition according to the business identifier, read the account data corresponding to the account of the external transaction request from the target memory partition, and generate a transaction order carrying the business identifier based on the account data; wherein, the target memory partition is a logically isolated storage area in each memory partition of the business database that is uniquely bound to the business identifier; The transaction engine is also used to assign a unique serial number to the transaction order and bind the unique serial number to the message string instance; The message string instance is used to execute pipeline operations at each level sequentially based on the memory data in the target memory partition, according to the order of the multi-level pipeline corresponding to the transaction order, in order to obtain the transaction result; The transaction engine is also used to update the memory data of the target memory partition based on the transaction results.
6. The distributed transaction system as described in claim 5, characterized in that, The distributed transaction system also includes monitoring and rollback components; The transaction engine is also used to acquire asset change data of the target memory partition and send the asset change data to an external system; The monitoring and rollback component is used to trigger memory data rollback when it is detected that the memory data in the target memory partition is inconsistent with the system data of the external system.
7. The distributed trading system as described in any one of claims 5 to 6, characterized in that, The distributed transaction system also includes business expansion components; The business extension component is used to register a new business identifier for the new business type in the tag allocation component when a new business type is detected. The business extension component is also used to create a new memory partition bound to the new identifier in the business database, and to register the mapping relationship between the new identifier and the new memory partition in the transaction engine.
8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the memory data isolation storage method as described in any one of claims 1 to 4.