A method to reduce the time consumption of calling services

By introducing a multi-level caching mechanism and distributed processing of transaction flows in the financial payment industry, the problem of increasing time-consuming caused by service link extension is solved, and the service timeliness and stability is improved, and high concurrency and data persistence is supported. to avoid single-node downtime and network fluctuations.

CN112783926BActive Publication Date: 2025-01-17SHENZHEN YINSHENG E-PAY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110077708.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-20
Publication Date
2025-01-17
Estimated Expiration
2041-01-20

AI Technical Summary

Technical Problem

In the financial payment industry, due to the increase in business iteration and system complexity, the service link is extended, and the total time-consuming of sub-services increases, affecting the timeliness and competitiveness of the product.

Method used

Adopt management platform, zookeeper, database and Internet trading system, combined with the transaction module and configuration module that distributes transaction flow processing, through a multi-level caching mechanism (first-level caffeine local cache and first-level redis cache cluster, second-level caffeine local cache and second-level caffeine local cache and second-level caffeine local cache and second-level caffeine Level redis cache cluster) optimizes data query, monitors node changes, and uses SpringCache and AOP surface mechanisms to improve cache efficiency and avoid network fluctuations and thread blockage.

Benefits of technology

It reduces the time-consuming service calls, improves service timeliness and stability, supports distributed deployment, avoids single-node downtime, realizes data persistence and high concurrency capabilities, and timely records cached exceptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112783926B_ABST
    Figure CN112783926B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for reducing the time consumption of calling services, relates to the field of financial payment technology, includes a management platform, zookeeper, a database and an Internet transaction system, zookeeper includes multiple node information, the management platform can modify the node information of zookeeper, the Internet system includes a transaction module and a configuration module that can process transaction flow in a distributed manner, the transaction module issues an instruction to call the data of the configuration module, the configuration module accesses the database according to the instruction requirements, retrieves the query result and returns the retrieved result to the transaction module, the transaction module and the configuration module can update the cache according to the query result, and monitor the node changes of zookeeper. The present invention utilizes distributed cache middleware to improve the timeliness of transaction flow in business processing, and optimizes the processing flow on this basis, reasonably and effectively allocates task resources, and greatly improves the market competitiveness of products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial payment, and in particular to a method for reducing the time consumption of calling a service. Background Art

[0002] Currently in the financial payment industry, in addition to ensuring the stability and security of service provision, whether the product service can make customers feel fast and efficient is also a very important core competitiveness.

[0003] Due to the continuous expansion and innovation of industry services. With the continuous iteration of business, business data is accumulated and innovated in system services, and the system service links are constantly extending. The complexity of system services is also increasing, resulting in the total time consumption of each sub-service rising, which will gradually erode the advantages of the product. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, a method for reducing the time consumption of calling a service of the present invention can reduce the time consumption of service calling and improve the timeliness of the service.

[0005] The technical solution adopted by the present invention to solve the technical problem is: a method for reducing the time consumption of calling a service, the improvement of which is that it includes a management platform, a zookeeper, a database and an Internet transaction system, the zookeeper includes a plurality of node information, and the management platform can modify the node information of the zookeeper;

[0006] The Internet system includes a transaction module and a configuration module that can process transaction flows in a distributed manner. The transaction module issues instructions to call data from the configuration module. The configuration module accesses the database according to the instruction requirements, retrieves the query results and returns the retrieved results to the transaction module. The transaction module and the configuration module can update the cache according to the query results and monitor the node changes of Zookeeper.

[0007] As a further improvement of the above technical solution, the transaction module includes a first-level caffeine local cache unit, a first-level redis cache cluster and a product service module;

[0008] The product service module issues instructions to call the data of the configuration module. According to the data returned by the configuration module, the first-level caffeine local cache unit is queried first. When the first-level caffeine local cache unit cannot be queried, the first-level redis cache cluster is queried.

[0009] As a further improvement of the above technical solution, the result returned by the configuration module can be directly refreshed, and the refreshed data is stored in the first-level caffeine local cache unit. The first-level caffeine local cache unit runs asynchronous refresh data and stores the refreshed data in the first-level redis cache cluster.

