Distributed lock management method and system supporting dynamic load balancing

By using programmable switches in a distributed lock management system to monitor the access frequency of lock managers and realize dynamic migration of locks, the problem of difficulty in realizing dynamic load balancing in the prior art is solved, and the accuracy and real-timeness of load balancing are improved.

CN119892837APending Publication Date: 2025-04-25SHANGHAI JIAOTONG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510093597.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Existing distributed lock management technology is difficult to achieve dynamic load balancing among lock managers under workloads where hot spots change, resulting in some lock managers being overloaded while others having a lot of computing power idle.

Method used

The access frequency of each lock manager is monitored by a programmable switch located in the center of the network within the rack and perform dynamic migration of the lock when the total frequency of the lock request exceeds a preset threshold, transferring it to the server with the lowest frequency of the current request processing.

Benefits of technology

It achieves higher load balancing accuracy and real-time, reduces migration time and complexity, maintains the transparency of dynamic load balancing to applications, and reduces network overhead for lock operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892837A_ABST
    Figure CN119892837A_ABST
Patent Text Reader

Abstract

The invention provides a distributed lock management method and system supporting dynamic load balancing. The method comprises a lock taking or unlocking step and a migration step. When the client accesses the shared data, a lock request is sent to the server; enabling the server side to execute a lock taking or unlocking step; and if the total frequency of the server receiving the lock request exceeds a preset threshold, executing the migration step. According to the method, the access frequency of each lock manager is tracked by using the position advantage of the programmable switch in the network center in the rack, and the lock dynamic migration target is selected according to the access frequency, so that the method has higher accuracy and real-time performance; compared with a load balancing mechanism based on a server, the time spent from migration decision to migration completion is reduced by 50%, and the accuracy of migration target decision is improved to 100%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of distributed lock management technology, and in particular, relates to a distributed lock management method and system supporting dynamic load balancing. More particularly, it relates to a distributed lock management method, system and device supporting dynamic load balancing. Background Art

[0002] In a distributed system, in order to support concurrent access to the same shared data by different servers, the application thread needs to acquire a lock before accessing the data to ensure its temporary exclusivity over the data. After the data access is completed, the application thread needs to release the lock and transfer the exclusive right to the data to other application threads. The same lock can only be held by one application thread at a time, and this application thread is called the lock holder. In order to serve the lock acquisition and lock release requests of application threads, distributed applications generally set up lock managers to maintain the metadata of all locks and respond to the requests of application threads. The lock acquisition requests and lock release requests are collectively referred to as lock requests.

[0003] However, as the number of application threads increases and the frequency of requests increases, the lock manager needs more computing resources to process lock acquisition and lock release requests. Due to the limited computing resources on each server, existing distributed lock management technologies often set up a lock manager on each server and statically divide the locks among these managers for separate management. All application threads know in advance which server's lock manager is responsible for managing each lock, and directly send network requests to the corresponding server when acquiring or releasing a lock.

[0004] Although this static partitioning method can improve the overall efficiency of lock request processing under uniform access workloads, it will cause serious load imbalance problems under uneven distribution, that is, offset distribution, workloads.

[0005] Specifically, since most lock requests are directed to a few hot locks, the lock managers that manage these locks will be overloaded, while the lock managers that manage other locks will have a lot of idle computing power. This will not only cause requests directed to hot locks to queue and show higher tail latency, but also waste computing power allocated to lock managers that manage non-hot locks.

[0006] Some existing technologies use a priori analysis of workload characteristics to derive the approximate frequency of each lock being accessed, and divide the locks accordingly to ensure that each lock manager needs to process lock requests at a similar frequency. Although this solution can work well under workloads with fixed hotspots, once the hotspot changes, the pre-determined allocation solution will no longer balance the load, and may instead aggravate the load imbalance.

[0007] Therefore, the existing lock management technology lacks a means to dynamically change the lock division method, and cannot achieve dynamic load balancing between lock managers under a workload with changing hot spots.

