Resource management method, computer device, storage medium, and program product

By unifying resource storage in a multi-tenant system and performing precise matching based on role identifiers, the problems of configuration deviations and omissions in resource management are solved, and efficient and reliable resource distribution and management are achieved.

CN122179304APending Publication Date: 2026-06-09BEIJING BAIJU YIXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAIJU YIXING TECH CO LTD
Filing Date
2026-01-20
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In multi-tenant resource management scenarios, resource configuration is prone to errors such as configuration deviations and resource omissions due to differences in manual operation, which affects the timeliness of resource delivery and the reliability of management.

Method used

By acquiring the target resource and its associated role identifier, storing it in the public resource space, and accurately matching the associated tenant based on the role identifier, the target resource is copied from the public resource space to the associated tenant's private resource space. By utilizing global locks and update master and sub-task management processes, centralized management and precise distribution of resources can be achieved.

Benefits of technology

It reduces the cost of redundant management of distributed resource storage, reduces configuration deviations and resource omissions, improves the simplicity and reliability of resource management, and enhances the efficiency and consistency of resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122179304A_ABST
    Figure CN122179304A_ABST
Patent Text Reader

Abstract

The application discloses a resource management method, computer equipment, a storage medium and a program product, and relates to the technical field of Internet. The resource management method comprises the following steps: acquiring a target resource and an associated role identifier of the target resource; storing the target resource into a public resource space; querying a tenant with a role associated with the role identifier as an associated tenant; and copying the target resource from the public resource space to a private resource space of the associated tenant. The technical problem that resource management is heavy and prone to exceptions is solved, and the technical effect that the dimensionality of resource management burden is reduced to improve resource management efficiency and reliability is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a resource management method, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] In traditional multi-tenant resource management scenarios, resource configuration often involves acquiring resources, storing them separately, and configuring associated permissions for each tenant individually. Manually configuring resources for each tenant is prone to errors such as configuration deviations and resource omissions due to variations in human operation. This affects both the timeliness of resource delivery and the overall reliability of resource management. Summary of the Invention

[0003] This application provides a resource management method, computer device, computer-readable storage medium, and computer program product to at least solve the problems of heavy resource management burden and susceptibility to anomalies in related technologies.

[0004] This application provides a resource management method, which includes: obtaining a target resource and its associated role identifier; storing the target resource in a public resource space; querying tenants with roles associated with the role identifier as associated tenants; and copying the target resource from the public resource space to the private resource space of the associated tenants.

[0005] In one embodiment of this application, copying a target resource from a public resource space to a private resource space of an associated tenant includes: constructing an update master task; executing the update master task to create an update subtask attached thereto; and executing the update subtask to transfer the target resource to the associated tenant.

[0006] In one embodiment of this application, performing the update subtask includes: deduplicating the target resource to obtain a copied resource; querying the role type of the associated role in the resource record file; querying the storage level of the target resource; and in response to the role type matching the storage level and the associated role not having a copied resource, transferring the copied resource to the private resource space and associating it with the associated tenant, and updating the resource record file.

[0007] In one embodiment of this application, the number of update subtasks matches the number of associated tenants; in response to the number of update subtasks being multiple, executing update subtasks includes: executing multiple update subtasks in parallel; monitoring the execution status of update subtasks and identifying whether any update subtasks have failed to execute; in response to the existence of update subtasks failing to execute, determining that the main update task has failed to execute; otherwise, determining that the main update task has executed successfully.

[0008] In one embodiment of this application, before copying the target resource from the public resource space to the private resource space of the associated tenant, the process includes: constructing a global lock; verifying whether there is an ongoing task and whether the global lock has been successfully constructed; wherein, the ongoing task represents the currently executing update main task; in response to the absence of an ongoing task and the successful construction of the global lock, determining to construct the update main task.

[0009] In one embodiment of this application, after creating the update subtask attached thereto, the method further includes: releasing the global lock.

