Redis-based account journal voucher construction method and system

By introducing a Redis database into accounting entry management and using key-value format to store and filter data, the problem of slow accounting entry code processing speed was solved, and efficient data processing and systematic management were achieved.

CN117271509BActive Publication Date: 2026-02-27WUHAN ZBANK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311198030.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2026-02-27
Estimated Expiration
2043-09-15

AI Technical Summary

Technical Problem

The management and classification of accounting entry codes in existing technologies are slow, especially when dealing with large amounts of data, and cannot meet the needs of electronic data processing.

Method used

By employing Redis database technology, an account entry detail table based on Redis is built, using key-value format to store business data, and filtering the Redis storage table during queries to improve processing speed.

Benefits of technology

It significantly improved the processing speed of accounting account entry details and achieved the standardization and systematization of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271509B_ABST
    Figure CN117271509B_ABST
Patent Text Reader

Abstract

The application provides a Redis-based account journal voucher construction method and system, and belongs to the technical field of databases, and comprises the following steps: obtaining a target accounting journal code, determining a Redis storage table of the target accounting journal code; obtaining business data, and storing the business data in a Redis database in a preset format; connecting the Redis database, calling a query database in the target accounting journal code, and if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to preset parameter values, and returning list data. By introducing the Redis database, the application can greatly improve the operation processing speed when constructing an accounting account journal voucher, and improve the standardization and systematization of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of database technology, in particular to a Redis-based account journal voucher construction method and system. BACKGROUND

[0002] The accounting entry code is also known as the "accounting entry standard code". It is a code for accounting entry. It is composed of accounting transaction code and accounting subject code. If time is wasted on entries in electronic data processing, even if the machine processing speed is very fast, the effect of using electronic data processing equipment will be lost. Therefore, it is necessary to simplify the procedures for preparing entries and try to concentrate on designing daily entries, while standardizing, standardizing and serializing difficult-to-understand and infrequently-occurring entries. In electronic data processing accounting, accounting entries can be prepared using uniformly designed accounting subject codes and standardized accounting transaction codes.

[0003] The management and classification of accounting entry codes, standardized table statistics and management play a crucial role. The current management generation method is generally slow, especially when the data volume is large, the efficiency is relatively low

[0004] Therefore, it is necessary to introduce a relatively mature application database technology to assist in management. SUMMARY

[0005] The present application provides a Redis-based account journal voucher construction method and system to solve the defect of slow processing speed in the prior art when constructing an accounting account journal voucher.

[0006] In a first aspect, the present application provides a Redis-based account journal voucher construction method, comprising:

[0007] Obtain the target accounting entry code, and determine the Redis storage table of the target accounting entry code;

[0008] Obtain business data, and store the business data in a Redis database in a preset format;

[0009] Connect the Redis database, call the query database in the target accounting entry code, and if it is determined that the Redis database contains the Redis storage table, filter the Redis storage table according to a preset parameter value, and return list data.

[0010] According to the Redis-based account journal voucher construction method provided by the present application, the Redis storage table of the target accounting entry code is determined, comprising:

[0011] An acquisition storage data and read data Redis configuration class is determined, and a calling interface of the Redis configuration class is determined;

[0012] A hash type in Redis is determined as a data storage type, a key in Redis is determined as a storage table name, and a value is determined as storage data, and the Redis storage table is constructed.

[0013] According to the account journal detail table construction method based on Redis provided by the application, business data is acquired, and the business data is stored in a Redis database in a preset format, and the method comprises the following steps:

[0014] The business data is converted into a data configuration table in a key-value format;

[0015] All the data configuration tables are imported into the Redis database.

[0016] According to the account journal detail table construction method based on Redis provided by the application, the business data is converted into a data configuration table in a key-value format, and the method comprises the following steps:

[0017] A username ID is determined as a table name, a hash is determined as table data list, and the hash comprises a field and a value.

[0018] According to the account journal detail table construction method based on Redis provided by the application, the Redis database is connected, and a query database in a target accounting entry code is called, and the method comprises the following steps:

