Timing snapshot generation method and apparatus, electronic device, and storage medium
By generating temporary resource locks and dynamically adjusting the task process, the time deviation problem of NAS scheduled snapshot tasks in the case of multi-task concurrency is solved, ensuring the accurate execution of scheduled snapshot tasks and meeting the specification requirements of file system and NAS scheduled snapshots.
Patent Information
- Application Number
- CN202211122507.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-09-15
AI Technical Summary
In existing technologies, when multiple tasks are running concurrently, the single resource lock causes the task creation time to deviate from the scheduled time, which cannot meet customers' needs for the number of file systems, the number of NAS timed snapshots, and accuracy.
By generating temporary resource locks, the task process is dynamically adjusted, idle task processes are identified and temporary resource locks are generated, and high-schedule-level tasks are prioritized to ensure the accuracy of the execution time of timed snapshot tasks.
This reduces the time skew of scheduled snapshot tasks under multi-task concurrency, meeting the system specifications of the file system and the snapshot specifications of NAS scheduled snapshots.
Smart Images

Figure CN115454931B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of snapshot generation, and in particular to a method, apparatus, electronic device, and storage medium for generating timed snapshots. Background Technology
[0002] In NAS (Network Attached Storage), a file system serves as the carrier, providing network sharing services for files or directories to different hosts within a local area network. A NAS snapshot is a fully usable copy of the file system's data at a specific point in time. NAS snapshots can be used to roll back the snapshot in case of file system failure, restoring the file system data to the point in time of the NAS snapshot copy, greatly reducing data loss. NAS timed snapshot policies (Snaptimers) can specify the period at which snapshots are created, creating them at fixed times. However, the creation or deletion of NAS timed snapshots takes time. To ensure data consistency, the file system needs to be briefly frozen before a snapshot is taken, and then thawed after the data copy is complete. The data copying process itself also takes time. Furthermore, before entering the file system freezing process, it is necessary to check whether the storage pool space on which the file system depends is sufficient, whether it exceeds the storage volume specification, whether it exceeds the file system snapshot limit, etc., which also consumes time. On a high-performance Intel x86 CPU, creating a scheduled NAS snapshot of a file system takes approximately one minute. On other, lower-performance CPU platforms, this time will be even longer. Therefore, if multiple file systems need to create scheduled NAS snapshots simultaneously, inevitably, the NAS snapshots created by file systems at the back of the task queue will deviate from the originally preset time. The longer the queue, the greater the deviation between the NAS snapshot created at the end of the queue and the expected creation time.
[0003] In existing technology, a dedicated resource lock—the dofssnaptimer lock—is set up within the NAS system to handle NAS scheduled snapshot tasks. All NAS scheduled snapshot creation or deletion tasks for the file system call this resource. This resource only responds to one task at a time; other tasks enter a waiting queue. Unprocessed NAS scheduled snapshot tasks will request the dofssnaptimer lock again every minute. Once the dofssnaptimer lock is used to process a task and enters an idle state, it will respond to one task's request, while the remaining tasks continue to wait until all NAS scheduled snapshot tasks are processed and the waiting queue is cleared. With only one dofssnaptimer lock, if too many NAS scheduled snapshot tasks need to be processed simultaneously, some scheduled snapshot tasks will deviate from their scheduled creation time. The longer the waiting queue, the longer the deviation in the final created NAS scheduled snapshot will be, failing to meet customer expectations. Furthermore, the currently configurable minimum NAS scheduled snapshot creation interval is 5 minutes, with each scheduled snapshot creation time around 40 seconds. Scheduled snapshot tasks in the waiting queue request the dofssnaptimer lock resource every minute. Therefore, if more than five file systems have NAS scheduled snapshot policies set with the same start time and a 5-minute interval, there's a possibility that one file system might have two NAS scheduled snapshot tasks waiting in the queue simultaneously. Since the dofssnaptimer lock responds randomly to NAS scheduled snapshot tasks, there's a risk that a NAS scheduled snapshot for a file system, which should be created in time period A, might be created later than the NAS scheduled snapshot that should be created in time period A+5 minutes. Furthermore, as customer demands for the number of file systems, the number of NAS scheduled snapshots, and the accuracy of NAS scheduled snapshots continue to increase, the current file system NAS scheduled snapshot processing mechanism is no longer suitable and cannot meet future development needs. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, electronic device, and storage medium for generating timed snapshots that can solve the problem that a single resource lock cannot handle the concurrent task requirements of multiple NAS timed snapshot tasks during the same period.
[0005] Firstly, a method for generating timed snapshots is provided, the method comprising:
[0006] When multiple timed snapshot tasks with the same start time are detected in the task execution queue, the task processes in the device are accessed and one or more idle task processes are identified.
[0007] Obtain the snapshot generation permission description from the device and generate a temporary resource lock based on the snapshot generation permission description and the idle task process;
[0008] A timed snapshot is generated based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
[0009] In one embodiment, obtaining the snapshot generation permission description in the device and generating a temporary resource lock based on the snapshot generation permission description and the idle task process includes:
[0010] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0011] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0012] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0013] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0014] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0015] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0016] In one embodiment, generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes:
[0017] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0018] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0019] In one embodiment, generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes:
[0020] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0021] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0022] In one embodiment, generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes:
[0023] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0024] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0025] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0026] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0027] In one embodiment, processing the file system according to the working resource lock or the temporary resource lock and generating the timed snapshot includes:
[0028] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0029] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0030] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0031] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0032] If so, the scheduled snapshot task was executed successfully.
[0033] In one embodiment, the step of generating a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task includes:
[0034] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0035] On the other hand, a timed snapshot generation apparatus is provided, the apparatus comprising:
[0036] The determination module is used to access the task processes in the device and determine one or more idle task processes when multiple timed snapshot tasks with the same start time are detected in the task execution queue.
[0037] The resource lock generation module is used to access the permission management file in the device and generate a temporary resource lock based on the permission management file and the idle task process.
[0038] The snapshot generation module is used to generate a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task.
[0039] In one embodiment, the resource lock generation module obtains the snapshot generation permission description from the device and generates a temporary resource lock based on the snapshot generation permission description and the idle task process, including:
[0040] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0041] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0042] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0043] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0044] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0045] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0046] In one embodiment, the snapshot generation module generates a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task, including:
[0047] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0048] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0049] In one embodiment, the snapshot generation module generates the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue, including:
[0050] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0051] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0052] In one embodiment, the snapshot generation module, based on the working resource lock in the device, the temporary resource lock, and the scheduled snapshot task, further includes generating a scheduled snapshot:
[0053] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0054] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0055] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0056] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0057] In one embodiment, the snapshot generation module processes the file system and generates the timed snapshot based on the working resource lock or the temporary resource lock, including:
[0058] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0059] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0060] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0061] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0062] If so, the scheduled snapshot task was executed successfully.
[0063] In one embodiment, after the snapshot generation module generates a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task, it includes:
[0064] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0065] In another aspect, an electronic device is provided, 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 perform the following steps:
[0066] When multiple timed snapshot tasks with the same start time are detected in the task execution queue, the task processes in the device are accessed and one or more idle task processes are identified.
[0067] Obtain the snapshot generation permission description from the device and generate a temporary resource lock based on the snapshot generation permission description and the idle task process;
[0068] A timed snapshot is generated based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
[0069] In one embodiment, the processor performs the following steps when executing the computer program:
[0070] The step of obtaining the snapshot generation permission description from the device and generating a temporary resource lock based on the snapshot generation permission description and the idle task process includes:
[0071] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0072] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0073] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0074] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0075] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0076] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0077] In one embodiment, the processor performs the following steps when executing the computer program:
[0078] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes:
[0079] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0080] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0081] In one embodiment, the processor performs the following steps when executing the computer program:
[0082] The step of generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes:
[0083] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0084] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0085] In one embodiment, the processor performs the following steps when executing the computer program:
[0086] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes:
[0087] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0088] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0089] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0090] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0091] In one embodiment, the processor performs the following steps when executing the computer program:
[0092] The step of processing the file system and generating the timed snapshot according to the working resource lock or the temporary resource lock includes:
[0093] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0094] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0095] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0096] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0097] If so, the scheduled snapshot task was executed successfully.
[0098] In one embodiment, the processor performs the following steps when executing the computer program:
[0099] After generating the timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task, the following steps are included:
[0100] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0101] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0102] When multiple timed snapshot tasks with the same start time are detected in the task execution queue, the task processes in the device are accessed and one or more idle task processes are identified.
[0103] Obtain the snapshot generation permission description from the device and generate a temporary resource lock based on the snapshot generation permission description and the idle task process;
[0104] A timed snapshot is generated based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
[0105] In one embodiment, the computer program performs the following steps when executed by a processor:
[0106] The step of obtaining the snapshot generation permission description from the device and generating a temporary resource lock based on the snapshot generation permission description and the idle task process includes:
[0107] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0108] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0109] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0110] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0111] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0112] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0113] In one embodiment, the computer program performs the following steps when executed by a processor:
[0114] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes:
[0115] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0116] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0117] In one embodiment, the computer program performs the following steps when executed by a processor:
[0118] The step of generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes:
[0119] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0120] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0121] In one embodiment, the computer program performs the following steps when executed by a processor:
[0122] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes:
[0123] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0124] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0125] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0126] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0127] In one embodiment, the computer program performs the following steps when executed by a processor:
[0128] The step of processing the file system and generating the timed snapshot according to the working resource lock or the temporary resource lock includes:
[0129] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0130] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0131] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0132] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0133] If so, the scheduled snapshot task was executed successfully.
[0134] In one embodiment, the computer program performs the following steps when executed by a processor:
[0135] After generating the timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task, the following steps are included:
[0136] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0137] When multiple scheduled snapshot tasks with the same start time are detected in the task execution queue, the system accesses the task processes in the device and identifies one or more idle task processes. It then obtains the snapshot generation permission description from the device and generates a temporary resource lock based on the snapshot generation permission description and the idle task processes. Finally, it generates a scheduled snapshot based on the working resource lock in the device, the temporary resource lock, and the scheduled snapshot tasks. Generating a temporary resource lock enables a dynamic resource adjustment strategy and solves the problem that a single resource lock cannot handle the concurrent task requirements of multiple NAS scheduled snapshots within the same time period. Calling and scheduling task processes with high resource levels helps to expand the system specifications of the file system and the snapshot specifications of NAS scheduled snapshots. Attached Figure Description
[0138] Figure 1 A flowchart illustrating the method for generating timed snapshots;
[0139] Figure 2 A schematic diagram illustrating the steps of the timed snapshot generation method;
[0140] Figure 3 A schematic diagram of the timed snapshot generation device;
[0141] Figure 4 This is an internal structural diagram of a computer device in an embodiment of the present invention. Detailed Implementation
[0142] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0143] The scheduled task visualization method provided in this application can be applied to, for example... Figure 1 The flowchart illustrates the method for generating timed snapshots. It involves identifying one or more idle task processes within the task process. When the sum of the number of idle task processes and the number of working resource locks exceeds the total number of tasks for multiple timed snapshot tasks, a target idle task process with fewer than one task is selected from the idle task processes based on the resource scheduling level. Then, a temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process. Finally, the timed snapshot task is executed and a timed snapshot is generated based on the working resource lock and the temporary resource lock provided in the device.
[0144] In one embodiment, such as Figure 2 As shown, the present invention provides a method for generating timed snapshots, the method comprising:
[0145] S201. When multiple timed snapshot tasks with the same start time are detected in the task execution queue, access the task processes in the device and determine one or more idle task processes in the task processes.
[0146] S202. Obtain the snapshot generation permission description in the device and generate a temporary resource lock according to the snapshot generation permission description and the idle task process;
[0147] S203. Generate a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
[0148] Specifically, when multiple scheduled snapshot tasks need to be executed concurrently, the system accesses the operating system (e.g., Windows) of the device (e.g., a computer) to determine which task processes are running in the system's task manager or background. These task processes mainly include system processes and user processes. System processes may include [Csrss], a core component of Windows, short for Client-Server Process; and [Ctfmon], which is used by processes installed on Windows XP (especially those installed with Office). After XP, the "Language Bar" appears in the lower right corner of the desktop; [explorer] explorer.exe always runs in the background, controlling the standard user interface, processes, commands, and desktop; [IEXPLORE] / [iexplore] Internet Explorer browser. When we surf the Internet with it, it consumes more memory, and this increases with the number of open browser windows. However, when all IE windows are closed, it does not disappear from the Task Manager; IEXPLORE.EXE continues to run in the background; [msmsgs] This is the famous MSN process for Microsoft's Windows Messenger (instant messaging software). It is bundled in the Home and Professional editions of WinXP. If you are also running programs such as Outlook (email) and MSN Explorer (Microsoft software), this process will run in the background to support all instant messaging software. The operating system of a device contains many system processes and user processes, which will not be listed here. Among all the task processes, one or more idle task processes can be selected. For example, the [IEXPLORE] process mentioned above, when the user closes all IE windows, its process file (IEXPLORE.EXE) is still running in the background. Therefore, [IEXPLORE], which is still running in the background but currently has no task to execute, can be identified as an idle task process. Alternatively, [IEXPLORE] processes running IE windows but not receiving task instructions can also be identified as idle task processes. Another example is the [msmsgs] process mentioned above. When it is running in the background and the Outlook program on supported devices has not yet started, this process can be identified as an idle task process.
[0149] In one embodiment, obtaining the snapshot generation permission description in the device and generating a temporary resource lock based on the snapshot generation permission description and the idle task process includes:
[0150] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0151] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0152] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0153] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0154] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0155] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0156] Specifically, for example, if there are five scheduled snapshot tasks with the same start time in the task queue, the number of idle task processes identified above needs to be compared with the device's built-in working resource lock (dofssnaptimer lock) and the number of scheduled snapshot tasks. For instance, if there are six idle task processes, their resource scheduling levels need to be obtained. The higher the resource scheduling level, the more memory and CPU can be allocated. Then, four target idle task processes are selected from the six idle task processes based on their resource scheduling levels. If there are only two idle task processes, they are directly determined as target idle task processes. After determining the target idle task processes, the snapshot generation permission description (permission code) in the device's operating system is obtained. By writing the permission code into the target idle task processes, the permission to execute file system scheduled snapshot tasks is granted. This permission is not file system-specific; scheduled snapshot tasks from all file systems can be executed. In this case, the target idle task processes can be considered as "temporary resource locks".
[0157] In one embodiment, generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes:
[0158] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0159] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0160] Specifically, as mentioned above, when there are five scheduled snapshot tasks with the same start time, the device has four generated temporary dofssnaptimer locks in addition to the original dofssnaptimer lock. The original dofssnaptimer lock preferentially selects one of the scheduled snapshot tasks to execute. Since each scheduled snapshot task processes a file system without priority and generates snapshots of the same size, the four temporary dofssnaptimer locks can each select a scheduled snapshot task to execute based on their different response speeds, without requiring NAS system scheduling. Conversely, when the device has two generated temporary dofssnaptimer locks in addition to the original dofssnaptimer lock, the original dofssnaptimer lock again preferentially selects one of the scheduled snapshot tasks to execute, while the temporary resource locks arbitrarily select a scheduled snapshot task to execute. The remaining scheduled snapshot tasks wait for either the temporary resource lock or the original dofssnaptimer lock to finish executing.
[0161] In one embodiment, generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes:
[0162] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0163] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0164] Specifically, when granting snapshot generation permission to a temporary resource lock, its permission priority is lower than the execution priority of its original task processing code. When the temporary resource lock receives a task message from the device, such as the
IEXPLORE
[0165] In one embodiment, generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes:
[0166] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0167] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0168] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0169] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0170] Specifically, the snapshot task message includes a file system identifier. This identifier is used to determine the file system corresponding to the scheduled snapshot task from among multiple file systems on the device, and the corresponding system parameters are obtained from that file system. These parameters include storage pool space, storage volume size, and scheduled snapshot size. Additionally, the snapshot task message includes the specification requirements for the scheduled snapshot to be generated. For example, if the memory required to generate a scheduled snapshot exceeds the file system's storage pool space, or the required storage volume size exceeds the file system's storage volume size, the scheduled snapshot task is determined to be unfinishable, and the scheduled snapshot task displayed as "running" in the task execution queue is deleted. Furthermore, because the total number of snapshots retained by the system has a system-level specification (e.g., a device can retain a maximum of 16 scheduled snapshots), when a retention limit of 1 is set for 16 file systems, if a scheduled snapshot already exists in the file system corresponding to the scheduled snapshot task, it is determined that the system parameters do not meet the requirements of the snapshot task message. Alternatively, when setting a retention limit of 2 for 8 file systems, if it is detected that a timed snapshot already exists in the file system corresponding to the timed snapshot task and still satisfies the snapshot task message, the timed snapshot task will only be officially executed according to the original dofssnaptimer lock or temporary resource lock if the storage pool space, storage volume size, and timed snapshot size all meet the snapshot size to be generated contained in the snapshot task message (not exceeding the storage pool space, not exceeding the storage volume size, and not exceeding the number of snapshots retained by the file system).
[0171] In one embodiment, processing the file system according to the working resource lock or the temporary resource lock and generating the timed snapshot includes:
[0172] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0173] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0174] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0175] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0176] If so, the scheduled snapshot task was executed successfully.
[0177] Specifically, the process of executing a scheduled snapshot task based on the original dofssnaptimer lock or temporary resource lock is similar, including: freezing the I / O (Input / Output) function of the corresponding file system by calling the original dofssnaptimer lock or temporary resource lock, creating a scheduled snapshot based on the copied file data, and restoring the file system's I / O function after creation. Whether a scheduled snapshot can be started normally can be determined by rolling back the scheduled snapshot, restoring the file system data to the data at the time of copying; if the rollback is successful, the scheduled snapshot task is considered successful; if the rollback fails, an alarm message containing a failure to generate the scheduled snapshot is sent to remind the user to check the reason for the failure. Of course, other methods can also be used to determine whether a scheduled snapshot can be started normally, which will not be elaborated upon here.
[0178] In one embodiment, the step of generating a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task includes:
[0179] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0180] Specifically, when there are no multiple timed snapshot tasks with the same start time that need to be processed concurrently in the task execution queue, the snapshot generation permission description written to the target idle task process is deleted, and the timed snapshot generation permission is no longer granted to it, that is, the target idle task process is no longer regarded as a temporary resource lock.
[0181] The proposed solution has the following beneficial effects:
[0182] 1) A dynamic resource adjustment strategy is implemented by generating temporary resource locks, which solves the problem that a single dofssnaptimer lock cannot handle the concurrent task requirements of multiple NAS timed snapshots in the same period;
[0183] 2) Calling high-level scheduling task processes helps to extend the system specifications of the file system and the snapshot specifications of NAS timed snapshots.
[0184] It should be understood that, although Figure 2The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0185] In one embodiment, such as Figure 3 As shown, a timed snapshot generation device is provided, the device comprising:
[0186] The determination module 301 is used to access the task processes in the device and determine one or more idle task processes among the task processes when multiple timed snapshot tasks with the same start time are detected in the task execution queue.
[0187] The resource lock generation module 302 is used to access the permission management file in the device and generate a temporary resource lock according to the permission management file and the idle task process.
[0188] The snapshot generation module 303 is used to generate a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task.
[0189] In one embodiment, the resource lock generation module obtains the snapshot generation permission description from the device and generates a temporary resource lock based on the snapshot generation permission description and the idle task process, including:
[0190] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0191] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0192] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0193] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0194] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0195] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0196] In one embodiment, the snapshot generation module generates a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task, including:
[0197] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0198] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0199] In one embodiment, the snapshot generation module generates the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue, including:
[0200] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0201] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0202] In one embodiment, the snapshot generation module, based on the working resource lock in the device, the temporary resource lock, and the scheduled snapshot task, further includes generating a scheduled snapshot:
[0203] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0204] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0205] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0206] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0207] In one embodiment, the snapshot generation module processes the file system and generates the timed snapshot based on the working resource lock or the temporary resource lock, including:
[0208] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0209] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0210] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0211] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0212] If so, the scheduled snapshot task was executed successfully.
[0213] In one embodiment, after the snapshot generation module generates a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task, it includes:
[0214] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0215] Specific limitations regarding the timed snapshot generation device can be found in the limitations of the timed snapshot generation method described above, and will not be repeated here. Each module in the aforementioned timed snapshot generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0216] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an alarm information processing method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0217] Those skilled in the art will understand that Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0218] In one embodiment, an electronic device is provided, 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 perform the following steps:
[0219] When multiple timed snapshot tasks with the same start time are detected in the task execution queue, the task processes in the device are accessed and one or more idle task processes are identified.
[0220] Obtain the snapshot generation permission description from the device and generate a temporary resource lock based on the snapshot generation permission description and the idle task process;
[0221] A timed snapshot is generated based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
[0222] In one embodiment, the processor performs the following steps when executing the computer program:
[0223] The step of obtaining the snapshot generation permission description from the device and generating a temporary resource lock based on the snapshot generation permission description and the idle task process includes:
[0224] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0225] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0226] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0227] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0228] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0229] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0230] In one embodiment, the processor performs the following steps when executing the computer program:
[0231] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes:
[0232] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0233] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0234] In one embodiment, the processor performs the following steps when executing the computer program:
[0235] The step of generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes:
[0236] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0237] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0238] In one embodiment, the processor performs the following steps when executing the computer program:
[0239] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes:
[0240] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0241] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0242] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0243] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0244] In one embodiment, the processor performs the following steps when executing the computer program:
[0245] The step of processing the file system and generating the timed snapshot according to the working resource lock or the temporary resource lock includes:
[0246] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0247] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0248] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0249] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0250] If so, the scheduled snapshot task was executed successfully.
[0251] In one embodiment, the processor performs the following steps when executing the computer program:
[0252] After generating the timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task, the following steps are included:
[0253] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0254] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0255] When multiple timed snapshot tasks with the same start time are detected in the task execution queue, the task processes in the device are accessed and one or more idle task processes are identified.
[0256] Obtain the snapshot generation permission description from the device and generate a temporary resource lock based on the snapshot generation permission description and the idle task process;
[0257] A timed snapshot is generated based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
[0258] In one embodiment, the computer program performs the following steps when executed by a processor:
[0259] The step of obtaining the snapshot generation permission description from the device and generating a temporary resource lock based on the snapshot generation permission description and the idle task process includes:
[0260] Determine whether the sum of the number of idle task processes and the number of working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks;
[0261] If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process;
[0262] Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes.
[0263] The temporary resource lock is generated according to the snapshot task processing permission description and the target idle task process;
[0264] If not, then all the aforementioned idle task processes are identified as the target idle task process;
[0265] Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process.
[0266] In one embodiment, the computer program performs the following steps when executed by a processor:
[0267] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes:
[0268] Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock;
[0269] The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
[0270] In one embodiment, the computer program performs the following steps when executed by a processor:
[0271] The step of generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes:
[0272] When the temporary resource lock receives the task message sent by the device, it cancels the execution of the timed snapshot task and re-records the timed snapshot task to the task execution queue.
[0273] Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
[0274] In one embodiment, the computer program performs the following steps when executed by a processor:
[0275] The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes:
[0276] The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained;
[0277] Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications;
[0278] If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated;
[0279] If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
[0280] In one embodiment, the computer program performs the following steps when executed by a processor:
[0281] The step of processing the file system and generating the timed snapshot according to the working resource lock or the temporary resource lock includes:
[0282] The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock;
[0283] Copy the file data from the file system and generate the timed snapshot based on the file data;
[0284] After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally.
[0285] If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device;
[0286] If so, the scheduled snapshot task was executed successfully.
[0287] In one embodiment, the computer program performs the following steps when executed by a processor:
[0288] After generating the timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task, the following steps are included:
[0289] When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
[0290] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0291] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0292] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for generating timed snapshots, the method comprising: When multiple timed snapshot tasks with the same start time are detected in the task execution queue, the device's operating system is accessed to scan the running task processes in the operating system. Task processes running in the background without any tasks to execute, and task processes that are running but have not received task instructions, will be designated as idle task processes. Determine whether the sum of the number of idle task processes and working resource locks is greater than the number of tasks in the plurality of timed snapshot tasks; If so, obtain the snapshot generation permission description and the resource scheduling level of the idle task process; Based on the resource scheduling level, a target idle task process with a process number less than one of the task numbers is determined from the idle task processes. A temporary resource lock is generated based on the snapshot task processing permission description and the target idle task process; If not, then all the aforementioned idle task processes are identified as the target idle task process; Obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process; A timed snapshot is generated based on the working resource lock, the temporary resource lock, and the timed snapshot task in the device.
2. The method according to claim 1, characterized in that, The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task includes: Execute the scheduled snapshot task and generate the scheduled snapshot according to the work resource lock; The timed snapshot is generated based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue.
3. The method according to claim 2, characterized in that, The step of generating the timed snapshot based on the temporary resource lock and the unexecuted timed snapshot tasks in the task execution queue includes: When the temporary resource lock receives the task message sent by the device, it cancels the execution of the scheduled snapshot task and re-records the scheduled snapshot task to the task execution queue. Delete the snapshot generation permission description and restore the temporary resource lock to the target idle task process.
4. The method according to claim 1, characterized in that, The step of generating a timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task further includes: The file system to be processed is determined based on the snapshot task message of the scheduled snapshot task, and the system coefficient of the file system is obtained; Determine whether the system coefficients meet the snapshot task information of the scheduled snapshot task, wherein the system coefficients include storage pool space, storage volume specifications, and scheduled snapshot specifications; If so, the file system is processed according to the working resource lock or the temporary resource lock, and the timed snapshot is generated; If not, then stop executing the scheduled snapshot task and remove the scheduled snapshot task from the task execution queue.
5. The method according to claim 4, characterized in that, The step of processing the file system and generating the timed snapshot according to the working resource lock or the temporary resource lock includes: The input / output functions of the file system are disabled based on the working resource lock or the temporary resource lock; Copy the file data from the file system and generate the timed snapshot based on the file data; After the timed snapshot is generated, the input / output function is restored and it is determined whether the timed snapshot can be started normally. If not, an alarm message indicating that the generation of a timed snapshot failed is sent to the operating system of the device; If so, the scheduled snapshot task was executed successfully.
6. The method according to claim 1, characterized in that, After generating the timed snapshot based on the working resource lock in the device, the temporary resource lock, and the timed snapshot task, the process includes: When there are no multiple timed snapshot tasks with the same start time in the task execution queue, delete the snapshot generation permission description and restore all temporary resource locks to the target idle task process.
7. A timed snapshot generation apparatus, the apparatus comprising: The determination module is used to access the device's operating system and scan the running task processes in the operating system when multiple timed snapshot tasks with the same start time are detected in the task execution queue; task processes running in the background without any tasks to be executed, and task processes that are running but have not received task instructions are identified as idle task processes. The resource lock generation module is used to determine whether the sum of the number of idle task processes and working resource locks is greater than the number of tasks of the multiple timed snapshot tasks; if so, it obtains the snapshot generation permission description and the resource scheduling level of the idle task process. Based on the resource scheduling level, a target idle task process with a number of processes less than one of the number of tasks is determined from the idle task processes; a temporary resource lock is generated based on the snapshot task processing permission description and the target idle task process; If not, then determine all the idle task processes as the target idle task process; obtain the snapshot generation permission description and generate the temporary resource lock according to the snapshot task processing permission description and the target idle task process; The snapshot generation module is used to generate a timed snapshot based on the working resource lock, the temporary resource lock, and the timed snapshot task.
8. An electronic device, characterized in that, include: One or more processors; And a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the method as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Thread pool resource management task processing method, device and equipment and storage medium
CN112035255A
Method and device for executing timed snapshot task
CN114564291A