[0010] In one embodiment of this application, querying a tenant with a role associated with a role identifier as an associated tenant includes: obtaining the target source resource of the target resource; identifying whether the current tenant has the target source resource and the target resource; and in response to the current tenant having the target source resource and not having the target resource, designating it as an associated tenant.

[0011] This application also provides a computer device, which includes a memory and a processor. The memory is used to store a computer program, and the processor is used to implement the steps of any of the above-described resource management methods when executing the computer program.

[0012] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described resource management methods.

[0013] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described resource management methods.

[0014] This application addresses the issue of redundant management costs associated with distributed resource storage by first acquiring the target resource and its associated role identifiers and then uniformly storing them in a public resource space. Furthermore, by accurately matching associated tenants based on role identifiers and copying the target resource from the public resource space to the corresponding private resource space, the tedious process of configuring resources individually for each tenant is reduced, as well as potential configuration errors and resource omissions during repetitive operations. Centralized management and redistribution improve the simplicity and consistency of resource management, thereby reducing the management burden and enhancing efficiency and reliability. Therefore, this application solves the technical problem of heavy and prone-to-abnormal resource management burdens, achieving the technical effect of reducing resource management burdens to improve efficiency and reliability. Attached Figure Description

[0015] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the 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.

[0016] Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of the resource management method of this application; Figure 2 This is a flowchart illustrating an embodiment of the resource management method of this application; Figure 3 This is a flowchart illustrating another embodiment of the resource management method of this application; Figure 4 A flowchart illustrating an embodiment of constructing and executing the main update task for this application; Figure 5 This is a flowchart illustrating an embodiment of the update subtask performed in this application; Figure 6 This is a flowchart illustrating an embodiment of monitoring and updating the execution status of subtasks in this application; Figure 7 This is a flowchart illustrating an embodiment of determining the execution status of the main task in this application; Figure 8 This is a flowchart illustrating an embodiment of the transfer of the target resource of this application. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0018] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0019] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] The specific application environment architecture or specific hardware architecture on which the execution of the resource management method depends is described here.

[0021] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of the resource management method of this application.

[0022] In one embodiment, during the operation of systems such as SaaS (Software as a Service), the platform can have a public resource space for storing tenant resources, platform resources, etc. Furthermore, the platform continuously iterates, adding new resources such as new functional modules, expanding data interfaces, and updating tool components, and needs to distribute these new resources to tenants to meet their business development needs. Since tenants have multiple roles, such as administrators, operators, and viewers within an enterprise tenant, and different roles have significantly different usage permissions and functional requirements for new resources, private resource spaces can be associated with each tenant. Resources are allocated to the super administrator account of a designated tenant, and the resource management device can perform corresponding resource management.

[0023] The embodiments of this application provide a resource management method, and the method is described in detail below in conjunction with the execution flow of the resource management method.

[0024] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the resource management method of this application.

[0025] S101: Obtain the target resource and its associated role identifier.

[0026] In this embodiment, the target resource and its associated role identifier can be obtained. The target resource refers to the newly added resource to be distributed, and the role identifier is used to represent the user role corresponding to the resource. By simultaneously obtaining the resource and its associated role identifier, the applicable scope of the resource can be clearly defined, which is conducive to accurate resource distribution and can reduce the risk of mismatch between resources and user roles.

[0027] S102: Store the target resource in the public resource space.

[0028] In this embodiment, after obtaining the target resource and role identifier, the target resource can be uniformly stored in the public resource space. The public resource space can be considered as a shared resource storage domain. Unified storage facilitates centralized management of resources, reduces the redundancy costs caused by multiple copy storage, and promotes centralized control of resources, thereby reducing the risks of decentralized operations in subsequent management.

[0029] S103: Query the tenants with the associated roles that have the role identifier as associated tenants.

[0030] In this embodiment, based on the acquired role identifier, the system queries and identifies tenants who have configured the associated role as associated tenants. This precise matching through the binding relationship between role identifiers and tenants replaces the manual process of individually screening tenants for resource allocation. This improves the accuracy of tenant matching, reduces the risk of errors from manual screening, and ensures that resources are only allocated to tenants with the corresponding role permissions, thus mitigating the risk of misallocation.

