Database fast path lock management method and related product

By dynamically managing the storage format of fast path locks, and combining sequential storage and hash table storage, the problem of lock requests exceeding the array size in high-concurrency environments is solved, thus improving the performance of the database system.

CN120973803APending Publication Date: 2025-11-18CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511081653.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In high-concurrency environments, the existing fast path lock array has a fixed number of bits, which means that when lock requests exceed the array's bit length, the main lock table must be used, increasing system performance bottlenecks.

Method used

By dynamically managing the storage format of fast path locks, combining sequential storage and hash table storage, the storage format is switched according to the process usage to meet storage requirements and reduce the frequency of lock-related events.

Benefits of technology

In high-concurrency environments, it reduces system performance bottlenecks and improves the overall performance of the database system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973803A_ABST
    Figure CN120973803A_ABST
Patent Text Reader

Abstract

The invention provides a database fast path lock management method and related products. The management method comprises the steps that a target process of a database locally stores a plurality of fast path locks in a first storage form, and the first storage form comprises sequential storage and is configured with a preset maximum storage bit number; according to the use condition of the fast path lock of the target process within the preset time, judging whether the preset maximum storage bit meets the storage requirement of the target process or not; and if not, using a second storage form to store each fast path lock of the target process, the second storage form including hash table storage. According to the method, the fast path lock of the database is dynamically managed, the occurrence frequency of lock-related events causing system performance bottlenecks is reduced, and the effect of improving the database system performance in a high-concurrency environment is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database, and in particular, to a database fast path lock management method, a computer readable storage medium, a computer program product and a computer device. BACKGROUND

[0002] In a database management system (DBMS), a lock management mechanism is usually used to ensure data consistency between concurrent transactions in a database. Specifically, the lock management mechanism uses a master lock table to manage all lock requests and release operations. When a transaction needs to acquire a lock on a certain resource, it needs to query the master lock table to check whether there is another transaction holding a lock on the resource. If the relevant entry in the master lock table is occupied, the transaction initiating the lock request may need to wait until the lock is available.

[0003] In related technologies, in order to reduce the resource overhead caused by frequent locking and unlocking operations, a fast path locking mechanism is introduced. This mechanism allows each backend process to record a fixed number of locks (called fast path locks) in the form of sequential storage (such as a fast path array) in the local process of the process, instead of accessing the master lock table every time a request is made. In the fast path locking mechanism, only compatible (non-conflicting) locks can use fast path locking, and if a process applies for a lock that may cause a conflict, the master lock table still needs to be used.

[0004] However, the number of bits of the existing fast path array is a fixed value (such as 16 bits), and can only store fast path locks that do not exceed the number of bits of the fast path array. If the number of lock requests exceeds the number of bits of the fast path array, the master lock table still needs to be used for locking and unlocking operations. In actual use of a database, in some high-concurrency environments, it is easy to exceed this limit, resulting in a system performance bottleneck. SUMMARY

[0005] An object of the present application is to provide a database fast path lock management method, a computer readable storage medium, a computer program product and a computer device to dynamically manage the fast path locks of a database, reduce the frequency of lock-related events that cause system performance bottlenecks, and achieve the effect of improving the performance of a database system in a high-concurrency environment.

[0006] Specifically, according to one aspect of the present application, the present application provides a database fast path lock management method, comprising:

[0007] The target process of the database stores a plurality of fast path locks locally using a first storage form, the first storage form comprising sequential storage and being configured with a preset maximum storage bit number;

[0008] Based on the usage of the fast path lock of the target process within a preset time, determine whether the preset maximum storage bits meet the storage requirements of the target process.

[0009] If the conditions are not met, then the fast path locks of the target process are stored using a second storage method, which includes hash table storage.

[0010] Optionally, determining whether the preset maximum storage size meets the storage requirements of the target process based on the usage of the fast path lock of the target process within a preset time includes:

[0011] The number of stored fast path locks of the target process is periodically collected;

[0012] Calculate the first frequency of the event in which the number of stored fast path locks of the target process reaches the preset maximum storage bits within multiple periods;

[0013] If the first frequency is greater than the first preset threshold, it is determined that the preset maximum storage bits do not meet the storage requirements of the target process.

