Cache database response method, multi-active system, storage medium and device

By using operation dictionary in the data center of the multi-living system to control the data access of the cached database, the problem of cached data interfering with each other in the multi-living system is solved, and the transparency of data operations and the physical independence of the database are achieved.

CN114911829BActive Publication Date: 2025-03-25CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210496773.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2025-03-25
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

In multi-live systems, cached data interferes with each other, resulting in data conflicts and increased coupling.

Method used

By introducing an operation dictionary in the data center, the candidate cache database is determined based on the command request of the application service, and the response results are accessed and filtered, ensuring the transparency of data operations and the physical independence of the database.

Benefits of technology

It effectively solves the problem of cached data interfering with each other in multi-living systems, reduces the degree of coupling, and ensures the transparency of data operations and the independence of databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911829B_ABST
    Figure CN114911829B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of database technology, and discloses a cache database response method, a multi-active system, a storage medium and a device. The cache database response method is applied to the multi-active system, and the multi-active system is composed of multiple active systems. The active system includes: an application service, a data center and a cache database. Since the present invention establishes a data center between the application service and the cache system, a data operation dictionary is defined from the perspective of data operation according to the data structure characteristics and data operation mode of the cache database. The data center controls the data access of the application service to the data cache system according to the operation dictionary, thereby ensuring the transparency of data operation and the physical independence of the database, and solving the application problem of cache data in the multi-active system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a cache database response method, a multi-active system, a storage medium and a device. Background Art

[0002] With the maturity of server development concepts and tools, cache databases such as redis and memcache are widely used in the development of services with large business volumes as performance components that increase service concurrency, throughput, and data operation rates.

[0003] However, in the architecture of a multi-active system, each subsystem is fully functional and autonomous, and an independent cache cluster is established. If the service is stateful, when the environment changes, data will "drift" between different subsystems. For example, when the application client network switches, the application access point will change from one multi-active node to another multi-active node. Therefore, a cache data will be added to the new active subsystem, and two copies of data will be generated in the new and old active subsystems, resulting in data conflicts.

[0004] Since cache databases do not have DBMS like traditional structured databases, business services in cache databases will directly operate all subsystem caches. Storage changes of subsystems will affect business services, and services will interfere with each other, increasing coupling. Summary of the invention

[0005] The main purpose of the present invention is to provide a cache database response method, a multi-active system, a storage medium and a device, aiming to solve the technical problem in the prior art that cache data in a multi-active system interfere with each other and increase the coupling degree.

[0006] To achieve the above object, the present invention provides a cache database response method, which is applied to a multi-active system, wherein the multi-active system is composed of multiple active systems, and the active system includes: an application service, a data center, and a cache database;

[0007] The cache database response method comprises the following steps:

[0008] The data center receives a command request from the application service, and determines a candidate cache database according to the command request and the operation dictionary;

[0009] Accessing the candidate cache database based on the operation dictionary, and receiving a response result set fed back by the candidate cache database;

[0010] Filter response data from the response result set according to the operation dictionary, and feed the response data back to the application service.

[0011] Optionally, the operation dictionary includes: a command set;

[0012] The step of the data center receiving a command request of an application service and determining a candidate cache database according to the command request and an operation dictionary includes:

[0013] The data center receives the command request of the application service;

[0014] A candidate cache database supporting the command request is screened from the cache database based on the command set.

[0015] Optionally, the operation dictionary further includes: an operation set;

[0016] The step of accessing the candidate cache database based on the operation dictionary and receiving a response result set fed back by the candidate cache database includes:

[0017] Searching the operation set for an access method corresponding to the command request;

[0018] The candidate cache database is accessed based on the access mode, and a response result set fed back by the candidate cache database is received.

[0019] Optionally, the step of accessing the candidate cache database based on the access mode and receiving a response result set fed back by the candidate cache database includes:

[0020] Finding the extended access content corresponding to the access mode;

[0021] The candidate cache database is accessed based on the access mode and the extended access content, and a response result set fed back by the candidate cache database is received.

[0022] Optionally, the operation dictionary further includes: a condition set;

[0023] The step of filtering response data from the response result set based on the operation dictionary and feeding back the response data to the application service includes:

[0024] Determining a screening condition according to the condition set;