[0031] S104: Copy the target resource from the public resource space to the private resource space of the associated tenant.

[0032] In this embodiment, after querying the associated tenants, the target resource is copied from the public resource space to the private resource space of each associated tenant. The private resource space is an independent resource domain for each tenant. The copying operation allows associated tenants to obtain the target resource within their exclusive domain, which helps ensure the exclusive use of tenant resources, reduces the risk of resource commingling, and avoids tenants repeatedly uploading the same type of resource. Centralized copying based on the public resource space, compared to individually requiring each tenant to obtain or distribute resources, reduces redundant resource transmission time, improving resource delivery efficiency and reducing the risk of resource transmission delays. Furthermore, the logic of distributing only to associated tenants prevents unauthorized tenants from obtaining unauthorized resources, reducing the security risk of resource leakage.

[0033] As can be seen above, by first acquiring the target resource and its associated role identifier and storing them uniformly in the public resource space, the repetitive management costs caused by distributed resource storage can be reduced. Based on the role identifier, accurately matching associated tenants and copying the target resource from the public resource space to the corresponding private resource space reduces the tedious operation of configuring resources individually for each tenant, and also reduces the possibility of configuration deviations, resource omissions, and other anomalies that may occur during repetitive operations. Centralized management and redistribution improve the simplicity and consistency of resource management, thereby reducing the management burden and contributing to improved efficiency and reliability of resource management.

[0034] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the resource management method of this application.

[0035] S201: Obtain the target resource and its associated role identifier.

[0036] In this embodiment, the target resource can be various data resources to be synchronized across tenants in a multi-tenant system, such as configuration file data, business form data, and permission template data. The associated role identifier is used to characterize the permission role attribute to which the target resource belongs. It can provide a basis for determining the scope of tenants that can synchronize the target resource, which helps to ensure the accuracy and reliability of cross-tenant synchronization of resources.

[0037] S202: Store the target resource in the public resource space.

[0038] In this embodiment, the public resource space is a pre-defined shared storage area within the multi-tenant system, allowing all tenants to access and invoke resources. Storing the target resource in the public resource space enables subsequent qualified related tenants to easily obtain the target resource, thereby providing data support for cross-tenant resource transmission and improving the efficiency of resource synchronization.

[0039] S203: Verify whether the current tenant contains the target source resource.

[0040] In this embodiment, the process ends when it is determined that the current tenant does not contain the target source resource. When it is determined that the current tenant contains the target source resource, step S204 is executed.

[0041] Specifically, the target source resource can be obtained. The target source resource can be considered as a baseline resource that is derived from or related to the target resource, and it can serve as the core basis for determining whether the current tenant is eligible for target resource synchronization. Identifying whether the current tenant has the target source resource can filter out tenants with the basis for resource synchronization, reduce invalid resource synchronization operations to unrelated tenants, and thus reduce the computational load on the system.

[0042] S204: Verify whether the current tenant contains the target resource.

[0043] In this embodiment, the process ends when it is determined that the current tenant contains the target resource, thereby reducing redundant synchronization for tenants that already possess the target resource and minimizing waste of system resources. When it is determined that the current tenant does not contain the target resource, step S205 is executed, thereby accurately locating the tenant object that needs to update the target resource, which helps improve the targeting of cross-tenant resource synchronization.

[0044] S205: Treat the current tenant as the associated tenant.

[0045] In this embodiment, the target source identifier can be used as one of the role identifiers to query tenants with roles associated with the role identifier as associated tenants.

[0046] In other words, this embodiment can identify whether the current tenant has the target source resource and the target resource. If the current tenant has the target source resource but does not have the target resource, it is designated as an associated tenant. The associated tenant is the target object that needs to receive synchronous updates of the target resource. Determining associated tenants through the above filtering logic ensures the rationality and necessity of resource synchronization.