[0008] The key to achieving dynamic load balancing is to support dynamic migration of lock metadata between lock managers. In the prior art, to change the lock manager where a lock is located, it is necessary to notify all application threads to change the target server to which they send network requests when taking or releasing the lock. In the case of a large number of application threads, this approach will greatly reduce the efficiency of migration and increase the complexity of migration. In addition, the lock manager does not know which lock managers are relatively idle at the moment, so when the frequency of its own request processing is too high and migration is required, it is difficult to decide which lock manager to migrate the lock to.

[0009] Patent document CN113254226A discloses an asymmetric distributed lock system and implementation method for asymmetric business scenarios. The solution includes a service node, and the service node includes a distributed lock manager. The distributed lock manager is connected to the local lock manager; the local lock manager is used to maintain the local lock queue and the network lock queue; the distributed lock manager accepts the lock operation request issued by the client, and performs subsequent operations according to the type of the lock operation request. By designing the shared lock and the exclusive lock as a local lock and a network lock, the lock with a higher number of operations can be designed as a local lock and the other as a network lock according to different asymmetric business scenarios, so that the two have different locking methods, and the local lock completely avoids network communication, thereby improving the performance of the shared lock or exclusive lock as a local lock. However, this solution cannot solve the problem that dynamic load balancing between lock managers is difficult to balance and the migration complexity is high.

[0010] This problem needs to be solved urgently. Summary of the invention

[0011] In view of the defects in the prior art, an object of the present invention is to provide a distributed lock management method and system supporting dynamic load balancing.

[0012] A distributed lock management method supporting dynamic load balancing according to the present invention includes: a lock taking or lock releasing step and a migration step;

[0013] When the client accesses shared data, it sends a lock request to the server; the server executes the lock acquisition or release steps;

[0014] The total frequency of lock requests received by the server exceeds the preset threshold and the migration step is executed.

[0015] Preferably, the lock-taking or lock-releasing step includes:

[0016] Step A1: Sending a lock packet; the lock packet includes a lock-taking network packet or a lock-releasing network packet;

[0017] Step A2: updating the request processing frequency of the lock manager according to the lock packet, and forwarding the lock packet to the server of the lock manager;

[0018] Step A3: Determine whether the lock package is managed by the manager of the lock. If yes, execute step A4; if no, execute step A2 again.

[0019] Step A4: instruct the lock manager to process the request and return a response network packet to the application thread of the server;

[0020] The migration steps include:

[0021] Step B1: Determine whether the target lock needs to be migrated. If yes, delete the lock and send a migration network packet; if no, do not process;

[0022] Step B2: updating the server ID of the lock manager of the lock to the target server, and transferring the migration network packet to the target server; the target server is the server with the lowest request processing frequency;

[0023] Step B3: Instruct the target server to copy the lock metadata of the migration network packet, and add the lock that needs to be migrated in step B1 to the index.

[0024] Preferably, in step A1, the type of the lock package includes lock taking, lock releasing, response or migration; the content of the lock package includes: type, server ID where the application thread is located, requested lock ID, lock taking application thread ID and lock releasing application thread ID; the type is the type of the lock package;

[0025] In step A2, the process of forwarding the lock package to the server of the lock manager includes:

[0026] Step A2.1: According to the type of the lock package, query the server ID where the application thread corresponding to the requested lock ID is located; update the request processing frequency of the lock manager;

[0027] Step A2.2: translating the server ID where the application thread is located into an egress port; forwarding the lock packet to the egress port;

[0028] In the step A3, the requested lock ID is used as a keyword for indexing to determine whether the lock package is managed by the lock manager; each server is provided with a lock manager;

[0029] In step A4, the lock manager processes the request and obtains a processing result; the processing result includes: operation success or operation failure.

[0030] Preferably, in step B1, the migration network packet includes: type, lock ID to be migrated, and lock metadata; the type is migration;

[0031] In the step B2, according to the type of the migration network packet, the server ID where the corresponding application thread is located is translated into an egress port, and the migration network packet is sent to the target server.

[0032] A distributed lock management system supporting dynamic load balancing according to the present invention includes: a lock taking or releasing module and a migration module;

[0033] When the client accesses shared data, it sends a lock request to the server, which triggers the lock-taking or lock-releasing module to work.