[0014] Optionally, determining whether the preset maximum storage size meets the storage requirements of the target process based on the usage of the fast path lock of the target process within a preset time includes:

[0015] Periodically collect the wait events of the fast path lock of the target process;

[0016] Calculate the second frequency of the wait event for the fast path lock of the target process within multiple cycles;

[0017] If the second frequency is greater than the second preset threshold, it is determined that the preset maximum storage bits do not meet the storage requirements of the target process.

[0018] Optionally, if the above conditions are not met, after storing each of the fast path locks of the target process in the second storage format, the steps further include:

[0019] Periodically acquire the wait events for the fast path lock of the target process;

[0020] Calculate the third frequency of the wait event for the fast path lock of the target process within multiple cycles;

[0021] If the third frequency is less than the third preset threshold, then the first storage format is used to store the fast path locks of the target process, wherein the third preset threshold is less than or equal to the second preset threshold.

[0022] Optionally, after the step of storing each of the fast path locks of the target process in the second storage form if the preset maximum storage bit number does not meet the storage requirement of the target process, the method further comprises:

[0023] acquiring a usage of the fast path locks of the target process within a preset time, and determining whether the preset maximum storage bit number meets a storage requirement of the target process;

[0024] if yes, switching to store each of the fast path locks of the target process in the first storage form.

[0025] Optionally, before the step of storing the plurality of fast path locks of the target process of the database in the first storage form locally, the method further comprises:

[0026] in a case where the database performs initialization, acquiring reference information of the database related to the fast path locks of the target process, the reference information comprising configuration file information and environment variable information related to the fast path locks of the target process;

[0027] determining the preset maximum storage bit number according to the reference information.

[0028] Optionally, before the step of storing the plurality of fast path locks of the target process of the database in the first storage form locally, the method further comprises:

[0029] in a case where the database performs initialization, acquiring reference information of the database related to the fast path locks of the target process, the reference information comprising configuration file information and environment variable information related to the fast path locks of the target process;

[0030] determining a first candidate preset maximum storage bit number of the target process according to the reference information;

[0031] determining whether a second candidate preset maximum storage bit number has been set by a user;

[0032] if yes, taking the second candidate preset maximum storage bit number as the preset maximum storage bit number;

[0033] if no, taking the first candidate preset maximum storage bit number as the preset maximum storage bit number.

[0034] According to another aspect of the present application, there is also provided a computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned database fast path lock management methods.

[0035] According to still another aspect of the present application, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the above database fast path lock management methods.

[0036] According to still another aspect of the present application, there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps of any of the above database fast path lock management methods.

[0037] The database fast path lock management method of the present application, by acquiring the usage of the fast path lock of the target process and switching the storage form of the fast path lock according to whether the preset maximum storage bit number meets the storage requirement of the target process, dynamically manages the fast path lock of the database, reduces the frequency of lock-related events that cause system performance bottleneck, and achieves the effect of improving the performance of the database system in a high concurrency environment.

[0038] The above and other objects, advantages and features of the present application will become more apparent from the following detailed description of some embodiments thereof, when taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0039] Some specific embodiments of the present application will be described in detail below with reference to the accompanying drawings, which are presented by way of illustration and not of limitation. Like or similar components or parts are designated with like reference numerals in the drawings. It should be understood by those skilled in the art that the drawings are not necessarily drawn to scale. In the drawings:

[0040] Figure 1 is a flowchart of a database fast path lock management method according to an embodiment of the present application;

[0041] Figure 2 is a flowchart of judging whether a preset maximum storage bit number meets the requirement according to the management method of an embodiment of the present application;

[0042] Figure 3 is a flowchart of dynamically switching the storage form of the fast path lock according to the management method of an embodiment of the present application;

[0043] Figure 4 is a flowchart of dynamically switching the storage form of the fast path lock according to the management method of another embodiment of the present application;

[0044] Figure 5 is a flowchart of determining the preset maximum storage bit number according to the management method of an embodiment of the present application;

[0045] Figure 6is a flowchart of determining a preset maximum storage bit number of a management method according to another embodiment of the present application;

