Data processing method of distributed system and distributed system

CN118612296BActive Publication Date: 2026-09-15INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410687789.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2026-09-15
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

[0004]本申请实施方式的目的是提供一种分布式系统的数据处理方法以及分布式系统,以解决数据访问倾斜、负载不均衡,系统不稳定的问题

Benefits of technology

[0036]The data processing method for a distributed system provided in this specification includes a client and a server with a proxy layer and a cache layer. The proxy layer is located between the client and the cache layer. The proxy layer has a first cache, and the cache layer has a second cache. When executing the above method, the server receives the client's current data access request through the proxy layer. When it is determined that the current request data corresponding to the current data access request hits the first cache, the proxy layer retrieves the current request data from the first cache and returns the current request data to the client. The cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing the cached data whose hotspot value meets a preset hotspot threshold from the second cache. By setting up the first and second caches as described above, hot and cold data in a distributed system can be stored separately. Furthermore, by configuring the proxy layer, the hotspot values ​​of cached data corresponding to each data access request can be monitored. When the monitored hotspot values ​​meet a preset hotspot threshold, the corresponding data in the second cache can be stored in the first cache. Then, when the client and server interact, if the current data access request hits the first cache, the relevant requested data can be directly read from the first cache and returned to the client without further data interaction with the cache layer. This avoids data access skew and load imbalance caused by a large number of data access requests meeting the hotspot threshold impacting certain areas of the second cache, thus affecting system stability. This improves the reliability, stability, and read/write performance of the distributed system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612296B_ABST
    Figure CN118612296B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method of a distributed system and the distributed system, and relates to the technical field of distribution, wherein the distributed system comprises a client and a server provided with an agent layer and a cache layer, the agent layer is arranged between the client and the cache layer, the agent layer is provided with a first cache, and the cache layer is provided with a second cache; the method comprises the following steps: receiving a current data access request of the client by using the agent layer; when it is determined that current request data corresponding to the current data access request hits the first cache, acquiring the current request data from the first cache by using the agent layer, and returning the current request data to the client; wherein the cache data in the first cache is obtained based on the following steps: calculating hot spot values of the cache data in the second cache based on a plurality of received data access requests, and acquiring the cache data whose hot spot value satisfies a preset hot spot threshold from the second cache. Through the above method, the reliability, stability and read-write performance of the distributed system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed technology, and in particular to a data processing method for a distributed system and a distributed system. Background Technology

[0002] Distributed caching is an extension of the traditional caching concept. It's a large-scale cache pool system based on the collaboration of multiple nodes in a distributed system. Its cached data is stored across multiple nodes in the cluster, and the routing of cached data is determined by a hash algorithm. Generally, distributed caching systems handle the mapping relationship between data and nodes by using cached data keys to calculate slots (hash slots). Each shard node in the cluster shares a portion of the hash slot's data storage. However, this method can lead to uneven data distribution. Currently, the severity of this imbalance is generally reduced by increasing the number of shards. However, increasing the number of shards cannot completely solve the problem of uneven load distribution across shards. For example, in some special scenarios, unexpected surges in access volume may occur, such as in transaction scenarios where popular products or flash sales trigger a large number of duplicate data access transactions, which will drastically increase the access service pressure on the distributed cache cluster. Furthermore, duplicate data access will cause access skew in the distributed cache cluster, meaning that the access volume of some data shard nodes is much greater than that of other data shard nodes. At the same time, increasing the number of shards results in low resource utilization and cannot monitor hot data or provide real-time monitoring and alerting capabilities. A large number of requests for accessing hot key data can overwhelm some shard nodes in the distributed caching system, causing system instability and affecting application services.

[0003] There is currently no effective solution to the aforementioned problems of skewed data access, unbalanced load, and system instability. Summary of the Invention

[0004] The purpose of this application is to provide a data processing method and a distributed system for a distributed system, so as to solve the problems of data access skew, load imbalance and system instability.

[0005] To address the aforementioned technical problems, this specification provides a data processing method for a distributed system, applicable to a distributed system including a client and a server with a proxy layer and a cache layer, wherein the proxy layer is located between the client and the cache layer, the proxy layer has a first cache, and the cache layer has a second cache; the method includes:

[0006] The server-side proxy layer is used to receive the client's current data access request;

[0007] When it is determined that the current request data corresponding to the current data access request hits the first cache, the proxy layer is used to retrieve the current request data from the first cache and return the current request data to the client; wherein, the cached data in the first cache is obtained by the proxy layer calculating the hot spot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing the cached data whose hot spot value meets a preset hot spot threshold from the second cache.

[0008] In some embodiments of this specification, after receiving the client's current data access request using the server's proxy layer, the method further includes:

[0009] When it is determined that the current data access request corresponding to the current data access request does not hit the first cache, the current data access request is sent to the cache layer using the proxy layer;

[0010] The caching layer retrieves the current request data corresponding to the current data access request from the second cache based on the current data access request, and returns the current request data to the client through the proxy layer.

[0011] In some embodiments of this specification, the proxy layer includes multiple proxy nodes and a request access interface, each proxy node has a cache node, and the cached data of multiple cache nodes is consistent;

[0012] Accordingly, receiving the client's current data access request using the server-side proxy layer includes:

[0013] The current data access request is received using the request access interface, and the target proxy node is determined among the multiple proxy nodes based on the current data access request and the current status of the multiple proxy nodes.

[0014] The current data access request is sent to the target proxy node using the request access interface.

[0015] In some embodiments of this specification, the distributed system further includes a streaming computing module, and the method further includes:

[0016] When any one of the proxy nodes is detected to have received a data access request, the system generates an access event message queue for each proxy node based on the received data access request, and sends the access event message queue to the streaming computing module.

[0017] The streaming computing module is used to determine the access event information of multiple access events in the access event message queue of each proxy node, and based on the access event information, the access data corresponding to each access event is determined in the cache data of the second cache.

