Distributed data caching method and system for financial industry

By adopting distributed data caching methods in the financial industry and using version numbers to control data consistency, the problem of difficult data consistency in the financial industry is solved, and efficient and secure data synchronization and cache management are achieved.

CN120030028AInactive Publication Date: 2025-05-23SHENZHEN GAOYANG HUANQIU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510190910.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-05-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the financial industry, data consistency between cross-systems and cross-microservices is difficult to ensure. The existing technology increases the number of middleware and system complexity, resulting in data synchronization delays and inconsistencies.

Method used

The distributed data caching method is adopted to obtain data update requests and judge the data type, and update the data in the local server and the shared server respectively. The version number is used to control data consistency, and the data version number is updated in real time to synchronize multi-level cache.

Benefits of technology

It improves the consistency of cross-domain data cache in the financial industry, reduces data synchronization delay, enhances data security and traceability, and improves the efficiency and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030028A_ABST
    Figure CN120030028A_ABST
Patent Text Reader

Abstract

The invention relates to a distributed data caching method for the financial industry, which comprises the following steps of: receiving a data updating request, identifying a parameter type in the updating request, namely shared data or exclusive data, for the exclusive data, acquiring a data updating instruction of a sub-service server by a system, and updating the data updating instruction of the sub-service server; the data in the sub-service server is updated according to the data; for the shared data, a data updating instruction of the shared server is obtained, the data in the shared server is updated, the system retrieves and updates the version number of the data in the shared server and the local server in real time, and if the version number of the data in the sub-service is higher than the corresponding version number of the shared server, the shared data is updated. The system obtains the latest data content of the database of the shared server, and the sub-service synchronously updates the data and version numbers in the server cache and the distributed cache to ensure the data consistency with the database of the shared server and the database of the local server. The method has the effect of improving the cross-domain data caching consistency in the financial industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data caching, and in particular to a distributed data caching method and system for the financial industry. Background Art

[0002] Currently, in the financial industry, the consistency of data shared across systems and microservices usually relies on the use of files as a medium and asynchronous data synchronization based on message middleware. If files, message middleware or real-time APIs are used across systems and microservices to ensure data consistency, the number of middleware and the complexity of system design will often increase, and may cause data synchronization delays and inconsistency in shared data, making the data caching efficiency between servers low. In distributed multi-level caches, how to ensure the consistency of caches at all levels, there are also synchronization time differences that lead to data inconsistencies and other anomalies. Especially in the financial industry, data consistency requirements are very high, so it needs to be improved. Summary of the invention

[0003] In order to improve the consistency of cross-domain data caching in the financial industry, the present application provides a distributed data caching method and system for the financial industry.

[0004] In the first aspect, the above-mentioned invention objective of the present application is achieved through the following technical solutions: A distributed data caching method for the financial industry, the method comprising the steps of: Obtaining a data update request and determining a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; If the parameter type is exclusive data, then obtain the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the local server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the local server database and update the version number corresponding to the data; If the parameter type is shared data, the data update instruction of the shared server is obtained, and the data in the shared server is updated according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the shared server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the shared server database and update the version number corresponding to the data; The subservice updates the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number to synchronize the content and version number of the shared server and local server database; When data is written and updated to the shared server and the local server, the version number of the data is updated in real time according to the update times.

[0005] By adopting the above technical solution, when a sub-server connected to a shared server needs to update the cache of shared data, it only needs to compare the version numbers to determine whether it is necessary to obtain the corresponding updated data from the shared server. If the version number has not been updated, the sub-server does not need to obtain new data from the shared server. By updating the version number of the corresponding data type, it can be ensured that all sub-servers in the multi-level cache can achieve data consistency synchronization in real time.

[0006] In a preferred example, the present application can be further configured as follows: when writing and updating data to the shared server and the local server, the version number of the data is updated in real time according to the update number, including the following steps: Acquire the real-time transmission data of the shared server and the local server according to the content of the update instruction; Writing the real-time transmission data to the shared server and the local server in the form of key-value to perform shared storage persistence, and updating and marking the version number of the real-time transmission data based on a preset version number update rule; The version numbers and write records of the shared data type and the exclusive data type on that day are recorded, and a cache log is generated. The cache log is used to query the cache records of a specified date.