[0046] Figure 7 is a schematic diagram of a computer program product according to an embodiment of the present application;

[0047] Figure 8 is a schematic diagram of a computer readable storage medium according to an embodiment of the present application; and

[0048] Figure 9 is a schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0049] The purpose of the management method of the database fast path lock of the present embodiment is to dynamically manage the database fast path lock, reduce the frequency of lock-related events that cause system performance bottlenecks, and achieve the effect of improving the performance of the database system in a high-concurrency environment.

[0050] Figure 1 is a flowchart of a management method of a database fast path lock according to an embodiment of the present application, which can generally include:

[0051] S300, the target process of the database stores a plurality of fast path locks in a first storage form locally, the first storage form includes sequential storage, and is configured with a preset maximum storage bit number;

[0052] S500, according to the usage of the fast path lock of the target process within a preset time, it is judged whether the preset maximum storage bit number meets the storage requirement of the target process;

[0053] S700, if not, store each fast path lock of the target process using a second storage form, and the second storage form includes hash table storage.

[0054] In the present embodiment, the target process can be a service process of the database, such as a backend process. The sequential storage (also referred to as linear storage) for storing the fast path lock can be array storage, i.e., a fast path array (also referred to as a fast path lock slot). The preset maximum storage bit number is the bit number (also referred to as the slot bit) of the fast path array, which is usually a fixed preset value (such as 16 bits). A fast path array can only store fast path locks that do not exceed the preset maximum storage bit number. If the number of lock requests exceeds the bit number of the fast path array, the master lock table still needs to be used for locking and unlocking operations.

[0055] The preset maximum storage bit number of the fast path array relates to the core structure of the database data, and generally cannot be extended or dynamically adjusted at runtime, and the value of the preset maximum storage bit number cannot be increased online. Although the value of the preset maximum storage bit number can be adjusted when the database is started (initialized), for example, from 16 to 32 bits. However, the fast path array belongs to sequential storage, and increasing the preset maximum storage bit number means that the fast path array must traverse more slots each time it is locked, which will use more lookup time and increase storage delay. Since the fast path array is designed for low delay and low overhead, excessively increasing the preset maximum storage bit number will not be worth the cost.

[0056] To dynamically manage the fast path locks of the database, the inventors of the present application have improved the storage mode of the fast path locks. Specifically, two storage modes are preset in the database, one is a first storage form, that is, a fast path array based on sequential storage. The other is a second storage form, that is, hash table storage (also known as hash storage or hash storage). Among them, the fast path array has lower delay, lower memory occupation and lower overhead, but can only store fast path locks that do not exceed the preset maximum storage bit number. The hash table storage can store more fast path locks, has lower delay, but higher memory occupation and higher overhead.

[0057] In this embodiment, the storage form of the fast path locks of the database can be dynamically switched between the first storage form and the second storage form to dynamically adapt to the actual use environment of the database. Specifically, after the database is started, the first storage form can be used by default. During the use of the database, the use of the fast path locks of the target process within a preset time can be obtained, the load of the database is judged by the use, whether the database is in a high concurrency environment is judged, and whether the preset maximum storage bit number meets the storage demand of the target process is judged. When it is determined that the database is in a low-load, low-concurrency environment, or the preset maximum storage bit number meets the storage demand of the target process, the current storage form is maintained, and lower memory and lower overhead are used while maintaining lower delay. When it is determined that the database is in a high-load, high-concurrency environment, or the preset maximum storage bit number cannot meet the storage demand of the target process, the first storage form is switched to the second storage form to store more fast path locks to meet the demand of the target process. Although the second storage form uses higher memory and higher overhead, it can maintain lower delay, reduce lock competition, reduce the frequency of lock-related events that cause system performance bottlenecks, and improve the overall running speed of the database.

[0058] Exemplarily, when switching the first storage form into the second storage form, all processes currently existing in the database can be first notified that the data will be converted from the sequential storage into the hash table storage, and then the conversion is performed. The conversion process includes creating a new hash structure, migrating existing elements, and converting the traversal fast path array operation when the lock is released into the hash table operation, etc.

