Disclosure of Invention
Based on this, it is necessary to provide a method and a system for synchronizing caches among multiple nodes, aiming at the problems of accumulation of synchronization requests and reduction of system response speed.
A cache synchronization method among multiple nodes comprises the following steps:
receiving a synchronous request instruction of a service system; the synchronous request instruction comprises an interface parameter and a cache operation instruction;
calling a corresponding interface according to the interface parameter of the synchronous request instruction;
and sending the synchronization request instruction to each preset cache synchronization server through the interface, wherein the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
According to the method for cache synchronization among the multiple nodes, the synchronization request instruction is sent to the cache synchronization server of the cache node to be synchronized, and then the cache synchronization server performs cache synchronization operation according to the synchronization request instruction, so that occupation of cache synchronization on service system resources is reduced, accumulation of synchronization requests is reduced, and the response speed of the system is improved.
In one embodiment, the method for synchronizing the cache among the multiple nodes further comprises the following steps:
receiving a synchronization success prompt message returned by the cache synchronization server; the synchronization success prompt information is prompt information sent by the cache synchronization server after the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction;
and returning first cache success prompt information to the service system according to the synchronization success prompt information.
In one embodiment, the method for synchronizing the cache among the multiple nodes further comprises the following steps:
if the cache synchronization server cannot receive the synchronization request instruction, storing the synchronization request instruction into a retry pool;
and sending the synchronization request instruction to the cache synchronization server according to a certain time period within a preset time threshold, wherein the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
In one embodiment, after the step of sending the synchronization request instruction to the cache synchronization server according to a certain time period within a preset time threshold, the method further includes the following steps:
and receiving a synchronization success prompt message returned by the cache synchronization server, and deleting the synchronization request instruction from the retry pool, wherein the synchronization success prompt message is a prompt message sent by the cache synchronization server after receiving the synchronization request instruction and executing a cache operation instruction in the synchronization request instruction.
A cache synchronization method among multiple nodes comprises the following steps:
receiving a synchronization request instruction sent by a cache synchronization server, wherein the synchronization request instruction comprises a cache operation instruction, cache data and a cache identifier;
positioning a cache service according to the cache identifier of the synchronization request instruction;
and updating the cache data to the cache service according to the cache operation instruction.
According to the method for cache synchronization among the multiple nodes, the synchronous request instruction is sent by the cache synchronization server side which receives the synchronous cache initiating node, and cache synchronization operation is carried out according to the synchronous request instruction, so that occupation of cache synchronization on service system resources is reduced, occurrence of synchronous request accumulation is reduced, and response speed of the system is improved.
In one embodiment, the method for synchronizing the cache among the multiple nodes further comprises the following steps:
receiving second cache success prompt information returned by the cache service;
and sending a synchronization success prompt message to the cache synchronization server according to the second cache success prompt message.
A cache synchronization method among multiple nodes comprises the following steps:
a first cache synchronization server receives a synchronization request instruction of a service system; the synchronization request instruction comprises an interface parameter, a cache operation instruction, a cache value and a cache identifier, and the first cache synchronization server comprises a cache synchronization server of a synchronization cache initiating node;
the first cache synchronization server calls a corresponding interface according to the interface parameter of the synchronization request instruction, and sends the synchronization request instruction to a second cache synchronization server through the interface, wherein the second cache synchronization server comprises a cache synchronization server of a cache node to be synchronized;
the second cache synchronization server receives a synchronization request instruction sent by the first cache synchronization server, and locates cache service according to a cache identifier of the synchronization request instruction;
and the second cache synchronization server side updates the cache data into the cache service according to the cache operation instruction.
According to the method for cache synchronization among the multiple nodes, the cache synchronization server of the synchronization cache initiating node sends the synchronization request instruction, and after the cache synchronization server of the synchronization cache node receives the synchronization request instruction, cache synchronization operation is performed according to the synchronization request instruction, so that occupation of cache synchronization on service system resources is reduced, accumulation of synchronization requests is reduced, and the response speed of the system is improved.
In one embodiment, the method for synchronizing the cache among the multiple nodes further comprises the following steps:
the second cache synchronization server receives second cache success prompt information returned by the cache service, and sends synchronization success prompt information to the first cache synchronization server according to the second cache success prompt information;
and the first cache synchronization server receives the synchronization success prompt message and returns a first cache success prompt message to the service system according to the synchronization success prompt message.
A system for inter-node cache synchronization, comprising:
the first synchronous request instruction receiving module is used for receiving a synchronous request instruction of a service system; the synchronous request instruction comprises an interface parameter and a cache operation instruction;
the interface calling module is used for calling a corresponding interface according to the interface parameter of the synchronous request instruction;
and the synchronous request instruction sending module is used for sending the synchronous request instruction to each preset cache synchronous server through the interface, wherein the cache synchronous server obtains the synchronous request instruction and executes a cache operation instruction in the synchronous request instruction.
According to the cache synchronization system among the multiple nodes, the synchronization request instruction is sent to the cache synchronization server of the cache node to be synchronized, and then the cache synchronization server performs cache synchronization operation according to the synchronization request instruction, so that occupation of cache synchronization on service system resources is reduced, accumulation of synchronization requests is reduced, and the response speed of the system is improved.
A system for inter-node cache synchronization, comprising:
the second synchronization request instruction receiving module is used for receiving a synchronization request instruction sent by a cache synchronization server, wherein the synchronization request instruction comprises a cache operation instruction, cache data and a cache identifier;
the cache service positioning module is used for positioning cache service according to the cache identifier of the synchronization request instruction;
and the cache data updating module is used for updating the cache data into the cache service according to the cache operation instruction.
According to the cache synchronization system among the multiple nodes, the cache synchronization server side of the node which receives the synchronization cache sends the synchronization request instruction, and cache synchronization operation is carried out according to the synchronization request instruction, so that occupation of cache synchronization on service system resources is reduced, accumulation of synchronization requests is reduced, and the response speed of the system is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for cache synchronization among multiple nodes in an embodiment of the present invention, where the embodiment takes a cache synchronization server side of a cache synchronization initiating node as an example for description, and the method for cache synchronization among multiple nodes includes the following steps:
step S110: receiving a synchronous request instruction of a service system; the synchronization request instruction comprises an interface parameter and a cache operation instruction.
In this step, the local cache synchronization server receives a synchronization request instruction sent by the service system, where the synchronization request instruction is triggered and sent when a certain service system in the local nodes performs an operation of caching data, where the local node is used as a cache synchronization initiating node, and the synchronization request instruction may record an interface parameter to be called and a synchronous cache operation instruction.
Step S120: and calling the corresponding interface according to the interface parameter of the synchronous request instruction.
In this step, the local cache synchronization server calls a corresponding interface according to the interface parameter of the synchronization request instruction.
Step S130: and sending the synchronization request instruction to each preset cache synchronization server through an interface, wherein the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
After the synchronization request instruction is sent to the cache synchronization server of the remote to-be-synchronized cache node through the interface, the cache synchronization server of the remote to-be-synchronized cache node obtains the synchronization request instruction, and performs synchronous caching according to the synchronization request instruction.
Optionally, a communication Protocol between the local cache synchronization server and the cache synchronization server of the remote node to be synchronized may use an HTTP (HyperText Transfer Protocol) Protocol, or may also use an interactive Protocol such as a TCP (Transmission Control Protocol) or a thread Protocol.
Furthermore, the selection of the remote cache node to be synchronized can be realized through the routing control among the nodes. Before synchronous caching, the remote nodes needing synchronous caching can be set by adjusting routing control among the nodes, so that the cache data of one node is synchronized into the cache of another appointed remote node, or the cache data synchronization value of one node is synchronized into the caches of a plurality of appointed remote nodes.
In the above embodiment, the synchronization request instruction is sent to the cache synchronization server of the node to be synchronized, and then the cache synchronization server performs cache synchronization operation according to the synchronization request instruction, so that occupation of cache synchronization on service system resources is reduced, occurrence of synchronization request accumulation is reduced, system response speed is improved, cache synchronization among multiple nodes is realized, cache service data among the multiple nodes is consistent, user imperceptibility of the service system when the node is switched can be ensured, situations that a large number of concurrent requests puncture a database to cause service opportunities due to cache data inconsistency when the node is switched by the service system are reduced, and stability of each service system in each node is ensured.
In one embodiment, the method for synchronizing the cache among the multiple nodes may further include the following steps:
receiving a synchronization success prompt message returned by the cache synchronization server; the cache synchronization server side sends a synchronization request instruction to a cache synchronization server side, wherein the synchronization success prompt information is prompt information sent by the cache synchronization server side after the cache synchronization server side obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction; and returning the first cache success prompt message to the service system according to the synchronization success prompt message.
And when the cache synchronization server of the remote node to be synchronized obtains the synchronization request instruction, performing synchronous caching according to the synchronization request instruction, returning the synchronization success prompt information to the local cache synchronization server after cache synchronization is realized, and returning the cache success prompt information to the service system by the local cache synchronization server according to the synchronization success prompt information.
Further, in the process of performing cache synchronization, when the network fluctuates or the network is abnormal, the cache synchronization server of the remote to-be-synchronized cache node cannot receive the synchronization request instruction, and cannot synchronize the cache data into the cache, and the local cache synchronization server can ensure the final consistency of the cache data through a retry mechanism. As an embodiment, the method for cache synchronization among multiple nodes may further include the following steps:
if the cache synchronization server cannot receive the synchronization request command, the synchronization request command is stored in a retry pool;
and sending the synchronization request instruction to a cache synchronization server according to a certain time period within a preset time threshold, wherein the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
The retry scheme can effectively avoid the accumulation of synchronous requests, reduce the occupation of system resources, improve the response speed and reduce the downtime.
Further, after the step of sending the synchronization request instruction to the cache synchronization server according to a certain time period within a preset time threshold, the method further comprises the following steps:
and receiving a synchronization success prompt message returned by the cache synchronization server, and deleting the synchronization request instruction from the retry pool, wherein the synchronization success prompt message is a prompt message sent by the cache synchronization server after receiving the synchronization request instruction and executing a cache operation instruction in the synchronization request instruction.
Specifically, the local cache synchronization server sends the synchronization request instruction in the retry pool to the cache synchronization server of the remote to-be-synchronized cache node, and deletes the synchronization request instruction in the retry pool after receiving the synchronization success prompt message returned by the cache synchronization server of the remote to-be-synchronized cache node, so that the storage space of the retry pool is saved, and the same synchronization request instruction is prevented from being repeatedly sent.
Referring to fig. 2, fig. 2 is a flowchart of a method for cache synchronization among multiple nodes in another embodiment of the present invention, which is described by taking a cache synchronization server side of a cache node to be synchronized as an example, and includes the following steps:
step S210: receiving a synchronization request instruction sent by a cache synchronization server, wherein the synchronization request instruction comprises a cache operation instruction, cache data and a cache identifier.
In this step, the cache synchronization server of the node to be synchronized receives a synchronization request instruction sent by the cache synchronization server of the node to be synchronized, where the synchronization request instruction is triggered and sent when a certain service system in the node to be synchronized performs a data caching operation, and the synchronization request instruction may record a synchronized cache operation instruction, cache data to be synchronized, and a cache identifier for locating to the cache service.
Step S220: and positioning the cache service according to the cache identification of the synchronization request instruction.
Step S230: and updating the cache data into the cache service according to the cache operation instruction.
The cache operation instruction may include a write instruction, a modify instruction, a delete instruction, and the like, and according to the cache operation instruction, writing the cache data into the cache service, deleting the cache data from the cache service, and modifying the data in the cache service may be implemented.
In this embodiment, after the cache synchronization server of the node to be synchronized receives the synchronization request instruction sent by the cache synchronization server of the node initiating the synchronization cache, the cache synchronization operation is performed according to the synchronization request instruction, so that the occupation of the cache synchronization on the service system resources is reduced, the occurrence of the synchronization request accumulation is reduced, and the system response speed is improved.
Further, the method for synchronizing the cache among the multiple nodes further comprises the following steps:
receiving a second cache success prompt message returned by the cache service; and sending the synchronization success prompt information to the cache synchronization server according to the second cache success prompt information.
After the cache synchronization server of the cache node to be synchronized updates the cache data in the cache service, the cache service returns cache success prompt information to the cache synchronization server of the cache node to be synchronized, and the cache synchronization server of the cache node to be synchronized sends the synchronization success prompt information to the cache synchronization server of the cache synchronization initiating node according to the cache success prompt information.
Referring to fig. 3, fig. 3 is a flowchart of a cache synchronization method among multiple nodes in another embodiment of the present invention, which is described by taking an example of interaction between a cache synchronization server of a cache synchronization initiating node and a cache synchronization server of a cache node to be synchronized, and includes the following steps:
step S310: a first cache synchronization server receives a synchronization request instruction of a service system; the first cache synchronization server comprises a cache synchronization server of a synchronization cache initiating node;
step S320: the first cache synchronization server calls a corresponding interface according to the interface parameter of the synchronization request instruction, and sends the synchronization request instruction to a second cache synchronization server through the interface, wherein the second cache synchronization server comprises a cache synchronization server of a cache node to be synchronized;
step S330: the second cache synchronization server receives the synchronization request instruction sent by the first cache synchronization server, and locates the cache service according to the cache identifier of the synchronization request instruction;
step S340: and the second cache synchronization server side updates the cache data into the cache service according to the cache operation instruction.
In this embodiment, the cache synchronization server of the synchronization cache initiating node sends the synchronization request instruction, and after receiving the synchronization request instruction, the cache synchronization server of the synchronization cache node performs cache synchronization operation according to the synchronization request instruction, so as to reduce occupation of cache synchronization on service system resources, reduce occurrence of synchronization request accumulation, improve system response speed, and improve system response speed.
Specifically, the first cache synchronization server is a cache synchronization server of the cache synchronization initiating node, and the second cache synchronization server is a cache synchronization server of the cache node to be synchronized. The cache data of a certain service system in a node is operated, the service system sends a synchronization request instruction to a local cache synchronization server, the node is used as a cache synchronization initiating node, and the local cache synchronization server of the node is used as a first cache synchronization server. After receiving the synchronization request instruction, the first cache synchronization server calls a corresponding interface according to the interface parameter of the synchronization request instruction, and simultaneously sends the synchronization request instruction to a remote second cache synchronization server through the interface; after the remote second cache synchronization server obtains the synchronization request instruction, the cache service to the node is positioned according to the cache identification of the synchronization request instruction, cache data in the cache service is updated according to cache operation instructions, such as a write-in instruction, a modification instruction, a deletion instruction and the like, cache synchronization among multiple nodes is realized, cache service data among the multiple nodes are consistent, a user can be ensured not to be aware when the service system switches the nodes, the situations that a large number of concurrent requests break down a database to cause server computers and the like due to cache data inconsistency of the service system when the nodes are switched are reduced, and the stability of each service system in each node is ensured.
Further, the first cache synchronization server may implement selection of the second cache synchronization server through inter-node routing control. In the process of synchronous caching, the routing control among the nodes is adjusted, the remote nodes needing synchronous caching are selected, and the cache data of one node is synchronized into the cache of one appointed remote node or the cache data synchronization value of one node is synchronized into the caches of a plurality of appointed remote nodes.
In one embodiment, the method for synchronizing the cache among the multiple nodes further comprises the following steps:
the second cache synchronization server receives second cache success prompt information returned by the cache service, and sends synchronization success prompt information to the first cache synchronization server according to the second cache success prompt information;
and the first cache synchronization server receives the synchronization success prompt message and returns the first cache success prompt message to the service system according to the synchronization success prompt message.
And informing the service system of the synchronous cache initiating node of completing cache synchronization through the synchronization success prompt message.
Further, in the process of performing cache synchronization, when the network fluctuates or the network is abnormal, the second cache synchronization server cannot receive the synchronization request instruction, and cannot synchronize the cache data into the cache, and the first cache synchronization server ensures the final consistency of the cache data through a retry mechanism. As an embodiment, the method for cache synchronization among multiple nodes may further include the following steps:
if the second cache synchronization server cannot receive the synchronization request instruction sent by the first cache synchronization server, the first cache synchronization server stores the synchronization request instruction into a retry pool;
and within a preset time threshold, the first cache synchronization server sends the synchronization request instruction to the second cache synchronization server according to a certain time period, wherein the second cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
The first cache synchronization server side stores the synchronization request instruction into a retry pool, and in the effective time of the synchronization request instruction, the first cache synchronization server side sends the synchronization request instruction to the second cache synchronization server side again at intervals, so that the final consistency of cache data is guaranteed, request accumulation is avoided, occupation of system resources is reduced, the response speed is improved, and downtime is reduced.
Further, within a preset time threshold, after the step of sending the synchronization request instruction to the cache synchronization server by the first cache synchronization server according to a certain time period, the method further includes the following steps:
and the first cache synchronization server receives synchronization success prompt information returned by the second cache synchronization server, and deletes the synchronization request instruction from the retry pool, wherein the synchronization success prompt information is prompt information sent after the second cache synchronization server receives the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
And the first cache synchronization server sends the synchronization request instruction in the retry pool to the second cache synchronization server, and deletes the synchronization request instruction in the retry pool after receiving the synchronization success prompt message returned by the second cache synchronization server, so that the storage space of the retry pool is saved, and the synchronization request instruction is prevented from being sent to the second cache synchronization server again.
For clearer clarity of the technical solution of the present invention, a method for synchronizing a cache between multiple nodes according to an embodiment of the present invention is described with reference to fig. 4 as an example.
Fig. 4 is a diagram of an application environment of a cache synchronization method among multiple nodes in an embodiment of the present invention, where the application environment includes multiple nodes, and each node deploys a complete set of services, including an independent distributed cache cluster, for example, a node 400A includes a system group 410A, a cache synchronization server 420A, and a distributed cache cluster 430A; the system group 410 includes one or more business systems, and the distributed cache service cluster 430 includes one or more cache services.
In the node 400A, the service system of the system group 410A operates to cache data, and the service system sends a synchronization request command to the local cache synchronization server 420A. Node 400A acts as the cache synchronization initiating node. After receiving the synchronization request instruction, the cache synchronization server 420a calls a corresponding interface according to the interface parameter of the synchronization request instruction, and sends the synchronization request instruction to one or more cache synchronization servers of the remote node through the interface, for example, to the cache synchronization server 420b, the cache synchronization server 420z, and the cache synchronization server 420 y. After the cache synchronization server of the remote node obtains the synchronization request instruction, the cache service to the node is positioned according to the cache identification of the synchronization request instruction, cache data in the cache service is updated according to cache operation instructions, such as a write-in instruction, a modification instruction, a deletion instruction and the like, cache synchronization among multiple nodes is realized, cache service data among the multiple nodes are consistent, the condition that a user does not sense when the service system switches the nodes can be guaranteed, the condition that a large number of concurrent requests break down a database due to cache data inconsistency of the service system when the nodes are switched is reduced, and the stability of each service system in each node is guaranteed.
According to the above method for synchronizing a cache between multiple nodes, the present invention further provides a system for synchronizing a cache between multiple nodes, and embodiments of the system for synchronizing a cache between multiple nodes according to the present invention are described in detail below.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a multi-node cache synchronization system according to an embodiment of the present invention. In this embodiment, a cache synchronization server side of a cache synchronization initiating node is taken as an example for explanation, and a cache synchronization system among multiple nodes includes:
a first synchronization request instruction receiving module 510, configured to receive a synchronization request instruction of a service system; the synchronous request instruction comprises an interface parameter and a cache operation instruction;
an interface calling module 520, configured to call a corresponding interface according to the interface parameter of the synchronization request instruction;
a synchronization request instruction sending module 530, configured to send a synchronization request instruction to each preset cache synchronization server through an interface, where the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
In this embodiment, the first synchronization request instruction receiving module 510 sends the synchronization request instruction to the cache synchronization server of the to-be-synchronized cache node, and then the cache synchronization server performs cache synchronization operation according to the synchronization request instruction, so as to reduce occupation of cache synchronization on service system resources, reduce occurrence of synchronization request accumulation, and improve system response speed.
In one embodiment, the system for cache synchronization among multiple nodes further comprises a first feedback information receiving module, configured to receive a synchronization success prompt message returned by the cache synchronization server; the cache synchronization server side sends a synchronization request instruction to a cache synchronization server side, wherein the synchronization success prompt information is prompt information sent by the cache synchronization server side after the cache synchronization server side obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction; and returning the first cache success prompt message to the service system according to the synchronization success prompt message.
In one embodiment, the synchronization request instruction sending module 530 stores the synchronization request instruction into the retry pool when the cache synchronization server cannot receive the synchronization request instruction; and sending the synchronization request instruction to a cache synchronization server according to a certain time period within a preset time threshold, wherein the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
In one embodiment, the first feedback information receiving module receives synchronization success prompt information returned by the cache synchronization server, and deletes the synchronization request instruction from the retry pool, where the synchronization success prompt information is prompt information sent by the cache synchronization server after receiving the synchronization request instruction and executing a cache operation instruction in the synchronization request instruction.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a multi-node cache synchronization system according to another embodiment of the present invention. This embodiment is described by taking a cache synchronization server side of a cache node to be synchronized as an example, and the system for synchronizing caches among multiple nodes includes:
a second synchronization request instruction receiving module 610, configured to receive a synchronization request instruction sent by a cache synchronization server, where the synchronization request instruction includes a cache operation instruction, cache data, and a cache identifier;
a cache service positioning module 620, configured to position a cache service according to the cache identifier of the synchronization request instruction;
and a cache data updating module 630, configured to update the cache data to the cache service according to the cache operation instruction.
In one embodiment, the system for cache synchronization among multiple nodes further includes a second feedback information receiving module, configured to receive a second cache success prompt message returned by the cache service; and sending the synchronization success prompt information to the cache synchronization server according to the second cache success prompt information.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a multi-node cache synchronization system according to another embodiment of the present invention. In this embodiment, a cache synchronization server of a cache synchronization initiating node and a cache synchronization server of a cache node to be synchronized are used for example to describe, the multi-node cache synchronization system includes a first synchronization request instruction receiving module 510, an interface calling module 520, a synchronization request instruction sending module 530, a second synchronization request instruction receiving module 610, a cache service positioning module 620, and a cache data updating module 630.
The first synchronization request instruction receiving module 510 receives a synchronization request instruction of a service system; the synchronous request instruction comprises an interface parameter, a cache operation instruction, a cache value and a cache identifier;
the interface calling module 520 calls a corresponding interface according to the interface parameter of the synchronization request instruction;
the synchronization request instruction transmitting module 530 transmits the synchronization request instruction to the second synchronization request instruction receiving module 610 through the interface;
the second synchronization request instruction receiving module 610 receives a synchronization request instruction sent by the first cache synchronization server;
the cache service positioning module 620 positions the cache service to be cached synchronously according to the cache identifier of the synchronization request instruction;
the cache data updating module 630 updates the cache data to the cache service according to the cache operation instruction.
In one embodiment, the inter-node cache synchronization system further includes a second feedback information receiving module and a first feedback information receiving module;
the second feedback information receiving module receives second cache success prompt information returned by the cache service and sends synchronization success prompt information to the first feedback information receiving module according to the second cache success prompt information;
and the first feedback information receiving module receives the synchronization success prompt information and returns the cache success prompt information to the service system according to the synchronization success prompt information.
In one embodiment, the synchronization request instruction sending module 530 stores the synchronization request instruction into the retry pool when the second synchronization request instruction receiving module 610 cannot receive the synchronization request instruction; and sending the synchronization request instruction to a cache synchronization server according to a certain time period within a preset time threshold, wherein the cache synchronization server obtains the synchronization request instruction and executes a cache operation instruction in the synchronization request instruction.
In one embodiment, the first feedback information receiving module receives synchronization success prompt information returned by the second feedback information receiving module, and deletes the synchronization request instruction from the retry pool, where the synchronization success prompt information is prompt information sent by the cache synchronization server after receiving the synchronization request instruction and executing a cache operation instruction in the synchronization request instruction.
The technical features and the advantageous effects described in the embodiments of the inter-node cache synchronization method are applicable to the embodiments of the inter-node cache synchronization system, and thus it is stated that the inter-node cache synchronization system and the inter-node cache synchronization method of the present invention correspond to each other one by one.
In one embodiment, a computer device is further provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the inter-node cache synchronization method as in any one of the above embodiments.
When the processor of the computer device executes a program, the method for cache synchronization among multiple nodes is realized, so that the occupation of the cache synchronization on the service system resources can be reduced, the occurrence of synchronization request accumulation is reduced, and the system response speed is improved.
In addition, it can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiments may be implemented by instructing the relevant hardware through a computer program, where the program may be stored in a non-volatile computer-readable storage medium, and in the embodiments of the present invention, the program may be stored in the storage medium of the computer system and executed by at least one processor in the computer system, so as to implement the processes of the embodiments including the above-described cache synchronization method between multiple nodes.
In one embodiment, a storage medium is further provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the inter-multi-node cache synchronization method according to any one of the above embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The computer storage medium and the computer program stored in the computer storage medium realize the flow including the embodiment of the cache synchronization method among the multiple nodes, so that the occupation of the cache synchronization on the service system resources can be reduced, the occurrence of synchronization request accumulation is reduced, and the system response speed is improved.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.