[0007] By adopting the above technical solutions, through real-time data acquisition, intelligent cache classification, version control and log recording of shared servers, not only the efficiency and accuracy of data processing are improved, but also the security and traceability of data are enhanced.

[0008] In a preferred example, the present application can be further configured as follows: when writing and updating data to the shared server and the local server, the version number of the data is updated in real time according to the update number, including the following steps: Acquire the real-time transmission data of the sub-server, and mark the type of the real-time transmission data; Determine the data type of the real-time transmission data based on a preset data type classification rule; If the data type is exclusive data, the real-time transmission data is stored in the database of the sub-service and the version number of the data is updated; If the data type is shared data, the data is transmitted in real time and stored in the shared database and the version number of the data is updated.

[0009] By adopting the above technical solution, each sub-service can obtain different version numbers of exclusive data or shared data according to the actual application scenario, so as to obtain data of different types and versions. Through refined distributed cache management, the efficiency and consistency of distributed data cache in the financial industry are achieved.

[0010] In a preferred example, the present application may be further configured as follows: in the step of obtaining the real-time transmission data of the sub-server and marking the type of the real-time transmission data, the steps are as follows: Obtain the transmission data of each server in the financial industry and use the real-time transmission data as real-time transmission data; Identify the content of the real-time transmission data, and generate an identifier corresponding to the real-time transmission data according to the identification result, wherein the identifier is used to indicate the data type of the real-time transmission data; The data types include user data of financial institutions, pricing parameters, financial product parameters, account data, and transaction data.

[0011] In a preferred example, the present application can be further configured as follows: in the step of determining the cache type of the real-time transmission data based on a preset data type classification rule, the data type classification rule classifies the data type based on the access frequency, sensitivity and update frequency corresponding to the data type.

[0012] In a preferred example, the present application can be further configured as follows: after the sub-server updates the content and version number of the required data according to the data content corresponding to the latest version number and synchronizes the content and version number with the shared server, the sub-server includes the following steps: The update status of the real-time transmission data is obtained. If the status of the real-time transmission data is still valid, the version number of the real-time transmission data is modified so that the data that is still in the valid state is cached in the server with the current version number, and the data content does not need to be updated.

[0013] By adopting the above technical solution, the system writes the real-time transmission data with the latest version number into the cache and distributed cache of the sub-service server. Any service requesting this data can obtain the latest data, ensuring the consistency and real-time nature of the data, ensuring that all users and systems can access the latest data, and reducing the number of data updates based on the data content, thereby improving the data processing efficiency of the server and reducing storage load requirements.

[0014] In a preferred example, the present application can be further configured to: after recording the version number and write record of the shared data type and the exclusive data type on the day, and generating a cache log, wherein the cache log is used to query the cache record of the specified date, the following steps are included: Obtaining a data query instruction, and performing data retrieval on a cache of a local server according to the data query instruction; If the local server cache does not have the corresponding data, a corresponding version number is generated according to the cache log to search the distributed cache to obtain the corresponding data.

[0015] If the distributed cache does not have the corresponding data, the exclusive data is retrieved from the sub-service database and the shared data is retrieved from the shared database according to the data type.

[0016] After the retrieval is completed, the version numbers corresponding to all data types are obtained from the shared database and synchronized to the distributed cache and sub-server cache.

[0017] By adopting the above technical solution, the system can reduce waiting time and quickly provide data to requesters by retrieving data from local servers first. Reducing queries to shared servers can reduce network load, especially during high traffic periods. Utilizing cache logs can ensure that even if data is not cached on the local server, the required data can be accurately retrieved from the shared server. The cache log records the versions and write records of all data, which helps monitor data access and changes and enhance data security. The cache log provides the financial industry with audit tracking capabilities, which helps meet regulatory requirements and compliance checks.