[0059] The management method of the database fast path lock of the application acquires the usage of the fast path lock of the target process, and switches the storage form of the fast path lock according to whether the preset maximum storage bit number meets the storage requirement of the target process, so as to dynamically manage the fast path lock of the database, reduce the frequency of the lock-related events causing the system performance bottleneck, and achieve the effect of improving the performance of the database system in the high concurrency environment.

[0060] In some embodiments of the management method of the database fast path lock of the application, as shown in Figure 2 According to the usage of the fast path lock of the target process within the preset time, it is determined whether the preset maximum storage bit number meets the storage requirement of the target process, which includes:

[0061] S511, periodically collecting the number of the stored fast path locks of the target process;

[0062] S513, calculating the first frequency of the event that the number of the stored fast path locks of the target process reaches the preset maximum storage bit number within multiple periods;

[0063] S515, if the first frequency is greater than a first preset threshold, it is determined that the preset maximum storage bit number does not meet the storage requirement of the target process.

[0064] In this embodiment, the database management system can collect the number of the stored fast path locks of the target process in real time or periodically. When the number of the stored fast path locks of the target process reaches the preset maximum storage bit number, it is recorded as a first event. Then the first frequency of the first event occurring within multiple periods (preset time) is counted. If the first frequency is small, it indicates that the database is in a low-load and low-concurrency environment, and the preset maximum storage bit number can meet the storage requirement of the target process. If the first frequency is greater than a first preset threshold, it indicates that the database is in a high-load and high-concurrency environment, and the preset maximum storage bit number cannot meet the storage requirement of the target process. Therefore, the first storage form needs to be switched into the second storage form to store more fast path locks to meet the requirement of the target process.

[0065] In actual use, the size of the first preset threshold can be determined according to the hardware resource conditions, application scenarios, etc. of the database, so as to optimize the resource configuration of the database and find a balance between improving the overall running speed of the database and reducing the overhead of the database.

[0066] In particular, it can be further determined whether the first frequency reaches stability (for example, the fluctuation range of the first frequency), and after reaching stability, the first storage form is switched to the second storage form, so as to prevent temporary fluctuation of the database load from causing misjudgment of the load condition.

[0067] In particular, in actual use, the size of the first preset threshold can be dynamically adjusted according to the change of the application scene of the database, so as to further optimize the resource configuration of the database, and make the database dynamically adapt to different application scenes and balance between improving the overall running speed of the database and reducing the database overhead.

[0068] In some embodiments of the database fast path lock management method of the application, as shown in Figure 3 According to the use condition of the fast path lock of the target process within the preset time, it is determined whether the preset maximum storage bit number meets the storage requirement of the target process, including:

[0069] S531, periodically collecting the waiting event of the fast path lock of the target process;

[0070] S533, calculating the second frequency of the waiting event of the fast path lock of the target process within a plurality of periods;

[0071] S535, if the second frequency is greater than a second preset threshold, it is determined that the preset maximum storage bit number does not meet the storage requirement of the target process.

[0072] In this embodiment, the database management system can collect the waiting event of the fast path lock of the target process in real time or periodically. Then, the second frequency of the waiting event within a plurality of periods (preset time) is counted. If the second frequency is small, it indicates that the database is in a low-load and low-concurrency environment, and the preset maximum storage bit number can meet the storage requirement of the target process. If the second frequency is greater than the second preset threshold, it indicates that the database is in a high-load and high-concurrency environment, and the preset maximum storage bit number cannot meet the storage requirement of the target process, and the first storage form needs to be switched to the second storage form to store more fast path locks to meet the requirement of the target process.

[0073] In actual use, the size of the second preset threshold can be determined according to the hardware resource condition, application scene, etc. of the database, so as to optimize the resource configuration of the database and balance between improving the overall running speed of the database and reducing the database overhead.

[0074] In particular, it can be further determined whether the second frequency reaches stability (for example, the fluctuation range of the second frequency), and after reaching stability, the first storage form is switched to the second storage form, so as to prevent temporary fluctuation of the database load from causing misjudgment of the load condition.

[0075] Particularly, in actual use, the size of the second preset threshold can also be dynamically adjusted according to changes in application scenarios of the database, so as to further optimize resource configuration of the database, and enable the database to dynamically adapt to different application scenarios and strike a balance between improving overall operation speed of the database and reducing database overhead.

