Data processing method of distributed system and distributed system
By introducing the proxy layer and the two-level cache structure into the distributed system, the data access skew and load imbalance problems of the distributed cache system in high-traffic scenarios are solved, and the stability and performance of the system are improved.
Patent Information
- Application Number
- CN202410687789.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-30
AI Technical Summary
Distributed cache systems are prone to data access skew and load imbalance in high-access scenarios, leading to system instability. Existing expansion sharding solutions cannot fully solve these problems.
Introduce a proxy layer and a two-level cache structure into the distributed system. The proxy layer receives client requests, calculates hotspot data and stores it in the second cache. When the preset threshold is met, it is copied to the first cache to avoid direct impact of hotspot data. The cache layer realizes separate storage and load balancing of hot and cold data.
Monitor and process hot data through the proxy layer to avoid data access skew and load imbalance, improve system reliability and stability, and improve read and write performance.
Smart Images

Figure CN118612296A
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] Distributed cache is an extension of the traditional cache concept. It is a large cache pool system based on the cooperation of multiple nodes in a distributed system. Its cache data storage is distributed on multiple nodes in the cluster, and the cache data routing is determined by the hash algorithm. Generally, the distributed cache system processes the mapping relationship between data and nodes based on the cache data key value Slot (hash slot) as data shard partition. Each shard node in the cluster shares part of the data storage of the hash slot, but this method may have the problem of uneven data distribution. At present, the severity of imbalance is generally reduced by expanding the number of shards. However, the expansion of the sharding solution cannot completely solve the problem of uneven load on each shard. For example, in some special demand scenarios, there will be an unexpected surge in access volume, such as a large number of repeated data access transactions caused by popular products and flash sales in transaction scenarios, which will sharply increase the access service pressure on the distributed cache cluster; and repeated data access will cause access skew in the distributed cache cluster, that is, the access volume of some data shard nodes is much greater than that of other data shard nodes. At the same time, the expansion of the sharding solution has low resource utilization, and it is impossible to monitor hot data and realize real-time monitoring and alarm capabilities. A large number of hot key data access requests will impact some shard nodes in the distributed cache system, causing system instability and further affecting application services.
[0003] Currently, no effective solution has been proposed for the above-mentioned problems of data access skew, load imbalance, and system instability. Summary of the invention
[0004] The purpose of the implementation mode of the present application is to provide a data processing method and a distributed system for a distributed system to solve the problems of data access skew, load imbalance, and system instability.
[0005] In order to solve the above technical problems, the first aspect of the present specification provides a data processing method for a distributed system, which is applied to a distributed system, wherein the distributed system includes a client and a server having a proxy layer and a cache layer, wherein the proxy layer is arranged between the client and the cache layer, the proxy layer is provided with a first cache, and the cache layer is provided with a second cache; the method includes:
[0006] Use the proxy layer on the server side 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 obtain the current request data from the first cache, and the current request data is returned to the client; wherein, the cache data in the first cache is obtained by the proxy layer calculating the hotspot value of the cache data in the second cache based on the multiple data access requests received, and obtaining the cache data whose hotspot value meets the preset hotspot threshold from the second cache for storage.
[0008] In some embodiments of the present specification, after receiving the current data access request of the client by the proxy layer of the server, the method further includes:
[0009] When it is determined that the current request data corresponding to the current data access request does not hit the first cache, using the proxy layer to send the current data access request to the cache layer;
[0010] The cache layer is used to obtain current request data corresponding to the current data access request from the second cache based on the current data access request, and the current request data is returned 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 is provided with a cache node, and the cache data of the multiple cache nodes are consistent;
[0012] Accordingly, using the proxy layer of the server to receive the client's current data access request includes:
[0013] Receiving the current data access request using the request access interface, and determining a target proxy node among the multiple proxy nodes based on the current data access request and the current states 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, each proxy node is used to generate an access event message queue corresponding to each proxy node based on the received data access request, and the access event message queue is sent to the stream computing module;
[0017] Determine access event information of multiple access events in the access event message queue of each proxy node received by the streaming computing module, and determine access data corresponding to each access event in the cache data of the second cache based on each access event information;
[0018] Determine the number of accesses corresponding to each access data based on the access data corresponding to the multiple access events by using the stream computing module, and use the number of accesses corresponding to each access data as the hotspot value of each access data;
[0019] Using the streaming computing module, the access data whose hotspot value meets the hotspot threshold is taken as hotspot data, a hotspot event list is generated based on the determined hotspot data, and the hotspot event list is returned to each proxy node;
[0020] Each proxy node is used to obtain hotspot data from the second cache based on the received hotspot event list, and the obtained hotspot data is stored 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] Correspondingly, the streaming computing module is used to determine the number of accesses corresponding to each access data based on the access data corresponding to the multiple access events, and the number of accesses corresponding to each access data is used as the hotspot value of each access data, including:
[0023] Utilize the stream computing module 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;
[0024] Correspondingly, using each proxy node to obtain hotspot data from the second cache based on the received hotspot event list includes:
[0025] The hotspot data is obtained from the second cache using the data identifier of the hotspot data in the received hotspot event list by each proxy node.
[0026] In some embodiments of the present specification, the above method also includes: for any one of the multiple proxy nodes, when it is determined that the amount of cache data of the cache node corresponding to the proxy node meets a preset cache threshold, the proxy node is used to determine the number of accesses to each cache data in the corresponding cache node, and the cache data with the least number of accesses in the cache node is invalidated.
[0027] In some embodiments of the present 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 current states of the multiple proxy nodes, a current proxy node is determined among the multiple proxy nodes, and the update cache data operation is sent to the current proxy node;
[0029] Using the current proxy node to process the cache data update operation, invalidating the cache data corresponding to the cache data update operation in the cache node corresponding to the current proxy node, and generating a hotspot invalidation event based on the cache data update operation;
[0030] Using the current proxy node to send the generated hotspot failure event to multiple proxy nodes in the proxy layer;
[0031] Each proxy node is used to perform invalidation processing on cache data corresponding to the cache data update operation in the cache node corresponding to each proxy node based on the hotspot invalidation event.
[0032] A second aspect of the present specification provides a distributed system, comprising a client and a server having a proxy layer and a cache layer, wherein the proxy layer is arranged between the client and the cache layer, the proxy layer is provided with a first cache, and the cache layer is provided with a second cache;
[0033] The proxy layer is used 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, obtain the current request data from the first cache and return the current request data to the client; the cache data in the first cache is obtained by the proxy layer calculating a hotspot value of the cache data in the second cache based on multiple data access requests received, and obtaining cache data from the second cache whose hotspot value meets a preset hotspot threshold for storage.
[0034] The third aspect of this specification provides an electronic device, comprising: a memory and a processor, the processor and the memory are communicatively connected to each other, the memory stores computer instructions, and the processor implements the steps of the above method by executing the computer instructions.
[0035] A fourth aspect of the present specification provides a computer storage medium, wherein the computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the steps of the above method are implemented.
[0036] The embodiment of the present specification provides a data processing method for a distributed system applied to a distributed system, wherein the distributed system includes a client and a server having a proxy layer and a cache layer, wherein the proxy layer is arranged between the client and the cache layer, wherein the proxy layer has a first cache, and wherein the cache layer has a second cache; when executing the above method, a current data access request of the client is received through the proxy layer of the server; 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; wherein the cache data in the first cache is obtained by calculating the hotspot value of the cache data in the second cache based on multiple data access requests received by the proxy layer, and obtaining the cache data whose hotspot value meets the preset hotspot threshold from the second cache for storage. Through the above-mentioned settings of the first cache and the second cache, the separate storage of hot and cold data in the distributed system can be achieved, and through the setting of the proxy layer, the hotspot value of the cache data corresponding to each data access request can be monitored when the distributed system processes data access requests, and the corresponding data in the second cache can be stored in the first cache when the monitored hotspot value meets the preset hotspot threshold. Then, when the client and the 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, thereby avoiding the problem of data access skew and load imbalance caused by a large number of data access requests that meet the hotspot threshold impacting some areas in the second cache, thereby affecting the stability of the system, and can improve the reliability, stability and read and write performance of the distributed system. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some implementation methods recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0038] Figure 1 Shown is a schematic diagram of a distributed system provided by an embodiment of the present application;
[0039] Figure 2 Another schematic diagram of a distributed system provided by an embodiment of this specification is shown;
[0040] Figure 3 The figure is a schematic diagram of a data processing method of a distributed system provided by an embodiment of this specification;
[0041] Figure 4 The figure shows a schematic diagram of the flow collection process provided by the embodiment of this specification;
[0042] Figure 5 The figure is a schematic diagram of a hotspot discovery process provided by an embodiment of this specification;
[0043] Figure 6 Shown is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order 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 in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work 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, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data shall comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0046] As mentioned above, the current distributed system is prone to data access skew, load imbalance, and system instability. In order to solve the above problems, the embodiment of this specification provides a data processing method for a distributed system, which is applied to a distributed system, wherein the distributed system includes a client and a server with a proxy layer and a cache layer, and the proxy layer is arranged between the client and the cache layer, the proxy layer is provided with a first cache, and the cache layer is provided with a second cache; when executing the above method, the client's current data access request is received through the proxy layer of the server; 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; wherein the cache data in the first cache is obtained by the proxy layer calculating the hotspot value of the cache data in the second cache based on the multiple data access requests received, and obtaining the cache data whose hotspot value meets the preset hotspot threshold from the second cache for storage.
[0047] The data processing method of the distributed system in the embodiments of the present specification can realize the separate storage of hot and cold data in the distributed system through the setting of the first cache and the second cache; and through the setting of the proxy layer, it can monitor the hotspot value of the cache data corresponding to each data access request when the distributed system processes the data access request, and can store the corresponding data in the second cache in the first cache when the monitored hotspot value meets the preset hotspot threshold. Then, when the client and the 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 the need to interact with the cache layer. This avoids the problem that a large number of data access requests with hotspot values meeting the hotspot threshold impact some areas in the second cache, causing data access skew and load imbalance, thereby affecting the stability of the system, and can improve the reliability, stability and read-write performance of the distributed system.
[0048] It can be understood that the above method provided in the embodiments of this specification can be applied to a server cluster or a distributed system composed of multiple physical servers.
[0049] Before introducing the data processing method of the distributed system in the embodiment of this specification, the distributed system in the embodiment of this specification is first introduced with reference to the accompanying drawings. Figure 1 A structural diagram of a distributed system in an embodiment of this specification is shown, referring to Figure 1 As shown, the distributed system may include a client 10 and a server 20 .
[0050] The client can be understood as the party that actively initiates requests and receives service responses in network communications. Usually, the client refers to a software program running on a certain type of operating system, which obtains the required information or services by communicating with the server.
[0051] The server 20 may include a proxy layer 201 and a cache layer 202. The proxy layer 201 is disposed between the client 10 and the cache layer 202, wherein the proxy layer 201 is provided with a first cache, and the cache layer 202 is provided with a second cache. The proxy layer 201 may be used to: receive a current data access request from the client 10; when determining that the current request data corresponding to the current data access request hits the first cache, obtain the current request data from the first cache, and return the current request data to the client 10; wherein the cache data in the first cache is obtained by the proxy layer 201 calculating the hotspot value of the cache data in the second cache based on the multiple data access requests received, and obtaining the cache data whose hotspot value meets the preset hotspot threshold from the second cache for storage.
[0052] It can be understood that the data access request issued 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 entrance for the client 10. Through the setting of the proxy layer 201, the separation of the client 10 and the cache layer 202 can be achieved; and the proxy layer 201 can monitor the cache data (hereinafter referred to as hot spot data) in the second cache whose hot spot value meets the preset hot spot threshold, and copy the hot spot 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 spot data, and can directly obtain the data requested by the data access request corresponding to the hot spot data from the first cache without interacting with the second cache, thereby realizing enhanced expansion of the server function.
[0053] In the embodiments of this specification, through the setting of the proxy layer 201, it is possible to monitor data access requests, collect and discover hot data, and improve the cache level of hot data, that is, to copy the hot data from the second cache to the first cache, and the access priority of the first cache is higher than that of the second cache. The data access request of the client 10 can directly return the result at the proxy layer 201 without entering the cache layer 202, which can reduce the time consumed in executing interactions and improve the access speed. At the same time, hot and cold data in the distributed system are isolated from each other, which can effectively reduce the performance impact of hot data on the cache layer 202 of the distributed cache system and improve system performance.
[0054] In some embodiments of the present specification, after the proxy layer 201 of the server 20 receives the current data access request of the client 10, it can also be used to: when it is determined that the current request data corresponding to the current data access request does not hit the first cache, send the current data access request to the cache layer; further, the cache layer 202 can be used to: based on the current data access request, obtain the current request data corresponding to the current data access request from the second cache, and return the current request data to the client through the proxy layer.
[0055] It can be understood that the current request data corresponding to the current data access request does not hit the first cache, that is, the hotspot value of the current request data does not meet the preset hotspot threshold, and the current request data is not hotspot data, so the current data access request can be forwarded to the cache layer 202 through the proxy layer 201, and the cache layer 202 can obtain the current request data from the second cache and return it to the proxy layer 201, and the proxy layer 201 can return the current request data to the client 10. It can be seen that in the embodiment of this specification, the proxy layer can monitor the hotspot data based on the data access request, and can obtain the hotspot data from the second cache and store it in the first cache, while non-hotspot data (i.e., cold data) can be stored in the second cache. When the client 10 accesses the hotspot data, it can be directly obtained from the first cache of the proxy layer 201, and when the client 10 accesses the cold data, it can be obtained from the second cache of the cache layer 202 through the proxy layer 201. Through the setting of the first-level cache (first cache) and the second-level cache (second cache), the data requested by the data access request can be accurately accessed without affecting the business performance of the system.
[0056] In some embodiments of the present specification, the second cache of the cache layer 202 may 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 stored in multiple nodes of the cluster (for example, Figure 2 On the Node node in the cache, the cache data route can be determined based on the hash algorithm.
[0057] Figure 2 The structure diagram of the distributed system in the embodiment of this specification is shown, and reference is made to Figure 2 In some embodiments of the present specification, the proxy layer 201 may include multiple proxy nodes (i.e. Figure 2 proxy node in the request access interface, each proxy node can have a cache node (i.e. Figure 2 The cache data of multiple cache nodes are consistent, and each cache node can serve as the local cache of the corresponding proxy node.
[0058] The request access interface of the server 20 can be used to: receive the client (ie Figure 2 The method comprises the steps of: receiving a current data access request of a client in the proxy node, and determining a 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 sending the current data access request to the target proxy node.
[0059] It can be understood that after analyzing the cache data requested by multiple data access data received by all proxy nodes, the hotspot data in the second cache can be determined, and the route corresponding to each cache data can be determined by the hash algorithm, that is, the Node node storing the cache data is determined, the hotspot data is obtained from the Node node, and the hotspot data can be copied to the cache node (cache node) corresponding to each proxy node (proxy node). Each proxy node has different resource performance, such as the resource performance of the proxy node and / or cache node. The rate of copying cache data may be different, and the synchronization speed may also be different, but the hotspot data to be copied is the same, and the cached data of each cache node is eventually consistent.
[0060] It can be understood 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 current number of processing requests of each proxy node, the current remaining resources of the proxy node, the processing performance of the proxy node, etc., so as to select a proxy node that is in the best state or meets the preset state 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 into 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 then combines with cloud load balancing services to achieve dynamic expansion and contraction capabilities of the proxy layer, 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 the client. The proxy layer may set up a master node to allocate data access requests, determine the corresponding target proxy node, and forward the data access requests to the target proxy node. This specification does not impose any restrictions on this.
[0063] In some embodiments of the present specification, the distributed system may further include a streaming computing module; accordingly, any one of the proxy nodes in the proxy layer 201 may be specifically used to: upon detecting receipt of a data access request, 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 received, and determine the access data corresponding to each access event in the cache data of the second cache based on the access event information; determine the number of accesses corresponding to each access data based on the access data corresponding to the multiple access events, and use the number of accesses 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 may also be used to: obtain hotspot data from the second cache based on the received hotspot event list, and store the obtained hotspot data in the cache node corresponding to each proxy node.
[0066] It can be understood that the monitoring of hot events can be triggered through the proxy node, and the mining of hot data can be realized through the streaming computing module. The streaming computing module can be located in the proxy layer as a part of the proxy layer, or it can be a system module independently set in the distributed system. For example, it can adopt a method similar to client 10 as a software program running on the operating system, and obtain access to the event message queue by communicating with the proxy layer.
[0067] It can be understood that the stream computing module can allocate a message queue to each proxy node. When processing or forwarding a data access request, each proxy node can trigger event monitoring and send an event to read the cached data in the second cache to the message queue, that is, the access event message queue. The events in the queue can be arranged based on the order of the data access request received by the proxy node, and then the stream computing module reads the access events in the message queue corresponding to each proxy node in turn, and analyzes the access event information of the access event to determine the data in the second cache corresponding to each access event, and can obtain the hotspot value corresponding to each data based on the number of accesses to the data in the second cache. After determining the hotspot value corresponding to each data, the data that meets the preset hotspot threshold can be directly screened as hotspot data; the data in the second cache can also be sorted based on the hotspot value, and it can be determined whether the hotspot value of the data in the first n bits meets the preset hotspot threshold to determine whether the first n bits of 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 the present 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] Correspondingly, 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 specifically used 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] Correspondingly, when each proxy node obtains hotspot data from the second cache based on the received hotspot event list, it can specifically be used to: obtain hotspot data from the second cache based on the data identifier of the hotspot data in the received hotspot event list.
[0071] It can be understood that the data access request issued by the client 10 may include the data identifier of the requested data, and then based on the number of hits to different data identifiers, the hotspot value corresponding to each data identifier can be determined. There is no need to determine the exact content of the data requested by each data access request. The hotspot value of the data in the second cache can be determined quickly and accurately through the data identifier, thereby reducing the data processing volume and improving the data processing rate.
[0072] Specifically, when each proxy node obtains hotspot data from the second cache based on the data identifier of the hotspot data in the received hotspot event list, it can determine the cache data route of each hotspot data in the second cache based on the data identifier of each hotspot data and a hash algorithm.
[0073] In some embodiments of the present specification, for any one of the multiple proxy nodes, when it is determined that the amount of cached data of the cache node corresponding to the proxy node meets a preset cache threshold, the proxy node determines the number of accesses to each cached data in the corresponding cache node, and invalidates the cached data with the least number of accesses in the cache node.
[0074] In some embodiments of the present specification, the request access interface can be 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 status of the multiple proxy nodes, and send the update cache data operation to the current proxy node.
[0075] Correspondingly, the current proxy node can be used to: process the update cache data operation, invalidate the cache data corresponding to the update cache data operation in the cache node corresponding to the current proxy node, and generate a hotspot invalidation event based on the update cache data operation; send the generated hotspot invalidation 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 corresponding to the update cache data operation in the cache nodes corresponding to each proxy node based on the hotspot invalidation event.
[0076] It can be understood that the above-mentioned preset cache threshold and cache data update operation can trigger the hotspot invalidation of cache data in the cache node corresponding to the proxy node, that is, the cache data with the least number of accesses in the cache node and / or the cache data corresponding to the cache data update operation can be used as hotspot invalidation data, which changes from hot data back to cold data and needs to be eliminated from the cache node. A hotspot invalidation event can be generated based on the hotspot data that is about to be eliminated. Each proxy node can consume the hotspot invalidation event and invalidate the hotspot data in its cache node, so that the data cached in the cache node of the proxy node is finally consistent.
[0077] Based on the above-mentioned distributed system, the embodiments of this specification also provide a data processing method applied to the above-mentioned distributed system. Although this specification provides the method operation steps or device structures shown in the following embodiments or drawings, more or fewer operation steps or module units after partial merging may be included in the method or device based on routine or no creative labor. In the steps or structures where there is no necessary causal relationship logically, the execution order of these steps or the module structure of the device are not limited to the execution order or module structure shown in the embodiments of this specification or the drawings. When the method or module structure is applied in an actual device, server or terminal product, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed processing, server cluster implementation environment). Figure 3 The figure shows a schematic diagram of a data processing method of a distributed system provided by an embodiment of the present application, which can be applied to Figure 1 The distributed system includes a client 10 and a server 20 having a proxy layer 201 and a cache layer 202, wherein the proxy layer 202 is disposed between the client 10 and the cache layer 202, the proxy layer 201 is provided with a first cache, and the cache layer 202 is provided with a second cache; Figure 3 As shown, the method includes:
[0078] S301: Utilize the proxy layer of the server to receive the current data access request of the client.
[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 cache data in the first cache is obtained by the proxy layer calculating the hotspot value of the cache data in the second cache based on multiple data access requests received, and obtaining the cache data whose hotspot value meets the preset hotspot threshold from the second cache for storage.
[0081] The client can be understood as the party that actively initiates requests and receives service responses in network communications. Usually, the client refers to a software program running on a certain type of operating system, which obtains the required information or services by communicating with the server.
[0082] In some embodiments of the present specification, after receiving the current data access request of the client by the proxy layer of the server, the following may also be included:
[0083] When it is determined that the current request data corresponding to the current data access request does not hit the first cache, using the proxy layer to send the current data access request to the cache layer;
[0084] The cache layer is used to obtain current request data corresponding to the current data access request from the second cache based on the current data access request, and the current request data is returned to the client through the proxy layer.
[0085] In some embodiments of the present specification, the second cache of the cache layer 202 may 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 stored in multiple nodes of the cluster (for example, Figure 2 On the Node node in the cache, the cache data route can be determined based on the hash algorithm.
[0086] In some embodiments of the present specification, the proxy layer may include multiple proxy nodes and a request access interface, each proxy node may be provided with a cache node, and cache data of the multiple cache nodes are consistent.
[0087] Accordingly, using the proxy layer of the server to receive the current data access request from the client may include:
[0088] Receiving the current data access request using the request access interface, and determining a target proxy node among the multiple proxy nodes based on the current data access request and the current states 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 can be understood 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 current number of processing requests of each proxy node, the current remaining resources of the proxy node, the processing performance of the proxy node, etc., so as to select a proxy node that is in the best state or meets the preset state 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 into 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 then combines with cloud load balancing services to achieve dynamic expansion and contraction capabilities of the proxy layer, 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 the client. The proxy layer may set up a master node to allocate data access requests, determine the corresponding target proxy node, and forward the data access requests to the target proxy node. This specification does not impose any restrictions on this.
[0093] In some embodiments of this specification, the distributed system may further include a stream 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, each proxy node is used to generate an access event message queue corresponding to each proxy node based on the received data access request, and the access event message queue is sent to the stream computing module;
[0095] Determine access event information of multiple access events in the access event message queue of each proxy node received by the streaming computing module, and determine access data corresponding to each access event in the cache data of the second cache based on each access event information;
[0096] Determine the number of accesses corresponding to each access data based on the access data corresponding to the multiple access events by using the stream computing module, and use the number of accesses corresponding to each access data as the hotspot value of each access data;
[0097] Using the streaming computing module, the access data whose hotspot value meets the hotspot threshold is taken as hotspot data, a hotspot event list is generated based on the determined hotspot data, and the hotspot event list is returned to each proxy node;
[0098] Each proxy node is used to obtain hotspot data from the second cache based on the received hotspot event list, and the obtained hotspot data is stored in the cache node corresponding to each proxy node.
[0099] It can be understood that the monitoring of hot events can be triggered through the proxy node, and the mining of hot data can be realized through the streaming computing module. The streaming computing module can be located in the proxy layer as a part of the proxy layer, or it can be a system module independently set in the distributed system. For example, it can adopt a method similar to client 10 as a software program running on the operating system, and obtain access to the event message queue by communicating with the proxy layer.
[0100] It can be understood that the stream computing module can allocate a message queue to each proxy node. When processing or forwarding a data access request, each proxy node can trigger event monitoring and send an event to read the cached data in the second cache to the message queue, that is, the access event message queue. The events in the queue can be arranged based on the order of the data access request received by the proxy node, and then the stream computing module reads the access events in the message queue corresponding to each proxy node in turn, and analyzes the access event information of the access event to determine the data in the second cache corresponding to each access event, and can obtain the hotspot value corresponding to each data based on the number of accesses to the data in the second cache. After determining the hotspot value corresponding to each data, the data that meets the preset hotspot threshold can be directly screened as hotspot data; the data in the second cache can also be sorted based on the hotspot value, and it can be determined whether the hotspot value of the data in the first n bits meets the preset hotspot threshold to determine whether the first n bits of 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 the present 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] Correspondingly, the streaming computing module is used to determine the number of accesses corresponding to each access data based on the access data corresponding to multiple access events, and the number of accesses of each access data is used as the hotspot value of each access data. This can include: using the streaming computing module to count the number of hits of the same data identifier, and using the number of hits of each data identifier as the hotspot value of the access data corresponding to each data identifier.
[0103] Correspondingly, using each proxy node to obtain hotspot data from the second cache based on the received hotspot event list may include: using each proxy node to obtain hotspot data from the second cache based on the data identifier of the hotspot data in the received hotspot event list.
[0104] Specifically, when each proxy node obtains hotspot data from the second cache based on the data identifier of the hotspot data in the received hotspot event list, it can determine the cache data route of each hotspot data in the second cache based on the data identifier of each hotspot data and a hash algorithm.
[0105] In some embodiments of the present specification, the above method may also include: for any one of the multiple proxy nodes, when it is determined that the amount of cache data of the cache node corresponding to the proxy node meets a preset cache threshold, using the proxy node to determine the number of times each cache data is accessed in the corresponding cache node, and invalidating the cache data with the least number of accesses in the cache node.
[0106] In some embodiments of the present specification, the above method may also include: when the request access interface receives an update cache data operation, based on the update cache data operation and the current status of the multiple proxy nodes, determining the current proxy node among the multiple proxy nodes, and sending the update cache data operation to the current proxy node; using the current proxy node to process the update cache data operation, 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; using the current proxy node to send the generated hotspot invalidation event to multiple proxy nodes of the proxy layer; using each proxy node to invalidate 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] It can be understood that the above-mentioned preset cache threshold and cache data update operation can trigger the hotspot invalidation of cache data in the cache node corresponding to the proxy node, that is, the cache data with the least number of accesses in the cache node and / or the cache data corresponding to the cache data update operation can be used as hotspot invalidation data, which changes from hot data back to cold data and needs to be eliminated from the cache node. A hotspot invalidation event can be generated based on the hotspot data that is about to be eliminated. Each proxy node can consume the hotspot invalidation event and invalidate the hotspot data in its cache node, so that the data cached in the cache node of the proxy node is finally consistent.
[0108] The description of the above process steps and specific implementation methods can be understood by referring to the content of the distributed system part, which will not be repeated here.
[0109] From the above embodiments, it can be seen that the process of hotspot data related processing at the proxy layer of the distributed system can include traffic collection, hotspot discovery and hotspot failure. The following will be combined with the accompanying drawings, taking the SDK-Client-API interface as an example to further introduce the process of traffic collection, hotspot discovery and hotspot failure between the proxy node and the streaming computing module in the above hotspot data related data processing process.
[0110] Figure 4 FIG. 1 shows a flow collection process in an embodiment of this specification. Figure 4 As shown, the traffic collection phase may specifically include the following processes:
[0111] S1: The client of the business application layer calls the SDK-Client-API interface to access the request. For example, the client can obtain cached data through "get key".
[0112] S2: The request traffic passes through the unified access entrance: the query-proxy cluster of the proxy layer, and is routed to a proxy node in the proxy layer through the load balancing algorithm. When the proxy node processes or forwards the request, an event listener will be triggered, and an event of reading cache data will be sent to the message queue. For reference, Figure 3 As shown in , the message queue may include multiple events issued by the corresponding proxy node. The multiple events can be arranged in sequence and consumed and read by the streaming computing module in sequence.
[0113] In some embodiments of the present specification, events in a message queue may be in an access event message protocol and in JSON format. The access event message may be as follows:
[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] Among them, source can represent the client IP that initiates the access, target can represent the proxy node IP to which the proxy layer is routed, timestamp can represent the timestamp of the access event, key can represent the key value of the cache data accessed by the access request, and type can represent the access API type.
[0120] S3: The streaming computing module can assign a message queue to each proxy node. Each access request event of the client will be sequentially read and consumed by the streaming computing module in the message queue, and then all request events will be summarized by the streaming computing module, that is, each cache data with the same key value (which can be a data identifier used to characterize cached data) is hit several times, so as to perform real-time statistical analysis and processing, generate a real-time heat map of cache access frequency, and achieve the purpose of monitoring traffic.
[0121] In the embodiments of the present specification, when the proxy layer receives a client access request, it can monitor the request behavior and trigger an event, which is sent to the streaming computing system for hot data mining.
[0122] Figure 5 FIG. 2 shows a hotspot discovery process in an embodiment of this specification. Figure 5 As shown, the hotspot discovery phase may specifically include the following processes:
[0123] S1: The streaming computing module performs real-time top key statistics on the access frequency of cached data. The top key can be cached data with the top n hotspot values, one or more cached data with the largest hotspot values, or cached data with the top two or three key values.
[0124] S2: Determine whether the top key is hot key data based on the hotspot threshold configuration (such as 3000qps, etc.).
[0125] S3: Periodically send hot key data list event messages to the queue system according to a preset period. The preset period may be, for example, 3-10 seconds, which may be configured based on actual conditions.
[0126] In some embodiments of the present specification, the hot key data list event message may be sent in the hot event message protocol in JSON format. The hot event message may 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 hot key value list.
[0131] S4: The proxy nodes of the query-proxy cluster at the proxy layer consume message queue events, identify and replicate hot data.
[0132] Specifically, the query-proxy cluster node can query the distributed cache (second cache) according to the hot key data list, and copy the hot key data to each proxy node in the proxy layer as the cache data of the node's own local cache (cache node in the first cache). Each proxy node can have different data replication rates and synchronization progress based on its own resource performance, but the hot key data list is the same, so that the local cache of each proxy node in the cluster can be eventually consistent.
[0133] In the embodiments of this specification, the proxy node can receive the hotspot data top key event, trigger the synchronization hotspot cache data process, synchronize the hotspot data in the second cache to the first cache, and realize the periodic update of the hotspot data. Furthermore, the proxy layer can uniformly receive the data access request of the client. When the key value of the requested data hits the first-level cache, it can be processed by the proxy layer and the requested data, that is, the hotspot key data, can be directly returned in the first-level cache. This data processing method has a fast response to data access requests and high system performance. At the same time, it can avoid the impact of a large number of hotspot key data accesses on the server, which can enhance the stability of the system.
[0134] In some embodiments of the present specification, in the hotspot failure phase, the local cache of the proxy node of the query-proxy cluster at the proxy layer uses the cache elimination algorithm (The Least Recently Used, LRU) to eliminate the hotspot data.
[0135] Specifically, when the space occupied by the hot key data in the first-level cache reaches a certain threshold (such as 90%), the least accessed data will be eliminated; when the query-proxy cluster node at the proxy layer receives the SDK-Client-API interface called by the client at the business application layer, such as updating the cache data through "del set", the hot data can be invalidated in the first-level cache of the current proxy node that receives the operation, and the event monitoring is triggered at the same time, and a cache invalidation event is sent to the message queue. The hotspot invalidation event message protocol corresponding to the hotspot invalidation event can be in JSON format, and the hotspot invalidation event message can be expressed as follows:
[0136] {"timestamp":"2024-05-10 18:35:22",
[0137] "key":"test_key1"}
[0138] Among them, timestamp can indicate the timestamp of the hotspot failure event, and key can indicate 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 cache data of proxy nodes in the proxy layer.
[0140] In the embodiments of this specification, a proxy layer is introduced into the original distributed cache system. This proxy layer can specifically add local cache, i.e., first-level cache, to the hot key data appearing in the distributed system, for caching the hot key data, while the cache layer of the original distributed cache cluster is used as a cache layer for non-hot key data, i.e., cold cache data, i.e., second-level cache. Furthermore, the access request for the hot key data will hit the first-level cache in the proxy layer, so as to obtain the processed and returned data, and there is no need to directly access the cold cache data on some shard nodes of the distributed cache cluster of the cache layer, thereby avoiding the problem of uneven access between the shard nodes, and at the same time, the design of the first and second-level caches also achieves the purpose of separate storage of hot and cold data. In addition, the proxy layer added between the business application layer (client) and the cache layer (distributed cache cluster) is used to provide a unified entrance for access to the application layer cache service. At the same time, the proxy layer can also realize services such as hot key data monitoring and collection, hot key data caching, and hot key data dynamic management, as a first-level cache of the distributed system. The client does not interact with the distributed cache cluster directly. Instead, the proxy layer is responsible for the cache access service of the business data. When the cached data is promoted to hot key data due to a large number of repeated accesses reaching the preset traffic threshold, it will be directly stored by the first-level cache of the proxy layer and returned to the client in real time without entering the storage layer of the second-level cache. Access requests for other cold data caches will be processed 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 the virtual access request client of the storage layer, and it is also the virtual cache data storage layer of the business application layer.
[0141] By implementing the above method to separate the storage of hot and cold data, it is possible to avoid the impact of access requests for hot key data on the performance of data sharding nodes in the cache layer, greatly reducing the service pressure of the distributed system. At the same time, since the 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] The present 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 The example of connecting through bus is taken in the following.
[0143] The processor 601 may be a central processing unit (CPU). The processor 601 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0144] The memory 602 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the data processing method of the distributed system in the embodiment 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, that is, the data processing method of the distributed system in the above method embodiment is implemented.
[0145] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 601, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the processor 601 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0146] The one or more modules are stored in the memory 602, and when executed by the processor 601, the following is performed: Figure 3 The data processing method of the distributed system in the illustrated embodiment.
[0147] The specific details of the above electronic device can be understood by referring to the corresponding descriptions and effects in the above method embodiments, and will not be repeated here.
[0148] The present specification also provides a computer storage medium, wherein the computer storage medium stores computer program instructions, and when the computer program instructions are executed, the steps of the data processing method of the above-mentioned distributed system are implemented.
[0149] The present specification also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the data processing method of the distributed system are implemented.
[0150] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0151] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0152] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
[0153] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0154] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute certain parts of the methods of each implementation method of the present application.
[0155] The present application can be used in many general or special computer system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0156] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0157] Although the present application has been described through embodiments, those skilled in the art will appreciate that there are many modifications and variations to the present application without departing from the spirit of the present application, and it is intended that the appended claims include these modifications and variations without departing from the spirit of the present application.
Claims
1. A data processing method for a distributed system, It is characterized in that Applied to a distributed system, the distributed system includes a client and a server having a proxy layer and a cache layer, wherein the proxy layer is arranged between the client and the cache layer, the proxy layer is provided with a first cache, and the cache layer is provided with a second cache; the method includes: Use the proxy layer on the server side 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 is used to obtain the current request data from the first cache, and the current request data is returned to the client; wherein, the cache data in the first cache is obtained by the proxy layer calculating the hotspot value of the cache data in the second cache based on the multiple data access requests received, and obtaining the cache data whose hotspot value meets the preset hotspot threshold from the second cache for storage.
2. The method according to claim 1, It is characterized in that After using the proxy layer on the server to receive the client's current data access request, it also includes: When it is determined that the current request data corresponding to the current data access request does not hit the first cache, using the proxy layer to send the current data access request to the cache layer; The cache layer is 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 the current request data is returned to the client through the proxy layer.
3. The method according to claim 1, It is characterized in that The proxy layer includes multiple proxy nodes and a request access interface, each proxy node is provided with a cache node, and the cache data of the multiple cache nodes are consistent; Accordingly, using the proxy layer of the server to receive the client's current data access request includes: Utilizing the request access interface to receive the current data access request, and based on the current data access request and current states of the multiple proxy nodes, determining a target proxy node among the multiple proxy nodes; The current data access request is sent to the target proxy node using the request access interface.
4. The method according to claim 3, It is characterized in that The distributed system further includes a stream computing module, and the method further includes: When any proxy node is detected to have received a data access request, each proxy node is used to generate an access event message queue corresponding to each proxy node based on the received data access request, and the access event message queue is sent to the stream computing module; Determine access event information of multiple access events in the access event message queue of each proxy node received by the streaming computing module, and determine access data corresponding to each access event in the cache data of the second cache based on each access event information; Determine the number of accesses corresponding to each access data based on the access data corresponding to the multiple access events using the stream computing module, and use the number of accesses corresponding to each access data as the hotspot value of each access data; Using the streaming computing module, the access data whose hotspot value meets the hotspot threshold is taken as hotspot data, a hotspot event list is generated based on the determined hotspot data, and the hotspot event list is returned to each proxy node; Each proxy node is used to obtain hotspot data from the second cache based on the received hotspot event list, and the obtained hotspot data is stored in the cache node corresponding to each proxy node.
5. The method according to claim 4, It is characterized in that The data access request includes a data identifier of the requested data, and the access event information includes the data identifier; Correspondingly, the streaming computing module is used to determine the number of accesses corresponding to each access data based on the access data corresponding to the multiple access events, and the number of accesses corresponding to each access data is used as the hotspot value of each access data, including: Utilize the stream computing module 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; Correspondingly, using each proxy node to obtain hotspot data from the second cache based on the received hotspot event list includes: The hotspot data is obtained from the second cache using the data identifier of the hotspot data in the received hotspot event list by each proxy node.
6. The method according to claim 3, It is characterized in that Also includes: For any one of the multiple proxy nodes, when it is determined that the amount of cache data of the cache node corresponding to the proxy node meets the preset cache threshold, the proxy node is used to determine the number of accesses to each cache data in the corresponding cache node, and the cache data with the least number of accesses in the cache node is invalidated.
7. The method according to claim 3, It is characterized in that Also includes: When the request access interface receives an update cache data operation, based on the update cache data operation and current states of the multiple proxy nodes, a current proxy node is determined among the multiple proxy nodes, and the update cache data operation is sent to the current proxy node; Using the current proxy node to process the cache data update operation, invalidating the cache data corresponding to the cache data update operation in the cache node corresponding to the current proxy node, and generating a hotspot invalidation event based on the cache data update operation; Using the current proxy node to send the generated hotspot failure event to multiple proxy nodes in the proxy layer; Each proxy node is used to perform invalidation processing on cache data corresponding to the cache data update operation in the cache node corresponding to each proxy node based on the hotspot invalidation event.
8. A distributed system, It is characterized in that It comprises a client and a server having a proxy layer and a cache layer, wherein the proxy layer is arranged between the client and the cache layer, the proxy layer is provided with a first cache, and the cache layer is provided with a second cache; The proxy layer is used 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, obtain the current request data from the first cache and return the current request data to the client; the cache data in the first cache is obtained by the proxy layer calculating a hotspot value of the cache data in the second cache based on multiple data access requests received, and obtaining cache data from the second cache whose hotspot value meets a preset hotspot threshold for storage.
9. An electronic device, It is characterized in that include: 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 implements the steps of the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer storage medium, It is characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Distributed cache method and system
CN108183947A
Data request processing method and device, computer equipment and storage medium
CN112076464A
Cited By
Dynamic adjustment method and device for deployment fragment number
CN119148947A
Configuration optimization method and device of distributed system and electronic equipment
CN119814796A