[0047] S206: Construct a global lock.

[0048] In this embodiment, the global lock is a resource access control lock at the multi-tenant system level. It can restrict access to the common resource space and the resource storage area of ​​associated tenants during resource synchronization. Constructing a global lock helps prevent other parallel tasks from tampering with or accessing related resources during resource synchronization, thereby ensuring the stability of resource synchronization operations.

[0049] S207: Verify whether there are currently no ongoing tasks and whether the global lock has been successfully constructed.

[0050] In this embodiment, "task in progress" refers to the main update task that is currently being executed.

[0051] If it is determined that there are no ongoing tasks and the global lock has been successfully built, proceed to step S208. If it is determined that there are ongoing tasks and / or the global lock has not been successfully built, step S206 or step S207 can be repeated depending on whether the global lock construction was incomplete / failed or an ongoing task exists. This is equivalent to determining to build and update the main task in response to the absence of ongoing tasks and the successful construction of the global lock.

[0052] S208: Build and update the main task.

[0053] In this embodiment, the update master task is the core task for coordinating and managing the cross-tenant synchronization process of the target resources. It can uniformly schedule the creation, execution, and status monitoring of subsequent subtasks. Constructing the update master task provides a top-level execution framework for resource synchronization operations, which helps to improve the standardization and controllability of the synchronization process.

[0054] S209: Create an update subtask.

[0055] In this embodiment, an update master task is executed to create update subtasks subordinate to it. Update subtasks can be task units that specifically perform detailed operations such as resource transfer, status verification, and result feedback, for example, a target resource reading subtask, an associated tenant storage path verification subtask, and a resource writing subtask. Decomposing the synchronization process into multiple update subtasks enables fine-grained control over the synchronization process and facilitates the identification of problems that arise during execution.

[0056] S210: Release the global lock.

[0057] In this embodiment, after the update subtask is created, the global lock can be released, which removes access restrictions on the public resource space and the associated tenant resource storage area, allowing other tasks to access the relevant resources normally, thereby improving the utilization rate of system resources. At the same time, releasing the global lock in advance helps avoid the situation where the global lock is occupied for a long time due to subsequent subtask execution timeouts.

[0058] S211: Execute the update subtask.

[0059] In this embodiment, an update subtask is executed to transfer the target resource to the associated tenant. Specifically, the update subtask can read the target resource from the public resource space and write it to the associated tenant's private resource space according to a preset execution order.

[0060] S212: Determine whether the update subtask was executed successfully.

[0061] In this embodiment, when it is determined that the update subtask was executed successfully, step S213 can be executed. When it is determined that the update subtask was not executed successfully, i.e., it failed, step S214 can be executed.

[0062] S213: The target resource update has been completed.

[0063] In this embodiment, in response to the determination that the update subtask was executed successfully, the target resource update status of the associated tenant can be determined to be completed.

[0064] Optionally, when there is only one update subtask, the target resource update can be considered complete when it executes successfully. When there are multiple update subtasks, the target resource update can be considered complete when all update subtasks have completed their execution.

[0065] S214: Determine whether the number of failures has reached the threshold.

[0066] In this embodiment, when the number of failures is determined to be less than the threshold, step S215 can be executed. When the number of failures is determined to be greater than the threshold, step S216 can be executed.

[0067] The number of retries threshold can be considered as the preset maximum number of retries for update subtasks. It can be reasonably set according to factors such as the system's computing power and the historical success rate of resource transmission. Setting a reasonable number of retries threshold can ensure the success rate of resource synchronization while avoiding the waste of system resources caused by unlimited retries.

[0068] S215: Determine that the execution status of the update subtask is in a retry state, accumulate its retry count, and wait for the offline task to retry.

[0069] In this embodiment, marking the update subtask as retryable allows the system's task scheduling module to identify the task's execution requirements. The accumulated number of retries provides a basis for subsequent judgment on whether the threshold has been reached. Waiting for the offline task to retry allows the subtask to be re-executed during periods of low system load, which helps improve the retry success rate and reduces the impact on other system tasks.