[0076] In some embodiments of the method for managing the fast path lock of the database, as shown in Figure 3 If the condition is not met, the step further includes:

[0077] S931, periodically acquiring the waiting event of the fast path lock of the target process;

[0078] S933, calculating a third frequency of the waiting event of the fast path lock of the target process in a plurality of periods;

[0079] S935, if the third frequency is less than a third preset threshold, switching to store each fast path lock of the target process in the first storage form, the third preset threshold being less than or equal to the second preset threshold.

[0080] In this embodiment, after the storage form of the fast path lock of the target process is switched to the second storage form, the database management system can continue to collect the waiting event of the fast path lock of the target process in real time or periodically. Then, a third frequency of the waiting event occurring in a plurality of periods (preset time) is counted. If the third frequency is small, it indicates that the database is in a low-load and low-concurrency environment, and the second storage form will use higher memory and higher overhead. At this time, the storage form can be switched from the second storage form to the first storage form to save memory and overhead. If the third frequency is greater than the third preset threshold, it indicates that the database is still in a high-load and high-concurrency environment, and the first storage form cannot meet the storage requirements of the target process, so the second storage form needs to be maintained to meet the requirements of the target process.

[0081] Exemplarily, when the second storage form is switched to the first storage form, the processes currently existing in the database can be first notified that the data will be converted from the hash table storage to the sequential storage, and then the conversion is performed. The conversion process can include migrating existing elements to the fast path array, destroying the hash table, and converting the lookup hash table operation when locking and unlocking to the traversal array operation, etc.

[0082] In the embodiment, the third preset threshold is less than or equal to the second preset threshold. In actual use, the size of the third preset threshold can be determined according to the hardware resource conditions of the database, the application scenarios, and the like, so as to optimize the resource configuration of the database and balance between improving the overall operation speed of the database and reducing the database overhead.

[0083] In particular, in actual use, the size of the third preset threshold can also be dynamically adjusted according to the changes of the application scenarios of the database, so as to further optimize the resource configuration of the database and enable the database to dynamically adapt to different application scenarios and balance between improving the overall operation speed of the database and reducing the database overhead.

[0084] In some embodiments of the method for managing the fast path lock of the database, as shown in Figure 4 If the condition is not met, the step further includes:

[0085] S911, acquiring the usage of the fast path lock of the target process within a preset time, and determining whether the preset maximum storage bit number meets the storage requirement of the target process;

[0086] S913, if the condition is met, switching to store each fast path lock of the target process in the first storage form.

[0087] In the embodiment, after the storage form of the fast path lock of the target process is switched to the second storage form, the database management system can continue to acquire the usage of the fast path lock of the target process within a preset time in real time or periodically, and determine whether the preset maximum storage bit number meets the storage requirement of the target process according to the usage. If the condition is met, the storage form can be switched from the second storage form to the first storage form to save the memory and the overhead. If the condition is not met, the second storage form is maintained to meet the requirement of the target process.

[0088] In the embodiment, by continuously acquiring the usage of the fast path lock of the target process and switching the storage form of the fast path lock according to whether the preset maximum storage bit number meets the storage requirement of the target process, the fast path lock of the database is dynamically managed, so that the database achieves a balance between improving the overall operation speed of the database and reducing the database overhead.

[0089] In some embodiments of the method for managing the fast path lock of the database, as shown in Figure 5 Before the target process of the database stores a plurality of fast path locks in the first storage form locally, the method further includes:

[0090] S111, in the case that the database performs initialization, obtaining reference information related to the fast path lock of the target process of the database, the reference information including configuration file information and environment variable information related to the fast path lock of the target process;

[0091] S113, determining the preset maximum storage bit number according to the reference information.

