A method and device for updating cache data

By establishing a temporary node under the Zookeeper node and resending cache update notifications, the problem of untimely cache updates in the Zookeeper Watch mechanism in high concurrency is solved, real-time and reliable updates of cached data are achieved.

CN113364822BActive Publication Date: 2024-12-03BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010148244.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-05
Publication Date
2024-12-03
Estimated Expiration
2040-03-05

AI Technical Summary

Technical Problem

The Zookeeper Watch mechanism is not applicable when data is highly concurrency, and it needs to be re-registered after a single listening, resulting in the second client not being able to promptly notify the second client to update the cache during the registration period.

Method used

By establishing a temporary node under the Zookeeper node to store the IP address of the first client, receiving cache update notifications and resending them to the client that has not received the notification, ensuring real-time update of cached data.

Benefits of technology

Real-time update reliability of cached data in high concurrency situations is achieved, and the problem of cache failure to update in time due to network exceptions is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113364822B_ABST
    Figure CN113364822B_ABST
Patent Text Reader

Abstract

The present invention discloses a cache data update method and device, and relates to the field of computer technology. A specific implementation of the method includes: in response to a registration monitoring request of a first client to a node, a temporary node is established under the node to store the IP address of the first client; a cache update notification transmitted by a second client is received, and the cache update notification is transmitted to the first client via the IP address, and then a message fed back by at least one first client is received; if the number of first clients that feedback the message is less than the number of temporary nodes, the cache update notification is resent to the first client to perform a local cache update on the first client. This implementation adds a feedback mechanism and a compensation mechanism. When there is a first client that does not receive the cache update notification, the cache update notification can be resent to all first clients or only to the third client that has not received the notification, and has real-time notification reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a cache data updating method and device. Background Art

[0002] Application local cache is usually stored in JVM (Java Virtual Machine). Compared with the unified cache center, it has the characteristics of efficient access because it does not involve network and serialization overhead.

[0003] The existing local cache management requires setting a cache expiration time, and when the expiration time is reached, the cache is updated again. However, in some cases (such as changes in city information), the cache expiration time is unknown. If it is set too long, the local cache is not updated in time, which may cause the database and local cache data to be inconsistent. Therefore, it is necessary to monitor whether the data in the database has changed in real time so as to update the local cache in time.

[0004] To address the above defects, the existing method mainly relies on the Zookeeper Watch mechanism to push the data update notification received from the first client to the second client in real time. However, in the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0005] The Zookeeper Watch mechanism is not suitable for high data concurrency situations, and the mechanism is a one-time monitoring mechanism. After the monitoring is completed, the monitoring event will be cleared. If you continue to monitor, you need to re-register. However, during the registration period, if the data in the first client changes, the second client cannot be notified in time to update the cache. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a cache data updating method and device, which can at least solve the problem that the local cache is not updated in time in the prior art.