[0070] S216: The update subtask was determined to have failed.

[0071] In this embodiment, after determining that the number of failures has reached a threshold, the update subtask is marked as failed, and information such as the reason for failure, failure time, and number of retries is recorded and reported to facilitate troubleshooting and handling by operations and maintenance personnel. Simultaneously, the failure result is fed back to the associated tenant, enabling the tenant to promptly adopt alternative solutions to obtain the target resource.

[0072] Therefore, this embodiment, by sequentially verifying the current tenant's target source resource and the existence status of the target resource, can relatively accurately filter related tenants, ensuring the targeting and rationality of resource synchronization. Utilizing global locks and in-process task verification to build a stable task execution environment helps reduce resource contention conflicts and improves the stability of the synchronization process. By breaking down the synchronization process into main tasks and sub-tasks, fine-grained management is achieved, and retry mechanisms and thresholds are set to ensure synchronization success rates while reducing system resource waste. This method can efficiently and stably achieve cross-tenant synchronous updates of target resources, improving the resource sharing efficiency and management level of multi-tenant systems.

[0073] Please see Figure 4 , Figure 4 This is a flowchart illustrating an embodiment of constructing and executing the main update task for this application.

[0074] S301: Build and update the main task.

[0075] In this embodiment, an update main task is constructed in response to an instruction to obtain a new target resource.

[0076] The master update task can be used to manage the entire update process of a target resource. Its task content can include the target resource's identification information, update content, associated tenant scope, and core rules for update execution. By constructing the master update task, the system can uniformly control the resource update process, which helps ensure the orderly operation of update operations and reduce resource data errors caused by chaotic update processes.

[0077] S302: Create an update subtask to deliver the target resource to the associated tenant.

[0078] In this embodiment, after the main update task is constructed, an update subtask can be created based on the scope of associated tenants already defined in the main update task to transfer the target resource to the associated tenant.

[0079] Update subtasks are essentially lightweight tasks. One main update task can correspond to one or more update subtasks, and each update subtask corresponds to resource transfer operations for one or a group of associated tenants. As illustrated in the examples above and below, the task content of an update subtask can include one or more of the following: the identification information of the corresponding associated tenant, the transfer path of the target resource, and data consistency verification rules. By breaking down the global resource update task into main tasks and subtasks, it is beneficial to achieve fine-grained control over resource update operations and improve the flexibility and scalability of update operations.

[0080] S303: Release the global lock.

[0081] In this embodiment, after the creation of the update subtask is completed, the system releases the global lock used to manage the update of the target resource. It is easy to understand that in a multi-tenant system, the global lock is used to prevent other concurrent operations from tampering with the target resource during the update process, ensuring the reliability of the update operation. Releasing the global lock after the update subtask is created effectively shortens the holding time of the global lock, reduces the impact on system concurrency performance, and helps improve the overall response speed of the multi-tenant system.

[0082] S304: Submit an update subtask to execute it.

[0083] In this embodiment, an already created update subtask can be submitted for execution. During execution, the update subtask can push the target resource to the corresponding associated tenant according to a preset delivery path.

[0084] S305: The adaptation update subtask was successfully executed, maintaining the update resource record file.

[0085] In this embodiment, after the update subtask is successfully executed, the system maintains an update resource log file based on the execution result of the update subtask. The update resource log file records tenants, private resource spaces, and the relationships between resources. Maintaining the update resource log file facilitates full traceability of the target resource update process, enabling rapid identification of the root cause when subsequent resource data anomalies occur. Simultaneously, this log file also provides data support for operation and maintenance management, facilitating operations personnel's understanding of the overall resource status.

[0086] Please see Figure 5 , Figure 5 This is a flowchart illustrating an embodiment of the update subtask performed in this application.

[0087] S401: Deduplicatize the target resource to obtain a copied resource.

