[go: up one dir, main page]

CN113760975A - Local cache processing method, apparatus, device, and computer-readable storage medium - Google Patents

Local cache processing method, apparatus, device, and computer-readable storage medium Download PDF

Info

Publication number
CN113760975A
CN113760975A CN202010994346.3A CN202010994346A CN113760975A CN 113760975 A CN113760975 A CN 113760975A CN 202010994346 A CN202010994346 A CN 202010994346A CN 113760975 A CN113760975 A CN 113760975A
Authority
CN
China
Prior art keywords
client
local cache
data
cluster
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010994346.3A
Other languages
Chinese (zh)
Inventor
石朝阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010994346.3A priority Critical patent/CN113760975A/en
Publication of CN113760975A publication Critical patent/CN113760975A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

本公开提供一种本地缓存处理方法、装置、设备及计算机可读存储介质,方法包括:与集群中的每一客户机建立通信连接;获取所述集群中任一客户机发送的数据同步请求,所述数据同步请求中包括待同步缓存以及发起所述数据同步请求的目标客户机的标识信息;根据所述数据同步请求中的待同步缓存,对本地缓存中的数据进行更新操作,使得更新后的本地缓存中的数据与所述目标客户机的本地缓存中的数据保持一致。从而能够保证更新后的本地缓存中的数据与所述目标客户机的本地缓存中的数据保持一致,有效地避免了个客户机内本地缓存数据不同步的问题,容灾能力较强。

Figure 202010994346

The present disclosure provides a local cache processing method, apparatus, device and computer-readable storage medium, the method includes: establishing a communication connection with each client in a cluster; acquiring a data synchronization request sent by any client in the cluster, The data synchronization request includes the cache to be synchronized and the identification information of the target client that initiated the data synchronization request; according to the cache to be synchronized in the data synchronization request, an update operation is performed on the data in the local cache, so that after the update, the data in the local cache is updated. The data in the local cache of the target client is consistent with the data in the local cache of the target client. Therefore, it can be ensured that the data in the updated local cache is consistent with the data in the local cache of the target client, effectively avoiding the problem that the local cache data in each client is out of synchronization, and the disaster recovery capability is strong.

Figure 202010994346

Description

