Range lock acquisition method, apparatus and system and computer readable storage medium

By directly determining the interval intersection situation corresponding to the range lock type, avoiding traversing the red and black tree, the problem of low range lock acquisition efficiency under the red and black tree management is solved, and efficient range lock acquisition is achieved.

WO2024244913A1PCT designated stage expired Publication Date: 2024-12-05HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/091400
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-30
Filing Date
2024-05-07
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

The existing red and black tree management range locks are in concurrent read and write access scenarios. As the number of acquired range locks increases, the time to traverse the red and black tree structure increases, resulting in low efficiency in acquiring range locks.

Method used

By directly acquiring the range lock corresponding to the type of the range lock, determine whether its intervals intersect, avoid traversing all acquired range locks, thereby improving the efficiency of acquiring range locks.

Benefits of technology

It significantly improves the efficiency of acquiring range locks and reduces delays, making it suitable for scenarios with higher concurrent read and write operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091400_05122024_PF_FP_ABST
    Figure CN2024091400_05122024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computers, and discloses a range lock acquisition method, apparatus and system and a computer readable storage medium. The method comprises: a first device acquiring a first packet sent by a second device, wherein the first packet is used for requesting to acquire a first range lock, the first packet comprises the type and range of the first range lock, and the first range lock is used for locking data stored in a distributed manner; then, acquiring a second range lock corresponding to the type of the first range lock, and determining whether the range of the first range lock intersects with the range of the second range lock; and sending a second packet to the second device on the basis of the range of the first range lock not intersecting with the range of the second range lock, wherein the second packet is used for instructing the second device to acquire the first range lock. According to the method, after a packet used for requesting a range lock is acquired, a range lock corresponding to the type is directly acquired, and then whether the ranges intersect is determined, so that there is no need to traverse fixed range locks from all acquired range locks, and the efficiency of acquiring range locks is high.
Need to check novelty before this filing date? Find Prior Art

Description

Range lock acquisition method, device, system and computer-readable storage medium

[0001] This application claims priority to Chinese patent application No. 202310626935.X, filed on May 30, 2023, entitled “Method, device, system and computer-readable storage medium for acquiring range locks,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a method, device, system, and computer-readable storage medium for acquiring a range lock. Background Art

[0003] Distributed systems often involve multiple clients concurrently accessing the same file for reading and writing. To ensure file consistency, a lock is typically acquired before any operation is performed on the file's data. This lock is then used to lock the file's data before the operation is performed. To improve lock acquisition efficiency and thus data locking efficiency, and to adapt to scenarios with high levels of concurrent read and write access, range locks, a lock type with flexible length that can lock intervals of data within a file, have emerged.

[0004] In related art, a red-black tree (RBTree) is used to manage range locks. Each node in the RBTree represents a range lock, and previously acquired range locks are linked together through the RBTree structure. To acquire a new range lock, the tree is traversed starting from the root node to check whether the new range lock conflicts with an already acquired range lock. If there is no conflict, the new range lock is acquired.

[0005] However, since the red-black tree structure needs to be traversed when acquiring a new range lock, as the number of acquired range locks increases, the time required to traverse the red-black tree structure increases, resulting in low efficiency in acquiring range locks.

[0006] Summary of the Invention

[0007] The present application proposes a range lock acquisition method, device, system, and computer-readable storage medium to improve the efficiency of acquiring range locks.

[0008] In a first aspect, a method for acquiring a range lock is provided, the method comprising: a first device acquiring a first message sent by a second device, the first message being used to request acquisition of a first range lock, the first message including a type and an interval of the first range lock, the first range lock being used to lock distributedly stored data; then, the first device acquiring a second range lock corresponding to the type of the first range lock, and determining whether the interval of the first range lock intersects with the interval of the second range lock; based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, the first device sending a second message to the second device, the second message being used to instruct the second device to acquire the first range lock.

[0009] In this method, after obtaining the message for requesting the range lock, the first device directly obtains the range lock corresponding to the type of the range lock, and then determines whether the intervals intersect, without traversing the fixed range locks from all the obtained range locks, thereby obtaining the range lock more efficiently.

[0010] In one possible implementation, the interval of the first range lock includes a first endpoint and a second endpoint, and the first endpoint, the second endpoint, and the endpoints included in the interval of the second range lock are represented by numerical values. In this case, determining whether the interval of the first range lock intersects with the interval of the second range lock includes: obtaining a first adjacent point and a second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock, wherein the first adjacent point is the endpoint with the largest numerical value among at least one first reference endpoint, and the numerical value of the first reference endpoint is smaller than the numerical value of the first endpoint; and the second adjacent point is the endpoint with the smallest numerical value among at least one second reference endpoint, and the numerical value of the second reference endpoint is larger than the numerical value of the first endpoint; and determining whether the interval of the first range lock intersects with the interval of the second range lock based on the first adjacent point, the second adjacent point, and the second endpoint.

[0011] That is, the first adjacent point and the second adjacent point are endpoints located on either side of the first endpoint, respectively, within the interval of the second range lock. Therefore, when determining whether the interval of the first range lock intersects with the interval of the second range lock based on the first adjacent point, the second adjacent point, and the second endpoint, whether the interval of the first range lock intersects with the interval of the second range lock can be determined based on the second range lock in which the first adjacent point is located, the second range lock in which the second adjacent point is located, and whether there is a second range lock whose interval includes the interval of the first range lock. The number of second range locks used to determine whether the intervals intersect is small, the determination efficiency is high, and thus the efficiency of acquiring range locks is improved.

[0012] In one possible implementation, there are multiple second range locks, and determining whether an interval of the first range lock intersects with an interval of the second range lock based on the first adjacent point, the second adjacent point, and the second endpoint includes: when the value of the second endpoint is greater than the value of the first endpoint, based on the fact that the first adjacent point is a fourth endpoint included in the interval of one second range lock, the second adjacent point is a fifth endpoint included in the interval of another second range lock, the value of the second endpoint is less than the value of the second adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks, determining that the interval of the first range lock does not intersect with the intervals of the multiple second range locks.

[0013] The interval including the fourth endpoint also includes the third endpoint, and the value of the third endpoint is smaller than the value of the fourth endpoint. The interval including the fifth endpoint also includes the sixth endpoint, and the value of the fifth endpoint is smaller than the value of the sixth endpoint. In other words, this method is applicable to the case where the first endpoint is the left-hand endpoint of the interval included in the first range lock, and the second endpoint is the right-hand endpoint of the interval included in the first range lock.

[0014] In one possible implementation, there are multiple second range locks, and determining whether an interval of the first range lock intersects with an interval of the second range lock based on the first adjacent point, the second adjacent point, and the second endpoint includes: when the value of the second endpoint is smaller than the value of the first endpoint, determining that the interval of the first range lock does not intersect with the intervals of the multiple second range locks based on the fact that the first adjacent point is a fourth endpoint included in the interval of one second range lock, the second adjacent point is a fifth endpoint included in the interval of another second range lock, the value of the second endpoint is larger than the value of the first adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks.

[0015] The interval including the fourth endpoint also includes the third endpoint, and the value of the third endpoint is smaller than the value of the fourth endpoint. The interval including the fifth endpoint also includes the sixth endpoint, and the value of the fifth endpoint is smaller than the value of the sixth endpoint. In other words, this method is applicable to the case where the first endpoint is the endpoint located to the right of the endpoints included in the interval of the first range lock, and the second endpoint is the endpoint located to the left of the endpoints included in the interval of the first range lock. The relative positions of the first and second endpoints are relatively flexible.

[0016] In one possible implementation, the first device stores a multi-level search structure corresponding to the type, and the endpoints included in the interval of the second range lock are stored in the multi-level search structure; obtaining the first adjacent point and the second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock includes: searching the multi-level search structure to obtain the first adjacent point and the second adjacent point of the first endpoint.

[0017] In this method, when the endpoints of the interval of the second range lock are included in a multi-level search structure corresponding to the type, the values ​​of multiple bit positions at the lower layer can be quickly determined based on the values ​​of the bit positions at the upper layer in the multi-level search structure, thereby being able to more quickly narrow the range of the bit positions where the first adjacent point and the second adjacent point of the first endpoint are located, and the efficiency of searching for the first adjacent point and the second adjacent point of the first endpoint based on the multi-level search structure is high.

[0018] In one possible implementation, after sending the second message to the second device, the method further includes: the first device adding the first endpoint and the second endpoint to a multi-level search structure. This method can add the endpoint of the first range lock to the multi-level search structure, so that the endpoint of the first range lock can be used to subsequently determine whether the range lock can be acquired.

[0019] In one possible implementation, after adding the first endpoint and the second endpoint to the multi-level search structure, the method further includes: the first device receiving a third message sent by the second device, the third message being used to request the release of the first range lock, the third message including the type of the first range lock, the first endpoint, and the second endpoint; the first device obtaining a multi-level search structure corresponding to the type; and the first device deleting the first endpoint and the second endpoint from the multi-level search structure. If the first range lock is released, the method can delete the endpoints of the first range lock from the multi-level search structure, ensuring that the endpoints included in the multi-level search structure remain consistent with those of the second range lock corresponding to the type.

[0020] In one possible implementation, if the first range lock is a range lock with intersecting intervals, the second range lock includes all range locks acquired before the first range lock with non-intersecting intervals. Alternatively, if the first range lock is a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock. This method can be applied to different types of first range locks, thus having a wide range of applications.

[0021] In one possible implementation, the first device is any one of a switch, a server, a device including a field programmable gate array (FPGA), a device including a smart network interface card (Smart NIC), or a device including a data processing unit (DPU), and the second device is a client. This method can be applied to the case where a variety of devices are used as the first device, and has a wide range of uses. Furthermore, in the case where the first device is any one of a switch, a device including an FPGA, a device including a smart network card, or a device including a DPU, no matter how many messages for requesting a range lock are received by the first device, the time taken by the first device to process these messages is substantially the same. Thus, in a scenario with a high number of concurrent read and write operations, the time it takes for the first device to execute the method is relatively stable. When the execution time of the method is short, the delay in obtaining the range lock is short, and the efficiency is high.

[0022] In a second aspect, a method for acquiring a range lock is provided, the method comprising: a second device sending a first message to a first device, the first message being used to request acquisition of a first range lock, the first message comprising a type and an interval of the first range lock, the first range lock being used to lock distributedly stored data; the second device receiving a second message sent by the first device, and acquiring the first range lock based on the second message, wherein the second message is sent by the first device based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock corresponding to the type.

[0023] In this method, after receiving a message requesting a range lock, the first device directly acquires the range lock corresponding to the range lock type and then determines whether the intervals intersect, without having to traverse a fixed range lock from all acquired range locks. This makes the determination of whether the intervals intersect more efficient. In this case, the time between the second device sending the first message and receiving the second message is shorter, making range lock acquisition more efficient.

