Financial document acquisition method and device, storage medium and server
By introducing a multi-level data caching and query mechanism into the storage system of the financial document model, the problem of wasting time and energy when users search for document template data in the huge financial document model is solved, and efficient and fast document access and users are achieved Improved experience.
Patent Information
- Application Number
- CN202411521736.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-29
AI Technical Summary
In the huge financial document model, users need to spend a lot of time and effort to find specific document template data. The existing technology may require a long response time even if advanced database query technology is used.
By introducing disk nodes, memory nodes and Redis nodes into the storage system, a multi-level data caching and query mechanism is adopted. The specific steps include receiving user's document access requests, querying in disk nodes, memory nodes and Redis nodes according to user location and usage scenarios. If hit, data will be returned directly. If hit, data will be filtered in memory nodes and Redis nodes. and merge the calculation, and finally write the result to the disk cache and return it to the user.
It significantly improves the efficiency and user experience of document access, through efficient data access and response, optimized data query and caching mechanism, flexible template data processing, intelligent data prefetching and caching update, and comprehensive data management and security guarantees.
Smart Images

Figure CN119396342A_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 vital role. They are not only an indispensable information carrier in the daily operation of enterprises, but also the key to ensuring the accuracy and compliance of financial data. However, with the expansion of enterprise scale and the increase of business complexity, financial document models have gradually shown some significant characteristics, the most prominent of which is the large amount of data and the large number of documents.
[0003] Specifically, the data carried by the financial document model often covers the entire picture of the enterprise's operations, including but not limited to sales records, purchase vouchers, expense reports, invoices, etc. These data are not only of various types, but each piece of data contains rich financial information and business details. Therefore, as the enterprise's operation time goes by and the business activities continue to increase, the amount of data in the financial document model shows an explosive growth trend.
[0004] At the same time, since there are many types of financial documents that need to be processed in daily operations of enterprises, and each document may correspond to different template formats and business processes, the number of documents in the financial document model is also considerable. This not only increases the difficulty of data management, but also brings considerable challenges to users when querying 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 effort. 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 embodiments of the present application provide a method, device, storage medium and server for obtaining financial documents, which can solve the problem that the long-term prediction results of offline training models in the prior art are not accurate. The technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for obtaining a financial document, 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 a plurality of disk nodes, the memory node set includes a plurality of memory nodes, the plurality of disk nodes and the plurality of memory nodes are in a one-to-one mapping relationship, and each disk node corresponds to an 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;
[0008] The method for obtaining the financial documents includes:
[0009] Receive a document access request from a user, the document access request carrying: a usage scenario, a user location, and a data filtering condition;
[0010] Determine a corresponding target disk node in the disk node set according to the user location, and 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 querying 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 data query condition is used to filter the public template data copy and the dynamic target data copy, the filtered public template data copy and the dynamic target data copy are merged to calculate new final document data, the new final document data is written to the target disk cache 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 target 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 a financial document, 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 query in the target disk node according to the usage scenario;
[0018] A return unit, used for returning 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 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 to query in the target memory node according to the usage scenario;
[0020] A calculation module, which is used for cloning the public template data and dynamic template data obtained by the query to generate a public template data copy and a dynamic template data copy if the target memory node is hit, filtering the public template data copy and the dynamic target data copy by using the data query condition, merging the filtered public template data copy and the dynamic target data copy to calculate new final document data, writing the new final document data to the target disk cache node, and returning the new final document data to the user;
[0021] The 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 target 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 brought about by the technical solutions provided by some embodiments of the present application include at least:
[0025] The efficiency of document access and user experience have been significantly improved 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. 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 It is a schematic diagram of the architecture of the storage system provided in the embodiment of the present application;
[0028] Figure 2 It is a flowchart of a method for obtaining financial documents provided in an embodiment of the present application;
[0029] Figure 3 It is a structural diagram of a Redis node provided in an embodiment of the present application;
[0030] Figure 4 It is a structural schematic diagram of a financial document acquisition device provided by the present application;
[0031] Figure 5 It 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 more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0033] like Figure 1 As shown, the storage system is deployed in the server, and 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, 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, 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 the final document data used, the memory node is used to cache the public template data used and all the dynamic template data in the region, and the Redis node is used to store all the public template data and all the dynamic template data, for example: the first disk node is used to cache the final document data used in Shandong Province, the first memory node caches all the dynamic target data and the public template data used in Zhejiang Province, and the Redis node is used to store all the public template data and the dynamic target data of 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 variety of data structures (such as lists, sets, hash tables, etc.) to store complex data. Redis not only provides fast access speed, but also supports data persistence (such as RDB snapshots and AOF logs) to ensure that data will not be lost after the server is restarted.
[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 as required.
[0036] The following will be combined with the attached 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 also Figure 2 , a flowchart of a method for obtaining a financial document is provided 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] Among them, the server listens to the network port and waits for the document access request sent by the user. When receiving the request, the server first parses the request header to obtain information such as the request method (such as GET, POST), request path, protocol version, etc. Then, the server parses the request body (for POST requests) and extracts the data submitted by the user. These data usually include usage scenarios (such as reimbursement, auditing, etc.), user locations (such as geographic coordinates or identifiers such as cities and provinces), and data filtering conditions (such as time ranges, amount ranges, matching values of specific fields, etc.). The server stores the parsed data in local variables or data structures for subsequent processing.
[0040] In some embodiments of the present application, see Figure 2 As shown in the figure, a primary database and multiple secondary databases are deployed in the Redis node. The primary database stores all public template data; multiple secondary databases correspond to a region respectively, and each secondary database is used to store all dynamic template data in the corresponding region. The primary database is deployed in the group company, and each secondary database is deployed in the provincial company (Zhejiang Province, Shandong Province, ..., Hebei Province).
[0041] The primary database acts as a storage center for public template data in the Redis node. It stores public template data shared by all users or business scenarios. Since public template data is usually unchanged or changes less frequently, storing them 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. 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 based on the user's location, thereby improving data access efficiency. The design of the secondary database allows data to be partitioned according to regions, which helps reduce data conflicts, improve data parallel processing capabilities, and reduce data access latency.
[0043] In some embodiments of the present application, the final document 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. This reduces the processing time on the server side and improves the response speed. After the front end receives the data in JSON format, it can directly use this data to update the UI or perform other processing without parsing it first and then converting the format. If both the front and back ends use JSON as the data exchange format, the representation of the data will be consistent between the front and back ends, which helps reduce errors caused by mismatched data formats. Data in JSON format is easy to read and debug, and both developers and testers can easily view and verify the data.
[0045] In some embodiments of the present application, when the final document data is written to the disk node, the server will attach a timestamp to the data record. This timestamp usually indicates the time when the data was created or last updated. The server needs to define a set of expiration rules that determine when a certain final document data is considered expired. For example, the data can be set to be valid within 30 days after creation, or the expiration time can be determined based on specific attributes of the data (such as the project completion date). The server can scan the final document data in the disk node regularly (such as 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 perform a deletion operation. Before deleting, some additional checks may need to be performed to ensure that data that is still in use is not accidentally deleted. For example, it can be checked whether other system components or users are referencing the data. The deletion operation should be recorded in the log for future auditing and troubleshooting. The log should contain the identification of the deleted data, the deletion time, and information about the user or system component that performed the deletion operation. After deleting the expired data, the server should ensure that the corresponding storage space is released. This may require updating the file system or database of the disk node to reflect the deleted data blocks.
[0046] During the deletion process, if any errors are encountered (such as disk failure, permission problems, etc.), the server should be able to capture these errors and take appropriate measures (such as recording error logs, notifying administrators, etc.). If the deletion operation is performed incorrectly (for example, due to incorrect timestamps or improper expiration rules), the server should have the ability 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 query in the target disk node according to the usage scenario.
[0048] Among them, the server searches for the corresponding disk node in the disk node set according to the user location information (such as city ID, province ID, etc.). This is usually implemented through a hash table or mapping table, where the user location information is used as the key and the disk node is used as the value. After determining the target disk node, the server constructs a query statement or query condition based on the usage scenario (such as querying reimbursement documents). The server performs query operations through the interface of the disk node (such as the file system API, database query interface, etc.) to retrieve the final document data that meets the usage scenario and data filtering conditions from the target disk node. 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 that is hit is returned to the user.
[0050] The server checks whether the query result is empty or contains the final document data that meets the conditions. If the query result is not empty and contains the final document data that meets the conditions, the server encapsulates the query result into an appropriate response format (such as JSON, XML, etc.). The server sets the response header, including the status code (such as 200OK), content type (such as application / JSON), etc. The server sends the encapsulated response data to the user through 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 query in the target memory node according to the usage scenario.
[0052] Among them, if the target disk node is not hit (that is, the query result is empty or does not contain the final document data that meets the conditions), the server turns to the memory node set. The server determines the target memory node associated with the target disk node based on the mapping relationship between the disk node and the memory node (such as hash table, mapping table, etc.). The server constructs the query statement or query condition according to the usage scenario and executes the query operation in the target memory node. This usually involves traversal and matching operations on the memory data structure. 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, and the data query conditions are used to filter the public template data copy and the dynamic target data copy. The filtered public template data copy and the dynamic target data copy are merged to calculate the new final document data, and the new final document data is written to the target disk cache node and the new final document data is returned to the user.
[0054] Among them, if the target memory node hits (that is, the query result is not empty and contains public template data and dynamic template data that meet the conditions), the server clones these data to generate public template data copies and dynamic template data copies. The cloning operation usually involves deep copy technology to ensure that the original data is not modified. The server performs filtering operations in the copies according to the data query conditions (such as time range, amount range, etc.) to filter out public template data and dynamic template data that meet the conditions. The server merges the filtered public template data copies and dynamic template data copies, 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 cache 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 it is determined that a data copy needs to be generated, the server will use object-level cloning technology. This technology allows the server to directly copy all fields and properties of the object in memory without serializing these objects into byte streams and then deserializing new object instances from the byte streams. In this way, the server can bypass the overhead of serialization and deserialization, thereby 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 these 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 generate a copy 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 in the cloned data copy. Since 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 target 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 quick access. The write operation usually involves an update operation on the memory data structure. The server can set a timer or trigger condition to write the data in the target memory node back to the Redis node when it is accessed a certain number of times or reaches a certain threshold 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 scenarios, user locations, and data filtering conditions carried by the user's document access request, the system can accurately locate the data range required by the user, thereby improving the pertinence and efficiency of data access. The system will prioritize the target disk node for query based on the user's location in the disk node set, and use the large capacity and persistence characteristics of disk storage to ensure data reliability and integrity. If the target disk node is hit, the data is returned directly, 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 cache 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 the generation of documents 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 to meet the document requirements in different usage scenarios.
[0063] When the target memory node is not hit, the system can query the corresponding public template data and dynamic template data in the Redis node according to the usage scenario and user location, and write them to the target memory node. This process realizes intelligent pre-fetching and cache update of data, improving the efficiency of subsequent queries. The use of Redis nodes also brings high-performance caching services, further shortening data access time and improving user experience.
[0064] The entire technical solution covers multi-level data management from disk to memory to Redis nodes, ensuring the comprehensiveness and consistency of data. By cloning data copies for filtering and calculation, the risk of directly modifying the original data is avoided, ensuring the security and integrity of the data.
[0065] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0066] See also Figure 4 , which shows a schematic diagram of the structure of a device for obtaining financial documents provided by an exemplary embodiment of the present application, hereinafter referred to as device 4. The device 4 can be implemented as all or part of the server through software, hardware or a combination of both. The 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 used 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, configured to determine a corresponding target disk node in the disk node set according to the user location, and query in the target disk node according to the usage scenario;
[0069] The return unit 403 is used 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 to query in the target memory node according to the usage scenario;
[0071] The calculation module 403 is used for cloning the public template data and dynamic template data obtained by the query to generate a public template data copy and a dynamic template data copy if the target memory node is hit, filtering the public template data copy and the dynamic target data copy by using the data query condition, merging the filtered public template data copy and the dynamic target data copy to calculate new final document data, writing the new final document data to the target disk cache node, and returning 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 target 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 according to 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 only uses the division of the above functional modules as an example when executing the method for obtaining financial documents. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the financial document acquisition device provided in the above embodiment and the financial document acquisition method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0080] The serial numbers of the above-mentioned 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, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2 The specific 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 also Figure 5 , which is a schematic diagram of the structure of a server provided in the 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 realize the connection and communication between these components.
[0085] The user interface 503 may include a display screen (Display) and a camera (Camera), and the optional 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] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts within the entire server 500, and executes various functions and processes data of the server 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.
[0088] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). 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 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program.
[0089] exist Figure 5In the server 500 shown in FIG. 1 , the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call the application stored in the memory 505 and specifically execute the following steps: Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.
[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0091] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for obtaining financial documents, characterized in that: 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 one area. The disk node is used to cache the final document data that has been used, the memory node is used to cache the public template data that has been used and all the dynamic template data in the area, and the Redis node is used to store all the public template data and all the dynamic template data; The method for obtaining the financial documents includes: Receive a document access request from a user, the document access request carrying: a usage scenario, a user location, and a data filtering condition; Determine a corresponding target disk node in the disk node set according to the user location, and 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 querying 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 data query condition is used to filter the public template data copy and the dynamic target data copy, the filtered public template data copy and the dynamic target data copy are merged to calculate new final document data, the new final document data is written to the target disk cache 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 target 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, wherein 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. According to the method described in claim 2, the first-level database is deployed in the group company, and each second-level database is deployed in the 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 by cloning the entire object level.
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 according to 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: include: 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 query in the target disk node according to the usage scenario; A return unit, used for returning the final document data of the hit to the user if the target disk node is hit; The query unit 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 to query in the target memory node according to the usage scenario; A calculation module, which is used for cloning the public template data and dynamic template data obtained by the query to generate a public template data copy and a dynamic template data copy if the target memory node is hit, filtering the public template data copy and the dynamic target data copy by using the data query condition, merging the filtered public template data copy and the dynamic target data copy to calculate new final document data, writing the new final document data to the target disk cache node, and returning the new final document data to the user; The 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 target 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, and the instructions 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 as claimed in 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
General account checking system and method, computer equipment and storage medium
CN114648397A
Template-based creation and archival of file systems
US6618736B1
Method for automatically generating financial document, device, computer apparatus, and storage medium
WO2019184123A1