[0092] When the database starts (initializes), the reference information such as the configuration file information and the environment variable information related to the fast path lock of the target process can be obtained. The configuration file information can include the hardware resource information, the maximum process number, the maximum lock quantity and the like of the database, and the environment variable information can be the preset application scenario of the database. Through the reference information, the load condition and the concurrency condition of the database in use can be predicted to a certain extent. When the expected condition is a low load and low concurrency condition, a smaller preset maximum storage bit number can be used to reduce the delay of the sequential storage in use. When the expected condition is a high load and high concurrency condition, a larger preset maximum storage bit number can be used to meet the storage requirement of the fast path lock of the target process. By setting a reasonable preset maximum storage bit number of the fast path lock when the database starts, and dynamically switching the storage form of the fast path lock when the database moves, the database can further balance between improving the overall running speed of the database and reducing the database overhead.

[0093] In particular, the database management system can intelligently infer a reasonable default value of the preset maximum storage bit number according to the reference information, so that the database can balance between improving the overall running speed of the database and reducing the database overhead.

[0094] In some embodiments of the database fast path lock management method of the application, as shown in Figure 6

[0095] S131, in the case that the database performs initialization, obtaining reference information related to the fast path lock of the target process of the database, the reference information including configuration file information and environment variable information related to the fast path lock of the target process;

[0096] S133, determining the first candidate preset maximum storage bit number of the target process according to the reference information;

[0097] S135, judging whether the second candidate preset maximum storage bit number has been set by the user;

[0098] S137, if the second candidate preset maximum storage bit number has been set, taking the second candidate preset maximum storage bit number as the preset maximum storage bit number;

[0099] ​S139, if not set, the first candidate preset maximum storage bit number is used as the preset maximum storage bit number.

[0100] In this embodiment, the database management system allows the user to customize the preset maximum storage bit number, and preferentially uses the preset maximum storage bit number customized by the user, so that the user can flexibly adjust the preset maximum storage bit number of the fast path lock of the database, and adapt to different application scenarios. By setting a reasonable preset maximum storage bit number of the fast path lock when the database starts, and dynamically switching the storage form of the fast path lock when the database is running, the database can further balance between improving the overall running speed of the database and reducing the overhead of the database.

[0101] The flowchart provided in this embodiment is not intended to indicate that the operations of the method should be performed in any particular order, or that all operations of the method are included in each and every case. In addition, the method can include additional operations. Within the scope of the technical idea provided by the method of this embodiment, additional changes can be made to the above method.

[0102] It should be understood that in some embodiments, parts can be realized by hardware, software, firmware or a combination thereof. In the above described embodiments, a plurality of steps or methods can be realized by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0103] The embodiment of the application further provides a computer program product 10, a computer readable storage medium 20 and a computer device 30. Figure 7 is a schematic diagram of the computer program product 10 according to an embodiment of the application, Figure 8 is a schematic diagram of the computer readable storage medium 20 according to an embodiment of the application, Figure 9 is a schematic diagram of the computer device 30 according to an embodiment of the application. The computer program product 10 includes a computer program 11, which, when executed by the processor 32, implements the steps of any of the above-mentioned database fast path lock management methods. The computer readable storage medium 20 has the above-mentioned computer program 11 stored thereon, and the computer program 11, when executed by the processor 32, implements the steps of any of the above-mentioned database fast path lock management methods. The computer device 30 can include a memory 31, a processor 32 and a computer program 11 stored on the memory 31 and running on the processor 32.

[0104] The computer program 11 for performing the operations of the present application can be in assemblies instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, configuration data for integrated circuits, or in source code or object code written in any combination of one or more programming languages, all of which can be transformed by an implementation of the present application. The computer program 11 can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present application.

[0105] For the description of the present embodiment, the computer program product 10 is the relevant product containing the computer program 11.

[0106] For the description of the present embodiment, the computer readable storage medium 20 is a tangible device that can retain and store the computer program 11, which can be any apparatus that can contain, store, communicate, propagate or transport the computer program 11 for use by or in connection with the instruction execution system, apparatus or device. More specific examples (a non-exhaustive list) of the computer readable storage medium 20 include the following: portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, and any suitable combination of the above, or any other medium of the moment.

[0107] The computer device 30 can be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smart phone. In some examples, the computer device 30 can be a cloud computing node. The computer device 30 can be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, and so on that perform particular tasks or implement particular abstract data types. The computer device 30 can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules can be located in both local and remote computer system storage media including memory storage devices.

[0108] The computer device 30 can include a processor 32 adapted to execute instructions stored in a memory 31, which provides temporary storage for operations of the instructions during runtime. The processor 32 can be a single core processor, multi-core processor, computing cluster, or any number of other configurations. The memory 31 can include random access memory (RAM), read only memory, flash memory, or any other suitable memory systems.

[0109] The computer device 30 can also include a network adapter / interface and an input / output (I / O) interface. The I / O interface allows for input and output of data with external devices that can be connected to the computer device. The network adapter / interface can provide for communication between the computer device and a network, typically illustrated as a communication network.

[0110] To this end, it will be understood that, although the present application has been described herein in terms of several exemplary embodiments, modifications which fall within the scope of the present application can be made based upon the teachings set forth herein. Accordingly, it is intended that the scope of the present application should be interpreted only in conjunction with the appended claims.

Claims

1. A method for managing fast path locks in a database, characterized in that, include: The target process of the database stores multiple fast path locks locally using a first storage format, which includes sequential storage and is configured with a preset maximum storage bit width. Based on the usage of the fast path lock of the target process within a preset time, determine whether the preset maximum storage bits meet the storage requirements of the target process. If the conditions are not met, then the fast path locks of the target process are stored using a second storage method, which includes hash table storage.

2. The management method according to claim 1, characterized in that, The step of determining whether the preset maximum storage size meets the storage requirements of the target process based on the usage of the fast path lock of the target process within a preset time includes: The number of stored fast path locks of the target process is periodically collected; Calculate the first frequency of the event in which the number of stored fast path locks of the target process reaches the preset maximum storage bits within multiple periods; If the first frequency is greater than the first preset threshold, it is determined that the preset maximum storage bits do not meet the storage requirements of the target process.

3. The management method according to claim 1, characterized in that, The step of determining whether the preset maximum storage size meets the storage requirements of the target process based on the usage of the fast path lock of the target process within a preset time includes: Periodically collect the wait events of the fast path lock of the target process; Calculate the second frequency of the wait event for the fast path lock of the target process within multiple cycles; If the second frequency is greater than the second preset threshold, it is determined that the preset maximum storage bits do not meet the storage requirements of the target process.

4. The management method according to claim 3, characterized in that, If the above conditions are not met, then after storing each of the fast path locks of the target process in the second storage format, the steps further include: Periodically acquire the wait events for the fast path lock of the target process; Calculate the third frequency of the wait event for the fast path lock of the target process within multiple cycles; If the third frequency is less than the third preset threshold, then the first storage format is used to store the fast path locks of the target process, wherein the third preset threshold is less than or equal to the second preset threshold.

5. The management method according to claim 1, characterized in that, If the above conditions are not met, then after storing each of the fast path locks of the target process in the second storage format, the steps further include: The usage of the fast path lock of the target process within a preset time period is obtained, and it is determined whether the preset maximum storage bits meet the storage requirements of the target process. If the conditions are met, then switch to using the first storage format to store the fast path locks of the target process.

6. The management method according to claim 1, characterized in that, Before the target process of the database stores multiple fast path locks locally using the first storage format, it also includes: When the database is initialized, reference information related to the fast path lock of the target process is obtained. The reference information includes configuration file information and environment variable information related to the fast path lock of the target process. Based on the reference information, the preset maximum storage bits are determined.

7. The management method according to claim 1, characterized in that, Before the target process of the database stores multiple fast path locks locally using the first storage format, it also includes: When the database is initialized, reference information related to the fast path lock of the target process is obtained. The reference information includes configuration file information and environment variable information related to the fast path lock of the target process. Based on the reference information, the first candidate preset maximum storage bits for the target process are determined; Determine whether the user has already set a second candidate preset maximum storage bit width; If it has already been set, then the second candidate preset maximum storage bit width is used as the preset maximum storage bit width; If not set, the first candidate preset maximum storage bit length shall be used as the preset maximum storage bit length.

8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the database fast path lock management method as described in any one of claims 1 to 7.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the database fast path lock management method as described in any one of claims 1 to 7.

10. A computer device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the database fast path lock management method according to any one of claims 1 to 7.