Task synchronization implementation method and device, equipment and computer program product

Through the polymorphic status of polymorphic locks and optimized lock level management, the problem of low multi-task synchronization efficiency caused by mutex locks is solved, multi-tasks can access shared resources at the same time, and operational efficiency is improved.

CN118796489APending Publication Date: 2024-10-18CHINA MOBILE M2M +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410259053.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-07
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In existing real-time operating systems, when multi-task synchronization is performed through mutex locks, tasks that hold the mutex lock for a long time will cause other tasks to enter the blocking queue and wait, affecting the operating efficiency of multi-tasks.

Method used

Propose a task synchronization implementation method that allows multiple tasks to access shared resources at the same time through the resource state, deadlock state, mutual exclusion state and recursive state of polymorphic locks, optimizing lock level switching and lock holders Management to ensure that tasks can still acquire locks even if the lock holder holds the lock for a long time.

Benefits of technology

It improves the ability of multi-tasks to access shared resources simultaneously, improves the operating efficiency of multi-tasks, and alleviates the problem of low operating efficiency caused by mutex locks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796489A_ABST
    Figure CN118796489A_ABST
Patent Text Reader

Abstract

The invention provides a task synchronization implementation method and device, equipment and a computer program product. The method comprises the steps that a first task applying for obtaining a target polymorphic lock is detected; under the condition that the lock holder of the target polymorphic lock is the second task, acquiring the current level of the target polymorphic lock; and under the condition that the current level is the resource state, allowing the first task to acquire the target polymorphic lock. The target polymorphic lock in the resource state supports a plurality of tasks to acquire the target polymorphic lock, so that under the condition that the target polymorphic lock has a lock holder, other tasks except the lock holder can still access the resource through the target polymorphic lock in the resource state. Even if the lock holder holds the target polymorphic lock for a long time after obtaining the target polymorphic lock, other tasks can still obtain the target polymorphic lock. Furthermore, when the importance of the shared resources allows simultaneous access of the multiple tasks, the resource state of the target polymorphic lock is beneficial to realizing simultaneous access of the multiple tasks to the shared resources, so that the running efficiency of the multiple tasks is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to a method, device, equipment and computer program product for implementing task synchronization. Background Art

[0002] In existing real-time operating system kernels, conflicts caused by access to shared resources or critical sections are resolved through synchronization mechanisms such as mutex locks, and mutual exclusion synchronization is achieved by locking and unlocking shared resources.

[0003] When multiple tasks use mutex locks for synchronization, if a task holds the mutex lock for a long time after obtaining it, other tasks that want to obtain the mutex lock can only enter the blocking queue of the mutex lock and wait. When the importance of the shared resource allows multiple tasks to access it simultaneously, this will affect the running efficiency of multiple tasks. Summary of the invention

[0004] The present application proposes a method, device, equipment and computer program product for implementing task synchronization, which can alleviate the technical problem of low multi-task operation efficiency existing in the related art when using mutual exclusion locks for multi-task synchronization.

[0005] The first embodiment of the present application proposes a method for implementing task synchronization, including:

[0006] Detecting the first task that applies to acquire the target polymorphic lock;

[0007] When the lock holder of the target polymorphic lock is the second task, obtaining the current level of the target polymorphic lock;

[0008] When the current level is a resource state, the first task is allowed to acquire the target polymorphic lock.

[0009] In one or more embodiments, before allowing the first task to acquire the target polymorphic lock, the method further includes:

[0010] Determine that the number of locked resources of the target polymorphic lock is less than the maximum number of locked resources, where the number of locked resources is used to represent the number of tasks that successfully acquire the target polymorphic lock;

[0011] After the first task successfully acquires the target polymorphic lock, the method further includes:

[0012] Update the number of locked resources = the number of locked resources + 1.

[0013] In one or more embodiments, the method further comprises:

[0014] When the current level is the resource state, obtaining a target task with the highest priority from the first task and the second task;

[0015] The lock holder of the target polymorphic lock is updated to the target task.

[0016] In one or more embodiments, the method further comprises:

[0017] When the current level is the resource state, based on the release operation of the third task, the target polymorphic lock is released, and the number of locked resources of the target polymorphic lock is updated to be equal to the number of locked resources-1.

[0018] In one or more embodiments, the method further comprises:

[0019] When the current level is the resource state, obtaining a first number of tasks in a blocking queue of the target polymorphic lock within a preset time period and a second number of tasks applying to obtain the target polymorphic lock within the preset time period;

[0020] When it is determined that the target polymorphic lock satisfies the level switching condition based on the first number and the second number, wait for the target polymorphic lock to be released until the number of locked resources of the target polymorphic lock becomes 0, switch the target polymorphic lock from the resource state to the recursive state or the mutually exclusive state, and determine that the highest priority task in the blocking queue of the target polymorphic lock is the lock holder of the target polymorphic lock in the recursive state or the mutually exclusive state.

[0021] In one or more embodiments, the method further comprises:

[0022] When the level of the target polymorphic lock is the recursive state or the mutually exclusive state, and the target polymorphic lock is a polymorphic lock trapped in a deadlock loop, obtaining a task with the lowest priority from the tasks trapped in the deadlock loop;

[0023] Switching the level of the current polymorphic lock held by the lowest priority task to a deadlock state or the resource state, and acquiring the highest priority task trapped in the deadlock loop from the blocking queue corresponding to the current polymorphic lock; the deadlock state is used to indicate that the current polymorphic lock is allowed to have two lock holders;