[0025] Filter response data from the response result set based on the filtering condition, and feed the response data back to the application service.

[0026] Optionally, before the step of the data center receiving a command request of an application service and determining a candidate cache database according to the command request and an operation dictionary, the step further includes:

[0027] When a modification of the cache database is detected, obtaining modification information of the cache database;

[0028] The operation dictionary is modified based on the modification information.

[0029] Optionally, the step of modifying the operation dictionary based on the modification information includes:

[0030] Determine a modification command type according to the modification information;

[0031] The command set, operation set and / or condition set of the operation dictionary are modified according to the modification command type.

[0032] In addition, to achieve the above-mentioned objectives, the present invention also proposes a multi-active system, which is composed of multiple active systems, and the active systems include: application services, data centers, and cache databases; the multi-active system also includes a memory, a processor, and a cache database response program stored on the memory and executable on the processor, and the cache database response program is configured to implement the cache database response method described above.

[0033] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a cache database response program is stored, and when the cache database response program is executed by a processor, the cache database response method as described above is implemented.

[0034] In addition, to achieve the above-mentioned purpose, the present invention also proposes a cache database response device, which includes: a database determination module, a result feedback module and a data screening module;

[0035] The database determination module is used for the data center to receive a command request for an application service and determine a candidate cache database according to the command request and an operation dictionary;

[0036] The result feedback module is used to access the candidate cache database based on the operation dictionary and receive a response result set fed back by the candidate cache database;

[0037] The data screening module is used to screen the response data from the response result set according to the operation dictionary, and feed the response data back to the application service.

[0038] In the present invention, a cache database response method is applied to a multi-active system, which is composed of multiple active systems, and the active systems include: an application service, a data center, and a cache database. The method includes: the data center receives a command request from the application service, and determines a candidate cache database based on the command request and an operation dictionary, accesses the candidate cache database based on the operation dictionary, receives a response result set fed back by the candidate cache database, filters response data from the response result set according to the operation dictionary, and feeds the response data back to the application service; since the present invention establishes a data center between the application service and the cache system, a data operation dictionary is defined from the perspective of data operation according to the data structure characteristics and data operation methods of the cache database, and the data center controls the data access of the application service to the data cache system according to the operation dictionary, thereby ensuring the transparency of data operation and the physical independence of the database, and solving the application problem of cache data in the multi-active system. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a structural diagram of a multi-active system of a hardware operating environment involved in an embodiment of the present invention;

[0040] Figure 2 This is a flow chart of a first embodiment of a method for caching database responses according to the present invention;

[0041] Figure 3 A schematic diagram of a multi-active system according to an embodiment of a method for caching database responses of the present invention;

[0042] Figure 4 This is a flow chart of a second embodiment of the method for caching database responses of the present invention;

[0043] Figure 5 A schematic diagram of a cache database response according to an embodiment of a cache database response method of the present invention;

[0044] Figure 6 This is a flow chart of a third embodiment of the method for caching database responses of the present invention;

[0045] Figure 7 This is a structural block diagram of the first embodiment of the cache database response device of the present invention.

[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0048] Reference Figure 1 , Figure 1A schematic diagram of the multi-active system structure of the hardware operating environment involved in the embodiment of the present invention.

[0049] like Figure 1 As shown, the multi-active system is composed of multiple active systems, and the active systems include: application services, data centers, and cache databases; the multi-active system may also include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable memory (Non-volatile Memory, NVM), such as a disk storage. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001 .

[0050] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation of the multi-active system, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0051] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and a cache database response program.

[0052] exist Figure 1 In the multi-active system shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the multi-active system calls the cache database response program stored in the memory 1005 through the processor 1001, and executes the cache database response method provided in the embodiment of the present invention.

[0053] Based on the above hardware structure, an embodiment of the method for caching database responses of the present invention is proposed.

[0054] Reference Figure 2 , Figure 2The flowchart of the first embodiment of the cache database response method of the present invention is shown in FIG.

[0055] Step S10: The data center receives a command request of an application service, and determines a candidate cache database according to the command request and an operation dictionary.

[0056] It should be understood that the cache database response method is applied to a multi-active system, which is composed of multiple active systems, and the active systems include: application services, data centers, and cache databases.