[0024] In one possible implementation, after acquiring the first range lock, the second device may further send a third message to the first device, the third message being used to request the release of the first range lock, the third message including the type and range of the first range lock. The second device may request the release of the first range lock, so that after the first range lock is released, the first range lock can be reacquired by another device, thereby enabling operations on distributed stored data based on the first range lock.

[0025] In one possible implementation, if the first range lock is a range lock with intersecting intervals, the second range lock includes all range locks acquired before the first range lock with non-intersecting intervals. Alternatively, if the first range lock is a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock. This method can be applied to different types of first range locks, thus having a wide range of applications.

[0026] In one possible implementation, the first device is any one of a switch, a server, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, and the second device is a client. This method can be applied to the case where multiple devices serve as the first device and has a wide range of uses. Furthermore, in the case where the first device is any one of a switch, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, no matter how many messages the first device receives for requesting a range lock, the time it takes for the first device to process these messages is substantially the same. Thus, in scenarios with a high number of concurrent read and write operations, the time it takes for the first device to execute the method is relatively stable. When the execution time of the method is short, the delay in obtaining the range lock is short, and the efficiency is high.

[0027] In a third aspect, a range lock acquisition device is provided, the device being applied to a first device, the device comprising:

[0028] A first acquisition module is configured to acquire a first message sent by the second device, where the first message is used to request a first range lock, the first message includes a type and a range of the first range lock, and the first range lock is used to lock distributed stored data;

[0029] A second acquisition module is used to acquire a second range lock corresponding to the type of the first range lock;

[0030] a determination module, configured to determine whether the interval of the first range lock intersects with the interval of the second range lock;

[0031] The sending module is configured to send a second message to the second device based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, wherein the second message is used to instruct the second device to acquire the first range lock.

[0032] In one possible implementation, the interval of the first range lock includes a first endpoint and a second endpoint, and the first endpoint, the second endpoint, and the endpoints included in the interval of the second range lock are represented by numerical values; a determination module is used to obtain a first adjacent point and a second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock, the first adjacent point being the endpoint with the largest numerical value among at least one first reference endpoint, and the numerical value of the first reference endpoint is smaller than the numerical value of the first endpoint, and the second adjacent point is the endpoint with the smallest numerical value among at least one second reference endpoint, and the numerical value of the second reference endpoint is larger than the numerical value of the first endpoint; based on the first adjacent point, the second adjacent point, and the second endpoint, determine whether the interval of the first range lock intersects with the interval of the second range lock.

[0033] In one possible implementation, there are multiple second range locks, and the determination module is configured to determine, when the value of the second endpoint is greater than the value of the first endpoint, that the interval of the first range lock does not intersect with the intervals of the multiple second range locks based on the fact that the first adjacent point is a fourth endpoint included in an interval of one second range lock, the second adjacent point is a fifth endpoint included in an interval of another second range lock, the value of the second endpoint is less than the value of the second adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks; wherein, the interval including the fourth endpoint also includes the third endpoint, the value of the third endpoint is less than the value of the fourth endpoint, and the interval including the fifth endpoint also includes the sixth endpoint, the value of the fifth endpoint is less than the value of the sixth endpoint.

[0034] In one possible implementation, there are multiple second range locks, and the determination module is configured to determine, when the value of the second endpoint is smaller than the value of the first endpoint, that the interval of the first range lock does not intersect with the intervals of the multiple second range locks based on the fact that the first adjacent point is a fourth endpoint included in an interval of one second range lock, the second adjacent point is a fifth endpoint included in an interval of another second range lock, the value of the second endpoint is greater than the value of the first adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks; wherein, the interval including the fourth endpoint also includes the third endpoint, the value of the third endpoint is smaller than the value of the fourth endpoint, and the interval including the fifth endpoint also includes the sixth endpoint, the value of the fifth endpoint is smaller than the value of the sixth endpoint.

[0035] In one possible implementation, the first device stores a multi-level search structure corresponding to the type, and the endpoints included in the interval of the second range lock are stored in the multi-level search structure; the determination module is used to search the multi-level search structure to obtain the first adjacent point and the second adjacent point of the first endpoint.

[0036] In a possible implementation, the determination module is further configured to add the first endpoint and the second endpoint to a multi-level search structure.

[0037] In one possible implementation, the first acquisition module is also used to obtain a third message sent by the second device, where the third message is used to request the release of the first range lock, and the third message includes the type of the first range lock, the first endpoint, and the second endpoint; the determination module is also used to obtain a multi-level search structure corresponding to the type; and delete the first endpoint and the second endpoint from the multi-level search structure.

[0038] In one possible implementation, based on the first range lock being a range lock with intersecting intervals, the second range lock includes range locks with non-intersecting intervals acquired before the first range lock; or, based on the first range lock being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock.

[0039] In a possible implementation, the first device is any one of a switch, a server, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, and the second device is a client.

[0040] In a fourth aspect, a range lock acquisition device is provided, the device being applied to a second device, the device comprising:

[0041] a sending module, configured to send a first message to a first device, the first message being used to request a first range lock, the first message including a type and a range of the first range lock, the first range lock being used to lock distributedly stored data;

[0042] A first acquisition module is configured to receive a second message sent by the first device, where the second message is sent by the first device based on the fact that an interval of the first range lock does not intersect an interval of a second range lock of a corresponding type;

[0043] The second acquisition module is configured to acquire the first range lock based on the second message.

[0044] In a possible implementation, the sending module is further configured to send a third message to the first device, where the third message is used to request the release of the first range lock, and the third message includes the type and range of the first range lock.

[0045] In one possible implementation, based on the first range lock being a range lock with intersecting intervals, the second range lock includes range locks with non-intersecting intervals acquired before the first range lock; or, based on the first range lock being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock.

[0046] In a possible implementation, the first device is any one of a switch, a server, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, and the second device is a client.

[0047] In a fifth aspect, a range lock acquisition system is provided, the system comprising a first device and a second device, the first device being used to execute any range lock acquisition method in the first aspect, and the second device being used to execute any range lock acquisition method in the second aspect.

[0048] In a sixth aspect, a computer system is provided, comprising a processor. When the processor executes program instructions or code, the computer system implements any of the range lock acquisition methods described in the first aspect or any of the range lock acquisition methods described in the second aspect. Exemplarily, the computer system further comprises a memory configured to store the program instructions or code.

[0049] In the seventh aspect, a computer-readable storage medium is provided, which stores at least one program instruction or code. When the program instruction or code is loaded and executed by a processor, the computer implements any method for acquiring a range lock in the first aspect, or any method for acquiring a range lock in the second aspect.

[0050] In an eighth aspect, a communication device is provided, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive signals and to control the transceiver to transmit signals. When the processor executes the instructions stored in the memory, the processor executes any of the range lock acquisition methods described in the first aspect or any of the range lock acquisition methods described in the second aspect.

[0051] Illustratively, there are one or more processors and one or more memories.

[0052] For example, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0053] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.

[0054] In the ninth aspect, a computer program or a computer program product is provided, the computer program or the computer program product comprising: computer program code, which, when executed by a computer, enables the computer to execute any range lock acquisition method in the first aspect, or any range lock acquisition method in the second aspect.

[0055] In the tenth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory. When the chip is installed in a first device, the first device executes any method for acquiring a range lock in the first aspect. When the chip is installed in a second device, the second device executes any method for acquiring a range lock in the second aspect.

[0056] Exemplarily, the chip further includes: an input interface, an output interface and the memory, and the input interface, the output interface, the processor and the memory are connected via an internal connection path.

[0057] It should be understood that the beneficial effects achieved by the technical solutions of the third to tenth aspects of this application and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first and second aspects and their corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] FIG1 is a schematic diagram of a plurality of clients initiating write requests to distributedly stored files provided by an embodiment of the present application;

[0059] FIG2 is a schematic diagram of the structure of a red-black tree;

[0060] FIG3 is a schematic structural diagram of a network lock system;

[0061] FIG4 is a schematic diagram of an implementation environment of a range lock acquisition method provided in an embodiment of the present application;

[0062] FIG5 is a schematic diagram of an implementation environment of another range lock acquisition method provided in an embodiment of the present application;

[0063] FIG6 is a schematic diagram of an implementation environment of another range lock acquisition method provided in an embodiment of the present application;

[0064] FIG7 is a flowchart of a method for acquiring a range lock provided in an embodiment of the present application;

[0065] FIG8 is a schematic diagram of the structure of a first message provided in an embodiment of the present application;

[0066] FIG9 is a schematic diagram of a process for obtaining a range lock provided by an embodiment of the present application;

[0067] FIG10 is a schematic diagram of an arrangement of endpoints provided in an embodiment of the present application;

[0068] FIG11 is a schematic diagram of a bitmap structure provided in an embodiment of the present application;

[0069] FIG12 is a schematic diagram of the positions of a first endpoint, a second endpoint, a first adjacent point, and a second adjacent point provided in an embodiment of the present application;

[0070] FIG13 is a schematic diagram of another process for obtaining a range lock provided in an embodiment of the present application;

[0071] FIG14 is a schematic structural diagram of a range lock acquisition device provided in an embodiment of the present application;

[0072] FIG15 is a schematic structural diagram of another range lock acquisition device provided in an embodiment of the present application;

[0073] FIG16 is a schematic diagram of the structure of a computer system provided in an embodiment of the present application;

[0074] FIG17 is a schematic diagram of the structure of another computer system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] The terms used in the embodiments of this application are only used to explain the embodiments of this application and are not intended to limit this application. The embodiments of this application are described below in conjunction with the accompanying drawings.

[0076] In a distributed system, multiple clients may simultaneously initiate read and / or write access to the same distributed storage file or database. Read access is also called a read operation, and write access is also called a write operation. Read operations are used to read data from a file, while write operations are used to modify data in a file. Read and write operations are collectively referred to as read and write operations. Simultaneous read and write operations on the same file or database are called concurrent read and write operations. Distributed systems often have a large number of concurrent read and write operations. These concurrent read and write operations, when performed on the same data in the same file or database, may cause data inconsistencies.

[0077] For example, distributed storage file 1 is stored simultaneously in storage device 1, storage device 2, and storage device 3 of the distributed system. When client 1 and client 2 in the distributed system simultaneously initiate write operations on file 1, if the write operation initiated by client 1 is performed on file 1 stored in storage device 1, and the write operation initiated by client 2 is performed on file 1 stored in storage device 2, the contents written by the write operation initiated by client 1 and the write operation initiated by client 2 are different, and the file 1 stored in storage device 1, storage device 2, and storage device 3 will be inconsistent.

[0078] To ensure data consistency, distributed locks have emerged. When a read or write operation is required on distributedly stored data, a distributed lock corresponding to the read or write operation is acquired. The distributed lock is then used to lock the data so that the object cannot be modified by other write operations. The read or write operation is then performed, thereby ensuring data consistency. In the embodiments of the present application, data includes but is not limited to files, blocks when files are stored in block form, and tables or records in a table in a database.