[0018] The streaming computing module uses access data corresponding to multiple access events to determine the number of accesses for each access data, and uses the number of accesses for each access data as the hotspot value of each access data.

[0019] The streaming computing module uses access data whose hotspot values ​​meet the hotspot threshold as hotspot data, generates a list of hotspot events based on the determined hotspot data, and returns the list of hotspot events to each proxy node.

[0020] Each proxy node retrieves hot data from the second cache based on the received list of hot events, and stores the retrieved hot data in the cache node corresponding to each proxy node.

[0021] In some embodiments of this specification, the data access request includes a data identifier of the requested data, and the access event information includes the data identifier;

[0022] Accordingly, the streaming computing module determines the number of accesses for each access data based on access data corresponding to multiple access events, and uses the number of accesses for each access data as the hotspot value for that access data, including:

[0023] The streaming computing module is used to count the number of hits for the same data identifier, and the number of hits for each data identifier is used as the hot spot value of the accessed data corresponding to each data identifier.

[0024] Accordingly, each proxy node retrieves hotspot data from the second cache based on the received list of hotspot events, including:

[0025] Each proxy node retrieves hot data from the second cache based on the data identifier of the hot data in the received hot event list.

[0026] In some embodiments of this specification, the above method further includes: for any one of the multiple proxy nodes, when it is determined that the cached data volume of the cache node corresponding to the proxy node meets the preset cache threshold, the proxy node is used to determine the access count of each cached data in the corresponding cache node, and the cached data with the fewest access counts in the cache node is invalidated.

[0027] In some embodiments of this specification, the above method further includes:

[0028] When the request access interface receives an update cache data operation, based on the update cache data operation and the current state of the multiple proxy nodes, the current proxy node is determined among the multiple proxy nodes, and the update cache data operation is sent to the current proxy node;

[0029] The current proxy node is used to process the update cache data operation, invalidating the cache data in the cache node corresponding to the update cache data operation, and generating hot spot failure events based on the update cache data operation.

[0030] The generated hotspot failure event is sent to multiple proxy nodes in the proxy layer using the current proxy node;

[0031] Each proxy node uses the hotspot failure event to invalidate the cached data in the cache node corresponding to the update cache data operation.

[0032] The second aspect of this specification provides a distributed system, including a client and a server having a proxy layer and a cache layer, wherein the proxy layer is located between the client and the cache layer, the proxy layer has a first cache, and the cache layer has a second cache;

[0033] The proxy layer is configured to: receive a current data access request from a client; when it is determined that the current request data corresponding to the current data access request hits the first cache, retrieve the current request data from the first cache and return the current request data to the client; wherein the cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing cached data whose hotspot value satisfies a preset hotspot threshold from the second cache.

[0034] A third aspect of this specification provides an electronic device, comprising: a memory and a processor, wherein the processor and the memory are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to implement the steps of the above method.

[0035] A fourth aspect of this specification provides a computer storage medium storing computer program instructions that, when executed by a processor, implement the steps of the above-described method.

[0036] The data processing method for a distributed system provided in this specification includes a client and a server with a proxy layer and a cache layer. The proxy layer is located between the client and the cache layer. The proxy layer has a first cache, and the cache layer has a second cache. When executing the above method, the server receives the client's current data access request through the proxy layer. When it is determined that the current request data corresponding to the current data access request hits the first cache, the proxy layer retrieves the current request data from the first cache and returns the current request data to the client. The cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing the cached data whose hotspot value meets a preset hotspot threshold from the second cache. By setting up the first and second caches as described above, hot and cold data in a distributed system can be stored separately. Furthermore, by configuring the proxy layer, the hotspot values ​​of cached data corresponding to each data access request can be monitored. When the monitored hotspot values ​​meet a preset hotspot threshold, the corresponding data in the second cache can be stored in the first cache. Then, when the client and server interact, if the current data access request hits the first cache, the relevant requested data can be directly read from the first cache and returned to the client without further data interaction with the cache layer. This avoids data access skew and load imbalance caused by a large number of data access requests meeting the hotspot threshold impacting certain areas of the second cache, thus affecting system stability. This improves the reliability, stability, and read / write performance of the distributed system. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0038] Figure 1 The diagram shown is a schematic of a distributed system provided in an embodiment of this application;

[0039] Figure 2 The diagram shown is another schematic diagram of the distributed system provided in the embodiments of this specification;

[0040] Figure 3 The diagram shown is a schematic representation of a data processing method for a distributed system provided in an embodiment of this specification.

[0041] Figure 4 The diagram shown is a schematic of the traffic acquisition process provided in an embodiment of this specification.

[0042] Figure 5 The diagram shown is a schematic of the hotspot discovery process provided in an embodiment of this specification.

[0043] Figure 6 The diagram shown is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0045] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, and necessary confidentiality measures have been taken. They do not violate public order and good morals, and corresponding operation entry points are provided for users to choose to agree to or reject the automated decision results. If the user chooses to reject, the process will proceed to the expert decision-making process.

[0046] As mentioned above, distributed systems are prone to problems such as data access skew, load imbalance, and system instability. To address these issues, this specification provides a data processing method for a distributed system. The distributed system includes a client and a server with a proxy layer and a cache layer. The proxy layer is located between the client and the cache layer. The proxy layer has a first cache, and the cache layer has a second cache. When executing the method, the server's proxy layer receives the client's current data access request. When it is determined that the current requested data corresponds to the first cache, the proxy layer retrieves the current requested data from the first cache and returns it to the client. The cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and then retrieving and storing cached data whose hotspot values ​​satisfy a preset hotspot threshold from the second cache.