[0018] In the second aspect, the above invention objective of the present application is achieved through the following technical solutions: A distributed data caching device for the financial industry, the device comprising: An update request acquisition unit, used to acquire a data update request and determine a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; The local server data acquisition unit is used to, when the parameter type is exclusive data, acquire the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction. Specifically, the latest version number corresponding to the required data in the local server is acquired, and compared with the existing version number in the distributed cache database. If the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, the data content corresponding to the latest version number of the local server database is acquired, and the version number corresponding to the data is updated; A shared server data acquisition unit is used to, when the parameter type is shared data, acquire the data update instruction of the shared server, and update the data in the shared server according to the content of the update instruction. Specifically, the latest version number corresponding to the required data in the shared server is acquired, and compared with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, the data content corresponding to the latest version number of the shared server database is acquired, and the version number corresponding to the data is updated; The data content updating unit is used for the sub-service to update the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number, so as to synchronize the content and version number with the shared server and local server database.

[0019] On the third aspect, the above-mentioned purpose of the present application is achieved through the following technical solutions: An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned distributed data caching method for the financial industry when executing the computer program.

[0020] Fourthly, the above-mentioned purpose of the present application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned distributed data caching method for the financial industry.

[0021] In summary, the present application includes at least one of the following beneficial technical effects: 1. Through refined distributed cache management, the efficiency and consistency of distributed data cache in the financial industry are achieved. Through real-time data acquisition, intelligent cache classification, version control and log recording, the system not only improves the speed and accuracy of data processing, but also enhances the security and traceability of data; 2. Write the real-time transmission data with the latest version number into the cache of the shared server. Any service requesting this data can obtain the latest data, ensuring the consistency and real-time nature of the data, ensuring that all users and systems can access the latest data, and improving service quality and user experience; 3. By retrieving data from the local server first, the system can reduce waiting time and quickly provide data to the requester. Reducing queries to shared servers can reduce network load, especially during high traffic periods. Using cache logs can ensure that even if the data is not cached on the local server, the required data can be accurately retrieved from the shared server. The cache log records the version and write records of all data, which helps monitor data access and changes and enhance data security. The cache log provides the financial industry with audit tracking capabilities, which helps meet regulatory requirements and compliance checks. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a flow chart of a distributed data caching method for the financial industry in one embodiment of the present application; Figure 2 This is a principle block diagram of a distributed data cache device for the financial industry in one embodiment of the present application; Figure 3 It is a schematic diagram of an electronic device in an embodiment of the present application.

[0023] Figure Number: 1. Update request acquisition unit; 2. Local server data acquisition unit; 3. Shared server data acquisition unit; 4. Data content update unit. DETAILED DESCRIPTION

[0024] The present application is further described in detail below in conjunction with the accompanying drawings.

[0025] In one embodiment, if Figure 1 As shown, the present application discloses a distributed data caching method for the financial industry, which specifically includes the following steps: S10: Obtain a data update request, and determine a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; Specifically, taking a financial trading platform as an example, in a financial trading platform, multiple servers are responsible for processing transaction data, user information and market conditions, and the system collects data streams from these servers in real time through APIs or message queues. The system classifies the collected data into "exclusive data" or "shared data" based on predefined rules, such as data access frequency and data sensitivity. For example, a user's transaction records may be marked as "exclusive data", while market data is marked as "shared data". This classification allows the system to optimize storage and access strategies based on the characteristics of the data, improving cache efficiency and data access speed.

[0026] S20: If the parameter type is exclusive data, obtaining a data update instruction of the local server of the sub-service, and updating the data in the local server of the sub-service according to the content of the update instruction; Specifically, obtain the latest version number corresponding to the required data in the local server, and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the local server database, and update the version number corresponding to the data. S30: If the parameter type is shared data, obtain the data update instruction of the shared server, and update the data in the shared server according to the content of the update instruction. Specifically, obtain the latest version number corresponding to the required data in the shared server, and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the shared server database, and update the version number corresponding to the data. S40: The sub-service updates the content and version number of the server cache and the distributed cache data according to the data content corresponding to the latest version number, so as to synchronize with the content and version number of the shared server and the local server database. It should be noted that for the data writing and updating of the local server and the shared server, it includes the steps S50: When writing and updating data to the shared server and the local server, the version number of the data is updated in real time according to the number of update times.