[0034] The total frequency of lock requests received by the server exceeds the preset threshold, triggering the migration module to work.

[0035] Preferably, the lock taking or lock releasing module includes:

[0036] Module A1: Sending a lock packet; the lock packet includes a lock-taking network packet or a lock-releasing network packet;

[0037] Module A2: updating the request processing frequency of the lock manager according to the lock package, and forwarding the lock package to the server of the lock manager;

[0038] Module A3: Determine whether the lock package is managed by the manager of the lock. If yes, trigger module A4 to work; if no, re-trigger module A2 to work;

[0039] Module A4: instructing the lock manager to process the request and return a response network packet to the application thread of the server;

[0040] The migration module comprises:

[0041] Module B1: Determine whether the target lock needs to be migrated. If yes, delete the lock and send a migration network packet; if no, do not process;

[0042] Module B2: updating the server ID of the lock manager of the lock to the target server, and transferring the migration network packet to the target server; the target server is the server with the lowest request processing frequency;

[0043] Module B3: instruct the target server to copy the lock metadata of the migration network packet, and add the locks to be migrated in module B1 to the index.

[0044] Preferably, in the module A1, the type of the lock package includes lock taking, lock releasing, response or migration; the content of the lock package includes: type, server ID where the application thread is located, requested lock ID, lock taking application thread ID and lock releasing application thread ID; the type is the type of the lock package;

[0045] In the module A2, the process of forwarding the lock package to the server of the lock manager includes:

[0046] Module A2.1: According to the type of the lock package, query the server ID where the application thread corresponding to the requested lock ID is located; update the request processing frequency of the lock manager;

[0047] Module A2.2: Translate the server ID where the application thread is located into an egress port; forward the lock packet to the egress port;

[0048] In the module A3, the requested lock ID is used as a keyword for indexing to determine whether the lock package is managed by the lock manager; each server is provided with a lock manager;

[0049] In the module A4, the lock manager processes the request and obtains a processing result; the processing result includes: operation success or operation failure.

[0050] Preferably, in the module B1, the migration network packet includes: type, lock ID to be migrated, and lock metadata; the type is migration;

[0051] In the module B2, according to the type of the migration network packet, the server ID where the corresponding application thread is located is translated into an egress port, and the migration network packet is sent to the target server.

[0052] According to a computer-readable storage medium storing a computer program provided by the present invention, when the computer program is executed by a processor, the steps of the distributed lock management method supporting dynamic load balancing are implemented.

[0053] An electronic device provided according to the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the distributed lock management method supporting dynamic load balancing are implemented.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. The present invention uses the location advantage of the programmable switch in the network center of the rack to track the access frequency of each lock manager, and selects the dynamic migration target of the lock based on this, which has higher accuracy and real-time performance; compared with the server-based load balancing mechanism, the time spent from migration decision to migration completion is reduced by 50%, and the accuracy of migration target decision is improved to 100%.

[0056] 2. The present invention utilizes a programmable switch to record the server where the current manager of each lock is located, so that the application thread does not need to care which server the request should be sent to when taking or releasing the lock, thereby maintaining the transparency of dynamic load balancing to the application and being easy to use.

[0057] 3. The present invention utilizes the powerful packet processing capability of the programmable switch to implement a dynamic load balancing mechanism, minimizing the impact of the dynamic load balancing function on the performance of normal lock-taking and lock-releasing operations; compared with the server-based load balancing mechanism, there is no need to make an additional network request during each lock operation, and the network overhead of the lock operation is reduced by 50%. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0059] Figure 1 A flowchart of taking and releasing a lock provided by the present invention;

[0060] Figure 2 A dynamic migration flow chart provided by the present invention;

[0061] Figure 3 This is a schematic diagram of the hardware device structure provided by the present invention. DETAILED DESCRIPTION

[0062] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0063] The present invention provides a distributed lock management method and device supporting dynamic load balancing, which distributes distributed lock objects to lock managers located on different servers for management, and uses the location advantage of a programmable switch device located in the network center of a rack to monitor the latest managers of all lock objects. When an application makes a network request to take or release a lock, the switch forwards the request to the server where the current manager of the lock is located when the request passes. Lock managers can periodically transfer the locks they manage to other lock managers for management through network requests, and these requests will update the manager information of the corresponding locks on the switch. Compared with the prior art, the present invention can better support the dynamic balancing of lock request processing loads among lock managers, and avoid a certain manager becoming a bottleneck.