Local cache processing method, device and equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of computers, and in particular, to a local cache processing method, device, and apparatus, and a computer-readable storage medium.
Background
Local caching refers to dividing the physical memory local to the client into a part of space for buffering data written back by the client to the server. The technology writes the data written back by the client into the local write-back cache instead of the hard disk of the server, and writes the data written back to the server when the cache space reaches a certain threshold. After the local write-back cache function is provided, the read-write pressure of the server and the network load can be greatly reduced.
In practical application, more local caches are used as various local caches derived based on Map, such as HashMap, convurrenthashmap and the like; a guava-based LoadingCache; springing based cafeine. The local cache can prevent request penetration; protecting the core resources; the access speed is accelerated.
However, in the use process of the local cache, any client in the cluster cannot perform information interaction with other clients, and therefore, the problems of data asynchrony between the clients and poor disaster tolerance are often caused.
Disclosure of Invention
The present disclosure provides a local cache processing method, device, and apparatus, and a computer-readable storage medium, which are used to solve the technical problems that an existing local cache processing method is likely to cause data asynchronism between clients and has poor disaster tolerance capability.
A first aspect of the present disclosure provides a local cache processing method, including:
establishing a communication connection with each client in the cluster;
acquiring a data synchronization request sent by any client in the cluster, wherein the data synchronization request comprises a cache to be synchronized and identification information of a target client initiating the data synchronization request;
and updating the data in the local cache according to the cache to be synchronized in the data synchronization request, so that the updated data in the local cache is consistent with the data in the local cache of the target client.
A second aspect of the present disclosure provides a local cache processing apparatus, including:
the connection module is used for establishing communication connection with each client in the cluster;
a synchronization request obtaining module, configured to obtain a data synchronization request sent by any client in the cluster, where the data synchronization request includes a cache to be synchronized and identification information of a target client that initiates the data synchronization request;
and the synchronization module is used for updating the data in the local cache according to the cache to be synchronized in the data synchronization request, so that the updated data in the local cache is consistent with the data in the local cache of the target client.
A third aspect of the present disclosure is to provide a local cache processing apparatus, including: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to call program instructions in the memory to perform the local cache processing method according to the first aspect.
A third aspect of the present disclosure is to provide a computer-readable storage medium having stored therein computer-executable instructions for implementing the local cache processing method according to the first aspect when the computer-executable instructions are executed by a processor.
According to the local cache processing, the device, the equipment and the computer readable storage medium provided by the disclosure, the communication connection is established with each client in the cluster, the data synchronization request sent by each client is obtained, and the data synchronization operation is performed according to the data synchronization request, so that the data in the updated local cache can be kept consistent with the data in the local cache of the target client, the problem of unsynchronized local cache data in each client is effectively avoided, and the disaster tolerance capability is strong.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of a network architecture upon which the present disclosure is based;
fig. 2 is a schematic flowchart of a local cache processing method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a local cache connection provided in an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of a local cache processing method according to a second embodiment of the present disclosure;
fig. 5 is a schematic flowchart of a local cache processing method according to a third embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a local cache processing apparatus according to a fourth embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a local cache processing device according to a fifth embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments obtained based on the embodiments in the disclosure belong to the protection scope of the disclosure.
In view of the above-mentioned technical problems that the existing local cache processing method is likely to cause data asynchronism between clients and has poor disaster tolerance capability, the present disclosure provides a local cache processing method, an apparatus, a device, and a computer-readable storage medium.
It should be noted that the present disclosure provides local caching processes, apparatuses, devices and computer readable storage media that can be utilized in various local caching processing scenarios.
In practical applications, the cache data in each client in the cluster is basically inconsistent due to request load balancing, which is very disadvantageous for some specific scenarios. For example, after a user cache is deleted in a client, the user information cannot be synchronized to all local caches in the cluster, and sometimes the user information cannot be completely cleaned from the local caches until the expiration time is reached. In addition, the local caches in the two clients in the cluster cannot be used for mutual operation because the local caches cannot sense the existence of the other client.
In the process of solving the technical problem, the inventors found through research that, in order to achieve synchronization of the cache between the clients in the cluster, a connection relationship between the clients in the cluster can be established. After the connection is established, when any client involves data change, a data synchronization request can be sent, so that other clients perform data synchronization operation according to the data synchronization request, and the data in the updated local cache can be guaranteed to be consistent with the data in the local cache of the target client.
The noun explains:
local caching: a caching component that can run on a client.
P2P communication: point-to-point communication, a communication method for removing servers, a node holding a communication list can access a remote node through an address in the list.
Netty: network communication assembly realized based on Java.
Mina: a network communication component.
Hashmap: hash table, a hash structure that can store data. Generally acting as a local cache, non-thread-safe.
guava cache: the local caching component of guava.
Cache penetration: the cache has no data, and the data is required to be sent to the database and then written back to the cache.
Buffering avalanche: a large number of requests penetrate directly through the cache to the database, causing the database to crash. Thereby triggering a process in which the entire cluster gradually crashes.
Fig. 1 is a schematic diagram of a network architecture based on the present disclosure, and as shown in fig. 1, the network architecture based on the present disclosure at least includes: the system comprises a server 1 and a plurality of clients 2, wherein a local cache processing device is arranged in the server, and the local cache processing device can be written by adopting languages such as C/C + +, Java, Shell or Python.
Fig. 2 is a schematic flow chart of a local cache processing method according to an embodiment of the present disclosure, and as shown in fig. 2, the method includes:
step 101, establishing a communication connection with each client in the cluster.
The execution subject of this embodiment is a local cache processing device, and the local cache processing device may be coupled to a server.
In order to achieve the synchronization of the data in the local cache of each client in the cluster, when any local cache performs data update, the data update operation may be performed according to the content synchronization of the local cache update. Therefore, a communication connection needs to be established with each client in the cluster first, so that the sending and receiving of the data synchronization request can be realized subsequently.
In particular, a communication connection may be established with each client in the cluster via a point-to-point communication technique. Each local cache in the cluster stores the connection addresses of other local caches, so that sensing and data transmission can be conveniently carried out. The communication capacity of the local cache is given by utilizing the bottom-layer netty component, and strong cluster sensing and control functions can be realized through the communication capacity and a proper communication protocol.
Step 102, obtaining a data synchronization request sent by any client in the cluster, where the data synchronization request includes a cache to be synchronized and identification information of a target client that initiated the data synchronization request.
In this embodiment, after establishing a communication connection with each client in the cluster, information interaction with each client may be performed. Specifically, when any client has a data update, in order to ensure that the data in other local caches is kept synchronized, a data synchronization request may be sent, where the data synchronization request may include identification information of a target client that currently has the data update and a cache to be synchronized corresponding to the client. Accordingly, the local cache processing device may obtain the data synchronization request sent by the target client.
And 103, updating the data in the local cache according to the cache to be synchronized in the data synchronization request, so that the updated data in the local cache is consistent with the data in the local cache of the target client.
In this embodiment, after the data synchronization request is acquired, the data in the local cache may be updated according to the cache to be synchronized in the data synchronization request.
Specifically, the data update of the target client may be data writing, accordingly, the cache to be synchronized may be content that needs to be written into the local cache, and after the data synchronization request is obtained, the content that needs to be cached in synchronization may be written into the local cache. The data update of the target client may be a data deletion operation, the content in the cache to be synchronized may be identification information of the cache to be deleted, and after the data synchronization request is obtained, the identification information of the cache to be deleted may perform a deletion operation on the cache to be deleted.
Accordingly, after the data in the local cache is updated according to the data synchronization request, the updated data in the local cache is consistent with the data in the local cache of the target client. So that the synchronicity of the data in the local caches of the clients can be guaranteed in any case.
Fig. 3 is a schematic diagram of connection of local caches provided in the embodiment of the present disclosure, and as shown in fig. 3, each local cache is in communication connection with other local caches in a cluster, so that information interaction can be achieved.
In the local cache processing method provided in this embodiment, a communication connection is established with each client in the cluster, a data synchronization request sent by each client is obtained, and data synchronization operation is performed according to the data synchronization request, so that it is ensured that data in the updated local cache is consistent with data in the local cache of the target client, the problem of local cache data in each client being asynchronous is effectively avoided, and the disaster tolerance capability is strong.
Fig. 4 is a schematic flow chart of a local cache processing method according to a second embodiment of the present disclosure, and on the basis of the first embodiment, as shown in fig. 4, after step 101, the method further includes:
step 201, obtaining status update information sent by any client in the cluster, where the status update information includes identification information of the client sending the status update information and a target status of the client sending the status update information.
Step 202, updating the state of the client sending the state updating information in a cache list pre-stored in a local cache to the target state according to the state updating information.
In this embodiment, since the operating status of each client in the cluster may be different, for example, an individual client may go offline due to some emergency. Therefore, a cache list including the connection address and the operation state of each local cache in the cluster may be stored in the local cache in advance.
In order to accurately determine the operating state of each client, monitoring operation can be performed in real time to obtain state update information sent by any client in the cluster, wherein the state update information includes identification information of the client sending the state update information and a target state of the client sending the state update information. The target status may specifically include an online status and an offline status.
After the state update information is acquired, the state of the client sending the state update information in the pre-stored cache list may be updated to the target state according to the state information.
For example, in practical applications, the local cache processing device may listen to the status update information sent by the clients in the cluster in real time. Specifically, the status update information may be an online information, and the online information may be a custom online protocol of 0x01 ip. If the local cache processing device receives the online information, the state of the client sending the state updating information in the cache list can be updated to be the online state. The status update information may be offline information, and the online information may specifically be 0x02 ip offline protocol. When receiving the offline message, the other clients set the client sending the status update information in the respective cache list to be in the offline status. Subsequent synchronized data operations will not be sent to the client that is offline.
According to the local cache processing method provided by the embodiment, the state updating information sent by each client is monitored, and the state of the client in the pre-stored cache list is updated according to the state updating instruction, so that the running state of each client can be accurately determined, data synchronization operation can be performed according to the running state, and the accuracy of data synchronization is improved.
Further, on the basis of any of the above embodiments, after the step 101, the method further includes:
and acquiring heartbeat packets sent by each client according to a preset first time interval, and updating the machine heartbeat activity detection counts of the clients sending the heartbeat packets in a pre-stored cache list according to the heartbeat packets.
In this embodiment, each client in the cluster may send a heartbeat packet to the cluster according to a preset first time interval to prove that the client is in a alive state. Wherein the first time interval may be one minute. Correspondingly, the local cache processing device can monitor whether a client sends a heartbeat packet in real time, and update the machine heartbeat activity detection count of the client sending the heartbeat packet in the pre-stored cache list according to the heartbeat packet.
Further, on the basis of any of the above embodiments, the method further includes:
and for each client in the cluster, if the heartbeat packet of the client is not received within a preset second time interval, updating the state of the client which does not send the heartbeat packet in a cache list prestored in a local cache to be an offline state.
In this embodiment, for each client in the cluster, if the heartbeat packet is not sent to the cluster beyond a preset second time interval, the client may be determined to process a dropped state, where the preset second time interval may be five minutes. Therefore, for each client in the cluster, if the local cache processing device does not receive the heartbeat packet of the client beyond the preset second time interval, the state of the client which does not send the heartbeat packet in the cache list pre-stored in the local cache is updated to be an offline state. Correspondingly, if the state of the client is judged to be the offline state, the client will not be sent to the offline client when a subsequent client performs data updating.
Different from the existing local cache processing method, when the local cache is hung for various reasons, a user is required to capture the exception, and then the cache is reestablished to perform data flash. For low concurrency applications, this data flush may cause cache breakthrough without much impact, but for high concurrency applications, this cache breakthrough will place great pressure on the underlying services, even causing cache avalanches. According to the local cache processing method provided by the embodiment, the state of each client is updated according to the time interval of sending the heartbeat packet by each client, so that the state of each client can be automatically and accurately determined, the disaster tolerance capability of the local cache is improved, and cache avalanche is avoided.
According to the local cache processing method provided by the embodiment, the heartbeat packets sent by each client are monitored, and the state of each client is updated according to the time interval of the heartbeat packets sent by each client, so that the state of each client can be accurately determined, and data synchronization operation can be performed according to the state, so that the accuracy of data synchronization is improved.
Fig. 5 is a schematic flow chart of a local cache processing method according to a third embodiment of the present disclosure, and on the basis of any one of the foregoing embodiments, as shown in fig. 5, after step 101, the method further includes:
step 301, obtaining a pause interaction request sent by any client in the cluster, where the pause interaction request includes identification information of the client sending the pause interaction request.
And step 302, stopping information interaction with the client sending the interaction suspending request according to the interaction suspending request.
In this embodiment, when the network traffic of the whole cluster is larger than a preset threshold and is not rich in bandwidth, the client may send a request for suspending interaction. The pause of network interaction does not affect the function of the local cache, and the local cache can still be normally used, only if no network is operated. And after the network flow is reduced, the network can be opened again.
Accordingly, the local cache processing device may listen to a pause interaction request sent by any client in the cluster, where the pause interaction request includes identification information of the client sending the pause interaction request. And further, according to the interaction suspending request, stopping information interaction with the client sending the interaction suspending request.
According to the local cache processing method provided by the embodiment, when the overall network flow of the cluster is larger than the preset threshold value and is larger than a preset threshold value and the bandwidth is not abundant, the information interaction with the client sending the interaction suspending request is stopped according to the interaction suspending request, so that the bandwidth pressure caused by the information interaction can be avoided, and the use efficiency of the local cache is improved.
Fig. 6 is a schematic structural diagram of a local cache processing apparatus according to a fourth embodiment of the present disclosure, and as shown in fig. 6, the apparatus includes: a connection module 41, a synchronization request obtaining module 42 and a synchronization module 43, wherein the connection module 41 is configured to establish a communication connection with each client in the cluster. A synchronization request obtaining module 42, configured to obtain a data synchronization request sent by any client in the cluster, where the data synchronization request includes a cache to be synchronized and identification information of a target client that initiates the data synchronization request. And a synchronization module 43, configured to perform an update operation on the data in the local cache according to the cache to be synchronized in the data synchronization request, so that the updated data in the local cache is consistent with the data in the local cache of the target client.
Specifically, on the basis of the fourth embodiment, the connection module is configured to:
a communication connection is established with each client in the cluster via a point-to-point communication technique.
The local cache processing apparatus provided in this embodiment establishes a communication connection with each client in the cluster, obtains a data synchronization request sent by each client, and performs data synchronization operation according to the data synchronization request, so as to ensure that data in the updated local cache is consistent with data in the local cache of the target client, thereby effectively avoiding the problem of local cache data in each client being asynchronous, and having a strong disaster tolerance capability.
Further, on the basis of the fourth embodiment, the apparatus further includes: the system comprises an update information acquisition module and an update module, wherein the update information acquisition module is used for acquiring state update information sent by any client in the cluster, and the state update information comprises identification information of the client sending the state update information and a target state of the client sending the state update information. And the updating module is used for updating the state of the client which sends the state updating information in a cache list pre-stored in a local cache into the target state according to the state updating information.
Further, on the basis of the fourth embodiment, the target status includes an online status and a offline status.
Further, on the basis of any one of the above embodiments, the apparatus further includes: and a heartbeat packet acquisition module. The heartbeat packet acquisition module is used for acquiring heartbeat packets sent by the clients according to a preset first time interval, and updating the machine heartbeat sounding counts of the clients sending the heartbeat packets in a pre-stored cache list according to the heartbeat packets.
Further, on the basis of any of the above embodiments, the method further includes: and the state updating module is used for updating the state of the client which does not send the heartbeat packet in the cache list prestored in the local cache to an offline state if the heartbeat packet of the client is not received in the cache list exceeding a preset second time interval for each client in the cluster.
Further, on the basis of any one of the above embodiments, the apparatus further includes: the system comprises an acquisition module and a control module, wherein the acquisition module is used for acquiring a pause interaction request sent by any client in the cluster, and the pause interaction request comprises identification information of the client sending the pause interaction request. And the control module is used for stopping information interaction with the client sending the pause interaction request according to the pause interaction request.
Further, on the basis of any of the above embodiments, the suspend interaction request is sent by the client when detecting that the current network traffic is greater than a preset threshold.
Fig. 7 is a schematic structural diagram of a local cache processing device according to a fifth embodiment of the present disclosure, and as shown in fig. 7, the device includes: a processing component 502, a memory 504, a power component 506, and a communication component 508.
The processing component 502 generally controls overall operation of the device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 502 may include one or more processors 510 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 505 and the processing component 502.
The memory 504 is configured to store various types of data to support operation at the device 500. Examples of such data include instructions for any application or method operating on device 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 504 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 506 provides power to the various components of the device 500. The power components 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 500.
The communication component 508 is configured to facilitate wired or wireless communication between the device 500 and other devices. The device 500 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 508 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 508 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 520 of the device 500 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer-readable storage medium, in which instructions, when executed by a processor of a terminal device, enable the terminal device to perform the above-described local cache processing method of the terminal device.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present disclosure, and not for limiting the same; while the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (18)