[0057] For ease of understanding, refer to Figure 3 This is for illustration only, but does not limit this solution. Figure 3 This is a schematic diagram of a multi-active system. In the figure, an independent data center is established in each active system. The data center consists of an access center and an operation dictionary. The access center can not only access the cache database of this system, but also access the cache database of other active systems through the operation dictionary configuration; each access center has an independently configured operation dictionary to control the operation behavior of the access center. The cache database of the current active system can also be configured as the main access library as the default operation library to perform write operations.

[0058] From a vertical perspective, application services are business data users and represent the business layer; the cache database in each active system represents the specific storage node or cluster of the data and is the storage layer of the data; the cache data center is between the business layer and the storage layer, and obtains data from the storage layer according to the configuration of the operation dictionary, and returns it to the application layer after conditional screening. The application service only needs to establish a connection with the access center and does not need to understand the status of the cache database behind the data center, which has good operational transparency. Changes to the cache database, such as location changes, adding databases, etc., only need to be modified in the operation dictionary accordingly, and will not affect the application service, thus ensuring the physical independence of data storage.

[0059] It should be noted that in cache databases such as redis and memcache, data is stored in a key-value manner, and a command request consists of three parts: "operation (command) + key + value". In this embodiment, an operation dictionary is defined from the perspective of data operation, and the operation dictionary contains the following contents: (1) Access description: mainly describes the information of accessors such as users and application services, including node information (such as name, address, etc.), authentication information (such as authentication information), access control information (such as operation permission information), etc.; (2) mainly describes the database type, location information, access information, etc. of the cache database. Each storage description corresponds to an independent cache database under a multi-active system and can be regarded as a data storage node; (3) In an operation dictionary, multiple data operation description records can be defined, and each record consists of three parts: command set, operation set and condition set.

[0060] It can be understood that the data center receives the command request of the application service, and determines the candidate cache database according to the command request and the operation dictionary, which can be the cache database that supports the command request screened by the access center in the operation dictionary as the candidate cache database.

[0061] Step S20: Access the candidate cache database based on the operation dictionary, and receive a response result set fed back by the candidate cache database.

[0062] It should be understood that accessing the candidate cache database based on the operation dictionary and receiving a response result set fed back by the candidate cache database can be to determine the access method corresponding to the command request based on the operation dictionary, and access the candidate cache database based on the access method, and receive a response result set fed back by the candidate cache database.

[0063] Step S30: Filter response data from the response result set according to the operation dictionary, and feed the response data back to the application service.

[0064] It can be understood that filtering response data from the response result set according to the operation dictionary and feeding the response data back to the application service can be to determine the filtering conditions corresponding to the command request according to the operation dictionary, and filter the response data from the response result set based on the filtering conditions, and feed the response data back to the application service.

[0065] In a first embodiment, a cache database response method is applied to a multi-active system, which is composed of multiple active systems, and the active systems include: an application service, a data center, and a cache database. The method includes: the data center receives a command request from the application service, and determines a candidate cache database based on the command request and an operation dictionary, accesses the candidate cache database based on the operation dictionary, receives a response result set fed back by the candidate cache database, filters response data from the response result set based on the operation dictionary, and feeds the response data back to the application service; since this embodiment establishes a data center between the application service and the cache system, a data operation dictionary is defined from the perspective of data operation based on the data structure characteristics and data operation methods of the cache database, and the data center controls the application service's data access to the data cache system based on the operation dictionary, thereby ensuring the transparency of data operations and the physical independence of the database, and solving the application problem of cache data in the multi-active system.

[0066] Reference Figure 4 , Figure 4 This is a flow chart of the second embodiment of the cache database response method of the present invention, based on the above Figure 2 The first embodiment shown provides a second embodiment of the method for caching database responses of the present invention.

[0067] In a second embodiment, the operation dictionary includes: a command set;

[0068] The step S10 comprises:

[0069] Step S101: The data center receives a command request for an application service.

[0070] It should be understood that in order to improve the reliability of the candidate cache database, in this embodiment, a command set may be pre-set in the operation dictionary, and based on the command set, a candidate cache database that supports the command request may be screened from the cache database.

[0071] It should be noted that the command set is a collection of some operation commands of cache databases such as redis and memcache, which are associated with the cache database. Whether the command can access the cache database is determined by whether the command set contains a certain command. A command may match multiple cache databases, and these nodes constitute the cache database set that supports the current command.