[0024] When the level of the current polymorphic lock is the deadlock state, determine the highest priority task as the second lock holder of the current polymorphic lock in the deadlock state; when the level of the current polymorphic lock is the resource state, and the number of locked resources of the current polymorphic lock is less than the maximum number of locked resources of the current polymorphic lock, allow the highest priority task to acquire the current polymorphic lock in the resource state;

[0025] After the highest priority task finishes running based on the current polymorphic lock, all polymorphic locks held by the highest priority task are released by the highest priority task.

[0026] In one or more embodiments, determining that the target polymorphic lock satisfies a level switching condition based on the first number and the second number includes:

[0027] When it is determined that the first quantity is greater than the first quantity threshold and the second quantity is greater than the second quantity threshold, it is determined that the target polymorphic lock meets the level switching condition, the first quantity threshold corresponding to the recursive state is greater than the first quantity threshold corresponding to the mutually exclusive state, and the second quantity threshold corresponding to the recursive state is greater than the second quantity threshold corresponding to the mutually exclusive state.

[0028] The embodiment of the second aspect of the present application provides a device for implementing task synchronization, including:

[0029] A detection module, used for detecting a first task applying for obtaining a target polymorphic lock;

[0030] an acquisition module, configured to acquire the current level of the target polymorphic lock when the lock holder of the target polymorphic lock is a second task;

[0031] A processing module is used to allow the first task to acquire the target polymorphic lock when the current level is a resource state.

[0032] An embodiment of the third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.

[0033] An embodiment of the fourth aspect of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method described in the first aspect.

[0034] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:

[0035] In the embodiment of the present application, the target polymorphic lock of the resource state supports multiple tasks to obtain the target polymorphic lock, so when the target polymorphic lock already has a lock holder, other tasks other than the lock holder can still access the resource through the target polymorphic lock of the resource state. In this way, even if the lock holder holds the target polymorphic lock for a long time after obtaining it, other tasks can still obtain the target polymorphic lock. Furthermore, when the importance of the shared resource allows multiple tasks to access it simultaneously, the resource state of the target polymorphic lock helps to achieve simultaneous access to the shared resource by multiple tasks, thereby improving the operating efficiency of multiple tasks.

[0036] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] By reading the detailed description of the preferred embodiment below, various other advantages and benefits will become clear to those of ordinary skill in the art. The accompanying drawings are only used for the purpose of illustrating the preferred embodiment and are not considered to be limitations of the present application. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings.

[0038] In the attached picture:

[0039] Figure 1 A flowchart of a method for implementing task synchronization provided by an embodiment of the present application is shown;

[0040] Figure 2 A schematic diagram showing the implementation principle of a polymorphic lock provided by an embodiment of the present application is shown;

[0041] Figure 3 A schematic diagram of a deadlock cycle provided by an embodiment of the present application is shown;

[0042] Figure 4 A schematic diagram showing the level switching of a polymorphic lock provided by an embodiment of the present application is shown;

[0043] Figure 5 A schematic diagram of the structure of a device for implementing task synchronization provided by an embodiment of the present application is shown;

[0044] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application is shown;

[0045] Figure 7 A schematic diagram of a storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0046] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0047] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0048] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0049] In existing real-time operating system kernels, conflicts caused by access to shared resources or critical sections are resolved through synchronization mechanisms such as mutex locks, and mutual exclusion synchronization is achieved by locking and unlocking shared resources.

[0050] Mutual exclusion is a mechanism for mutual exclusion between tasks in an operating system. When a task occupies a resource, other tasks are not allowed to access it until the task that occupies the resource releases the lock. That is, a resource is only allowed to be accessed by one visitor at a time, which is unique and exclusive. However, mutual exclusion does not limit the order in which visitors access resources, that is, access is disordered.

[0051] Mutex locks support both non-recursive and recursive locks. When a mutex lock is set to a non-recursive lock, once the lock is acquired by a task, it cannot be acquired by any task again before it is released; when a mutex lock is set to a recursive lock, if the lock is acquired by a task, the task can acquire the lock again without being suspended. In general, when using a lock, the user should clearly define the scope of the critical resources to be protected, only lock when accessing the critical resources, and unlock immediately after the access is completed.

[0052] The mutex lock is implemented based on the blocking queue. The initial count value of the mutex lock is 0 (indicating that the mutex lock has not been acquired at this time). When the task successfully acquires the mutex lock, the count value is increased by 1 (indicating that the mutex lock has been acquired at this time), and the task becomes the holder of the lock. When another task acquires the mutex lock, since the lock has been acquired, the task is suspended and placed in the blocking queue until the lock holder releases the lock. The suspended task is awakened and placed in the ready queue.

[0053] In the related art, when multiple tasks use a mutex lock for synchronization, if a task holds the mutex lock for a long time after obtaining it, other tasks can only enter the blocking queue of the mutex lock and wait when they want to obtain the mutex lock. When the importance of the shared resource allows multiple tasks to access it simultaneously, this will affect the operating efficiency of multiple tasks.

[0054] In order to solve the problems existing in the related art, the embodiments of the present application provide a method, apparatus, device and computer program product for implementing task synchronization.

[0055] For ease of understanding, the concepts involved in the embodiments of the present application are explained below.

[0056] Polymorphic lock, in order to cope with various complex situations of synchronization between tasks and use as little overhead as possible, this application proposes a polymorphic lock mechanism. As the name suggests, the polymorphic lock has multiple states (resource state, deadlock state, mutual exclusion state, recursive state), and different states have different functions. It combines the characteristics of semaphores and mutual exclusion locks, and can cope with problems such as thread blocking overhead, priority flipping, and deadlock.