[0019] Before connecting an actual database, a Redis database is connected in a dao layer of the query database;

[0020] The query database in the Redis database is acquired according to a table name of the dao layer.

[0021] According to the account journal detail table construction method based on Redis provided by the application, if it is determined that the Redis database comprises the Redis storage table, the Redis storage table is filtered according to a preset parameter value, and list data is returned, and the method comprises the following steps:

[0022] The Redis storage table in the query database is acquired;

[0023] Parameter operation is performed based on the preset parameter value, the Redis storage table is filtered to obtain the list data;

[0024] The list data is returned.

[0025] According to the application, a Redis-based account journal voucher construction method is provided, and after connecting the Redis database and calling the database query in the target accounting entry code, the method further comprises the following steps:

[0026] If it is determined that the Redis database does not contain the Redis storage table, the Redis storage table is continuously queried, and the newly queried data is updated to the Redis database.

[0027] In a second aspect, the application further provides a Redis-based account journal voucher construction system, comprising:

[0028] The obtaining module is configured to obtain a target accounting entry code and determine a Redis storage table of the target accounting entry code.

[0029] The storage module is configured to obtain business data and store the business data in a Redis database in a preset format.

[0030] The connecting module is configured to connect the Redis database, call the database query in the target accounting entry code, and if it is determined that the Redis database contains the Redis storage table, filter the Redis storage table according to a preset parameter value and return list data.

[0031] In a third aspect, the application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the Redis-based account journal voucher construction method according to any one of the above aspects when executing the program.

[0032] In a fourth aspect, the application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the Redis-based account journal voucher construction method according to any one of the above aspects.

[0033] The Redis-based account journal voucher construction method and system provided by the application can greatly improve the operation processing speed and improve the data processing standardization and systematization when constructing the accounting account journal voucher by introducing the Redis database. BRIEF DESCRIPTION OF DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0035] Figure 1 is a flowchart of the Redis-based account journal voucher construction method provided by the present application;

[0036] Figure 2 is a Redis data table storage type schematic diagram provided by the present application;

[0037] Figure 3 is a structural schematic diagram of the Redis-based account journal voucher construction system provided by the present application;

[0038] Figure 4 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION

[0039] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0040] Figure 1 is a flowchart of the Redis-based account journal voucher construction method provided by the present application, as shown in Figure 1 , including:

[0041] Step 100: obtaining a target accounting journal code, and determining a Redis storage table of the target accounting journal code;

[0042] Step 200: obtaining business data, and storing the business data in a Redis database in a preset format;

[0043] Step 300: connecting the Redis database, calling a query database in the target accounting journal code, and if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data.

[0044] Specifically, in view of the problem that the speed of generating journal vouchers in batches is too slow in the current financial management, the Redis-based account journal voucher construction method provided by the present application can improve the end-of-day execution time. The main steps include:

[0045] determining the tables that need to be placed in Redis, querying all table data before task execution, and storing the data of all tables in Redis in the form of key and value;

[0046] In the method of calling the generation of accounting record code, the Redis is connected to determine whether the data of the table is contained in the Redis.

[0047] If the data of the table is contained in the Redis, the corresponding column information is returned according to the method input parameter, otherwise the database is continuously queried.

[0048] The present application can greatly improve the operation processing speed and improve the data processing standardization and systematization by introducing the Redis database when constructing the accounting account journal detail table.

[0049] Based on the above embodiment, the Redis storage table of the target accounting record code is determined, including:

[0050] The storage data and reading data Redis configuration class are obtained, and the calling interface of the Redis configuration class is determined.

[0051] It is determined that the hash type in the Redis is used as the data storage type, the key in the Redis is used as the storage table name, and the value is used as the storage data, and the Redis storage table is constructed.

[0052] The present application embodiment needs to define a new Redis storage method as a common method when all table storage methods are used for subsequent data storage.

[0053] Specifically, first, a Redis configuration class is added as a core class for accessing data, which is used for storing data and reading data in subsequent processing, and a corresponding interface is created for implementing the interface calling specific method during running.