[0072] Step S102: Filter candidate cache databases that support the command request from the cache database based on the command set.

[0073] It is understandable that filtering candidate cache databases supporting command requests from the cache database based on the command set may be determining whether the command request can access the cache database based on the command set, and filtering candidate cache databases supporting the command request from the cache database based on the determination result.

[0074] In the second embodiment, by presetting a command set in the operation dictionary, the data center receives a command request of the application service, and screens candidate cache databases supporting the command request from the cache database based on the command set, thereby improving the reliability of the candidate cache databases.

[0075] In a second embodiment, the operation dictionary further includes: an operation set;

[0076] The step S20 comprises:

[0077] Step S201: searching the operation set for the access mode corresponding to the command request.

[0078] It should be understood that in order to improve the reliability of the response result set, in this embodiment, the operation set can be pre-set in the operation dictionary, and the candidate cache database can be accessed based on the operation set, and the response result set fed back by the candidate cache database can be received.

[0079] It should be noted that the operation set defines the access method of the data center to the cache database set, matches the candidate cache database to be accessed according to the command set, and can select which candidate cache database to access according to the definition in the configuration of the operation set. Among them, the access method may include: traversal access, arbitrary access, and default access.

[0080] For ease of understanding, reference is made to Table 1 for explanation, but this does not limit the present solution.

[0081] Table 1 Access method table

[0082] Access method illustrate Traversal Access Traversing the access cache database Any access Select a cache database to request data using hash / polling / random function Default Access The cache database under the same active system is used as the default access library

[0083] Step S202: accessing the candidate cache database based on the access mode, and receiving a response result set fed back by the candidate cache database.

[0084] It can be understood that accessing the candidate cache database based on the access method and receiving a response result set fed back by the candidate cache database can be selecting a target cache database from the candidate cache database based on the access method, accessing the target cache database, and receiving a response result set fed back by the target cache database.

[0085] The second embodiment pre-sets an operation set in the operation dictionary, searches for an access method corresponding to a command request in the operation set, accesses a candidate cache database based on the access method, and receives a response result set fed back by the candidate cache database, thereby improving the reliability of the response result set.

[0086] Furthermore, in order to obtain more information for the condition set to filter data, the step S202 includes:

[0087] Finding the extended access content corresponding to the access mode;

[0088] The candidate cache database is accessed based on the access mode and the extended access content, and a response result set fed back by the candidate cache database is received.

[0089] It should be understood that when the data center accesses the cache database, it can also make appropriate expansions based on the user request according to the access method to obtain more information for the condition set to filter data.

[0090] In a specific implementation, for example, in order to obtain the TTL information of the data, it is necessary to append a command requesting TTL to the command requested by the user, and use the pipeline method to send the extended multiple commands to the target cache database at one time.

[0091] In a second embodiment, the operation dictionary further includes: a condition set;

[0092] The step S30 includes:

[0093] Step S301: determining a screening condition according to the condition set.

[0094] It should be understood that in order to improve the reliability of the response data, in this embodiment, a condition set may be pre-set in the operation dictionary, and a screening condition may be determined based on the condition set, and the response data may be screened from the response result set based on the screening condition.

[0095] It should be noted that the condition set defines the set of data filtering methods supported by the data center, and filters and returns the response data that meets the conditions as the command request based on the content or result of the data. The condition type can be combined with logical operations to form a conditional expression.

[0096] For ease of understanding, reference is made to Table 2 for explanation, but this does not limit the present solution.

[0097] Table 2 Conditional operation table

[0098]

[0099] Step S302: Filter response data from the response result set based on the filtering condition, and feed the response data back to the application service.

[0100] For ease of understanding, refer to Figure 5 This is for illustration only, but does not limit this solution. Figure 5 This is a schematic diagram of cache database response. In the figure, the access center implements the process of executing operations according to the definition of the operation dictionary. It receives the command request of the application service, combines the request command with the definition in the operation dictionary, obtains the set of candidate databases; uses the operation set to select a database from the candidate cache database to execute the data request, and obtains the result of the database response as the response result set; and uses the condition set to define the operation to filter out a piece of data from the result set as the final response data and return it to the application service.