1. A local cache processing method, comprising:
establishing a communication connection with each client in the cluster;
acquiring a data synchronization request sent by any client in the cluster, wherein the data synchronization request comprises a cache to be synchronized and identification information of a target client initiating the data synchronization request;
and updating the data in the local cache according to the cache to be synchronized in the data synchronization request, so that the updated data in the local cache is consistent with the data in the local cache of the target client.
2. The method of claim 1, wherein establishing a communication connection with each client in the cluster comprises:
a communication connection is established with each client in the cluster via a point-to-point communication technique.
3. The method of claim 1 or 2, wherein after establishing the communication connection with each client in the cluster, further comprising:
acquiring state updating information sent by any client in the cluster, wherein the state updating information comprises identification information of the client sending the state updating information and a target state of the client sending the state updating information;
and updating the state of the client sending the state updating information in a cache list pre-stored in a local cache to the target state according to the state updating information.
4. The method of claim 3, wherein the target states include an online state and an offline state.
5. The method of claim 1 or 2, wherein after establishing the communication connection with each client in the cluster, further comprising:
and acquiring heartbeat packets sent by each client according to a preset first time interval, and updating the machine heartbeat activity detection counts of the clients sending the heartbeat packets in a pre-stored cache list according to the heartbeat packets.
6. The method of claim 5, further comprising:
and for each client in the cluster, if the heartbeat packet of the client is not received within a preset second time interval, updating the state of the client which does not send the heartbeat packet in a cache list prestored in a local cache to be an offline state.
7. The method of claim 1 or 2, wherein after establishing the communication connection with each client in the cluster, further comprising:
obtaining a pause interaction request sent by any client in the cluster, wherein the pause interaction request comprises identification information of the client sending the pause interaction request;
and stopping information interaction with the client sending the interaction suspending request according to the interaction suspending request.
8. The method of claim 7, wherein the request to suspend interaction is sent by the client upon detecting current network traffic greater than a predetermined threshold.
9. A local cache processing apparatus, comprising:
the connection module is used for establishing communication connection with each client in the cluster;
a synchronization request obtaining module, configured to obtain a data synchronization request sent by any client in the cluster, where the data synchronization request includes a cache to be synchronized and identification information of a target client that initiates the data synchronization request;
and the synchronization module is used for updating the data in the local cache according to the cache to be synchronized in the data synchronization request, so that the updated data in the local cache is consistent with the data in the local cache of the target client.
10. The apparatus of claim 9, wherein the connection module is configured to:
a communication connection is established with each client in the cluster via a point-to-point communication technique.
11. The apparatus of claim 9 or 10, further comprising:
an update information obtaining module, configured to obtain status update information sent by any client in the cluster, where the status update information includes identification information of the client that sends the status update information and a target status of the client that sends the status update information;
and the updating module is used for updating the state of the client which sends the state updating information in a cache list pre-stored in a local cache into the target state according to the state updating information.
12. The apparatus of claim 11, wherein the target status comprises an online status and an offline status.
13. The apparatus of claim 9 or 10, further comprising:
and the heartbeat packet acquisition module is used for acquiring heartbeat packets sent by the clients according to a preset first time interval and updating the machine heartbeat activity detection counts of the clients sending the heartbeat packets in a pre-stored cache list according to the heartbeat packets.
14. The apparatus of claim 13, further comprising:
and the state updating module is used for updating the state of the client which does not send the heartbeat packet in the cache list prestored in the local cache to an offline state if the heartbeat packet of the client is not received in the second time interval.
15. The apparatus of claim 9 or 10, further comprising:
an obtaining module, configured to obtain a pause interaction request sent by any client in the cluster, where the pause interaction request includes identification information of the client that sends the pause interaction request;
and the control module is used for stopping information interaction with the client sending the pause interaction request according to the pause interaction request.
16. The apparatus of claim 15, wherein the request to suspend interaction is sent by the client upon detecting that current network traffic is greater than a preset threshold.
17. A local cache processing device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to invoke program instructions in the memory to perform the local cache processing method of any of claims 1-8.
18. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, perform the local cache processing method of any one of claims 1-8.
CN202010994346.3A 2020-09-21 2020-09-21 Local cache processing method, apparatus, device, and computer-readable storage medium Pending CN113760975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010994346.3A CN113760975A (en) 2020-09-21 2020-09-21 Local cache processing method, apparatus, device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010994346.3A CN113760975A (en) 2020-09-21 2020-09-21 Local cache processing method, apparatus, device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN113760975A true CN113760975A (en) 2021-12-07