[0010] As a further improvement of the above technical solution, the configuration module includes a secondary caffeine local cache unit, a secondary redis cache cluster and a sub-service module;

[0011] The sub-service module issues a command to call the database data, and first queries the secondary caffeine local cache unit based on the data returned by the database. When the secondary caffeine local cache unit cannot be found, it queries the secondary redis cache cluster.

[0012] As a further improvement of the above technical solution, the results returned by the database can be directly refreshed, and the refreshed data is stored in the secondary caffeine local cache unit. The secondary caffeine local cache unit runs asynchronous refresh data and stores the refreshed data in the secondary redis cache cluster.

[0013] As a further improvement of the above technical solution, the sub-service module includes a client cache unit.

[0014] As a further improvement of the above technical solution, the Internet transaction system includes SpringCache, which forms a multi-level cache mechanism with the first-level caffeine local cache unit and the first-level redis cache cluster. The first business processing result is preferentially saved in the first-level caffeine local cache unit and an expiration time is set. The result is asynchronously refreshed to the first-level redis cache cluster and persisted. The next request is preferentially queried using the local cache, or the result is obtained through the redis persistent data query;

[0015] SpringCache forms a multi-level cache mechanism with the secondary caffeine local cache unit and the secondary redis cache cluster. The first business processing result is saved in the secondary caffeine local cache unit and the expiration time is set. The result is asynchronously refreshed to the secondary redis cache cluster and persisted. The next request will use the local cache for query first, or get the result through the redis persistent data query.

[0016] As a further improvement of the above technical solution, the Internet transaction system includes a public interface to facilitate the storage of transaction business processing results in the cache.

[0017] As a further improvement of the above technical solution, the Internet transaction system includes a monitor for constantly recording cache anomalies to facilitate the use of a cache switch to fuse the cache call.

[0018] As a further improvement of the above technical solution, the Internet transaction system includes utilizing the AOP aspect mechanism in combination with thread variables to form a dynamic cache switch.

[0019] As a further improvement of the above technical solution, the Internet transaction system includes a section interceptor provided at the entire cache entrance.

[0020] The beneficial effects of the present invention are:

[0021] 1. Reduce the time consumption of service calls and improve the timeliness of services;

[0022] 2. Avoid network fluctuations, thread blocking and long resource competition, and improve service stability;

[0023] 3. Support distributed deployment and provide cluster services to avoid service failure caused by single node downtime;

[0024] 4. Data persistence, timely service update or restart, stored data is always valid;

[0025] 5. Support high concurrency of requests and improve the load capacity of the service.

[0026] 6. The present invention is used to record cache abnormalities at all times, making it easier to use a cache switch to fuse the cache call. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a structural framework diagram of the present invention. DETAILED DESCRIPTION

[0028] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0029] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.

[0030] The present invention discloses a method for reducing the time consumption of calling services, comprising a management platform, a zookeeper, a database and an Internet transaction system, wherein the zookeeper comprises a plurality of node information, the management platform can modify the node information of the zookeeper, the Internet system comprises a transaction module and a configuration module which can process transaction flows in a distributed manner, the transaction module issues an instruction to call the data of the configuration module, the configuration module accesses the database according to the instruction requirements, retrieves the query results and returns the retrieved results to the transaction module, the transaction module and the configuration module can update the cache according to the query results and monitor the node changes of the zookeeper.

[0031] In the above embodiment, the present invention utilizes distributed processing of transaction flows (cache middleware) to improve the timeliness of transaction flows in business processing, and at the same time optimizes the processing flow on this basis, reasonably and effectively allocates task resources, and greatly improves the market competitiveness of the product.

[0032] For further reference, Figure 1 The transaction module includes a first-level caffeine local cache unit, a first-level redis cache cluster and a product service module. The product service module issues an instruction to call the data of the configuration module. According to the data returned by the configuration module, the first-level caffeine local cache unit is queried first. When the first-level caffeine local cache unit cannot be queried, the first-level redis cache cluster is queried. The result returned by the configuration module can be refreshed directly, and the refreshed data is stored in the first-level caffeine local cache unit. The first-level caffeine local cache unit runs asynchronous refresh data and stores the refreshed data in the first-level redis cache cluster.

