Data access method, system, device, equipment, storage medium and program product
By utilizing a local caching-first query strategy and global data storage information in a distributed system, the problem of low efficiency in distributed data access is solved, enabling data access based on proximity and load balancing, thereby improving system performance and scalability.
Patent Information
- Application Number
- CN202511587817.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-27
AI Technical Summary
Existing distributed data access methods are inefficient when processing massive amounts of data, cannot effectively utilize storage resources in distributed systems, and result in high network transmission overhead and high data access latency.
When a data access request is received, the system first queries the local cache for the target data. If the target data is not found, it retrieves the target data by querying the data storage information, including the mapping relationship between the data stored by multiple clients in the distributed system and the client identifiers. The system utilizes a local cache priority query strategy and maintains global data storage information to quickly locate and retrieve the target data.
It significantly reduces network transmission overhead and data access latency, improves data access efficiency and success rate, enables data access to be localized and load balancing, and enhances the overall performance and scalability of the system.
Smart Images

Figure CN121579534A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of storage, and particularly relates to a data access method, system, device, equipment, storage medium and program product. BACKGROUND
[0002] With the development of distributed computing and high-concurrency business technology, an application scenario of processing large-scale data in parallel on multiple client nodes appears. In order to linearly improve the overall business performance of the system when the number of clients increases, and effectively isolate the direct pressure of business applications on the backend shared storage system, a solution of preloading hot data to the local storage of the client is proposed, thereby forming a distributed data access mode based on local cache.
[0003] However, when processing massive data, the above-mentioned distributed data access method has the problem of low access efficiency. SUMMARY
[0004] Therefore, it is necessary to provide a data access method, system, device, equipment, storage medium and program product capable of improving data access efficiency in view of the above technical problems.
[0005] In a first aspect, the present application provides a data access method applied to a first client in a distributed system, and the method comprises the following steps:
[0006] In the case that a data access request is received, the target data requested by the data access request is queried in the local cache of the first client.
[0007] If the local cache does not hit the target data, the target data is obtained by querying data storage information; the data storage information comprises a mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers.
[0008] The data access method provided by the embodiments of the present application comprises the following steps: in the case that a data access request is received, the target data requested by the data access request is queried in the local cache of the first client; if the local cache does not hit the target data, the target data is acquired by querying data storage information. The data storage information comprises a mapping relationship between the data stored by a plurality of clients in a distributed system and a plurality of client identifiers. In the above method, firstly, the local cache is preferentially queried by using a local cache query strategy, and when the target data exists in the local cache, the target data can be directly returned, which significantly reduces the network transmission overhead and data access delay, and improves the data access efficiency; secondly, by maintaining the global data storage information, the target data can be quickly located and acquired when the cache misses, and the success rate of data access and system reliability are improved. The method effectively utilizes the storage resources of each client in the distributed system, realizes the nearby access of data and load balancing, and is particularly suitable for data-intensive applications in a large-scale distributed environment, which guarantees the efficient access of data and significantly improves the overall performance and scalability of the system.
[0009] In some embodiments, the target data is acquired by querying the data storage information, comprising:
[0010] According to the mapping relationship between the data stored by the plurality of clients and the plurality of client identifiers, the second client identifier corresponding to the target data is determined;
[0011] A data acquisition request is sent to the second client corresponding to the second client identifier, a feedback result returned by the second client is received, and the target data is acquired according to the feedback result.
[0012] In some embodiments, the target data is acquired according to the feedback result, comprising:
[0013] If the feedback result indicates that the local cache on the second client stores the target data, the target data is extracted from the feedback result;
[0014] If the feedback result indicates that the local cache on the second client does not store the target data, the target data is acquired from the back-end storage device of the second client.
[0015] The method provided in the embodiments of the present application can first determine whether the target data is in the local cache of other clients when the local cache of the first client does not hit the target data, instead of directly obtaining the target data from the backend storage device, so that the cache resources of the nodes in the distributed system can be fully utilized, the access pressure on the backend storage system can be significantly reduced, the data access delay can be reduced, and the data access efficiency can be improved. In addition, the client where the target data is located can be quickly located by querying the data storage information, network congestion caused by network-wide broadcast query can be avoided, the time cost of data searching can be significantly reduced, the data access speed can be accelerated, and the response performance of the overall system can be improved.
[0016] In some embodiments, the method further includes:
[0017] receiving a mapping table sent by a backend server in the distributed system, and updating the data storage information according to the mapping table; the mapping table includes a mapping relationship between data stored by a plurality of clients in the distributed system and a plurality of client identifiers.
[0018] The method provided in the embodiments of the present application can clearly record the mapping relationship between the data stored by the plurality of clients in the distributed system and the client identifiers in the mapping table. When specific data needs to be accessed, the system can directly and accurately find the client storing the data according to the mapping table, blind search in the entire distributed system is avoided, the data positioning time is greatly shortened, and the data access efficiency is improved. When a client joins or exits the distributed system, the global mapping table is uniformly maintained and distributed by the backend server, so that the consistency and accuracy of the data positioning information of the clients are ensured.
[0019] In a second aspect, the present application provides a data access method applied to a second client in a distributed system, the method including:
[0020] When a data acquisition request sent by a first client in the distributed system is received, querying the target data requested by the data acquisition request in the local cache of the second client;
[0021] If the local cache hits the target data, extracting the target data from the local cache, generating a feedback result according to the target data, and sending the feedback result to the first client.
[0022] In some embodiments, the method further includes:
[0023] If the local cache does not hit the target data, generating an error code carried in the feedback result and sent to the first client to instruct the first client to acquire the target data from the backend storage device of the second client.
[0024] The method described in this application embodiment allows the first client to determine whether the target data is in the local cache of other clients before directly retrieving it from the backend storage device when the target data is not found in the first client's local cache. This fully utilizes the caching resources of each node in the distributed system, significantly reducing the access pressure on the backend storage system, lowering data access latency, and thus improving data access efficiency. Furthermore, querying data storage information can quickly locate the client where the target data is located, avoiding network congestion caused by broadcast queries across the entire network, significantly reducing the time cost of data retrieval, thereby accelerating data access speed and improving the overall system response performance.
[0025] In some embodiments, the method further includes:
[0026] Retrieve the target data and related data from the backend storage device, and load the target data and related data into the local cache.
[0027] The method described in this application, by loading the target data and related data into the local cache of the second client, allows the second client to quickly respond directly from the local cache when the first client requests the target data or its associated data again, without requiring the first client to access the backend storage device. Since the read / write speed of the local cache is much faster than the speed of retrieving data from the backend storage device, the above method can significantly shorten the data retrieval time, improve the system's response speed, and thus improve data access efficiency.
[0028] Thirdly, this application provides a data access method applied to a backend server in a distributed system, the method comprising:
[0029] Construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in a distributed system;
[0030] The mapping table is sent to the first and second clients in the distributed system to instruct them to update the data storage information in their local storage according to the mapping table.
[0031] The method described in this application embodiment clearly records the mapping relationship between data stored by multiple clients in the distributed system and client identifiers in the mapping table. When specific data needs to be accessed, the system can directly and accurately find the client storing the data based on the mapping table, avoiding blind searching throughout the distributed system, greatly shortening the data location time, and thus improving data access efficiency. When a client joins or leaves the distributed system, the global mapping table is uniformly maintained and distributed by the backend server, ensuring the consistency and accuracy of data location information for each client.
[0032] Fourthly, this application provides a distributed system, which includes: multiple clients and backend servers;
[0033] Any client is used to execute the data access method of either the first aspect or the second aspect described above;
[0034] The backend server is used to execute third-party data access methods.
[0035] Fifthly, this application also provides a data access device, the device comprising:
[0036] The first query module is used to query the target data requested by the data access request in the local cache of the first client when a data access request is received.
[0037] The acquisition module is used to retrieve the target data by querying the data storage information if the local cache does not find the target data. The data storage information includes the mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers.
[0038] Sixthly, this application also provides a data access device, the device comprising:
[0039] The second query module is used to query the target data requested by the data retrieval request in the local cache of the second client when a data retrieval request is received from the first client in the distributed system.
[0040] The return module is used to retrieve the target data from the local cache if the target data is found in the local cache, generate a feedback result based on the target data, and send the feedback result to the first client.
[0041] In a seventh aspect, this application also provides a data access device, the device comprising:
[0042] The building module is used to construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in a distributed system;
[0043] The sending module is used to send the mapping table to the first client and the second client in the distributed system, so as to instruct the first client and the second client to update the data storage information in their local storage according to the mapping table.
[0044] Eighthly, this application also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the data access method of any one of the first to third aspects described above.
[0045] Ninthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the data access method of any one of the first to third aspects described above.
[0046] In a tenth aspect, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the data access method of any one of the first to third aspects described above.
[0047] The aforementioned data access method, system, device, equipment, storage medium, and program product involve the following steps: Upon receiving a data access request, the method queries the local cache of a first client for the requested target data. If the local cache does not contain the target data, the method retrieves the target data by querying data storage information. This data storage information includes a mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers. Firstly, by employing a local cache-first query strategy, the method directly returns the target data if it exists in the local cache, significantly reducing network transmission overhead and data access latency, thus improving data access efficiency. Secondly, by maintaining global data storage information, the method ensures rapid location and retrieval of the target data even when the cache is not found, improving the success rate of data access and system reliability. This method effectively utilizes the storage resources of each client in the distributed system, achieving proximity-based data access and load balancing. It is particularly suitable for data-intensive applications in large-scale distributed environments, significantly improving the overall system performance and scalability while ensuring efficient data access. Attached Figure Description
[0048] Figure 1 These are schematic diagrams of the structure of a distributed system in some embodiments;
[0049] Figure 2 This is one of the flowcharts illustrating the data access method in some embodiments;
[0050] Figure 3 This is a second flowchart illustrating the data access method in some embodiments;
[0051] Figure 4 This is the third flowchart illustrating the data access method in some embodiments;
[0052] Figure 5 This is the fourth flowchart illustrating the data access method in some embodiments;
[0053] Figure 6 This is the fifth flowchart illustrating the data access method in some embodiments;
[0054] Figure 7 This is the sixth flowchart illustrating the data access method in some embodiments;
[0055] Figure 8 This is the seventh flowchart illustrating the data access method in some embodiments;
[0056] Figure 9 This is the eighth flowchart illustrating the data access method in some embodiments;
[0057] Figure 10 This is a structural block diagram of the data access device in some embodiments;
[0058] Figure 11 This is one of the structural block diagrams of a data access device in some embodiments;
[0059] Figure 12 This is a second structural block diagram of a data access device in some embodiments;
[0060] Figure 13 This is the third internal structure diagram of a computer device in some embodiments. Detailed Implementation
[0061] In the embodiments of this application, the term "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0062] In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.
[0063] In the embodiments of this application, the term "at least one" means one or more. For example, at least one of A, B and C can represent six situations: A exists alone, B exists alone, C exists alone, A and B exist simultaneously, A and C exist simultaneously, B and C exist simultaneously, and A, B and C exist simultaneously.
[0064] The technical solutions of 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 of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0065] With the development of distributed computing and high-concurrency business technologies, application scenarios have emerged that involve parallel processing of large-scale data across multiple client nodes. To linearly improve overall system performance as the number of clients increases, while effectively isolating the direct pressure of business applications on the backend shared storage system, a solution has been proposed to pre-load hot data into the client's local storage, thus forming a distributed data access model based on local caching. However, when processing massive amounts of data, the aforementioned distributed data access method suffers from low access efficiency.
[0066] In view of this, embodiments of this application propose a data access method, system, apparatus, device, storage medium, and program product. The method can first obtain the target data from the local cache of a first client. If the target data is not found in the local cache of the first client, the first client can first determine whether the target data is in the local cache of other clients, instead of directly obtaining it from the backend storage device. This can make full use of the cache resources of each node in the distributed system, significantly reduce the access pressure on the backend storage system, reduce data access latency, and thus improve data access efficiency.
[0067] It should be noted that the beneficial effects or technical problems solved by the embodiments of this application are not limited to this one, but may also be other implicit or related problems. For details, please refer to the description of the embodiments below.
[0068] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0069] In some embodiments, the data access method provided in this application can be applied to, for example... Figure 1In the distributed system shown, there are multiple clients 101, multiple backend storage devices 102, and a backend server 103. The clients 101 are interconnected, with each client corresponding to a backend storage device 102. The backend server 103 is connected to both the clients 101 and the backend storage devices 102. There can be one or more backend servers 103. The frontend clients 101, the backend storage devices 102, and the backend servers 103 together constitute the storage nodes in the distributed system, which includes multiple storage nodes. The client 101 is the entry point for users to interact with the distributed file system, initiating file read / write requests. The backend storage devices 102 store data, and the backend servers 103 process client requests. In practical applications, this distributed system can be a distributed file system. The clients 101 can be various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices, or they can be servers or server clusters. The backend storage devices 102 can be integrated onto the backend servers 103 or located in the cloud or on other network servers. The backend server 103 can be a variety of personal computers, laptops, smartphones, tablets, IoT devices and portable wearable devices, or it can be a server or a server cluster composed of multiple servers.
[0070] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the solution of this application and does not constitute a limitation on the distributed system to which the solution of this application is applied. A specific distributed system may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0071] In some embodiments, such as Figure 2 As shown, a data access method is provided, which can be applied to... Figure 1 Taking the first client in a distributed system as an example, the explanation includes the following steps:
[0072] S201, upon receiving a data access request, query the target data requested by the data access request in the local cache of the first client.
[0073] In this context, the first client can be any client in the distributed system. The data access request table is used to retrieve the target data. The target data can be cached data or metadata.
[0074] In this embodiment, the first client can receive data access requests from different sources. For example, user actions on the client interface, or API calls from other systems or processes. Upon receiving a data access request, the first client can parse it and extract the identifier information of the target data. This identifier information includes, for example, the target data's identifier, data type, and query conditions. Then, the first client can perform a query operation in its local cache based on the target data's identifier information to determine if the local cache has hit the target data. If the local cache has hit the target data, the target data can be directly returned to the requester. Simultaneously, relevant cache hit information, such as hit time and hit count, can be recorded for subsequent cache performance analysis.
[0075] Optionally, the first client can perform query operations based on key-value pair caching. Specifically, the first client's local cache can store data in key-value pair format, with each data item having a unique key. When a data access request is received, the identifier information of the target data can be used as the key. Then, the corresponding key-value pair is directly searched in the local cache. If the corresponding key-value pair exists in the local cache, it means that the target data exists in the local cache, and it can be determined that the local cache has hit the target data; if the corresponding key-value pair does not exist in the local cache, it means that the target data does not exist in the local cache, and it can be determined that the local cache has missed the target data. For example, in the client of an e-commerce application, product information is stored in the cache, with the product ID as the key and the product details as the value. When a user requests to view product information, the client extracts the product ID and searches for the corresponding product information in the local cache.
[0076] Optionally, the first client can perform query operations using an index structure. Specifically, the first client can create a hash index for locally cached data. When a data access request is received, the target data's identifier information is used to calculate a hash value using a hash function. Then, the hash value is used to locate the possible storage location of the target data in the hash index. Further search and comparison are performed at that location to determine if the target data exists. If the target data exists, it means the local cache has hit the target data; if the target data does not exist, it means the local cache has not hit the target data.
[0077] S202, if the local cache does not find the target data, the target data is obtained by querying the data storage information.
[0078] The data storage information includes the mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers. For example, the mapping relationship is: data A - client 1, data B - client 2, ..., data N - client n. Here, data N - client n indicates that data N is stored in the backend storage device of client n. The data storage information is obtained by the backend server in the distributed system through pre-division and data mapping of the storage areas of the storage system, and is updated in real time.
[0079] In this embodiment, multiple client-side local caches can be pre-built based on SSDs and HDDs. These local caches are then combined into a cache group (with network pathways between clients within the cache group, enabling interaction of cached data and metadata). This allows the use of multiple client-side local caches to build a common cache group at the front end. The dataset can then be pre-warmed (pre-loaded) into the cache group and distributed to each client within the cache group using consistent hashing, thus forming a cached dataset within the cache group.
[0080] The first client can receive data storage information sent by the backend server in advance and load this information into its local cache. Whenever the data storage information is updated, the backend server sends the latest data storage information to the first client, which then loads it into its local cache. If the target data is not found in the first client's local cache, the first client can retrieve the data storage information from its local cache, determine the storage location of the target data based on this information, and then retrieve the target data. Optionally, if the target data is not found in the first client's local cache, the first client can send a network request to the backend server to obtain the latest data storage information, determine the storage location of the target data based on this information, and then retrieve the target data.
[0081] The data access method provided in this application, upon receiving a data access request, queries the local cache of a first client for the requested target data. If the local cache does not contain the target data, the target data is retrieved by querying data storage information. This data storage information includes a mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers. Firstly, by employing a local cache-first query strategy, the method directly returns the target data if it exists in the local cache, significantly reducing network transmission overhead and data access latency, thus improving data access efficiency. Secondly, by maintaining global data storage information, it ensures that the target data can be quickly located and retrieved even when the cache is not found, improving the success rate of data access and system reliability. This method effectively utilizes the storage resources of each client in the distributed system, achieving proximity-based data access and load balancing. It is particularly suitable for data-intensive applications in large-scale distributed environments, significantly improving the overall system performance and scalability while ensuring efficient data access.
[0082] In some embodiments, a specific implementation method for obtaining target data by querying data storage information is also provided, such as... Figure 3 As shown, "obtaining target data by querying data storage information" in S202 above includes:
[0083] S301, determine the second client identifier corresponding to the target data based on the mapping relationship between the data stored by multiple clients and the multiple client identifiers.
[0084] The second client identifier is the identifier of the client where the target data is located.
[0085] In this embodiment, when the local cache of the first client hits the target data, the data storage information can be queried. Based on the mapping relationship between data stored by multiple clients and multiple client identifiers in the data storage information, the second client identifier corresponding to the target data can be determined. Specifically, data matching the target data's identifier information can be found in the data storage information, and the identifier of the client corresponding to the data matching the target data's identifier information can be used as the second client identifier.
[0086] S302, send a data acquisition request to the second client corresponding to the second client identifier, receive the feedback result returned by the second client, and acquire the target data based on the feedback result.
[0087] The data retrieval request is used to obtain the target data. The feedback result includes the target data or an error code.
[0088] In this embodiment, after determining the identifier of the second client, the first client can send a data retrieval request to the second client corresponding to the second client identifier. Upon receiving the data retrieval request, the second client can parse the request and extract the identifier information of the target data. For example, the identifier information includes the identifier of the target data, its data type, and query conditions. Then, the second client can perform a query operation in its local cache based on the identifier information of the target data to determine whether the local cache has hit the target data. If the local cache has hit the target data, it can directly extract the target data from the local cache, generate a feedback result based on the target data, and then send the feedback result to the first client, which can then receive the feedback result returned by the second client. If the local cache has not hit the target data, an error code is generated and carried in the feedback result and sent to the first client, which can then receive the feedback result returned by the second client. It should be noted that the method by which the second client performs a query operation in its local cache based on the identifier information of the target data is similar to or the same as the method by which the first client performs a query operation in its local cache based on the identifier information of the target data.
[0089] Furthermore, such as Figure 4 As shown, "obtain target data based on feedback results" in S302 above includes:
[0090] S3021, If the feedback result indicates that the target data is stored in the local cache on the second client, then extract the target data from the feedback result.
[0091] In this embodiment of the application, when the first client receives the feedback result from the second client, if the feedback result is the target data, it means that the target data is stored in the local cache on the second client, and the first client can directly extract the target data from the feedback result.
[0092] S3022, if the feedback result indicates that the target data is not stored in the local cache on the second client, then the target data is retrieved from the backend storage device of the second client.
[0093] The backend storage device of the second client is a storage device for storing the target data.
[0094] In this embodiment, if the feedback result is an error code, it indicates that the local cache on the second client did not find the target data. In this case, the first client can retrieve the target data from the second client's backend storage device. Specifically, the first client can use the obtained access information of the backend storage device to construct a new retrieval request according to the protocols and formats supported by the backend storage device and send it to the backend storage device. This request also includes detailed identification information of the target data to ensure that the backend storage device can accurately locate it. After receiving the request, the backend storage device performs a comprehensive search within its own storage system based on the data identification information in the request. Once the backend storage device finds the target data, it returns it to the first client in a specific format, allowing the first client to retrieve the target data.
[0095] The method described in this application embodiment allows the first client to determine whether the target data is in the local cache of other clients before directly retrieving it from the backend storage device when the target data is not found in the first client's local cache. This fully utilizes the caching resources of each node in the distributed system, significantly reducing the access pressure on the backend storage system, lowering data access latency, and thus improving data access efficiency. Furthermore, querying data storage information can quickly locate the client where the target data is located, avoiding network congestion caused by broadcast queries across the entire network, significantly reducing the time cost of data retrieval, thereby accelerating data access speed and improving the overall system response performance.
[0096] In some embodiments, the above data access method further includes:
[0097] Receive the mapping table sent by the backend server in the distributed system, and update the data storage information according to the mapping table.
[0098] The mapping table includes the mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers.
[0099] In this embodiment, the backend server in the distributed system can divide the storage area of the storage system, then map the data to the divided blocks, associate it with multiple backend storage devices, and obtain the clients corresponding to the multiple backend storage devices. Finally, it associates the data with the client identifiers to obtain the mapping relationship between the data stored by multiple clients and the multiple client identifiers, i.e., the mapping table. After the backend server constructs the mapping table, it can send the mapping table to multiple clients in the distributed system, specifically including a first client and a second client. After receiving the mapping table, the first client and the second client can load the mapping table into their local cache as data storage information. The backend server also updates the mapping table in real time according to changes in the distributed system (e.g., adding or removing clients) and sends the latest mapping table to the first client and the second client. After receiving the new mapping table, the first client and the second client can update their data storage information according to the new mapping table. Specifically, they can update the data storage information according to the updated information in the new mapping table, or they can directly replace the original data storage information with the mapping table to obtain the latest data storage information.
[0100] The method described in this application embodiment clearly records the mapping relationship between data stored by multiple clients in the distributed system and client identifiers in the mapping table. When specific data needs to be accessed, the system can directly and accurately find the client storing the data based on the mapping table, avoiding blind searching throughout the distributed system, greatly shortening the data location time, and thus improving data access efficiency. When a client joins or leaves the distributed system, the global mapping table is uniformly maintained and distributed by the backend server, ensuring the consistency and accuracy of data location information for each client.
[0101] In some embodiments, such as Figure 5 As shown, a data access method is provided, which can be applied to... Figure 1 Taking the second client in a distributed system as an example, the following steps are included:
[0102] S401, upon receiving a data retrieval request from the first client in the distributed system, queries the local cache of the second client for the target data requested in the data retrieval request.
[0103] S402, if the local cache hits the target data, the target data is extracted from the local cache, a feedback result is generated based on the target data, and the feedback result is sent to the first client.
[0104] S403, if the local cache does not find the target data, an error code is generated and sent to the first client in the feedback result to instruct the first client to retrieve the target data from the backend storage device of the second client.
[0105] The data retrieval request is used to obtain the target data. The feedback result includes the target data or an error code.
[0106] In this embodiment, after receiving a data retrieval request from the first client, the second client can parse the request and extract the identification information of the target data. For example, the identification information includes the target data's identifier, data type, and query conditions. Then, the second client can perform a query operation in its local cache based on the target data's identification information to determine if the local cache hits the target data. If the local cache hits the target data, it can directly retrieve the target data from the local cache, generate a feedback result based on the target data, and send the feedback result to the first client, which can then receive the feedback result returned by the second client. If the local cache does not hit the target data, an error code is generated and included in the feedback result, which is then sent to the first client, which can then receive the feedback result returned by the second client. Optionally, the second client can perform the query operation based on a key-value pair cache. Specifically, the second client's local cache can store data in key-value pair format, with each data item having a unique key. When a data access request is received, the target data's identification information can be used as the key. Then, the key-value pair corresponding to that key is directly searched in the local cache. If the corresponding key-value pair exists in the local cache, it means the target data is present in the local cache, and the local cache has hit the target data. If the corresponding key-value pair does not exist in the local cache, it means the target data is not present in the local cache, and the local cache has missed the target data. For example, in the client of an e-commerce application, product information is stored in the cache, with the product ID as the key and the product details as the value. When a user requests to view product information, the client extracts the product ID and looks up the corresponding product information in the local cache. Optionally, the second client can perform the query operation using an index structure. Specifically, the second client can create a hash index for the local cache data. When a data access request is received, the target data's identifier information is used to calculate a hash value using a hash function. Then, based on the hash value, the location in the hash index where the target data might be stored is located. Further search and comparison are performed at this location to determine if the target data exists. If the target data exists, it means the local cache has hit the target data; if the target data does not exist, it means the local cache has missed the target data.
[0107] The method described in this application embodiment allows the first client to determine whether the target data is in the local cache of other clients before directly retrieving it from the backend storage device when the target data is not found in the first client's local cache. This fully utilizes the caching resources of each node in the distributed system, significantly reducing the access pressure on the backend storage system, lowering data access latency, and thus improving data access efficiency. Furthermore, querying data storage information can quickly locate the client where the target data is located, avoiding network congestion caused by broadcast queries across the entire network, significantly reducing the time cost of data retrieval, thereby accelerating data access speed and improving the overall system response performance.
[0108] In some embodiments, the above data access method further includes:
[0109] Retrieve the target data and related data from the backend storage device, and load the target data and related data into the local cache.
[0110] The relevant data can be data that has a dependency relationship with the target data, or data that belongs to the same file as the target data.
[0111] In this embodiment of the application, if the target data is not found in the local cache of the second client, the second client can obtain the target data and related data from the backend storage device and load the target data and related data into the local cache.
[0112] The method described in this application, by loading the target data and related data into the local cache of the second client, allows the second client to quickly respond directly from the local cache when the first client requests the target data or its associated data again, without requiring the first client to access the backend storage device. Since the read / write speed of the local cache is much faster than the speed of retrieving data from the backend storage device, the above method can significantly shorten the data retrieval time, improve the system's response speed, and thus improve data access efficiency.
[0113] In some embodiments, such as Figure 6 As shown, a data access method is provided, which can be applied to... Figure 1 This explanation uses a backend server in a distributed system as an example, and includes the following steps:
[0114] S501: Construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in the distributed system.
[0115] S502, the mapping table is sent to the first client and the second client in the distributed system to instruct the first client and the second client to update the data storage information in their local storage according to the mapping table.
[0116] The data storage information includes the mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers.
[0117] In this embodiment, the backend server can divide the storage area of the storage system, map the data to the divided blocks, associate it with multiple backend storage devices, obtain the clients corresponding to the multiple backend storage devices, and finally associate the data with the client identifiers. This yields a mapping relationship between the data stored by multiple clients and the client identifiers, i.e., a mapping table. For example, data can be mapped to each client in a cache group using a consistent hashing method. After the backend server constructs the mapping table, it can send the mapping table to multiple clients in the distributed system, specifically a first client and a second client. Upon receiving the mapping table, the first and second clients can load it into their local caches as data storage information. The backend server also updates the mapping table in real time according to changes in the distributed system (e.g., adding or removing clients) and sends the latest mapping table to the first and second clients. Upon receiving the new mapping table, the first and second clients can update their data storage information accordingly. Specifically, they can update the data storage information based on the updated information in the new mapping table, or they can directly replace the original data storage information with the mapping table to obtain the latest data storage information. Furthermore, the dataset's data and metadata are mapped to various clients in the cache group using consistent hashing: if a client fails, the data and metadata mapped to that client node will be mapped to other clients, affecting only the mapping of that portion of data and metadata. In addition, consistent hashing also supports adding or removing client nodes within the cache group.
[0118] The method described in this application embodiment clearly records the mapping relationship between data stored by multiple clients in the distributed system and client identifiers in the mapping table. When specific data needs to be accessed, the system can directly and accurately find the client storing the data based on the mapping table, avoiding blind searching throughout the distributed system, greatly shortening the data location time, and thus improving data access efficiency. When a client joins or leaves the distributed system, the global mapping table is uniformly maintained and distributed by the backend server, ensuring the consistency and accuracy of data location information for each client.
[0119] In some embodiments, a distributed system is provided, comprising: multiple clients and a backend server; wherein any client is used to execute the above... Figures 2 to 5 Specifically, when the client acts as the first client, the steps of the data access method in any embodiment are executed as follows: Figures 2 to 4The steps of the data access method in any embodiment are specifically executed when the client acts as a second client. Figure 5 The steps of the data access method in this embodiment. The backend server is used to execute... Figure 6 The steps of the data access method are as follows. The data access method provided in the above embodiments is similar in implementation principle and technical effect to the above method embodiments, and will not be repeated here.
[0120] In summary, based on all the above embodiments, a data access method is also provided, such as... Figure 7 As shown, the method includes:
[0121] S601: The backend server constructs a mapping table based on the mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers, and sends the mapping table to the first client and the second client in the distributed system.
[0122] S602, the first client and the second client receive the mapping table sent by the backend server in the distributed system, and update the data storage information according to the mapping table.
[0123] S603, when the first client receives a data access request, it queries the target data requested by the data access request in the local cache of the first client. If the local cache does not find the target data, it determines the second client identifier corresponding to the target data according to the data storage information and sends a data acquisition request to the second client corresponding to the second client identifier.
[0124] S604, when the second client receives a data retrieval request sent by the first client, it queries the target data requested by the data retrieval request in the local cache of the second client.
[0125] S605, if the second client finds the target data in its local cache, it extracts the target data from the local cache, generates a feedback result based on the target data, and sends the feedback result to the first client.
[0126] S606 If the second client does not find the target data in its local cache, it generates an error code and sends it to the first client in the feedback result. It also retrieves the target data and related data from the backend storage device and loads the target data and related data into its local cache.
[0127] S607, the first client receives the feedback result returned by the second client. If the feedback result indicates that the target data is stored in the local cache on the second client, the target data is extracted from the feedback result. If the feedback result indicates that the target data is not stored in the local cache on the second client, the target data is obtained from the backend storage device of the second client.
[0128] In the embodiments of this application, such as Figure 8 As shown, consider caching a large dataset into multiple client nodes (i.e., the second client). The specific method is shown in the figure below: (1) Client nodes can build local caches based on SSDs and HDDs; (2) Users can execute commands to form a cache group of multiple client nodes through the backend server (the client nodes in the cache group have network access and can interact with cached data and metadata) to build a front-end cache using the local block devices of multiple clients; (3) Users can call the preheating command to preheat the dataset into the cache group. The data and metadata are distributed to the client nodes in the cache group in a consistent hashing manner. Figure 8 (4) The main IO process is as follows: ① When the user process accesses data (or metadata), it first accesses the local cache (arrows 2 and 3 in the figure); ② If the local cache is not hit, a request is sent to the target node (second client) of the data (or metadata) (arrow 4 in the figure); ③ The target node accesses the local cache. If it hits, it returns the relevant content. Otherwise, it returns the error code of the missing data and actively loads the file corresponding to the current data (or metadata) (arrows 5 and 7 in the figure); ④ If the local cache of the target node is hit, the user operation ends. Otherwise, the original client obtains the required data (or metadata) from the backend storage (arrow 6).
[0129] The dataset's data and metadata are mapped to various clients in the cache group using consistent hashing. If a client fails, the data and metadata mapped to that client node will be mapped to other clients, affecting only the mapping of that specific data and metadata. Furthermore, consistent hashing also supports adding or removing client nodes within the cache group. Figure 9 As shown, when node 2 fails: the consistent hashing mechanism maps the data and metadata that were originally mapped to node 2 to node 3, while the mapping of data and metadata in other parts of the dataset remains unchanged.
[0130] The method described in this application utilizes multiple compute nodes equipped with smaller SSD devices to cache a large dataset. When the total space across multiple clients is sufficient, business access to the dataset can achieve 100% cache hit rate. Compared to directly accessing backend storage, the client achieves higher IOPS; and during business execution, the backend storage experiences no business pressure, avoiding interference between different business processes. This shared cache resides in a unified namespace with the backend storage and is transparent to user businesses, who can still access this shared cache using the standard POSIX interface.
[0131] A shared cache is built using the local block devices of multiple clients in a distributed file system (DFS) to fully cache large datasets within the clients. Multiple client nodes form a cache group, with network connections established between nodes within the group for data and metadata exchange. This shared cache, built based on multiple clients, resides in the same namespace as the backend storage, allowing user applications to utilize it without modification. A preheating command is provided: a dataset can be preheated to the client nodes of the cache group, and the dataset's data and metadata are distributed to the local caches of each client according to rules. When an application accesses data (or metadata), if it doesn't find it in the local cache of its current node, a consistent hashing algorithm can be used to determine the target node for the data. The application then attempts to retrieve the data (or metadata) from the target node's local cache. If the target node's local cache also doesn't find the data, the client can actively perform a loading operation. Thanks to consistent hashing, if the target client node for a particular data (or metadata) fails or performs add / delete maintenance operations, the target node will automatically switch to another node, without affecting access to the data (or metadata).
[0132] The methods described in each of the above steps have been described in the foregoing embodiments. For details, please refer to the foregoing descriptions. They will not be repeated here.
[0133] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0134] Based on the same inventive concept, this application also provides a data access device for implementing the data access method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more data access device embodiments provided below can be found in the limitations of the data access method described above, and will not be repeated here.
[0135] In some embodiments, such as Figure 10 As shown, a data access device is provided, comprising:
[0136] The first query module 11 is used to query the target data requested by the data access request in the local cache of the first client when a data access request is received.
[0137] The acquisition module 12 is used to obtain the target data by querying the data storage information if the local cache does not find the target data; the data storage information includes the mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers.
[0138] In some embodiments, the above-mentioned acquisition module includes:
[0139] The determining unit is used to determine the second client identifier corresponding to the target data based on the mapping relationship between the data stored by multiple clients and multiple client identifiers.
[0140] The receiving unit is used to send a data acquisition request to the second client corresponding to the second client identifier, receive the feedback result returned by the second client, and acquire the target data based on the feedback result.
[0141] In some embodiments, the receiving unit includes:
[0142] Extraction sub-units are used to extract target data from feedback results if the feedback result indicates that the target data is stored in the local cache on the second client.
[0143] The sub-unit is used to retrieve the target data from the backend storage device of the second client if the feedback result indicates that the target data is not stored in the local cache on the second client.
[0144] In some embodiments, the data access device described above is further configured to receive a mapping table sent by a backend server in a distributed system, and update data storage information according to the mapping table; the mapping table includes a mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers.
[0145] In some embodiments, such as Figure 11 As shown, a data access device is provided, comprising:
[0146] The second query module 21 is used to query the target data requested by the data retrieval request in the local cache of the second client when it receives a data retrieval request sent by the first client in the distributed system.
[0147] Return module 22 is used to extract the target data from the local cache if the target data is hit in the local cache, generate a feedback result based on the target data, and send the feedback result to the first client.
[0148] In some embodiments, the data access device described above is further configured to generate an error code and send it to the first client in the feedback result if the local cache does not hit the target data, so as to instruct the first client to retrieve the target data from the backend storage device of the second client.
[0149] In some embodiments, the data access device described above is further configured to obtain target data and related data of the target data from a backend storage device, and load the target data and related data into a local cache.
[0150] In some embodiments, such as Figure 12 As shown, a data access device is provided, comprising:
[0151] Module 31 is used to construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in the distributed system.
[0152] The sending module 32 is used to send the mapping table to the first client and the second client in the distributed system, so as to instruct the first client and the second client to update the data storage information in their local storage according to the mapping table.
[0153] Each module in the aforementioned data access device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0154] In some embodiments, a computer device is provided, which may be a terminal or a server, and its internal structure diagram may be as follows. Figure 13As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data access method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0155] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0156] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0157] Upon receiving a data access request, the target data requested by the data access request is retrieved from the local cache of the first client;
[0158] If the local cache does not find the target data, the target data is obtained by querying the data storage information; the data storage information includes the mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers.
[0159] In some embodiments, when a processor executes a computer program, it further performs the following steps:
[0160] Based on the mapping relationship between data stored by multiple clients and multiple client identifiers, determine the second client identifier corresponding to the target data;
[0161] Send a data acquisition request to the second client corresponding to the second client identifier, receive the feedback result returned by the second client, and acquire the target data based on the feedback result.
[0162] In some embodiments, when a processor executes a computer program, it further performs the following steps:
[0163] If the feedback indicates that the target data is stored in the local cache on the second client, then extract the target data from the feedback result;
[0164] If the feedback indicates that the target data is not stored in the local cache on the second client, then the target data is retrieved from the backend storage device of the second client.
[0165] In some embodiments, when a processor executes a computer program, it further performs the following steps:
[0166] It receives the mapping table sent by the backend server in the distributed system and updates the data storage information according to the mapping table; the mapping table includes the mapping relationship between the data stored by multiple clients in the distributed system and multiple client identifiers.
[0167] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0168] When a data retrieval request is received from the first client in the distributed system, the second client queries the local cache for the target data requested in the data retrieval request.
[0169] If the target data is found in the local cache, the target data is retrieved from the local cache, a feedback result is generated based on the target data, and the feedback result is sent to the first client.
[0170] In some embodiments, when a processor executes a computer program, it further performs the following steps:
[0171] If the local cache does not find the target data, an error code is generated and sent to the first client in the feedback result, instructing the first client to retrieve the target data from the backend storage device of the second client.
[0172] In some embodiments, when a processor executes a computer program, it further performs the following steps:
[0173] Retrieve the target data and related data from the backend storage device, and load the target data and related data into the local cache.
[0174] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0175] Construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in a distributed system;
[0176] The mapping table is sent to the first and second clients in the distributed system to instruct them to update the data storage information in their local storage according to the mapping table.
[0177] The computer device provided in the above embodiments has a similar implementation principle and technical effect to the above method embodiments, and will not be described again here.
[0178] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0179] Upon receiving a data access request, the target data requested by the data access request is retrieved from the local cache of the first client;
[0180] If the local cache does not find the target data, the target data is obtained by querying the data storage information; the data storage information includes the mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers.
[0181] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0182] Based on the mapping relationship between data stored by multiple clients and multiple client identifiers, determine the second client identifier corresponding to the target data;
[0183] Send a data acquisition request to the second client corresponding to the second client identifier, receive the feedback result returned by the second client, and acquire the target data based on the feedback result.
[0184] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0185] If the feedback indicates that the target data is stored in the local cache on the second client, then extract the target data from the feedback result;
[0186] If the feedback indicates that the target data is not stored in the local cache on the second client, then the target data is retrieved from the backend storage device of the second client.
[0187] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0188] It receives the mapping table sent by the backend server in the distributed system and updates the data storage information according to the mapping table; the mapping table includes the mapping relationship between the data stored by multiple clients in the distributed system and multiple client identifiers.
[0189] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0190] When a data retrieval request is received from the first client in the distributed system, the second client queries the local cache for the target data requested in the data retrieval request.
[0191] If the target data is found in the local cache, the target data is retrieved from the local cache, a feedback result is generated based on the target data, and the feedback result is sent to the first client.
[0192] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0193] If the local cache does not find the target data, an error code is generated and sent to the first client in the feedback result, instructing the first client to retrieve the target data from the backend storage device of the second client.
[0194] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0195] Retrieve the target data and related data from the backend storage device, and load the target data and related data into the local cache.
[0196] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0197] Construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in a distributed system;
[0198] The mapping table is sent to the first and second clients in the distributed system to instruct them to update the data storage information in their local storage according to the mapping table.
[0199] The computer-readable storage medium provided in the above embodiments has a similar implementation principle and technical effect to the above method embodiments, and will not be described again here.
[0200] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0201] Upon receiving a data access request, the target data requested by the data access request is retrieved from the local cache of the first client;
[0202] If the local cache does not find the target data, the target data is obtained by querying the data storage information; the data storage information includes the mapping relationship between the data stored by multiple clients in the distributed system and the multiple client identifiers.
[0203] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0204] Based on the mapping relationship between data stored by multiple clients and multiple client identifiers, determine the second client identifier corresponding to the target data;
[0205] Send a data acquisition request to the second client corresponding to the second client identifier, receive the feedback result returned by the second client, and acquire the target data based on the feedback result.
[0206] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0207] If the feedback indicates that the target data is stored in the local cache on the second client, then extract the target data from the feedback result;
[0208] If the feedback indicates that the target data is not stored in the local cache on the second client, then the target data is retrieved from the backend storage device of the second client.
[0209] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0210] It receives the mapping table sent by the backend server in the distributed system and updates the data storage information according to the mapping table; the mapping table includes the mapping relationship between the data stored by multiple clients in the distributed system and multiple client identifiers.
[0211] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0212] When a data retrieval request is received from the first client in the distributed system, the second client queries the local cache for the target data requested in the data retrieval request.
[0213] If the target data is found in the local cache, the target data is retrieved from the local cache, a feedback result is generated based on the target data, and the feedback result is sent to the first client.
[0214] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0215] If the local cache does not find the target data, an error code is generated and sent to the first client in the feedback result, instructing the first client to retrieve the target data from the backend storage device of the second client.
[0216] In some embodiments, when a computer program is executed by a processor, it further performs the following steps:
[0217] Retrieve the target data and related data from the backend storage device, and load the target data and related data into the local cache.
[0218] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0219] Construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in a distributed system;
[0220] The mapping table is sent to the first and second clients in the distributed system to instruct them to update the data storage information in their local storage according to the mapping table.
[0221] The computer program product provided in the above embodiments has a similar implementation principle and technical effect to the above method embodiments, and will not be described again here.
[0222] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0223] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0224] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data access method, characterized in that, The method, applied to the first client in a distributed system, includes: Upon receiving a data access request, the target data requested by the data access request is queried from the local cache of the first client; If the local cache does not find the target data, the target data is obtained by querying the data storage information; the data storage information includes the mapping relationship between the data stored by multiple clients in the distributed system and multiple client identifiers.
2. The method according to claim 1, characterized in that, The step of obtaining the target data by querying data storage information includes: Based on the mapping relationship between data stored by multiple clients and multiple client identifiers, the second client identifier corresponding to the target data is determined; Send a data acquisition request to the second client corresponding to the second client identifier, receive the feedback result returned by the second client, and acquire the target data based on the feedback result.
3. The method according to claim 2, characterized in that, The step of obtaining the target data based on the feedback result includes: If the feedback result indicates that the target data is stored in the local cache on the second client, then the target data is extracted from the feedback result; If the feedback result indicates that the target data is not stored in the local cache on the second client, then the target data is retrieved from the backend storage device of the second client.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: The system receives a mapping table sent by a backend server in the distributed system and updates the data storage information according to the mapping table; the mapping table includes the mapping relationship between data stored by multiple clients and multiple client identifiers in the distributed system.
5. A data access method, characterized in that, The method, applied to a second client in a distributed system, includes: Upon receiving a data retrieval request from the first client in the distributed system, the second client queries the local cache for the target data requested in the data retrieval request. If the local cache hits the target data, the target data is extracted from the local cache, a feedback result is generated based on the target data, and the feedback result is sent to the first client.
6. The method according to claim 5, characterized in that, The method further includes: If the local cache does not find the target data, an error code is generated and sent to the first client along with the feedback result, instructing the first client to retrieve the target data from the backend storage device of the second client.
7. The method according to claim 6, characterized in that, The method further includes: The target data and related data are obtained from the backend storage device, and the target data and related data are loaded into the local cache.
8. A data access method, characterized in that, The method, applied to a backend server in a distributed system, includes: Based on the mapping relationship between the data stored by multiple clients and the multiple client identifiers in the distributed system, a mapping table is constructed; The mapping table is sent to the first client and the second client in the distributed system to instruct the first client and the second client to update the data storage information in their local storage according to the mapping table.
9. A distributed system, characterized in that, The distributed system includes: multiple clients and backend servers; Any of the aforementioned clients is configured to execute the data access method as described in any one of claims 1-7; The backend server is used to execute the data access method as described in claim 8.
10. A data access device, characterized in that, The device includes: The first query module is used to query the target data requested by the data access request in the local cache of the first client when a data access request is received. The acquisition module is used to acquire the target data by querying data storage information if the local cache does not find the target data; the data storage information includes the mapping relationship between data stored by multiple clients in the distributed system and multiple client identifiers.
11. A data access device, characterized in that, The device includes: The second query module is used to query the target data requested by the data acquisition request in the local cache of the second client when a data acquisition request is received from the first client in the distributed system. The return module is configured to, if the local cache hits the target data, extract the target data from the local cache, generate a feedback result based on the target data, and send the feedback result to the first client shown.
12. A data access device, characterized in that, The device includes: The building module is used to construct a mapping table based on the mapping relationship between data stored by multiple clients and multiple client identifiers in a distributed system; The sending module is used to send the mapping table to a first client and a second client in the distributed system, so as to instruct the first client and the second client to update the data storage information stored locally according to the mapping table.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.