[0047] The data processing method for a distributed system in the embodiments of this specification can achieve separate storage of hot and cold data in the distributed system by setting up a first cache and a second cache. Furthermore, by setting up a proxy layer, it can monitor the hotspot values ​​of cached data corresponding to each data access request when the distributed system processes data access requests. When the monitored hotspot values ​​meet a preset hotspot threshold, the corresponding data in the second cache can be stored in the first cache. Thus, when the client and server interact with data, when it is determined that the current data access request hits the first cache, the relevant current request data can be directly read from the first cache and returned to the client without further data interaction with the cache layer. This avoids the problem of data access skew and load imbalance caused by a large number of data access requests with hotspot values ​​meeting the hotspot threshold impacting a part of the second cache, thereby affecting system stability. This can improve the reliability, stability, and read / write performance of the distributed system.

[0048] It is understood that the methods described above in the embodiments of this specification can be applied to server clusters or distributed systems consisting of multiple physical servers.

[0049] Before describing the data processing method of the distributed system in the embodiments of this specification, the distributed system in the embodiments of this specification will first be described with reference to the accompanying drawings. Figure 1 A structural diagram of a distributed system according to an embodiment of this specification is shown, with reference to... Figure 1 As shown, the distributed system may include a client 10 and a server 20.

[0050] In network communication, a client can be understood as the party that actively initiates requests and receives service responses. Typically, a client refers to a software program running on a certain type of operating system that communicates with the server to obtain the required information or services.

[0051] The server 20 may include a proxy layer 201 and a cache layer 202. The proxy layer 201 is located between the client 10 and the cache layer 202. The proxy layer 201 has a first cache, and the cache layer 202 has a second cache. The proxy layer 201 can be used to: receive the current data access request from the client 10; when it is determined that the current request data corresponding to the current data access request hits the first cache, retrieve the current request data from the first cache and return the current request data to the client 10; wherein, the cached data in the first cache is obtained by the proxy layer 201 calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing the cached data whose hotspot value meets a preset hotspot threshold from the second cache.

[0052] It is understandable that the data access request sent by the client can reach the cache layer 202 through the proxy layer 20, and the data returned by the cache layer 202 to the client 10 can be implemented through the proxy layer 201. That is, the proxy layer 201 uniformly receives the data access request of the client 10 and can provide a unified entry point for the client 10. Through the configuration of the proxy layer 201, the separation between the client 10 and the cache layer 202 can be achieved. Furthermore, the proxy layer 201 can monitor the cached data (hereinafter referred to as hot data) in the second cache whose hot values ​​meet the preset hot threshold, and copy the hot data from the second cache to the first cache. The proxy layer 201 can monitor and process the data access request corresponding to the hot data, and can directly obtain the data requested by the data access request of the corresponding hot data from the first cache without interacting with the second cache, which can realize the enhancement and expansion of the server-side functions.

[0053] In this embodiment, the proxy layer 201 enables monitoring of data access requests, collection and detection of hot data, and improvement of the caching level for hot data. Specifically, hot data is copied from the second cache to the first cache, with the first cache having a higher access priority than the second cache. Client 10's data access requests can directly return results in the proxy layer 201 without entering the caching layer 202, reducing interaction time and improving access speed. Simultaneously, hot and cold data isolation in the distributed system effectively reduces the impact of hot data on the performance of the distributed caching system's caching layer 202, improving system performance.

[0054] In some embodiments of this specification, after receiving the current data access request from the client 10, the proxy layer 201 of the server 20 can also be used to: send the current data access request to the cache layer when it is determined that the current request data corresponding to the current data access request does not hit the first cache; furthermore, the cache layer 202 can be used to: obtain the current request data corresponding to the current data access request from the second cache based on the current data access request, and return the current request data to the client through the proxy layer.

[0055] It is understood that the current data access request does not hit the first cache, meaning the hot data value does not meet the preset hot data threshold, and therefore the current data access request is not hot data. Thus, the current data access request can be forwarded to the cache layer 202 through the proxy layer 201. The cache layer 202 can retrieve the current data from the second cache and return it to the proxy layer 201. The proxy layer 201 can then return the current data to the client 10. Therefore, in this embodiment, the proxy layer can monitor hot data based on data access requests and retrieve hot data from the second cache and store it in the first cache. Non-hot data (i.e., cold data) can be stored in the second cache. When the client 10 accesses hot data, it can directly retrieve it from the first cache of the proxy layer 201. When the client 10 accesses cold data, it can retrieve it from the second cache of the cache layer 202 through the proxy layer 201. By setting up a first-level cache (first cache) and a second-level cache (second cache), the data requested by the data access request can be accurately accessed without affecting the system's business performance.