[0027] In the step of obtaining the latest version number corresponding to the required data in the shared server, comparing it with the existing version number in the distributed cache database, if the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, obtaining the data content corresponding to the latest version number of the shared server database, and updating the version number corresponding to the data, it includes the following steps: Obtain the update status of the real-time transmission data. If the status of the real-time transmission data is still the effective status, modify the version number of the real-time transmission data, so that the data still in the effective status is cached in the server with the current version number, and the data content does not need to be updated.

[0028] Specifically, the system regularly checks or obtains the update status of each real-time transmission data item through an event trigger mechanism. For example, after a transaction data is completed, its status will be updated from "pending" to "effective". This step ensures that the system can timely identify the latest status of the data, providing an accurate basis for subsequent version control and data synchronization; Check whether the data status is the effective status: In the embodiment of the present application, for each piece of real-time transmission data, the system checks whether its status is marked as "valid". If the data status is "valid", the system considers that the data is currently valid and needs to be correctly cached.

[0029] This step helps the system filter out data that is outdated or no longer needed, and only retains and updates valid data, thereby saving storage space and improving data access efficiency.

[0030] Modify the version number of real-time transmission data: For data with a status of "effective", the system automatically updates its version number. For example, if the current version number is "V1", the system will update it to "V2" to reflect the latest data status. In the embodiment of the present application, the version number is numbered with a date, and the version number is updated in the form of T+1.

[0031] By updating the version number, the system can ensure that all cached data is up to date and can track the history of data changes, which is critical for auditing and compliance in the financial industry.

[0032] The system writes the real-time transmission data with the latest version number into the cache of the shared server. Any service requesting this data can obtain the latest data, ensuring the consistency and real-time nature of the data, ensuring that all users and systems can access the latest data, and improving service quality and user experience.

[0033] In S50: when writing and updating data to the shared server and the local server, the version number of the data is updated in real time according to the update number, the following steps are included: S51: acquiring real-time transmission data of the sub-server, and marking the type of the real-time transmission data; S52: judging the data type of the real-time transmission data based on a preset data type classification rule; S53: If the data type is exclusive data, the real-time transmission data is stored in the local database of the sub-service and the version number of the data is updated; S54: If the data type is shared data, the data is transmitted in real time and stored in a shared database and a version number of the data is updated.

[0034] Specifically, the content of the real-time transmission data is identified, and an identifier corresponding to the real-time transmission data is generated according to the identification result, wherein the identifier is used to indicate the data type of the real-time transmission data; The data business types include user data of financial institutions, pricing parameters, financial product parameters, account data, and transaction data.

[0035] By acquiring data in real time and identifying and marking the data, the system can ensure that the data processed is up to date, which is crucial for the financial industry because the real-time nature of the data directly affects trading decisions and risk management.

[0036] Among them, the data type classification rule classifies data types based on the access frequency, sensitivity and update frequency corresponding to the data type, obtains the corresponding version number from the shared database for different data service types, and uses the version to retrieve it from the sub-server cache and distributed cache respectively.

[0037] It should be further explained that, in S50: when writing and updating data to the shared server and the local server, the version number of the data is updated in real time according to the update number, the following steps are also included: Acquire the real-time transmission data of the shared server and the local server according to the content of the update instruction; Writing the real-time transmission data to the shared server and the local server in the form of key-value to perform shared storage persistence, and updating and marking the version number of the real-time transmission data based on a preset version number update rule; Specifically, taking shared data as an example, for data marked as "shared data", such as tenant parameters, organization definition parameters, product parameters, etc., the system assigns a version number to it and writes it to the shared server in key-value format.