Family

ID=78785842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010994346.3A Pending CN113760975A (en) 2020-09-21 2020-09-21 Local cache processing method, apparatus, device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN113760975A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117014375A (en) * 2023-10-07 2023-11-07 联通在线信息科技有限公司 CDN device self-adaptive flow control and quick online and offline method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6311206B1 (en) * 1999-01-13 2001-10-30 International Business Machines Corporation Method and apparatus for providing awareness-triggered push
CN1852105A (en) * 2005-09-15 2006-10-25 华为技术有限公司 Method and system for realizing end-to-end data sharing
CN101631140A (en) * 2009-08-03 2010-01-20 中兴通讯股份有限公司 Cluster server of instant communication system and method of inter-clusters communication
CN101789963A (en) * 2010-01-05 2010-07-28 深圳中兴网信科技有限公司 Data synchronization system
WO2015070565A1 (en) * 2013-11-12 2015-05-21 中兴通讯股份有限公司 Method and system for notifying friend group permissions, client, and server
CN107360239A (en) * 2017-07-25 2017-11-17 郑州云海信息技术有限公司 A kind of client connection status detection method and system
CN107948318A (en) * 2017-12-27 2018-04-20 世纪龙信息网络有限责任公司 Cache synchronization method and system between multinode
CN109561137A (en) * 2018-11-14 2019-04-02 广州虎牙信息科技有限公司 Establish method, apparatus, terminal device and the medium of P2P network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6311206B1 (en) * 1999-01-13 2001-10-30 International Business Machines Corporation Method and apparatus for providing awareness-triggered push
CN1852105A (en) * 2005-09-15 2006-10-25 华为技术有限公司 Method and system for realizing end-to-end data sharing
CN101631140A (en) * 2009-08-03 2010-01-20 中兴通讯股份有限公司 Cluster server of instant communication system and method of inter-clusters communication
CN101789963A (en) * 2010-01-05 2010-07-28 深圳中兴网信科技有限公司 Data synchronization system
WO2015070565A1 (en) * 2013-11-12 2015-05-21 中兴通讯股份有限公司 Method and system for notifying friend group permissions, client, and server
CN107360239A (en) * 2017-07-25 2017-11-17 郑州云海信息技术有限公司 A kind of client connection status detection method and system
CN107948318A (en) * 2017-12-27 2018-04-20 世纪龙信息网络有限责任公司 Cache synchronization method and system between multinode
CN109561137A (en) * 2018-11-14 2019-04-02 广州虎牙信息科技有限公司 Establish method, apparatus, terminal device and the medium of P2P network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117014375A (en) * 2023-10-07 2023-11-07 联通在线信息科技有限公司 CDN device self-adaptive flow control and quick online and offline method and device
CN117014375B (en) * 2023-10-07 2024-02-09 联通在线信息科技有限公司 CDN device self-adaptive flow control and quick online and offline method and device