[0088] In this embodiment, a deduplication operation is performed on the target resource. By identifying and merging or removing duplicate content segments in the target resource, a simplified copy resource is obtained. This deduplication process can filter redundant information in the target resource, reduce the storage space occupied by the copied resource, and improve the efficiency of subsequent resource transmission, thus reducing the time consumed in the resource distribution process.

[0089] S402: Query the role type associated with a role within a resource record file.

[0090] In this embodiment, the operation of querying the resource record file is performed. The resource record file can be considered as a file that records the relationships between all resources, roles, and tenants within the platform. By querying the role type corresponding to the associated role in this file, the resource usage permission level of the associated role can be clearly identified. This provides data support for subsequent permission matching operations and helps ensure the compliance of resource distribution.

[0091] S403: Query the storage level of the target resource.

[0092] In this embodiment, the operation of querying the storage level of the target resource is performed. The storage level is a resource classification level based on attributes such as the importance and scope of use of the resource. By querying the storage level corresponding to the target resource, the distribution scope and permission requirements of the resource can be clarified, which can provide a basis for subsequent role type and storage level matching, and help reduce the risk of mis-distribution of resources.

[0093] S404: Verify whether the role type matches the storage level.

[0094] In this embodiment, when it is determined that the role type matches the storage level, step S405 can be executed. When it is determined that the role type does not match the storage level, step S409 can be executed. The verification process can compare the preset role type and storage level matching rule base to determine whether the currently associated role has the permission to obtain resources at the corresponding storage level, which helps to ensure the security of resource usage.

[0095] S405: Determine to assign the target resource to the associated role.

[0096] In this embodiment, in response to the successful matching verification of role type and storage level, it can be determined that the target resource will be assigned to the associated role. This provides a basis for subsequent resource distribution, clearly defining the associated role's usage rights to the target resource, and helps ensure that resources are distributed to roles with the corresponding permissions.

[0097] S406: Query whether the associated role has a copy resource.

[0098] In this embodiment, when it is determined that the associated role does not have copying resources, step S407 can be executed; when it is determined that the associated role has copying resources, step S409 can be executed.

[0099] S407: Transfer the copied resource to the private resource space and associate it with the associated tenant.

[0100] In this embodiment, in response to the associated role not possessing the copied resource, the copied resource can be transferred to the associated tenant's private resource space, while simultaneously establishing an association between the copied resource and the associated tenant. The private resource space can be considered a relatively independent resource domain for the tenant, allowing the associated tenant to obtain the copied resource within its exclusive domain. This ensures the exclusive use of tenant resources and reduces the risk of resource commingling.

[0101] S408: Update resource log file.

[0102] In this embodiment, in response to the role type matching the storage level and the associated role not having replicated resources, the replicated resources are transferred to the private resource space and associated with the associated tenant, and the resource record file is updated. This can ensure the timeliness and accuracy of the data in the file, provide reliable data support for subsequent resource query and management operations, and help improve the overall consistency of resource management.

[0103] S409: Stop copying the target resource to the associated tenant.

[0104] In this embodiment, in response to a mismatch between the role type and storage level and / or the associated role already possessing the copied resource, the operation of suspending the copying of the target resource to the associated tenant can be executed. This reduces the distribution of resources that do not meet permission requirements, prevents duplicate resources from occupying private resource space, helps reduce the management costs caused by invalid operations, and improves the accuracy and security of resource distribution.

[0105] As can be seen in this embodiment, after querying the associated tenants, the target resource is copied from the public resource space to the private resource space of each associated tenant. The private resource space is an independent resource domain for each tenant. The copying operation allows associated tenants to obtain the target resource within their exclusive domain, which helps ensure the exclusive use of tenant resources, reduces the risk of resource commingling, and avoids tenants repeatedly uploading the same type of resource. Centralized copying based on the public resource space, compared to the mode of individual tenant resource uploads, reduces the time spent on redundant resource transmission, thus improving resource delivery efficiency and reducing the risk of resource transmission delays. Furthermore, the logic of distributing only to associated tenants reduces the risk of unauthorized tenants obtaining unauthorized resources, thereby reducing the security risk of resource leakage.