[0057] For this polymorphic lock, in order to meet the function of level state change, its core data structure is mainly shown in Table 1.

[0058] Table 1

[0059]

[0060] The levels of polymorphic locks are shown in Table 2:

[0061] Table 2

[0062]

[0063] The functional characteristics of polymorphic locks at each level are as follows:

[0064] Resource state: A polymorphic lock in resource state is similar to a semaphore. Whether a task successfully applies for the polymorphic lock is determined based on the maximum number of locked resources and the number of locked resources. However, unlike a semaphore, a polymorphic lock has a lock holder at this level. The main function of the lock holder at this level is to facilitate level switching and to solve priority flipping and deadlock problems.

[0065] Mutual Exclusion: A polymorphic lock in the mutual exclusion state is similar to a non-recursive mutex lock. If the lock holder of the polymorphic lock is empty, the task is allowed to successfully acquire the lock. Otherwise, the task enters the blocking queue and waits for the lock holder to release the task. At this level, the number of locked resources can only be 1 or 0.

[0066] Recursive state: A polymorphic lock in recursive state is similar to a recursive mutex lock. The principle is basically the same as that of the mutex state. The difference is that the lock holder can lock the lock multiple times. The number of locked resources is determined by the number of times the lock holder applies to obtain the polymorphic lock.

[0067] Deadlock state: The polymorphic lock is allowed to switch to this level only when a deadlock occurs. The polymorphic lock in deadlock state allows two lock holders to appear, namely the original lock holder and the highest priority task trapped in a deadlock cycle in the blocking queue of the polymorphic lock. After the deadlock is quickly resolved, it will be restored to the original level as soon as possible.

[0068] The following takes the mutually exclusive state as an example to introduce the implementation principle of polymorphic locks.

[0069] like Figure 2 As shown, Figure 2 The coordinate axis in is time as the horizontal axis and the task priority as the vertical axis. Task 1 and Task 2 are two tasks with different priorities, and the priority of Task 1 is greater than that of Task 2. At t0, Task 2 is in the ready queue, Task 2 acquires the polymorphic lock and becomes the lock holder. At t1, Task 1 is in the ready queue. At t2, Task 1 acquires the polymorphic lock, and Task 1 is suspended and placed in the blocking queue of the polymorphic lock. At t3, Task 2 releases the polymorphic lock, Task 2 is released from the blocking queue, returns to the ready queue, and Task 2 acquires the polymorphic lock.

[0070] The following describes a method, apparatus, device and computer program product for implementing task synchronization according to an embodiment of the present application in conjunction with the accompanying drawings.

[0071] To facilitate understanding of this embodiment, a method for implementing task synchronization disclosed in the embodiment of the present application is first introduced in detail. The execution subject of the method for implementing task synchronization provided in the embodiment of the present application is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the method for implementing task synchronization can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0072] like Figure 1 As shown, the implementation method of the task synchronization may include:

[0073] Step 101: Detecting a first task that applies to acquire a target polymorphic lock;

[0074] Step 102: when the lock holder of the target polymorphic lock is the second task, obtain the current level of the target polymorphic lock;

[0075] Step 103: When the current level is a resource state, allow the first task to acquire the target polymorphic lock.

[0076] In this embodiment, the lock holder is a task that has successfully acquired the target polymorphic lock, and the task can use the target polymorphic lock to access resources. The second task is not the same task as the first task. It should be noted that in the description of the embodiments of the present application, the technical terms "first" and "second" are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In other words, the first task has no direct connection with the first task that applies to acquire the target polymorphic lock after the target polymorphic lock is initialized, and the same is true for the second task.

[0077] In this embodiment, when the level of the target polymorphic lock is resource state, the target polymorphic lock allows multiple tasks to obtain the target polymorphic lock, and each of the multiple tasks can access resources through the target polymorphic lock. It should be understood that the resources accessed by different tasks through the target polymorphic lock can be the same or different.

[0078] In the solution provided by this embodiment, the target polymorphic lock in resource state supports multiple tasks to obtain the target polymorphic lock, so when the target polymorphic lock already has a lock holder, other tasks other than the lock holder can still access the resource through the target polymorphic lock in resource state. In this way, even if the lock holder holds the target polymorphic lock for a long time after obtaining it, other tasks can still obtain the target polymorphic lock. Furthermore, when the importance of a shared resource allows multiple tasks to access it simultaneously, the resource state of the target polymorphic lock helps to achieve simultaneous access of multiple tasks to the shared resource, thereby improving the operating efficiency of multiple tasks.

[0079] In one or more embodiments, in order to alleviate the problem of excessive system resource overhead caused by too many tasks simultaneously acquiring target polymorphic lock access resources, before allowing the first task to acquire the target polymorphic lock, the following steps may also be included:

[0080] Determine that the number of locked resources of the target polymorphic lock is less than the maximum number of locked resources, where the number of locked resources is used to represent the number of tasks that successfully acquire the target polymorphic lock;

[0081] After the first task successfully acquires the target polymorphic lock, the following steps may also be included:

[0082] Update the number of locked resources = the number of locked resources + 1.

[0083] In this embodiment, the maximum number of locked resources can be pre-configured based on experience or actual needs, and this embodiment does not specifically limit this. For example, the maximum number of locked resources can be pre-configured to 2, that is, a maximum of 2 tasks are allowed to acquire the target polymorphic lock.

[0084] In one or more embodiments, the target polymorphic lock of the pre-set resource state allows one lock holder. Accordingly, the method may further include the following steps:

[0085] When the current level is a resource state, obtain the target task with the highest priority from the first task and the second task;