[0054] The data type of the table data uses the hash in the Redis basic type, the key needs to be stored in the table name of the table in the Redis, and the value is the specific data.

[0055] Based on the above embodiment, the business data is obtained, and the business data is stored in the Redis database in a preset format, including:

[0056] The business data is converted into a data configuration table in a key-value format.

[0057] All data configuration tables are imported into the Redis database.

[0058] The business data is converted into a data configuration table in a key-value format, including:

[0059] The user name ID is determined as the table name, the hash is determined as the table data list, and the hash includes the field and the value.

[0060] The embodiment of the application needs to assemble the business data in a corresponding format, unify the different tables into a format, store them into Redis, add a formatting method, and format the different tables.

[0061] Specifically, after the business data is queried, the table needed for generating the journal entry is generated before the code for generating the accounting journal is called, and all the tables are queried into Redis without conditions, because the tables are configuration tables and the data volume is not large, so there is no pressure on Redis, and then the storage format is key, value form, the key is the table name, and the value is the collection of all data.

[0062] The storage type is as shown in the table. Figure 2 The user ID corresponds to the table name, the hash corresponds to the list of specific table data, the field in the list includes the name label, the age label and the birthday label and the like, and the value includes the name data, the age data and the birthday data.

[0063] Based on the above embodiment, the Redis database is connected, the query database in the target accounting journal code is called, and the query database includes:

[0064] Before connecting the actual database, the Redis database is connected in the dao layer of the query database;

[0065] The Redis database in the query database is obtained according to the table name of the dao layer.

[0066] If it is determined that the Redis database contains the Redis storage table, the Redis storage table is filtered according to the preset parameter value, and the list data is returned, including:

[0067] The Redis storage table in the query database is obtained;

[0068] The Redis storage table is filtered to obtain the list data based on the preset parameter value;

[0069] The list data is returned.

[0070] The embodiment of the application is directed to the Redia data operation, including data formatting, data storage into Redis, data taking out from Redis, Redis data refreshing, Redis data updating, Redis data deleting, Redis data modifying and the like, so that a unified interface can be used for processing when the Redis needs to be operated subsequently.

[0071] Specifically, in the dao layer of the query database, before actually linking the database, Redis is linked first, if the linking is successful, and the data of the table existing in Redis is found according to the table name of the dao layer, then the specific data is filtered out according to the parameter value of the method input parameter, and is returned.

[0072] Based on the above embodiment, after connecting the Redis database and calling the query database in the target accounting entry code, the following is further included:

[0073] If it is determined that the Redis database does not contain the Redis storage table, the Redis storage table is continued to be queried, and the new data found by the query is updated to the Redis database.

[0074] Specifically, according to the above embodiment, if there is no data in Redis, after the data is queried, the new data is put into Redis.

[0075] It should be noted that since the original entry generation method needs to be modified, for the dao layer of the previous table, a new upper layer method needs to be added, which will first judge whether the table exists in Redis, if it exists, the data is taken out, if it does not exist, the table is continued to be queried, and is updated into Redis, waiting for the subsequent thread to be used.

[0076] The Redis-based account entry detail table construction system provided by the application is described below, and the Redis-based account entry detail table construction system described below can be correspondingly referred to the Redis-based account entry detail table construction method described above.

[0077] Figure 3 is a structural schematic diagram of the Redis-based account entry detail table construction system provided by the embodiment of the application, as Figure 3 shown, comprising: an acquisition module 31, a storage module 32 and a connection module 33, wherein:

[0078] The acquisition module 31 is used for acquiring a target accounting entry code and determining a Redis storage table of the target accounting entry code; the storage module 32 is used for acquiring business data and storing the business data in a Redis database in a preset format; and the connection module 33 is used for connecting the Redis database, calling a query database in the target accounting entry code, if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data.

[0079] Figure 4 An example of an entity structure schematic diagram of an electronic device is shown in Figure 4As shown, the electronic device can include a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 complete mutual communication through the communications bus 440. The processor 410 can invoke a logical instruction in the memory 430 to execute a Redis-based account journal detail table construction method, which includes: obtaining a target accounting journal code, determining a Redis storage table of the target accounting journal code; obtaining business data, storing the business data in a Redis database in a preset format; connecting the Redis database, invoking a query database in the target accounting journal code, and if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data.