[0033] Furthermore, the configuration module includes a secondary caffeine local cache unit, a secondary redis cache cluster, and a sub-service module. The sub-service module issues an instruction to call the data of the database, and first queries the secondary caffeine local cache unit according to the data returned by the database. When the secondary caffeine local cache unit cannot be queried, the secondary redis cache cluster is queried. The result returned by the database can be directly refreshed, and the refreshed data is stored in the secondary caffeine local cache unit. The secondary caffeine local cache unit runs asynchronous refresh data and stores the refreshed data in the secondary redis cache cluster.

[0034] The product service module has a calling end for calling the data of the configuration module, and the sub-service module has a service end for accessing the database. In order to ensure the high efficiency of product services, the present invention will reduce the time consumption and network overhead of sub-services by caching the result service of the subsystem when the business link cannot be reduced, and at the same time greatly improve the load capacity and stability of product services.

[0035] Furthermore, the Internet transaction system includes SpringCache, which forms a multi-level cache mechanism with the first-level caffeine local cache unit and the first-level redis cache cluster. The first business processing result is saved in the first-level caffeine local cache unit and an expiration time is set. The result is asynchronously refreshed to the first-level redis cache cluster and persisted. The next request is queried using the local cache first, or the result is obtained through the redis persistent data query.

[0036] SpringCache forms a multi-level cache mechanism with the secondary caffeine local cache unit and the secondary redis cache cluster. The first business processing result is saved in the secondary caffeine local cache unit and the expiration time is set. The result is asynchronously refreshed to the secondary redis cache cluster and persisted. The next request will use the local cache for query first, or get the result through the redis persistent data query.

[0037] In the above embodiment, the springCache framework is introduced, and a set of caffeine local cache and a set of redis cluster are used to form a multi-level cache mechanism. The first business processing result is saved in the caffeine local cache first and the expiration time is set, and then the result is asynchronously refreshed to the redis cluster in the same module as the caffeine local cache unit for caching and persistence. The local cache is also used for querying in priority for the next request. At the same time, when the cache result is removed due to service restart, local cache expiration or insufficient space, the result can also be queried through redis persistent data. (Here is an additional explanation: 1. The local cache is saved in memory, so the service restart will reset the service memory data. Redis saves the data to the cluster server and the space is much larger than the local cache, so the above problem does not exist. 2. In terms of service time consumption, local cache query is less than redis cache query (because of network time consumption), and redis cache query is less than calling the interface to re-obtain the result (in addition to network time consumption, there is a lot of business logic that needs to be reprocessed)).

[0038] Furthermore, the Internet trading system includes a public interface to facilitate the storage of transaction processing results in the cache. A distributed redis framework (a primary redis cache cluster and a secondary redis cache cluster) is introduced into the Internet trading system, and the sentinel mode in the redis framework is used to inject services into the Internet trading system, providing a public interface to facilitate the storage of transaction processing results in the cache and subsequent queries, and supporting the consistency of transaction transactions.

[0039] Furthermore, the sub-service module includes a client cache unit. Since there are multiple nodes supporting access in the product of the present invention, in order to improve the hit rate of the cache, a new cache is added to the client, and a corresponding cache is also added to the server, that is, the client cache unit. When one of the nodes is not hit or the service is down, it can also ensure that the server can provide normal service within a period of time.

[0040] In addition, the Internet transaction system includes a monitor that is used to record cache anomalies at all times, making it easier to use the cache switch to fuse the cache call. At the same time, considering that due to the existence of the cache, the transaction information configuration cannot take effect in real time when the information changes, so the relevant cache configuration will take effect with a certain delay. Therefore, based on the node information changes of Zookeeper, the monitoring unit monitors the node at all times, and triggers the cache update operation through the node changes. In this way, for some special business configurations that require high timeliness, the operation colleagues can manually and actively trigger the update.

[0041] Finally, the Internet trading system includes a dynamic cache switch formed by combining the AOP aspect mechanism with thread variables. The Internet trading system includes a aspect interceptor at the entire cache entrance. Considering that there are certain risks in the cache, in order to ensure the strong consistency of some transaction information, the AOP aspect mechanism is combined with thread variables to form a dynamic cache switch for specifying transaction services with high timeliness requirements. At the entire cache entrance, the aspect interceptor is used to mark the entire specified task chain as using the cache for a series of transactions. At the same time, in order to avoid cache exceptions after the cache solution is launched, the cache is marked at the beginning using a dynamically configured cache switch to ensure the stability of the transaction after the cache exception.

