Method, device, storage medium and server for obtaining financial document
By adopting a multi-level data management architecture in enterprise financial management and utilizing a combination of disk, memory, and Redis nodes for query, the problem of low data search efficiency in the financial document model is solved, achieving efficient data access and improving user experience.
Patent Information
- Application Number
- CN202411521736.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-10-29
AI Technical Summary
In corporate financial management, existing technologies make it difficult to efficiently search for specific document template data from a large financial document model, resulting in long query response time and low efficiency.
A multi-level data management architecture is adopted, including disk nodes, memory nodes and Redis nodes. The target node is located according to the user location and usage scenario, and queries and data filtering are performed to generate the final document data, ensuring the reliability and integrity of the data.
It improves the efficiency and response speed of data access, optimizes data query and caching mechanisms, enhances user experience, and realizes flexible template data processing and comprehensive data management.
Smart Images

Figure CN119396342B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method, device, storage medium and server for obtaining financial documents. Background Art
[0002] In the field of financial management, financial document models play a crucial role. They are not only an indispensable information carrier for daily business operations, but also key to ensuring the accuracy and compliance of financial data. However, as enterprises expand in size and business complexity, financial document models have gradually revealed some significant characteristics, the most prominent of which are the large amount of data and the large number of documents.
[0003] Specifically, the data contained in financial document models often encompasses the entirety of a company's operations, including but not limited to sales records, purchase vouchers, expense reports, invoices, and more. Not only is this data diverse, but each piece of data contains rich financial information and business details. Therefore, as companies operate over time and their business activities continue to expand, the amount of data in financial document models is experiencing explosive growth.
[0004] At the same time, due to the wide variety of financial documents that companies must process in their daily operations, each of which may correspond to different template formats and business processes, the number of documents in the financial document model is also quite large. This not only increases the difficulty of data management, but also poses considerable challenges for users when searching for the required document template data.
[0005] When users need to find specific document template data in a huge financial document model, it often takes a lot of time and energy. Even if advanced database query technology is used, it may take a long time to respond to meet the user's query needs. Summary of the Invention
[0006] The present invention provides a method, device, storage medium, and server for acquiring financial documents, which can solve the problem of low accuracy of long-term prediction results of offline training models in the prior art. The technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for obtaining financial documents, which is applied to a storage system including a disk node set, a memory node set, and a Redis node, wherein the disk node set includes multiple disk nodes, the memory node set includes multiple memory nodes, the multiple disk nodes and the multiple memory nodes are in a one-to-one mapping relationship, and each disk node corresponds to a region; the disk node is used to cache used final document data, the memory node is used to cache used public template data and all dynamic template data in the region, and the Redis node is used to store all public template data and all dynamic template data;
[0008] The method for obtaining the financial documents includes:
[0009] Receive a document access request from a user, the document access request carrying: usage scenario, user location, and data filtering conditions;
[0010] Determine a corresponding target disk node in the disk node set according to the user location, and perform a query in the target disk node according to the usage scenario;
[0011] If the target disk node is hit, the final document data of the hit is returned to the user;
[0012] If the target disk node is not hit, determining a target memory node associated with the target disk node in the memory node set, and performing a query in the target memory node according to the usage scenario;
[0013] If the target memory node is hit, the public template data and dynamic template data obtained by the query are cloned to generate a public template data copy and a dynamic template data copy, the public template data copy and the dynamic template data copy are filtered using the data query condition, the filtered public template data copy and the dynamic template data copy are merged to calculate new final document data, the new final document data is written to the target disk node, and the new final document data is returned to the user;
[0014] If the target memory node is not hit, the corresponding public template data and dynamic template data are queried in the Redis node according to the usage scenario and the user location, and the queried public template data and dynamic template data are written into the target memory node.
[0015] In a second aspect, an embodiment of the present application provides a device for obtaining financial documents, the device comprising:
[0016] A receiving unit, configured to receive a document access request from a user, wherein the document access request carries: a usage scenario, a user location, and a data filtering condition;
[0017] a query unit, configured to determine a corresponding target disk node in the disk node set according to the user location, and perform a query in the target disk node according to the usage scenario;
[0018] A return unit, configured to return the final document data of the hit to the user if the target disk node is hit;
[0019] The query unit is further configured to, if the target disk node is not hit, determine a target memory node associated with the target disk node in the memory node set, and perform a query in the target memory node according to the usage scenario;
[0020] a calculation module configured to, if the target memory node is hit, clone the public template data and dynamic template data obtained from the query to generate a public template data copy and a dynamic template data copy, filter the public template data copy and the dynamic template data copy using the data query condition, merge the filtered public template data copy and the dynamic template data copy to calculate new final document data, write the new final document data to the target disk node, and return the new final document data to the user;
[0021] An update module is used to query the corresponding public template data and dynamic template data in the Redis node according to the usage scenario and the user location if the target memory node is not hit, and write the queried public template data and dynamic template data into the target memory node.
[0022] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0023] In a fourth aspect, an embodiment of the present application provides a server, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0024] The beneficial effects of the technical solutions provided by some embodiments of the present application include at least:
[0025] Through efficient data access and response, optimized data query and caching mechanism, flexible template data processing, intelligent data pre-fetching and cache update, and comprehensive data management and security assurance, the efficiency of document access and user experience have been significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 work.
[0027] Figure 1 This is a schematic diagram of the architecture of the storage system provided in an embodiment of the present application;
[0028] Figure 2 This is a flowchart of a method for obtaining financial documents provided in an embodiment of the present application;
[0029] Figure 3 This is a schematic diagram of the structure of the Redis node provided in the embodiment of the present application;
[0030] Figure 4 This is a schematic diagram of the structure of a financial document acquisition device provided by this application;
[0031] Figure 5 This is a structural diagram of a server provided by this application. DETAILED DESCRIPTION
[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
[0033] like Figure 1 As shown, the storage system is deployed in a server. The storage system may include: the storage system includes a disk node set, a memory node set, and a Redis node. The disk node set includes multiple disk nodes, and the memory node set includes multiple memory nodes. The multiple disk nodes and the multiple memory nodes are in a one-to-one mapping relationship. Each disk node corresponds to a region. For example, the first disk node corresponds to Zhejiang Province, the second disk node corresponds to Shandong Province, and the corresponding first memory node corresponds to Zhejiang Province, and the second memory node corresponds to Shandong Province. The disk node is used to cache used final document data, the memory node is used to cache used public template data and all dynamic template data in the region, and the Redis node is used to store all public template data and all dynamic template data. For example, the first disk node is used to cache used final document data in Shandong Province, the first memory node caches all dynamic target data and used public template data in Zhejiang Province, and the Redis node is used to store all public template data and dynamic target data in all regions. The disk node is connected to the associated memory node, and the memory node is connected to the Redis node.
[0034] Redis is a high-performance key-value storage system that supports fast data read and write operations and provides a rich set of data structures (such as lists, sets, and hash tables) for storing complex data. Redis not only provides fast access but also supports data persistence (such as RDB snapshots and AOF logs), ensuring that data is not lost after a server restart.
[0035] It should be understood that Figure 1 The number of disk nodes, memory nodes, and Redis nodes in the example is only for reference. Any number of nodes can be used depending on the implementation requirements.
[0036] The following will be combined with the Figure 2 , the method for obtaining financial documents provided in the embodiment of the present application is described in detail. Among them, the financial document obtaining device in the embodiment of the present application can be Figure 1 The server shown.
[0037] See Figure 2 , provides a flow chart of a method for obtaining financial documents for an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0038] S201: Receive a document access request from a user.
[0039] The server listens on a network port, waiting for a user to send a document access request. Upon receiving a request, the server first parses the request header to obtain information such as the request method (e.g., GET, POST), the request path, and the protocol version. The server then parses the request body (for POST requests) and extracts the user-submitted data. This data typically includes the usage scenario (e.g., reimbursement, auditing), the user's location (e.g., geographic coordinates or identifiers such as city or province), and data filtering criteria (e.g., time range, amount range, matching values for specific fields). The server stores the parsed data in local variables or data structures for subsequent processing.
[0040] In some embodiments of this application, see Figure 2 As shown, a Redis node is deployed with a primary database and multiple secondary databases. The primary database stores all public template data. Each secondary database corresponds to a region and stores all dynamic template data in that region. The primary database is deployed at the group company, and the secondary databases are deployed at provincial companies (Zhejiang, Shandong, ..., Hebei).
[0041] Among them, the primary database acts as a storage center for common template data in Redis nodes. It stores all common template data shared by users or business scenarios. Since common template data is usually constant or changes infrequently, storing them centrally in the primary database can simplify data management and maintenance.
[0042] The secondary database is used to store dynamic template data, which is usually related to a specific region or user group and may change frequently. Multiple secondary databases correspond to one region respectively. Each secondary database is responsible for storing all dynamic template data in the corresponding region. This design enables the server to quickly locate the corresponding secondary database according to the user's location, thereby improving data access efficiency. The design of the secondary database allows data to be partitioned by region, which helps to reduce data conflicts, improve data parallel processing capability, and reduce data access delay.
[0043] In some embodiments of the present application, the final invoice data in each disk node is stored in JSON format.
[0044] Among them, since the data is already in JSON format, the server does not need to convert it to JSON again. This reduces the processing time on the server side and improves response speed. After receiving the JSON format data, the front end can directly use these data to update the UI or perform other processing without first parsing and then converting the format. If both the front end and the back end use JSON as the data exchange format, the representation of the data will remain consistent between the front end and the back end, which helps to reduce errors caused by data format mismatches. JSON format data is easy to read and debug, whether it is a developer or a tester, it can be easily viewed and verified.
[0045] In some embodiments of the present application, when finalized document data is written to a disk node, the server appends a timestamp to the data record. This timestamp typically indicates the time the data was created or last updated. The server needs to define a set of expiration rules that determine when finalized document data is considered expired. For example, data can be valid for 30 days after creation, or expiration can be determined based on specific data attributes (such as project completion date). The server can scan the finalized document data in the disk node periodically (e.g., daily, weekly, or monthly), check the timestamp of each data record, and compare it with the current time to determine which data has expired. Once expired data is detected, the server should delete it. Before deletion, additional checks may be performed to ensure that data that is still in use is not accidentally deleted. For example, checks can be performed to ensure that other system components or users are referencing the data. Deletion operations should be logged for future auditing and troubleshooting purposes. The log should contain the identity of the deleted data, the deletion time, and information about the user or system component that performed the deletion. After deleting expired data, the server should ensure that the corresponding storage space is freed. This may require updating the disk node's file system or database to reflect the deleted data blocks.
[0046] If any errors are encountered during the deletion process (such as disk failures, permission issues, etc.), the server should be able to capture these errors and take appropriate measures (such as logging errors, notifying administrators, etc.). If the deletion operation is performed incorrectly (for example, due to incorrect timestamps or improper expiration rules), the server should be able to recover the deleted data. This may require maintaining backups or snapshots of the data.
[0047] S202: Determine a corresponding target disk node in the disk node set according to the user location, and perform a query in the target disk node according to the usage scenario.
[0048] The server searches for the corresponding disk node in the disk node set based on the user's location information (such as city ID, province ID, etc.). This is typically implemented using a hash table or mapping table, with the user's location information as the key and the disk node as the value. After determining the target disk node, the server constructs a query statement or query conditions based on the use case (such as querying reimbursement documents). The server executes the query operation through the disk node's interface (such as the file system API, database query interface, etc.), retrieving the final document data from the target disk node that meets the use case and data filtering conditions. The server stores the query results in local variables or data structures for subsequent processing.
[0049] S203: If the target disk node is hit, the final document data of the hit is returned to the user.
[0050] The server checks whether the query result is empty or contains final document data that meets the requirements. If the query result is not empty and contains final document data that meets the requirements, the server encapsulates the query result into an appropriate response format (such as JSON or XML). The server sets the response header, including the status code (such as 200 OK) and the content type (such as application / JSON). The server sends the encapsulated response data to the user via the network interface.
[0051] S204: If the target disk node is not hit, determine a target memory node associated with the target disk node in the memory node set, and perform a query in the target memory node according to the usage scenario.
[0052] If the target disk node is not found (i.e., the query result is empty or does not contain the final document data that meets the conditions), the server turns to the set of in-memory nodes. The server determines the target in-memory node associated with the target disk node based on a mapping relationship between disk nodes and in-memory nodes (e.g., a hash table or mapping table). The server constructs a query statement or query conditions based on the usage scenario and executes the query operation in the target in-memory node. This typically involves traversing and matching in-memory data structures. The server stores the query results in local variables or data structures for subsequent processing.
[0053] S205. If the target memory node is hit, the public template data and dynamic template data obtained by the query are cloned to generate a public template data copy and a dynamic template data copy. The public template data copy and the dynamic template data copy are filtered using the data query conditions. The filtered public template data copy and the dynamic template data copy are merged to calculate the new final document data. The new final document data is written to the target disk node and the new final document data is returned to the user.
[0054] Among them, if the target memory node is hit (that is, the query result is not empty and contains public template data and dynamic template data that meet the conditions), the server clones this data to generate a copy of the public template data and a copy of the dynamic template data. The cloning operation usually involves deep copy technology to ensure that the original data is not modified. The server performs filtering operations in the copy according to the data query conditions (such as time range, amount range, etc.) to filter out the public template data and dynamic template data that meet the conditions. The server merges the filtered copies of the public template data and the dynamic template data, and calculates the new final document data according to the business logic, which involves traversal, matching and calculation operations on the data. The server writes the new final document data to the target disk node for subsequent fast access and persistent storage. The server encapsulates the new final document data into an appropriate response format and sends it to the user through the network interface.
[0055] Furthermore, when determining that a data copy is necessary, the server employs object-level, whole-object cloning. This technique allows the server to directly copy all fields and properties of an object in memory, without serializing the object into a byte stream and then deserializing it from the byte stream to create a new object instance. This bypasses the serialization and deserialization overhead, significantly improving the speed and efficiency of data cloning.
[0056] Furthermore, the server uses the data graph to quickly locate relevant public template data and dynamic template data based on key information such as input items, input devices, and scenario items. The data graph may contain a mapping relationship between this key information and data locations (such as memory addresses, disk offsets, or Redis keys). Once the relevant data is located, the server will make a deep copy (or a shallow copy as needed) to avoid direct modification of the original data. The server uses data query conditions (such as date range, amount range, project name, etc.) to filter the cloned data copies. Because the data graph already provides an efficient positioning mechanism, this step of filtering can be faster because it only needs to match within the located data range without traversing the entire data set.
[0057] S206: If the target memory node is not hit, query the corresponding public template data and dynamic template data in the Redis node according to the usage scenario and user location, and write the queried public template data and dynamic template data into the target memory node.
[0058] Among them, if the target memory node is not hit (that is, the query result is empty or does not contain public template data and dynamic template data that meet the conditions), the server turns to the Redis node. The server constructs a query statement or query condition based on the usage scenario and user location information, and executes the query operation in the Redis node. This usually involves access and read operations on Redis data structures, such as hash tables, lists, sets, etc. The server stores the queried public template data and dynamic template data in local variables or data structures. The server writes this data to the target memory node for subsequent fast access. The write operation usually involves an update operation on the memory data structure. The server can set a timer or trigger condition. When the data in the target memory node is accessed a certain number of times or reaches a certain threshold, it will be written back to the Redis node to achieve data persistence and load balancing.
[0059] The embodiments of the present application specifically include the following beneficial effects:
[0060] By receiving the usage scenario, user location, and data filtering criteria included in user document access requests, the system can accurately locate the data range required by the user, thereby improving the targeted and efficient data access. The system prioritizes the target disk node within the disk node set based on the user's location for query, leveraging the large capacity and persistence of disk storage to ensure data reliability and integrity. If the target disk node is matched, the data is directly returned, reducing unnecessary query overhead.
[0061] When the target disk node is not hit, the system further searches for the target memory node associated with the target disk node in the memory node set. The fast access feature of the memory node can significantly improve the query speed and reduce the response time. If the target memory node is hit, the system generates a copy by cloning the public template data and dynamic template data, and filters it using the data filtering conditions, and finally merges and calculates the new final document data. This process not only ensures the real-time nature of the data, but also avoids the risk of directly modifying the original template data. Writing the new final document data to the target disk node not only realizes the persistent storage of the data, but also provides a fast access path for similar queries in the future, further improving system performance.
[0062] The system supports the separate processing of public template data and dynamic template data, making document generation more flexible and customizable. Public template data provides the basic framework and structure of the document, while dynamic template data is filled and modified according to specific business scenarios, meeting the document requirements in different usage scenarios.
[0063] When the target memory node is not found, the system queries the corresponding public and dynamic template data in the Redis node based on the usage scenario and user location, and writes it to the target memory node. This process enables intelligent data pre-fetching and cache updates, improving the efficiency of subsequent queries. The use of Redis nodes also provides high-performance caching services, further reducing data access time and improving the user experience.
[0064] The entire technical solution encompasses multi-layered data management, from disk to memory to Redis nodes, ensuring data comprehensiveness and consistency. By cloning data copies for filtering and calculations, the risk of directly modifying the original data is avoided, ensuring data security and integrity.
[0065] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0066] See Figure 4, which shows a schematic diagram of the structure of a financial document acquisition device provided by an exemplary embodiment of the present application, hereinafter referred to as device 4. Device 4 can be implemented as all or part of a server through software, hardware, or a combination of both. Device 4 includes: a receiving unit 401, a query unit 402, a return unit 403, a calculation unit 404, and an update unit 405.
[0067] The receiving unit 401 is configured to receive a document access request from a user, wherein the document access request carries: a usage scenario, a user location, and a data filtering condition;
[0068] A query unit 402 is configured to determine a corresponding target disk node in the disk node set according to the user location, and perform a query in the target disk node according to the usage scenario;
[0069] Return unit 403, configured to return the final document data of the hit to the user if the target disk node is hit;
[0070] The query unit 402 is further configured to determine a target memory node associated with the target disk node in the memory node set if the target disk node is not hit, and perform a query in the target memory node according to the usage scenario;
[0071] The calculation module 403 is configured to, if the target memory node is hit, clone the public template data and dynamic template data obtained from the query to generate a public template data copy and a dynamic template data copy, filter the public template data copy and the dynamic template data copy using the data query condition, merge the filtered public template data copy and the dynamic template data copy to calculate new final document data, write the new final document data to the target disk node, and return the new final document data to the user;
[0072] The update module 404 is used to query the corresponding public template data and dynamic template data in the Redis node according to the usage scenario and the user location if the target memory node is not hit, and write the queried public template data and dynamic template data into the target memory node.
[0073] In one or more possible embodiments, the Redis node includes: a primary database and multiple secondary databases, the primary database stores all public template data; multiple secondary databases correspond to one area respectively, and each secondary database is used to store all dynamic template data in the corresponding area.
[0074] In one or more possible embodiments, the primary database is deployed in a group company, and each secondary database is deployed in a provincial company under the group company.
[0075] In one or more possible embodiments, the final document data in each disk node is stored in JSON format.
[0076] In one or more possible embodiments, a data copy is generated by using an object-level overall cloning method.
[0077] In one or more possible embodiments, data filtering is performed by using element positioning.
[0078] In one or more possible embodiments, the final document data stored in each disk node is provided with a timestamp; when it is detected based on the timestamp that a certain final document data in the disk node is expired, the final document data is deleted from the disk node.
[0079] It should be noted that the device 4 provided in the above embodiment, when executing the method for obtaining financial documents, only uses the division of the above-mentioned functional modules as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the above-mentioned functions. In addition, the financial document obtaining device provided in the above embodiment and the financial document obtaining method embodiment are based on the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.
[0080] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0081] The present application also provides a computer storage medium that can store multiple instructions, which are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown, the specific execution process can be found in Figure 2 The detailed description of the illustrated embodiment will not be repeated here.
[0082] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for obtaining financial documents as described in the above embodiments.
[0083] See Figure 5 , provides a structural diagram of a server according to an embodiment of the present application. Figure 5 As shown, the server 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0084] The communication bus 502 is used to implement the connection and communication between these components.
[0085] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0086] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0087] The processor 501 may include one or more processing cores. The processor 501 utilizes various interfaces and circuits to connect various components within the server 500. It executes instructions, programs, code sets, or instruction sets stored in the memory 505, and accesses data stored in the memory 505 to perform various server 500 functions and process data. Optionally, the processor 501 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 501 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display screen; and the modem handles wireless communications. It is understood that the modem may also be implemented as a separate chip, rather than integrated into the processor 501.
[0088] The memory 505 can include a random access memory (RAM) and a read-only memory (ROM). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 505 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above various method embodiments, etc.; and the data storage area can store data involved in the above various method embodiments, etc. The memory 505 can also be at least one storage device located away from the processor 501. As shown in Figure 5 The memory 505 as a computer storage medium can include an operating system, a network communication module, a user interface module, and an application program.
[0089] In the server 500 as shown in Figure 5 The user interface 503 is mainly used to provide an interface for user input and obtain user input data; and the processor 501 can be used to call an application program stored in the memory 505 and specifically execute the method as shown in Figure 2 The specific process can refer to Figure 2 which will not be described here.
[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The program can be stored in a computer readable storage medium, and when the program is executed, it can include the processes of the above-mentioned method embodiments. The storage medium can be a magnetic disc, an optical disc, a read-only memory, or a random access memory, etc.
[0091] The above disclosure is only the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so the equivalent changes made according to the claims of the present application still fall within the scope of the present application.
Claims
1. A method for obtaining financial documents, characterized in that: Applied to a storage system, the storage system includes a disk node set, a memory node set, and a Redis node, the disk node set includes multiple disk nodes, the memory node set includes multiple memory nodes, the multiple disk nodes and the multiple memory nodes are in a one-to-one mapping relationship, and each disk node corresponds to a geographical area; The disk node is used to cache the used final document data, the memory node is used to cache the used public template data and all dynamic template data in the area, and the Redis node is used to store all public template data and all dynamic template data; The method for obtaining the financial documents includes: Receive a document access request from a user, the document access request carrying: usage scenario, user location, and data filtering conditions; Determine a corresponding target disk node in the disk node set according to the user location, and perform a query in the target disk node according to the usage scenario; If the target disk node is hit, the final document data of the hit is returned to the user; If the target disk node is not hit, determining a target memory node associated with the target disk node in the memory node set, and performing a query in the target memory node according to the usage scenario; If the target memory node is hit, the public template data and dynamic template data obtained by the query are cloned to generate a public template data copy and a dynamic template data copy, the public template data copy and the dynamic template data copy are filtered using the data query condition, the filtered public template data copy and the dynamic template data copy are merged to calculate new final document data, the new final document data is written to the target disk node, and the new final document data is returned to the user; If the target memory node is not hit, the corresponding public template data and dynamic template data are queried in the Redis node according to the usage scenario and the user location, and the queried public template data and dynamic template data are written into the target memory node.
2. The method according to claim 1, characterized in that The Redis node includes: a primary database and multiple secondary databases, the primary database stores all public template data; the multiple secondary databases correspond to one area respectively, and each secondary database is used to store all dynamic template data in the corresponding area.
3. The method according to claim 2, further comprising: deploying the primary database in a group company, and deploying each secondary database in a provincial company under the group company.
4. The method according to claim 1, 2 or 3, characterized in that: The final document data in each disk node is stored in JSON format.
5. The method according to claim 4, characterized in that Generate data copies using object-level cloning.
6. The method according to claim 1 or 2 or 3 or 5, characterized in that Use element positioning to filter data.
7. The method according to claim 6, characterized in that The final document data stored in each disk node is provided with a timestamp; when it is detected based on the timestamp that a certain final document data in the disk node is expired, the final document data is deleted from the disk node.
8. A device for obtaining financial documents, characterized in that: Applied to a storage system, the storage system includes a disk node set, a memory node set, and a Redis node, the disk node set includes multiple disk nodes, the memory node set includes multiple memory nodes, the multiple disk nodes and the multiple memory nodes are in a one-to-one mapping relationship, and each disk node corresponds to a geographical area; The disk node is used to cache the used final document data, the memory node is used to cache the used public template data and all dynamic template data in the area, and the Redis node is used to store all public template data and all dynamic template data; The acquisition device includes: A receiving unit, configured to receive a document access request from a user, wherein the document access request carries: a usage scenario, a user location, and a data filtering condition; a query unit, configured to determine a corresponding target disk node in the disk node set according to the user location, and perform a query in the target disk node according to the usage scenario; A return unit, configured to return the final document data of the hit to the user if the target disk node is hit; The query unit is further configured to, if the target disk node is not hit, determine a target memory node associated with the target disk node in the memory node set, and perform a query in the target memory node according to the usage scenario; a calculation module configured to, if the target memory node is hit, clone the public template data and dynamic template data obtained through the query to generate a public template data copy and a dynamic template data copy, filter the public template data copy and the dynamic template data copy using a data query condition, merge the filtered public template data copy and the dynamic template data copy to calculate new final document data, write the new final document data to the target disk node, and return the new final document data to the user; An update module is used to query the corresponding public template data and dynamic template data in the Redis node according to the usage scenario and the user location if the target memory node is not hit, and write the queried public template data and dynamic template data into the target memory node.
9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 7.
10. A server, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps according to any one of claims 1 to 7.
Citation Information
Patent Citations
Online digital traditional Chinese medicine platform system
CN106709074A
Cache optimization method for reading performance of KV storage system based on LSM-tree
CN114398007A