[0038] Through version number tagging and key-value storage, the system can ensure data consistency and traceability, while facilitating cross-server sharing and synchronization of data.

[0039] S53: Record the version number and write record of the shared data type and the exclusive data type on that day, and generate a cache log, which is used to query the cache record of a specified date; Specifically, it records the version number of the local server and shared server on that day and detailed information of all write operations, and generates a cache log. The cache log provides the system with auditing and monitoring capabilities, making it possible to track the history of data changes, which is crucial for compliance and security in the financial industry.

[0040] In summary, through refined distributed cache management, the efficiency and consistency of distributed data cache in the financial industry are achieved. Through real-time data acquisition, intelligent cache classification, version control and logging, the system not only improves the speed and accuracy of data processing, but also enhances the security and traceability of data. These features are crucial for the financial industry because they directly affect the execution of transactions, risk control and compliance with regulations. In addition, this solution also reduces operating costs and improves the scalability and reliability of the system by reducing unnecessary data transmission and storage.

[0041] Specifically, for data marked as "exclusive data", such as the accounting subject parameters of the accounting general ledger service, which are exclusive data for the accounting general ledger service, the system will store it in the local database of the sub-service itself. The data will also be cached in the local server cache and distributed cache, which can reduce data transmission delays and improve data access speed, especially in high-frequency access scenarios.

[0042] If the data type is shared data, it generally belongs to a specific service, but other services also need to access the data. In this case, the data will be marked as shared data and written to the database shared by all services in Key-Value format. It also supports data filtering in the shared server based on the marked version number for the real-time transmission data. This service will also cache the data to the local server cache and distributed cache through version number marking, which can reduce data transmission delays and increase data access speed, especially in high-frequency access scenarios.

[0043] Specifically, check whether the version number of the real-time transmission data in the sub-server is consistent with the version number of the shared server on that day. If it is inconsistent, the data corresponding to the latest version number in the shared server is transmitted to the sub-server. This version number-based screening mechanism ensures that only the latest data is written, avoiding data conflicts and overwriting problems, and enhancing data consistency and accuracy.

[0044] After the step S53: recording the version numbers and write records of the shared data type and the exclusive data type on the day, and generating a cache log, the cache log is used to query the cache records of the specified date, the following steps are included: S531: Obtain a data query instruction, and perform data search on a local server according to the data query instruction; Specifically, when an application in financial services needs to obtain transaction records of a specific user, it sends a data query instruction to the local server. This instruction contains the user identifier and query parameters, such as the transaction date range.

[0045] By retrieving data from the local server first, the system can respond to query requests quickly, reduce reliance on shared servers, and reduce network latency and load.

[0046] S532: If the local server does not have the corresponding data, generate a corresponding version number according to the cache log and search the shared server to obtain the corresponding data; Specifically, if the local server does not find the corresponding data, the system will refer to the cache log, determine the version number of the data to be queried, and construct a new query request to send to the shared server, and the new query request includes the version number corresponding to the query content.

[0047] The cache log provides a reliable history that enables the system to accurately locate and retrieve old versions of data, which is critical for financial operations that require auditing or backtracking historical data.

[0048] In summary, this solution provides an efficient and reliable data retrieval mechanism suitable for distributed data caching scenarios in the financial industry. The advantages of this approach include: Improve response speed: By retrieving data from local servers first, the system can reduce waiting time and provide data to requesters quickly.

[0049] Reduced network load: Reducing queries to shared servers can reduce network load, especially during high traffic periods.

[0050] Data integrity and consistency: Utilizing cache logs ensures that required data can be accurately retrieved from shared servers even if the data is not cached on the local server.

[0051] Enhanced data security: The cache log records the versions and write records of all data, which helps monitor data access and changes and enhances data security.

[0052] Support data auditing and compliance: Cache logs provide audit trail capabilities for the financial industry, helping to meet regulatory requirements and compliance checks.