[0080] In addition, the logical instruction in the memory 430 described above can be implemented in the form of a software functional unit and sold or used as an independent product, and can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0081] On the other hand, the present application also provides a computer program product, which includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, and the computer can execute the Redis-based account journal detail table construction method provided by the above-mentioned method, which includes: obtaining a target accounting journal code, determining a Redis storage table of the target accounting journal code; obtaining business data, storing the business data in a Redis database in a preset format; connecting the Redis database, invoking a query database in the target accounting journal code, and if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data.

[0082] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements a Redis-based account journal line item construction method provided by each of the above methods, the method comprising: obtaining a target accounting journal code, determining a Redis storage table of the target accounting journal code; obtaining business data, storing the business data in a Redis database in a preset format; connecting the Redis database, calling a query database in the target accounting journal code, and if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data.

[0083] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0084] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the method described in each embodiment or some part of the embodiment.

[0085] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A Redis-based account journal line item construction method, characterized in that, The method comprises the following steps: obtaining a target accounting entry code, determining a Redis storage table of the target accounting entry code; obtaining business data, and storing the business data in a Redis database in a preset format; connecting the Redis database, calling a query database in the target accounting entry code, and if it is determined that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data. In the step of obtaining business data and storing the business data in a Redis database in a preset format, the method comprises the following steps: converting the business data into a data configuration table in a key-value format, determining a username ID as a table name, a hash as table data list, and the hash comprising a field and a value; importing all the data configuration tables into the Redis database; after the business data is queried, before the generation of an accounting entry code is called, a table required for generating an entry is queried into the Redis without conditions. 2.The Redis-based account journal voucher building method of claim 1, wherein, In the step of determining the Redis storage table of the target accounting entry code, the method comprises the following steps: obtaining a storage data and reading data Redis configuration class, and determining a calling interface of the Redis configuration class; determining that a hash type in the Redis is used as a data storage type, a key in the Redis is used as a storage table name, and a value is used as storage data, and constructing the Redis storage table. 3.The Redis-based account journal voucher building method of claim 1, wherein, In the step of connecting the Redis database and calling the query database in the target accounting entry code, the method comprises the following steps: before connecting an actual database, connecting a Redis database in a dao layer of the query database; obtaining the query database in the Redis database according to a table name of the dao layer.

4. The Redis-based account journal ledger building method of claim 3, wherein, In the step of determining that the Redis database contains the Redis storage table, filtering the Redis storage table according to a preset parameter value, and returning list data, the method comprises the following steps: obtaining the Redis storage table in the query database; performing a parameter input operation based on the preset parameter value, filtering the Redis storage table to obtain the list data; and returning the list data.

5. The Redis-based account journal ledger building method of claim 1, wherein, After the step of connecting the Redis database and calling the query database in the target accounting entry code, the method further comprises the following steps: if it is determined that the Redis database does not contain the Redis storage table, continuing to query the Redis storage table, and updating new data queried to the Redis database.

6. A Redis-based account journal line item building system based on the Redis-based account journal line item building method according to any one of claims 1 to 5, characterized by, The method comprises the following steps: a obtaining module is configured to obtain a target accounting entry code, and determine a Redis storage table of the target accounting entry code; a storage module is configured to obtain business data, and store the business data in a Redis database in a preset format; a connecting module is configured to connect the Redis database, call a query database in the target accounting entry code, and if it is determined that the Redis database contains the Redis storage table, filter the Redis storage table according to a preset parameter value, and return list data.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the Redis-based account journal voucher building method according to any one of claims 1-5 when executing the program.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the Redis-based account journal voucher building method according to any one of claims 1-5 when executed by the processor.

Citation Information

Patent Citations

  • Method and apparatus for generating accounting entry

    CN109034988A

  • Tax data conversion method and system

    CN110515993A

  • RAC multi-node database query method, device and system

    CN111581234A