[0106] Please see Figure 6, Figure 6 This is a flowchart illustrating an embodiment of monitoring and updating the execution status of subtasks in this application.

[0107] In one embodiment, after completing the query of associated tenants, the target resource is copied from the public resource space to the private resource space of each associated tenant, i.e., the update subtask is executed. After the update subtask enters the execution state from its initial state, it can be divided into three states based on the execution result. Specifically, if execution is successful, it enters the successful execution state; if execution fails and the number of failures reaches a preset threshold, it enters the failed execution state; if execution fails but the number of retries has not yet reached the threshold, it enters the retry state, and can subsequently return to the execution state to continue trying. Please refer to [link to relevant documentation]. Figure 7 , Figure 7 This is a flowchart illustrating an embodiment of determining the execution status of the main task in this application.

[0108] S501: Executes multiple update subtasks in parallel.

[0109] In this embodiment, multiple update subtasks are executed in parallel. These subtasks may include updating field information in resource record files, synchronizing resource-role associations, and updating tenant resource permission configurations. Parallel execution allows for the simultaneous processing of multiple update subtasks, reducing the overall time required for update operations and improving the efficiency of resource record file updates.

[0110] S502: Monitor the execution status of update subtasks.

[0111] In this embodiment, the real-time execution status of each subtask is continuously monitored during the parallel execution of multiple update subtasks.

[0112] S503: Identify whether there is a failure in the execution of the update subtask.

[0113] In this embodiment, if it is determined that an update subtask has failed to execute, step S504 can be executed. If it is determined that no update subtask has failed to execute, step S505 can be executed.

[0114] Based on the monitored execution status of each update subtask, identify whether any subtasks have failed. The identification process compares the preset completion status of each subtask with the actual execution results, which helps to accurately determine whether any subtasks have execution anomalies and also provides a clear basis for determining the results of subsequent main update tasks.

[0115] S504: The main task update was determined to have failed.

[0116] In this embodiment, in response to the failure of an update subtask, the main update task is determined to have failed, which helps maintenance personnel to quickly locate the failed subtask and perform repair.

[0117] S505: The main task update was successfully executed.

[0118] In this embodiment, in response to the absence of an update subtask failing to execute, the update main task is determined to have failed.

[0119] Please see Figure 8 , Figure 8 This is a flowchart illustrating an embodiment of the transfer of the target resource of this application.

[0120] In one embodiment, initially, the public resource space contains 1000 resources, which are associated with multiple private resource spaces, including a private resource space containing 500 resources, a private resource space containing 600 resources, and a private resource space containing 700 resources. Specifically, the private resource space containing 500 resources is bound to roles J1 (containing 100 resources), J2 (containing 200 resources), and J3 (containing 300 resources); the private resource space containing 700 resources is bound to roles J4 (containing 400 resources), J5 (containing 500 resources), and J6 (containing 600 resources).

[0121] In this embodiment, the target source resource of target resource rk12345 can be r1.

[0122] Specifically, when the target resource rk12345 is input, the public resource space is updated to have the original 1000 resources plus the target resource rk12345. This resource is then distributed to the corresponding associated private resource space containing 500 resources, updating its resource count to the original 500 resources plus the target resource rk12345. Simultaneously, the resource count of role J1, which contains 100 resources, is also updated to the original 100 resources plus the target resource rk12345. The resource counts of the remaining private resource spaces, as well as those of roles J2 (200 resources), J3 (300 resources), J4 (400 resources), J5 (500 resources), and J6 (600 resources), remain unchanged.