[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, a cache data updating method is provided, comprising:

[0008] In response to a registration monitoring request of a first client to a node, establishing a temporary node under the node to store the IP address of the first client;

[0009] receiving a cache update notification transmitted by the second client, transmitting the cache update notification to the first client through the IP address, and then receiving at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received;

[0010] If the number of first clients that feedback the message is less than the number of temporary nodes, the cache update notification is resent to the first client to perform a local cache update on the first client.

[0011] Optionally, the receiving a cache update notification transmitted by the second client includes:

[0012] receiving a cache data update notification from a second client, storing the key name of the cache data in the node, so as to generate a cache update notification based on the key name through the node; wherein the node represents a node where the cache data has changed;

[0013] The transmitting the cache update notification to the first client through the IP address includes:

[0014] The cache update notification is transmitted to the first client via the IP address to trigger the first client to load the key value from the second client according to the key name.

[0015] Optionally, the resending the cache update notification to the first client to perform a local cache update on the first client includes:

[0016] The cache update notification is resent to all first clients under the temporary node, so as to re-update the local cache of all first clients.

[0017] Optionally, the message includes the key name and IP address;

[0018] The step of resending the cache update notification to the first client to perform a local cache update on the first client includes:

[0019] Determine the IP address of a third client that has not received the cache update notification based on the IP address in the temporary node and the IP address in the feedback message; wherein the third client is a subset of the first client;

[0020] The cache update notification is retransmitted to the third client via the IP address of the third client, so as to perform a local cache update on the third client.

[0021] Optionally, after receiving at least one first client feedback message, the method further includes:

[0022] storing the message in a feedback record corresponding to the key name; and

[0023] The feedback record is stored in the second client.

[0024] To achieve the above object, according to another aspect of an embodiment of the present invention, a cache updating device is provided, comprising:

[0025] A request receiving module, configured to, in response to a registration monitoring request of a first client to a node, establish a temporary node under the node to store the IP address of the first client;

[0026] a message feedback module, configured to receive a cache update notification transmitted by a second client, transmit the cache update notification to the first client via the IP address, and then receive at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received;

[0027] The notification compensation module is used to resend the cache update notification to the first client if the number of first clients that feedback the message is less than the number of temporary nodes, so as to perform a local cache update on the first client.

[0028] Optionally, the message feedback module is used to:

[0029] receiving a cache data update notification from a second client, storing the key name of the cache data in the node, so as to generate a cache update notification based on the key name through the node; wherein the node represents a node where the cache data has changed;

[0030] The cache update notification is transmitted to the first client via the IP address to trigger the first client to load the key value from the second client according to the key name.

[0031] Optionally, the notification compensation module is used to: resend the cache update notification to all first clients under the temporary node to re-update the local cache of all first clients.

[0032] Optionally, the message includes the key name and IP address;

[0033] The notification compensation module is used to:

[0034] Determine the IP address of a third client that has not received the cache update notification based on the IP address in the temporary node and the IP address in the feedback message; wherein the third client is a subset of the first client;

[0035] The cache update notification is retransmitted to the third client via the IP address of the third client, so as to perform a local cache update on the third client.

[0036] Optionally, a message logging module is also included, which is used to:

[0037] storing the message in a feedback record corresponding to the key name; and

[0038] The feedback record is stored in the second client.

[0039] To achieve the above objective, according to another aspect of an embodiment of the present invention, a cache updating electronic device is provided.

[0040] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the cache data update methods described above.

[0041] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the cache data updating methods described above is implemented.

[0042] According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: adding feedback mechanism and compensation mechanism, when the number of clients that have received the notification is less than their total number, the cache update notification can be resent to all first clients or only third clients that have not received the notification, thereby realizing compensatory update of the cache data key and having real-time notification reliability.

[0043] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0045] Figure 1 This is a main flow chart of a cache data updating method according to an embodiment of the present invention;

[0046] Figure 2 is a flow chart of an optional cache data updating method according to an embodiment of the present invention;

[0047] Figure 3 is a schematic diagram of a framework of a cache data updating method according to an embodiment of the present invention;

[0048] Figure 4 is a schematic diagram of main modules of a cache updating device according to an embodiment of the present invention;

[0049] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0050] Figure 6 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0052] It should be noted that the embodiment of the present invention relates to a local cache update solution, which can be applied to a variety of computer languages, such as Java. The nodes are mainly in Zookeeper, which is a distributed, open source distributed application coordination service.

[0053] See also Figure 1 , which shows a main flow chart of a cache data updating method provided by an embodiment of the present invention, comprising the following steps:

[0054] S101: In response to a registration monitoring request of a first client to a node, establish a temporary node under the node to store the IP address of the first client;

[0055] S102: receiving a cache update notification transmitted by the second client, transmitting the cache update notification to the first client through the IP address, and then receiving at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received;

[0056] S103: If the number of first clients that feedback the message is less than the number of temporary nodes, resend the cache update notification to the first client to perform a local cache update on the first client.

[0057] In the above implementation, for step S101, the first client requests to register and monitor a node in Zookeeper, calls the Watch interface of Zookeeper, and completes the registration operation. After the registration is completed, a temporary node is established under the node to store the IP address of the first client.

[0058] It should be noted that one node may correspond to multiple temporary nodes, and one client may correspond to one temporary node. By storing the client IP addresses, the number of first clients corresponding to the node and which first clients there are may be counted.

[0059] In addition, the monitoring here is still one-way monitoring. Temporary nodes are a type of node under Zookeeper. When the first client that creates a temporary node crashes or closes the connection with Zookeeper, the node will be deleted.

