CN115525686B - Caching method and device for mapping configuration data - Google Patents

Caching method and device for mapping configuration data Download PDF

Info

Publication number
CN115525686B
CN115525686B CN202211236458.8A CN202211236458A CN115525686B CN 115525686 B CN115525686 B CN 115525686B CN 202211236458 A CN202211236458 A CN 202211236458A CN 115525686 B CN115525686 B CN 115525686B
Authority
CN
China
Prior art keywords
configuration data
application
mapping configuration
memory
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211236458.8A
Other languages
Chinese (zh)
Other versions
CN115525686A (en
Inventor
杨平文
冯辉
胡汝道
吴小华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202211236458.8A priority Critical patent/CN115525686B/en
Publication of CN115525686A publication Critical patent/CN115525686A/en
Application granted granted Critical
Publication of CN115525686B publication Critical patent/CN115525686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for caching mapping configuration data, wherein the method for caching the mapping configuration data is applied to an analytical conversion server for caching the mapping configuration data and comprises the following steps: monitoring application starting, inquiring a memory, and if the memory does not store mapping configuration data corresponding to the application; inquiring whether the cache stores the mapping configuration data corresponding to the application, if so, storing the mapping configuration data corresponding to the application into the memory; if not, inquiring a database, obtaining mapping configuration data corresponding to the application, and storing the mapping configuration data into the cache and the memory, so as to sequentially inquire the memory, the cache and the database to obtain the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache. The data conversion processing efficiency can be improved.

Description

Caching method and device for mapping configuration data
Technical Field
The invention relates to the technical field of data storage, in particular to a caching method and device for mapping configuration data.
Background
With the development of internet and computer communication technologies, due to different protocols and user definitions followed by different clients and servers, the data conversion and processing amounts between the clients and the servers are increased, and when each online transaction between the clients and the servers is processed, each data conversion mapping relation of each application of the distributed database needs to be accessed, and the information in the data is correspondingly converted according to the data conversion mapping relation, so that the time consumption of the data conversion processing of the online transaction is longer, and the data conversion processing efficiency is low.
Disclosure of Invention
Accordingly, the present invention is directed to a method and apparatus for buffering mapping configuration data, so as to improve the data conversion efficiency.
In a first aspect, an embodiment of the present invention provides a method for caching mapping configuration data, which is applied to an analytical conversion server for caching the mapping configuration data, including:
monitoring application starting, inquiring a memory, and if the memory does not store mapping configuration data corresponding to the application;
inquiring whether the cache stores the mapping configuration data corresponding to the application, if so, storing the mapping configuration data corresponding to the application into the memory;
if not, inquiring a database, obtaining mapping configuration data corresponding to the application, and storing the mapping configuration data into the cache and the memory, so as to sequentially inquire the memory, the cache and the database to obtain the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache.
With reference to the first aspect, the embodiment of the present invention provides a first possible implementation manner of the first aspect, where the method further includes:
receiving an online transaction request initiated by a client after starting the application, and analyzing and acquiring a service field contained in the online transaction request;
sequentially accessing the memory, the cache and the database to obtain mapping configuration data corresponding to the application;
acquiring configuration data corresponding to the service field from the acquired mapping configuration data corresponding to the application;
and packaging the obtained configuration data corresponding to the service field to obtain packaging data, and transmitting the packaging data to the service server corresponding to the application.
With reference to the first possible implementation manner of the first aspect, the embodiment of the present invention provides a second possible implementation manner of the first aspect, where the sequentially accessing the application memory, the cache, and the database to obtain mapping configuration data corresponding to the application includes:
inquiring whether the memory stores mapping configuration data corresponding to the application;
if yes, acquiring mapping configuration data corresponding to the application, and if not, inquiring whether the cache stores the mapping configuration data corresponding to the application;
if yes, acquiring the mapping configuration data corresponding to the application, and if not, acquiring the mapping configuration data corresponding to the application from the database.
With reference to the second possible implementation manner of the first aspect, the embodiment of the present invention provides a third possible implementation manner of the first aspect, where the method further includes:
and if the cache is queried to store the mapping configuration data corresponding to the application, storing the mapping configuration data corresponding to the application obtained from the cache into the memory.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the method further includes:
and if the database is queried to store the mapping configuration data corresponding to the application, storing the mapping configuration data corresponding to the application obtained from the database into the cache and the memory.
With reference to the first aspect, the first possible implementation manner of the first aspect, and any one of the first possible implementation manner to the fourth possible implementation manner of the first aspect, the embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where the method further includes:
and after the application exit is monitored, destroying the mapping configuration data of the application stored in the memory.
With reference to the first aspect, the first possible implementation manner of the first aspect, or any one of the first possible implementation manner to the fourth possible implementation manner of the first aspect, the embodiment of the present invention provides a sixth possible implementation manner of the first aspect, wherein the database and the mapping configuration data stored in the memory are set to be permanently valid, and the mapping configuration data stored in the memory is set to be valid only when the application runs.
In a second aspect, an embodiment of the present invention further provides a caching apparatus for mapping configuration data, including:
the first query module is used for monitoring the starting of the application and querying the memory, if the memory does not store the mapping configuration data corresponding to the application;
the second query module is used for querying whether the cache stores the mapping configuration data corresponding to the application, and if so, storing the mapping configuration data corresponding to the application into the memory;
and the second query module is used for querying a database if not, acquiring mapping configuration data corresponding to the application, storing the mapping configuration data into the cache and the memory, sequentially querying the memory, the cache and the database to acquire the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache.
In a third aspect, embodiments of the present application provide a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method described above.
According to the method and the device for caching the mapping configuration data, provided by the embodiment of the invention, the memory is queried through monitoring the starting of the application, and if the memory does not store the mapping configuration data corresponding to the application; inquiring whether the cache stores the mapping configuration data corresponding to the application, if so, storing the mapping configuration data corresponding to the application into the memory; if not, inquiring a database, obtaining mapping configuration data corresponding to the application, and storing the mapping configuration data into the cache and the memory, so as to sequentially inquire the memory, the cache and the database to obtain the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache. Therefore, when an application is started, mapping configuration data of the application for data conversion processing is written into the memory with high read-write speed by querying the memory, the cache or the database, so that after an online transaction request of the application is received, the mapping configuration data can be acquired from the memory, the time for acquiring the mapping configuration data is effectively shortened, and the data conversion processing efficiency is effectively improved; if the mapping configuration data is obtained from the cache, the time required for obtaining the mapping configuration data can still be effectively shortened because the reading and writing speed of the cache is higher than that of the database, and the data conversion processing efficiency is effectively improved.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a method for caching mapping configuration data according to an embodiment of the present invention;
FIG. 2 is another flow chart illustrating a method for caching mapping configuration data according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a cache of mapping configuration data according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a buffer device for mapping configuration data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device 500 according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
At present, for mapping configuration data in online transaction of a financial system, the mapping configuration data is used for converting data submitted by a client into data compatible with a server, namely, performing adaptive modification of a service field (converting the service field in the client data into a service field corresponding to the server) and protocol encapsulation of the data, in order to improve the efficiency of large-scale data conversion processing, various data conversion mapping relations are constructed in a database, so that the submitted data can be converted and encapsulated according to the constructed data conversion mapping relation. For example, for online transaction of the financial system, mapping configuration data corresponding to each service field such as a transaction code mapping relationship, a field domain mapping relationship, an enumeration mapping relationship, a response code mapping relationship and the like are stored in a database, so that when online transaction is performed, according to a service field in submitted data, a data conversion mapping relationship corresponding to the service field is queried in the database, and based on the data conversion mapping relationship, the field and the format submitted by a client can be converted into a field and a format corresponding to a server, and package data is formed and transmitted to the server. However, this method requires a long time to access the distributed database, which makes the data conversion process inefficient. In the embodiment of the invention, the mapping configuration data in the database, such as the transaction code mapping relationship, the field domain mapping relationship, the enumeration mapping relationship and the response code mapping relationship, is basic data, and has small data change, so that the mapping configuration data can be cached for further improving the access efficiency of data conversion processing. For example, the data is buffered to the front application memory in a buffer mode, each memory corresponds to an application, and the read-write speed of the memory is far greater than the read-write speed of the database, so that the data conversion processing efficiency of online transaction can be effectively improved.
The embodiment of the invention provides a method and a device for caching mapping configuration data, and the method and the device are described in the following through the embodiment.
Fig. 1 is a flowchart illustrating a method for caching mapping configuration data according to an embodiment of the present invention. As shown in fig. 1, the method is applied to a resolution conversion server for caching mapping configuration data, and includes:
step 101, monitoring application starting, inquiring a memory, and if the memory does not store mapping configuration data corresponding to the application;
in the embodiment of the invention, the bank core system comprises an analysis conversion server, a client and a service server, wherein the analysis conversion server is used for monitoring the client and detecting that the client starts an application for online transaction, for example, the application installed on the client is monitored to be double-clicked by a user, or the user inputs uniform resource locator (URL, uniform Resource Locator) information corresponding to the application in a browser address field of the client, but the client does not initiate an online transaction request for the application, and mapping configuration data corresponding to the application needs to be stored into a memory with higher data reading and writing speed first, so that the mapping configuration data can be obtained more quickly when data conversion processing is needed according to the mapping configuration data later.
In the embodiment of the invention, if the mapping configuration data corresponding to the application is stored in the memory, the caching process of the mapping configuration data is ended.
In an embodiment of the present invention, as an optional embodiment, the mapping configuration data includes, but is not limited to: transaction code mapping relation, field domain mapping relation, enumeration mapping relation and response code mapping relation. Taking an online transaction request as an account opening transaction code mapping relation as an example, assuming that an account opening transaction code configured by an application as a client is 101, in a service server, the configured account opening transaction code is C101, and the transaction code mapping relation is as follows: 101 (00) -C101 (01), wherein 00 in brackets represents a client, and 01 represents a service server (server).
In the embodiment of the present invention, as an optional embodiment, a memory is set in the analytical conversion server, each memory corresponds to an application, and the memory is identified by the name of the application. Therefore, the memory is locally arranged in the analytical conversion server, mapping configuration data with small data change is stored, the direct frequent access to the database can be reduced, the data access of the application memory is quick, and the time required for acquiring the mapping configuration data is effectively reduced; further, the memory and the database form multiple copies for storing mapping configuration data, and the storage of the mapping configuration data is safe and guaranteed; moreover, when the database is not available, the memory is utilized, and the online transaction is not influenced, so that the business continuity during the operation of the online transaction is ensured by utilizing a multi-data copy method.
Step 102, inquiring whether the cache stores the mapping configuration data corresponding to the application, if so, storing the mapping configuration data corresponding to the application into the memory;
step 103, if not, inquiring a database, obtaining mapping configuration data corresponding to the application, and storing the mapping configuration data into the cache and the memory, so as to sequentially inquire the memory, the cache and the database to obtain the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache.
In the embodiment of the invention, a cache is queried, and whether mapping configuration data corresponding to the application is stored in the cache is judged, wherein the access priority of the cache is higher than that of the database, and the access priority of the memory is higher than that of the cache.
If the mapping configuration data corresponding to the application is stored, reading the mapping configuration data corresponding to the application from the cache, writing the mapping configuration data corresponding to the application into the memory, and if the mapping configuration data is not stored, executing the step of querying the database.
In the embodiment of the invention, the cache is arranged to form high availability of data access with the database.
In the embodiment of the invention, mapping configuration data corresponding to the application obtained from a database is respectively written into the cache and the memory.
In the embodiment of the invention, the obtained mapping configuration data is stored in the cache and the memory, so that a double database with high availability can be formed with the database.
In the embodiment of the invention, after the application is started, the user can log in the application to conduct online transaction. For example, for a mobile banking app application, when the mobile banking app is clicked to open, the resolution conversion server in communication with the mobile banking app pulls mapping configuration data from the cache and stores the mapping configuration data in the memory, or pulls mapping configuration data from the database and stores the mapping configuration data in the memory and the cache respectively. Thus, after the application is started, the mapping configuration data is obtained through database or cache inquiry and cached to the memory.
In the embodiment of the invention, because the memory space of the memory is limited, as an alternative embodiment, the mapping configuration data stored in the memory is used for counting the access frequency of each online transaction in the application, and the mapping configuration data corresponding to the online transaction with the first N bits is selected for carrying out the configuration of the data in the memory.
In an embodiment of the present invention, as an optional embodiment, the method further includes:
a11, receiving an online transaction request initiated after the client starts the application, and analyzing and acquiring a service field contained in the online transaction request;
in an embodiment of the present invention, the online transaction request includes one or more service fields. For example, if the online transaction request is a request for an account opening and a remittance after the account opening, the online transaction request includes two service fields of the account opening and the remittance.
A12, sequentially accessing the memory, the cache and the database, and searching mapping configuration data corresponding to the application;
in the embodiment of the present invention, as an optional embodiment, sequentially accessing the application memory, the cache, and the database, and searching the mapping configuration data corresponding to the application includes:
inquiring whether the memory stores mapping configuration data corresponding to the application;
if yes, acquiring mapping configuration data corresponding to the application, and if not, inquiring whether the cache stores the mapping configuration data corresponding to the application;
if yes, acquiring the mapping configuration data corresponding to the application, and if not, acquiring the mapping configuration data corresponding to the application from the database.
In the embodiment of the present invention, as an optional embodiment, by querying an application identifier stored in the memory, if an application identifier identical to the application identifier of the started application is stored, it is determined that mapping configuration data corresponding to the application (the started application) is stored in the memory.
In the embodiment of the invention, because the protocols supported by the clients and the field names supported by the protocols are different, the fields contained in the online transaction request submitted by the clients and the protocols adopted by the transaction request are required to be converted into the fields of the server and the supported protocols according to the mapping configuration data. For example, taking an online transaction as an account opening example, the online transaction request includes transaction code information (service field) corresponding to the account opening, for example, 101, and at the server side, the transaction code information corresponding to the account opening is C101 (destination field), so that the transaction code information needs to be converted from 101 to C101 according to mapping configuration data, so that a core service server of a subsequent server side can call a corresponding online transaction processing process according to the converted C101 to process the online transaction.
In the embodiment of the invention, the mapping configuration data is the mapping relation between the service field and the destination field, and for an application, the mapping relation is fixed and does not change before the application is upgraded and configured to change.
A13, acquiring configuration data corresponding to the service field from the acquired mapping configuration data corresponding to the application;
in the embodiment of the invention, after the online transaction is accessed, as an optional embodiment, an analytical conversion service is called, mapping configuration data is queried from a memory, if the mapping configuration data does not exist in the memory, a cache is queried, if the mapping configuration data does not exist in the memory, mapping configuration data corresponding to the application is queried and obtained from a database, and meanwhile, the obtained mapping configuration data is stored into the cache and the memory, namely, the mapping configuration data is queried in sequence of the application memory, the cache and the database. The data stored in the memory is second-level cache data, the data stored in the cache is first-level cache data, and the data stored in the database is initial data. In this way, the data with smaller data change is cached to the memory in the first level caching mode, so that the efficiency is improved to the greatest extent, and the data is cached to the cache of the front application in the second level caching mode, so that the multi-level caching processing technology with high data availability and access priority is formed, and the processing efficiency of online transaction is improved.
And A14, packaging the obtained configuration data corresponding to the service field to obtain packaging data, and transmitting the packaging data to the service server corresponding to the application.
In the embodiment of the invention, the configuration data corresponding to the acquired service field is encapsulated according to a protocol compatible with the server side.
In an embodiment of the present invention, as an optional embodiment, the method further includes:
and after the application exit is monitored, destroying the mapping configuration data of the application stored in the memory.
In the embodiment of the present invention, as an optional embodiment, the mapping configuration data stored in the database and the cache is set to be permanently valid, and the mapping configuration data stored in the memory is set to be valid only when the application is running. The mapping configuration data stored in the memory is effective when the process corresponding to the application is operated, the stored mapping configuration data can be destroyed after the process corresponding to the application is stopped, and the latest mapping configuration data is re-pulled and cached in the memory after the application is restarted. The application exiting means that no client logs in the application, or the server upgrades the application, or an abnormal termination service occurs in the running of the application.
In the embodiment of the present invention, as an alternative embodiment, the cache is a database based on key/value pairs, for example, may be a dis database or a Memcached database, where the database is a database capable of storing data in a persistent manner, including but not limited to: HBase database, mySQL database, elastesearch database. The data reading and writing speed of the memory is larger than that of the cache, and the data reading and writing speed of the cache is larger than that of the database.
In the embodiment of the invention, the original mapping configuration data is stored by utilizing the database, the cache is used as a first-level cache for storing the data, and the memory (application process memory) is used as a second-level cache for storing the data, so that multiple data copies are formed, and the mapping configuration data can be directly obtained from the memory or the cache through the multi-level cache. Further, the database and the cache are utilized to store data, so that a multi-copy mode of the data can be formed, when the database is unavailable, the cache can be utilized, the online transaction is not influenced, the service continuity during the online transaction operation is ensured, the availability of the data can be effectively ensured, the access to the database can be effectively reduced through the prepositive configuration of the mapping configuration data to form a multi-level cache, and the data access efficiency and the data conversion processing efficiency are improved.
As shown in fig. 2 and 3, the method includes:
step 201, mapping configuration maintenance is carried out through an interface set by a database, and mapping configuration data corresponding to the application is stored in the database;
in the embodiment of the invention, when application development or application maintenance is carried out, the mapping configuration data corresponding to the application is stored into the database through interface mapping configuration maintenance, so that loading and warehousing are realized. Wherein, the time limit of the data stored in the database is permanently valid, the data is initial data, and the database can be a distributed data storage area.
Step 202, after the analytical conversion server monitors the initial use of the application, reading mapping configuration data corresponding to the application from a database, and storing the mapping configuration data into a cache database and a process cache database respectively;
in the embodiment of the invention, when an application is initially used, for example, when the application is initially started, the analytical conversion server reads mapping configuration data corresponding to the application from a database, loads the mapping configuration data to a Cache database (Cache), and loads the mapping configuration data corresponding to the application to a process Cache (Cache) database. In this way, the mapping configuration data of the application is stored in the cache and the process cache database to form multiple data copies, and in the subsequent application, when the database is not available, the mapping configuration data corresponding to the application can be read from the cache or the process cache database without influencing the online transaction, thereby ensuring the service continuity during the operation of the online transaction.
In the embodiment of the invention, the time limit of the data stored in the cache database is permanently valid, and the data is first-level cache data; the time limit active process of the data stored in the process cache database is effective, namely effective when the process corresponding to the application runs, and the data is secondary cache data. The process cache database corresponds to the memory, and the cache database and the data in the process cache database are used in a running state, namely, in the running process of the application.
Step 203, the analytical transformation server receives an online transaction request initiated by an application;
in the embodiment of the invention, a user initiates an online transaction request through the application of the client, and the analysis and conversion server analyzes according to the received online transaction request to obtain the application corresponding to the online transaction request.
Step 204, inquiring whether the process cache database stores the mapping configuration data corresponding to the application, if not, executing step 205, and if so, executing step 209;
in the embodiment of the present invention, when the mapping configuration data is stored in the foregoing steps, some exceptions may cause that the mapping configuration data is not stored in the cache database or the process cache database, so that when an online transaction request is received, the query of the mapping configuration data is performed in the process cache database.
Step 205, inquiring whether the cache database stores the mapping configuration data corresponding to the application, if not, executing step 206, and if so, executing step 208;
in the embodiment of the invention, if mapping configuration data corresponding to the application is not queried in the process cache database, query is performed from the cache database.
Step 206, querying the cache database, and executing step 207;
in the embodiment of the invention, mapping configuration data corresponding to the application is stored in the cache database.
Step 207, writing mapping configuration data corresponding to the application obtained by the query into a process cache database and a cache database respectively, and executing step 209;
in the embodiment of the invention, after the mapping configuration data corresponding to the application is queried, the mapping configuration data are respectively written into the process cache database and the cache database, so that the data can be conveniently accessed at high speed in the subsequent online transaction request.
Step 208, writing mapping configuration data corresponding to the application obtained by the query into a process cache database, and executing step 209;
and step 209, processing the online transaction request according to the mapping configuration data corresponding to the application obtained by the query.
In the embodiment of the invention, after the mapping configuration data corresponding to the application is obtained, the configuration data corresponding to the service field is obtained from the obtained mapping configuration data; and packaging the obtained configuration data to obtain packaging data, and transmitting the packaging data to a service server corresponding to the application.
Fig. 4 is a schematic diagram of a buffer device for mapping configuration data according to an embodiment of the present invention. As shown in fig. 4, the apparatus includes:
a first query module 401, configured to monitor that an application is started, query a memory, and if the memory does not store mapping configuration data corresponding to the application;
in an embodiment of the present invention, as an optional embodiment, the mapping configuration data includes, but is not limited to: transaction code mapping relation, field domain mapping relation, enumeration mapping relation and response code mapping relation.
In the embodiment of the present invention, whether the mapping configuration data corresponding to the application is stored in the memory is queried, and if not, the second query module 402 is notified.
A second query module 402, configured to query whether the cache stores mapping configuration data corresponding to the application, and if yes, store the mapping configuration data corresponding to the application into the memory;
in the embodiment of the present invention, the cache is queried, and it is determined whether the mapping configuration data corresponding to the application is stored in the cache, if so, the mapping configuration data corresponding to the application is stored in the memory, and if not, the third query module 403 is notified.
And the query module 403 is configured to query a database if not, obtain mapping configuration data corresponding to the application, store the mapping configuration data in the cache and the memory, and sequentially query the memory, the cache and the database to obtain the mapping configuration data after receiving an online transaction request of the application, where a read-write speed of the cache is higher than that of the database, and a read-write speed of the memory is higher than that of the cache.
In an embodiment of the present invention, as an optional embodiment, the apparatus further includes:
an analysis module (not shown in the figure) for receiving an online transaction request initiated after the client starts the application, and analyzing and acquiring a service field contained in the online transaction request;
the query module is used for sequentially accessing the memory, the cache and the database and obtaining mapping configuration data corresponding to the application;
the conversion module is used for acquiring configuration data corresponding to the service field from the acquired mapping configuration data corresponding to the application;
and the encapsulation module is used for encapsulating the acquired configuration data corresponding to the service field to obtain encapsulation data, and transmitting the encapsulation data to a core service server of the service end corresponding to the application.
In an embodiment of the present invention, as a further alternative embodiment, the apparatus further includes:
and the destroying module is used for destroying the mapping configuration data of the application stored in the memory after the application exit is monitored.
In the embodiment of the present invention, as an optional embodiment, the mapping configuration data stored in the database and the cache is set to be permanently valid, and the mapping configuration data stored in the memory is set to be valid only when the application is running.
In the embodiment of the present invention, as an alternative embodiment, the cache is a database based on key/value pairs, for example, may be a dis database or a Memcached database, where the database is a database capable of storing data in a persistent manner, including but not limited to: HBase database, mySQL database, elastesearch database. The data reading and writing speed of the memory is larger than that of the cache, and the data reading and writing speed of the cache is larger than that of the database.
As shown in fig. 5, an embodiment of the present application provides a computer device 500 for executing the method for caching mapping configuration data in fig. 1, where the device includes a memory 501, a processor 502 connected to the memory 501 through a bus, and a computer program stored on the memory 501 and capable of running on the processor 502, where the processor 502 implements the steps of the method for caching mapping configuration data when executing the computer program.
Specifically, the memory 501 and the processor 502 can be general-purpose memories and processors, which are not limited herein, and the above-described caching method of mapping configuration data can be performed when the processor 502 runs a computer program stored in the memory 501.
Corresponding to the method for caching mapping configuration data in fig. 1, the embodiment of the application further provides a computer readable storage medium, where a computer program is stored, and the computer program is executed by a processor to perform the steps of the method for caching mapping configuration data.
In particular, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, or the like, and the computer program on the storage medium can execute the above-described caching method for mapping configuration data when executed.
In the embodiments provided herein, it should be understood that the disclosed systems and methods may be implemented in other ways. The system embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical functional division, and there may be additional divisions in actual implementation, and e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, system or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments provided in the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that: like reference numerals and letters in the following figures denote like items, and thus once an item is defined in one figure, no further definition or explanation of it is required in the following figures, and furthermore, the terms "first," "second," "third," etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present application, and are not intended to limit the scope of the present application, but the present application is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, the present application is not limited thereto. Any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or make equivalent substitutions for some of the technical features within the technical scope of the disclosure of the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the corresponding technical solutions. Are intended to be encompassed within the scope of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. The caching method of the mapping configuration data is characterized by being applied to an analytic conversion server for caching the mapping configuration data and comprising the following steps:
monitoring the starting of an application in a client, inquiring a memory, and if the memory does not store mapping configuration data corresponding to the application;
inquiring whether the cache stores the mapping configuration data corresponding to the application, if so, storing the mapping configuration data corresponding to the application into the memory;
if not, querying a database, obtaining mapping configuration data corresponding to the application, and storing the mapping configuration data into the cache and the memory, so as to sequentially query the memory, the cache and the database to obtain the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache;
the method further comprises the steps of:
receiving an online transaction request initiated by a client after starting the application, and analyzing and acquiring a service field contained in the online transaction request;
sequentially accessing the memory, the cache and the database to obtain mapping configuration data corresponding to the application;
acquiring configuration data corresponding to the service field from the acquired mapping configuration data corresponding to the application;
and packaging the obtained configuration data corresponding to the service field to obtain packaging data, and transmitting the packaging data to the service server corresponding to the application.
2. The method of claim 1, wherein the sequentially accessing the application memory, the cache, and the database to obtain the mapping configuration data corresponding to the application includes:
inquiring whether the memory stores mapping configuration data corresponding to the application;
if yes, acquiring mapping configuration data corresponding to the application, and if not, inquiring whether the cache stores the mapping configuration data corresponding to the application;
if yes, acquiring the mapping configuration data corresponding to the application, and if not, acquiring the mapping configuration data corresponding to the application from the database.
3. The method according to claim 2, wherein the method further comprises:
and if the cache is queried to store the mapping configuration data corresponding to the application, storing the mapping configuration data corresponding to the application obtained from the cache into the memory.
4. The method according to claim 2, wherein the method further comprises:
and if the database is queried to store the mapping configuration data corresponding to the application, storing the mapping configuration data corresponding to the application obtained from the database into the cache and the memory.
5. The method according to any one of claims 1 to 4, further comprising:
and after the application exit is monitored, destroying the mapping configuration data corresponding to the application stored in the memory.
6. The method of any one of claims 1 to 4, wherein the database and cache stored mapping configuration data is set to be permanently valid and the memory stored mapping configuration data is set to be valid only at application runtime.
7. A caching apparatus for mapping configuration data, comprising:
the first query module is used for monitoring the starting of the application in the client, querying the memory, and if the memory does not store the mapping configuration data corresponding to the application;
the second query module is used for querying whether the cache stores the mapping configuration data corresponding to the application, and if so, storing the mapping configuration data corresponding to the application into the memory;
the third query module is used for querying a database if not, acquiring mapping configuration data corresponding to the application, storing the mapping configuration data into the cache and the memory, sequentially querying the memory, the cache and the database to acquire the mapping configuration data after receiving an online transaction request of the application, wherein the reading and writing speed of the cache is higher than that of the database, and the reading and writing speed of the memory is higher than that of the cache;
the apparatus further comprises:
the analysis module is used for receiving an online transaction request initiated after the client starts the application, and analyzing and acquiring a service field contained in the online transaction request;
the query module is used for sequentially accessing the memory, the cache and the database and obtaining mapping configuration data corresponding to the application;
the conversion module is used for acquiring configuration data corresponding to the service field from the acquired mapping configuration data corresponding to the application;
and the encapsulation module is used for encapsulating the acquired configuration data corresponding to the service field to obtain encapsulation data, and transmitting the encapsulation data to a core service server of the service end corresponding to the application.
8. A computer device, comprising: a processor, a memory and a bus, said memory storing machine readable instructions executable by said processor, said processor and said memory communicating via the bus when the computer device is running, said machine readable instructions when executed by said processor performing the steps of the method of caching mapping configuration data according to any one of claims 1 to 6.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the caching method of mapping configuration data according to any one of claims 1 to 6.
CN202211236458.8A 2022-10-10 2022-10-10 Caching method and device for mapping configuration data Active CN115525686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211236458.8A CN115525686B (en) 2022-10-10 2022-10-10 Caching method and device for mapping configuration data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211236458.8A CN115525686B (en) 2022-10-10 2022-10-10 Caching method and device for mapping configuration data

Publications (2)

Publication Number Publication Date
CN115525686A CN115525686A (en) 2022-12-27
CN115525686B true CN115525686B (en) 2023-06-13

Family

ID=84701236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211236458.8A Active CN115525686B (en) 2022-10-10 2022-10-10 Caching method and device for mapping configuration data

Country Status (1)

Country Link
CN (1) CN115525686B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143417A (en) * 2019-12-27 2020-05-12 广东浪潮大数据研究有限公司 Data processing method, device and system, Nginx server and medium
CN111581234A (en) * 2020-05-09 2020-08-25 中国银行股份有限公司 RAC multi-node database query method, device and system
CN114756577A (en) * 2022-03-25 2022-07-15 北京友友天宇系统技术有限公司 Processing method of multi-source heterogeneous data, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040236726A1 (en) * 2003-05-19 2004-11-25 Teracruz, Inc. System and method for query result caching
CN105338026B (en) * 2014-07-24 2018-10-09 阿里巴巴集团控股有限公司 The acquisition methods of data resource, device and system
CN110110256A (en) * 2018-01-17 2019-08-09 阿里巴巴集团控股有限公司 Data processing method, device, electronic equipment and storage medium
CN110909025A (en) * 2018-09-17 2020-03-24 深圳市优必选科技有限公司 Database query method, query device and terminal
CN110597739A (en) * 2019-06-03 2019-12-20 上海云盾信息技术有限公司 Configuration management method, system and equipment
CN112163001A (en) * 2020-09-25 2021-01-01 同程网络科技股份有限公司 High-concurrency query method, intelligent terminal and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143417A (en) * 2019-12-27 2020-05-12 广东浪潮大数据研究有限公司 Data processing method, device and system, Nginx server and medium
CN111581234A (en) * 2020-05-09 2020-08-25 中国银行股份有限公司 RAC multi-node database query method, device and system
CN114756577A (en) * 2022-03-25 2022-07-15 北京友友天宇系统技术有限公司 Processing method of multi-source heterogeneous data, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于内存映射文件的复杂对象快速读取方法;黄向平;彭明田;杨永凯;;计算机技术与发展(第03期);全文 *

Also Published As

Publication number Publication date
CN115525686A (en) 2022-12-27

Similar Documents

Publication Publication Date Title
US9350826B2 (en) Pre-fetching data
US20070174420A1 (en) Caching of web service requests
CN106302595B (en) Method and equipment for carrying out health check on server
CN110990365A (en) Data synchronization method, device, server and storage medium
CN110659971B (en) Transaction data processing method and device
CN106911735B (en) Data acquisition method and device
CN111416885A (en) Outer chain rewriting distributed system with fixed-length domain name
US20060090033A1 (en) Facilitating Server Response Optimization
CN107197000B (en) Static and dynamic hybrid caching method, device and system
CN114549068A (en) Short link generation method, equipment, device and computer readable storage medium
CN109656670B (en) Page rendering method and device
CN117573574B (en) Prefetching method and device, electronic equipment and readable storage medium
CN113330432A (en) Asynchronous predictive caching of content listed in search results
CN115525686B (en) Caching method and device for mapping configuration data
CN111291083B (en) Webpage source code data processing method and device and computer equipment
CN111125168B (en) Data processing method and device, electronic equipment and storage medium
CN111756744B (en) H5 user identification method, device, equipment and storage medium
CN106911733B (en) Cloud proxy website access method and device
CN111339390A (en) Method, computing device and storage medium for crawling information based on fixed-line telephone
CN108846141B (en) Offline cache loading method and device
CN106911736B (en) Cloud proxy server, pure asynchronous data transmission method and system of cloud proxy
CN110825986B (en) Method, system, storage medium and electronic device for client to request data
CN113608886B (en) Function access caching method and device, electronic equipment and storage medium
CN111381985B (en) Heterogeneous system data calling method, device, equipment and storage medium
CN115544094A (en) Data storage calling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant