Resource coordination processing method, device and equipment for backup job, storage medium and program product
By detecting tape library resource conflicts and releasing them based on priority and timeout mechanisms, the stability and efficiency issues caused by multiple backup jobs competing for resources in the tape library are resolved. This achieves efficient resource allocation and scheduling, improving the stability and execution efficiency of backup jobs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 广州鼎甲计算机科技有限公司
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-14
AI Technical Summary
In tape libraries, resource conflicts caused by multiple backup jobs competing for the same resource simultaneously affect the stability and execution efficiency of backup jobs. Existing technologies cannot effectively solve the problems of multiple resource contention, deadlock, starvation of low-priority jobs, and idle lock resources.
By acquiring the resource occupancy status of the tape library and the resource request information of backup jobs, resource conflicts are detected. Based on the conflict type and the priority of the backup job, a conflict resolution strategy is determined, a coordination processing instruction is generated, and the controller is instructed to release resources to be allocated to the target backup job. Combined with fair locking mechanism, priority preemption and timeout release mechanism, precise resource scheduling is achieved.
It alleviates resource contention conflicts in concurrent backup scenarios, improves the stability and execution efficiency of backup jobs, avoids deadlocks and starvation of low-priority jobs, improves the utilization of lock resources and scheduling fairness, and adapts to the needs of complex concurrent scenarios.
Smart Images

Figure CN122387657A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage and backup technology, and in particular to a resource coordination processing method, apparatus, computer equipment, storage medium and computer program product for backup operations. Background Technology
[0002] As an enterprise-level offline backup device, tape libraries have exclusive resources (such as tape drives, tape media, and robotic arms), meaning that resources can typically only be used by one backup job at a time. With the increase in the number of concurrent backup jobs, scenarios where multiple backup jobs simultaneously compete for the same resources frequently occur, and these resource contention conflicts affect the stability and execution efficiency of backup jobs. Summary of the Invention
[0003] Therefore, it is necessary to provide a resource coordination and processing method, apparatus, computer equipment, storage medium, and computer program product for backup operations to address the aforementioned technical problems.
[0004] This application provides a resource coordination processing method for backup jobs, the method comprising:
[0005] Obtain the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup jobs for the tape library;
[0006] Based on the resource request information of each of the multiple backup jobs, determine the resource request conflicts between the multiple backup jobs;
[0007] Based on the conflict type corresponding to the requested resource conflict and the priority of each of the multiple backup jobs, a conflict resolution strategy is determined;
[0008] When determining to allocate a target resource to a target backup job according to the conflict resolution strategy, if it is determined that the target resource is occupied by other backup jobs based on the resource occupancy status of the target resource, a coordination processing instruction is generated; the coordination processing instruction is used to instruct the controller of the tape library to trigger other backup jobs to release the target resource and allocate the target resource to the target backup job.
[0009] This application provides a resource coordination and processing apparatus for backup operations, the apparatus comprising:
[0010] The acquisition module is used to acquire the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup jobs for the tape library.
[0011] The conflict detection module is used to determine the resource request conflicts between multiple backup jobs based on their respective resource request information.
[0012] The conflict resolution strategy determination module is used to determine the conflict resolution strategy based on the conflict type corresponding to the requested resource conflict and the priority of each of the multiple backup jobs.
[0013] The instruction generation module is used to determine, according to the conflict resolution strategy, that when allocating the target resource to the target backup job, if it is determined according to the resource occupancy status of the target resource that the target resource is occupied by other backup jobs, generate a coordination processing instruction; the coordination processing instruction is used to instruct the tape library controller to trigger other backup jobs to release the target resource and allocate the target resource to the target backup job.
[0014] This application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0015] This application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0016] This application provides a computer program product having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0017] The resource coordination processing method, apparatus, computer equipment, storage medium, and computer program product for the aforementioned backup operation acquire the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup operations targeting the tape library; determine the resource request conflict situation between the multiple backup operations based on the resource request information of each backup operation; determine the conflict resolution strategy based on the conflict type corresponding to the resource request conflict situation and the priority of each backup operation; when determining to allocate the target resource to the target backup operation according to the conflict resolution strategy, if it is determined from the resource occupancy status of the target resource that it is occupied by other backup operations, a coordination processing instruction is generated; the coordination processing instruction is used to instruct the tape library controller to trigger other backup operations to release the target resource and allocate the target resource to the target backup operation. This solution detects resource requests from multiple backup jobs in a tape library by analyzing their respective resource request information. Based on the conflict type and the priorities of each backup job, a conflict resolution strategy is determined. When the strategy determines to allocate the target resource to the target backup job, if the target resource is found to be occupied by another backup job, a coordination instruction is generated. This instruction instructs the tape library controller to trigger other backup jobs to release the target resource and allocate it to the target backup job. This approach alleviates resource contention conflicts in concurrent backup scenarios, improving backup job stability and execution efficiency. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating a resource coordination method for backup jobs in one embodiment.
[0020] Figure 2 This is a schematic diagram of the timeout handling process in one embodiment;
[0021] Figure 3 This is another flowchart illustrating the resource coordination processing method for backup jobs in one embodiment;
[0022] Figure 4 This is a structural block diagram of a resource coordination and processing device for backup jobs in one embodiment.
[0023] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0024] 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.
[0025] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various objects, but these objects are not limited by these terms. These terms are only used to distinguish the first object from the second object. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the solutions, or any combination of multiple solutions.
[0026] This application provides a resource coordination processing method for backup jobs, the steps of which can be executed by a computer device, and the method may include... Figure 1 The steps are shown.
[0027] Step S101: Obtain the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup jobs for the tape library.
[0028] The system can collect data on the resource occupancy status (locked / unlocked) of each resource in the tape library and the resource request information of each backup job for the tape library at a set collection frequency, thereby providing data support for conflict determination. The collection frequency can use a default value, such as 50ms / time. In some implementations, the collection frequency can be determined based on the number of concurrent backup jobs for the tape library; the higher the number of concurrent backup jobs, the higher the collection frequency. For example, in high-concurrency backup job scenarios, the collection frequency can be set to 30ms / time, and in low-concurrency backup job scenarios, the collection frequency can be set to 100ms / time. The resource request information of the backup jobs may include, but is not limited to, the priority of the backup job, the type of resource requested by the backup job, and the resource request time.
[0029] Step S102: Determine the resource request conflict between multiple backup jobs based on their respective resource request information.
[0030] The resource types requested by each backup job can be parsed from the resource request information of each backup job, thereby constructing a resource-job association matrix. Conflicts can be judged based on the resource-job association matrix and the resource request overlap, and whether there are conflicts between the resources requested by backup jobs, thus revealing the resource request conflict situation between multiple backup jobs.
[0031] Step S103: Determine the conflict resolution strategy based on the conflict type corresponding to the requested resource conflict and the priority of each of the multiple backup jobs.
[0032] Resource conflict status is used to characterize whether conflicts exist between the resources requested by the backup jobs, and if so, the corresponding conflict type. In this step, a conflict resolution strategy is determined based on the conflict type corresponding to the resource conflict status and the priorities of the multiple backup jobs. This strategy is used to resolve conflicts between the resources requested by the backup jobs. The priority of the backup jobs can be determined based on the priority level of the job type to which the backup job belongs, or it can be determined based on the priority level of the job type to which the backup job belongs and the job's urgency, thus adapting to more complex priority requirements.
[0033] In step S104, when determining to allocate the target resource to the target backup job according to the conflict resolution strategy, if it is determined that the target resource is occupied by other backup jobs based on its resource occupancy status, a coordination processing instruction is generated. This coordination processing instruction instructs the tape library controller to trigger other backup jobs to release the target resource and allocate it to the target backup job.
[0034] The conflict resolution strategy carries information about which resources to allocate to which backup job. Therefore, by parsing the conflict resolution strategy, it can be determined which resource to allocate to which backup job. This resource can be called the target resource, and the backup job can be called the target backup job. The resource occupancy status of the target resource can be obtained from the resource occupancy status of each resource in the tape library. If the resource occupancy status of the target resource indicates that it is occupied by another backup job besides the target backup job, a coordination processing instruction can be generated and sent to the tape library controller. The tape library controller manages the resources of the tape library. After receiving the coordination processing instruction, the tape library controller can, according to the instructions, trigger the backup job occupying the target resource to temporarily store incomplete data in the cache and release the target resource, then allocate the target resource to the target backup job.
[0035] In the resource coordination and processing method for the above backup jobs, conflict detection of requested resources is performed on the resource request information of multiple backup jobs in the tape library. A conflict resolution strategy is determined based on the conflict type corresponding to the requested resource conflict and the priority of each backup job. When the conflict resolution strategy determines that the target resource will be allocated to the target backup job, if the target resource is determined to be occupied by other backup jobs based on its resource occupancy status, a coordination processing instruction is generated. This instruction instructs the tape library controller to trigger other backup jobs to release the target resource and allocate it to the target backup job. This alleviates resource contention conflicts in concurrent backup job scenarios and improves the stability and execution efficiency of backup jobs.
[0036] In an exemplary embodiment, a conflict resolution strategy is determined based on the conflict type corresponding to the requested resource conflict and the respective priorities of multiple backup jobs, including:
[0037] When the conflict type corresponding to the resource request conflict indicates that the resources requested by at least two backup jobs are completely conflicting, the higher priority backup job is determined from the at least two backup jobs according to their respective priorities; a complete conflict indicates that the resources requested by at least two backup jobs are exactly the same; when there are at least two high-priority backup jobs, the first type of target backup job is determined from the at least two high-priority backup jobs according to the order of the resource request times of the high-priority backup jobs, and the same resources requested by at least two backup jobs are determined as the first type of target resources, thus obtaining the conflict resolution strategy; the resource request time is obtained from parsing the resource request information.
[0038] In this embodiment, it can be determined whether the requested resource conflict corresponds to a complete conflict type. A complete conflict type indicates that at least two backup jobs are requesting the exact same resource, which means that at least two backup jobs are competing for the same resource. If the requested resource conflict corresponds to a complete conflict type, then the higher priority backup job (such as the highest priority backup job) can be determined from the at least two backup jobs based on their respective priorities.
[0039] If the number of high-priority backup jobs is 1, then that high-priority backup job can be identified as a first-category target backup job. If the number of high-priority backup jobs is greater than or equal to 2, then the resource request time of the high-priority backup jobs can be obtained from the resource request information, and the high-priority backup job with the earlier resource request time can be identified as a first-category target backup job.
[0040] The same resource requested by at least two backup jobs is identified as a first-class target resource; the conflict resolution strategy is obtained by allocating the first-class target resource to the first-class target backup job.
[0041] In the event of a complete conflict, this embodiment achieves precise resource scheduling through a two-level screening mechanism: First, high-priority backup jobs are determined based on their priority, ensuring that critical backup jobs receive resources first. Then, resource request time is introduced as the arbitration criterion for jobs of the same priority, preventing disorderly contention among high-priority backup jobs. This embodiment avoids situations where low-priority backup jobs occupy resources for extended periods, forcing high-priority backup jobs to wait continuously, and also eliminates resource waste caused by repeated competition among backup jobs of the same priority. Therefore, it improves the overall throughput efficiency of the tape library while ensuring backup service continuity.
[0042] In an exemplary embodiment, a conflict resolution strategy is determined based on the conflict type corresponding to the requested resource conflict and the respective priorities of multiple backup jobs, including:
[0043] When the conflict type corresponding to the resource request conflict indicates that the resources requested by at least two backup jobs partially conflict, the same resources requested by at least two backup jobs are identified as overlapping resources, and the resources requested by at least two backup jobs other than overlapping resources are identified as non-overlapping resources. Partial conflict indicates that the resources requested by at least two backup jobs are partially the same. For overlapping resources, based on the respective priorities of the at least two backup jobs, a higher priority backup job is identified among the at least two backup jobs, and a second type of target backup job is obtained based on the higher priority backup job. The overlapping resources are identified as second type target resources. For non-overlapping resources, the backup job requesting non-overlapping resources is identified as a third type of target backup job, and the non-overlapping resources are identified as third type target resources. Based on the second type of target backup job and the second type of target resource, as well as the third type of target backup job and the third type of target resource, a conflict resolution strategy is obtained.
[0044] In this embodiment, it can be determined whether the requested resource conflict corresponds to a partial conflict type. A partial conflict type indicates that at least two backup jobs request the same portion of the resource, indicating a partial conflict, meaning that at least two backup jobs are competing for the same portion of the resource. If the requested resource conflict corresponds to a partial conflict type, the same resource requested by at least two backup jobs can be identified as overlapping resources, and the resources requested by at least two backup jobs other than overlapping resources can be identified as non-overlapping resources.
[0045] For overlapping resources, these resources can be identified as second-category target resources. Based on the priorities of at least two backup jobs, a higher-priority backup job (e.g., the highest-priority backup job) can be identified among the at least two backup jobs. If there is only one high-priority backup job, that high-priority backup job can be identified as a second-category target backup job. If there are two or more high-priority backup jobs, the resource request time of the high-priority backup jobs can be obtained from the resource request information, and the high-priority backup job with the earlier resource request time can be identified as a second-category target backup job.
[0046] For non-overlapping resources, they can be classified as third-category target resources. Backup jobs requesting non-overlapping resources can be classified as third-category target backup jobs.
[0047] By allocating second-type target resources to second-type target backup jobs and third-type target resources to third-type target backup jobs, a conflict resolution strategy is obtained.
[0048] In this embodiment, when partial conflicts exist, a resource splitting and decoupling mechanism is used to resolve some conflict deadlocks: First, the resources requested by backup jobs are divided into overlapping and non-overlapping resources. Non-overlapping resources can be directly allocated to the corresponding backup jobs, eliminating unnecessary waiting; overlapping resources can be allocated according to the priority of backup jobs, ensuring that resources are prioritized for critical backup jobs. This embodiment degrades global waiting to local queuing, which can compress the idle time of the backup window and maximize the concurrent utilization of tape library resources while maintaining the priority of high-priority jobs.
[0049] In an exemplary embodiment, a conflict resolution strategy is determined based on the conflict type corresponding to the requested resource conflict and the respective priorities of multiple backup jobs, including:
[0050] When the conflict type corresponding to the resource request conflict indicates that at least two backup jobs are deadlocked, a high-priority backup job is determined among the at least two backup jobs; a deadlock conflict indicates that at least two backup jobs are waiting for each other to release resources; a fourth type of target backup job is obtained based on the high-priority backup job, and a fourth type of target resource is obtained based on the resources involved in the deadlock conflict; a conflict resolution strategy is obtained based on the fourth type of target backup job and the fourth type of target resource.
[0051] In this embodiment, it can be determined whether the requested resource conflict situation corresponds to the deadlock conflict type. The deadlock conflict type indicates that there are at least two backup jobs waiting for each other to release resources. For example, if backup job J1 occupies resource D1 and waits for resource M2, and backup job J2 occupies resource M2 and waits for resource D1, a circular waiting relationship is formed between backup job J1 and backup job J2, and a deadlock conflict exists.
[0052] If the requested resource conflict corresponds to a deadlock conflict type, then based on the priority of the backup jobs, a higher-priority backup job (such as the highest-priority backup job) can be determined from the backup jobs with deadlock conflicts. A fourth type of target backup job is then obtained based on the higher-priority backup job. The resources involved in the deadlock conflict can be identified as fourth-type target resources; in the example above, the resources involved in the deadlock conflict include resources D1 and M2. The conflict resolution strategy is derived by allocating fourth-type target resources to fourth-type target backup jobs.
[0053] In this embodiment, when deadlock conflicts exist, the deadlock loop is broken through priority arbitration. The high-priority backup job retains its occupancy right in the circular waiting chain, and the resources held by the low-priority backup job can be forcibly released to cut off the waiting loop. This allows for rapid recovery from the stalemate state, avoids a complete interruption of backup tasks, and minimizes the destructive impact of deadlock on the backup window.
[0054] In an exemplary embodiment, a fourth type of target backup job is obtained based on the high-priority backup job, including:
[0055] When there are at least two high-priority backup jobs, identify the backup job that consumes the most resources among the at least two high-priority backup jobs, and designate the backup job that consumes the most resources as the fourth type of target backup job.
[0056] If the requested resource conflict corresponds to a deadlock conflict type, then the higher priority backup job (such as the highest priority backup job) can be determined from the backup jobs with deadlock conflicts based on the priority of the backup jobs.
[0057] If there is only one high-priority backup job, then that high-priority backup job can be identified as a fourth-category target backup job. If there are two or more high-priority backup jobs, then the amount of resources used by each high-priority backup job can be determined, and the high-priority backup job that uses the most resources can be identified as a fourth-category target backup job.
[0058] In this embodiment, when deadlock conflicts exist, if there are at least two high-priority backup jobs, the one that occupies the most resources will be retained first among the deadlock backup jobs of the same priority. This can break the circular wait at the lowest cost, because the backup job that releases fewer resources has a lower rollback cost.
[0059] In one exemplary embodiment, the method provided in this application further includes Figure 2 The steps shown are as follows:
[0060] Step S201: Monitor the duration of each resource being occupied; Step S202: When the duration of any resource being occupied reaches a preset threshold, determine whether the backup job has completed the preset operation based on the execution status of the backup job occupying the resource; Step S203: If the backup job has not completed the preset operation, generate a resource release command; The resource release command is used to instruct the tape library controller to trigger the backup job to release the corresponding resources to supply other backup jobs.
[0061] In this embodiment, the occupied duration of each resource in the tape library can be monitored. When the occupied duration of a resource reaches a preset threshold T0, the execution status of the backup job occupying that resource can be obtained. Based on the execution status, it can be determined whether the backup job has completed the preset operation (such as tape mounting, data read / write initiation). If the backup job has not completed the preset operation, a resource release command is generated and sent to the tape library controller. The tape library controller can trigger the aforementioned backup job to release the corresponding resource according to the resource release command, so as to provide it for other backup jobs. Thus, this embodiment can avoid long-term resource idleness through a timeout release mechanism, thereby improving resource utilization.
[0062] To better understand the above method, an application example of the resource coordination processing method for backup jobs in this application is described in detail below. The solution provided in this embodiment can be applied to the conflict resolution of concurrent job resource contention in tape library offline backup scenarios.
[0063] Existing resource conflict resolution technologies often employ simple queuing and retries or single-lock mechanisms. These methods typically only achieve basic conflict avoidance and cannot effectively solve problems such as deadlocks and starvation of low-priority jobs caused by multi-resource contention. As tape library backup scenarios become more complex (e.g., multi-replica backup, cross-node backup), the dimensions and frequency of resource contention further increase, highlighting the limitations of existing conflict resolution methods. Therefore, an efficient and reliable conflict resolution solution is needed. In applications such as offline tape library backup, existing technologies have the following shortcomings:
[0064] 1. Weak ability to resolve resource contention conflicts, prone to deadlock issues. Related technologies use a single lock mechanism or a simple queuing strategy, which does not consider scenarios where multiple backup jobs simultaneously contend for multiple core resources (such as backup job A occupying drive 1 waiting for tape A, and backup job B occupying tape A waiting for drive 1). This can easily lead to deadlock scenarios where each job waits for the other to release its resources, resulting in a complete interruption of backup jobs and affecting the integrity of the backup task.
[0065] 2. Low-priority backup jobs are prone to starvation and have poor scheduling fairness. Related technologies lack a priority preemption mechanism and allocate resources only according to the order of requests. If high-priority backup jobs continue to be submitted, low-priority backup jobs will be in a waiting state for a long time and will not be able to obtain resources, resulting in job starvation. This violates the principle of scheduling fairness and affects the normal execution of non-core business backups.
[0066] 3. Lock resources are severely idle, and conflict resolution efficiency is low. Related technologies lack a lock timeout release mechanism. After a backup job acquires a resource lock, if it cannot continue execution due to abnormal conditions such as tape mounting failure or network interruption, it will occupy the lock resource for a long time, preventing other backup jobs from acquiring the resource. This results in severe lock resource idleness and low conflict resolution efficiency.
[0067] 4. Limited applicability to complex concurrent scenarios. The relevant technologies can only handle contention for a single resource (such as a drive), and cannot adapt to the conflict resolution needs of complex concurrent scenarios such as multiple resources (drives and tape media) and multiple copy backups, thus having limited applicability.
[0068] To address the issues of weak conflict resolution capabilities, susceptibility to deadlock, and poor fairness in concurrent job resource contention in tape libraries, this embodiment provides a three-in-one conflict resolution solution integrating a fair locking mechanism, a priority preemption strategy, and a timeout release mechanism. Through refined lock resource management and conflict determination logic, it achieves efficient conflict resolution across multiple resources and scenarios, avoiding deadlock and starvation while improving conflict resolution efficiency and scheduling fairness, thus adapting to complex concurrent backup scenarios. The solution provided in this embodiment includes priority preemption and timeout release mechanisms to avoid deadlock and starvation. Furthermore, the solution includes targeted conflict resolution strategies to avoid simple access conflicts, adapting to complex scenarios with multiple jobs competing for multiple resources.
[0069] The solution provided in this embodiment can resolve conflicts in the concurrent operation resource contention of tape library through a three-layer architecture of "conflict detection layer + lock management layer + resolution execution layer". Each part can be implemented independently and does not depend on other scheduling modules (such as priority allocation, robotic arm collaboration).
[0070] The hardware components of the solution provided in this embodiment may include: a tape library body (including multiple tape drives, disk trays, tape media, and a controller), a conflict detection module, and a lock management server; the software components may include: a conflict detection unit, a fair lock management unit, a priority determination unit, a timeout control unit, and a conflict resolution execution unit. The connection relationships of each component are as follows:
[0071] (1) Hardware connection: The conflict detection module can be connected to the tape library body through the fiber optic channel to collect the resource occupancy status and backup job execution status in real time; the lock management server can be connected to the conflict detection module and the tape library controller through Ethernet respectively, receive status data and issue conflict resolution instructions; the tape library controller can be connected to the driver and the robotic arm through the internal bus to execute resolution instructions to release resources or adjust the job execution order.
[0072] The tape library itself is the core execution unit, providing core resources such as drives and tape media, and performing backup jobs and resource release operations. The conflict detection module can collect the occupancy status (locked / unlocked), resource request information, and execution status of backup jobs at a set sampling frequency, providing data support for conflict determination. The lock management server runs the core conflict resolution logic, managing lock resources, determining conflict types, and generating resolution instructions; it is the core control unit of the conflict resolution scheme.
[0073] (2) Software connection: The conflict detection unit can receive the status data of the conflict detection module, determine whether there is a resource contention conflict, and transmit the conflict information to the fair lock management unit; the priority determination unit extracts the job priority information and outputs it to the fair lock management unit; the fair lock management unit can generate lock allocation / release instructions based on the conflict information and priority, and synchronize them to the timeout control unit; the timeout control unit can monitor the lock occupation time and trigger the timeout release instruction; the conflict resolution execution unit can send the lock management instructions and resolution strategies to the tape library controller.
[0074] The conflict detection unit can construct a resource-job association matrix and determine conflicts based on the resource request overlap (a resource request overlap of 100% can be considered a complete conflict, while a resource request overlap between 50% and 100% can be considered a partial conflict). It can also detect whether there is a circular wait (a precursor to deadlock), and if so, mark it as a deadlock conflict.
[0075] As an example, assume that the tape library contains four core resources: tape library drives D1 and D2, and tape media M1 and M2. Simultaneously, there are two concurrent backup jobs, J1 and J2. The resource-job association matrix constructed by the conflict detection unit is as follows: Backup job J1 requests resource {D1, M1}, and job J2 requests resource {D1, M2}.
[0076] Calculations show that the two backup jobs have a 100% overlap in resource requests to D1, and the overall resource request overlap is between 50% and 100%, so it can be considered a partial conflict.
[0077] If backup job J1 occupies D1 and waits for M2, while backup job J2 occupies M2 and waits for D1, it indicates that a circular wait relationship has formed between backup jobs J1 and J2, and this conflict can be marked as a deadlock conflict.
[0078] If backup jobs J1 and J2 both request and exclusively use resource D1, then the resource request overlap is 100%, which can be considered a complete conflict.
[0079] The fair lock management unit can configure an independent fair lock for each core resource (drive, tape media) and maintain a lock request queue (sorted by resource request time). The fair lock management unit can support priority preemption and timeout release, and dynamically adjust the lock allocation status.
[0080] Priority determination unit: Extracts job priority levels (levels 1-5, with level 1 being the highest), providing a basis for determining preemption strategies and conflict resolution order;
[0081] The timeout control unit can configure a timeout period T0 for each lock (default 30 seconds, T0 size is configurable), monitor the lock occupancy time in real time, and if the core operation (such as tape mounting, data read / write start) is not completed within the timeout period, an automatic release command can be triggered.
[0082] The conflict resolution execution unit can execute exclusive resolution strategies for different conflict types; among them, the passive strategy for complete conflict can be: allocate locks according to priority + request order; the passive strategy for partial conflict can be: resource slicing allocation; the passive strategy for deadlock conflict can be: release the lock resources of low-priority jobs.
[0083] The solution provided in this embodiment can detect resource contention and deadlock precursors in real time, and combine fair locks, priority preemption, and timeout release mechanisms to execute refined resolution strategies for different conflict types, achieving rapid conflict resolution, avoiding deadlock and starvation problems, and ensuring stable execution of concurrent jobs. Figure 3 The following steps are described in the proposed solution:
[0084] Step 1: Status Acquisition and Conflict Detection. The conflict detection module can collect the occupancy status of each resource and the resource request information of the job in real time (requested resource type, priority, and resource request time). The conflict detection unit can construct a resource-job association matrix to determine whether a conflict exists and the type of conflict (complete conflict / partial conflict / deadlock conflict).
[0085] Step 2: Fair Lock Queue Management. The fair lock management unit can maintain a lock request queue for each conflicting resource, sorted according to the resource request time of the backup job; at the same time, it can receive job priority information from the priority determination unit and synchronize the priority identifier to the lock request queue to support the preemption strategy.
[0086] Step 3: Conflict Resolution Strategy Determination. Based on the conflict type and the priority of the backup job, the Fair Lock Management Unit determines the conflict resolution strategy:
[0087] (1) Complete conflict (multiple jobs competing for the same resource): the resource is allocated to the job with the highest priority first; if the priorities are the same, the resource is allocated according to the order of the request time.
[0088] (2) Partial conflict (multiple jobs compete for multiple resources, with partial overlap): Non-overlapping resources are directly allocated to the backup job that requests the non-overlapping resource, and overlapping resources can be allocated according to the priority of the backup job;
[0089] (3) Deadlock conflict (circular wait): Mark the backup job in the circular wait; you can release all lock resources of the lowest priority job, or release the lock resources of the backup job that occupies the fewest resources, thus breaking the circular wait.
[0090] Step 4: Priority Preemption. If the resources requested by a high-priority backup job are already occupied by a low-priority backup job, the fair lock management unit can trigger the preemption mechanism: notify the low-priority backup job to temporarily store the incomplete data in the cache and release the lock resources; allocate the lock to the high-priority backup job; the low-priority backup job is added to the tail of the lock request queue, waiting for reallocation.
[0091] Step 5: Timeout Release Monitoring. The timeout control unit can monitor the occupancy time of each lock in real time. If a backup job acquires a lock but fails to complete the core operation within time T0, an automatic release command can be triggered. The fair lock management unit will mark the lock as "unlocked" and extract the next backup job from the lock request queue to allocate lock resources. T0 can use a default value of 30 seconds. In some implementations, T0 can be a dynamic timeout period, calculated based on the backup job type and resource type. For example, for a full backup job, the timeout period can be 60 seconds, while for an incremental job, it can be 20 seconds.
[0092] Step 6: Conflict Resolution Result Feedback and Status Update. The conflict resolution execution unit can send lock allocation / release commands to the tape library controller, which executes the commands to adjust the resource occupancy status; at the same time, it feeds back the resolution result (success / failure). The fair lock management unit can update the lock status and request queue. The conflict detection unit repeats the above steps to achieve continuous conflict resolution.
[0093] The solution in this embodiment can avoid deadlock scenarios and significantly improve job execution stability. By detecting deadlock precursors and using a low-priority job lock release mechanism, circular waiting can be broken at its source, reducing the deadlock rate. Compared to related technologies (deadlock rate of approximately 5%-8%), the job execution success rate of this solution can be increased to over 99.5%.
[0094] The solution in this embodiment can solve the starvation problem of low-priority jobs and ensure scheduling fairness. By combining fair lock queues and priority preemption mechanisms, the starvation rate of low-priority jobs is reduced to below 0.5%, ensuring that high-priority jobs are executed first while also guaranteeing that low-priority jobs can obtain resources, thus significantly improving scheduling fairness.
[0095] The solution in this embodiment can reduce lock resource idleness and improve conflict resolution efficiency by more than 40%. The timeout release mechanism avoids long-term lock resource idleness, improving lock resource utilization by 35%; the refined resolution strategy for different conflict types reduces the average conflict resolution time from 3-5 seconds in related technologies to less than 0.5 seconds, significantly improving resolution efficiency.
[0096] The solution in this embodiment can be adapted to conflict resolution in multiple scenarios, making it highly applicable. It supports the resolution of conflicts arising from contention for multiple resources such as drives and tape media, and can adapt to complex concurrent scenarios such as full / incremental / multiple copy backups. It can adapt to tape libraries of different brands and specifications without modifying the core logic, demonstrating good compatibility and scalability.
[0097] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0098] Based on the same inventive concept, this application also provides a resource coordination processing apparatus for implementing the resource coordination processing method for backup jobs described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more resource coordination processing apparatus embodiments for backup jobs provided below can be found in the limitations of the resource coordination processing method for backup jobs described above, and will not be repeated here.
[0099] In one exemplary embodiment, such as Figure 4 As shown, a resource coordination and processing apparatus for backup jobs is provided, comprising:
[0100] The acquisition module 401 is used to acquire the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup jobs for the tape library.
[0101] The conflict detection module 402 is used to determine the resource request conflict between multiple backup jobs based on their respective resource request information.
[0102] The conflict resolution strategy determination module 403 is used to determine the conflict resolution strategy based on the conflict type corresponding to the requested resource conflict and the priority of each of the multiple backup jobs;
[0103] The instruction generation module 404 is used to generate a coordination processing instruction when determining, according to the conflict resolution strategy, that the target resource is occupied by other backup jobs. The coordination processing instruction is used to instruct the tape library controller to trigger other backup jobs to release the target resource and allocate the target resource to the target backup job.
[0104] In an exemplary embodiment, the conflict resolution strategy determination module 403 is configured to, when the conflict type corresponding to the requested resource conflict indicates that the resources requested by at least two backup jobs are completely conflicting, determine a high-priority backup job among the at least two backup jobs according to their respective priorities; the complete conflict indicates that the resources requested by at least two backup jobs are exactly the same; when the number of high-priority backup jobs is at least two, determine a first type of target backup job among the at least two high-priority backup jobs according to the order of the resource request times of the high-priority backup jobs, and determine the same resource requested by the at least two backup jobs as the first type of target resource, thereby obtaining a conflict resolution strategy; the resource request time is obtained from the resource request information.
[0105] In an exemplary embodiment, the conflict resolution strategy determination module 403 is configured to, when the conflict type corresponding to the requested resource conflict indicates that the resources requested by at least two backup jobs have partial conflicts, determine the same resources requested by at least two backup jobs as overlapping resources, and determine the resources requested by at least two backup jobs other than overlapping resources as non-overlapping resources; the partial conflict indicates that the resources requested by at least two backup jobs are partially the same; for the overlapping resources, based on the respective priorities of the at least two backup jobs, determine the high-priority backup job among the at least two backup jobs, obtain the second type of target backup job based on the high-priority backup job, and determine the overlapping resources as the second type of target resources; for the non-overlapping resources, determine the backup job requesting the non-overlapping resources as the third type of target backup job, and determine the non-overlapping resources as the third type of target resources; and obtain a conflict resolution strategy based on the second type of target backup job and the second type of target resources, as well as the third type of target backup job and the third type of target resources.
[0106] In an exemplary embodiment, the conflict resolution strategy determination module 403 is configured to determine a high-priority backup job among at least two backup jobs when the conflict type corresponding to the requested resource conflict indicates that at least two backup jobs are deadlocked; the deadlock conflict indicates that at least two backup jobs are waiting for each other to release resources; a fourth type of target backup job is obtained based on the high-priority backup job, and a fourth type of target resource is obtained based on the resources involved in the deadlock conflict; and a conflict resolution strategy is obtained based on the fourth type of target backup job and the fourth type of target resource.
[0107] In an exemplary embodiment, the resolution strategy determination module 403 is used to determine the backup job that occupies the most resources among the at least two high-priority backup jobs when the number of high-priority backup jobs is at least two, and to determine the backup job that occupies the most resources as the fourth type of target backup job.
[0108] In an exemplary embodiment, the device further includes a timeout processing module for monitoring the duration of occupation of multiple resources; when the duration of occupation of any resource reaches a preset threshold, determining whether the backup job has completed a preset operation based on the execution status of the backup job occupying the resource; if the backup job has not completed the preset operation, generating a resource release instruction; the resource release instruction is used to instruct the controller of the tape library to trigger the backup job to release the corresponding resources to supply other backup jobs.
[0109] Each module in the resource coordination and processing device for the aforementioned backup operation 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.
[0110] In one exemplary embodiment, a computer device is provided, the internal structure of which can be as shown in the figure. Figure 5As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores the data involved in the aforementioned methods. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource coordination processing method for backup jobs.
[0111] Those skilled in the art will understand that Figure 5 The 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.
[0112] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the various method embodiments described above.
[0113] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the various method embodiments described above.
[0114] In one exemplary embodiment, a computer program product is provided having a computer program stored thereon, the computer program being executed by a processor of the steps described in the various method embodiments above.
[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0116] 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, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0117] 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 application.
[0118] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. 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 application should be determined by the appended claims.
Claims
1. A resource coordination processing method for backup jobs, characterized in that, The method includes: Obtain the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup jobs for the tape library; Based on the resource request information of each of the multiple backup jobs, determine the resource request conflicts between the multiple backup jobs; Based on the conflict type corresponding to the requested resource conflict and the priority of each of the multiple backup jobs, a conflict resolution strategy is determined; When determining to allocate a target resource to a target backup job according to the conflict resolution strategy, if it is determined that the target resource is occupied by other backup jobs based on the resource occupancy status of the target resource, a coordination processing instruction is generated; the coordination processing instruction is used to instruct the controller of the tape library to trigger other backup jobs to release the target resource and allocate the target resource to the target backup job.
2. The method according to claim 1, characterized in that, Based on the conflict type corresponding to the requested resource conflict and the respective priorities of multiple backup jobs, a conflict resolution strategy is determined, including: When the conflict type corresponding to the requested resource conflict indicates that the resources requested by at least two backup jobs are completely conflicting, the higher priority backup job is determined among the at least two backup jobs according to their respective priorities; the complete conflict indicates that the resources requested by at least two backup jobs are exactly the same. When there are at least two high-priority backup jobs, a first-class target backup job is determined from the at least two high-priority backup jobs according to the order of their resource request times, and the same resource requested by the at least two backup jobs is determined as the first-class target resource, thus obtaining a conflict resolution strategy; the resource request time is obtained from the resource request information.
3. The method according to claim 1, characterized in that, Based on the conflict type corresponding to the requested resource conflict and the respective priorities of multiple backup jobs, a conflict resolution strategy is determined, including: When the conflict type corresponding to the requested resource conflict indicates that the resources requested by at least two backup jobs have partial conflicts, the same resources requested by at least two backup jobs are identified as overlapping resources, and the resources requested by at least two backup jobs other than overlapping resources are identified as non-overlapping resources; the partial conflict indicates that the resources requested by at least two backup jobs are partially the same. For the overlapping resources, based on the priorities of at least two backup jobs, a high-priority backup job is determined among the at least two backup jobs, and a second type of target backup job is obtained based on the high-priority backup job, and the overlapping resources are determined as the second type of target resources; For the non-overlapping resources, the backup job requesting the non-overlapping resources is identified as a third type of target backup job, and the non-overlapping resources are identified as a third type of target resource; Based on the second type of target backup job and the second type of target resource, as well as the third type of target backup job and the third type of target resource, a conflict resolution strategy is obtained.
4. The method according to claim 1, characterized in that, Based on the conflict type corresponding to the requested resource conflict and the respective priorities of multiple backup jobs, a conflict resolution strategy is determined, including: When the conflict type corresponding to the requested resource conflict indicates that at least two backup jobs are deadlocked, a higher priority backup job is determined among the at least two backup jobs; the deadlock conflict indicates that at least two backup jobs are waiting for each other to release resources. The fourth type of target backup job is obtained based on the high-priority backup job, and the fourth type of target resource is obtained based on the resources involved in the deadlock conflict; Based on the fourth type of target backup job and the fourth type of target resource, a conflict resolution strategy is obtained.
5. The method according to claim 4, characterized in that, The fourth category of target backup jobs is derived from high-priority backup jobs, including: When there are at least two high-priority backup jobs, the backup job that consumes the most resources among the at least two high-priority backup jobs is identified, and the backup job that consumes the most resources is identified as the fourth type of target backup job.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Monitor the duration of each of the multiple resources in use; When the duration of any resource being occupied reaches a preset threshold, the execution status of the backup job occupying the resource is used to determine whether the backup job has completed the preset operation. If the backup job fails to complete the preset operation, a resource release instruction is generated; the resource release instruction is used to instruct the controller of the tape library to trigger the backup job to release the corresponding resources to supply other backup jobs.
7. A resource coordination and processing device for backup operations, characterized in that, The device includes: The acquisition module is used to acquire the resource occupancy status of multiple resources in the tape library and the resource request information of multiple backup jobs for the tape library. The conflict detection module is used to determine the resource request conflicts between multiple backup jobs based on their respective resource request information. The conflict resolution strategy determination module is used to determine the conflict resolution strategy based on the conflict type corresponding to the requested resource conflict and the priority of each of the multiple backup jobs. The instruction generation module is used to determine, according to the conflict resolution strategy, that when allocating the target resource to the target backup job, if it is determined according to the resource occupancy status of the target resource that the target resource is occupied by other backup jobs, generate a coordination processing instruction; the coordination processing instruction is used to instruct the tape library controller to trigger other backup jobs to release the target resource and allocate the target resource to the target backup job.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.