[0086] Update the lock holder of the target polymorphic lock to the target task.

[0087] In this embodiment, the priority of the first task and the second task refers to the original priority, and the original priority of the task is configured by the user who creates the task during the task creation process. The original priority of the task is used to characterize the importance of the task. The higher the original priority of the task, the more important the task.

[0088] It should be noted that, when the target polymorphic lock is created and the level is initialized to the resource state, assuming that the target polymorphic lock has no lock holder, if two tasks successively acquire the target polymorphic lock, then the lock holder of the target polymorphic lock can be determined by the priorities of the two tasks and the time when the target polymorphic lock is acquired. Specifically, if the priorities of the two tasks are different, the task with a higher priority is determined to be the lock holder of the target polymorphic lock. If the priorities of the two tasks are the same, the task that acquires the target polymorphic lock earlier is determined to be the lock holder of the target polymorphic lock.

[0089] In this embodiment, in one or more embodiments, the target polymorphic lock at the resource state level supports the release of any task.

[0090] In specific implementation, the method may further include the following steps:

[0091] When the current level is the resource state, based on the release operation of the third task, the target polymorphic lock is released, and the number of locked resources is updated = the number of locked resources - 1.

[0092] The third task may be the first task, and after the second task successfully acquires the target polymorphic lock, the third task may also be the second task. Of course, the third task may also be any task other than the first task and the second task, which is not specifically limited in this embodiment.

[0093] In this embodiment, the number of locked resources before updating is related to whether the first task successfully acquires the target polymorphic lock. Assuming that before the first task applies to acquire the target polymorphic lock, the number of locked resources of the target polymorphic lock is a. If the first task successfully acquires the target polymorphic lock, the number of locked resources of the target polymorphic lock becomes a+1. Accordingly, after the target polymorphic lock is released based on the release operation of the third task, the number of locked resources is updated to be a+1-1=a. If the first task fails to acquire the target polymorphic lock, the number of locked resources of the target polymorphic lock is still a. Accordingly, after the target polymorphic lock is released based on the release operation of the third task, the number of locked resources is updated to be a-1.

[0094] In one or more embodiments, the level of the target polymorphic lock may also include a recursive state or a mutual exclusion state, wherein in the mutual exclusion state, the target polymorphic lock only allows one task to acquire the lock, which is basically consistent with the non-recursive mutual exclusion lock in the related technology; in the recursive state, the target polymorphic lock only allows one task to acquire the lock, which is basically consistent with the recursive mutual exclusion lock in the related technology.

[0095] In this embodiment, the target polymorphic lock can also be switched between different levels. In specific implementation, there are two switching modes: automatic switching and manual switching. Automatic switching is suitable for scenarios with low requirements for resource protection, while manual switching is more suitable for scenarios with high requirements for resource protection and more changes.

[0096] When the switching mode is automatic switching, the method may further include the following steps:

[0097] When the current level is a resource state, obtain a first number of tasks in a blocking queue of a target polymorphic lock within a preset time period and a second number of tasks applying to obtain the target polymorphic lock within a preset time period;

[0098] When it is determined based on the first quantity and the second quantity that the target polymorphic lock satisfies the level switching condition, wait for the target polymorphic lock to be released until the number of locked resources of the target polymorphic lock becomes 0, switch the target polymorphic lock from the resource state to the recursive state or the mutual exclusion state, and determine that the highest priority task in the blocking queue of the target polymorphic lock is the lock holder of the target polymorphic lock in the recursive state or the mutual exclusion state.

[0099] It should be understood that when the level of the target polymorphic lock is the resource state, the number of locked resources of the target polymorphic lock is less than or equal to the maximum number of locked resources, that is, the number of tasks that can successfully acquire the target polymorphic lock is less than or equal to the maximum number of locked resources. When the number of tasks that have successfully acquired the target polymorphic lock within the preset time period is equal to the maximum number of locked resources, if there are still other tasks applying to acquire the target polymorphic lock, then the task will be suspended and placed in the blocking queue. Therefore, once there are tasks in the blocking queue of the target polymorphic lock, it means that the number of tasks that have acquired the target polymorphic lock has reached the maximum number of locked resources. Since the maximum number of locked resources of the target polymorphic lock in the resource state is greater than the number of lock holders of the target polymorphic lock in the recursive state or the mutually exclusive state, in this case, it is necessary to wait for the target polymorphic lock to be released until the number of target polymorphic locks becomes 0.

[0100] Moreover, during the period when the number of locked resources decreases, in order to make the number of locked resources become 0, the tasks on the blocking queue of the target polymorphic lock are not released. At the same time, if a new task applies to obtain the target polymorphic lock, the new task is directly added to the blocking queue. When the number of locked resources is 0, the level is switched to the mutual exclusion state or recursive state. After the switch is completed, if there are tasks on the blocking queue, the task with the highest priority is released to become the new lock holder. It should be noted that when the number of locked resources is greater than 1, during the period when the number of locked resources is reduced to 0, although the number of locked resources is less than the maximum number of locked resources, the tasks on the blocking queue are not accepted to be released, and the new tasks are not accepted to successfully obtain the lock.

[0101] In this embodiment, the tasks that apply to obtain the target polymorphic lock within the preset time period include two types of tasks: successful applications and unsuccessful applications. The successful applications refer to tasks that successfully obtain the target polymorphic lock, and the unsuccessful applications refer to tasks that fail to successfully obtain the target polymorphic lock.

