Data storage method and calculation method for financial data medium table
By adopting a multi-server storage and computing co-site method in the financial data center, the problem of low storage and computing efficiency and poor availability of distributed architecture in the financial industry is solved, and efficient and reliable data processing and expansion capabilities are achieved.
Patent Information
- Application Number
- CN202410730383.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-20
AI Technical Summary
Existing financial data middle platforms based on distributed architecture have deficiencies in storage and computing efficiency and availability, especially when processing massive financial transaction data, resulting in delays and single points of failure.
Using a data center composed of multiple servers, the IPv4 address is mapped to the hash ring through the modulus, and the transaction data is stored on the nearest servers. Combined with data redundancy and hot or cold expansion, the design calculation program is deployed on all servers. On the server, an available server is randomly selected to execute the calculation request.
It significantly improves data storage and computing efficiency, enhances system reliability and availability, supports unlimited expansion of data scale and controllability of hardware costs, and achieves an efficient and reliable financial data middle platform.
Smart Images

Figure CN118672964A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of financial transaction systems, and in particular to a data storage method and a calculation method for a financial data middle station. Background Art
[0002] With the explosive growth of business data, data middle platform has become a common choice for enterprise data applications. From a technical perspective, data middle platform includes data collection, storage, calculation, etc., and forms a unified data caliber. Its technical foundation generally adopts a distributed architecture.
[0003] In the financial industry, a huge amount of transaction data is generated every moment. There are many types of transaction data, such as transaction data, entrustment data, position data, profit and loss calculation, etc., which are very difficult to store. As a result, the application of distributed data middle platform in the financial industry is difficult. At present, the data middle platform system based on distributed architecture usually adopts the following solutions in the business form of large-scale data aggregation: (1) offline data processing solution; (2) data movement solution between different nodes, that is, pulling data from the storage server to the business server for calculation or aggregation; (3) copying data to all server nodes when distributing; (4) storing data in the underlying database. These processing methods have their own shortcomings in terms of storage, computing delay, network occupancy, single point failure, etc., which reduce the computing efficiency of the data middle platform and deteriorate its availability. Summary of the invention
[0004] To solve the above problems, the first aspect of the present application provides a data storage method of a financial data middle platform, comprising the following steps:
[0005] S1. Establish a data center consisting of multiple servers;
[0006] S2. IPv4 address pair 2 for each server 32 -1 modulo, and mapped to 0 to 2 in a clockwise direction 32 -1 hash ring;
[0007] S3. Take the hash of the transaction account of the transaction data so that the transaction data falls into the corresponding hash ring;
[0008] S4. Store the transaction data on the nearest n servers in a clockwise direction.
[0009] This application distributes financial transaction data based on transaction accounts, significantly improving storage efficiency and providing an efficient and reliable foundation for subsequent data query, call and calculation.
[0010] In some implementations, 2≤n≤6. The present application designs certain data redundancy when storing transaction data, which greatly improves the reliability of the data middle platform while ensuring the operating efficiency of the data middle platform.
[0011] In some implementations, transaction data of 5 to 30 transaction accounts are stored on each server. By limiting the number of transaction accounts stored on each server, the hardware utilization of the server is guaranteed, the hardware cost is controlled, and an efficiency basis is provided for subsequent multi-account query calls and calculations.
[0012] In some implementations, when the hardware resources of a single server are occupied by more than 60%, the data center is expanded. The data center in this application supports unlimited expansion of data scale, and by limiting the expansion conditions of the data center, it ensures that the data center can run stably at a high rate and the hardware cost is controllable.
[0013] In some embodiments, the expansion is hot expansion or cold expansion.
[0014] In some implementations, when the data center is running, the hardware resource occupancy of a single server is 30% to 50%.
[0015] A second aspect of the present invention provides a data calculation method for a financial data middle platform. Based on the above data storage method, the data calculation method includes the following steps:
[0016] S5. Deploy the computing program on all servers;
[0017] S6. The data center maps the account information in the calculation request to n servers storing the transaction account;
[0018] S7. The data center randomly selects an available server from the n servers storing the transaction account to execute the calculation request.
[0019] This application stores basic-granularity computing units and transaction data on the same site, effectively combining distributed storage with distributed computing and high-availability systems. When the data center responds to data computing requests, it performs calculations on the basic computing units. The real-time nature of the data is close to that of a stand-alone program, taking into account performance, network, and high data reliability. It solves the shortcoming of traditional distributed application data storage and data computing not being on the same site, and continues to maintain the flexibility of distributed systems in programming and computing.
[0020] In some embodiments, when a calculation request includes account information of multiple trading accounts, the data center will separate the account information of multiple trading accounts into corresponding numbers of trading accounts, and then execute steps S6 and S7 respectively. After the server performing the calculation completes the calculation, it will feed back the calculation results to the data center for aggregation. By setting up multiple storage and computing co-station servers in the data center, the data center in this application can process calculation requests of multiple trading accounts in parallel, thereby improving calculation efficiency.
[0021] A third aspect of the present invention provides a financial data middle platform for executing the above-mentioned data storage method.
[0022] In some implementations, the financial data middle platform is also used to execute the above-mentioned data calculation method.
[0023] Based on the above-mentioned storage method and calculation method, the data middle platform in this application has the characteristics of high operating efficiency, high reliability and availability. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1 It is a schematic diagram of a data storage method of a financial data middle platform provided by this application;
[0026] Figure 2 This is a flowchart of a data storage method of a financial data middle platform provided by this application;
[0027] Figure 3 This is a flow chart of a data calculation method for a financial data middle platform provided in this application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] It should be noted that the terms "including" and "having" and any variations of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes or methods.
[0030] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The word "exemplary" used herein means "used as an example, embodiment or illustrative". Any embodiment described herein as "exemplary" is not necessarily to be interpreted as being superior or better than other embodiments.
[0031] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods and means well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0032] See also Figure 2 The first aspect of the present application provides a data storage method of a financial data middle platform, comprising the following steps:
[0033] S1. Establish a data center consisting of multiple servers;
[0034] S2. IPv4 address pair 2 for each server 32 -1 modulo, and mapped to 0 to 2 in a clockwise direction 32 -1 hash ring;
[0035] S3. Take the hash of the transaction account of the transaction data so that the transaction data falls into the corresponding hash ring;
[0036] S4. Store the transaction data on the nearest n servers in a clockwise direction.
[0037] The data center in this application includes multiple servers for storing financial transaction data. The IPv4 address of the server consists of four groups of 8-bit binary numbers. After taking the modulus, the mapping of each server in the hash ring is unique. Figure 1 As shown in the figure, taking the data center containing 4 servers as an example, the IPv4 address of each server is modulo and mapped to 0~2 in a clockwise direction. 32 -1 hash ring and are named Node(K), Node(M), Node(N), and Node(P) respectively.
[0038] This application does not limit the number of servers, theoretically the maximum number can be 232 -1. The number of servers directly affects the storage capacity of the data center. When setting it, it is necessary to balance factors such as storage efficiency, system stability, and cost. In some embodiments, when the hardware resource occupancy of a single server exceeds 60%, the data center is expanded. The hardware resources of a single server are, for example, a 16-core processor and 24G memory. By setting the hardware resource occupancy rate as a capacity expansion condition, the scale of transaction data stored in the data center can be increased under the premise of controllable costs, ensuring the efficiency and stability of operation.
[0039] In some embodiments, the expansion is hot expansion or cold expansion. Hot expansion refers to dynamically adding servers when the middle platform is running, so the two servers adjacent to the newly added server need to perform data migration; cold expansion refers to adding servers during downtime or maintenance windows. Preferably, the expansion is cold expansion.
[0040] Financial transaction data usually includes transaction data, entrustment data, position data, profit and loss calculations, etc., which are very difficult to classify and store. This application divides different types of transaction data into trading accounts, that is, all transaction data under a trading account is stored together, which significantly improves storage efficiency and provides an efficient and reliable basis for subsequent calls and calculations. "Taking hashes" in this application refers to converting data of any length into a hash value of fixed length through a hash algorithm. Figure 1 As shown in the figure, taking three transaction data as an example, the transaction account of each transaction data is hashed so that it falls on the positions t1, t2, and t3 on the hash ring respectively. In actual scenarios, each transaction account will have tens of thousands of transaction data every day, and the number of transactions divided into entrustment, transaction, position, etc. varies from thousands to tens of thousands.
[0041] In some embodiments, 2≤n≤6; preferably, 3≤n≤5. Figure 1As shown, taking the storage of transaction data at t1 as an example, the three servers Node(K), Node(M), and Node(N) closest to t1 are found in turn in a clockwise direction, and the transaction data is stored in the above three servers. In the existing distributed storage technology, one data is only stored on one server, which can effectively reduce the hardware cost. However, for a large number of transaction data, the reliability of single server storage is insufficient and the computing power is poor. This application stores data on multiple servers and sets data redundancy. When one or several servers fail, there are still available servers to keep running, thereby improving the reliability of data services. However, multi-server storage increases the hardware cost exponentially, and too many servers are not conducive to the utilization of hardware. Therefore, it is preferred to design the number of servers with a hardware resource occupancy rate within the range of 30%-50%, that is, preferably 3≤n≤5. When n is lower than the preferred range, the hardware resource occupancy of the server exceeds 60%, the computing delay of the data middle station is serious, and the stability is reduced.
[0042] In some implementations, transaction data of 5 to 30 transaction accounts are stored on each server; preferably, transaction data of 8 to 24 transaction accounts are stored on each server. The number of transaction accounts corresponding to each server is, for example, 8, 16, or 24. By limiting the number of transaction accounts stored on each server, the hardware utilization of the server is guaranteed, the hardware cost is controlled, and an efficiency basis is provided for subsequent multi-account query calls and calculations.
[0043] See also Figure 3 Based on the data storage method of a financial data middle station provided in the first aspect above, the second aspect of the present application provides a data calculation method of a financial data middle station, including the following steps:
[0044] S5. Deploy the computing program on all servers;
[0045] S6. The data center maps the account information in the calculation request to n servers storing the transaction account;
[0046] S7. The data center randomly selects an available server from the n servers storing the transaction account to execute the calculation request.
[0047] This application realizes data storage and data computing on the same site by deploying the computing program on the server, saving server resources and improving the computing efficiency of the data center.
[0048] The financial transaction data center receives external computing requests, which can be transaction data query or call, transaction data update, profit and loss calculation, etc. The data center maps the account information in the computing request to the corresponding n servers, and the mapping can be performed in a clockwise direction. Among the n servers mapped, the data center randomly selects an available server to execute the computing request.
[0049] Since the transaction data of the same trading account is stored on multiple servers, and all servers are deployed with computing programs, there are also multiple servers that can perform calculations. When individual servers are unavailable, the system can still operate normally, which improves the stability of data calculation and the reliability of the data middle platform. In the case of excluding unavailable servers, the random selection strategy is efficient enough, while reducing the difficulty and workload of the middle platform development.
[0050] In some embodiments, when a calculation request includes account information of multiple trading accounts, the data center will separate the account information of multiple trading accounts into corresponding numbers of trading accounts, and then execute steps S6 and S7 respectively. After the server performing the calculation completes the calculation, it will feed back the calculation results to the data center for aggregation. Since the data center includes multiple servers with storage and calculation co-sites, the data center in this application can process calculation requests of multiple trading accounts in parallel, thereby improving calculation efficiency.
[0051] For data calculations under single account information, the total number of servers included in the data center is proportional to the computing performance of a single server. The reason is that the data stored and the calculations to be performed by a single server decrease as the number of servers increases, so the latency is lower. However, for data calculations under multiple account information, although parallel calculations of multiple trading accounts on different servers can improve efficiency, the feedback and aggregation steps may cause delays, which will become more serious as the number of servers increases. Therefore, controlling the number of trading accounts stored on each server improves the efficiency of feedback and aggregation, and this can also reduce the number of servers, so as to balance hardware costs and low latency on the premise that the data center can support sufficient data scale.
[0052] The third aspect of the present application provides a financial data middle platform for executing the above-mentioned data storage method and data calculation method. Based on the above-mentioned storage method and calculation method, the data middle platform in the present application has the characteristics of high operating efficiency, high reliability and high availability.
[0053] In the description of this specification, the description with reference to the terms "some embodiments", "for example", or "example" means that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present embodiment. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0054] Although the present embodiment has been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations may be made without departing from the principles and spirit of the present embodiment, the scope of which is defined by the claims and their equivalents.
Claims
1. A data storage method for a financial data middle platform, characterized in that: The following steps are involved: S1. Establish a data center consisting of multiple servers; S2. For each of the IPv4 addresses of the server 2 32 -1 modulo, and mapped to 0 to 2 in a clockwise direction 32 -1 hash ring; S3. Take the hash of the transaction account of the transaction data so that the transaction data falls into the corresponding hash ring; S4. Store the transaction data in the nearest n servers in a clockwise direction.
2. The data storage method according to claim 1, characterized in that: 2≤n≤6。 3. The data storage method according to claim 1, characterized in that: Each of the servers stores transaction data of 5 to 30 transaction accounts.
4. The data storage method according to any one of claims 1 to 3, characterized in that: When the hardware resources of a single server exceed 60%, the data center is expanded.
5. The data storage method according to claim 4, characterized in that: The capacity expansion is hot capacity expansion or cold capacity expansion.
6. The data storage method according to claim 4, characterized in that: When the data center is running, the hardware resource occupancy of a single server is 30% to 50%.
7. A data calculation method for a financial data center, characterized in that: Based on the data storage method according to any one of claims 1 to 6, the data calculation method comprises the following steps: S5. Deploy the computing program on all the servers; S6. The data center maps the account information in the calculation request to the n servers storing the transaction account; S7. The data center randomly selects an available server from the n servers storing the transaction account to execute the calculation request.
8. The data calculation method according to claim 7, characterized in that: When the calculation request contains account information of multiple trading accounts, the data middle station will divide the account information of the multiple trading accounts into a corresponding number of trading accounts, and then execute step S6 and step S7 respectively. After completing the calculation, the server that executes the calculation will feed back the calculation result to the data middle station for aggregation.
9. A financial data middle platform, characterized in that: Used to execute the data storage method according to any one of claims 1-6.
10. The financial data middle platform according to claim 9, characterized in that: It is also used to execute the data calculation method according to claim 7 or 8.
