Resource management method and device based on tree structure, equipment, medium and product
By adopting a tree-based resource management method in the quota resource management system of the financial industry, constructing a resource tree and allocating a resource pool, the problem of inflexible resource management in traditional systems is solved, and more efficient and flexible resource management is achieved.
Patent Information
- Application Number
- CN202411395477.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Traditional quota resource management systems cannot achieve flexible control of quota resources, resulting in inflexible resource management, delayed information feedback and waste of resources.
A resource management method based on tree structure is adopted to construct a resource tree, where the tree node is composed of a public resource pool and an internal reserved resource pool to achieve flexible allocation and allocation of resources.
It enhances the flexibility of resource allocation, improves resource utilization efficiency and response speed, reduces resource idleness and waste, and ensures that key users or tasks receive stable resource support.
Smart Images

Figure CN119444425A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a tree-structure-based resource management method, device, equipment, medium and product. Background Art
[0002] In the current financial industry, the management of quota resources for financial products is a complex and crucial task that requires a balance between efficiency and fairness. Traditional quota resource management systems often adopt a fixed allocation and regular update model, which leads to marketers often facing problems such as incomplete information and delayed decision-making when dealing with quota resource allocation. Customers also have a poor experience when rushing to purchase quota resources due to improper quota resource allocation, resulting in failed purchases. It can be seen that the traditional quota resource management system cannot achieve flexible control of quota resources. In a rapidly changing market environment, it may lead to inflexible quota resource management, delayed information feedback, and waste of resources. Summary of the invention
[0003] The main purpose of this application is to provide a tree-structured resource management method, device, equipment, medium and product, aiming to solve the technical problem of low flexibility of resource management.
[0004] To achieve the above objectives, the present application proposes a resource management method based on a tree structure, comprising:
[0005] Construct a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node;
[0006] When receiving a resource allocation instruction input from the outside, allocating downwards from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pools according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pools according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and internal reserved resource pool between nodes in the same tree allocating to each other;
[0007] When receiving an externally input resource occupation application, obtain the applicant user, applied resources and applied occupation tree node of the resource occupation application, and determine whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, check whether the superior public resources meet the applied resources, where the user reserved resources are resources reserved for the applicant user in the internal reserved resource pool, and the superior public resources are resources in the public resource pool of the superior node of the occupation tree node.
[0008] In one embodiment, after the step of allocating downward from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, the method further includes:
[0009] Determine the internal reserved resource pool allocation strategy for all tree nodes, and reserve the internal reserved resources of the tree nodes for the applicant users specified by the internal reserved resource pool allocation strategy.
[0010] In one embodiment, the step of determining whether the user reserved resources in the occupied tree node meet the applied resources, and if the user reserved resources do not meet the applied resources, then checking whether the upper level public resources meet the applied resources includes:
[0011] Determine whether the remaining reserved resources in the occupied tree node are less than the applied resources, wherein the internal reserved resources of the occupied tree node include the remaining reserved resources and the internal reserved resources occupied by the applying user;
[0012] If the remaining reserved resources in the occupied tree node are less than the applied resources, it is determined that the user reserved resources in the occupied tree node do not meet the applied resources, and in the order of the resource tree, it is checked whether there is a target node whose remaining public resources are greater than the applied resources in the occupied tree node and the upper node of the occupied tree node, wherein the public resources of the target node include the remaining public resources and the occupied public resources;
[0013] If there is a target node whose remaining public resources are greater than the applied resources, it is determined that the upper-level public resources satisfy the applied resources and occupy the remaining public resources in the target node.
[0014] In one embodiment, after the step of checking whether there is a target node whose remaining public resources are greater than the applied resources in the occupied tree node and the upper node of the occupied tree node in the order of the resource tree, the following steps are included:
[0015] If there is no target node whose remaining public resources are greater than the applied resources, it is determined that the upper-level public resources do not meet the applied resources, and the unoccupied public resources and internal reserved resources of other tree nodes are allocated to the internal reserved resource pool of the occupied tree node according to the preset allocation strategy.
[0016] In one embodiment, the tree structure-based resource management method further includes:
[0017] When receiving a cancellation application for a resource occupation application, determining an occupation mode of the resource occupation application, the occupation mode including an internal reserved resource pool occupation mode and a public resource pool occupation mode;
[0018] If there is an internal reserved resource pool occupation mode in the occupation mode, the internal reserved resources occupied by the resource occupation application are updated according to the occupied resources in the internal reserved resource pool occupation mode in the resource occupation application;
[0019] If there is a public resource pool occupancy mode in the occupancy mode, the public resources occupied by the resource occupancy application are updated according to the occupied resources in the public resource pool occupancy mode in the resource occupancy application.
[0020] In one embodiment, the tree structure-based resource management method further includes:
[0021] When the target resource of the tree node needs to be occupied, the occupation record of the tree node is locked, and the target resource in the tree node is occupied. After the occupation is successful, the occupation record of the tree node is updated, wherein the target resource includes the public resource and internal reserved resource of the tree node.
[0022] In addition, to achieve the above purpose, the present application also proposes a resource management device based on a tree structure, and the resource management device based on a tree structure includes:
[0023] A construction module constructs a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node;
[0024] An allocation module, when receiving a resource allocation instruction input from the outside, allocates downward from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pool according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pool according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and the internal reserved resource pool between nodes in the same tree allocating to each other;
[0025] The occupation module, when receiving an externally input resource occupation application, obtains the applicant user, the applied resources and the applied occupation tree node of the resource occupation application, and determines whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, check whether the superior public resources meet the applied resources, where the user reserved resources are the resources reserved for the applicant user in the internal reserved resource pool, and the superior public resources are the resources in the public resource pool of the superior node of the occupation tree node.
[0026] In addition, to achieve the above-mentioned purpose, the present application also proposes a tree-structured resource management device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the tree-structured resource management method as described above.
[0027] In addition, to achieve the above purpose, the present application also proposes a medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the tree-structured resource management method described above are implemented.
[0028] In addition, to achieve the above-mentioned purpose, the present application also provides a product, which is a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the steps of the tree-structure-based resource management method as described above are implemented.
[0029] One or more technical solutions proposed in this application have at least the following technical effects:
[0030] The present application constructs a resource tree, wherein the resource tree is a tree structure, and the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool. The public resource pool is a shared resource pool of all tree nodes, which enhances the flexibility of resource allocation and allows different levels and nodes to flexibly allocate resources according to actual needs; the internal reserved resource pool is an exclusive resource pool for at least one designated user, which increases the exclusivity and security of resource use and ensures that key users or tasks obtain stable resource support. The tree node includes a root node and a branch node; when receiving an external input resource allocation instruction, the root public resource pool and the root internal reserved resource pool of the root node are allocated downward according to the resource allocation instruction, realizing the step-by-step detailed allocation of resources from the top layer to the base layer, and supporting cross-level and cross-node resource allocation, improving resource utilization efficiency and response speed. Among them, the resource allocation instruction includes the root public resource pool allocating to the lower public resource pool according to the level, the root internal reserved resource pool allocating to the lower internal reserved resource pool according to the level, and supporting resource coordination between nodes at the same level to meet more complex resource demand scenarios. The public resource pool of the branch node is allocated to the public resource pool of the superior according to the hierarchy, and the internal reserved resource pool of the branch node is allocated to the internal reserved resource pool of the superior according to the hierarchy, realizing the reverse reflux and redistribution of resources, and enhancing the flexibility and adaptability of the system. In addition, the mutual allocation of the public resource pool and the internal reserved resource pool between the same tree nodes is also realized, which promotes the optimal configuration of resources in the global scope and reduces the idleness and waste of resources. When receiving the resource occupation application input from the outside, the applicant user, the application resource and the occupied tree node applied for the resource occupation application are obtained, and it is judged whether the internal reserved resources reserved for the applicant user in the internal reserved resource pool in the occupied tree node meet the applied resources, thereby improving the accuracy and efficiency of resource application processing. If the user reserved resources of the internal reserved resource pool in the occupied tree node do not meet the applied resources, the public resource pool of the upper node of the occupied tree node is requested for resources, ensuring the timely response and satisfaction of resource requirements, while maintaining the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 This is a flowchart of the first embodiment of the resource management method based on the tree structure of the present application;
[0034] Figure 2 A resource tree allocation scene graph for the tree-structure-based resource management method of this application;
[0035] Figure 3 This is a scenario diagram of the tree-structure-based resource management method of this application;
[0036] Figure 4 This is a schematic diagram of the module structure of a tree-structured resource management device according to an embodiment of the present application;
[0037] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the tree-structured resource management method in the embodiment of the present application.
[0038] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0039] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0040] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0041] This embodiment provides a resource management method based on a tree structure, which can construct a resource tree according to the structural information input externally, and the tree integrates a public resource pool and an internal reserved resource pool. By clearly defining the internal reserved resource allocation strategy of each tree node, the method ensures that key resources can be accurately reserved for users who meet specific policy conditions, thereby ensuring the priority of important customer resources and promoting the optimal allocation of resources. Users can monitor the resource usage status in real time, and realize dynamic allocation of resource pools according to their respective strategies, maximize resource utilization, and realize flexible division and efficient utilization of resources. In addition, the method follows the principle of minimum scope occupancy, gives priority to the use of internal reserved resources, and then allocates resources according to the hierarchical order of users in the resource tree, which greatly improves the liquidity and utilization efficiency of resources. In the process of resource occupation, the system only locks necessary resources, significantly reducing the phenomenon of invalid occupation. By accurately evaluating and verifying whether the remaining reserved resources of the tree node meet the user's application requirements, the problem of excessive resource allocation or idle waste is effectively prevented. Once the internal reserved resources are insufficient, the system can intelligently search and allocate the remaining public resources in the qualified upper nodes in the resource tree structure to meet the user's application to the greatest extent. This not only improves resource utilization, but also enhances the system's response speed and adaptability, bringing significant convenience and benefits to resource management and user services. At the same time, by locking the occupancy records, this method effectively avoids data conflicts and inconsistencies caused by concurrent operations, ensuring data integrity and consistency in the resource allocation process. The system can also flexibly handle the cancellation of resource occupancy applications to ensure that resources can be efficiently recovered and reallocated, further improving the flexibility and efficiency of resource management.
[0042] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the system as an example to illustrate this embodiment and the following embodiments.
[0043] Based on this, this embodiment provides a resource management method based on a tree structure. Figure 1 , Figure 1 This is a flowchart of the first embodiment of the tree-structure-based resource management method of the present application.
[0044] In this embodiment, the tree structure-based resource management method includes steps S10 to S30:
[0045] Step S10, constructing a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node;
[0046] It should be noted that the resource tree is a tree structure used to manage and allocate resources. In this structure, each node represents a resource allocation unit. The nodes are connected through a hierarchical relationship to form a tree structure, and the hierarchy and ownership of the organization are reflected through the parent-child relationship. The public resource pool is a collection of resources shared by each node in the resource tree. These resources can be used by the node and all its upper and lower nodes. The internal reserved resource pool is a collection of exclusive resources for a specific node in the resource tree. These resources are usually reserved for designated users or customers and cannot be directly accessed by other users. The tree node is the basic component unit of the resource tree. Each node contains a certain number of resources (public resource pools and internal reserved resource pools). The nodes are connected to each other through a hierarchical relationship to form the entire resource tree. The tree node includes the root node and the branch node. The root node is the starting point of the resource tree and is the top-level node of the entire resource tree. The root node usually represents the top level of the entire organization or system and is responsible for the allocation and management of total resources. Branch nodes are other nodes in the resource tree except the root node. They are derived from the root node or other branch nodes and represent more detailed resource allocation units.
[0047] It should be noted that the tree nodes of the resource tree can be enterprise servers. Multiple servers are connected through hierarchical relationships to form a tree structure. The hierarchy and ownership of the servers are reflected through parent-child relationships. The public resource pool can be a public database on the server. The public business data in the public database can be used by the server and all its upper and lower level servers. The internal reserved resource pool can be a privacy database on the server. The privacy business data in the privacy database can usually only be accessed by designated users or customers, and other users cannot directly access it. Both public business data and privacy business data are text data. The root node can be the main server, and the branch node can be a sub-server under the main server. When business data needs to be stored on the server in the resource tree according to the storage policy, the business data can be distributed layer by layer from the main server according to the storage policy and stored in the public database or privacy database in the sub-server. By building a server resource tree, the flexibility and security of business data access can be enhanced, the number of interactions between devices can be reduced, and the interaction efficiency between devices can be improved.
[0048] In this step, according to the external input structure information, by defining the hierarchy and association relationship between nodes, a tree-structured resource tree is constructed (the specific construction process includes determining the root node, and then adding child nodes step by step according to the input structure description. Each node clearly identifies its position in the tree and its connection relationship with other nodes). Each tree node of the resource tree contains two resource pools: a public resource pool and an internal reserved resource pool. The public resource pool is open and can be shared and accessed by all nodes in the tree according to certain rules; while the internal reserved resource pool is set independently for each node and is only for the exclusive use of the node and its eligible child nodes. Such a design not only ensures the flexibility and sharing of resources, but also takes into account the resource priority and protection of specific users.
[0049] Step S20, when receiving the resource allocation instruction input from the outside, allocating downward from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pool according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pool according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and the internal reserved resource pool between nodes in the same tree allocating to each other;
[0050] It should be noted that resource allocation instructions are commands for directing how resources are allocated in a resource tree. Resource allocation instructions may include allocating resources from a root node to a branch node, allocating branch nodes to upper and lower levels, or transferring resources between different nodes.
[0051] When receiving the resource allocation instruction input from the outside, the system starts to allocate resources from the total resource pool of the root node (including the root public resource pool and the root internal reserved resource pool) according to the resource allocation instruction. When the total resources are only allocated in the root public resource pool or the root internal reserved resource pool, the total resources need to be allocated in the root public resource pool and the root internal reserved resource pool according to the resource allocation instruction, so as to facilitate the continued downward allocation. Then the total public resources start from the root public resource pool of the root node and are gradually allocated to the lower public resource pools according to the hierarchical relationship. Similarly, the root internal reserved resources also start from the root internal reserved resource pool of the root node and are allocated to the lower internal reserved resource pool according to the hierarchical relationship to ensure that specific users or tasks can obtain their reserved resources. The allocation of the public resource pool and the internal reserved resource pool of the branch node mentioned in the resource allocation instruction to the upper level is relatively special and is usually used for resource recovery or reallocation. For example, when a branch node completes its task and releases resources, these resources may flow back to the corresponding resource pool of the upper node according to the hierarchical relationship. In addition to allocations between levels, instructions may also include mutual allocations of resources between different nodes within the same level. This is usually based on a certain strategy or requirement, such as load balancing, resource sharing, etc. Once the source, allocation direction, and quantity of resources are determined, the system will perform the allocation operation. This may include updating the status of the resource pool, modifying the connection relationship between nodes, and notifying relevant users or tasks that resources have been allocated. Furthermore, the entire allocation process can be recorded in detail for subsequent monitoring. The system can also monitor the use of resources to ensure that resources are used reasonably and make dynamic adjustments when necessary.
[0052] Step S30, when receiving an externally input resource occupation application, obtain the applicant user, applied resources and applied occupation tree node of the resource occupation application, and determine whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, check whether the superior public resources meet the applied resources, where the user reserved resources are resources reserved for the applicant user in the internal reserved resource pool, and the superior public resources are resources in the public resource pool of the superior node of the occupation tree node.
[0053] It should be noted that a resource occupation application is a request initiated by a user or system to request the occupation of resources in a specific resource tree node. The resource occupation application includes the applicant user, the amount of resources requested, the occupied tree node requested, the specific time of the application, the expected start time and end time, priority information and other application information.
[0054] When receiving an external input resource occupation application, the system will first parse the application content to clearly determine the applicant, the amount of resources applied for, the occupation tree node applied for, and any related additional information (such as time range, priority, etc.). Subsequently, the system will conduct a detailed check on the occupation tree node applied for to see whether its internal reserved resource pool has reserved sufficient internal reserved resources for the applicant user. If the internal reserved resources are not enough to meet the application requirements, the system will further intelligently traverse the resource tree structure, explore the upper node to the upper node to open the available resources of the resource pool, follow the principle of minimum scope occupation, and strive to reasonably and efficiently complete the resource allocation under the premise of minimizing the scope of resource occupation. In this process, the system will give priority to the use of internal reserved resources, and then the public resource occupation based on the user's position order in the resource tree. Once sufficient resources are found to meet the application, the system will immediately perform the resource locking operation and register the occupation to ensure that the resources are exclusively used by the user within the specified time period. If the resources cannot meet the application, the system will automatically reject the application and feedback the rejection reason and recommended measures to the user through appropriate channels.
[0055] For example, assuming that this embodiment is applied to a banking institution, each tree node represents a banking institution. Figure 2 , Figure 2It is a resource tree allocation scenario diagram, which clearly shows the flow and allocation process of resources between institutions at different levels. The figure is divided into three main levels: first-level institutions, second-level institutions and leaf institutions, which are the head office, branch and outlet institutions in this embodiment. The first-level institution, as the top-level institution, is responsible for the scheduling and management of overall resources. Its public resource pool and internal reserved resource pool have a large number of public resources and internal reserved resources. Public resources are resources that can be applied for by all subordinate institutions, while internal reserved resources are resources specifically used for internal allocation or to deal with special situations. The first-level institution transfers resources to subordinate institutions by means of resource allocation. The second-level institutions in the figure are the hubs connecting the first-level institutions and leaf institutions. They receive resources from the first-level institutions and further allocate them to their own sub-institutions or subordinate leaf institutions. Each second-level institution (such as institution 2-1 and institution 2-2) also has a public resource pool and an internal reserved resource pool to meet its own needs and allocate downward. Depending on the hierarchical situation of the institution tree between the first-level institution and the leaf institution, there can be multiple levels of institutions. To avoid redundancy, only the second-level institution is taken as an example. Leaf organizations are at the bottom of the organizational structure. They can only receive resources from higher-level organizations, but cannot allocate or transfer any resources. Each leaf organization (such as organization n-1 and organization nn) also has a public resource pool and an internal reserved resource pool to receive resources from higher-level organizations. The arrows in the figure are all bidirectional, indicating that resources can flow in both directions, that is, they can be allocated downward or recycled upward. In addition, each organization can have multiple branches, that is, a first-level organization can allocate resources to multiple second-level organizations, and a second-level organization can allocate resources to multiple leaf organizations.
[0056] This embodiment constructs a resource tree, wherein the resource tree is a tree structure, and the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool. The public resource pool is a shared resource pool of all tree nodes, which enhances the flexibility of resource allocation and allows different levels and nodes to flexibly allocate resources according to actual needs; the internal reserved resource pool is an exclusive resource pool for at least one designated user, which increases the exclusivity and security of resource use and ensures that key users or tasks obtain stable resource support. The tree node includes a root node and a branch node; when receiving an external input resource allocation instruction, the root public resource pool and the root internal reserved resource pool of the root node are allocated downward according to the resource allocation instruction, realizing the step-by-step detailed allocation of resources from the top layer to the base layer, and supporting cross-level and cross-node resource allocation, improving resource utilization efficiency and response speed. Among them, the resource allocation instruction includes the root public resource pool allocating to the lower public resource pool according to the level, the root internal reserved resource pool allocating to the lower internal reserved resource pool according to the level, and supporting resource coordination between nodes at the same level to meet more complex resource demand scenarios. The public resource pool of the branch node is allocated to the public resource pool of the superior according to the hierarchy, and the internal reserved resource pool of the branch node is allocated to the internal reserved resource pool of the superior according to the hierarchy, realizing the reverse reflux and redistribution of resources, and enhancing the flexibility and adaptability of the system. In addition, the mutual allocation of the public resource pool and the internal reserved resource pool between the same tree nodes is also realized, which promotes the optimal configuration of resources in the global scope and reduces the idleness and waste of resources. When receiving the resource occupation application input from the outside, the applicant user, the application resource and the occupied tree node applied for the resource occupation application are obtained, and it is judged whether the internal reserved resources reserved for the applicant user in the internal reserved resource pool in the occupied tree node meet the applied resources, thereby improving the accuracy and efficiency of resource application processing. If the user reserved resources of the internal reserved resource pool in the occupied tree node do not meet the applied resources, the public resource pool of the upper node of the occupied tree node is requested for resources, ensuring the timely response and satisfaction of resource requirements, while maintaining the stability and reliability of the system.
[0057] In a feasible implementation, the steps in step S20 may include step T10:
[0058] Step T10, determining the internal reserved resource pool allocation strategy for all tree nodes, and reserving the internal reserved resources of the tree nodes for the applicants specified by the internal reserved resource pool allocation strategy.
[0059] It should be noted that the internal reserved resource pool allocation strategy is to formulate rules and methods for allocating internal reserved resources to different customers or purposes. The strategy can be set based on various factors such as customer importance, historical performance, business needs, etc.
[0060] After the resource tree is constructed, an internal reserved resource pool allocation strategy needs to be determined for each tree node. The allocation strategy specifies which customers can obtain internal reserved resources, as well as the specific methods and conditions for resource allocation. The formulation of this allocation strategy may be based on a variety of factors, such as the customer's historical purchase record, the priority of important customers, the needs of business development, etc. According to these factors, a flexible and specific resource allocation rule can be set for each organization. The internal reserved resources that are not reserved for the designated applicant are theoretically not available for occupation. Only after the internal reserved resources of the corresponding node are reserved for the designated applicant according to the determined internal reserved resource pool allocation strategy can they be occupied by the designated applicant. The reservation process is dynamic, which means that the reservation of resources will be adjusted in real time according to actual conditions (such as customer needs, sales strategies, etc.). Furthermore, when implementing the reservation, the system can check whether the designated applicant meets the conditions for resource reservation (such as whether it is a high-value customer, whether it has participated in a specific promotional activity, etc.). If it meets the conditions, the corresponding resources will be reserved in the applicant's account for subsequent use. Furthermore, the system will record the usage of internal reserved resources in real time so that managers can keep track of resource allocation and occupancy at any time, providing data support for subsequent quota resource management and marketing strategies.
[0061] For example, reference Figure 3 , Figure 3 This is a schematic diagram of the internal reserved resource pool. It can be seen from the figure that the internal reserved resource pool has been reserved for three customers, namely customer 1, customer 2, and customer 3. Taking customer 1 as an example, when customer 1 applies to occupy the tree node to which the internal reserved resource pool belongs, the customer 1 reserved resources in the internal reserved resource pool will be allocated to customer 1 first. If the customer 1 reserved resources are less than the resources applied for by customer 1, resources will be applied for from the public resource pool in the tree node to which the internal reserved resource pool belongs.
[0062] This embodiment significantly improves the refinement and flexibility of resource management. The internal reserved resource pool allocation strategy of each tree node is clarified to ensure that key resources can be accurately reserved for designated users who meet the policy conditions, which not only guarantees the resource priority of important customers, but also promotes the effective allocation of resources. The dynamic adjustment mechanism of this strategy makes resource allocation more flexible and can quickly respond to changes in market demand.
[0063] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated hereafter. On this basis, the steps of step S30 also include steps A10 to A30:
[0064] Step A10, determining whether the remaining reserved resources in the occupied tree node are less than the applied resources, wherein the internal reserved resources of the occupied tree node include the remaining reserved resources and the internal reserved resources occupied by the applying user;
[0065] It should be noted that the occupied tree node refers to the tree node applied for by the resource occupation application. For a certain occupied tree node, the remaining reserved resources refer to the internal resources reserved for the specific applicant by the node, minus the resources actually occupied by the user. The applied resources are the amount of resources requested by the user during the application process.
[0066] First, the remaining amount of resources reserved for the applicant in the occupied tree node is calculated. This is done by subtracting the amount of internal reserved resources actually occupied by the user under the node from the total amount of internal reserved resources preset for the user or dynamically adjusted according to the policy, so as to accurately obtain the remaining amount of resources that the user can continue to apply for. This calculation process ensures that the system can grasp the resource occupation status and remaining available resources of each user under each tree node in real time. Next, the remaining reserved resources are compared with the user's application resources, that is, the calculated remaining reserved resources are directly compared with the amount of resources that the user hopes to occupy for this application. If the remaining reserved resources are greater than or equal to the user's application resources, it means that the internal reserved resources under the node can meet the user's current application needs; if the remaining reserved resources are less than the user's application resources, it means that the internal reserved resources under the node are insufficient to support this application, and the system will need to further explore the public resource pool of the upper node or take other measures to meet the user's application.
[0067] Step A20, if the remaining reserved resources in the occupied tree node are less than the applied resources, it is determined that the user reserved resources in the occupied tree node do not meet the applied resources, and in the order of the resource tree, it is checked whether there is a target node whose remaining public resources are greater than the applied resources in the occupied tree node and the upper node of the occupied tree node, wherein the public resources of the target node include the remaining public resources and the occupied public resources;
[0068] It should be noted that the parent node is a node at a higher level than the current node in the resource tree structure, and is the parent node or ancestor node of the current node. For a certain tree node, the remaining public resources refer to the remaining part of the total public resources of the node after deducting the resources allocated to other users or purposes.
[0069] If the remaining reserved resources are less than the requested resources, the system traverses the occupied tree nodes and their parent nodes upwards in the hierarchical order of the resource tree. For each of the above tree nodes, the system calculates its remaining public resources, that is, the total public resources minus the allocated resources. During the traversal process, the system checks whether there is a target node whose remaining public resources are greater than the remaining requested resources.
[0070] In a feasible implementation, the steps in step A20 may include step A201:
[0071] Step A201, if there is no target node whose remaining public resources are greater than the applied resources, it is determined that the upper-level public resources do not meet the applied resources, and the unoccupied public resources and internal reserved resources of other tree nodes are allocated to the internal reserved resource pool of the occupied tree node according to the preset allocation strategy.
[0072] It should be noted that the preset allocation strategy is a set of rules or algorithms pre-set in the system or application to guide the allocation of resources between different nodes or users. The preset allocation strategy may be based on a variety of factors, such as priority, historical usage, business needs, etc. In the resource tree, in addition to internal reserved resources, each node may also have some public resources that are not occupied by any user or purpose. This part of the unoccupied public resources can be flexibly used according to the preset allocation strategy.
[0073] If there is no target node with a remaining public resource greater than the requested resource during the entire traversal process, the system will check the resource usage of other nodes in the entire resource tree, especially focusing on those unoccupied public resources. These resources may be distributed on different nodes, but are not currently occupied by any user or purpose. Based on the preset allocation strategy, the system will decide how to reallocate these unoccupied public resources and possible internal reserved resources (if the policy allows) according to certain rules or algorithms. This strategy may take into account a variety of factors, such as node priority, resource urgency, user's historical performance, etc. Based on the results of the preset allocation strategy, the system will reallocate some or all of the unoccupied public resources and possible part of the internal reserved resources to the internal reserved resource pool of the occupied tree node. The purpose of this is to meet the user's application resource needs and ensure that the user can obtain sufficient resources to complete his business or operation. After the resource reallocation is completed, the system will update the resource status information of the relevant nodes, including the internal reserved resource pool of the occupied tree node, the unoccupied public resources of other nodes, etc., to ensure the data consistency and accuracy of the entire resource tree system.
[0074] In this embodiment, if the system fails to find a superior node that meets the conditions after traversal, it will intelligently start the preset allocation strategy and flexibly allocate the unoccupied resources of other nodes to the internal reserved pool of the occupied tree node. This strategy comprehensively considers priority, historical situation and business needs to ensure the rationality and efficiency of resource allocation. Through the dynamic reallocation of resources, not only the user's remaining resource needs are met, but also the overall optimization and balance of the resource tree system are promoted, and the flexibility of the system and user satisfaction are improved.
[0075] Step A30: If there is a target node whose remaining public resources are greater than the applied resources, it is determined that the upper-level public resources satisfy the applied resources and occupy the remaining public resources in the target node.
[0076] When a superior node that meets the conditions is found (i.e., its remaining public resources are greater than the requested resources), the system will occupy the remaining public resources in the node equal to the requested resources to meet the user's requested resource needs. During the occupation process, the system will ensure that the remaining resource limit of any node will not be exceeded to ensure the stability and sustainability of the entire resource tree system.
[0077] This embodiment significantly enhances the flexibility and efficiency of resource allocation. First, by accurately calculating and judging whether the remaining reserved resources of the occupied tree nodes meet the user's application, resource over-allocation or idleness is effectively avoided. When the remaining reserved resources are insufficient, the system intelligently searches for and occupies the remaining public resources of the qualified upper node in the resource tree structure, thereby ensuring that the user's application is met to the greatest extent. This process not only improves resource utilization, but also enhances the system's response speed and adaptability, bringing great convenience and benefits to resource management and user services.
[0078] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first or second embodiment can be referred to the above introduction, and will not be repeated in the following. The resource management method based on the tree structure also includes steps B10 to B30:
[0079] In a feasible implementation manner, the tree structure-based resource management method further includes step C10:
[0080] Step C10, when the target resource of the tree node needs to be occupied, the occupation record of the tree node is locked, and the target resource in the tree node is occupied. After the occupation is successful, the occupation record of the tree node is updated, wherein the target resource includes the public resource and internal reserved resource of the tree node.
[0081] It should be noted that the occupancy record is a collection of information used to record the current occupancy status of tree node resources. It may contain detailed information such as which resources have been occupied, who occupied them, and the occupancy time. Locking is a mechanism in concurrency control to prevent multiple users or processes from modifying the same data item at the same time, thereby avoiding data inconsistency. In this embodiment, the occupancy record is locked to ensure that there will be no interference from other operations when the record is updated. Resource occupation refers to the process in which a user or system requests and successfully obtains available resources in a tree node. After successfully occupying resources, these resources will no longer be available to other requests until they are released.
[0082] Before attempting to occupy a resource in a tree node, the system first locks the occupancy record of the node. This is to prevent data races or inconsistencies when updating the record. The locking operation ensures that no other process or thread can modify the occupancy record of the node before the current operation is completed. After the occupancy record is locked, the system checks whether there are enough available resources in the tree node to satisfy the request. If there are enough resources, the resources are marked as occupied and allocated to the requester. This involves updating the internal state of the tree node to reflect the latest allocation of resources. If there are insufficient resources, the occupation request may fail, or the system may take other actions (such as waiting for resources to be released or requesting more resources). After the resource is successfully occupied, the system updates the occupancy record of the tree node to reflect this change. The update operation may include recording the current state of the resource (such as occupied), occupant information, occupation time, etc. After the update is completed, the occupancy record is unlocked so that other processes or threads can access and modify it.
[0083] In this embodiment, the security and accuracy of resource occupation are significantly improved. By locking the occupation record, data conflicts and inconsistencies under concurrent operations are effectively avoided, ensuring data integrity and consistency in the resource allocation process. At the same time, the instant update of the occupation record not only provides users with accurate feedback on resource occupation, but also provides a reliable basis for the subsequent resource management and scheduling of the system. This mechanism not only improves the efficiency and success rate of resource occupation, but also enhances the system's concurrent processing capabilities and user experience.
[0084] Step B10, when receiving a cancellation application for a resource occupation application, determining an occupation mode of the resource occupation application, the occupation mode including an internal reserved resource pool occupation mode and a public resource pool occupation mode;
[0085] It should be noted that the application for revocation of a resource occupation application is a request issued by a user or a system, which is intended to cancel a previously submitted resource occupation application and release the occupied resources for reallocation. The occupation mode is the allocation mechanism or method used when resources are occupied, which determines how resources are occupied by a specific application. The occupation modes mentioned in this embodiment include an internal reserved resource pool occupation mode and a public resource pool occupation mode. The internal reserved resource pool occupation mode is a resource occupation mode in which resources are reserved for specific users and stored in an internal reserved resource pool. This mode is typically used to ensure that key users or businesses receive priority resource support. The public resource pool occupation mode is another resource occupation mode in which resources are allocated to users from a public resource pool, which is open to all users and is allocated based on first-come, first-served or other preset rules.
[0086] When the system receives a cancellation request for a resource occupation application, the system needs to identify the occupation mode used by the resource occupation application. This is done by checking the information recorded when the resource occupation application was made, which can come from the occupation record in step C10, indicating how the resource was occupied (i.e., through the internal reserved resource pool or the public resource pool).
[0087] Step B20, if there is an internal reserved resource pool occupation mode in the occupation mode, then according to the occupied resources in the internal reserved resource pool occupation mode in the resource occupation application, the internal reserved resources occupied by the resource occupation application are updated;
[0088] If the resource occupation application includes the internal reserved resource pool occupation mode, the system will further check how many resources the application occupies in the internal reserved resource pool. Then, the system will subtract the amount of resources occupied by the application from the occupied resources in the internal reserved resource pool. This means that the resources originally reserved for the application are released, making them available again for other users or purposes.
[0089] Step B30: If there is a public resource pool occupation mode in the occupation mode, the public resources occupied by the resource occupation application are updated according to the occupied resources in the public resource pool occupation mode in the resource occupation application.
[0090] If the resource occupation application involves the public resource pool occupation mode, the system will take similar actions. The system will check how many resources the application has occupied in the public resource pool and subtract this amount of resources from the occupied public resources. This also releases resources so that these resources can re-enter the public resource pool for subsequent applications.
[0091] Through this embodiment, the system can flexibly handle the revocation of resource occupation applications to ensure efficient recovery and redistribution of resources. When a revocation application occurs, the system first identifies the resource occupation mode and distinguishes between different processing methods for internal reservations and public resource pools. For internal reserved resources, the system accurately releases the reserved resources of specific users to maintain the fairness and effectiveness of the resource reservation mechanism. For public resources, the system returns the resources to the resource pool in a timely manner to ensure the liquidity and accessibility of resources. This mechanism not only improves the flexibility and response speed of resource management, but also effectively promotes the optimal allocation and efficient utilization of resources.
[0092] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the tree-structured resource management method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0093] This application also provides a resource management device based on a tree structure, please refer to Figure 4, the resource management device based on the tree structure includes:
[0094] A construction module 10 constructs a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node;
[0095] The allocation module 20, when receiving the resource allocation instruction input from the outside, allocates downward from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pool according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pool according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and the internal reserved resource pool between nodes in the same tree allocating to each other;
[0096] The occupation module 30, when receiving an externally input resource occupation application, obtains the applicant user, the applied resources and the applied occupation tree node of the resource occupation application, and determines whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, it checks whether the superior public resources meet the applied resources, wherein the user reserved resources are the resources reserved for the applicant user in the internal reserved resource pool, and the superior public resources are the resources in the public resource pool of the superior node of the occupation tree node.
[0097] The tree-structure-based resource management device provided by the present application adopts the tree-structure-based resource management method in the above-mentioned embodiment, which can solve the technical problem of low resource management flexibility. Compared with the prior art, the beneficial effects of the tree-structure-based resource management device provided by the present application are the same as the beneficial effects of the tree-structure-based resource management method provided by the above-mentioned embodiment, and other technical features in the tree-structure-based resource management device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0098] The present application provides a tree-structured resource management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the tree-structured resource management method in the above-mentioned embodiment 1.
[0099] Reference below Figure 5, which shows a schematic diagram of a tree-structured resource management device suitable for implementing the embodiment of the present application. The tree-structured resource management device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The tree-structure-based resource management device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0100] like Figure 5 As shown, the tree-structure-based resource management device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the tree-structure-based resource management device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the tree-structured resource management device to communicate with other devices wirelessly or by wire to exchange data. Although the tree-structured resource management device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0101] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0102] The tree-structure-based resource management device provided by the present application adopts the tree-structure-based resource management method in the above embodiment, which can solve the technical problem of low resource management flexibility. Compared with the prior art, the beneficial effects of the tree-structure-based resource management device provided by the present application are the same as the beneficial effects of the tree-structure-based resource management method provided by the above embodiment, and other technical features in the tree-structure-based resource management device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0103] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0104] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0105] The present application provides a medium, which is a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the tree-structure-based resource management method in the above-mentioned embodiment.
[0106] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0107] The computer-readable storage medium may be included in the resource management device based on the tree structure; or may exist independently without being assembled into the resource management device based on the tree structure.
[0108] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a tree-structured resource management device, the tree-structured resource management device:
[0109] Construct a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node;
[0110] When receiving a resource allocation instruction input from the outside, allocating downwards from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pools according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pools according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and internal reserved resource pool between nodes in the same tree allocating to each other;
[0111] When receiving an externally input resource occupation application, obtain the applicant user, applied resources and applied occupation tree node of the resource occupation application, and determine whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, check whether the superior public resources meet the applied resources, where the user reserved resources are resources reserved for the applicant user in the internal reserved resource pool, and the superior public resources are resources in the public resource pool of the superior node of the occupation tree node.
[0112] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0115] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned tree-structure-based resource management method, and can solve the technical problem of low resource management flexibility. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the tree-structure-based resource management method provided by the above-mentioned embodiment, and will not be repeated here.
[0116] The present application also provides a product, which is a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the tree-structure-based resource management method as described above are implemented.
[0117] The computer program product provided by this application can solve the technical problem of low flexibility in resource management. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as those of the tree-structured resource management method provided in the above embodiment, which will not be described in detail here.
[0118] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A resource management method based on a tree structure, characterized in that: The tree structure-based resource management method comprises: Constructing a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all the tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node; When receiving a resource allocation instruction input from the outside, allocating downwards from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pool according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pool according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and the internal reserved resource pool between the same tree nodes allocating to each other; When receiving an externally input resource occupation application, obtain the applicant user, applied resources and applied occupation tree node of the resource occupation application, and determine whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, check whether the superior public resources meet the applied resources, wherein the user reserved resources are resources reserved for the applicant user in an internal reserved resource pool, and the superior public resources are resources in the public resource pool of the superior node of the occupation tree node.
2. The tree-structure-based resource management method according to claim 1, characterized in that: After the step of allocating downwards from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, the method further includes: An internal reserved resource pool allocation policy for all the tree nodes is determined, and the internal reserved resources of the tree nodes are reserved for designated users of the internal reserved resource pool allocation policy.
3. The tree-structure-based resource management method according to claim 1, characterized in that: The step of judging whether the user reserved resources in the occupied tree node meet the applied resources, and if the user reserved resources do not meet the applied resources, checking whether the upper level public resources meet the applied resources comprises: Determine whether the remaining reserved resources in the occupied tree node are less than the applied resources, wherein the internal reserved resources of the occupied tree node include the remaining reserved resources and the internal reserved resources occupied by the applying user; If the remaining reserved resources in the occupied tree node are less than the applied resources, it is determined that the user reserved resources in the occupied tree node do not meet the applied resources, and in the order of the resource tree, it is checked whether there is a target node whose remaining public resources are greater than the applied resources in the occupied tree node and the upper node of the occupied tree node, wherein the public resources of the target node include the remaining public resources and the occupied public resources; If there is a target node whose remaining public resources are greater than the applied resources, it is determined that the upper-level public resources satisfy the applied resources and occupy the remaining public resources in the target node.
4. The tree-structure-based resource management method according to claim 3, characterized in that: After the step of checking whether there is a target node whose remaining public resources are greater than the applied resources in the occupied tree node and the upper node of the occupied tree node in the order of the resource tree, the following steps are included: If there is no target node whose remaining public resources are greater than the applied resources, it is determined that the upper-level public resources do not meet the applied resources, and the unoccupied public resources and internal reserved resources of other tree nodes are allocated to the internal reserved resource pool of the occupied tree node according to the preset allocation strategy.
5. The tree-structure-based resource management method according to claim 1, characterized in that: The tree structure-based resource management method further includes: When receiving a cancellation application for the resource occupation application, determining an occupation mode of the resource occupation application, the occupation mode including an internal reserved resource pool occupation mode and a public resource pool occupation mode; If the internal reserved resource pool occupancy mode exists in the occupancy mode, the internal reserved resources occupied by the resource occupancy application are updated according to the occupied resources in the internal reserved resource pool occupancy mode in the resource occupancy application; If the public resource pool occupation mode exists in the occupation mode, the public resources occupied by the resource occupation application are updated according to the occupied resources in the public resource pool occupation mode in the resource occupation application.
6. The tree-structure-based resource management method according to claim 1, characterized in that: The tree structure-based resource management method further includes: When the target resources of the tree node need to be occupied, the occupation record of the tree node is locked, and the target resources in the tree node are occupied. After the occupation is successful, the occupation record of the tree node is updated, wherein the target resources include the public resources and internal reserved resources of the tree node.
7. A resource management device based on a tree structure, characterized in that: The tree-structure-based resource management device comprises: A construction module, constructing a resource tree according to the external input structure information, wherein the resource tree is a tree structure, the tree nodes of the resource tree are composed of a public resource pool and an internal reserved resource pool, the public resource pool is a shared resource pool of all the tree nodes, the internal reserved resource pool is an exclusive resource pool of at least one specified user, and the tree nodes include a root node and a branch node; an allocation module, when receiving an externally input resource allocation instruction, allocating downward from the root public resource pool and the root internal reserved resource pool of the root node according to the resource allocation instruction, wherein the resource allocation instruction includes the root public resource pool allocating to the subordinate public resource pool according to the hierarchy, the root internal reserved resource pool allocating to the subordinate internal reserved resource pool according to the hierarchy, the branch node public resource pool allocating to the superior public resource pool according to the hierarchy, the branch node internal reserved resource pool allocating to the superior internal reserved resource pool according to the hierarchy, and the public resource pool and the internal reserved resource pool between the same tree nodes allocating to each other; The occupation module, when receiving an externally input resource occupation application, obtains the applicant user, the applied resources and the applied occupation tree node of the resource occupation application, and determines whether the user reserved resources in the occupation tree node meet the applied resources. If the user reserved resources do not meet the applied resources, check whether the superior public resources meet the applied resources, wherein the user reserved resources are the resources reserved for the applicant user in the internal reserved resource pool, and the superior public resources are the resources in the public resource pool of the superior node of the occupation tree node.
8. A resource management device based on a tree structure, characterized in that: The tree-structure-based resource management device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the tree-structure-based resource management method according to any one of claims 1 to 6.
9. A medium, characterized in that The medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the tree-structured resource management method according to any one of claims 1 to 6 are implemented.
10. A product, characterized in that The product is a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the tree-structure-based resource management method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Resource scheduling method and device
CN113448726A
Resource statistical method and device based on resource tree permission, medium and electronic equipment
CN114691671A
Resource allocation tree
US20130055279A1