[0102] In this embodiment, it is possible to determine whether the first quantity and the second quantity satisfy the level switching condition based on a preset quantity threshold. The quantity thresholds in the level switching conditions for switching to a recursive state and switching to a mutually exclusive state are different. As an example, assuming that the first quantity is greater than the first quantity threshold and the second quantity is greater than the second quantity threshold, it is determined that the target polymorphic lock satisfies the level switching condition. Then, the first quantity threshold in the switching condition for switching to a mutually exclusive state can be pre-configured to be smaller than the first quantity threshold in the switching condition for switching to a recursive state, and the second quantity threshold in the switching condition for switching to a mutually exclusive state can be configured to be smaller than the second quantity threshold in the switching condition for switching to a recursive state.

[0103] This embodiment also provides a manual implementation of switching the target polymorphic lock in resource state to exclusive state or recursive state. In an optional implementation, when the number of locked resources of the target polymorphic lock in resource state is 1, in manual mode, the user can directly switch the level of the target polymorphic lock to recursive state or exclusive state.

[0104] It should be understood that the switching mode (manual switching or automatic switching) of the target polymorphic lock and the initial level of the target polymorphic lock can be obtained by initializing the polymorphic lock using a preconfigured initialization function when creating the target polymorphic lock.

[0105] In one or more embodiments, when the target polymorphic lock is a polymorphic lock trapped in a deadlock cycle, the deadlock cycle is released by switching the polymorphic lock to a deadlock state.

[0106] In specific implementation, the method may further include the following steps:

[0107] When the level of the target polymorphic lock is a recursive state or a mutually exclusive state, and the target polymorphic lock is a polymorphic lock trapped in a deadlock loop, a task with the lowest priority is obtained from the tasks trapped in the deadlock loop;

[0108] Switch the level of the current polymorphic lock held by the lowest priority task to a deadlock state or a resource state, and obtain the highest priority task trapped in a deadlock loop from the blocking queue corresponding to the current polymorphic lock; the deadlock state is used to indicate that the current polymorphic lock is allowed to have two lock holders;

[0109] When the level of the current polymorphic lock is in deadlock state, determine the highest priority task as the second lock holder of the current polymorphic lock in deadlock state; when the level of the current polymorphic lock is in resource state, and the number of locked resources of the current polymorphic lock is less than the maximum number of locked resources of the current polymorphic lock, allow the highest priority task to obtain the current polymorphic lock in resource state;

[0110] After the highest priority task completes its operation based on the current polymorphic lock, all polymorphic locks held by the highest priority task are released by the highest priority task.

[0111] In this embodiment, the deadlock cycle includes two tasks and two polymorphic locks, each task uniquely corresponds to a polymorphic lock, and each task is the lock holder of the polymorphic lock corresponding to the task. When two tasks both want to obtain another polymorphic lock that does not correspond to them, it is considered that a deadlock cycle has occurred.

[0112] Please refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a deadlock cycle shown in this embodiment. Figure 3As shown in the figure, assuming that polymorphic locks A and B are both mutually exclusive, task A acquires lock A first, and then task B acquires lock B. At this time, task A and task B both become lock holders of their own locks. If task A tries to acquire task B again, it will be blocked in the blocking queue of polymorphic lock B. If task B tries to acquire polymorphic lock A, task B will also be blocked in the blocking queue of polymorphic lock A. At this time, a deadlock cycle is generated.

[0113] It should be understood that for a polymorphic lock that is trapped in a deadlock loop, the level of the polymorphic lock can only be the mutually exclusive state or the recursive state. After the level of the polymorphic lock is switched to the deadlock state or the resource state, in the deadlock state, the polymorphic lock allows two lock holders, and in the resource state, the polymorphic lock allows multiple tasks to acquire it. When the resources of the polymorphic lock are sufficient (that is, the number of locked resources of the polymorphic lock is less than the maximum number of locked resources), the highest priority task can acquire the polymorphic lock in the deadlock state or the resource state, so that the highest priority task can run. After the highest priority task releases all polymorphic locks, the lowest priority task can acquire the polymorphic lock that could not be acquired when trapped in a deadlock loop, and thus can run.

[0114] It should be understood that the lowest priority task may be the lock holder of the target polymorphic lock in the deadlock state, or it may be another task in the deadlock cycle. Accordingly, when the lowest priority task is the lock holder of the target polymorphic lock in the deadlock state, the current polymorphic lock is the target polymorphic lock. The highest priority task is the other task of the two tasks in the deadlock cycle except the lowest priority task.

[0115] It should be understood that after the highest priority task releases all polymorphic locks held by the highest priority task, the lowest priority task can obtain the polymorphic lock held by the highest priority task when it falls into a deadlock loop, so that the lowest priority task can run based on the polymorphic lock and the current polymorphic lock.

[0116] Still combined Figure 3 For example, when a deadlock cycle is detected, if the deadlock cycle is not resolved for a long time, the lowest priority task is selected from the tasks trapped in the deadlock cycle (assuming that task B has the lowest priority), then the polymorphic lock B level held by task B will be switched to a deadlock state, and then the task trapped in the deadlock cycle and with the highest priority is obtained from the blocking queue of polymorphic lock B to become the second lock holder. Combined with the situation in the figure, this second lock holder can only be task A, then task A successfully acquires the polymorphic lock B and gets to run, then task A releases polymorphic lock B in turn, and then releases polymorphic lock A, polymorphic lock A becomes without a lock holder, so task B can also acquire polymorphic lock A, and then task B can run, then task B releases polymorphic lock A in turn, and then releases polymorphic lock B, at this point, all tasks in the deadlock cycle are finished.