[0053] Improve system reliability: Even when some nodes in a distributed system fail, the system can still retrieve data from shared servers through cache logs to ensure service continuity.

[0054] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0055] In one embodiment, a distributed data caching device for the financial industry is provided, and the distributed data caching device for the financial industry corresponds one-to-one to the distributed data caching method for the financial industry in the above embodiment. Figure 2 As shown, the distributed data cache device for the financial industry includes: An update request acquisition unit (1) is used to acquire a data update request and determine a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; The local server data acquisition unit (2) is used to, when the parameter type is exclusive data, acquire the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction. Specifically, the latest version number corresponding to the required data in the local server is acquired, and compared with the existing version number in the distributed cache database. If the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, the data content corresponding to the latest version number of the local server database is acquired, and the version number corresponding to the data is updated; A shared server data acquisition unit (3), used for, when the parameter type is shared data, acquiring a data update instruction of the shared server, and updating the data in the shared server according to the content of the update instruction, specifically, acquiring the latest version number corresponding to the required data in the shared server, and comparing it with the existing version number in the distributed cache database; if the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, acquiring the data content corresponding to the latest version number of the shared server database, and updating the version number corresponding to the data; The data content updating unit (4) is used for the sub-service to update the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number, so as to synchronize the content and version number with the shared server and local server database.

[0056] For the specific definition of the distributed data caching device for the financial industry, please refer to the definition of the distributed data caching method for the financial industry above, which will not be repeated here. Each module in the above-mentioned distributed data caching device for the financial industry can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0057] In one embodiment, an electronic device is provided. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 3As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store a database. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a distributed data caching method for the financial industry is implemented.

[0058] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Obtaining a data update request and determining a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; If the parameter type is exclusive data, then obtain the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the local server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the local server database and update the version number corresponding to the data; If the parameter type is shared data, the data update instruction of the shared server is obtained, and the data in the shared server is updated according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the shared server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the shared server database and update the version number corresponding to the data; The subservice updates the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number to synchronize the content and version number of the shared server and local server database; When data is written and updated to the shared server and the local server, the version number of the data is updated in real time according to the update times.

[0059] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Obtaining a data update request and determining a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; If the parameter type is exclusive data, then obtain the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the local server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the local server database and update the version number corresponding to the data; If the parameter type is shared data, the data update instruction of the shared server is obtained, and the data in the shared server is updated according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the shared server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the shared server database and update the version number corresponding to the data; The subservice updates the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number to synchronize the content and version number of the shared server and local server database; When data is written and updated to the shared server and the local server, the version number of the data is updated in real time according to the update times.

[0060] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0061] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0062] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A distributed data caching method for the financial industry, characterized in that: The method comprises the steps of: obtaining a data update request, and determining a parameter type of the data update, wherein the parameter type comprises shared data and exclusive data; If the parameter type is exclusive data, then obtain the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the local server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the local server database and update the version number corresponding to the data; If the parameter type is shared data, the data update instruction of the shared server is obtained, and the data in the shared server is updated according to the content of the update instruction; Specifically, obtain the latest version number of the required data in the shared server and compare it with the existing version number in the distributed cache database. If the version number corresponding to the required data in the subservice is higher than the existing version number in the distributed cache database, obtain the data content corresponding to the latest version number of the shared server database and update the version number corresponding to the data; The subservice updates the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number to synchronize the content and version number of the shared server and local server database; When data is written and updated to the shared server and the local server, the version number of the data is updated in real time according to the update times.

2. A distributed data caching method for the financial industry according to claim 1, characterized in that: When writing and updating data to the shared server and the local server, the step of updating the data version number in real time according to the update times includes the following steps: Acquire the real-time transmission data of the shared server and the local server according to the content of the update instruction; Writing the real-time transmission data to the shared server and the local server in the form of key-value to perform shared storage persistence, and updating and marking the version number of the real-time transmission data based on a preset version number update rule; The version numbers and write records of the shared data type and the exclusive data type on that day are recorded, and a cache log is generated. The cache log is used to query the cache records of a specified date.