[0079] Among the various types of distributed locks, range locks have flexible lengths and can lock data within an interval, so using range locks to lock data within an interval is more efficient. Figure 1 is a schematic diagram of a plurality of clients initiating write requests to distributedly stored files provided by an embodiment of the present application. Referring to Figure 1, client 1 initiates a write operation on data from 0 to 4 kilobytes (KB) of file 1, where 0 to 4KB is represented as [0, 4K], client 2 initiates a write operation on data from 9KB to 60 megabytes (MB) of file 1, where 9KB to 60MB is represented as [9K, 60M], and client 3 initiates a write operation on data from 70MB to 100MB of file 1, where 70MB to 100MB is represented as [70M, 100M].

[0080] Client 1 obtains range lock 1 with an interval of [0, 1], client 2 obtains range lock 2 with an interval of [2, 15K], and client 3 obtains range lock 3 with an interval of [16K, 25K]. The granularity of range locks 1, 2, and 3 is 4KB. The granularity of a range lock refers to how much data is locked by a value in the range lock interval. When the range lock granularity is 4KB, a value in the range lock interval is used to lock 4KB of data. Therefore, range lock 1 can be used to lock data in the range of [0, 4K], range lock 2 can be used to lock data in the range of [9K, 60M], and range lock 3 can be used to lock data in the range of [70M, 100M].

[0081] In a related technique, range locks are managed using a red-black tree. Each node in the red-black tree represents a range lock, and multiple acquired range locks are linked together through the red-black tree structure. Figure 2 is a schematic diagram of the red-black tree structure. As shown in Figure 2, each node in the red-black tree also includes the type of range lock. When a new range lock needs to be acquired, the red-black tree is traversed starting from the root node to check whether the new range lock to be acquired conflicts with the already acquired range locks. If there is no conflict, the new range lock is acquired.

[0082] Referring to Figure 2, when a new range lock needs to be acquired, traversal starts from the range lock [50, 70]. If the new range lock is a shared range lock, and the interval of this range lock does not intersect with the intervals of all exclusive range locks in the red-black tree, this range lock does not conflict with the already acquired range lock; if the interval of this range lock does intersect with the interval of any exclusive range lock in the red-black tree, this range lock conflicts with the already acquired range lock. If the new range lock is an exclusive range lock, and the interval of this range lock does not intersect with the intervals of all exclusive range locks and all shared range locks in the red-black tree, this range lock does not conflict with the already acquired range lock; if this range lock intersects with the interval of any exclusive range lock or any shared range lock in the red-black tree, this range lock conflicts with the already acquired range lock.

[0083] However, because acquiring a new range lock requires traversing the red-black tree from the root node, the time it takes to traverse the tree increases as the number of acquired range locks increases, resulting in lower efficiency in acquiring new range locks. Furthermore, in related art, traversing the red-black tree is performed by a central processing unit (CPU). As concurrent read and write operations increase, the CPU load increases rapidly, leading to a rapid increase in the latency of acquiring range locks. Furthermore, due to the complex structure of the red-black tree, it is difficult to improve the efficiency of acquiring range locks by offloading the red-black tree structure to hardware.

[0084] In another related technology, a netlock system (netlock) is used to manage range locks. Figure 3 is a schematic diagram of the structure of a netlock system. Referring to Figure 3, a top of rack switch (TOR switch) and a lock manager both store a lock table. The lock table stores the correspondence between objects and locks. For a particular object, the lock corresponding to the object can be obtained by searching the lock table. The TOR switch also stores routing information. The TOR switch is connected to multiple lock managers and multiple database servers. An object can be a file, a block when a file is stored in blocks, a table in a database, or a record in a table.

[0085] A request message sent by a client is forwarded to the lock manager via the top-of-rack switch. This request message is used to obtain a lock corresponding to a specific object. The top-of-rack switch is capable of parsing the request message. If its lock table contains the corresponding relationship between the object and the lock, the top-of-rack switch intercepts the request message and sends a response message to the client, indicating that the lock has been successfully acquired. However, the lock table in the network lock system stores the correspondence between objects and locks on a per-object basis. For multiple objects, the client needs to send multiple requests to obtain the corresponding locks, which reduces lock acquisition efficiency.

[0086] An embodiment of the present application provides a method for acquiring a range lock, which is used to improve the efficiency of acquiring a range lock. The method can be applied to the implementation environment shown in Figure 4. Referring to Figure 4, the implementation scenario includes a distributed system, and the distributed system includes a first device 101 and a second device 102, and the first device 101 and the second device 102 are communicatively connected. The first device 101 and the second device 102 can be connected to each other via a wired or wireless network, which is not limited in this embodiment of the present application. Exemplarily, the first device 101 is any one of a switch, a server, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, and the second device 102 is a client.

[0087] Exemplarily, the first device 101 obtains a first message sent by the second device 102, where the first message is used to request a first range lock, and the first message includes the type and interval of the first range lock, where the first range lock is used to lock distributed stored data; then, the first device 101 obtains a second range lock corresponding to the type of the first range lock; thereafter, the first device 101 determines whether the interval of the first range lock intersects with the interval of the second range lock; based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, the first device 101 sends a second message to the second device 102, where the second message is used to instruct the second device 102 to obtain the first range lock.

[0088] Afterwards, the first device 101 may acquire the first range lock and use the first range lock to lock the distributed stored data. The second device 102 may acquire the first range lock based on the second message and then operate on the data according to the first range lock.

[0089] Range lock types include range locks with intersecting intervals and range locks with non-intersecting intervals. A range lock with intersecting intervals is also called a shared range lock, while a range lock with non-intersecting intervals is also called an exclusive range lock. A shared range lock's interval can be occupied by at least one range lock, while an exclusive range lock's interval can only be occupied by one range lock. A shared range lock corresponds to a read operation. When data is locked using a shared range lock, the data corresponding to the interval in this shared range lock can also be locked by other shared range locks, but not by an exclusive range lock. An exclusive range lock corresponds to a write operation. When data is locked using an exclusive range lock, the data corresponding to the interval in this exclusive range lock cannot be locked by other exclusive range locks or other shared range locks. For example, the first range lock is a range lock with intersecting intervals, that is, the first range lock is a shared range lock, and the second device 102 performs a read operation on the data. For another example, the first range lock is a range lock with non-intersecting intervals, that is, the first range lock is an exclusive range lock, and the second device 102 performs a write operation on the data.

[0090] The distributed system shown in FIG4 can be a distributed file system. For example, the implementation environment of the method is shown in FIG5 . Referring to FIG5 , the implementation environment also includes multiple storage devices 103, which are communicatively connected and used to store files. That is, in the implementation environment shown in FIG5 , the distributed stored data includes distributed stored files. The distributed system shown in FIG4 can also be a distributed database. For example, the implementation environment of the method is shown in FIG6 . Referring to FIG6 , the implementation environment also includes multiple database servers 104, which are communicatively connected and used to store tables. That is, in the implementation environment shown in FIG6 , the distributed stored data includes distributed stored tables.

[0091] The method for acquiring a range lock provided in an embodiment of the present application may be shown in Figure 7. Next, the method will be described in conjunction with the implementation scenario shown in Figure 4. As shown in Figure 7, the method includes but is not limited to S701 to S707.

[0092] S701: The second device sends a first message to the first device. The first message is used to request a first range lock. The first message includes a type and a range of the first range lock. The first range lock is used to lock distributed stored data.

[0093] Exemplarily, the first device is any one of a switch, a server, a device including an FPGA, a device including a SmartNIC, or a device including a DPU, and the second device is a client. In one possible implementation, when the second device needs to obtain a first range lock to operate on distributed stored data, the second device generates a first message and sends the first message to the first device.

[0094] FIG8 is a schematic diagram of the structure of a first message provided in an embodiment of the present application. Referring to FIG8 , the first message includes a communication protocol header, an operation (OP) field, a response code (Res Code) field, a lock type (lock type) field, a client identifier (client ID) field, a start (start) field, and an end (end) field. The communication protocol header includes type indication information, and the type indication information is used to indicate that the first message is a message for acquiring or releasing a range lock. For example, the communication protocol header is a message header, and the first message is a message using the user datagram protocol (UDP) protocol. In this case, the type indication information includes a destination port number. When the destination port number is a reference port number, the first message is a message for acquiring or releasing a range lock. The reference port number can be determined based on experience or actual needs, and the embodiment of the present application does not limit this.

[0095] The Operation field is used to indicate the type of request, which includes but is not limited to a request to acquire a range lock or a request to release a range lock. For example, if the Operation field has a first value, the request type is a request to acquire a range lock; if the Operation field has a second value, the request type is a request to release a range lock. The first and second values ​​can be determined based on actual needs, for example, a first value of 1 and a second value of 0.

[0096] The response code field is used to indicate whether the request is successful. The value of the response code field is modified by the first device after determining whether the first range lock is successfully acquired or failed. For example, in the case where the first range lock is successfully acquired, the first device sets the value of the response code field to the third value. In the case where the first range lock fails to be acquired, the first device sets the value of the response code field to the fourth value. The third value and the fourth value can be determined according to actual needs, for example, the third value is 1 and the fourth value is 0. In the first message, the value of the response code field can be empty. The lock type field is used to indicate the type of the first range lock. The type of the first range lock includes but is not limited to any one of a shared range lock and an exclusive range lock. For example, when the value of the lock type field is the fifth value, the first range lock is a shared range lock. When the value of the lock type field is the sixth value, the first range lock is an exclusive range lock. The fifth value and the sixth value can be determined according to actual needs. For example, the fifth value is 1 and the sixth value is 0.

[0097] The client identifier field is used to indicate the second device, so that after the first device determines whether the first range lock has been successfully acquired or failed, it can determine the second device based on the client identifier field and send a second message to the second device. Exemplarily, the start field and the end field are used together to indicate the interval of the first range lock. For example, the interval of the first range lock includes a first endpoint and a second endpoint, and the first endpoint and the second endpoint are both represented by numerical values. In an embodiment of the present application, the endpoints included in the interval refer to the starting point and the ending point of the interval, rather than the points between the starting point and the ending point. When the numerical value of the first endpoint is less than the second endpoint, the start field includes the numerical value of the first endpoint, so that the start field is used to indicate the first endpoint of the first range lock. In this case, the first endpoint is also called the left endpoint of the interval of the first range lock or the starting point of the interval of the first range lock; the end field includes the numerical value of the second endpoint, so that the end field is used to indicate the second endpoint of the first range lock. In this case, the second endpoint is also called the right endpoint of the interval of the first range lock or the ending point of the interval of the first range lock.