[0060] Regarding step S102, when the cache data in the second client (eg, a database) changes, a cache update notification is transmitted to Zookeeper, and is forwarded by Zookeeper to the first client.

[0061] The cache data in the present invention is in the form of key-value pairs, where the key is stored in the node and the value is stored in the second client. Figure 2 After receiving the notification, the first client will load the corresponding value from the second client according to the key in the cache data, and then update the local cache of the first client.

[0062] In addition, after receiving the notification, the first client calls the feedback interface provided by the proxy (the interface is associated with the message feedback module), feeds back to the proxy the message that the cache update notification has been received, and uploads its updated cache data key, IP address and other information.

[0063] It should be noted that the entire notification mechanism of the present invention is implemented on the proxy. After receiving the feedback message from the first client, the proxy can store the feedback message in a feedback record corresponding to the cache data key, and the feedback record can be stored in the second client or a preset file / module.

[0064] Regarding step S103, when there is a network anomaly or it is inconvenient to send and receive notifications, some first clients may not receive the cache update notification and thus cannot update the local cache.

[0065] Based on the solution to the above problem, in addition to the message feedback module, the present invention also provides a notification compensation module in the proxy, which is used to perform compensation operations when it is detected that the first client has not received the cache update notification. Specifically:

[0066] 1) Count the number of IP addresses in the temporary nodes under the Zookeeper node, and use the number as the total number of first clients; wherein the temporary nodes can be filtered based on the cached data key;

[0067] 2) Counting the number of first clients that have received the cache update notification from the feedback record;

[0068] 3) Compare the total number of first clients in 1) and the amount of feedback in 2):

[0069] ① If the feedback amount = the total number of first listening clients, then set the cache key status in the node to update successfully;

[0070] ② If the feedback amount is less than the total number of the first listening clients, it means that some clients (i.e., the third clients) have not received the cache update notification, and the feedback record is set to expired (or failed) status;

[0071] 4) Trigger the compensation mechanism and transmit the cache update notification again:

[0072] ① Regardless of whether the first client receives the cache update notification or not, the cache update notification will be sent again;

[0073] ② According to the first client IP address in the temporary node and the first client IP address in the feedback record, determine the third client that has not received the cache update notification, and then only send the cache update notification to the third client;

[0074] 5) Regardless of notifying all first clients again or notifying only the third client, the feedback amount and the total number of clients still need to be compared repeatedly until the number of repetitions reaches an upper limit or all first clients receive the cache update notification.

[0075] It should be noted that, compared with method ② in method ①, method ① in 4 needs to first determine the third client that has not received the notification, and then send the cache update notification. The operation steps are fewer, and only the first client loads the cache data once again, which is highly efficient. Therefore, the present invention mainly selects method ① for implementation.

[0076] In addition, a background task can be started to scan the cache data key periodically (for example, every 5 seconds) to verify whether all first clients have received the cache update notification. It should be noted that for the same node and the same cache data key, there may be multiple first clients associated. When the cache data in the second client changes, the cache of all first clients needs to be updated.

[0077] The method provided in the above embodiment adds a feedback mechanism and a compensation mechanism. When the number of clients that have received the notification is less than their total number, the cache update notification can be resent to all first clients or only third clients that have not received the notification, thereby realizing a compensatory update of the cache data key and having real-time notification reliability.

[0078] See also Figure 2 , shows a schematic flow chart of an optional cache data update method according to an embodiment of the present invention, comprising the following steps:

[0079] S201: In response to a registration monitoring request of a first client to a node, establish a temporary node under the node to store the IP address of the first client;

[0080] S202: receiving a cache data update notification from a second client, storing the key name of the cache data in the node, so as to generate a cache update notification based on the key name through the node; wherein the node represents a node where the cache data is changed;

[0081] S203: Transmitting the cache update notification to the first client via the IP address to trigger the first client to load the key value from the second client according to the key name;

[0082] S204: receiving a message fed back by at least one first client; wherein the message indicates that a cache update notification has been received;

[0083] S205: If the number of first clients that feedback the message is less than the number of temporary nodes, resend the cache update notification to the first client to perform a local cache update on the first client.

[0084] In the above embodiment, for steps S201, S204 and S205, see Figure 1 The description of steps S101 to S103 is not repeated here.