3. A distributed data caching method for the financial industry according to claim 1, characterized in that: When writing and updating data to the shared server and the local server, the step of updating the data version number in real time according to the update times includes the following steps: Acquire the real-time transmission data of the sub-server, and mark the type of the real-time transmission data; Determine the data type of the real-time transmission data based on a preset data type classification rule; If the data type is exclusive data, the real-time transmission data is stored in the database of the sub-service and the version number of the data is updated; If the data type is shared data, the data is transmitted in real time and stored in the shared database and the version number of the data is updated.

4. A distributed data caching method for the financial industry according to claim 3, characterized in that: The step of acquiring the real-time transmission data of the sub-server and marking the type of the real-time transmission data includes the following steps: Obtain the transmission data of each server in the financial industry and use the real-time transmission data as real-time transmission data; Identify the content of the real-time transmission data, and generate an identifier corresponding to the real-time transmission data according to the identification result, wherein the identifier is used to indicate the data type of the real-time transmission data; The data types include user data of financial institutions, pricing parameters, financial product parameters, account data, and transaction data.

5. A distributed data caching method for the financial industry according to claim 3, characterized in that: In the step of determining the cache type of the real-time transmission data based on a preset data type classification rule, the data type classification rule classifies the data type based on the access frequency, sensitivity and update frequency corresponding to the data type.

6. A distributed data caching method for the financial industry according to claim 1, characterized in that: The steps include: after the sub-server updates the content and version number of the required data according to the data content corresponding to the latest version number and synchronizes the content and version number with the shared server, the steps include: The update status of the real-time transmission data is obtained. If the status of the real-time transmission data is still valid, the version number of the real-time transmission data is modified so that the data that is still in the valid state is cached in the server with the current version number, and the data content does not need to be updated.

7. A distributed data caching method for the financial industry according to claim 2, characterized in that: After recording the version numbers and write records of the shared data type and the exclusive data type on the day, and generating a cache log, which is used to query the cache records of the specified date, the following steps are included: Obtaining a data query instruction, and performing data retrieval on a cache of a local server according to the data query instruction; If the local server cache does not contain the corresponding data, the corresponding version number generated according to the cache log is searched from the distributed cache to obtain the corresponding data; If the distributed cache does not contain the corresponding data, the exclusive data is retrieved from the sub-service database and the shared data is retrieved from the shared database according to the data type; After the retrieval is completed, the version numbers corresponding to all data types are obtained from the shared database and synchronized to the distributed cache and sub-server cache.

8. A distributed data caching device for the financial industry, applied to a distributed data caching method for the financial industry as claimed in any one of claims 1 to 7, characterized in that: The device comprises: An update request acquisition unit (1) is used to acquire a data update request and determine a parameter type of the data update, wherein the parameter type includes shared data and exclusive data; The local server data acquisition unit (2) is used to, when the parameter type is exclusive data, acquire the data update instruction of the local server of the sub-service, and update the data in the local server of the sub-service according to the content of the update instruction. Specifically, the latest version number corresponding to the required data in the local server is acquired, and compared with the existing version number in the distributed cache database. If the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, the data content corresponding to the latest version number of the local server database is acquired, and the version number corresponding to the data is updated; A shared server data acquisition unit (3), used for, when the parameter type is shared data, acquiring a data update instruction of the shared server, and updating the data in the shared server according to the content of the update instruction, specifically, acquiring the latest version number corresponding to the required data in the shared server, and comparing it with the existing version number in the distributed cache database; if the version number corresponding to the required data in the sub-service is higher than the existing version number in the distributed cache database, acquiring the data content corresponding to the latest version number of the shared server database, and updating the version number corresponding to the data; The data content updating unit (4) is used for the sub-service to update the content and version number of the server cache and distributed cache data according to the data content corresponding to the latest version number, so as to synchronize the content and version number with the shared server and local server database.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of a distributed data caching method for the financial industry as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a distributed data caching method for the financial industry as described in any one of claims 1 to 7 are implemented.