Object processing method, object processing client, and object processing system
By caching the write record information of the target object on the client side, the problem of multiple network communications on the client side is solved, resulting in faster data access and reduced network communication costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-05-12
- Publication Date
- 2026-06-12
AI Technical Summary
In existing technologies, clients need to make multiple network communications when reading data from distributed data structures, which increases network communication costs.
Write record information of the target object is cached on the client side. The target data storage node is found and the data is read through the local cache, reducing network communication.
By caching target data locally on the client side, network communication overhead is reduced, data access speed is improved, and network communication costs are lowered.
Smart Images

Figure CN115168412B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to an object processing method. One or more embodiments of this specification also relate to an object processing client, an object processing system, a computing device, and a computer-readable storage medium. Background Technology
[0002] With the continuous development of computer and network technologies, the demand for online data processing and storage is increasing day by day, and distributed data structures have emerged accordingly. When reading data in a distributed data structure, it is often necessary to first use the distributed data structure index to determine the storage node of the data, and then read the required data from the storage node.
[0003] In existing technologies, servers store distributed data structure indexes. If a client wants to read data, it first needs to find the storage address of the data in the server's distributed data structure index, and then retrieve the specific data based on that address. However, this process requires the client to perform multiple network communications with the server to query the index and read the data, resulting in multiple network communication overheads and increased network communication costs. Summary of the Invention
[0004] In view of this, embodiments of this specification provide an object processing method. One or more embodiments of this specification also relate to an object processing client, an object processing system, a computing device, and a computer-readable storage medium, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, an object processing method is provided, applied to a client, comprising:
[0006] Detect object processing requests targeting a target object on the server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information;
[0007] When the request type is a read request, the corresponding target data storage node is found in the local cache based on the data identification information. The local cache is updated based on the write record information of the target client to the target object in the server.
[0008] If the target data storage node is located, the target data corresponding to the object processing request is read from the target data storage node.
[0009] Optionally, after determining the request type corresponding to the object's processing request, the method further includes:
[0010] When the request type is a write request, the object processing request is sent to the server;
[0011] Upon receiving a write completion message from the server, the corresponding write record information is generated based on the object processing request.
[0012] Write log information is written to the server's shared log area, which is used by various clients to obtain the current write log information.
[0013] Optionally, the data identification information includes the write level;
[0014] Before generating the corresponding write record information based on the object processing request, the process also includes:
[0015] Determine if the write level is greater than the preset level threshold. If it is, execute the operation steps of generating the corresponding write record information based on the object processing request.
[0016] Optionally, based on the object processing request, corresponding write record information is generated, including:
[0017] Determine the write type, the data to be written, and the corresponding write level of the object processing request;
[0018] Write record information is generated based on the write type, the data to be written, and the corresponding write level.
[0019] Optionally, before determining whether the write level is greater than a preset level threshold, the method further includes:
[0020] Determine the attribute parameters of the target object in the server;
[0021] Set the corresponding preset level threshold based on the attribute parameters.
[0022] Optionally, before detecting object processing requests for a target object on the server and determining the request type corresponding to the object processing request, the method further includes:
[0023] Retrieve the current write log information from the shared log area;
[0024] Update the data thumbnails stored in the local cache based on the write log information.
[0025] Optionally, based on the write record information, the data thumbnail stored in the local cache is updated, including:
[0026] The write record information is parsed to obtain the write type, the data to be written, and the corresponding write level;
[0027] Based on the write type and write level, determine the data to be modified in the data thumbnail;
[0028] Use the data to be written to update the data to be modified.
[0029] Optionally, after finding the corresponding target data storage node from the local cache based on the data identification information, the process further includes:
[0030] If the corresponding target data storage node is not found, identify other clients that are on the same machine as the client.
[0031] Search for the target data storage node corresponding to the data identification information in the local cache of other clients;
[0032] If found, the target data corresponding to the object processing request is retrieved from the target data storage node.
[0033] Optionally, after retrieving the target data storage node corresponding to the data identifier information from the local cache of other clients, the process further includes:
[0034] If the target data storage node corresponding to the data identifier information is not found in the local cache of other clients, the target data storage node is searched from the target object on the server, and the target data corresponding to the object processing request is obtained from the target data storage node.
[0035] According to a second aspect of the embodiments of this specification, an object processing apparatus is provided, comprising:
[0036] The determination module is configured to detect object processing requests for target objects in the server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information;
[0037] The lookup module is configured to, when the request type is a read request, look up the corresponding target data storage node from the local cache based on the data identification information. The local cache is updated based on the write record information of the target client to the target object in the server.
[0038] The read module is configured to read the target data corresponding to the object processing request from the target data storage node when the target data storage node is found.
[0039] According to a third aspect of the embodiments of this specification, an object processing system is provided, including a first client, a second client, and a server;
[0040] The first client is configured to detect object processing requests for a target object on the server, determine the request type corresponding to the object processing request, send the object processing request to the server if the request type is a write request, generate corresponding write log information based on the object processing request, and write the write log information to the server's shared log area.
[0041] The second client is configured to obtain current write record information from the shared log area, update the data thumbnails stored in the local cache based on the write record information, detect object processing requests for target objects on the server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information; if the request type is a read request type, search for the corresponding target data storage node in the local cache based on the data identification information, and if the target data storage node is found, read the target data corresponding to the object processing request from the target data storage node.
[0042] According to a fourth aspect of the embodiments of this specification, a computing device is provided, comprising:
[0043] Memory and processor;
[0044] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the operation steps of the above object processing method.
[0045] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of any object processing method.
[0046] One embodiment of this specification provides an object processing method. A client can detect object processing requests for a target object on a server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information; if the request type is a read request, the client searches for the corresponding target data storage node in the local cache based on the data identification information, wherein the local cache is updated based on the write record information of the target client to the target object on the server; if the target data storage node is found, the target data corresponding to the object processing request is read from the target data storage node.
[0047] In this scenario, the client's local cache can be updated based on the target client's write records of the target object on the server. That is, the client's local cache can store the relevant write data for the target object. When the client needs to read data, it can first look up the corresponding target data storage node in its local cache. If the corresponding target data storage node is found, the required data can be read directly from that node. Thus, by caching the relevant write data of the target object in the client's local cache, the access speed to the target object can be accelerated. When the data to be read is in the client's local cache, the previous cross-network data read operation is transformed into a read operation from the local cache, saving network communication overhead and reducing network communication costs. Attached Figure Description
[0048] Figure 1 This is a flowchart of an object processing method provided in one embodiment of this specification;
[0049] Figure 2 This is a flowchart of another object processing method provided in one embodiment of this specification;
[0050] Figure 3a This is a schematic diagram of the interaction process of an object processing method provided in one embodiment of this specification;
[0051] Figure 3b This is a screenshot illustrating the effect of client-side local caching as provided in one embodiment of this specification.
[0052] Figure 4 This is a schematic diagram of the structure of an object processing client provided in one embodiment of this specification;
[0053] Figure 5 This is a schematic diagram of the structure of an object processing system provided in one embodiment of this specification;
[0054] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0055] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0056] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0057] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0058] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0059] RDMA (Remote Direct Memory Access): It was developed to solve the latency of server-side data processing in network transmission. It directly transfers data to the computer's storage area over the network, quickly moving data from one system to a remote system's memory without affecting the operating system. This reduces the need for much of the computer's processing power, eliminates the overhead of external memory copying and context switching, and thus frees up memory bandwidth and CPU cycles to improve application system performance.
[0060] RNIC: A network interface card that supports RDMA.
[0061] Snooping-like protocol: a type of snooping protocol.
[0062] Directory-based protocol: based on directory protocols.
[0063] SkipList: Skip List. SkipList is a sorted data structure that supports O(1) methods such as Insert, Contain, and Remove. These operations on SkipList can be performed in O(logN) time (assuming there are N nodes in the SkipList). From another perspective, SkipList consists of a hierarchical structure of linked lists, behaving similarly to a probabilistic data structure. Each node is created at a random level and exists in all levels up to its highest level. The length of each linked list can be reduced from the bottom to the top with probability p (e.g., 0.5). A key characteristic of SkipList is that higher-level lists are always contained within lower-level lists. Another core feature is that each node in a SkipList is adjacent to its predecessor and successor nodes at the data structure level, but the current node and its predecessor / successor nodes are usually not in the same memory region, so traversing the nodes in the skip list always results in costly random memory accesses.
[0064] It's important to note that in RDMA-based data structures, maintaining data structure cache consistency incurs significant overhead, while operating without a cache is inefficient for unidirectional data structure operations. Tree-like data structures (e.g., binary search trees, SkipLists) always have a hierarchical structure, indicating that higher-level data structure nodes are accessed more frequently than lower-level nodes. Typically, assuming a data structure has L levels, caching can be used on the client side to cache higher-level data to accelerate data structure operation. Furthermore, when multiple clients access the data structure simultaneously, and each client caches a portion of the data structure, cache consistency issues arise. To ensure data consistency in the cache, current work typically uses synchronization primitives to propagate dirty writes and clear cache reads. This method incurs additional overhead when synchronizing data. For unidirectional operations, the original log(n)+1 (log(n) round trips for indexing and one round trip for reading data) becomes log(n)+1-LN after applying caching. On the other hand, each client only needs to cache nodes, which is the original data structure. Therefore, client caching is a powerful tool for reducing network round trips, and caching some data appropriately can improve performance as much as possible.
[0065] Currently, common snooping-like protocols support cache consistency but exhibit poor scalability, while directory-based protocols suffer from high latency. To maintain cache consistency, two commonly used mechanisms exist: "snooping" and "directory-based." In snooping-like protocols, each modification should be broadcast by the server to all clients. Simultaneously, clients update their caches to the new state. The drawback is obvious: communication overhead increases linearly with the number of clients, resulting in poor scalability. As for directory-based protocols, they exhibit even higher latency than snooping-like protocols during execution. This is because, for each access, the client requires at least three network round trips to retrieve new data from the server. Therefore, snooping-like protocols are understood as push-based protocols, while directory-based protocols are understood as pull-based protocols. The embodiments in this specification assume a relatively small number of clients and that network round trips are still costly compared to local access.
[0066] Therefore, in order to reduce the overhead of multiple network communications caused by distributed data structure indexing, the embodiments of this specification cache specific data structure nodes on the client side to accelerate traversal, and propose a pull-based cache consistency protocol. Multiple clients on the same machine can share the cache to reduce synchronization overhead, thus providing consistency for RDMA read operations.
[0067] This specification provides an object processing method, and also relates to an object processing client, an object processing system, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0068] Figure 1 A flowchart of an object processing method provided according to an embodiment of this specification is shown, applied to a client, including steps 102 to 106.
[0069] Step 102: Detect object processing requests for the target object in the server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information.
[0070] Specifically, a target object can be understood as an object capable of storing data. This target object can be a distributed data structure index, based on which the storage node of the required data can be found, and then the required data can be read. For example, the target object can be a binary search tree, skip list, linked list, two-dimensional table, etc., in the server's memory.
[0071] Furthermore, the object processing request can be understood as a request that can process the target object; if the target object is a skip list, the object processing request can be understood as a read request that performs read operations on the skip list (e.g., Find, Contain methods); or, the object processing request can be understood as a write request that performs write operations on the skip list (e.g., Insert, Update, Remove methods). Correspondingly, the request type can be understood as the type of the request, for example, the request is a read request type or a write request type.
[0072] Secondly, data identification information can identify the data that needs to be processed. Based on the data identification information, the storage node of the target data to be read can be located, so as to read the corresponding target data. When the target data is data stored in a node of a skip list, the data identification information can be understood as an identifier that uniquely represents the target data. For example, when the target data is data stored in a node of a skip list in the form of key-value pairs, the data identification information can be understood as the key corresponding to the data. Alternatively, the data identification information can also be information that identifies the level of the data to be processed, such as level L, level N, etc.
[0073] It should be noted that the object processing method provided in the embodiments of this specification can perform read or write operations based on RDMA. Therefore, the object processing method provided in the embodiments of this specification can be applied to the network communication module of the client. Based on this, the client can directly send object processing requests to the network communication module in the server through its own configured network communication module, so that the server can process the object processing requests accordingly. Therefore, when the client detects an object processing request for a target object in the server, it can determine the request type corresponding to the object processing request, and thus determine the corresponding processing operation.
[0074] In an optional implementation of this embodiment, if the object processing request detected by the client is a write request type, the object processing request can be sent to the server to perform a write modification operation on the target object in the server. In this case, the write modification operation performed by the client can also be additionally recorded for synchronization by other clients. That is, after determining the request type corresponding to the object processing request, the following can also be included:
[0075] When the request type is a write request, the object processing request is sent to the server;
[0076] Upon receiving a write completion message from the server, the corresponding write record information is generated based on the object processing request.
[0077] Write log information is written to the server's shared log area, which is used by various clients to obtain the current write log information.
[0078] It's important to note that when the object processing request type is a write request, it indicates that a modification operation is to be performed on the target object stored on the server. In this case, the client can send the object processing request to the server. After receiving the request, the server can modify the corresponding data in the target object based on the request and return a write completion message to the client. This message indicates that the server has completed the write operation. When the client receives the write completion message from the server, it means the write operation is finished. At this point, the client can generate corresponding write log information based on the object processing request and write this information to the server's shared log area. This avoids the server's involvement in updating and maintaining the shared log area, reducing server processing load. In this way, the server's shared log area can record relevant information about the client's write operations. Subsequently, each client (including the client that performed the write operation) can read the write log information from this shared log to update its local cache, thereby ensuring cache consistency across all clients.
[0079] In one optional implementation of this embodiment, the write record information can be a tuple structure, that is, the corresponding write record information is generated according to the object processing request. The specific implementation process can be as follows:
[0080] Determine the write type, the data to be written, and the corresponding write level of the object processing request;
[0081] Write record information is generated based on the write type, the data to be written, and the corresponding write level.
[0082] Specifically, write type refers to the type of operation that the object processing request targets for the target object, such as inserting a node or deleting a node. Data to be accessed refers to the specific data to be written to the corresponding node. Write level refers to the level of the write operation in the target object.
[0083] It's important to note that the target object can be a binary tree or a skip list structure. Therefore, different data within the target object reside at different levels, and searches are typically performed by traversing from the highest to the lowest level. Thus, the write type of the request, the data to be written, and the corresponding write level can be determined. Then, write record information is generated based on the write type, the data to be written, and the corresponding write level. In this way, the generated write record information can record the write type, the data to be written, and the corresponding write level of the write operation, allowing for synchronization across clients and maintaining cache consistency.
[0084] For example, each write record can be organized into a tuple, in the format {write type, data to be written, write level}, such as a write record like {Insert, data, L}, where Insert indicates that the write type is inserting data, the data field is the number of data structures to be inserted, and L is the write level to be inserted on the server side.
[0085] In an optional implementation of this embodiment, information on write operations with a write level greater than a preset threshold may only be recorded in the server's shared log area. That is, the client's local cache only caches information on write operations with a write level greater than the preset threshold. Therefore, the data identification information includes the write level. Before generating the corresponding write record information based on the object processing request, it may also include:
[0086] Determine if the write level is greater than the preset level threshold. If it is, execute the operation steps of generating the corresponding write record information based on the object processing request.
[0087] Specifically, object processing requests can carry the write level of the data to be modified. In practical applications, once it is determined that the object processing request is a write request type, it means that the data of the target object on the server needs to be modified. At this point, it can be further determined whether the write level carried in the object processing request is greater than a preset level threshold. If it is greater than the preset level threshold, the corresponding write record information is generated according to the object processing request, and the write record information is written to the server's shared log area so that each client can update its local cache.
[0088] It's important to note that the target object is typically a tree-like data structure, such as a binary search tree or a SkipList, which always has a hierarchical structure. This indicates that higher-level data structure nodes are accessed more frequently than lower-level data structure nodes. Generally, assuming the target object's data structure has L levels, caching can be used on the client side to cache higher-level data in order to accelerate the operation of the data structure.
[0089] Additionally, the client caches data locally to buffer higher-level data that are above a preset level threshold. These levels are organized as “thumbs up”, which are subsets of the original data structure (i.e., the target object).
[0090] In this embodiment of the specification, to reduce the overhead of synchronizing data modifications—specifically, the overhead of synchronizing write record information from the server's shared log area using local caching—it is unnecessary to record the write record information of each write operation in the server's shared log area. Therefore, this embodiment provides a pull-based synchronization primitive. The client can append the write record information of each write operation with a level greater than a preset threshold to the server's shared log area. This process is performed after each write operation, and the client performing the write operation flushes the information to the server's shared log area via RDMA write operations.
[0091] Furthermore, because the write log information includes the write hierarchy in its parameters, it ensures a deterministic ordering of write operations at a high level. Since the write log information only includes write operations, which constitute a small fraction of the total operations, the overhead of recording is tolerable.
[0092] In an optional implementation of this embodiment, the preset level threshold can be customized. That is, before determining whether the write level is greater than the preset level threshold, the following steps may be included:
[0093] Determine the attribute parameters of the target object in the server;
[0094] Set the corresponding preset level threshold based on the attribute parameters.
[0095] It should be noted that the preset level threshold is an adjustable parameter. The attribute parameters of the target object can include its size and type. Different preset level thresholds can be set for target objects of different sizes and types. Therefore, the corresponding preset level threshold can be set according to the attribute parameters of the target object in the server. This allows the client's local cache to cache write record information at different levels for target objects of different sizes and types, improving the flexibility of the local cache. Specifically, when setting the corresponding preset level threshold according to the attribute parameters, different preset level thresholds can be set for different attribute parameters. The specific value of the preset level threshold can be randomly generated, such as by generating it using a 1 / 2 ratio, i.e., preset level threshold N = pow(1 / 2, i), where pow is a power function in programming languages that returns 1 / 2 raised to the power of i, and i can represent the total number of levels of the target object.
[0096] In an optional implementation of this embodiment, before detecting object processing requests, the client may first synchronize the current write record information from the server's shared log area. That is, before detecting object processing requests for target objects on the server and determining the request type corresponding to the object processing request, the following may also be included:
[0097] Retrieve the current write log information from the shared log area;
[0098] Update the data thumbnails stored in the local cache based on the write log information.
[0099] It should be noted that when each client performs a write operation on the target object, it can append write record information of the write operation to the server's shared log area. Therefore, each client can periodically obtain the current write record information from the shared log area, and then update the data thumbnail stored in the local cache based on the write record information to ensure the consistency of the local cache of each client when processing object processing requests.
[0100] In one optional implementation of this embodiment, the data thumbnails stored in the local cache are updated based on the write record information, specifically including the following steps:
[0101] The write record information is parsed to obtain the write type, the data to be written, and the corresponding write level;
[0102] Based on the write type and write level, determine the data to be modified in the data thumbnail;
[0103] Use the data to be written to update the data to be modified.
[0104] It should be noted that the client updates its local cache by reading the current write record information from the server's shared log area via RDMA read operations, without the server's awareness. After obtaining the write record information, the client first parses the write type, the data to be written, and the corresponding write level. Then, it updates the data to be modified in the local cache data structure according to the write type and write level. The entire process is the same as on the server. In this way, each read operation of each client will always obtain a consistent view of the data structure, i.e., the local cache. Overall, the embodiments in this specification provide consistency for the local caches of each client.
[0105] Step 104: If the request type is a read request, find the corresponding target data storage node in the local cache according to the data identification information. The local cache is updated based on the write record information of the target client to the target object in the server.
[0106] It should be noted that the target client refers to the client that has performed a write operation on the target object on the server. The client that receives the object processing request of the read request type can be the same client as the client that performed the write operation, that is, the client that receives the object processing request of the read request type is also the target client; or, the client that receives the object processing request of the read request type can be a different client than the client that performed the write operation, that is, the client that receives the object processing request of the read request type obtains the write record information of other clients from the server's shared log area to ensure cache consistency, and then first looks up the corresponding target data storage node based on the local cache.
[0107] In this embodiment, the client's local cache can be updated based on the target client's write records of the target object on the server. That is, the client's local cache can cache the relevant write data of the target object. When the client needs to read data, it can first search for the corresponding target data storage node in its local cache. If the corresponding target data storage node is found, the required data can be read directly from the found target data storage node. Thus, by caching the relevant write data of the target object in the client's local cache, the access speed of the target object can be accelerated. When the data to be read is in the client's local cache, the previous cross-network data read operation is transformed into a read operation from the local cache, saving network communication overhead and reducing network communication costs.
[0108] Step 106: If the target data storage node is found, read the target data corresponding to the object processing request from the target data storage node.
[0109] It should be noted that when the target data storage node is found in the client's local cache, the target data corresponding to the object processing request can be read directly from the target data storage node. The previous cross-network data read operation is transformed into a read operation from the local cache, saving network communication overhead and reducing network communication costs.
[0110] In one optional implementation of this embodiment, different clients on the same machine can share the local cache. That is, after finding the corresponding target data storage node from the local cache based on the data identification information, the process may further include:
[0111] If the corresponding target data storage node is not found, identify other clients that are on the same machine as the client.
[0112] Search for the target data storage node corresponding to the data identification information in the local cache of other clients;
[0113] If found, the target data corresponding to the object processing request is retrieved from the target data storage node.
[0114] It's important to note that different clients on the same machine can share a local cache. With a shared local cache, each client can store only a portion of the data in the shared log area. Furthermore, for each data update in the shared log area, multiple clients only need to update their cache once, reducing the overhead of maintaining cache consistency. When a client initiates a read-type object processing request, it can not only check its own local cache for the corresponding target data storage node, but also, if not found in its own local cache, check the local caches of other clients on the same machine. If found, it can directly retrieve the target data corresponding to the object processing request from the target data storage node. In this way, the previous cross-network data read operation is transformed into a read-from-local-cache operation, saving network communication overhead and reducing network communication costs.
[0115] In the embodiments of this specification, if the corresponding target data storage node is not found in the client's local cache, it can then be searched from the target object on the server, that is, after searching for the target data storage node corresponding to the data identification information in the local cache of other clients, it may further include:
[0116] If the target data storage node corresponding to the data identifier information is not found in the local cache of other clients, the target data storage node is searched from the target object on the server, and the target data corresponding to the object processing request is obtained from the target data storage node.
[0117] It should be noted that for each read-type object processing request on the client, the target data storage node is first located by accessing the write record information in the client's local cache. When the level of the data to be read is greater than the predicted level threshold, the target data storage node cannot be located through the client's local cache. In this case, the data can be read directly from the target object on the server via RDMA to locate the target data storage node.
[0118] One embodiment of this specification provides an object processing method. A client can detect object processing requests for a target object on a server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information; if the request type is a read request, the client searches for the corresponding target data storage node in the local cache based on the data identification information, wherein the local cache is updated based on the write record information of the target client to the target object on the server; if the target data storage node is found, the target data corresponding to the object processing request is read from the target data storage node.
[0119] In this scenario, the client's local cache can be updated based on the target client's write records of the target object on the server. That is, the client's local cache can store the relevant write data for the target object. When the client needs to read data, it can first look up the corresponding target data storage node in its local cache. If the corresponding target data storage node is found, the required data can be read directly from that node. Thus, by caching the relevant write data of the target object in the client's local cache, the access speed to the target object can be accelerated. When the data to be read is in the client's local cache, the previous cross-network data read operation is transformed into a read operation from the local cache, saving network communication overhead and reducing network communication costs.
[0120] Figure 2 A flowchart of another object processing method provided in one embodiment of this specification is shown, which specifically includes the following steps:
[0121] Step 202: The first client detects the object processing request for the target object in the server, determines the request type corresponding to the object processing request, wherein the object processing request carries data identification information.
[0122] Step 204: When the request type is a write request, the first client sends an object processing request to the server. The data identification information carried by the object processing request of the write request type includes the write level.
[0123] Step 206: The first client determines whether the write level is greater than the preset level threshold. If it is greater, then proceed to step 208 below. If it is not greater, then end.
[0124] In an optional implementation of this embodiment, the preset level threshold can be predefined, that is, before determining whether the write level is greater than the preset level threshold, the method further includes:
[0125] Determine the attribute parameters of the target object in the server;
[0126] Set the corresponding preset level threshold based on the attribute parameters.
[0127] Step 208: When the first client receives a write completion message from the server after the write level is greater than the preset level threshold, it determines the write type, the data to be written, and the corresponding write level of the object processing request. Based on the write type, the data to be written, and the corresponding write level, it generates write record information and writes the write record information to the server's shared log area.
[0128] Step 210: The second client obtains the current write record information from the shared log area, parses the write record information to obtain the write type, the data to be written, and the corresponding write level; based on the write type and write level, it determines the data to be modified in the data thumbnail stored in the local cache; and updates the data to be modified using the data to be written.
[0129] It should be noted that the second client may be the same as or different from the first client. That is, the client that performs the write operation can synchronize the current write record information from the server's shared log area, and the client that does not perform the write operation can also synchronize the current write record information from the server's shared log area.
[0130] Step 212: The second client detects the object processing request for the target object in the server, determines the request type corresponding to the object processing request, wherein the object processing request carries data identification information; if the request type is a read request type, the corresponding target data storage node is found from the local cache according to the data identification information.
[0131] Step 214: If the target data storage node is found, the second client reads the target data corresponding to the object processing request from the target data storage node.
[0132] Step 216: If the second client does not find the corresponding target data storage node, it determines other clients on the same machine as the second client and searches for the target data storage node corresponding to the data identification information in the local cache of the other clients.
[0133] Step 218: If the target data storage node corresponding to the data identification information is found in the local cache of other clients, the target data corresponding to the object processing request is obtained from the target data storage node.
[0134] Step 220: If the target data storage node corresponding to the data identifier information is not found in the local cache of other clients, the target data storage node is searched from the target object on the server, and the target data corresponding to the object processing request is obtained from the target data storage node.
[0135] It should be noted that, Figure 3a This is a schematic diagram illustrating the interaction process of an object processing method provided in one embodiment of this specification. To reduce the overhead of synchronizing write record information from the server's shared log to the local cache, the first client can append write record information for each write operation at a level greater than N in the target object of the server to the server's shared log area, such as... Figure 3aAs shown, the server's target object is a linked list, including data nodes 1-7. Each data node has a corresponding data structure, and each write record is organized into a tuple, formatted as {write type, data to be written, write level}. For example, an operation like {Insert, data, L}, where the data field is the data to be inserted into the data structure (i.e., the data to be written), and L is the insertion level on the server side (i.e., the write level). This process occurs immediately after each write operation by the first client, and the client executing the operation (i.e., the first client) flushes the data to the server's shared log area via RDMA write operations. Simultaneously, the second client can retrieve the write record information stored in the server's shared log area via RDMA read operations to update its local cache without the server's awareness. That is, each client stores write record information for write operations at levels greater than N in its local cache, such as... Figure 3a The dotted line indicates the second client. After obtaining the write record information, the second client first parses the write type and then updates the local cache data structure according to the write type. The entire process is the same as on the server side. Therefore, each read operation of the second client will always obtain a consistent data structure view (i.e., the local caches of each client maintain consistency).
[0136] Furthermore, in this embodiment, high-level data structure nodes are cached using client-side local caching technology to accelerate data structure access operations. When data is in the local cache, previous cross-network RDMA read operations are transformed into read operations from the local cache. Since high-level data structure nodes are accessed more frequently, they are chosen here. Additionally, the proportion of data cached on the client side is not large, therefore the overhead for maintaining client-side cache consistency is within an acceptable range.
[0137] As an example, Figure 3b This is a screenshot illustrating the effect of client-side local caching as provided in one embodiment of this specification. The effects of using different cache sizes are shown below. Figure 3bAs shown, this example uses a distributed SkipList as the data structure. With 6 clients, each maintaining 1 / 32 of the SkipList as a cache on its own machine (i.e., its local cache), the SkipList throughput reaches 184 KOPS, which is 3.2 times higher than without a cache (57.5 KOPS when the local cache is 0). Generally, throughput increases with cache size, but gradually slows down due to the overhead of synchronization primitives. When the local cache size is 1 / 16 of the entire SkipList, the throughput is 216 KOPS. The throughput peaks at 293 KOPS when the local cache size is 1 / 8 of the entire SkipList. After that, as the local cache size continues to increase, the throughput decreases. When the local cache ratio is 1 / 4, the throughput decrease is not significant. When the local cache ratio is 1 / 2, the throughput drops to 74% of the peak throughput. The reason is that when caching a large proportion of SkipList, the overhead of the cache consistency protocol is higher than the benefits of caching.
[0138] This specification provides an embodiment of an object processing method. A first client can append write record information for each write operation above a preset level threshold in the target object on the server to the server's shared log area. Simultaneously, a second client can retrieve the write record information stored in the server's shared log area via RDMA read operations to update its local cache, without the server's awareness. After obtaining the write record information, the second client first parses the write type and then updates the data structure of its local cache according to the write type; the entire process is identical to that on the server side. Therefore, the local caches of each client maintain consistency. When a client needs to read data, it can first search for the corresponding target data storage node in its local cache. If the corresponding target data storage node is found, the required data can be read directly based on the found target data storage node. Thus, by caching the relevant write data of the target object in the client's local cache, the access speed of the target object can be accelerated. When the data to be read is in the client's local cache, the previous cross-network data read operation is transformed into a read-from-local-cache operation, saving network communication overhead and reducing network communication costs.
[0139] Corresponding to the above method embodiments, this specification also provides object processing client embodiments. Figure 4 A schematic diagram of the structure of an object processing client provided in one embodiment of this specification is shown. Figure 4 As shown, the client includes:
[0140] The determination module 402 is configured to detect object processing requests for a target object in the server and determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information;
[0141] The lookup module 404 is configured to, when the request type is a read request type, look up the corresponding target data storage node from the local cache based on the data identification information, wherein the local cache is updated based on the write record information of the target client to the target object in the server;
[0142] The reading module 406 is configured to read the target data corresponding to the object processing request from the target data storage node when the target data storage node is found.
[0143] Optionally, the client also includes a write module, configured as follows:
[0144] When the request type is a write request, the object processing request is sent to the server;
[0145] Upon receiving a write completion message from the server, the corresponding write record information is generated based on the object processing request.
[0146] Write log information is written to the server's shared log area, which is used by various clients to obtain the current write log information.
[0147] Optionally, the data identification information includes the write level; the write module is further configured as follows:
[0148] Determine if the write level is greater than the preset level threshold. If it is, execute the operation steps of generating the corresponding write record information based on the object processing request.
[0149] Optionally, the write module is further configured as follows:
[0150] Determine the write type, the data to be written, and the corresponding write level of the object processing request;
[0151] Write record information is generated based on the write type, the data to be written, and the corresponding write level.
[0152] Optionally, the write module is further configured as follows:
[0153] Determine the attribute parameters of the target object in the server;
[0154] Set the corresponding preset level threshold based on the attribute parameters.
[0155] Optionally, the client also includes an update module, configured as follows:
[0156] Retrieve the current write log information from the shared log area;
[0157] Update the data thumbnails stored in the local cache based on the write log information.
[0158] Optionally, the update module is further configured as follows:
[0159] The write record information is parsed to obtain the write type, the data to be written, and the corresponding write level;
[0160] Based on the write type and write level, determine the data to be modified in the data thumbnail;
[0161] Use the data to be written to update the data to be modified.
[0162] Optionally, the reading module 406 is further configured to:
[0163] If the corresponding target data storage node is not found, identify other clients that are on the same machine as the client.
[0164] Search for the target data storage node corresponding to the data identification information in the local cache of other clients;
[0165] If found, the target data corresponding to the object processing request is retrieved from the target data storage node.
[0166] Optionally, the reading module 406 is further configured to:
[0167] If the target data storage node corresponding to the data identifier information is not found in the local cache of other clients, the target data storage node is searched from the target object on the server, and the target data corresponding to the object processing request is obtained from the target data storage node.
[0168] This specification provides an embodiment of an object processing client. The client's local cache can be updated based on the write records of the target object on the server. That is, the client's local cache can cache the relevant write data of the target object. When the client needs to read data, it can first search for the corresponding target data storage node in its local cache. If the corresponding target data storage node is found, the required data can be read directly from the found target data storage node. Thus, by caching the relevant write data of the target object in the client's local cache, the access speed of the target object can be accelerated. When the data to be read is in the client's local cache, the previous cross-network data read operation is transformed into a read operation from the local cache, saving network communication overhead and reducing network communication costs.
[0169] The above is an illustrative scheme of an object processing client according to this embodiment. It should be noted that the technical solution of this object processing client and the technical solution of the object processing method described above belong to the same concept. For details not described in detail in the technical solution of the object processing client, please refer to the description of the technical solution of the object processing method described above.
[0170] Corresponding to the above method embodiments, this specification also provides object processing system embodiments. Figure 5 A schematic diagram of the structure of an object processing system provided in one embodiment of this specification is shown. Figure 5 As shown, the system includes a first client 502, a second client 504, and a server 506;
[0171] The first client 502 is configured to detect object processing requests for target objects in server 506, determine the request type corresponding to the object processing request; if the request type is a write request, send the object processing request to server 506; upon receiving a write completion message returned by server 506, generate corresponding write record information according to the object processing request; and write the write record information to the shared log area of server 506.
[0172] The second client 504 is configured to obtain the current write record information from the shared log area, update the data thumbnail stored in the local cache based on the write record information, detect object processing requests for the target object in server 506, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information; if the request type is a read request type, search for the corresponding target data storage node in the local cache based on the data identification information, and if the target data storage node is found, read the target data corresponding to the object processing request from the target data storage node.
[0173] This specification provides an embodiment of an object processing system. A first client can append write record information for write operations of a target object on the server at each level exceeding a preset level threshold to the server's shared log area. Simultaneously, a second client can retrieve the write record information stored in the server's shared log area via RDMA read operations to update its local cache, without the server's awareness. After obtaining the write record information, the second client first parses the write type and then updates the data structure of its local cache according to the write type; the entire process is identical to that on the server side. Therefore, the local caches of each client maintain consistency. When a client needs to read data, it can first search for the corresponding target data storage node in its local cache. If the corresponding target data storage node is found, the required data can be read directly based on the found target data storage node. Thus, by caching the relevant write data of the target object in the client's local cache, the access speed of the target object can be accelerated. When the data to be read is in the client's local cache, the previous cross-network data read operation is transformed into a read-from-local-cache operation, saving network communication overhead and reducing network communication costs.
[0174] The above is an illustrative scheme of an object processing system according to this embodiment. It should be noted that the technical solution of this object processing system and the technical solution of the object processing method described above belong to the same concept. For details not described in detail in the technical solution of the object processing system, please refer to the description of the technical solution of the object processing method described above.
[0175] Figure 6 A structural block diagram of a computing device 600 according to one embodiment of this specification is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.
[0176] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0177] In one embodiment of this specification, the above-described components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0178] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 600 can also be a mobile or stationary server.
[0179] The processor 620 is used to execute the following computer-executable instructions to implement the operation steps of the above object processing method.
[0180] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the object processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the object processing method described above.
[0181] An embodiment of this specification also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used to implement the operational steps of the object processing method described above.
[0182] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the object processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the object processing method described above.
[0183] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0184] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0185] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0186] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0187] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the embodiments described in this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An object handling method, applied to a client, comprising: Detect object processing requests targeting a target object in the server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information, and the data identification information includes the write level; When the request type is a read request type, the corresponding target data storage node is found in the local cache according to the data identification information. The local cache is updated based on the write record information of the target object in the server by the target client. The write record information is read from the shared log area of the server. The shared log area records relevant information of the write operation of the target client with a write level greater than a preset level threshold, which is used by each client to obtain the current write record information. If the target data storage node is located, the target data corresponding to the object processing request is read from the target data storage node.
2. The object processing method according to claim 1, after determining the request type corresponding to the object processing request, further comprising: If the request type is a write request, the object processing request is sent to the server; Upon receiving a write completion message from the server, corresponding write record information is generated based on the object processing request. The write record information is written to the shared log area of the server, wherein the shared log area is used by each client to obtain the current write record information.
3. The object processing method according to claim 2, wherein the data identification information includes a writing hierarchy; Before generating the corresponding write record information based on the object processing request, the method further includes: Determine whether the write level is greater than a preset level threshold. If it is, then execute the operation step of generating corresponding write record information based on the object processing request.
4. The object processing method according to claim 2, wherein generating corresponding write record information according to the object processing request includes: Determine the write type, the data to be written, and the corresponding write level of the object processing request; The write record information is generated based on the write type, the data to be written, and the corresponding write level.
5. The object processing method according to claim 3, further comprising, before determining whether the write level is greater than a preset level threshold: Determine the attribute parameters of the target object in the server; Based on the attribute parameters, set the corresponding preset level threshold.
6. The object processing method according to any one of claims 2-5, further comprising, before detecting the object processing request for the target object in the server and determining the request type corresponding to the object processing request: Obtain the current write record information from the shared log area; The data thumbnails stored in the local cache are updated based on the write record information.
7. The object processing method according to claim 6, wherein updating the data thumbnail stored in the local cache according to the write record information includes: The write record information is parsed to obtain the write type, the data to be written, and the corresponding write level; Based on the write type and the write level, determine the data to be modified in the data thumbnail; The data to be written is used to update the data to be modified.
8. The object processing method according to claim 1, after searching for the corresponding target data storage node from the local cache based on the data identification information, further includes: If the corresponding target data storage node is not found, identify other clients that are on the same machine as the client. Search the local cache of the other clients for the target data storage node corresponding to the data identification information; If found, the target data corresponding to the object processing request is obtained from the target data storage node.
9. The object processing method according to claim 8, after searching for the target data storage node corresponding to the data identification information from the local cache of the other client, further comprising: If the target data storage node corresponding to the data identification information is not found in the local cache of the other clients, the target data storage node is searched from the target object of the server, and the target data corresponding to the object processing request is obtained from the target data storage node.
10. An object processing client, comprising: The determination module is configured to detect object processing requests for a target object in the server, determine the request type corresponding to the object processing request, wherein the object processing request carries data identification information, and the data identification information includes a write level; The lookup module is configured to, when the request type is a read request type, look up the corresponding target data storage node from the local cache based on the data identification information. The local cache is updated based on the write record information of the target client on the target object in the server. The write record information is read from the shared log area of the server. The shared log area records relevant information of write operations of the target client with a write level greater than a preset level threshold, which is used by each client to obtain the current write record information. The reading module is configured to read the target data corresponding to the object processing request from the target data storage node when the target data storage node is found.
11. An object processing system, comprising a first client, a second client, and a server; The first client is configured to detect object processing requests for a target object in the server and determine the request type corresponding to the object processing request; If the request type is a write request, the object processing request is sent to the server; Upon receiving a write completion message from the server, corresponding write record information is generated based on the object processing request; the write record information is then written to the server's shared log area. The second client is configured to obtain the current write record information from the shared log area and update the data thumbnails stored in the local cache based on the write record information; The system detects object processing requests targeting a target object on the server, determines the request type corresponding to the object processing request, wherein the object processing request carries data identification information, the data identification information including a write level; if the request type is a read request type, the system searches for the corresponding target data storage node in the local cache according to the data identification information, and if the target data storage node is found, the system reads the target data corresponding to the object processing request from the target data storage node.
12. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the operation steps of the object processing method according to any one of claims 1 to 9.
13. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the operational steps of the object processing method according to any one of claims 1 to 9.