Configurable credit accounting method and system matched with Redis and electronic equipment
By using Redis cache and idempotent annotations in the financial system, the problem of transaction data acquisition and verification under high concurrency is solved, the processing efficiency and availability of the system are improved, the rapid acquisition and real-time verification of data are realized, and the physical cost is reduced. The frequency of database queries improves the overall quality of the system.
Patent Information
- Application Number
- CN202410856219.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-28
AI Technical Summary
It is difficult for traditional financial systems to ensure data consistency and reliability in high-concurrency scenarios, resulting in transaction data processing errors and affecting fund settlement and credibility. The main problem is that rapid acquisition and real-time interception and verification of transaction data are difficult to achieve.
Using Redis as an unstructured database, by creating a new idempotent attribute parameter configuration table and custom idempotent annotations, combined with Redis cache, it can achieve rapid acquisition and real-time interception and verification of transaction data, reduce dependence on physical databases, and improve system processing efficiency. and availability.
It improves the system's high concurrent processing capabilities and data consistency, reduces hardware and network resource occupancy, reduces CPU pressure, simplifies the system process, enhances the system's robustness and readability, and reduces the cost of physical storage verification risk.
Smart Images

Figure CN118796308A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology of financial institutions, and in particular to a configurable credit accounting method, system and electronic equipment in combination with Redis. Background Art
[0002] With the rapid development of society, people's demand for funds is increasing day by day. Whether it is as small as a bottle of water or as large as a house, it is inseparable from the bank's credit accounting system, so the system is subject to huge service traffic. With the exponential increase in service inflow, the traditional single system architecture can no longer meet the existing multi-user high-concurrency mobile operation needs. Although the system is available under the microservice cluster architecture, the data consistency and reliability cannot be guaranteed, which seriously affects the normal flow of core business and will cause many data governance issues.
[0003] Most of the existing financial systems on the market still use the method of checking whether the main information elements of the request exist in the physical table to determine whether a transaction has occurred for the request. When the number of requests is small, the same transaction problem can be solved and intercepted by querying. However, if multiple requests for the same elements are made concurrently within a unit of time, the system will fail to intercept, causing the system to process transactions according to the request elements in a disordered data process, deteriorating data quality, and scenarios involving amount calculations will cause serious deviations in the resulting amount, which will ultimately affect the clearing of funds and cause financial institutions to lose funds, reputation, and goodwill.
[0004] The existing processing method is to query whether there are records in the physical table to determine whether the transaction has occurred. If the amount of data in the physical table is too large or the relevant fields do not have an index mechanism, the query time will be too long, and the occurrence of the same transaction cannot be identified in a single request transaction. In high-concurrency scenarios, the system's tolerance will be weakened, and the system will be blinded by interception and unable to identify whether it is the same transaction, which will eventually lead to transaction data misalignment and deviation in results. Therefore, the key point to solve the problem is how to quickly obtain the main information elements of transaction data. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the present invention provides a configurable credit accounting method, system and electronic device in combination with Redis, so as to solve the problem of quickly obtaining the main information elements of transaction data in the prior art and realize the problem of real-time interception and verification.
[0006] According to a first aspect of the present invention, the present invention provides a configurable credit accounting method using Redis, comprising the following steps:
[0007] Step 1: Create an idempotent attribute parameter configuration table, including: idempotent keyword, idempotent switch, whether the transaction can be repeated, cache timeout value, cache timeout unit and transaction scenario attribute column;
[0008] Step 2: Create a custom idempotent annotation;
[0009] Step 3: Create a new section to crosscut the idempotent annotation;
[0010] Step 4: Query the idempotent attribute parameter configuration table and preheat the query result through Redis;
[0011] Step 5: Get configuration information from Redis according to the scenario code and dynamically inject annotations;
[0012] Step 6: Configure annotations on the transaction methods that need to be configured according to the transaction scenario;
[0013] Step 7: When the configured expiration time is reached, Redis automatically deletes the cached transaction information.
[0014] Based on the above technical solution, the present invention can also make the following improvements.
[0015] Optionally, the idempotent attribute parameter configuration table is initialized and configured according to the requirements of the transaction scenario, and the configuration is loaded into the Redis cache when the system is running to reduce frequent database interactions.
[0016] Optionally, the idempotent annotation increases system resilience by setting default values for the annotation during the establishment process according to the differences in running systems and running conditions, and personalizes annotation properties according to the characteristics of different systems to meet the differentiated needs of different systems.
[0017] Optionally, the newly created section and the cross-cutting idempotent annotation include:
[0018] Create a new Java class for the aspect and create a surrounding aspect method;
[0019] When the status is that duplicate transactions are not allowed, the value of the corresponding transaction information is obtained according to the annotation attribute keyword. After assembling the primary key, query whether there is data in Redis to determine whether the relevant transaction information is already in the cache; if it does not exist in the cache, calculate the timeout time according to the attributes time and unit, store the transaction data in the cache and set the timeout time;
[0020] If there is a cache, the transaction result in the cache is retrieved and returned.
[0021] Optionally, querying the idempotent attribute parameter configuration table and preheating the query result through Redis includes: when the system starts, querying the database parameter configuration table, assembling the obtained results into a newly added model, and using hash type data to store model data in Redis; wherein the set key is the scene, and the value is the Json type data of the model;
[0022] Dynamically adjust the parameter acquisition and loading methods according to the characteristics of the system, and evaluate which method is more suitable for the operation of the system based on the actual situation of the system.
[0023] Optionally, the loading form is not limited to obtaining configuration information from a table structure, and the configuration information may also be obtained in a configuration file form or static parameters when the system is started and loaded into the cache.
[0024] Optionally, obtain configuration information from Redis based on the scenario code, and dynamically inject annotations including:
[0025] According to the system class attributes, match the transaction scenario code value in Redis to obtain the corresponding configuration parameter Json type data and convert it into a model;
[0026] Use Redis cache to obtain configuration information, and dynamically inject the obtained model attribute parameters into the corresponding fields of Annotation; the attribute injection of Annotation can be obtained from configuration files and static parameters, or combined in multiple ways to meet the needs of different differentiated systems.
[0027] Optionally, configuring annotations on the transaction method that needs to be configured according to the transaction scenario includes:
[0028] Load parameters from Redis to idempotent annotation properties. Annotations can be flexibly configured according to transaction scenarios. Initial transaction scenario parameters are loaded into Redis through configuration files, physical databases, or static system parameters when the system service is started. The cache is automatically refreshed after the configuration parameters are updated in real time.
[0029] According to a second aspect of the present invention, there is provided a configurable credit accounting system using Redis, comprising:
[0030] A system parameter establishment module is used to create an idempotency attribute parameter configuration table; the idempotency attribute parameter configuration table includes an idempotency keyword, an idempotency switch, a repeatable transaction flag, a cache timeout value, a cache timeout unit, and a transaction scenario attribute column; and a new custom idempotency annotation; a new section is created to cross-cut the idempotency annotation;
[0031] The system parameter calling module is used to query the idempotent attribute parameter configuration table, preheat the query result through Redis; obtain the configuration information from Redis and inject it into the annotation attribute; configure the annotation on the transaction method that needs to be configured according to the transaction scenario;
[0032] The system parameter processing module is used to automatically delete cached transaction information when the configured expiration time is reached.
[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a configurable credit accounting method in combination with Redis as described above is implemented.
[0034] Technical effects and advantages of the present invention:
[0035] The present invention provides a configurable credit accounting method, system and electronic device with Redis, which uses Redis as an unstructured database for idempotent verification, and has higher reading and writing speeds than physical storage, making the system processing more efficient, reducing frequent queries to the physical database, releasing more hardware and network resources, and reducing application CPU pressure;
[0036] Using annotations makes configuration easier, reduces duplicate logic, improves system readability, and simplifies system processing. It improves the system's high concurrency, high availability, and robustness, reduces various risks caused by the use of physical storage verification, and thus improves system quality.
[0037] Annotation parameter configuration allows parameters to be adjusted dynamically, flexibly adjusted according to different idempotence requirements, and updated in real time, thereby improving the system's configurability and reducing the difficulty of subsequent maintenance.
[0038] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flowchart of the steps of a configurable credit accounting method with Redis provided by an embodiment of the present invention;
[0040] Figure 2 It is a schematic diagram of a general flow of a request path provided by an embodiment of the present invention;
[0041] Figure 3 It is a flowchart of the Aspect internal logic method provided by an embodiment of the present invention;
[0042] Figure 4 It is a flowchart of a configuration data transfer method provided by an embodiment of the present invention;
[0043] Figure 5 It is a flowchart of a method for acquiring and converting data from a cache provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] In order to solve the problem of quickly obtaining the main information elements of transaction data, the embodiment of the present invention introduces the unstructured database Redis as the storage of key combination data.
[0046] It should be noted that Redis is a memory-based database with high read and write speed, rich data types, and easy deployment. Therefore, compared with physical disk-type databases, it has a natural advantage in reading, and only key request information elements need to be stored during the transaction, occupying less memory space. However, in order to avoid the memory occupancy of the memory database being too high as the transaction volume increases and accumulates, an expiration time is set for the information elements that fall into the memory database during each transaction. The system is implemented in JAVA language, and since this programming language is an object-oriented programming language, the system is easier to understand, develop and maintain.
[0047] It is understandable that based on the defects in the background technology, the embodiment of the present invention proposes a configurable credit accounting method with Redis, specifically as follows: Figure 1 As shown, the calculation method includes the following implementation steps:
[0048] Step 1: Create a new idempotency attribute parameter configuration table Table; the Table contains the idempotency keyword key, idempotency switch switch, repeatable transaction flag repeat, cache timeout value time, cache timeout unit unit and transaction scene attribute column. In addition, the configuration parameter table can be expanded according to actual conditions to meet the operation of the corresponding system;
[0049] The idempotency attribute parameter configuration table will be initialized according to the requirements of the transaction scenario, and the configuration will be loaded into the Redis cache when the system is running to reduce frequent database interactions. The configuration method of idempotency parameters is not limited to physical tables, and configuration files, static parameters, etc. can also be used. Different configuration strategies can be adopted according to actual conditions to meet different changing needs.
[0050] Through the above technical solution, the common parts are extracted through annotations, and a set of logic is used to intercept according to easy keywords with different configurations; the code intrusion is low.
[0051] Step 2: Create a custom idempotent annotation Annotation, which contains the idempotent keyword key, idempotent switch switch, repeatable transaction flag repeat, cache timeout value time, cache timeout unit unit and transaction scene scene.
[0052] In the above technical solution, according to the differences in the operating systems and the operating conditions, the default values can be set for the annotations during the establishment process to increase the resilience of the system, such as the default settings of key = loanNo, switch = Y, repeat = N, time = 90, unit = s, scene = repay. On this basis, the annotation attributes can be personalized according to the characteristics of different systems to meet the differentiated needs of different systems, such as adding a maximum number of transaction requests per day, and directly returning a transaction failure when the number is reached.
[0053] Through the above implementation steps, frequent database interactions can be reduced for the use of Redis.
[0054] Step 3: Create a new aspect around the idempotent annotations mentioned above; when a transaction request passes, first perform a pre-check through the Aspect;
[0055] For details of the specific process, please refer to the attached Figure 2 and attached Figure 3 As shown, the specific implementation process of creating a new section and surrounding the cross-cutting idempotent annotation is as follows:
[0056] 3.1. Create a new Aspect Java class;
[0057] 3.2. Establish the surrounding section method Method; the specific logic of Method is as follows:
[0058] 3.2.1. Determine whether the annotation switch is turned on to decide whether to use the annotation-related parameters for data interception verification. If the switch is not turned on, the communication process is carried out directly without going through the idempotent interception verification logic;
[0059] 3.2.2. Determine whether the transaction is repeatable. If it is a repeatable transaction, the transaction process is carried out directly without going through the idempotent interception verification logic;
[0060] 3.3. When the repeat status is not allowed to repeat transactions, the value of the corresponding transaction information is obtained according to the annotation attribute keyword key. After assembling the primary key, query whether there is data in Redis to determine whether the relevant transaction information is already in the cache. If it does not exist in the cache, calculate the timeout time according to the attributes time and unit, store the transaction data in the cache and set the timeout time; if it exists in the cache, take out the transaction result in the cache and return it.
[0061] In the above implementation steps, the newly created section can add some specialized processing according to the characteristics of different systems. It is not just verification and interception. Some additional functions can be performed in the cross-cutting process, such as adding printing of request start and end time in the cross-cutting logic or distributing and calling other system interfaces, etc. Specific changes need to be made according to the needs of different systems.
[0062] Through the above implementation steps, you can configure cache parameters for Redis as a cache database to achieve efficient reading and writing.
[0063] Step 4: Query the idempotent attribute parameter configuration table and preheat the query result through Redis;
[0064] Figure 4 is a flow chart of the configuration data transfer method provided by an embodiment of the present invention, and Figure 4 As shown, the specific implementation process of querying the idempotent attribute parameter configuration table is:
[0065] 4.1. When the system starts, query the database parameter configuration table Table;
[0066] 4.2. Assemble the obtained results into the newly added model;
[0067] 4.3. Use hash type data type to store model data in Redis, where the key is set to scene, the value is the Json type data of the model, and the parameters are placed in Redis.
[0068] In the implementation of the above-mentioned aspect steps, cache request information is involved. When the request is compared with the information keywords in the cache, the request information is saved. The configuration loading form is not limited to obtaining configuration information from the table structure. Configuration information can also be obtained in the form of configuration files or static parameters when the system starts and loaded into the cache. The parameter acquisition and loading methods are dynamically adjusted according to the characteristics of the system. Preheating can also choose not to query the database and load the cache when the system starts, but to use lazy loading. Only when it is used, the database is queried and saved to the Redis cache. According to the actual situation of the system, it is evaluated which method is more suitable for the operation of the system.
[0069] Step 5: Get configuration information from Redis according to the scenario code and dynamically inject annotations;
[0070] Figure 5 is a flow chart of a method for obtaining and converting data from a cache provided by an embodiment of the present invention, and Figure 5 As shown, the configuration information is obtained from Redis according to the scenario code, and the specific implementation process of dynamic annotation injection is as follows:
[0071] 5.1. Get the scene type of the configuration annotation Java class;
[0072] 5.2. Get the Json type data of the corresponding attributes from Redis according to the scene type;
[0073] 5.3. Convert JSON type data into model;
[0074] 5.4. Dynamically inject model attribute values into Annotation.
[0075] In the above technical solution, step 5 is to obtain the configuration injection annotation attributes from the cache to realize dynamic configuration annotation; the main function of the transaction scene is to obtain the corresponding configuration parameter JSON type data according to the system class attribute matching the transaction scene code value in Redis and convert it into a model, and at the same time dynamically inject the obtained model attribute parameters into the corresponding fields of Annotation, to maximize the support system to achieve changes only through configuration, and reduce the risks brought by frequent code changes. Using Redis cache to obtain configuration is mainly to reduce frequent database queries and improve system processing efficiency. Annotation attribute injection can be obtained from configuration files or static parameters, or a combination of multiple methods can be used to meet the needs of different differentiated systems.
[0076] Step 6: Configure annotations on the transaction methods that need to be configured according to the transaction scenario;
[0077] In the above technical solution, according to the requirements of the system and the differentiation of different transaction scenarios, it is necessary to configure the Annotation of different transaction scenarios on each method. When a transaction request is made, it will first enter the Annotation Aspect for processing. Multiple annotations can be configured on the same method, such as log printing or statistical request volume annotations. This implementation step adopts the configuration method, with low code intrusion. When it is not needed in the future, the idempotence can be released through configuration or the system can be rarely changed and offline.
[0078] Step 7: When the configured expiration time is reached, Redis automatically deletes the cached transaction information.
[0079] This implementation step is to automatically delete the expired data, so that no additional clearing process is required by the program. Specifically, there are time and unit in the parameter configuration. When the transaction request comes in, Redis will set the expiration time according to the configuration. When the configured expiration time is reached, Redis will automatically delete the stored data. The unit can be hour, minute, second, millisecond, and supports multiple unit type configurations to meet the different needs of the system. Multiple types of configuration settings make the system more robust. The idempotent time of different transactions needs to be determined based on the transaction characteristics and the hardware configuration to avoid slow or paralyzed system operation caused by incorrect settings. Finally, determine which business processes in the system have high concurrency, and perform annotation configuration to avoid duplicate transactions.
[0080] In summary, the embodiment of the present invention uses Redis as an unstructured database for idempotent verification, which has higher reading and writing speeds than physical storage, making the system processing more efficient, reducing frequent queries to the physical database, releasing more hardware and network resources, and reducing application CPU pressure;
[0081] Using annotations makes configuration easier, reduces duplicate logic, improves system readability, and simplifies system processing. It improves the system's high concurrency, high availability, and robustness, reduces various risks caused by the use of physical storage verification, and thus improves system quality.
[0082] Annotation parameter configuration allows parameters to be adjusted dynamically, flexibly adjusted according to different idempotence requirements, and updated in real time, thereby improving the system's configurability and reducing the difficulty of subsequent maintenance.
[0083] According to a second aspect of the present invention, a configurable credit accounting method system using Redis is provided, comprising:
[0084] A system parameter establishment module is used to create an idempotency attribute parameter configuration table; the idempotency attribute parameter configuration table includes an idempotency keyword, an idempotency switch, a repeatable transaction flag, a cache timeout value, a cache timeout unit, and a transaction scenario attribute column; and a new custom idempotency annotation; a new section is created to cross-cut the idempotency annotation;
[0085] The system parameter calling module is used to query the idempotent attribute parameter configuration table, preheat the query result through Redis; obtain the configuration information from Redis and inject it into the annotation attribute; configure the annotation on the transaction method that needs to be configured according to the transaction scenario;
[0086] The system parameter processing module is used to automatically delete cached transaction information when the configured expiration time is reached.
[0087] It can be understood that a configurable credit accounting system with Redis provided by the present invention corresponds to a configurable credit accounting method with Redis provided in the aforementioned embodiments. The relevant technical features of a configurable credit accounting system with Redis can refer to the relevant technical features of a configurable credit accounting method with Redis, which will not be repeated here.
[0088] In addition, an embodiment of the present invention further provides an electronic device, which includes: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The processor can call the logic instructions in the memory to execute the steps of the above-mentioned Redis-configurable credit accounting method.
[0089] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0090] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0092] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A configurable credit accounting method with Redis, It is characterized in that The following steps are involved: Step 1: Create an idempotent attribute parameter configuration table, including: idempotent keyword, idempotent switch, whether the transaction can be repeated, cache timeout value, cache timeout unit and transaction scenario attribute column; Step 2: Create a custom idempotent annotation; Step 3: Create a new section to crosscut the idempotent annotation; Step 4: Query the idempotent attribute parameter configuration table and preheat the query result through Redis; Step 5: Get configuration information from Redis according to the scenario code and dynamically inject annotations; Step 6: Configure annotations on the transaction methods that need to be configured according to the transaction scenario; Step 7: When the configured expiration time is reached, Redis automatically deletes the cached transaction information.
2. According to claim 1, a configurable credit accounting method with Redis, It is characterized in that The idempotent attribute parameter configuration table is initialized and configured according to the requirements of the transaction scenario, and the configuration is loaded into the Redis cache when the system is running to reduce frequent database interactions.
3. According to claim 1, a configurable credit accounting method with Redis, It is characterized in that The idempotent annotation increases system resilience by setting default values for the annotation during the establishment process according to the differences in running systems and running conditions, and personalizes the annotation properties according to the characteristics of different systems to meet the differentiated needs of different systems.
4. According to claim 1, a configurable credit accounting method with Redis, It is characterized in that The newly created aspect, surrounding the cross-cutting idempotent annotation, includes: Create a new Java class for the aspect and create a surrounding aspect method; When the status is that duplicate transactions are not allowed, the value of the corresponding transaction information is obtained according to the annotation attribute keyword. After assembling the primary key, query whether there is data in Redis to determine whether the relevant transaction information is already in the cache; if it does not exist in the cache, calculate the timeout time according to the attributes time and unit, store the transaction data in the cache and set the timeout time; If there is a cache, the transaction result in the cache is retrieved and returned.
5. According to claim 1, a configurable credit accounting method with Redis, It is characterized in that The query result of the idempotent attribute parameter configuration table through Redis preheating includes: When the system starts, query the database parameter configuration table, assemble the obtained results into the newly added model, and use hash type data to store model data in Redis; the key set is the scene, and the value is the Json type data of the model; Dynamically adjust the parameter acquisition and loading methods according to the characteristics of the system, and evaluate which method is more suitable for the operation of the system based on the actual situation of the system.
6. According to claim 5, a configurable credit accounting method with Redis, It is characterized in that The loading form is not limited to obtaining configuration information from a table structure, and the configuration information can also be obtained through a configuration file or static parameters when the system is started and loaded into the cache.
7. According to claim 1, a configurable credit accounting method with Redis, It is characterized in that Get configuration information from Redis according to the scenario code, and dynamically inject annotations including: According to the system class attributes, match the transaction scenario code value in Redis to obtain the corresponding configuration parameter Json type data and convert it into a model; Use Redis cache to obtain configuration information, and dynamically inject the obtained model attribute parameters into the corresponding fields of Annotation; the attribute injection of Annotation can be obtained from configuration files and static parameters, or combined in multiple ways to meet the needs of different differentiated systems.
8. According to claim 7, a configurable credit accounting method with Redis, It is characterized in that Configuring annotations on the transaction methods that need to be configured according to the transaction scenarios includes: Load parameters from Redis to idempotent annotation properties. Annotations can be flexibly configured according to transaction scenarios. Initial transaction scenario parameters are loaded into Redis through configuration files, physical databases, or static system parameters when the system service is started. The cache is automatically refreshed after the configuration parameters are updated in real time.
9. A configurable credit accounting system with Redis, It is characterized in that include: A system parameter establishment module is used to create an idempotency attribute parameter configuration table; the idempotency attribute parameter configuration table includes an idempotency keyword, an idempotency switch, a repeatable transaction flag, a cache timeout value, a cache timeout unit, and a transaction scenario attribute column; and a new custom idempotency annotation; a new section is created to cross-cut the idempotency annotation; The system parameter calling module is used to query the idempotent attribute parameter configuration table, preheat the query result through Redis; obtain the configuration information from Redis and inject it into the annotation attribute; configure the annotation on the transaction method that needs to be configured according to the transaction scenario; The system parameter processing module is used to automatically delete cached transaction information when the configured expiration time is reached.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, it implements a configurable credit accounting method with Redis as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method, device, equipment for realizing business idempotence, and medium
CN113703831A
Idempotent implementation method and device, computer equipment and storage medium
CN116821587A
Interface control method and device and electronic equipment
CN117749884A
Consensus key locking with fast local storage for idempotent transactions
US20230230097A1
Transaction request processing method and apparatus, and transaction transfer system
WO2022135158A1