[0117] The following is a comprehensive description of the present application scheme with a specific embodiment. The specific embodiment includes three parts of the scheme, namely, the conventional function implementation of the polymorphic lock, the level switching mode implementation of the polymorphic lock, and the deadlock resolution function implementation of the polymorphic lock. The following introduces these three parts of the scheme respectively.

[0118] The general implementation of polymorphic locks can include the following steps:

[0119] Step 1: Create a polymorphic lock. Initialize the polymorphic lock by the initialization function, and initialize the data structure members such as the level and maximum number of resources of the polymorphic lock.

[0120] Step 2: The polymorphic lock is first applied for by Task A. At this time, Task A succeeds in applying for the lock and becomes the lock holder. When Task B also applies for the lock when Task A is the lock holder, the following situations are handled:

[0121] When the polymorphic lock is in resource state and the number of locked resources is less than or equal to the maximum number of locked resources, task B is allowed to successfully acquire the lock. The new lock holder is a task with a higher priority. If the priorities of task A and task B are the same, they follow the first-come-first-served principle, and the number of locked resources increases by one.

[0122] When the polymorphic lock is in the mutually exclusive state and the lock already has a lock holder, task B enters the blocking queue of the lock. After task A releases the lock, the highest priority task in the blocking queue can be released and becomes the new lock holder of the polymorphic lock.

[0123] When the polymorphic lock is in recursive state, task B applies for the lock and the processing method is the same as the mutually exclusive state. If task A applies for the lock again, the application is allowed to succeed and the number of locked resources increases by one.

[0124] Step 3: When releasing a polymorphic lock, if there is a task blocked on the lock, the highest priority task blocked on the lock needs to be released, and it is necessary to determine and confirm whether to change the lock holder, and update the number of locked resources and other structure member information. The response method for each polymorphic lock level in the release process is basically carried out according to the above process. Different levels are explained as follows:

[0125] When a polymorphic lock in the resource state is released, it can be released by any task, and the value of the locked resource state is reduced by one (it can only be reduced to 0 at the lowest);

[0126] A polymorphic lock in a mutually exclusive state can only be released by the lock holder, and the number of locked resources is reduced by one (it can only be reduced to 0 at the lowest);

[0127] A polymorphic lock in a recursive state can only be released by the lock holder, and the number of locked resources is reduced by one (it can only be reduced to 0 at the lowest). If the lock is acquired multiple times, it needs to be released the corresponding number of times to be completely unlocked;

[0128] If it is in a deadlock state, it means that the current lock-holding task has entered a deadlock loop. Similar to the mutual exclusion state, the lock-holding task is required to release the lock. When the signal that the deadlock loop has been released is received, the deadlock state is exited and the corresponding polymorphic lock release operation is performed according to the original state.

[0129] Step 4: When destroying a polymorphic lock, if priority inheritance was required before, the priority of the corresponding task needs to be restored. In addition, since the lock will be destroyed, if there are tasks still blocked on the lock, all tasks on the lock blocking queue need to be released and restored to the ready state; finally, the resources related to the polymorphic lock are recycled.

[0130] The implementation of the level switching method of the polymorphic lock may include the following steps:

[0131] There are two main ways to switch the level of polymorphic locks: automatic switching and manual switching. Automatic switching is suitable for scenarios with low requirements for resource protection, while manual switching is more suitable for scenarios with high requirements for resource protection and more changes.

[0132] Step 1: When the switching mode is automatic switching, the lock is allowed to automatically determine when to switch levels. The switching mode provided by this application has two important factors, namely, the counter in the data structure and the number of tasks in the blocking queue. See the following for details:

[0133] The idea of ​​automatic switching of polymorphic locks in the present application is mainly to use less system overhead to maintain resources with less competition, and to use more overhead to ensure concurrent competition with higher requirements; based on this idea, if the counter value reaches a certain threshold within a preset time (i.e., a tick heartbeat), and the number of tasks in the blocking queue of the polymorphic lock reaches a certain threshold, it is necessary to switch to a mutually exclusive state or a recursive state with a deeper lock depth to ensure the concurrent operation of multiple tasks; conversely, if there are fewer tasks accessing the polymorphic lock for a long time during a tick heartbeat, it can be switched to a resource state, so that the tasks can reduce blocking, reduce context switching, and reduce task scheduling.

[0134] For example, assuming that the polymorphic lock is in the mutually exclusive state at this time, then count whether the number of tasks applying for the lock reaches a certain threshold during a tick heartbeat process, and determine whether it is necessary to switch to a lower-level resource state based on the blocking situation of the blocking queue to release more tasks to run and meet the actual operating conditions.

[0135] If a deadlock is detected, it will automatically switch to the deadlock state, complete the deadlock release operation according to the deadlock release method, and then automatically switch back to the original state;

[0136] Step 2: When the switching mode is manual switching, the user needs to manually switch. The user manually controls when to switch the level according to the actual development needs;

[0137] Step 3: Regardless of automatic or manual switching, follow the following rules:

[0138] If the lock is switched from the mutual exclusion state or recursive state to the resource state, since it is in the resource state at this time, multiple tasks can acquire the lock, but there is only one lock holder, which is determined by the priority. The specific number of tasks to be released can be determined based on the values ​​of the maximum number of locked resources and the number of locked resources. How many tasks blocked on the lock can be released, generally release tasks in order of priority (if the scheduling method is priority scheduling). As an example, please refer to Figure 4 , Figure 4 There are 4 suspended tasks in the blocking queue of the exclusive or recursive polymorphic lock. Assuming that the maximum number of locked resources of the resource-state polymorphic lock is 4, since the exclusive or recursive polymorphic lock has only one lock holder, the number of tasks that can be released after calculation is 4-1=3, then the three tasks with the highest priority in the blocking queue can be released, namely task 2, task 3 and task 4.