[0064] The distributed lock management method supporting dynamic load balancing provided by the present invention includes lock acquisition, lock release and migration operations, wherein the steps of the lock acquisition or lock release operation of the application thread include:

[0065] Step 1.1: The application thread sends a lock acquisition or lock release network packet to the switch.

[0066] Step 1.2: The switch updates the request processing frequency of the lock manager responsible for managing the lock, and forwards the network packet to the server where the lock manager is located.

[0067] Step 1.3: The lock manager on the server described in step 1.2 checks whether the requested lock is managed by itself. If so, it continues to execute step 1.4. Otherwise, it returns the network packet to the switch and repeats from step 1.2.

[0068] Step 1.4: The lock manager on the server described in step 1.2 processes the request and sends a response network packet to the switch.

[0069] Step 1.5: The switch forwards the network packet to the server where the requester is located.

[0070] Step 1.6: The application thread on the server described in step 1.5 receives the response network packet and completes the lock acquisition or release operation.

[0071] The steps of the migration operation include:

[0072] Step 2.1: The lock manager deletes the lock that needs to be migrated from its own index and sends a migration network packet to the switch.

[0073] Step 2.2: The switch updates the server ID of the lock manager of the lock to be migrated to the server with the lowest current request processing frequency, and forwards the network packet to the server.

[0074] Step 2.3: The target server receives the network packet, copies the lock metadata from the network packet to its own memory, and adds the lock to be migrated to its own index.

[0075] Specifically, the network packet for taking or releasing the lock in step 1.1 includes the type of packet, the server ID where the application thread is located, the requested lock ID and the application thread ID for taking or releasing the lock. The type of the packet includes taking the lock, releasing the lock, replying or migrating;

[0076] Specifically, the forwarding process in step 1.2 includes determining the type of packet, querying the server ID corresponding to the requested lock ID, translating the ID into an egress port, and sending the network packet from the egress port.

[0077] Specifically, the lock manager in step 1.3 records the lock list managed by the lock manager through an index, and the checking step refers to searching the index by using the requested lock ID as a keyword. Each server is only provided with one lock manager.

[0078] Specifically, the response network packet in step 1.4 includes the type of packet, i.e., response, the server ID where the application thread is located, the requested lock ID, the application thread ID for taking or releasing the lock, and the processing result; the processing result includes operation success or operation failure.

[0079] Specifically, the migration network packet in step 2.1 includes the type of packet, ie, migration, the lock ID to be migrated, and the lock metadata to be migrated.

[0080] Specifically, the forwarding process in step 2.2 includes determining the type of the packet, ie, migrating, translating the server ID where the application thread in the packet is located into an egress port, and sending the network packet from the egress port.

[0081] A programmable switch device located in the network center of a rack maintains a mapping relationship from server ID to output port in its memory, records the server ID of each current lock manager, and records the frequency of requests processed by each current lock manager.

[0082] Example:

[0083] like Figure 1 As shown in the figure, the specific process of lock acquisition and lock release operation in the distributed lock management method supporting dynamic load balancing of the present invention. Figure 1 The following lock management steps are described in detail:

[0084] In this embodiment, there are 5 servers connected to the same switch.

[0085] The five servers include: server 1, server 2, server 3, server 4 and server 5;

[0086] Among them, server 1, server 2, and server 3 run application threads, and server 4 and server 5 run lock managers.

[0087] In step 101, the application thread sends a lock request. In this embodiment, the lock ID is 1, the application thread ID is 2, and the server ID where the application thread is located is 1;

[0088] In step 102, the switch finds that the lock manager corresponding to lock 1 is located on server 4;

[0089] In step 103, the switch increases the request processing frequency of server 4 by one;

[0090] In step 104, the switch forwards the network packet to the server 4;

[0091] In step 105, the lock manager on server 4 receives the network packet and searches its own index for the lock with ID 1;