[0056] In some embodiments of this specification, the second cache of the cache layer 202 can be a distributed cache, that is, the second cache is set as a cache pool system in which multiple nodes cooperate, and the cache data is distributed across multiple nodes of the cluster (e.g., Figure 2 On the Node (in the system), the route of cached data can be determined based on a hash algorithm.

[0057] Figure 2 A structural diagram of the distributed system in the embodiments of this specification is shown, with reference to... Figure 2 In some embodiments of this specification, the proxy layer 201 may include multiple proxy nodes (i.e., Figure 2 The proxy node and the request access interface are defined in the system. Each proxy node can have a cache node (i.e., Figure 2 (In the cache nodes), the cached data of multiple cache nodes is consistent, and each cache node can act as a local cache for the corresponding proxy node.

[0058] The request access interface of server 20 can be used to: receive requests from clients (i.e., ... Figure 2 The system receives the current data access request from the client in the middle, and determines the target proxy node among the multiple proxy nodes based on the current data access request and the current status of the multiple proxy nodes; and sends the current data access request to the target proxy node.

[0059] It is understandable that after analyzing the cached data requested by multiple data access data received by all proxy nodes, the hot data in the second cache can be identified, and the route corresponding to each cached data can be determined by a hash algorithm, that is, the Node node storing the cached data can be determined. The hot data can be obtained from the Node node and copied to the cache node corresponding to each proxy node. Each proxy node may have different copying rates and synchronization speeds depending on its own resource performance, such as the different resource performance of the proxy node and / or cache node. However, the hot data to be copied is the same, and the cached data of each cache node will eventually be consistent.

[0060] It is understandable that when receiving the current request data, the request access interface can comprehensively determine the current status of each proxy node based on the current resource status of each proxy node, such as the number of requests that each proxy node can currently process, the remaining resources of the proxy node, and the processing performance of the proxy node, so as to select the proxy node in the best state or the one that meets the preset state from among multiple proxy nodes as the target node to process the current data access request.

[0061] In some embodiments of this specification, the access proxy layer proxy nodes can be deployed as a service cluster (e.g., a query-proxy cluster) based on containerized orchestration deployment technology. Each proxy node in the access proxy layer collects and monitors real-time access traffic, and combined with cloud load balancing services, enables the proxy layer to dynamically scale up and down, thereby responding to dynamically changing load demands and optimizing network traffic.

[0062] In other embodiments, the request access interface may be used only to receive data access requests from clients. The proxy layer may set up a master node to allocate data access requests, determine their corresponding target proxy nodes, and forward the data access requests to the target proxy nodes. This specification does not limit this.

[0063] In some embodiments of this specification, the distributed system may further include a streaming computing module; correspondingly, any one of the proxy nodes in the proxy layer 201 may be used to: when a data access request is detected, generate an access event message queue corresponding to the current proxy node based on the received data access request, and send the access event message queue to the streaming computing module.

[0064] The streaming computing module can be used to: determine the access event information of multiple access events in the access event message queue of each proxy node, and determine the access data corresponding to each access event in the cached data of the second cache based on the access event information; determine the access count corresponding to each access data based on the access data corresponding to multiple access events, and use the access count of each access data as the hotspot value of each access data; use the access data whose hotspot value meets the hotspot threshold as hotspot data, generate a hotspot event list based on the determined hotspot data, and return the hotspot event list to each proxy node.

[0065] Each proxy node can also be used to: retrieve hot data from the second cache based on the received list of hot events, and store the retrieved hot data in the cache node corresponding to each proxy node.

[0066] It's understandable that hotspot event monitoring can be triggered through proxy nodes, and hotspot data mining can be achieved through the streaming computing module. The streaming computing module can reside in the proxy layer as part of the proxy layer, or it can be a system module independently set up in the distributed system. For example, it can adopt a similar approach to client 10, as a software program running on the operating system, and obtain access event message queues by communicating with the proxy layer.

[0067] It is understandable that the streaming computing module can allocate a message queue to each proxy node. When processing or forwarding data access requests, each proxy node can trigger an event listener, sending an event to read cached data from the second cache to this message queue, i.e., the access event message queue. The events in this queue can be arranged according to the order of data access requests received by the proxy nodes. Then, the streaming computing module sequentially reads the access events in the message queues corresponding to each proxy node, analyzes the access event information, determines the data in the second cache accessed by each access event, and obtains the hotspot value corresponding to each data based on the access frequency of the data in the second cache. After determining the hotspot value corresponding to each data, data that meets the preset hotspot threshold can be directly filtered as hotspot data; alternatively, the data in the second cache can be sorted based on the hotspot value, and it can be determined whether the hotspot values ​​of the top n data meet the preset hotspot threshold to determine whether the top n data are hotspot data. Then, a corresponding hotspot event list can be generated based on the determined hotspot data and returned to each proxy node, so that each proxy node can copy the hotspot data from the second cache to its corresponding cache node based on the hotspot event list.

[0068] In some embodiments of this specification, the data access request may include a data identifier of the requested data, and the access event information may include the data identifier.

[0069] Accordingly, when the streaming computing module determines the number of accesses corresponding to each access data based on the access data corresponding to multiple access events, and uses the number of accesses of each access data as the hotspot value of each access data, it can be used specifically to: count the number of hits of the same data identifier, and use the number of hits of each data identifier as the hotspot value of the access data corresponding to each data identifier.

[0070] Accordingly, when each proxy node retrieves hot data from the second cache based on the received list of hot events, it can specifically retrieve hot data from the second cache based on the data identifier of the hot data in the received list of hot events.

[0071] It is understandable that the data access request sent by client 10 may include the data identifier of the requested data. Then, based on the number of hits of different data identifiers, the hot spot value corresponding to each data identifier can be determined without determining the exact content of the data requested by each data access request. The hot spot value of the data in the second cache can be quickly and accurately determined through the data identifier, reducing the amount of data processing and improving the data processing speed.

[0072] Specifically, when each proxy node retrieves hot data from the second cache based on the data identifier of the hot data in the received hot event list, it can determine the cached data route of each hot data in the second cache based on the data identifier of each hot data and the hash algorithm.

[0073] In some embodiments of this specification, for any one of a plurality of proxy nodes, when it is determined that the cached data amount of the cache node corresponding to the proxy node meets a preset cache threshold, the proxy node determines the access count of each cached data in the corresponding cache node and invalidates the cached data with the fewest access counts in the cache node.

[0074] In some embodiments of this specification, the request access interface can be used to: upon receiving an update cache data operation, determine the current proxy node among the plurality of proxy nodes based on the update cache data operation and the current state of the plurality of proxy nodes, and send the update cache data operation to the current proxy node.

[0075] Accordingly, the current proxy node can be used to: process the update cache data operation, invalidate the cache data in the cache node corresponding to the update cache data operation, and generate a hotspot failure event based on the update cache data operation; send the generated hotspot failure event to multiple proxy nodes in the proxy layer; other proxy nodes in the proxy layer 201 can be used to: invalidate the cache data in the cache node corresponding to the update cache data operation based on the hotspot failure event.

[0076] As can be understood, the above-mentioned preset cache threshold and cache data update operations can trigger hotspot invalidation of cached data in the cache nodes corresponding to the proxy nodes. That is, the cached data with the fewest accesses and / or the cached data corresponding to update operations in the cache node can be considered hotspot invalidation data, changing from hot data back to cold data and needing to be evicted from the cache node. Hotspot invalidation events can be generated based on the hotspot data that is about to be evicted. Each proxy node can consume hotspot invalidation events and invalidate the hotspot data in its cache nodes, ensuring that the data cached in the proxy node's cache nodes eventually becomes consistent.

[0077] Based on the aforementioned distributed system, embodiments of this specification also provide a data processing method applied to the aforementioned distributed system. Although this specification provides method operation steps or apparatus structures as shown in the following embodiments or figures, the method or apparatus may include more or fewer operation steps or module units, either combined or without inventive effort, based on conventional methods or without inventive effort. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the apparatus is not limited to the execution order or module structure shown in the embodiments or figures of this specification. When the method or module structure is applied in actual devices, servers, or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or figures (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed processing or server cluster implementation environment). Figure 3 The diagram shown is a schematic representation of a data processing method for a distributed system provided in an embodiment of this application. This method can be applied to... Figure 1 The distributed system includes a client 10 and a server 20 equipped with a proxy layer 201 and a cache layer 202. The proxy layer 202 is located between the client 10 and the cache layer 202. The proxy layer 201 has a first cache, and the cache layer 202 has a second cache. Figure 3 As shown, the method includes:

[0078] S301: Utilize the server's proxy layer to receive the client's current data access request.

[0079] S302: When it is determined that the current request data corresponding to the current data access request hits the first cache, the proxy layer is used to obtain the current request data from the first cache and the current request data is returned to the client.

[0080] The cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and storing the cached data whose hotspot value meets the preset hotspot threshold from the second cache.

[0081] In network communication, a client can be understood as the party that actively initiates requests and receives service responses. Typically, a client refers to a software program running on a certain type of operating system that communicates with the server to obtain the required information or services.

[0082] In some embodiments of this specification, after receiving the client's current data access request using the server's proxy layer, the following may also be included:

[0083] When it is determined that the current data access request corresponding to the current data access request does not hit the first cache, the current data access request is sent to the cache layer using the proxy layer;

[0084] The caching layer retrieves the current request data corresponding to the current data access request from the second cache based on the current data access request, and returns the current request data to the client through the proxy layer.

[0085] In some embodiments of this specification, the second cache of the cache layer 202 can be a distributed cache, that is, the second cache is set as a cache pool system in which multiple nodes cooperate, and the cache data is distributed across multiple nodes of the cluster (e.g., Figure 2 On the Node (in the system), the route of cached data can be determined based on a hash algorithm.

[0086] In some embodiments of this specification, the proxy layer may include multiple proxy nodes and request access interfaces, each proxy node may have a cache node, and the cached data of multiple cache nodes is consistent.

[0087] Accordingly, receiving current data access requests from clients using the server-side proxy layer can include:

[0088] The current data access request is received using the request access interface, and the target proxy node is determined among the multiple proxy nodes based on the current data access request and the current status of the multiple proxy nodes.

[0089] The current data access request is sent to the target proxy node using the request access interface.

[0090] It is understandable that when receiving the current request data, the request access interface can comprehensively determine the current status of each proxy node based on the current resource status of each proxy node, such as the number of requests that each proxy node can currently process, the remaining resources of the proxy node, and the processing performance of the proxy node, so as to select the proxy node in the best state or the one that meets the preset state from among multiple proxy nodes as the target node to process the current data access request.

[0091] In some embodiments of this specification, the access proxy layer proxy nodes can be deployed as a service cluster (e.g., a query-proxy cluster) based on containerized orchestration deployment technology. Each proxy node in the access proxy layer collects and monitors real-time access traffic, and combined with cloud load balancing services, enables the proxy layer to dynamically scale up and down, thereby responding to dynamically changing load demands and optimizing network traffic.

[0092] In other embodiments, the request access interface may be used only to receive data access requests from clients. The proxy layer may set up a master node to allocate data access requests, determine their corresponding target proxy nodes, and forward the data access requests to the target proxy nodes. This specification does not limit this.

[0093] In some embodiments of this specification, the distributed system may further include a streaming computing module, and the method may further include:

[0094] When any one of the proxy nodes is detected to have received a data access request, the system generates an access event message queue for each proxy node based on the received data access request, and sends the access event message queue to the streaming computing module.

[0095] The streaming computing module is used to determine the access event information of multiple access events in the access event message queue of each proxy node, and based on the access event information, the access data corresponding to each access event is determined in the cache data of the second cache.

[0096] The streaming computing module uses access data corresponding to multiple access events to determine the number of accesses for each access data, and uses the number of accesses for each access data as the hotspot value of each access data.

[0097] The streaming computing module uses access data whose hotspot values ​​meet the hotspot threshold as hotspot data, generates a list of hotspot events based on the determined hotspot data, and returns the list of hotspot events to each proxy node.

[0098] Each proxy node retrieves hot data from the second cache based on the received list of hot events, and stores the retrieved hot data in the cache node corresponding to each proxy node.

[0099] It's understandable that hotspot event monitoring can be triggered through proxy nodes, and hotspot data mining can be achieved through the streaming computing module. The streaming computing module can reside in the proxy layer as part of the proxy layer, or it can be a system module independently set up in the distributed system. For example, it can adopt a similar approach to client 10, as a software program running on the operating system, and obtain access event message queues by communicating with the proxy layer.

[0100] It is understandable that the streaming computing module can allocate a message queue to each proxy node. When processing or forwarding data access requests, each proxy node can trigger an event listener, sending an event to read cached data from the second cache to this message queue, i.e., the access event message queue. The events in this queue can be arranged according to the order of data access requests received by the proxy nodes. Then, the streaming computing module sequentially reads the access events in the message queues corresponding to each proxy node, analyzes the access event information, determines the data in the second cache accessed by each access event, and obtains the hotspot value corresponding to each data based on the access frequency of the data in the second cache. After determining the hotspot value corresponding to each data, data that meets the preset hotspot threshold can be directly filtered as hotspot data; alternatively, the data in the second cache can be sorted based on the hotspot value, and it can be determined whether the hotspot values ​​of the top n data meet the preset hotspot threshold to determine whether the top n data are hotspot data. Then, a corresponding hotspot event list can be generated based on the determined hotspot data and returned to each proxy node, so that each proxy node can copy the hotspot data from the second cache to its corresponding cache node based on the hotspot event list.

[0101] In some embodiments of this specification, the data access request may include a data identifier of the requested data, and the access event information may include the data identifier.

[0102] Accordingly, the streaming computing module determines the number of accesses corresponding to each access data based on the access data corresponding to multiple access events, and uses the number of accesses for each access data as the hotspot value of each access data. This can include: using the streaming computing module to count the number of hits for the same data identifier, and using the number of hits for each data identifier as the hotspot value of the access data corresponding to each data identifier.

[0103] Accordingly, retrieving hot data from the second cache using each proxy node based on the received list of hot events may include: retrieving hot data from the second cache using each proxy node based on the data identifier of the hot data in the received list of hot events.

[0104] Specifically, when each proxy node retrieves hot data from the second cache based on the data identifier of the hot data in the received hot event list, it can determine the cached data route of each hot data in the second cache based on the data identifier of each hot data and the hash algorithm.

[0105] In some embodiments of this specification, the above method may further include: for any one of a plurality of proxy nodes, when it is determined that the cached data volume of the cache node corresponding to the proxy node meets a preset cache threshold, the proxy node is used to determine the access count of each cached data in the corresponding cache node, and the cached data with the fewest access counts in the cache node is invalidated.

[0106] In some embodiments of this specification, the above method may further include: when the request access interface receives an update cache data operation, determining a current proxy node among the multiple proxy nodes based on the update cache data operation and the current state of the multiple proxy nodes, and sending the update cache data operation to the current proxy node; processing the update cache data operation using the current proxy node, invalidating the cache data corresponding to the update cache data operation in the cache node corresponding to the current proxy node, and generating a hotspot invalidation event based on the update cache data operation; sending the generated hotspot invalidation event to the multiple proxy nodes of the proxy layer using the current proxy node; and invalidating the cache data corresponding to the update cache data operation in the cache node corresponding to each proxy node based on the hotspot invalidation event.

[0107] As can be understood, the above-mentioned preset cache threshold and cache data update operations can trigger hotspot invalidation of cached data in the cache nodes corresponding to the proxy nodes. That is, the cached data with the fewest accesses and / or the cached data corresponding to update operations in the cache node can be considered hotspot invalidation data, changing from hot data back to cold data and needing to be evicted from the cache node. Hotspot invalidation events can be generated based on the hotspot data that is about to be evicted. Each proxy node can consume hotspot invalidation events and invalidate the hotspot data in its cache nodes, ensuring that the data cached in the proxy node's cache nodes eventually becomes consistent.

[0108] The descriptions and specific implementation methods of each process step mentioned above can be found in the section on distributed systems, and will not be repeated here.

[0109] As can be seen from the above embodiments, the process of handling hot data in the proxy layer of a distributed system can include traffic collection, hotspot discovery, and hotspot failure. The following, with reference to the accompanying drawings and using the SDK-Client-API interface as an example, will further describe the processes of traffic collection, hotspot discovery, and hotspot failure between the proxy node and the streaming computing module during the aforementioned hot data processing.

[0110] Figure 4 This specification illustrates a flow acquisition process as described in an embodiment. (Reference) Figure 4 As shown, the traffic collection phase may specifically include the following processes:

[0111] S1: The client in the business application layer calls the SDK-Client-API interface to access requests. For example, the client can obtain cached data by "get key".

[0112] S2: Request traffic passes through a unified access point: the query-proxy cluster in the proxy layer. Using a load balancing algorithm, it is routed to a proxy node within the proxy layer. When a proxy node processes or forwards a request, an event listener is triggered, sending an event to the message queue to read cached data. (See reference...) Figure 3 As shown, the message queue can include multiple events issued by the corresponding proxy node. These events can be arranged in order and consumed and read by the streaming computing module in sequence.

[0113] In some embodiments of this specification, events in the message queue can be accessed via an event message protocol in JSON format, as shown below:

[0114] {"source":"192.168.1.1",

[0115] "target":"192.168.10.1",

[0116] "timestamp":"2024-05-10 14:53:39",

[0117] "key":"test_key",

[0118] "type":"get"}

[0119] Here, source can represent the IP address of the client that initiated the access, target can represent the IP address of the proxy node to which the proxy layer is routed, timestamp can represent the timestamp of the access event, key can represent the key value of the cached data accessed by the access request, and type can represent the type of API accessed.

[0120] S3: The streaming computing module can allocate a message queue to each proxy node. Each access request event from the client will be sequentially read and consumed by the streaming computing module in the message queue. Then, the streaming computing module will aggregate all request events, that is, each cached data with the same key value (which can be a data identifier used to represent cached data) is hit several times, thereby performing real-time statistical analysis and processing to generate a real-time heatmap of cache access frequency, so as to achieve the purpose of monitoring traffic.

[0121] In the embodiments described in this specification, when the proxy layer receives a client access request, it can listen to the request behavior and trigger an event, which is then sent to the streaming computing system for hotspot data mining.

[0122] Figure 5 A hotspot discovery process from an embodiment of this specification is illustrated. (See reference...) Figure 5 As shown, the hotspot discovery phase may specifically include the following process:

[0123] S1: The streaming computing module performs real-time top key statistics on the access frequency of cached data. The top key can be the cached data with the top n hottest values, one or more cached data with the largest hottest values, or cached data with the second or third highest key values.

[0124] S2: Determine whether the top key is hot key data based on the hotspot threshold configuration (e.g., 3000 qps).

[0125] S3: Periodically sends hot key data list event messages to the queue system according to a preset period. The preset period can be, for example, 3-10 seconds, and can be configured based on actual needs.

[0126] In some embodiments of this specification, the hotspot key data list event message can be sent in JSON format using the hotspot event message protocol. The hotspot event message can be as follows:

[0127] {"timestamp":"2024-05-10 16:33:32",

[0128] "keys":["test_key1",

[0129] "test_key2"]}

[0130] Among them, timestamp can represent the timestamp of the hot event, and keys can represent the list of hot key values.

[0131] S4: In the proxy layer, the proxy nodes of the query-proxy cluster consume message queue events, identify and replicate hot data.

[0132] Specifically, query-proxy cluster nodes can query the distributed cache (second cache) based on the list of hot key data, and copy the hot key data to each proxy node in the proxy layer as cache data in the local cache of the node itself (cache node in the first cache). Each proxy node may have different data copying rates and synchronization progress depending on its own resource performance, but the list of hot key data is the same, which can achieve eventual consistency of the local cache of each proxy node in the cluster.

[0133] In this embodiment, the proxy node can receive hot data top key events, triggering a hot data synchronization process to synchronize hot data in the second cache to the first cache, thus achieving periodic updates of hot data. Furthermore, the proxy layer can uniformly receive data access requests from clients. When the requested data key value matches the first-level cache, the proxy layer can process it and directly return the requested data (i.e., the hot key data) from the first-level cache. This data processing method offers fast response times for data access requests, high system performance, and avoids server overload caused by a large number of hot key data accesses, thereby enhancing system stability.

[0134] In some embodiments of this specification, during the hotspot failure phase, the local cache of the proxy nodes in the proxy layer query-proxy cluster uses the Least Recently Used (LRU) cache eviction algorithm to evict hotspot data.

[0135] Specifically, when the total space occupied by hot key data in the first-level cache reaches a certain threshold (e.g., 90%), the least accessed data will be evicted. When a proxy layer query-proxy cluster node receives a client call to the SDK-Client-API interface from the business application layer, such as updating cache data via "del set", the hot data can be invalidated in the first-level cache of the current proxy node that received the operation. Simultaneously, an event listener is triggered, sending a cache invalidation event to the message queue. The hot data invalidation event message protocol can use JSON format, and the hot data invalidation event message can be represented as follows:

[0136] {"timestamp":"2024-05-10 18:35:22",

[0137] "key":"test_key1"}

[0138] Here, timestamp can represent the timestamp of the hotspot failure event, and key can represent the key value of the failed hotspot.

[0139] Furthermore, all proxy nodes in the query-proxy cluster of the proxy layer can consume message queue events and uniformly invalidate the first-level cache of hot key data to achieve eventual consistency of local cached data on proxy nodes in the proxy layer.

[0140] In this embodiment, a proxy layer is introduced into the existing distributed caching system. This proxy layer can add a local cache (Level 1 cache) specifically for hot key data in the distributed system. The original distributed caching cluster's caching layer serves as a caching layer for non-hot key data (i.e., cold cache data) (Level 2 cache). Therefore, access requests for hot key data will hit the Level 1 cache in the proxy layer, thus obtaining processing and returning the data, without needing to directly access the cold cache data on some shard nodes of the distributed caching cluster. This avoids uneven access between shard nodes, and the design of Level 1 and Level 2 caches achieves the goal of separating hot and cold data storage. Furthermore, the proxy layer added between the business application layer (client) and the caching layer (distributed caching cluster) provides a unified entry point for application layer caching services. The proxy layer can also implement services such as hot key data monitoring and collection, hot key data caching, and dynamic management of hot key data, serving as the Level 1 cache of the distributed system. The client does not directly interact with the distributed cache cluster. Instead, the proxy layer handles the cache access service for business data. When cached data becomes hot key data due to a large number of repeated accesses reaching a preset traffic threshold, it will be directly stored in the first-level cache of the proxy layer and returned to the client in real time, without entering the second-level cache storage layer. Access requests for other cold data caches will be handled by any proxy node on the load balancing routing link in the proxy layer and forwarded to the first-level cache. That is, the proxy layer is a virtual access request client for the storage layer and also a virtual cache data storage layer for the business application layer.

[0141] By implementing the above method to separate hot and cold data storage, we can avoid the impact of access requests for hot key data on the performance of data sharding nodes in the cache layer, significantly reducing the service pressure of the distributed system. At the same time, since hot key data is separated from the cache layer and does not participate in data sharding, the reliability, stability and read / write performance of the cache layer will be greatly improved.

[0142] This specification also provides an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 601 and a memory 602, wherein the processor 601 and the memory 602 may be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.

[0143] Processor 601 may be a central processing unit (CPU). Processor 601 may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.

[0144] The memory 602, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the data processing method of the distributed system in the embodiments of the present invention. The processor 601 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory 602, thereby implementing the data processing method of the distributed system in the above method embodiments.

[0145] The memory 602 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor 601, etc. Furthermore, the memory 602 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 602 may optionally include memory remotely located relative to the processor 601, and these remote memories may be connected to the processor 601 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0146] The one or more modules are stored in the memory 602, and when executed by the processor 601, they perform actions such as... Figure 3 The data processing method of the distributed system in the illustrated embodiment.

[0147] The specific details of the aforementioned electronic device can be understood by referring to the relevant descriptions and effects in the above method embodiments, and will not be repeated here.

[0148] This specification also provides a computer storage medium storing computer program instructions, which, when executed, implement the steps of the data processing method of the distributed system described above.

[0149] This specification also provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the data processing method for the distributed system described above.

[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0151] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. The focus of each embodiment is to describe the differences from other embodiments.

[0152] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions.

[0153] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0154] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute certain parts of the methods of various embodiments of this application.

[0155] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0156] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0157] Although this application has been described through embodiments, those skilled in the art will know that this application has many modifications and variations without departing from the spirit of this application, and it is intended that the appended claims cover such modifications and variations without departing from the spirit of this application.

Claims

1. A data processing method of a distributed system, characterized by, The method is applied to a distributed system, which includes a client and a server with a proxy layer and a caching layer, wherein the proxy layer is located between the client and the caching layer, the proxy layer has a first cache, and the caching layer has a second cache; the method includes: The server-side proxy layer is used to receive the client's current data access request; When it is determined that the current request data corresponding to the current data access request hits the first cache, the proxy layer retrieves the current request data from the first cache and returns the current request data to the client; wherein, the cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing the cached data whose hotspot value meets a preset hotspot threshold from the second cache; the proxy layer includes multiple proxy nodes and request access interfaces, each proxy node has one cache node, and the cached data of multiple cache nodes is consistent; The proxy layer also includes a streaming computing module, and the method further includes: When any one of the proxy nodes is detected to have received a data access request, the system generates an access event message queue for each proxy node based on the received data access request, and sends the access event message queue to the streaming computing module. The streaming computing module is used to determine the access event information of multiple access events in the access event message queue of each proxy node, and based on the access event information, the access data corresponding to each access event is determined in the cached data of the second cache; the data access request includes the data identifier of the requested data, and the access event information includes the data identifier; The streaming computing module is used to count the number of hits for the same data identifier, and the number of hits for each data identifier is used as the hot spot value of the accessed data corresponding to each data identifier. The streaming computing module uses access data whose hotspot values ​​meet the hotspot threshold as hotspot data, generates a list of hotspot events based on the determined hotspot data, and returns the list of hotspot events to each proxy node. Using the data identifier of hot data in the received hot event list, each proxy node retrieves hot data from the second cache and stores the retrieved hot data in the cache node corresponding to each proxy node. The method further includes: for any one of the multiple proxy nodes, when it is determined that the cached data volume of the cache node corresponding to the proxy node meets the preset cache threshold, the number of accesses of each cached data in the corresponding cache node is determined by the proxy node, and the cached data with the fewest accesses in the cache node is invalidated. When the request access interface receives an update cache data operation, based on the update cache data operation and the current state of the multiple proxy nodes, the current proxy node is determined among the multiple proxy nodes, and the update cache data operation is sent to the current proxy node; The current proxy node is used to process the update cache data operation, invalidating the cache data in the cache node corresponding to the update cache data operation, and generating hot spot failure events based on the update cache data operation. The generated hotspot failure event is sent to multiple proxy nodes in the proxy layer using the current proxy node; Each proxy node uses the hotspot failure event to invalidate the cached data in the cache node corresponding to the update cache data operation.

2. The method according to claim 1, characterized in that, After receiving the client's current data access request using the server-side proxy layer, it also includes: When it is determined that the current data access request corresponding to the current data access request does not hit the first cache, the current data access request is sent to the cache layer using the proxy layer; The caching layer retrieves the current request data corresponding to the current data access request from the second cache based on the current data access request, and returns the current request data to the client through the proxy layer.

3. The method according to claim 1, characterized in that, Receiving current data access requests from clients using the server-side proxy layer includes: The current data access request is received using the request access interface, and the target proxy node is determined among the multiple proxy nodes based on the current data access request and the current status of the multiple proxy nodes. The current data access request is sent to the target proxy node using the request access interface.

4. A distributed system, characterized in that, It includes a client and a server with a proxy layer and a cache layer, wherein the proxy layer is located between the client and the cache layer, the proxy layer has a first cache, and the cache layer has a second cache; The proxy layer is configured to: receive a current data access request from a client; when it is determined that the current request data corresponding to the current data access request hits the first cache, retrieve the current request data from the first cache and return the current request data to the client; wherein the cached data in the first cache is obtained by the proxy layer calculating the hotspot value of the cached data in the second cache based on multiple received data access requests, and retrieving and storing cached data whose hotspot value satisfies a preset hotspot threshold from the second cache; The proxy layer includes multiple proxy nodes and request access interfaces. Each proxy node has a cache node, and the cached data of multiple cache nodes is consistent. The proxy layer also includes a streaming computing module. Each proxy node is used to generate an access event message queue corresponding to each proxy node based on the received data access request when it is detected that any proxy node has received a data access request, and send the access event message queue to the streaming computing module. The streaming computing module is used to determine the access event information of multiple access events in the access event message queue of each proxy node, and to determine the access data corresponding to each access event in the cached data of the second cache based on the access event information; the data access request includes the data identifier of the requested data, and the access event information includes the data identifier; the number of hits of the same data identifier is counted, and the number of hits of each data identifier is used as the hot spot value of the access data corresponding to each data identifier; the access data whose hot spot value meets the hot spot threshold is used as hot spot data, a hot spot event list is generated based on the determined hot spot data, and the hot spot event list is returned to each proxy node; Each proxy node is also used to: retrieve hot data from the second cache based on the data identifier of the hot data in the received hot event list, and store the retrieved hot data in the cache node corresponding to each proxy node; For any one of the multiple proxy nodes, when it is determined that the cached data volume of the cache node corresponding to the proxy node meets the preset cache threshold, the proxy node determines the access count of each cached data in the corresponding cache node, and invalidates the cached data with the fewest access counts in the cache node; the request access interface is used to: when receiving an update cache data operation, determine the current proxy node among the multiple proxy nodes based on the update cache data operation and the current state of the multiple proxy nodes, and send the update cache data operation to the current proxy node; The current proxy node is used to: process the update cache data operation, invalidate the cache data in the cache node corresponding to the update cache data operation, and generate a hotspot failure event based on the update cache data operation; and send the generated hotspot failure event to multiple proxy nodes in the proxy layer. Other proxy nodes in the proxy layer are used to invalidate the cached data in the cache nodes corresponding to the update cached data operation based on the hotspot failure event.

5. An electronic device, characterized in that, include: A memory and a processor, the processor and the memory being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to implement the steps of the method according to any one of claims 1 to 3.

6. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Data request processing method and device, computer equipment and storage medium

    CN112076464A