[0098] In the case where the value of the first endpoint is greater than the second endpoint, the start field includes the value of the second endpoint, so that the start field is used to indicate the second endpoint of the first range lock. In this case, the second endpoint is also called the left endpoint of the interval of the first range lock or the starting point of the interval of the first range lock; the end field includes the value of the first endpoint, so that the end field is used to indicate the first endpoint of the first range lock. In this case, the second endpoint is called the right endpoint of the interval of the first range lock or the ending point of the interval of the first range lock. In an embodiment of the present application, the interval of the first range lock corresponds to the interval of the data to be operated, for example, the first endpoint corresponds to the starting point of the reference data, and the second endpoint corresponds to the ending point of the reference data, so that the first range lock can be used to lock the data to be operated. The data to be operated is distributed stored data, and the data to be operated includes but is not limited to data in a file or data in a table stored in a database.

[0099] Figure 9 is a schematic diagram of a process for acquiring a range lock provided by an embodiment of the present application, and the operation of the second device generating the first message may be the message generation operation performed by the second device as shown in Figure 9. The embodiment of the present application does not limit the manner in which the second device sends the first message to the first device.

[0100] S702: The first device obtains a first message sent by the second device.

[0101] The embodiments of the present application do not limit the manner in which the first device obtains the first message sent by the second device, and the manner in which the second device sends the first message to the first device can correspond to that of the first device. For example, when the second device sends the first message to the first device via a wireless network, the first device receives the first message via the wireless network.

[0102] S703: The first device obtains a second range lock corresponding to the type of the first range lock.

[0103] In one possible implementation, after receiving a message, the first device identifies the message and, if the message is for acquiring or releasing a range lock, executes S703; if the message is not for acquiring or releasing a range lock, performs other processing on the message. For example, after receiving a first message, the first device identifies the message header of the first message and, if it identifies the first message as a message for acquiring or releasing a range lock, executes S703. The message identification operation may correspond to the message identification operation performed by the first device shown in FIG9 .

[0104] In an embodiment of the present application, the first device stores already acquired range locks, so that after obtaining the type of the first range lock, it can acquire the acquired range lock corresponding to the type of the first range lock, and the acquired range lock corresponding to the type is the second range lock corresponding to the type. Exemplarily, based on the first range lock being a range lock with intersecting intervals, the second range lock includes the range locks with non-intersecting intervals acquired before the first range lock; or, based on the first range being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock. That is, based on the first range lock being a shared range lock, the second range lock includes the exclusive range lock acquired before the first range lock; based on the first range lock being an exclusive range lock, the second range lock includes the exclusive range lock and the shared range lock acquired before the first range lock.

[0105] In an embodiment of the present application, if the number of acquired range locks corresponding to the type is 0, the number of second range locks is 0; if the number of acquired range locks corresponding to the type is greater than or equal to 1, the number of second range locks is greater than or equal to 1.

[0106] S704: The first device determines whether the interval of the first range lock intersects with the interval of the second range lock.

[0107] In one possible implementation, if the number of second range locks is 0, it is directly determined that the interval of the first range lock does not intersect with the interval of the second range lock. If the number of second range locks is greater than or equal to 1, it is determined whether the interval of the first range lock intersects with at least one interval of the second range lock.

[0108] Illustratively, when the interval of the first range lock includes a first endpoint and a second endpoint, if the first range lock is a shared range lock, whether the interval of the first range lock intersects with the interval of the acquired exclusive range lock is determined based on the first endpoint and the second endpoint. If the first range lock is an exclusive range lock, whether the interval of the first range lock intersects with the intervals of the acquired shared range lock and exclusive range lock is determined based on the first endpoint and the second endpoint.

[0109] Alternatively, if the first range lock is an exclusive range lock, whether the interval of the first range lock intersects with the interval of the acquired shared range lock is determined based on the first endpoint and the second endpoint, and whether the interval of the first range lock intersects with the interval of the acquired exclusive range lock is determined based on the first endpoint and the second endpoint. In this manner, the operations of determining whether the interval of the first range lock intersects with the interval of the acquired shared range lock and determining whether the interval of the first range lock intersects with the interval of the acquired exclusive range lock can be performed in parallel, or one of the operations can be performed first, and if the intervals do not intersect, the other can be performed, thereby improving the efficiency of determining whether the intervals of the first range lock and the second range lock intersect.

[0110] Exemplarily, the first endpoint, the second endpoint, and the endpoints included in the interval of the second range lock are represented by numerical values, and determining whether the interval of the first range lock intersects the interval of the second range lock includes S7041 to S7042.

[0111] S7041: Obtain a first adjacent point and a second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock.

[0112] The first adjacent point is the endpoint with the largest value among the at least one first reference endpoint, and its value is smaller than the first endpoint. The second adjacent point is the endpoint with the smallest value among the at least one second reference endpoint, and its value is larger than the first endpoint. That is, among the at least one first reference endpoint included in the interval of the second range lock, the first adjacent point is the endpoint with the smallest distance from the first endpoint; and among the at least one second reference endpoint included in the interval of the second range lock, the second adjacent point is the endpoint with the smallest distance from the first endpoint. The first endpoint, the second endpoint, and the endpoints of the second range lock can be arranged on a number axis in ascending order of value, so that the intervals of each range lock are represented as intervals on the number axis.

[0113] Figure 10 is a schematic diagram of an endpoint arrangement provided by an embodiment of the present application. As shown in Figure 10, the intervals of range lock 1 to range lock 3 each include two endpoints, and the endpoints are arranged in ascending order of numerical value. The left endpoint of the interval of range lock 1 is L1 and the right endpoint is R1, and the interval of range lock 1 is shown as L1 to R1. The left endpoint of the interval of range lock 2 is M and the right endpoint is N, and the interval of range lock 2 is shown as M to N. The left endpoint of the interval of range lock 3 is L2 and the right endpoint is R2, and the interval of range lock 3 is shown as L2 to R2. When range lock 2 is the first range lock, the first endpoint is the left endpoint, and the second endpoint is the right endpoint, L1 is the first adjacent point of the first endpoint, and R1 is the second adjacent point of the first endpoint. When range lock 2 is the first range lock, the first endpoint is the right endpoint, and the second endpoint is the left endpoint, L2 is the first adjacent point of the first endpoint, and R2 is the second adjacent point of the first endpoint.

[0114] For example, when the first adjacent point of the first endpoint is obtained first, since the endpoints of the range lock interval are arranged in ascending order of numerical value, the first endpoint among the endpoints included in the interval of the second range lock whose numerical value is greater than the numerical value of the first adjacent point is directly taken as the second adjacent point; or, when the second adjacent point of the first endpoint is obtained first, the first endpoint among the endpoints included in the interval of the second range lock whose numerical value is less than the numerical value of the second adjacent point is directly taken as the first adjacent point.

[0115] In one possible implementation, the first device stores a multi-level search structure corresponding to the type, and the endpoints included in the interval of the second range lock are stored in the multi-level search structure. In this case, obtaining the first adjacent point and the second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock includes: searching the multi-level search structure corresponding to the type, and obtaining the first adjacent point and the second adjacent point of the first endpoint. Exemplarily, the multi-level search structure is a bitmap structure. Figure 11 is a schematic diagram of a bitmap structure provided in an embodiment of the present application. Figure 11 is an example of a bitmap structure with three layers, but is not used to limit the number of layers of the bitmap structure. The bitmap structure may include more or fewer layers.

[0116] Taking the range lock interval of [0, 1023] as an example, in the bitmap structure shown in Figure 11, 0 and 1023 are the values ​​of the left endpoint and the right endpoint, respectively, and 1 to 1022 are the values ​​of the midpoint, respectively. The bit values ​​at positions 0 and 1023 are set as the first reference value, and the values ​​at positions 1 to 1022 are set as the second reference value. The first reference value and the second reference value are set based on experience or actual needs, and are not limited in this embodiment of the present application. For example, the first reference value is 1 and the second reference value is 0.

[0117] Next, we'll use the example of a first reference value of 1 and a second reference value of 0. Continuing with Figure 11, in the lowest layer of the bitmap structure, layer 3 shown in Figure 11, each bit position corresponds to a numerical value, and the value of the bit position indicates the position of the numerical value corresponding to that bit position. For example, in layer 3, the bit positions corresponding to the numerical values ​​0 and 1023 have a value of 1, while the bit positions corresponding to other numerical values ​​have a value of 0. In two adjacent layers, a bit position in the upper layer corresponds to X bit positions in the lower layer, and the value of a bit position in the upper layer indicates the X bit positions in the lower layer corresponding to that bit position. Where X is the maximum bit width of data processed by the processor of the first device, or any value less than the maximum bit width. For example, if the processor is a 64-bit processor, the maximum bit width is 64, and X is 64 or any value less than 64. If the processor is a 32-bit processor, the maximum bit width is 32, and X is 32 or any value less than 32.

[0118] Figure 11 uses X as an example to illustrate. As shown in Figure 11, one bit position in layer 2 corresponds to 32 bit positions in layer 3. If the values ​​of the 32 bit positions in layer 3 are all 0, the values ​​of the bit positions in layer 2 corresponding to these 32 bit positions are 0. If the values ​​of the 32 bit positions in layer 3 are not all 0, the values ​​of the bit positions in layer 2 corresponding to these 32 bit positions are 1. One bit position in layer 1 corresponds to 32 bit positions in layer 2. If the values ​​of the 32 bit positions in layer 2 are all 0, the values ​​of the bit positions in layer 1 corresponding to these 32 bit positions are 0. If the values ​​of the 32 bit positions in layer 2 are not all 0, the values ​​of the bit positions in layer 1 corresponding to these 32 bit positions are 1. In this case, one bit position in layer 1 corresponds to 1024 bit positions in layer 3.

[0119] For example, when the range lock interval is [0, P-1], X bit positions in the lower layer correspond to one bit position in the upper layer, and the maximum number of levels required for the bitmap structure is Wherein, P is an integer greater than 1, Indicates that log X The value of P is rounded up. Layer 1 is the highest layer in the bitmap structure, and layer Q is the lowest layer in the bitmap structure. A bit position in layer Q corresponds to a value position, and a bit position in layer 1 corresponds to X. Q-1 The position of a value.

[0120] Take the example of obtaining the first adjacent point of the first endpoint by searching the multi-level search structure, and directly taking the first endpoint located to the right of the first adjacent point among the endpoints included in the interval of the second range lock as the second adjacent point. The process of searching for the first adjacent point of the first endpoint starts from searching layer 1 and ends at layer Q. For layer i, the search process includes but is not limited to S1-1 to S1-4, where i is greater than or equal to 1 and less than or equal to Q. In the embodiment of the present application, the bit position of layer i has an identification value, and an identification value is used to indicate a bit position of layer i. The identification value can be represented by a numerical value. For layer Q, since a bit position corresponds to a numerical position, the identification value of the bit position is a numerical value.

[0121] S1-1, search for the identification value in layer i that is less than or equal to Y i And the maximum identity value Y with a value of 1 i_max .