[0085] In the above implementation, for steps S202 and S203, the operator can add, modify, and delete cache data through the CMS (Content Management System), and save the changed data (its value) to the second client.

[0086] The cache data in the present invention is in the form of a key-value pair, and its key is stored in the Zookeeper node by the CMS through a proxy. At this time, the node content of the node is the cache data key. It should be noted that the node here only indicates that the value corresponding to the key has been updated, and after determining that all first clients have received the cache update notification, the cache data key is cleared.

[0087] The cache update notification transmitted to the first client can be generated by the node after receiving the cache data key. Then the real-time notification module of the proxy is called to transmit the cache update notification to the first client. After receiving the notification, the first client will load the corresponding value from the second client according to the key of the cache data, and then update the local cache of the first client.

[0088] The method provided in the above embodiment only stores the cache data key in the second client in the node, and the node generates a cache update notification, which is transmitted to the first client through the real-time notification module to trigger the first client to perform message feedback and key value loading operations.

[0089] See also Figure 3 , shows a schematic diagram of a cache data update method framework according to an embodiment of the present invention, including a real-time update module, a message feedback module and a notification compensation module, wherein:

[0090] 1) Real-time notification module: When the program starts, the first client (Client) registers to monitor a node with Zookeeper, and at the same time establishes a temporary node under the node to save the first client IP address.

[0091] The CMS updates the cache data in the second client, stores the key of the cache data in the node through the real-time update module of the proxy, and generates a cache update notification through the node and transmits it to the first client.

[0092] 2) Message feedback module: After receiving the cache update notification, the first client calls the feedback interface provided by the proxy to feedback to the proxy that it has received the cache update notification and uploads its IP address, updated cache key and other fields. After receiving the feedback, the message feedback module reports the client information in the feedback record.

[0093] 3) Notify the compensation module, periodically scan the cache data key, and verify whether all first clients have received the cache update notification. If no client has received the update message, the cache key status is set to update success. If so, the feedback record is set to expired, and the real-time notification module is called again to initiate notification.

[0094] See also Figure 4 , shows a schematic diagram of main modules of a cache data updating device 400 provided in an embodiment of the present invention, including:

[0095] The request receiving module 401 is used to establish a temporary node under the node in response to the registration monitoring request of the first client to the node to store the IP address of the first client;

[0096] The message feedback module 402 is used to receive the cache update notification transmitted by the second client, transmit the cache update notification to the first client through the IP address, and then receive at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received;

[0097] The notification compensation module 403 is configured to resend the cache update notification to the first client if the number of first clients that feedback the message is less than the number of temporary nodes, so as to perform a local cache update on the first client.

[0098] In the implementation device of the present invention, the message feedback module 402 is used to:

[0099] receiving a cache data update notification from a second client, storing the key name of the cache data in the node, so as to generate a cache update notification based on the key name through the node; wherein the node represents a node where the cache data has changed;

[0100] The cache update notification is transmitted to the first client via the IP address to trigger the first client to load the key value from the second client according to the key name.

[0101] In the implementation device of the present invention, the notification compensation module 403 is used to: resend the cache update notification to all first clients under the temporary node, so as to re-update the local cache of all first clients.

[0102] In the implementation device of the present invention, the message includes the key name and the IP address;

[0103] The notification compensation module 403 is used to:

[0104] Determine the IP address of a third client that has not received the cache update notification based on the IP address in the temporary node and the IP address in the feedback message; wherein the third client is a subset of the first client;

[0105] The cache update notification is retransmitted to the third client via the IP address of the third client, so as to perform a local cache update on the third client.

[0106] The implementation device of the present invention further includes a message recording module 404 (not shown in the figure), which is used to:

[0107] storing the message in a feedback record corresponding to the key name; and

[0108] The feedback record is stored in the second client.

[0109] In addition, the specific implementation content of the device described in the embodiment of the present invention has been described in detail in the method described above, so the repeated content will not be described again here.

[0110] Figure 5 An exemplary system architecture 500 is shown in which embodiments of the present invention may be applied.

[0111] like Figure 5 As shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505 (just an example). The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0112] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 501, 502, 503.

[0113] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0114] The server 505 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 501 , 502 , and 503 (only as an example).