[0042] The beneficial effects of the present invention are:

[0043] 1. Reduce the time consumption of service calls and improve the timeliness of services;

[0044] 2. Avoid network fluctuations, thread blocking and long resource competition, and improve service stability;

[0045] 3. Support distributed deployment and provide cluster services to avoid service failure caused by single node downtime;

[0046] 4. Data persistence, timely service update or restart, stored data is always valid;

[0047] 5. Support high concurrency of requests and improve the load capacity of services;

[0048] 6. The present invention is used to record cache abnormalities at all times, making it easier to use a cache switch to fuse the cache call.

[0049] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A method for reducing the time consumption of calling a service, characterized in that: It includes a management platform, zookeeper, a database and an Internet transaction system. Zookeeper includes multiple node information. The management platform can modify the node information of zookeeper. The Internet system includes a transaction module and a configuration module for distributed processing of transaction flows. The transaction module issues instructions to call the data of the configuration module. The configuration module accesses the database according to the instruction requirements, retrieves the query results and returns the retrieved results to the transaction module. The transaction module and the configuration module update the cache according to the query results and monitor the node changes of Zookeeper. The transaction module includes a first-level caffeine local cache unit, a first-level redis cache cluster and a product service module; the product service module issues an instruction to call the data of the configuration module, and first queries the first-level caffeine local cache unit according to the data returned by the configuration module, and queries the first-level redis cache cluster when the first-level caffeine local cache unit cannot be queried; The configuration module includes a secondary caffeine local cache unit, a secondary redis cache cluster and a sub-service module; the sub-service module issues an instruction to call the data in the database, and first queries the secondary caffeine local cache unit according to the data returned by the database, and queries the secondary redis cache cluster when the secondary caffeine local cache unit cannot be queried; The Internet transaction system includes SpringCache, which forms a multi-level cache mechanism with the first-level caffeine local cache unit and the first-level redis cache cluster. The first business processing result is saved in the first-level caffeine local cache unit and the expiration time is set. The result is asynchronously refreshed to the first-level redis cache cluster and persisted. The next request uses the local cache for query. When the cached result is removed due to service restart, local cache expiration or insufficient space, the result is queried through the redis persistent data. SpringCache forms a multi-level cache mechanism with the secondary caffeine local cache unit and the secondary redis cache cluster. The first business processing result is saved in the secondary caffeine local cache unit first and the expiration time is set. The result is asynchronously refreshed to the secondary redis cache cluster and persisted. The next request uses the local cache for query. When the cached result is removed due to service restart, local cache expiration or insufficient space, the result is queried through the redis persistent data. The result returned by the configuration module is directly refreshed, and the refreshed data is stored in the first-level caffeine local cache unit. The first-level caffeine local cache unit runs asynchronous refresh data and stores the refreshed data in the first-level redis cache cluster; The results returned by the database are directly refreshed, and the refreshed data is stored in the secondary caffeine local cache unit. The secondary caffeine local cache unit runs asynchronous refresh data and stores the refreshed data in the secondary redis cache cluster.

2. A method for reducing the time consumption of calling a service according to claim 1, characterized in that: The sub-service module includes a client cache unit.

3. A method for reducing the time consumption of calling a service according to claim 1, characterized in that: The Internet transaction system includes a public interface to facilitate the storage of transaction business processing results in a cache.

4. A method for reducing the time consumption of calling a service according to claim 1, characterized in that: The Internet trading system includes a monitor.

5. A method for reducing the time consumption of calling a service according to claim 1, characterized in that: The Internet trading system includes using the AOP aspect mechanism in combination with thread variables to form a dynamic cache switch.

6. A method for reducing the time consumption of calling a service according to claim 1, characterized in that: The Internet transaction system includes a facet interceptor at the entire cache entrance.

Citation Information

Patent Citations

  • Stream-type dynamic configuration updating architecture and method based on zookeeper

    CN106843930A