[0122] Y i The bit position corresponding to the value of the first endpoint is the identification value at layer i, Y represents the value of the first endpoint, Express Round down. i Equal to Y i_max In the case of i Greater than Y i_max And Y i_max If it is greater than 0, execute S1-3, and i_max If it is less than 0, execute S1-4.

[0123] S1-2, if layer i is the bottom layer, determine if the interval of the first range lock intersects with the interval of the second range lock. If layer i is not the bottom layer, find the next layer with an identification value less than or equal to Y. i+1 And the maximum identity value Y with a value of 1 i+1_max .

[0124] When layer i is the lowest layer, that is, layer Q, if the obtained identification value Y Q_max Equal to Y Q , indicating that the first range lock and the second range lock share an endpoint, the interval of the first range lock and the interval of the second range lock have an intersection, and the intersection includes at least the endpoint Y Q In this case, it is determined that the interval of the first range lock intersects the interval of the second range lock. i+1 The bit position corresponding to the value of the first endpoint is the identification value at layer i+1, For Y i+1 With Y i+1_max For different situations, the subsequent steps can refer to Y i With Yi_max The subsequent steps performed in different situations are not described here in detail.

[0125] S1-3, if layer i is the bottom layer, determine Y i_max is the value of the first adjacent point. If layer i is not the bottom layer, find the next layer with an identification value less than or equal to Y i+1 And the maximum identity value Y with a value of 1 i+1_max .

[0126] Y i+1 Indicates the bit position corresponding to the value of the first endpoint in layer i+1, Yi +1 =(Y i_max +1)*X-1. (Y i_max +1)*X-1 represents Y in layer i+1 i_max The identifier value of the last bit position in the corresponding X bit positions. i+1 With Y i+1_max For different situations, the subsequent steps can refer to Y i With Y i_max The subsequent steps performed in different situations are not described here in detail.

[0127] Combine steps S1-1 to S1-3, and at layer Q, obtain the found identification value Y Q_max . Identification value Y Q_max There are three possible situations: (1) Y Q_max <0, in this case, it means that there is no first adjacent point; (2) Y Q_max =Y Q In this case, it is determined that the interval of the first range lock and the interval of at least one second range lock have an intersection, and at least the endpoint Y exists in the intersection Q ; (3) 0≤Y Q_max <Y Q In this case, Y Q_max Determine the identification value of the first adjacent point.

[0128] S1-4: Return a third reference value. The third reference value indicates the first neighboring point in the multi-level search structure that does not include the first endpoint. Among the bit positions at layer Q with a value of 1, the value of the bit position with the smallest value is determined as the value of the second neighboring point. The third reference value is determined based on experience or actual needs; for example, the third reference value is -1. The above-described operations of obtaining the first and second neighboring points of the first endpoint correspond to the neighboring search operations performed by the first device in Figure 9.

[0129] In the case where the endpoints of the interval of the second range lock are included in a multi-level search structure corresponding to the type, the values ​​of multiple bit positions at the lower layer can be quickly determined based on the values ​​of the bit positions at the upper layer in the multi-level search structure, so that the range of the bit positions of the first adjacent point and the second adjacent point of the first endpoint can be narrowed down more quickly, and the efficiency of searching for the first adjacent point and the second adjacent point of the first endpoint based on the multi-level search structure is high.

[0130] S7042: Determine whether the interval of the first range lock intersects with the interval of the second range lock based on the first adjacent point, the second adjacent point, and the second endpoint.

[0131] Combined with the above-mentioned contents of S7041, it can be seen that the first adjacent point and the second adjacent point are endpoints located on either side of the first endpoint, respectively, within the interval of the second range lock. Therefore, when determining whether the interval of the first range lock intersects with the interval of the second range lock based on the first adjacent point, the second adjacent point, and the second endpoint, whether the interval of the first range lock intersects with the interval of the second range lock can be determined based on the second range lock containing the first adjacent point, the second range lock containing the second adjacent point, and whether there is a second range lock whose interval contains the interval of the first range lock. In this case, the number of second range locks used to determine whether the intervals intersect is small, the determination efficiency is high, and thus the efficiency of acquiring range locks is improved.

[0132] FIG12 is a schematic diagram of the positions of a first endpoint, a second endpoint, a first adjacent point, and a second adjacent point provided by an embodiment of the present application. Referring to FIG12 , there are multiple second range locks, M represents the first endpoint and the first endpoint is the left endpoint, N represents the second endpoint and the second endpoint is the right endpoint, L represents the first adjacent point, and R represents the second adjacent point. As shown in FIG12 (a), when both L and R are left endpoints included in the interval of the second range lock, M is included in the interval of the second range lock where L is located, and the interval of the first range lock intersects with the interval of the second range lock where L is located. As shown in FIG12 (b), when L is the left endpoint included in the interval of one second range lock and R is the right endpoint included in the interval of another second range lock, M is included in both the interval of the second range lock where L is located and the interval of the second range lock where R is located, and the interval of the first range lock intersects with both the interval of the second range lock where L is located and the interval of the second range lock where R is located.

[0133] As shown in (c) of Figure 12 , when both L and R are right endpoints included in the interval of the second range lock, and M is included in the interval of the second range lock where R is located, then the interval of the first range lock intersects with the interval of the second range lock where R is located. As shown in (d) of Figure 12 , when L is the right endpoint included in the interval of one second range lock and R is the left endpoint included in the interval of another second range lock, M is neither included in the interval of the second range lock where L is located nor in the interval of the second range lock where R is located. When the value of N is less than the value of R, the interval of the first range lock does not intersect with the interval of the second range lock where L is located, nor with the interval of the second range lock where R is located. Continuing with (d) of Figure 12 , if the interval of the first range lock is also not included in the interval of the second range lock, then the interval of the first range lock does not intersect with the interval of the second range lock of the corresponding type.

[0134] As shown in (e) of Figure 12 , if there is an endpoint L' to the left of L and an endpoint R' to the right of R, and L' and R' are two endpoints included in an interval of a second range lock, if the interval of the second range lock where L' and R' are located contains the interval of the first range lock, then the interval of the first range lock intersects with the interval of the second range lock where L' and R' are located. Therefore, the conditions for the intervals of the first range lock and the second range lock not to intersect include, but are not limited to: L is the right endpoint included in an interval of a second range lock, R is the left endpoint included in an interval of another second range lock, the value of N is less than the value of R, and the interval of the first range lock is not completely included in any interval of the second range lock.

[0135] For example, if there is only one second range lock, whether the interval of the first range lock intersects with the interval of the second range lock is determined directly based on the values ​​of the first endpoint, the second endpoint, and both endpoints of the second range lock. If there are multiple second range locks, whether the interval of the first range lock intersects with the interval of the second range lock is determined based on different conditions of the second endpoints, including but not limited to the following cases A and B.

[0136] In case A, the value of the second endpoint is greater than the value of the first endpoint.

[0137] In this case, the first endpoint may be the left endpoint of the interval included in the first range lock, and the second endpoint may be the right endpoint of the interval included in the first range lock. Based on the fact that the first adjacent point is the fourth endpoint of the interval included in one second range lock, the second adjacent point is the fifth endpoint of the interval included in another second range lock, the value of the second endpoint is smaller than the value of the second adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the plurality of second range locks, it is determined that the interval of the first range lock does not intersect with the intervals of the plurality of second range locks.

[0138] The interval including the fourth endpoint also includes the third endpoint, and the value of the third endpoint is smaller than the value of the fourth endpoint. The interval including the fifth endpoint also includes the sixth endpoint, and the value of the fifth endpoint is smaller than the value of the sixth endpoint. In other words, the third and fifth endpoints can both be the left endpoints of the interval included in the second range lock, and the fourth and sixth endpoints can both be the right endpoints of the interval included in the second range lock.

[0139] That is, if the following conditions (a1) to (a4) are not simultaneously met, then the interval of the first range lock is determined to intersect the intervals of multiple second range locks. Condition (a1): The first adjacent point is the fourth endpoint included in the interval of one second range lock; Condition (a2): The second adjacent point is the fifth endpoint included in the interval of another second range lock; Condition (a3): The value of the second endpoint is less than the value of the second adjacent point; Condition (a4): The interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks.

[0140] In case B, the value of the second endpoint is smaller than the value of the first endpoint.

[0141] In this case, the first endpoint may be the right endpoint of the interval of the first range lock, and the second endpoint may be the left endpoint included in the interval of the first range lock. Based on the fact that the first adjacent point is the fourth endpoint included in the interval of one second range lock, the second adjacent point is the fifth endpoint included in the interval of another second range lock, the value of the second endpoint is greater than the value of the first adjacent point, and the interval of the first range lock is not included in the interval of any range lock among the acquired range locks of the corresponding type, it is determined that the interval of the first range lock does not intersect with the intervals of the multiple second range locks.

[0142] The interval including the fourth endpoint also includes the third endpoint, and the value of the third endpoint is smaller than the value of the fourth endpoint. The interval including the fifth endpoint also includes the sixth endpoint, and the value of the fifth endpoint is smaller than the value of the sixth endpoint. In other words, the third and fifth endpoints can both be the left endpoints of the interval included in the second range lock, and the fourth and sixth endpoints can both be the right endpoints of the interval included in the second range lock.

[0143] That is, if the following conditions (b1) to (b4) are not simultaneously met, then the interval of the first range lock is determined to intersect the intervals of multiple second range locks. Condition (b1): The first adjacent point is the fourth endpoint included in the interval of one second range lock; Condition (b2): The second adjacent point is the fifth endpoint included in the interval of another second range lock; Condition (b3): ​​The value of the second endpoint is greater than the value of the first adjacent point; Condition (b4): The interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks.

[0144] In the method provided in the embodiment of the present application, since the second range lock whose interval does not include the first adjacent point and does not include the first range lock, and the second range lock whose interval does not include the second adjacent point and does not include the first range lock, do not intersect with the interval of the first range lock, when determining whether the interval of the first range lock intersects with the intervals of multiple second range locks, it is directly determined that the intervals of these two second range locks do not intersect with the interval of the first range lock. This makes it more efficient to determine whether the interval of the first range lock intersects with the intervals of multiple second range locks, thereby improving the efficiency of acquiring the first range lock. The above process of determining whether the interval of the first range lock intersects with the interval of the second range lock can correspond to the conditional determination operation performed by the first device in Figure 9.

[0145] S705: Based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, the first device sends a second message to the second device, where the second message is used to instruct the second device to acquire the first range lock.

[0146] In this embodiment of the present application, the structure of the second message is identical to that of the first message. If the intervals of the first range lock and the second range lock do not intersect, the first device can obtain the second message by modifying the value of the Response Code field of the first message. For example, the first device modifies the value of the Response Code field of the first message to a third value to obtain the second message. Thus, after the second device obtains the second message, it can obtain the first range lock based on the third value of the Response Code field.