[0123] After completing the specific association between roles and resources and writing the target resource rk12345, role J1, which contains 100 resources and has added the target resource rk12345, is associated with resources rk1, rk123456, rk2, etc., while role J2, which contains 200 resources, is associated with resources rk4, rk5, rk6, etc., clearly demonstrating the differences in resource sets corresponding to different roles. After completing the query of associated tenants, the target resource is copied from the public resource space to the private resource space of each associated tenant. The private resource space is the tenant's independent resource domain. The copy operation allows associated tenants to obtain the target resource within their exclusive domain, which helps to ensure the exclusive use of tenant resources, reduces the risk of resource commingling, and avoids tenants repeatedly uploading the same type of resource. Based on centralized copying of the public resource space, compared with the mode of individual tenant resource uploads, it can reduce the time spent on repeated resource transmission, thereby improving resource delivery efficiency and reducing the risk of resource transmission delays; it can also reduce the risk of unauthorized tenants obtaining unauthorized resources and reduce the security risk of resource leakage.

[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0125] Embodiments of this application also provide a resource management device.

[0126] The resource management device includes a connection module and a management module. The connection module is used to input the target resource. The management module is used to implement the resource management method as described in any of the preceding embodiments.

[0127] The management module can at least obtain the target resource and its associated role identifier; store the target resource in the public resource space; query the tenant with the associated role of the role identifier as the associated tenant; and copy the target resource from the public resource space to the private resource space of the associated tenant.

[0128] For further explanation of the features in the embodiments corresponding to the resource management device, please refer to the relevant descriptions in the embodiments corresponding to the resource management method, which will not be repeated here.

[0129] Embodiments of this application also provide a computer device.

[0130] The computer device includes a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the resource management method embodiments described above.

[0131] Embodiments of this application also provide a computer-readable storage medium.

[0132] The computer-readable storage medium stores a computer program configured to execute the steps in any of the above-described resource management method embodiments when run.

[0133] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0134] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described resource management method embodiments.

[0135] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the resource management method embodiments described above.

[0136] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0137] The resource management method, computer device, computer-readable storage medium, and computer program product provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A resource management method, characterized in that, The resource management method includes: Obtain the target resource and its associated role identifier; Store the target resource in the public resource space; Query the tenants with the roles associated with the aforementioned role identifier as associated tenants; The target resource is copied from the public resource space to the private resource space of the associated tenant.

2. The resource management method according to claim 1, characterized in that, The step of copying the target resource from the public resource space to the private resource space of the associated tenant includes: Build and update the main task; Execute the main update task to create update subtasks subordinate to it; Execute the update subtask to transfer the target resource to the associated tenant.

3. The resource management method according to claim 2, characterized in that, Executing the update subtask includes: The target resource is deduplicated to obtain a copied resource; Query the role type of the associated role described in the resource record file; Query the storage level of the target resource; In response to the role type matching the storage level and the associated role not having the copied resource, the copied resource is transferred to the private resource space and associated with the associated tenant, and the resource record file is updated.

4. The resource management method according to claim 2, characterized in that, The number of update subtasks matches the number of associated tenants; In response to the fact that there are multiple update subtasks, executing the update subtasks includes: Execute multiple update subtasks in parallel; Monitor the execution status of the update subtasks and identify whether any update subtasks have failed to execute. If the update subtask fails to execute, the update main task is determined to have failed; otherwise, the update main task is determined to have succeeded.

5. The resource management method according to claim 2, characterized in that, Before copying the target resource from the public resource space to the associated tenant's private resource space, the following steps are included: Build a global lock; Verify whether there is an ongoing task and whether the global lock has been successfully constructed; wherein, the ongoing task refers to the currently executing main update task; If there is no ongoing task and the global lock is successfully constructed, it is determined that the update main task should be constructed.

6. The resource management method according to claim 5, characterized in that, The process of creating the update subtask attached to it also includes: releasing the global lock.

7. The resource management method according to claim 1, characterized in that, The query includes tenants whose roles are associated with the role identifier, including: Obtain the target source resource of the target resource; Identify whether the current tenant possesses the target source resource and the target resource; In response to the current tenant having the target source resource but not having the target resource, it is designated as the associated tenant.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the resource management method according to any one of claims 1 to 7.

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 resource management method according to any one of claims 1 to 7.

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 resource management method according to any one of claims 1 to 7.