[0101] For ease of understanding, this example illustrates the cache database response process, but does not limit this solution. Taking the case of data drift in a multi-active system as an example, the configuration and application of the operation dictionary and access center in this patent are explained. If the data drift is the data of the "set" operation, and there are data with the same key value in the cache database db1 of the multi-active system s1 and the cache data db2 of the multi-active system s2, we need to read the latest data.

[0102] The operation dictionary is set up as follows:

[0103] 1) Insert the read command "get" corresponding to the set command into the operation set of the operation dictionary of the multi-active systems s1 and s2;

[0104] 2) Define the access mode of the get command as "traversal access" in the access set;

[0105] 3) Set the condition for data return to "TTL" in the condition set;

[0106] The operation process of the data center is as follows:

[0107] 1) The application service sends a get request to the access center of any active system s1 or s2;

[0108] 2) The access center selects the databases that support the get command in the operation dictionary command set according to the get command, and obtains the candidate database set consisting of db1 and db2;

[0109] 3) According to the definition of the "get" command in the operation set as "traversal operation", the data center reorganizes and expands the get request, sends it to db1 and db2 respectively in a pipeline manner, and obtains two data results to form a result set;

[0110] 4) If the screening condition for the "get" command in the condition set is ttl, the data with the maximum value of ttl is selected as the latest generated data, and this data is used as the response data;

[0111] 5) The access center obtains the response data and returns it to the application service.

[0112] The second embodiment pre-sets an operation set in the operation dictionary, searches for an access method corresponding to a command request in the operation set, accesses a candidate cache database based on the access method, and receives a response result set fed back by the candidate cache database, thereby improving the reliability of response data.

[0113] Reference Figure 6 , Figure 6 This is a flow chart of the third embodiment of the cache database response method of the present invention. Figure 2 The first embodiment shown provides a third embodiment of the method for caching database responses of the present invention.

[0114] In the third embodiment, before step S10, the method further includes:

[0115] Step S01: when it is detected that the cache database is modified, the modification information of the cache database is obtained.

[0116] It should be understood that in order to continue to operate the cache database after modifying the cache database, this embodiment also obtains modification information of the cache database when detecting modification of the cache database, and modifies the operation dictionary based on the modification information.

[0117] It should be noted that the modification information may be a location change, an addition to a database, etc.

[0118] Step S02: modify the operation dictionary based on the modification information.

[0119] It can be understood that in order to continue to operate the cache database after the cache database is modified, this embodiment only needs to make corresponding modifications in the operation dictionary when the cache database modification is detected.

[0120] It should be understood that the above method will not affect application services, thereby ensuring the physical independence of data storage.

[0121] In the third embodiment, it is disclosed that when a modification of the cache database is detected, modification information of the cache database is obtained, and the operation dictionary is modified based on the modification information; because this embodiment makes corresponding modifications in the operation dictionary when the modification of the cache database is detected, the cache database can continue to be operated after the cache database is modified.

[0122] Furthermore, in order to improve the reliability of the operation dictionary, the step S02 includes:

[0123] Determine a modification command type according to the modification information;

[0124] The command set, operation set and / or condition set of the operation dictionary are modified according to the modification command type.

[0125] It should be understood that in order to improve the reliability of the operation dictionary, when modifying the operation dictionary, this embodiment first determines the modification command type based on the modification information, and then modifies the command set, operation set and / or condition set of the operation dictionary based on the modification command type.

[0126] In addition, an embodiment of the present invention further provides a storage medium, on which a cache database response program is stored. When the cache database response program is executed by a processor, the cache database response method as described above is implemented.

[0127] In addition, refer to Figure 7 , the embodiment of the present invention further proposes a cache database response device, the cache database response device comprises: a database determination module 10, a result feedback module 20 and a data screening module 30;

[0128] The database determination module 10 is used for the data center to receive a command request for an application service, and to determine a candidate cache database according to the command request and an operation dictionary.

[0129] For ease of understanding, refer to Figure 3 This is for illustration only, but does not limit this solution. Figure 3 This is a schematic diagram of a multi-active system. In the figure, an independent data center is established in each active system. The data center consists of an access center and an operation dictionary. The access center can not only access the cache database of this system, but also access the cache database of other active systems through the operation dictionary configuration; each access center has an independently configured operation dictionary to control the operation behavior of the access center. The cache database of the current active system can also be configured as the main access library as the default operation library to perform write operations.