[0147] For example, if the interval of the first range lock intersects the interval of the second range lock, the first device sends a rejection message to the second device, indicating that the second device does not acquire the first range lock. The structure of the rejection message is the same as that of the first message. In one possible implementation, the first device modifies the value of the response code field of the first message to a fourth value to generate a rejection message. Upon receiving the rejection message, the second device can determine that acquisition of the first range lock failed based on the value of the response code field being the fourth value.

[0148] Exemplarily, the first device further modifies the routing information in the first message based on the routing information of the second device to obtain a second message or a rejection message. Thus, based on the routing information in the second message, the first device can send the second message to the second device, or, based on the routing information in the rejection message, the first device can send a rejection message to the second device. The above-mentioned operation of modifying the value of the response code field may correspond to the data modification operation performed by the first device in FIG9 , and the operation of the first device sending the second message to the second device and the operation of the first device sending the rejection message to the second device may correspond to the result feedback operation performed by the first device in FIG9 .

[0149] S706: The second device receives the second message sent by the first device.

[0150] Combining the contents of S702 to S705, it can be seen that the second message is sent by the first device based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock of the corresponding type. This embodiment of the application does not limit the method by which the second device obtains the second message sent by the first device; it can correspond to the method by which the first device sends the second message to the second device. For example, if the first device sends the second message to the second device via the wireless network, the second device receives the second message via the wireless network.

[0151] S707: The second device obtains the first range lock based on the second message.

[0152] Illustratively, the second device parses the second message and, based on the response code field of the second message being a third value, acquires the first range lock. The second device's operation of acquiring the first range lock based on the second message may correspond to the message parsing operation performed by the second device in FIG9 . Illustratively, the method further includes: the second device receiving a rejection message sent by the first device, and determining, based on the rejection message, that acquisition of the first range lock failed.

[0153] In one possible implementation, when or after sending the second message to the second device, the first device uses the first range lock to lock the data corresponding to the interval of the first range lock. Thus, after the second device acquires the first range lock, it can operate on the locked data. For example, if the first range lock is a shared range lock, the second device reads the locked data; if the first range lock is an exclusive range lock, the second device modifies the locked data.

[0154] Because the first device may store a multi-level search structure corresponding to the type of the first range lock, in one possible implementation, after the first device sends the second message to the second device, the method further includes: the first device adding the first endpoint and the second endpoint to the multi-level search structure. For example, the first device sets the values ​​of the positions of the numerical values ​​of the first endpoint and the second endpoint in the multi-level search structure to the first reference value, while maintaining the values ​​of the positions of the numerical values ​​of the intermediate points in the interval of the first range lock other than the first endpoint and the second endpoint unchanged.

[0155] For example, taking the first reference value as 1, for layer i in the multi-level search structure, a bit position in layer i corresponds to X N-i For the value representing the first endpoint, the bit position corresponding to the value is Set the identifier value to The value of the bit position of is set to 1, where M1 represents the value of the first endpoint, Express Round down. For the value representing the second endpoint, the bit position corresponding to the value is Set the identifier value to The value of the bit position of is set to 1, where N1 represents the value of the second endpoint, Express Round down.

[0156] In one possible implementation, after the second device acquires the first range lock, the method further includes: the second device sending a third message to the first device, the third message being used to request the release of the first range lock, the third message including the type and range of the first range lock. For example, after the second device performs an operation on the data corresponding to the range of the first range lock, it sends the third message to the first device. The structure of the third message is the same as that of the first message. The value of the operation field in the third message can be the second value, so that the request type of the third message is a request to release the range lock.

[0157] Thus, after receiving the third message, the first device can release the first range lock based on the third message. Exemplarily, when the interval of the first range lock includes the first endpoint and the second endpoint, after adding the first endpoint and the second endpoint to the multi-level search structure, the method further includes: the first device obtaining a third message sent by the second device, the third message being used to request the release of the first range lock, the third message including the type of the first range lock, the first endpoint, and the second endpoint; the first device obtaining a multi-level search structure corresponding to the type of the first range lock; and the first device deleting the first endpoint and the second endpoint from the multi-level search structure.

[0158] Exemplarily, deleting the first endpoint and the second endpoint is a process of setting the bit positions corresponding to the values ​​of the first endpoint and the second endpoint in the multi-level search structure to the second reference value. In this embodiment of the present application, the deletion operation is performed layer by layer, from layer Q to layer 1. For example, assuming the second reference value is 0, for layer i, X bit positions in layer i correspond to one bit position in layer i-1. Therefore, if the values ​​of the X bit positions in layer i are all 0, the values ​​of the bit positions corresponding to these X bit positions in layer i-1 are set to 0.

[0159] For the value representing the first endpoint, the identification value h1 of the bit position corresponding to the value in layer i is The bit position value of the identification value h1 is set to 0, where M1 represents the value of the first endpoint. Express Round down. If the identification value in layer i is to The bit positions of layer i-1 are all 0, and the to The value of the bit position corresponding to the bit position of to The value of the bit position corresponding to the bit position of remains unchanged. Indicates that Round down.

[0160] For the value representing the second endpoint, the identification value h2 of the bit position corresponding to the value in layer i is The bit position value of the identification value h2 is set to 0, wherein N1 represents the value of the second endpoint, Express Round down. If the identification value in layer i is to The bit positions of layer i-1 are all 0, and the to The value of the bit position corresponding to the bit position of the bit position is set to 0, otherwise the value of the bit position corresponding to the bit position in layer i-1 is kept. to The value of the bit position corresponding to the bit position of remains unchanged. Indicates that Round down.

[0161] Next, the process of acquiring a range lock is described by taking the application of the method provided in the embodiment of the present application to a distributed file system and a distributed database as an example.

[0162] In Example 1, the method is applied to a distributed file system, which includes at least one first device, multiple second devices, and multiple third devices. The first device is a switch, the second device is a client, and the third device is a storage device.

[0163] Multiple third devices are used to store files in a distributed manner. That is, the same file is stored in multiple third devices. Multiple clients can simultaneously initiate read requests and / or write requests for the same distributedly stored file. For example, multiple clients include client 1 and client 2, and file 1 is stored in multiple storage devices in a distributed manner. Client 1 initiates a write operation for data [0, 4K] of file 1, and client 2 initiates a write operation for data [3K, 6K] of file 1. Client 1 and client 2 initiate the write operation at the same time.

[0164] In this case, client 1 sends message 1 to the switch. Message 1 is used to request range lock A. Message 1 includes the type and interval of range lock A. Range lock A is used to lock the data [0, 4K] in file 1. In Example 1, the type of range lock A is an exclusive range lock, and the interval is [0, 4K]. Figure 13 is a schematic diagram of another process for obtaining a range lock provided by an embodiment of the present application. As shown in Figure 13, client 1 sends message 1 to the switch. After obtaining message 1 sent by client 1, the switch obtains the second range lock corresponding to the exclusive range lock and determines whether the interval of range lock A intersects with the interval of the second range lock. Based on the fact that the interval of range lock A does not intersect with the interval of the second range lock, as shown in Figure 13, the switch sends message 2 to client 1. Message 2 is used to instruct client 1 to obtain range lock A, so that client 1 can obtain range lock A based on message 2.

[0165] For example, as shown in Figure 13, client 2 sends message 3 to the switch. Message 3 requests range lock B. Message 3 includes the type and range of range lock B. Range lock B is used to lock the data [3K, 6K] in file 1. In Example 1, range lock B is an exclusive range lock with a range of [3K, 6K]. The switch receives message 3 later than message 1. After receiving message 3 from client 2, the switch obtains the second range lock corresponding to the exclusive range lock and determines whether the range of range lock B intersects with the range of the second range lock.

[0166] In Example 1, when determining whether the interval of range lock B intersects with the interval of the second range lock, range lock A has already been acquired. That is, the second range lock includes range lock A. Since the interval of range lock A intersects with the interval of range lock B, the interval of range lock B also intersects with the interval of the second range lock. In this case, referring to Figure 13, the switch sends message 4 to client 2. Message 4 is a rejection message. Therefore, based on message 4, client 2 can determine that acquisition of range lock B has failed.

[0167] In Example 2, the method is applied to a distributed database, which includes at least one first device, multiple second devices, and multiple third devices. The first device is a switch, the second device is a client, and the third device is a database server.

[0168] Multiple third devices are used for distributed storage tables, that is, the same table is stored in multiple third devices. Multiple clients can simultaneously initiate read requests and / or write requests for the same distributed storage table. For example, multiple clients include client 3 and client 4, and Table 1 is stored in multiple database servers in a distributed storage manner. Table 1 includes multiple records. For any record in the multiple records, the any record includes an identifier (ID) corresponding to the any record. Client 3 initiates an operation to modify the records in Table 1 whose identifier values ​​are greater than or equal to 3, and client 4 initiates an operation to modify the records in Table 1 whose identifier values ​​are less than or equal to 2.

[0169] In this case, client 3 sends message 5 to the switch. Message 5 is used to request range lock C. Message 5 includes the type and interval of range lock C. Range lock C is used to lock records whose identifier values ​​in Table 1 are greater than or equal to 3. In Example 2, range lock C is of type exclusive range lock, and its interval is [3, R]. R represents a fourth reference value, which is less than 0. [3, R] indicates that the value of the starting identifier is 3 and the value of the ending identifier is not limited. After receiving message 5 from client 3, the switch obtains the second range lock corresponding to the exclusive range lock and determines whether the interval of range lock C intersects with the interval of the second range lock. Based on the fact that the interval of range lock C does not intersect with the interval of the second range lock, the switch sends message 6 to client 3, instructing client 3 to obtain range lock C. Thus, client 3 can obtain range lock C based on message 6.

[0170] Client 4 sends message 7 to the switch. Message 7 requests a range lock D. Message 7 includes the type and interval of range lock D. Range lock D is used to lock records whose identifier values ​​are less than or equal to 2 in Table 1. In Example 2, range lock D is an exclusive range lock, and the interval is [R, 2]. [R, 2] indicates that the starting identifier value is not limited and the ending identifier value is 2. After receiving message 7 from client 4, the switch obtains the second range lock corresponding to the exclusive range lock and determines whether the interval of range lock D intersects with the interval of the second range lock. Based on the fact that the interval of range lock D does not intersect with the interval of the second range lock, the switch sends message 8 to client 4, instructing client 4 to obtain range lock D. Thus, client 4 can obtain range lock D based on message 8.

[0171] In the method provided in an embodiment of the present application, after receiving a message requesting a range lock, the first device directly acquires a range lock corresponding to the range lock type, and then determines whether the intervals intersect, without having to traverse a fixed range lock from all acquired range locks, thereby more efficiently acquiring range locks. If the number of second range locks is less than the number of all acquired range locks, the number of second range locks used to determine whether the intervals intersect is smaller, resulting in a more efficient determination of whether the intervals intersect, and thus more efficient acquisition of the first range lock.