[0092] In step 107, the lock manager successfully finds the metadata of lock 1, processes the lock acquisition request for lock 1, and sends a response network packet for lock 1 and application thread 2 to server 1;

[0093] In step 108, the switch forwards the response network packet to server 1;

[0094] In step 109, application thread 2 receives the response network packet and completes the lock acquisition operation.

[0095] like Figure 2 As shown in the figure, the specific process of dynamic migration in the distributed lock management method supporting dynamic load balancing of the present invention is shown. Figure 2 The following lock management steps are described in detail:

[0096] In step 201, lock manager A deletes the lock that needs to be migrated from its own index. In this embodiment, the ID of the server where lock manager A is located is 4, and the ID of the lock that needs to be migrated is 1;

[0097] In step 202, lock manager A sends a network packet containing lock metadata migration to the switch;

[0098] In step 203, the switch finds that the server with the lowest current request processing frequency is server 5;

[0099] In step 204, the switch updates the lock manager server corresponding to lock 1 to server 5;

[0100] In step 205, the switch forwards the migration network packet to server 5;

[0101] In step 206, lock manager B on server 5 copies the lock metadata from the network packet to its own memory;

[0102] In step 207, lock manager B creates a mapping between lock ID (1) and lock metadata in its own index.

[0103] like Figure 3 As shown, the software in the present invention is deployed in a computer cluster. The network cards on each machine in the cluster connect these computers to the same programmable switch via network cables.

[0104] The present invention also provides a distributed lock management system that supports dynamic load balancing. The distributed lock management system that supports dynamic load balancing can be implemented by executing the process steps of the distributed lock management method that supports dynamic load balancing, that is, those skilled in the art can understand the distributed lock management method that supports dynamic load balancing as a preferred implementation of the distributed lock management system that supports dynamic load balancing.

[0105] A distributed lock management system supporting dynamic load balancing according to the present invention includes: a lock taking or releasing module and a migration module;

[0106] When the client accesses shared data, it sends a lock request to the server, which triggers the lock-taking or lock-releasing module to work.

[0107] The total frequency of lock requests received by the server exceeds the preset threshold, triggering the migration module to work.

[0108] According to a computer-readable storage medium storing a computer program provided by the present invention, when the computer program is executed by a processor, the steps of the distributed lock management method supporting dynamic load balancing are implemented.

[0109] An electronic device provided according to the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the distributed lock management method supporting dynamic load balancing are implemented.

[0110] According to a programmable switch device located in a network center within a rack provided by the present invention, the programmable switch device can maintain a mapping relationship from a server ID to an output port, record the server ID of the current lock manager, and record the frequency of requests processed by each current lock manager in the steps of the distributed lock management method supporting dynamic load balancing.

[0111] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0112] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A distributed lock management method supporting dynamic load balancing, characterized in that: include: The lock-taking or lock-releasing steps and the migration steps; When the client accesses shared data, it sends a lock request to the server; Instruct the server to execute the lock-taking or lock-releasing steps; The total frequency of lock requests received by the server exceeds the preset threshold and the migration step is executed.

2. The distributed lock management method supporting dynamic load balancing according to claim 1, characterized in that: The lock-taking or lock-releasing step includes: Step A1: Sending a lock packet; the lock packet includes a lock-taking network packet or a lock-releasing network packet; Step A2: updating the request processing frequency of the lock manager according to the lock packet, and forwarding the lock packet to the server of the lock manager; Step A3: Determine whether the lock package is managed by the manager of the lock. If yes, execute step A4; if no, execute step A2 again. Step A4: instruct the lock manager to process the request and return a response network packet to the application thread of the server; The migration steps include: Step B1: Determine whether the target lock needs to be migrated. If yes, delete the lock and send a migration network packet; if no, do not process; Step B2: updating the server ID of the lock manager of the lock to the target server, and transferring the migration network packet to the target server; the target server is the server with the lowest request processing frequency; Step B3: Instruct the target server to copy the lock metadata of the migration network packet, and add the lock that needs to be migrated in step B1 to the index.