[0139] If the state is switched from the mutual exclusion state to the recursive state, the lock holder is allowed to acquire the lock multiple times to strengthen the protection of resources.

[0140] If the state is switched from resource state to exclusive state or recursive state, since exclusive state or recursive state only allows one task to hold the lock, if the number of locked resources of the polymorphic lock is 1, that is, only one task currently holds the lock, it is allowed to switch to exclusive state or recursive state. If the number of locked resources is greater than 1, it is necessary to wait for other tasks to release the lock. The state can be switched only after the number of locked resources is reduced to 0.

[0141] About the deadlock resolution function of polymorphic lock:

[0142] When a deadlock occurs, regardless of whether the switching mode is automatic or manual, it will automatically switch to the deadlock state to release the deadlock. The relevant process is as follows:

[0143] When a deadlock occurs, after switching to the deadlock state, the lock is allowed to have two lock holders. In addition to the original lock holder of the lock, the highest priority task trapped in the deadlock loop will be released from the blocking queue and become the second lock holder. That is, the task will change from the blocked state to the ready state to be executed. At this time, the deadlock loop is broken and the deadlock will be released accordingly.

[0144] It should be understood that after a deadlock occurs, the level of the polymorphic lock can be switched to a resource state. If the resources are sufficient, the blocked tasks can also be run and the deadlock can be resolved.

[0145] The embodiment of the present application also provides a device for implementing task synchronization, which is used to execute the method for implementing task synchronization provided by any of the above embodiments. Figure 5 As shown, the device comprises:

[0146] A detection module 51, used to detect a first task applying to obtain a target polymorphic lock;

[0147] An acquisition module 52, configured to acquire the current level of the target polymorphic lock when the lock holder of the target polymorphic lock is a second task;

[0148] The processing module 53 is configured to allow the first task to acquire the target polymorphic lock when the current level is a resource state.

[0149] In one or more embodiments, the device is also used to:

[0150] Before allowing the first task to acquire the target polymorphic lock, determining that the number of locked resources of the target polymorphic lock is less than a maximum number of locked resources, the number of locked resources being used to represent the number of tasks that successfully acquire the target polymorphic lock;

[0151] After the first task successfully acquires the target polymorphic lock, the method further includes:

[0152] Update the number of locked resources = the number of locked resources + 1.

[0153] In one or more embodiments, the device is also used to:

[0154] When the current level is the resource state, obtaining a target task with the highest priority from the first task and the second task;

[0155] The lock holder of the target polymorphic lock is updated to the target task.

[0156] In one or more embodiments, the device is also used to:

[0157] When the current level is the resource state, based on the release operation of the third task, the target polymorphic lock is released, and the number of locked resources is updated to be equal to the number of locked resources-1.

[0158] In one or more embodiments, the device is also used to:

[0159] When the current level is the resource state, obtaining a first number of tasks in a blocking queue of the target polymorphic lock within a preset time period and a second number of tasks applying to obtain the target polymorphic lock within the preset time period;

[0160] When it is determined that the target polymorphic lock satisfies the level switching condition based on the first number and the second number, wait for the target polymorphic lock to be released until the number of locked resources of the target polymorphic lock becomes 0, switch the target polymorphic lock from the resource state to the recursive state or the mutually exclusive state, and determine that the highest priority task in the blocking queue of the target polymorphic lock is the lock holder of the target polymorphic lock in the recursive state or the mutually exclusive state.

[0161] In one or more embodiments, the device is also used to:

[0162] When the level of the target polymorphic lock is the recursive state or the mutually exclusive state, and the target polymorphic lock is a polymorphic lock trapped in a deadlock loop, obtaining a task with the lowest priority from the tasks trapped in the deadlock loop;

[0163] Switching the level of the current polymorphic lock held by the lowest priority task to a deadlock state or the resource state, and acquiring the highest priority task trapped in the deadlock loop from the blocking queue corresponding to the current polymorphic lock; the deadlock state is used to indicate that the current polymorphic lock is allowed to have two lock holders;

[0164] When the level of the current polymorphic lock is the deadlock state, determine the highest priority task as the second lock holder of the current polymorphic lock in the deadlock state; when the level of the current polymorphic lock is the resource state, and the number of locked resources of the current polymorphic lock is less than the maximum number of locked resources of the current polymorphic lock, allow the highest priority task to acquire the current polymorphic lock in the resource state;

[0165] After the highest priority task finishes running based on the current polymorphic lock, all polymorphic locks held by the highest priority task are released by the highest priority task.

[0166] In one or more embodiments, the device is also used to:

[0167] When it is determined that the first quantity is greater than the first quantity threshold and the second quantity is greater than the second quantity threshold, it is determined that the target polymorphic lock meets the level switching condition, the first quantity threshold corresponding to the recursive state is greater than the first quantity threshold corresponding to the mutually exclusive state, and the second quantity threshold corresponding to the recursive state is greater than the second quantity threshold corresponding to the mutually exclusive state.

[0168] The device for implementing task synchronization provided in the embodiment of the present application and the method for implementing task synchronization provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.

[0169] The present application also provides an electronic device to implement the above-mentioned task synchronization method. Figure 6 It shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 6 As shown, the electronic device 6 includes: a processor 600, a memory 601, a bus 602 and a communication interface 603, wherein the processor 600, the communication interface 603 and the memory 601 are connected via the bus 602; the memory 601 stores a computer program that can be run on the processor 600, and when the processor 600 runs the computer program, the implementation method of task synchronization provided in any of the aforementioned embodiments of the present application is executed.