Similar Documents

Publication Publication Date Title
US10871985B2 (en) Displaying media files between changes in states of an application client
WO2021121370A1 (en) Message loss detection method and apparatus for message queue
CA2931762C (en) Method for providing a connection of a client to an unmanaged service in a client-server remote access system
CN106980625B (en) Data synchronization method, device and system
WO2017092351A1 (en) Cache data update method and device
TW201709698A (en) Verifying source addresses associated with a terminal
WO2015010645A1 (en) Method and apparatus for message transmission
US20170201476A1 (en) Information exchange methods and devices
EP3846419A2 (en) File resource processing method and apparatus, device and medium
CN107797859B (en) Scheduling method of timing task and scheduling server
WO2019019457A1 (en) Control center device, business system processing method and system, and storage medium
WO2019033935A1 (en) Interface message displaying and processing method and apparatus, and electronic device
CN113760842B (en) Data processing method, device, electronic device and storage medium
CN113127732A (en) Method and device for acquiring service data, computer equipment and storage medium
CN113760975A (en) Local cache processing method, apparatus, device, and computer-readable storage medium
CN112769876B (en) Method, device, equipment and medium for acquiring equipment channel information
WO2017054734A1 (en) Locking file management method and device
CN108632130B (en) Method and device for multi-terminal chat input transfer, electronic equipment and storage medium
WO2019120259A1 (en) Media data storage method, storage device, and electronic device
CN110691401B (en) System application management method and device
CN110321199B (en) Method and device for notifying common data change, electronic equipment and medium
US9860149B2 (en) Continuous monitoring of data servers using a shadowing proxy
CN108667682B (en) Connection synchronization method, device and medium based on secure gateway deep packet detection
CN106411542A (en) Method and device of realizing device search
CN110968557B (en) Data processing method and device in distributed file system and electronic equipment

Legal Events

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