3. The distributed lock management method supporting dynamic load balancing according to claim 2, characterized in that: In step A1, the type of the lock packet includes lock acquisition, lock release, response or migration; the content of the lock packet includes: type, server ID where the application thread is located, requested lock ID, lock acquisition application thread ID and lock release application thread ID; In step A2, the process of forwarding the lock package to the server of the lock manager includes: Step A2.1: According to the type of the lock package, query the server ID where the application thread corresponding to the requested lock ID is located; update the request processing frequency of the lock manager; Step A2.2: translating the server ID where the application thread is located into an egress port; forwarding the lock packet to the egress port; In the step A3, the requested lock ID is used as a keyword for indexing to determine whether the lock package is managed by the lock manager; each server is provided with a lock manager; In step A4, the lock manager processes the request and obtains a processing result; the processing result includes: operation success or operation failure.

4. The distributed lock management method supporting dynamic load balancing according to claim 3, characterized in that: In step B1, the migration network packet includes: type, lock ID to be migrated, and lock metadata; the type is migration; In the step B2, according to the type of the migration network packet, the server ID where the corresponding application thread is located is translated into an egress port, and the migration network packet is sent to the target server.

5. A distributed lock management system supporting dynamic load balancing, characterized in that: Includes: including: lock taking or lock releasing module and migration module; When the client accesses shared data, it sends a lock request to the server, which triggers the lock-taking or lock-releasing module to work. The total frequency of lock requests received by the server exceeds the preset threshold, triggering the migration module to work.

6. The distributed lock management system supporting dynamic load balancing according to claim 5, characterized in that: The lock taking or lock releasing module includes: Module A1: Sending a lock packet; the lock packet includes a lock-taking network packet or a lock-releasing network packet; Module A2: updating the request processing frequency of the lock manager according to the lock package, and forwarding the lock package to the server of the lock manager; Module A3: Determine whether the lock package is managed by the manager of the lock. If yes, trigger module A4 to work; if no, re-trigger module A2 to work; Module A4: instructing the lock manager to process the request and return a response network packet to the application thread of the server; The migration module comprises: Module B1: Determine whether the target lock needs to be migrated. If yes, delete the lock and send a migration network packet; if no, do not process; Module B2: updating the server ID of the lock manager of the lock to the target server, and transferring the migration network packet to the target server; the target server is the server with the lowest request processing frequency; Module B3: instruct the target server to copy the lock metadata of the migration network packet, and add the locks to be migrated in module B1 to the index.

7. The distributed lock management system supporting dynamic load balancing according to claim 6, characterized in that: In the module A1, the types of the lock packet include lock taking, lock releasing, response or migration; the contents of the lock packet include: type, server ID where the application thread is located, requested lock ID, lock taking application thread ID and lock releasing application thread ID; In the module A2, the process of forwarding the lock package to the server of the lock manager includes: Module A2.1: According to the type of the lock package, query the server ID where the application thread corresponding to the requested lock ID is located; update the request processing frequency of the lock manager; Module A2.2: Translate the server ID where the application thread is located into an egress port; forward the lock packet to the egress port; In the module A3, the requested lock ID is used as a keyword for indexing to determine whether the lock package is managed by the lock manager; each server is provided with a lock manager; In the module A4, the lock manager processes the request and obtains a processing result; the processing result includes: operation success or operation failure.

8. The distributed lock management system supporting dynamic load balancing according to claim 7, characterized in that: In the module B1, the migration network packet includes: type, lock ID to be migrated, and lock metadata; the type is migration; In the module B2, according to the type of the migration network packet, the server ID where the corresponding application thread is located is translated into an egress port, and the migration network packet is sent to the target server.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the distributed lock management method supporting dynamic load balancing according to any one of claims 1 to 4 are implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by a processor, the steps of the distributed lock management method supporting dynamic load balancing according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Cluster distributed type lock management method based on storage area network SAN

    CN101252603A

  • Lock migration method and device

    CN103488530A

  • Distributed lock migration method and device, electronic equipment and storage medium

    CN111858079A

  • Distributed lock management method and device

    CN113076187A

  • Distributed controller cluster load balancing system

    CN113641499A