[0172] In the case where the first device is any one of a switch, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, the first device has a linear processing capability, that is, the first device has a deterministic processing delay, and no matter how many messages for requesting a range lock are received, the time taken by the first device to process these messages is basically the same. In an embodiment of the present application, the time being basically the same means that the difference in duration does not exceed a reference threshold, and the reference threshold can be set based on experience or actual needs. Thus, in a scenario with a high number of concurrent read and write operations, the duration for the first device to execute the method provided in the embodiment of the present application is relatively stable, and does not increase rapidly with the increase in the number of concurrent read and write operations, and is suitable for scenarios with a high number of concurrent read and write operations. When the execution time of the method is short, the delay in obtaining the range lock is short, and the efficiency is high.

[0173] An embodiment of the present application also provides a device for acquiring a range lock. Figure 14 is a schematic diagram of the structure of a device for acquiring a range lock provided by an embodiment of the present application. The device is applied to a first device, that is, based on the multiple modules shown in Figure 14, the device can perform all or part of the operations performed by the first device. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiment of the present application does not limit this. As shown in Figure 14, the device includes a first acquisition module 1401, a second acquisition module 1402, a determination module 1403 and a sending module 1404.

[0174] The first acquisition module 1401 is used to obtain a first message sent by the second device, where the first message is used to request the acquisition of a first range lock. The first message includes the type and interval of the first range lock, and the first range lock is used to lock distributed stored data; the second acquisition module 1402 is used to obtain a second range lock corresponding to the type of the first range lock; the determination module 1403 is used to determine whether the interval of the first range lock and the interval of the second range lock intersect; the sending module 1404 is used to send a second message to the second device based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, where the second message is used to instruct the second device to acquire the first range lock.

[0175] In one possible implementation, the interval of the first range lock includes a first endpoint and a second endpoint, and the first endpoint, the second endpoint, and the endpoints included in the interval of the second range lock are represented by numerical values; the determination module 1403 is used to obtain the first adjacent point and the second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock, the first adjacent point is the endpoint with the largest numerical value among at least one first reference endpoint, and the numerical value of the first reference endpoint is smaller than the numerical value of the first endpoint, and the second adjacent point is the endpoint with the smallest numerical value among at least one second reference endpoint, and the numerical value of the second reference endpoint is larger than the numerical value of the first endpoint; based on the first adjacent point, the second adjacent point, and the second endpoint, determine whether the interval of the first range lock intersects with the interval of the second range lock.

[0176] In one possible implementation, there are multiple second range locks, and determination module 1403 is configured to determine, when the value of the second endpoint is greater than the value of the first endpoint, that the interval of the first range lock does not intersect with the intervals of the multiple second range locks based on the fact that the first adjacent point is a fourth endpoint included in an interval of one second range lock, the second adjacent point is a fifth endpoint included in an interval of another second range lock, the value of the second endpoint is less than the value of the second adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks; wherein, the interval including the fourth endpoint also includes the third endpoint, the value of the third endpoint is less than the value of the fourth endpoint, and the interval including the fifth endpoint also includes the sixth endpoint, the value of the fifth endpoint is less than the value of the sixth endpoint.

[0177] In one possible implementation, there are multiple second range locks, and determination module 1403 is configured to determine, when the value of the second endpoint is smaller than the value of the first endpoint, that the interval of the first range lock does not intersect with the intervals of the multiple second range locks based on the fact that the first adjacent point is a fourth endpoint included in an interval of one second range lock, the second adjacent point is a fifth endpoint included in an interval of another second range lock, the value of the second endpoint is greater than the value of the first adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the multiple second range locks; wherein, the interval including the fourth endpoint also includes the third endpoint, the value of the third endpoint is smaller than the value of the fourth endpoint, and the interval including the fifth endpoint also includes the sixth endpoint, the value of the fifth endpoint is smaller than the value of the sixth endpoint.

[0178] In one possible implementation, the first device stores a multi-level search structure corresponding to the type, and the endpoints included in the interval of the second range lock are stored in the multi-level search structure; the determination module 1403 is used to search the multi-level search structure to obtain the first adjacent point and the second adjacent point of the first endpoint.

[0179] In a possible implementation, the determination module 1403 is further configured to add the first endpoint and the second endpoint to a multi-level search structure.

[0180] In one possible implementation, the first acquisition module 1401 is also used to obtain a third message sent by the second device, where the third message is used to request the release of the first range lock, and the third message includes the type, the first endpoint, and the second endpoint of the first range lock; the determination module 1403 is also used to obtain a multi-level search structure corresponding to the type; and delete the first endpoint and the second endpoint from the multi-level search structure.

[0181] In one possible implementation, based on the first range lock being a range lock with intersecting intervals, the second range lock includes range locks with non-intersecting intervals acquired before the first range lock; or, based on the first range lock being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock.

[0182] In a possible implementation, the first device is any one of a switch, a server, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, and the second device is a client.

[0183] In the apparatus provided in the embodiments of the present application, after receiving a message requesting a range lock, the apparatus directly acquires a range lock corresponding to the range lock type, thereby determining whether intervals intersect, without having to traverse a fixed range lock from all already acquired range locks. This results in more efficient range lock acquisition. If the number of second range locks is less than the number of all already acquired range locks, the number of second range locks used to determine whether intervals intersect is smaller, resulting in more efficient determination of whether intervals intersect, and thus more efficient acquisition of the first range lock.

[0184] Figure 15 is a schematic diagram of the structure of another range lock acquisition device provided in an embodiment of the present application. The device is applied to a second device. That is, based on the multiple modules shown in Figure 15, the device can perform all or part of the operations performed by the second device. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown, and the embodiments of the present application are not limited to this. As shown in Figure 15, the device includes a sending module 1501, a first acquisition module 1502, and a second acquisition module 1503.

[0185] A sending module 1501 is used to send a first message to a first device, where the first message is used to request a first range lock. The first message includes the type and interval of the first range lock, and the first range lock is used to lock distributed stored data. A first acquisition module 1502 is used to receive a second message sent by the first device, where the second message is sent by the first device based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock corresponding to the type. A second acquisition module 1503 is used to acquire the first range lock based on the second message.

[0186] In a possible implementation, the sending module 1501 is further configured to send a third message to the first device, where the third message is used to request the release of the first range lock, and the third message includes the type and range of the first range lock.

[0187] In one possible implementation, based on the first range lock being a range lock with intersecting intervals, the second range lock includes range locks with non-intersecting intervals acquired before the first range lock; or, based on the first range lock being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock.

[0188] In a possible implementation, the first device is any one of a switch, a server, a device including an FPGA, a device including an intelligent network card, or a device including a DPU, and the second device is a client.

[0189] In the apparatus provided in the embodiments of the present application, after receiving a message requesting a range lock, the first device directly acquires a range lock corresponding to the range lock type and then determines whether the intervals intersect, without having to traverse a fixed range lock from all acquired range locks. This makes the determination of whether the intervals intersect more efficient. In this case, the time from sending the first message to receiving the second message is shorter, and the efficiency of acquiring range locks is higher.

[0190] It should be understood that the devices provided in Figures 14-15 above are merely examples of the division of the functional modules described above when implementing their functions. In actual applications, the functions described above can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the devices and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0191] Referring to FIG. 16 , FIG. 16 is a schematic diagram of the structure of a computer system provided in an embodiment of the present application. For example, as shown in FIG. 16 , the computer system is a computer system 2000. The computer system 2000 may be a network device, a routing device, or a switching device. The computer system 2000 shown in FIG. 16 is used to perform the operations involved in the first device or the operations involved in the second device in the range lock acquisition method shown in FIG. 7 . The computer system 2000 is, for example, a server, etc., and the computer system 2000 may be implemented by a general bus architecture.

[0192] As shown in FIG. 16 , a computer system 2000 includes at least one processor 2001 , a memory 2003 , and at least one communication interface 2004 .

[0193] The processor 2001 is, for example, a central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, a transistor logic device, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0194] Optionally, computer system 2000 also includes a bus. The bus is used to transmit information between the components of computer system 2000. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses can be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG16 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.

[0195] The memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 can also be integrated with the processor 2001.

[0196] The communication interface 2004 uses any transceiver-like device to communicate with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The communication interface 2004 can include a wired communication interface or a wireless communication interface. Specifically, the communication interface 2004 can be an Ethernet interface, a fast Ethernet (FE) interface, a gigabit Ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In the embodiment of the present application, the communication interface 2004 can be used for the computer system 2000 to communicate with other devices.

[0197] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG16 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0198] In a specific implementation, as an embodiment, the computer system 2000 may include multiple processors, such as processor 2001 and processor 2005 shown in FIG16 . Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0199] In a specific implementation, as an embodiment, the computer system 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 2001 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.

[0200] In some embodiments, the memory 2003 is used to store program code 2010 for executing the solution of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of the present application.

[0201] In a specific embodiment, the computer system 2000 of the embodiment of the present application can be the first device in the above-mentioned method embodiments. The processor 2001 in the computer system 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored in the processor 2001 itself, so that the computer system 2000 shown in Figure 16 can execute all or part of the operations performed by the first device.

[0202] In a specific embodiment, the computer system 2000 of the embodiment of the present application can be the second device in the above-mentioned method embodiments. The processor 2001 in the computer system 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored in the processor 2001 itself, so that the computer system 2000 shown in Figure 16 can execute all or part of the operations performed by the second device.

[0203] The computer system 2000 may also correspond to the apparatus shown in Figures 14 and 15 above, and each functional module in the apparatus shown in Figures 14 and 15 is implemented using software of the computer system 2000. In other words, the functional modules included in the apparatus shown in Figures 14 and 15 are generated by the processor 2001 of the computer system 2000 after reading the program code 2010 stored in the memory 2003.

[0204] Among them, each step of the range lock acquisition method shown in Figure 7 is completed by the hardware integrated logic circuit or software instructions in the processor of the computer system 2000. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0205] Figure 17 is a structural diagram of another computer system provided in an embodiment of the present application, and the computer system is used to perform the operations involved in the first device or the operations involved in the second device in the range lock acquisition method shown in Figure 7 above. Exemplarily, the computer system is a server, and the server may have relatively large differences due to different configurations or performance. The computer system may include one or more processors 1701 and one or more memories 1702, wherein at least one computer program is stored in one or more memories 1702, and at least one computer program is loaded and executed by one or more processors 1701. Exemplarily, the processor 1701 is a CPU. Of course, the computer system may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The computer system may also include other components for realizing device functions, which are not described here.

[0206] An embodiment of the present application further provides a computer system, comprising a processor. When the processor executes program instructions or code, the computer system executes the range lock acquisition method executed by the first device or the range lock acquisition method executed by the second device. Exemplarily, the computer system further comprises a memory configured to store the program instructions or code.