[0130] From a vertical perspective, application services are business data users and represent the business layer; the cache database in each active system represents the specific storage node or cluster of the data and is the storage layer of the data; the cache data center is between the business layer and the storage layer, and obtains data from the storage layer according to the configuration of the operation dictionary, and returns it to the application layer after conditional screening. The application service only needs to establish a connection with the access center and does not need to understand the status of the cache database behind the data center, which has good operational transparency. Changes to the cache database, such as location changes, adding databases, etc., only need to be modified in the operation dictionary accordingly, and will not affect the application service, thus ensuring the physical independence of data storage.

[0131] It should be noted that in cache databases such as redis and memcache, data is stored in a key-value manner, and a command request consists of three parts: "operation (command) + key + value". In this embodiment, an operation dictionary is defined from the perspective of data operation, and the operation dictionary contains the following contents: (1) Access description: mainly describes the information of accessors such as users and application services, including node information (such as name, address, etc.), authentication information (such as authentication information), access control information (such as operation permission information), etc.; (2) mainly describes the database type, location information, access information, etc. of the cache database. Each storage description corresponds to an independent cache database under a multi-active system and can be regarded as a data storage node; (3) In an operation dictionary, multiple data operation description records can be defined, and each record consists of three parts: command set, operation set and condition set.

[0132] It can be understood that the data center receives the command request of the application service, and determines the candidate cache database according to the command request and the operation dictionary, which can be the cache database that supports the command request screened by the access center in the operation dictionary as the candidate cache database.

[0133] The result feedback module 20 is used to access the candidate cache database based on the operation dictionary and receive a response result set fed back by the candidate cache database.

[0134] It should be understood that accessing the candidate cache database based on the operation dictionary and receiving a response result set fed back by the candidate cache database can be to determine the access method corresponding to the command request based on the operation dictionary, and access the candidate cache database based on the access method, and receive a response result set fed back by the candidate cache database.

[0135] The data screening module 30 is used to screen the response data from the response result set according to the operation dictionary, and feed the response data back to the application service.

[0136] It can be understood that filtering response data from the response result set according to the operation dictionary and feeding the response data back to the application service can be to determine the filtering conditions corresponding to the command request according to the operation dictionary, and filter the response data from the response result set based on the filtering conditions, and feed the response data back to the application service.

[0137] In this embodiment, a cache database response method is applied to a multi-active system, which is composed of multiple active systems, and the active systems include: an application service, a data center, and a cache database. The method includes: the data center receives a command request from the application service, and determines a candidate cache database based on the command request and an operation dictionary, accesses the candidate cache database based on the operation dictionary, receives a response result set fed back by the candidate cache database, filters response data from the response result set based on the operation dictionary, and feeds the response data back to the application service; since this embodiment establishes a data center between the application service and the cache system, a data operation dictionary is defined from the perspective of data operation based on the data structure characteristics and data operation methods of the cache database, and the data center controls the application service's data access to the data cache system based on the operation dictionary, thereby ensuring the transparency of data operations and the physical independence of the database, and solving the application problem of cache data in the multi-active system.

[0138] In one embodiment, the operation dictionary includes: a command set;

[0139] The database determination module 10 is also used for the data center to receive command requests for application services;

[0140] The database determination module 10 is further configured to filter candidate cache databases supporting the command request from the cache database based on the command set.

[0141] In one embodiment, the operation dictionary further includes: an operation set;

[0142] The result feedback module 20 is further used to search the operation set for the access mode corresponding to the command request;

[0143] The result feedback module 20 is further configured to access the candidate cache database based on the access mode, and receive a response result set fed back by the candidate cache database.

[0144] In one embodiment, the result feedback module 20 is further used to find the extended access content corresponding to the access mode;

[0145] The result feedback module 20 is further configured to access the candidate cache database based on the access mode and the extended access content, and receive a response result set fed back by the candidate cache database.

[0146] In one embodiment, the operation dictionary further includes: a condition set;

[0147] The data screening module 30 is further used to determine screening conditions according to the condition set;

[0148] The data screening module 30 is further configured to screen response data from the response result set based on the screening condition, and feed the response data back to the application service.