[0170] The memory 601 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0171] The bus 602 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 601 is used to store programs, and the processor 600 executes the programs after receiving execution instructions. The implementation method of the task synchronization disclosed in any implementation method of the embodiment of the present application may be applied to the processor 600, or implemented by the processor 600.

[0172] The processor 600 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 600. The above processor 600 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601, and the processor 600 reads the information in the memory 601 and completes the steps of the above method in combination with its hardware.

[0173] The electronic device provided in the embodiment of the present application and the implementation method of task synchronization provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.

[0174] The present application also provides a computer-readable storage medium corresponding to the task synchronization implementation method provided in the above-mentioned implementation method. Figure 7 The computer-readable storage medium shown is a CD 30 on which a computer program (ie, a program product) is stored. When the computer program is executed by a processor, the method for implementing task synchronization provided by any of the aforementioned implementations will be executed.

[0175] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0176] The computer-readable storage medium provided by the above-mentioned embodiment of the present application and the implementation method of task synchronization provided by the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0177] An embodiment of the present application also provides a computer program product corresponding to the implementation method of task synchronization provided in the aforementioned embodiment, and the computer program product includes a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the implementation method of task synchronization provided in any of the aforementioned embodiments.

[0178] It should be noted that:

[0179] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known structures and technologies are not shown in detail so as not to obscure the understanding of this description.

[0180] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following schematic diagram: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0181] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0182] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for implementing task synchronization, It is characterized in that include: Detecting the first task that applies to acquire the target polymorphic lock; When the lock holder of the target polymorphic lock is the second task, obtaining the current level of the target polymorphic lock; When the current level is a resource state, the first task is allowed to acquire the target polymorphic lock.

2. The method according to claim 1, It is characterized in that Before allowing the first task to acquire the target polymorphic lock, the method further includes: Determine that the number of locked resources of the target polymorphic lock is less than the maximum number of locked resources, where the number of locked resources is used to represent the number of tasks that successfully acquire the target polymorphic lock; After the first task successfully acquires the target polymorphic lock, the method further includes: Update the number of locked resources = the number of locked resources + 1.

3. The method according to claim 1, It is characterized in that The method further comprises: When the current level is the resource state, obtaining a target task with the highest priority from the first task and the second task; The lock holder of the target polymorphic lock is updated to the target task.

4. The method according to claim 1, It is characterized in that The method further comprises: When the current level is the resource state, based on the release operation of the third task, the target polymorphic lock is released, and the number of locked resources of the target polymorphic lock is updated to be equal to the number of locked resources-1.

5. The method according to claim 2, It is characterized in that The method further comprises: When the current level is the resource state, obtaining a first number of tasks in a blocking queue of the target polymorphic lock within a preset time period and a second number of tasks applying to obtain the target polymorphic lock within the preset time period; When it is determined that the target polymorphic lock satisfies the level switching condition based on the first number and the second number, wait for the target polymorphic lock to be released until the number of locked resources of the target polymorphic lock becomes 0, switch the target polymorphic lock from the resource state to the recursive state or the mutually exclusive state, and determine that the highest priority task in the blocking queue of the target polymorphic lock is the lock holder of the target polymorphic lock in the recursive state or the mutually exclusive state.

6. The method according to claim 5, It is characterized in that The method further comprises: When the level of the target polymorphic lock is the recursive state or the mutually exclusive state, and the target polymorphic lock is a polymorphic lock trapped in a deadlock loop, obtaining a task with the lowest priority from the tasks trapped in the deadlock loop; Switching the level of the current polymorphic lock held by the lowest priority task to a deadlock state or the resource state, and acquiring the highest priority task trapped in the deadlock loop from the blocking queue corresponding to the current polymorphic lock; the deadlock state is used to indicate that the current polymorphic lock is allowed to have two lock holders; When the level of the current polymorphic lock is the deadlock state, determine the highest priority task as the second lock holder of the current polymorphic lock in the deadlock state; when the level of the current polymorphic lock is the resource state, and the number of locked resources of the current polymorphic lock is less than the maximum number of locked resources of the current polymorphic lock, allow the highest priority task to acquire the current polymorphic lock in the resource state; After the highest priority task finishes running based on the current polymorphic lock, all polymorphic locks held by the highest priority task are released by the highest priority task.

7. The method according to claim 5, It is characterized in that Determining, based on the first number and the second number, that the target polymorphic lock meets a level switching condition includes: When it is determined that the first quantity is greater than the first quantity threshold and the second quantity is greater than the second quantity threshold, it is determined that the target polymorphic lock meets the level switching condition, the first quantity threshold corresponding to the recursive state is greater than the first quantity threshold corresponding to the mutually exclusive state, and the second quantity threshold corresponding to the recursive state is greater than the second quantity threshold corresponding to the mutually exclusive state.

8. A device for implementing task synchronization, It is characterized in that include: A detection module, used for detecting a first task applying for obtaining a target polymorphic lock; an acquisition module, configured to acquire the current level of the target polymorphic lock when the lock holder of the target polymorphic lock is a second task; A processing module is used to allow the first task to acquire the target polymorphic lock when the current level is a resource state.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that The processor runs the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product, It is characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method as claimed in any one of claims 1 to 7.

Citation Information

Cited By

  • Database lock leakage rapid detection and traceability positioning method and system, and electronic equipment

    CN122614622A