[0115] It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the device is generally set in the server 505 .

[0116] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0117] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0118] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0119] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0120] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0121] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0122] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0123] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a request receiving module, a message feedback module, and a notification compensation module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the notification compensation module may also be described as a "module for compensating cache update notifications".

[0124] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0125] In response to a registration monitoring request of a first client to a node, establishing a temporary node under the node to store the IP address of the first client;

[0126] receiving a cache update notification transmitted by the second client, transmitting the cache update notification to the first client through the IP address, and then receiving at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received;

[0127] If the number of first clients that feedback the message is less than the number of temporary nodes, the cache update notification is resent to the first client to perform a local cache update on the first client.

[0128] According to the technical solution of the embodiment of the present invention, a feedback mechanism and a compensation mechanism are added. When the number of clients that have received the notification is less than their total number, the cache update notification can be resent to all first clients or only third clients that have not received the notification, thereby realizing compensatory update of the cache data key and having real-time notification reliability.

[0129] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A cache data updating method, characterized in that: include: In response to a registration monitoring request of a first client to a node, a temporary node is established under the node to store the IP address of the first client; wherein one node corresponds to multiple temporary nodes, one client corresponds to one temporary node, and if the first client that creates the temporary node crashes or closes the connection, the temporary node is automatically deleted; receiving a cache update notification transmitted by the second client, transmitting the cache update notification to the first client through the IP address, and then receiving at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received; If the number of first clients in the feedback message is less than the number of temporary nodes, the cache update notification is resent to the first client to perform a local cache update on the first client, including: determining the IP address of a third client that has not received the cache update notification based on the IP address in the temporary node and the IP address in the feedback message; wherein the third client is a subset of the first client; and retransmitting the cache update notification to the third client via the IP address of the third client to perform a local cache update on the third client.

2. The method according to claim 1, characterized in that The receiving a cache update notification transmitted by the second client includes: receiving a cache data update notification from a second client, storing the key name of the cache data in the node, so as to generate a cache update notification based on the key name through the node; wherein the node represents a node where the cache data has changed; The transmitting the cache update notification to the first client through the IP address includes: The cache update notification is transmitted to the first client via the IP address to trigger the first client to load the key value from the second client according to the key name.

3. The method according to claim 1, characterized in that The step of resending the cache update notification to the first client to perform a local cache update on the first client includes: The cache update notification is resent to all first clients under the temporary node, so as to re-update the local cache of all first clients.

4. The method according to claim 2, characterized in that: After receiving at least one first client feedback message, the method further includes: storing the message in a feedback record corresponding to the key name; and The feedback record is stored in the second client.

5. A cache data updating device, characterized in that: include: A request receiving module, configured to, in response to a registration monitoring request of a first client to a node, establish a temporary node under the node to store the IP address of the first client; wherein one node corresponds to multiple temporary nodes, one client corresponds to one temporary node, and if the first client that creates the temporary node crashes or closes the connection, the temporary node is automatically deleted; a message feedback module, configured to receive a cache update notification transmitted by a second client, transmit the cache update notification to the first client via the IP address, and then receive at least one message fed back by the first client; wherein the message indicates that the cache update notification has been received; A notification compensation module is used to resend the cache update notification to the first client if the number of first clients in the feedback message is less than the number of temporary nodes, so as to update the local cache of the first client, including: determining the IP address of a third client that has not received the cache update notification based on the IP address in the temporary node and the IP address in the feedback message; wherein the third client is a subset of the first client; and retransmitting the cache update notification to the third client via the IP address of the third client, so as to update the local cache of the third client.

6. The device according to claim 5, characterized in that The message feedback module is used to: receiving a cache data update notification from a second client, storing the key name of the cache data in the node, so as to generate a cache update notification based on the key name through the node; wherein the node represents a node where the cache data has changed; The cache update notification is transmitted to the first client via the IP address to trigger the first client to load the key value from the second client according to the key name.

7. The device according to claim 5, characterized in that The notification compensation module is used to resend the cache update notification to all first clients under the temporary node, so as to re-update the local cache of all first clients.

8. The device according to claim 6, characterized in that Also includes a message logging module for: storing the message in a feedback record corresponding to the key name; and The feedback record is stored in the second client.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.