[0149] In one embodiment, the cache database response device further includes: a dictionary modification module;

[0150] The dictionary modification module is used to obtain modification information of the cache database when detecting modification of the cache database;

[0151] The dictionary modification module is further used to modify the operation dictionary based on the modification information.

[0152] In one embodiment, the dictionary modification module is further used to determine a modification command type according to the modification information;

[0153] The dictionary modification module is further used to modify the command set, operation set and / or condition set of the operation dictionary according to the modification command type.

[0154] Other embodiments or specific implementations of the cache database response device of the present invention can refer to the above-mentioned method embodiments, which will not be described in detail here.

[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0156] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0157] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0158] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for caching database responses, characterized in that: The cache database response method is applied to a multi-active system, wherein the multi-active system is composed of multiple active systems, and the active systems include: application services, data centers, and cache databases; The cache database response method comprises the following steps: The data center receives a command request from the application service, and determines a candidate cache database according to the command request and the operation dictionary; Accessing the candidate cache database based on the operation dictionary, and receiving a response result set fed back by the candidate cache database; Filter response data from the response result set according to the operation dictionary, and feed the response data back to the application service; Wherein, the operation dictionary includes: a command set; The step of the data center receiving a command request of an application service and determining a candidate cache database according to the command request and an operation dictionary includes: The data center receives the command request of the application service; Filtering a candidate cache database supporting the command request from the cache database based on the command set; The operation dictionary also includes: an operation set; The step of accessing the candidate cache database based on the operation dictionary and receiving a response result set fed back by the candidate cache database includes: Searching the operation set for an access method corresponding to the command request; Finding the extended access content corresponding to the access mode; The candidate cache database is accessed based on the access mode and the extended access content, and a response result set fed back by the candidate cache database is received.

2. The cache database response method according to claim 1, characterized in that: The operation dictionary also includes: a condition set; The step of filtering response data from the response result set based on the operation dictionary and feeding back the response data to the application service includes: Determining a screening condition according to the condition set; Filter response data from the response result set based on the filtering condition, and feed the response data back to the application service.

3. The cache database response method according to claim 1 or 2, characterized in that: Before the step of the data center receiving a command request from an application service and determining a candidate cache database according to the command request and an operation dictionary, the step further includes: When a modification of the cache database is detected, obtaining modification information of the cache database; The operation dictionary is modified based on the modification information.

4. The cache database response method according to claim 3, characterized in that: The step of modifying the operation dictionary based on the modification information includes: Determine a modification command type according to the modification information; The command set, operation set and / or condition set of the operation dictionary are modified according to the modification command type.

5. A multi-active system, characterized in that: The multi-active system is composed of multiple active systems, and the active systems include: application services, data centers and cache databases; the multi-active system also includes: a memory, a processor and a cache database response program stored on the memory and executable on the processor, and when the cache database response program is executed by the processor, it implements the cache database response method as described in any one of claims 1 to 4.

6. A storage medium, characterized in that: The storage medium stores a cache database response program, and when the cache database response program is executed by the processor, the cache database response method according to any one of claims 1 to 4 is implemented.

7. A cache database response device, characterized in that: The cache database response device includes: a database determination module, a result feedback module and a data screening module; The database determination module is used for the data center to receive a command request for an application service and determine a candidate cache database according to the command request and an operation dictionary; The result feedback module is used to access the candidate cache database based on the operation dictionary and receive a response result set fed back by the candidate cache database; The data screening module is used to screen the response data from the response result set according to the operation dictionary, and feed the response data back to the application service; Wherein, the operation dictionary includes: a command set; The database determination module is also used for the data center to receive command requests for application services; The database determination module is further used to screen candidate cache databases supporting the command request from the cache database based on the command set; The operation dictionary also includes: an operation set; The result feedback module is further used to search the operation set for the access mode corresponding to the command request; The result feedback module is further used to search for extended access content corresponding to the access mode; access the candidate cache database based on the access mode and the extended access content, and receive a response result set fed back by the candidate cache database.

Citation Information

Patent Citations

  • Data interacting method and system and computer-readable storage medium

    CN107133297A

  • Code relationship generation method and device, electronic device and storage medium

    CN110333898A

  • Retrieval method and device and computer readable storage medium

    CN111612554A