[0207] In a possible implementation, the computer system further includes an input interface and an output interface, and the input interface, the output interface, the processor, and the memory are connected via an internal connection path.

[0208] The present application also provides a range lock acquisition system, comprising a first device and a second device. The first device is configured to execute the method performed by the first device shown in FIG7 , and the second device is configured to execute the method performed by the second device shown in FIG7 . The functions of the first and second devices of the system can be found in the description of FIG7 above and will not be detailed here.

[0209] An embodiment of the present application further provides a communication device, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. When the processor executes the instructions stored in the memory, the processor executes any of the range lock acquisition methods described in the first aspect or any of the range lock acquisition methods described in the second aspect.

[0210] It should be understood that the processor may be a CPU, or other general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced Reduced Instruction Set Machine (ARM) architecture.

[0211] Furthermore, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store device type information.

[0212] The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0213] An embodiment of the present application further provides a computer-readable storage medium, in which at least one program instruction or code is stored. When the program instruction or code is loaded and executed by a processor, the computer implements the range lock acquisition method executed by the first device in the method embodiment, or the range lock acquisition method executed by the second device.

[0214] An embodiment of the present application further provides a computer program or computer program product, which includes: computer program code, which, when executed by a computer, enables the computer to execute the range lock acquisition method performed by the first device in the method embodiment, or the range lock acquisition method performed by the second device.

[0215] An embodiment of the present application also provides a chip, including a processor, for calling and executing instructions stored in a memory from the memory. When the chip is installed in a first device, the first device executes the range lock acquisition method executed by the first device in the method embodiment. When the chip is installed in a second device, the second device executes the range lock acquisition method executed by the second device in the method embodiment.

[0216] Exemplarily, the chip further includes: an input interface, an output interface and a memory, the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the memory contains the above-mentioned program instructions or codes.

[0217] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program or computer program product. The computer program or computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0218] To clearly illustrate the interchangeability of hardware and software, the above description has generally described the steps and components of each embodiment according to their functions. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0219] The computer program code for implementing the methods of the embodiments of the present application can be written in one or more programming languages. These computer program codes can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable range lock acquisition device, so that when the program code is executed by the computer or other programmable range lock acquisition device, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the computer, partially on the computer, as a separate software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.

[0220] In the context of the embodiments of the present application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like. Examples of signals may include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.

[0221] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0222] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or can be electrical, mechanical or other forms of connection.

[0223] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0224] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.

[0225] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limit on quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various examples, a first device may be referred to as a second device, and similarly, a second device may be referred to as a first device.

[0226] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0227] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, a plurality of range locks means two or more range locks. The terms "system" and "network" are often used interchangeably herein.

[0228] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0229] It will also be understood that the term “comprise” (also known as “includes,” “including,” “comprises,” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0230] It should also be understood that, depending on the context, the phrase “if it is determined that…” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining…” or “in response to determining…” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event]”.

[0231] It should be understood that determining B based on A does not mean determining B based solely on A. B can also be determined based on A and / or other information.

[0232] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0233] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for acquiring a range lock, characterized in that: The method comprises: The first device obtains a first message sent by the second device, where the first message is used to request to obtain a first range lock, the first message includes a type and a range of the first range lock, and the first range lock is used to lock distributed stored data; The first device acquires a second range lock corresponding to the type of the first range lock; The first device determines whether an interval of the first range lock intersects an interval of the second range lock; Based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, the first device sends a second message to the second device, where the second message is used to instruct the second device to acquire the first range lock.

2. The method according to claim 1, characterized in that The interval of the first range lock includes a first endpoint and a second endpoint, and the first endpoint, the second endpoint, and the endpoints included in the interval of the second range lock are represented by numerical values; The determining whether the interval of the first range lock intersects with the interval of the second range lock includes: Acquire a first adjacent point and a second adjacent point of the first endpoint from the endpoints included in the interval of the second range lock, wherein the first adjacent point is an endpoint with the largest value among at least one first reference endpoint, and the value of the first reference endpoint is smaller than the value of the first endpoint, and the second adjacent point is an endpoint with the smallest value among at least one second reference endpoint, and the value of the second reference endpoint is larger than the value of the first endpoint; It is determined whether an interval of the first range lock intersects an interval of the second range lock according to the first adjacent point, the second adjacent point, and the second endpoint.

3. The method according to claim 2, characterized in that The number of the second range locks is multiple, and determining whether the interval of the first range lock intersects with the interval of the second range lock according to the first adjacent point, the second adjacent point and the second endpoint includes: In the case where the value of the second endpoint is greater than the value of the first endpoint, based on the fact that the first adjacent point is a fourth endpoint included in an interval of a second range lock, the second adjacent point is a fifth endpoint included in an interval of another second range lock, the value of the second endpoint is less than the value of the second adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the plurality of second range locks, it is determined that the interval of the first range lock does not intersect with the intervals of the plurality of second range locks; Among them, the interval including the fourth endpoint also includes a third endpoint, the value of the third endpoint is smaller than the value of the fourth endpoint, and the interval including the fifth endpoint also includes a sixth endpoint, and the value of the fifth endpoint is smaller than the value of the sixth endpoint.

4. The method according to claim 2, characterized in that: The number of the second range locks is multiple, and determining whether the interval of the first range lock intersects with the interval of the second range lock according to the first adjacent point, the second adjacent point and the second endpoint includes: In the case where the value of the second endpoint is smaller than the value of the first endpoint, based on the fact that the first adjacent point is a fourth endpoint included in an interval of a second range lock, the second adjacent point is a fifth endpoint included in an interval of another second range lock, the value of the second endpoint is larger than the value of the first adjacent point, and the interval of the first range lock is not included in the interval of any second range lock among the plurality of second range locks, it is determined that the interval of the first range lock does not intersect with the intervals of the plurality of second range locks; Among them, the interval including the fourth endpoint also includes a third endpoint, the value of the third endpoint is smaller than the value of the fourth endpoint, and the interval including the fifth endpoint also includes a sixth endpoint, and the value of the fifth endpoint is smaller than the value of the sixth endpoint.

5. The method according to any one of claims 2 to 4, characterized in that: The first device stores a multi-level search structure corresponding to the type, and the endpoints included in the interval of the second range lock are stored in the multi-level search structure; The acquiring, from the endpoints included in the interval of the second range lock, a first adjacent point and a second adjacent point of the first endpoint, comprises: The multi-level search structure is searched to obtain a first adjacent point and a second adjacent point of the first endpoint.

6. The method according to claim 5, characterized in that After sending the second message to the second device, the method further includes: The first device adds the first endpoint and the second endpoint to the multi-level search structure.

7. The method according to claim 6, characterized in that After adding the first endpoint and the second endpoint to the multi-level search structure, the method further includes: The first device obtains a third message sent by the second device, where the third message is used to request to release the first range lock, and the third message includes a type of the first range lock, a first endpoint, and a second endpoint; The first device obtains a multi-level search structure corresponding to the type; The first device deletes the first endpoint and the second endpoint from the multi-level search structure.

8. The method according to any one of claims 1 to 7, characterized in that: Based on the first range lock being a range lock with intersecting intervals, the second range lock includes a range lock with non-intersecting intervals acquired before the first range lock; Alternatively, based on the first range lock being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock.

9. The method according to any one of claims 1 to 8, characterized in that: The first device is any one of a switch, a server, a device including a field programmable gate array, a device including a smart network card, or a device including a data processing unit, and the second device is a client.

10. A method for acquiring a range lock, characterized in that: The method comprises: The second device sends a first message to the first device, where the first message is used to request to obtain a first range lock, the first message includes a type and a range of the first range lock, and the first range lock is used to lock distributed stored data; The second device receives a second message sent by the first device, where the second message is sent by the first device based on that an interval of the first range lock and an interval of a second range lock corresponding to the type do not intersect; The second device acquires the first range lock based on the second message.

11. The method according to claim 10, characterized in that After acquiring the first range lock, the method further includes: The second device sends a third message to the first device, where the third message is used to request to release the first range lock, and the third message includes a type and a range of the first range lock.

12. The method according to claim 10 or 11, characterized in that: Based on the first range lock being a range lock with intersecting intervals, the second range lock includes a range lock with non-intersecting intervals acquired before the first range lock; Alternatively, based on the first range lock being a range lock with non-intersecting intervals, the second range lock includes all range locks acquired before the first range lock.

13. The method according to any one of claims 10 to 12, characterized in that: The first device is any one of a switch, a server, a device including a field programmable gate array, a device including a smart network card, or a device including a data processing unit, and the second device is a client.

14. A range lock acquisition device, characterized in that: The device is applied to a first device, and includes: A first acquisition module, configured to acquire a first message sent by a second device, wherein the first message is used to request to acquire a first range lock, the first message includes a type and a range of the first range lock, and the first range lock is used to lock distributed stored data; A second acquisition module, configured to acquire a second range lock corresponding to the type of the first range lock; a determination module, configured to determine whether the interval of the first range lock intersects with the interval of the second range lock; The sending module is configured to send a second message to the second device based on the fact that the interval of the first range lock does not intersect with the interval of the second range lock, wherein the second message is used to instruct the second device to acquire the first range lock.

15. A range lock acquisition device, characterized in that: The device is applied to a second device, and includes: A sending module, configured to send a first message to a first device, wherein the first message is used to request a first range lock, the first message includes a type and a range of the first range lock, and the first range lock is used to lock distributed stored data; A first acquisition module, configured to receive a second message sent by the first device, where the second message is sent by the first device based on that an interval of the first range lock and an interval of a second range lock corresponding to the type do not intersect; A second acquisition module is configured to acquire the first range lock based on the second message.

16. A range lock acquisition system, characterized in that: The system comprises a first device and a second device, wherein the first device is used to execute the method according to any one of claims 1 to 9, and the second device is used to execute the method according to any one of claims 10 to 13.

17. A computer system, characterized in that: The computer system comprises: a processor, and when the processor executes program instructions or codes, the computer system implements the method according to any one of claims 1 to 13.

18. The computer system according to claim 17, characterized in that: The computer system further comprises: a memory, wherein the memory is used to store the program instructions or codes.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program instruction or code, and when the program instruction or code is loaded and executed by the processor, the computer implements the method according to any one of claims 1 to 13.

20. A chip, characterized in that: The chip includes a processor, which is used to call and execute instructions stored in the memory from the memory. When the chip is installed in a first device, the first device executes the method described in any one of claims 1 to 9. When the chip is installed in a second device, the second device executes the method described in any one of claims 10 to 13.

Citation Information

Patent Citations

  • Range lock obtaining method, device and system and computer readable storage medium

    CN119066039A

  • Implementation method and device of range lock

    CN104391935A

  • Data storage method, metadata server and client

    CN110968563A

  • File lock management method and device of distributed file system and medium

    CN115951844A

  • Scalable Range Locks

    US20200265091A1