Resource allocation method, device, electronic device and storage medium

By determining the resource type according to the role type and flexibly allocate, the waste problem caused by the single resource allocation in the existing technology is solved, and the effective utilization and re-allocation of resources are achieved.

CN113626193BActive Publication Date: 2025-03-11GUAHAO (HANGZHOU) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110914114.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-10
Publication Date
2025-03-11
Estimated Expiration
2041-08-10

AI Technical Summary

Technical Problem

The existing Internet resource allocation method has single resource allocation in different role types, resulting in insufficient resource reservations for non-special roles and wasted special resources.

Method used

By receiving appointment requests from the target role, determine the available resource types according to the role type, reduce the remaining available resources of the corresponding type of resources, and mark them as shared resources at the time of the exclusive resource release, so as to achieve flexible allocation of resources.

Benefits of technology

It effectively avoids the remaining waste of reserved resources due to no reservation, realizes the re-allocation and full utilization of resources, and reduces resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626193B_ABST
    Figure CN113626193B_ABST
Patent Text Reader

Abstract

The present application provides a resource allocation method, device, electronic device and storage medium, the method comprising: receiving a reservation request of a target role; determining the available resource type of the target role according to the role type carried in the reservation request; the available resource type includes exclusive resources and shared resources; according to the available resource type of the target role, reducing the remaining available resources of the corresponding type of resources; when the resource release time of the exclusive resource is reached, marking the remaining available resources of the exclusive resource as shared resources. The present application realizes the flexible allocation of resources in the process of reserving resources for different role types, avoiding unnecessary waste caused by the reserved exclusive resources being left over but not released.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of the Internet, and more specifically, to a resource allocation method, device, electronic device and storage medium. Background Art

[0002] In the existing methods, in the process of resource allocation on the Internet, the resource allocation method for reservation requests from different types of roles is relatively simple: on the one hand, only a part of the resources are fully reserved for special roles, and only special roles are allowed to make reservations; on the other hand, the number of non-reserved resources is insufficient and the number of resources that non-special roles need to make reservations is large, and non-reserved resources are often "in short supply" for non-special roles. In the end, there are no resources available for non-special roles, and the reserved resources that have not been reserved are left unreserved until the end, and no role reservations are made, resulting in unnecessary waste of resources. Summary of the invention

[0003] The embodiment of the present application provides a resource allocation method, device, electronic device and storage medium, the purpose of which is to improve the resource allocation process. The embodiment of the present application realizes flexible allocation of resources in the process of reserving resources for different role types, avoiding unnecessary waste of reserved resources due to no reservation.

[0004] The first aspect of an embodiment of the present application provides a resource allocation method, including: receiving a reservation request of a target role; determining the available resource type of the target role according to the role type carried in the reservation request; the available resource types include exclusive resources and shared resources; according to the available resource type of the target role, reducing the remaining available resources of the corresponding type of resources; when the resource release time of the exclusive resources is reached, marking the remaining available resources of the exclusive resources as shared resources.

[0005] In one embodiment, before determining the available resource type of the target role according to the role type carried in the reservation request, the method further includes: dividing the total resources into shared resources and exclusive resources in response to the received configuration information.

[0006] In one embodiment, the available resource type of the target role is determined based on the role type carried in the reservation request, including: if the role type carried in the reservation request is an exclusive role, determining the available resource type of the target role is an exclusive resource; based on the available resource type of the target role, reducing the remaining available resources of the corresponding type of resources, including: if the available resource type of the target role is an exclusive resource, reducing the remaining available resources of the exclusive resource.

[0007] In one embodiment, the available resource type of the target role is determined based on the role type carried in the reservation request, including: if the role type carried in the reservation request is a shared role, determining the available resource type of the target role is a shared resource; based on the available resource type of the target role, reducing the remaining available resources of the corresponding type of resources, including: if the available resource type of the target role is a shared resource, reducing the remaining available resources of the shared resource.

[0008] In one embodiment, after marking the remaining available resources of the exclusive resources as shared resources, the method further includes: updating the remaining available resources of the shared resources.

[0009] In one embodiment, the remaining available resources of the corresponding type of resources are reduced according to the available resource type of the target role, including: determining the maximum reservable quantity configured corresponding to the role identifier according to the role identifier carried in the reservation request; calculating the remaining reservable quantity of the role identifier according to the reserved quantity and the maximum reservable quantity corresponding to the role identifier; and making resource reservations according to the remaining reservable quantity, the remaining available resources, and the reservation quantity carried in the reservation request, thereby reducing the remaining available resources and increasing the reserved quantity.

[0010] In one embodiment, resource reservation is performed based on the remaining available quantity, the remaining available resources and the reservation quantity carried by the reservation request, the remaining available resources are reduced and the reserved quantity is increased, including: if the remaining available quantity is zero, stopping resource reservation for the reservation request.

[0011] A second aspect of an embodiment of the present application provides a resource allocation device, including a receiving module, a judging module, an executing module and a marking module.

[0012] Among them, the receiving module is used to receive the reservation request of the target role; the judging module is used to determine the available resource type of the target role according to the role type carried in the reservation request; wherein the available resource types include exclusive resources and shared resources; the executing module is used to reduce the remaining available resources of the corresponding type of resources according to the available resource type of the target role; the marking module is used to mark the remaining available resources of the exclusive resources as shared resources when the resource release time of the exclusive resources is reached.

[0013] A third aspect of an embodiment of the present application provides an electronic device, comprising: a processor and a memory for storing processor executable instructions; wherein the processor is configured to execute the resource allocation method described in the first aspect of the embodiment of the present application and any embodiment thereof.

[0014] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to complete the resource allocation method described in the first aspect of the embodiments of the present application and any of its embodiments.

[0015] The resource allocation method, device, electronic device and storage medium provided in the present application realize resource reallocation by marking the remaining available resources of exclusive resources as shared resources and updating the remaining available resources of shared resources, thereby achieving effective division of roles and full utilization of resources and reducing unnecessary waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.

[0017] Figure 1 A schematic diagram of an application scenario of a resource allocation method provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0019] Figure 3 A schematic diagram of a process flow of a resource allocation method provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of a process flow of a resource allocation method provided in an embodiment of the present application;

[0021] Figure 5 A flowchart of sub-steps of step S430 provided in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of the structure of a resource allocation device provided in one embodiment of the present application.

[0023] Figure numerals: 100 - client; 110 - electronic device; 10 - memory; 11 - bus; 12 - processor; 200 - server; 300 - network; 500 - resource allocation device; 510 - receiving module; 520 - judgment module; 530 - execution module; 540 - marking module. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0025] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0026] Figure 1 Schematic diagram of an application scenario of the resource allocation method provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes a client 100 and a server 200, and the client 100 and the server 200 are connected via a network 300. The client 100 can be a personal computer, a tablet computer, a smart phone, etc. The server 200 can be a server or a server cluster. The client 100 or the server 200 can execute the resource allocation method provided in the embodiment of the present application.

[0027] Figure 2 This is a schematic diagram of the structure of an electronic device 110 provided in an embodiment of the present application. The electronic device 110 can be used as the server 200 or the client 100. Figure 2 , the electronic device 110 includes at least one processor 12 and a memory 10, Figure 2 A processor 12 is taken as an example. The processor 12 and the memory 10 are connected via a bus 11. The memory 10 stores instructions that can be executed by at least one processor 12. The instructions are executed by at least one processor 12 so that at least one processor 12 executes the resource allocation method in the following embodiment.

[0028] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 12 to complete the resource allocation method described in the following embodiment.

[0029] Figure 3 For a flow chart of a resource allocation method provided in an embodiment of the present application, please refer to Figure 3 , this method can be obtained by Figure 2 The electronic device 110 shown is executed to implement resource allocation. The resource allocation in this application involves various scenarios, such as ticket reservation, ticket reservation, medical platform registration, etc. The method includes the following steps:

[0030] S410: Receive a reservation request from a target role.

[0031] The target role refers to the role for which the resource reservation is made, and the role type of the target role may be a shared role or an exclusive role. In one embodiment, the reservation request may be sent by the client 100 to the server 200, and the server 200 receives the reservation request. The reservation request may include the role type of the target role.

[0032] In one embodiment, different role types may include different role identifiers, for example, role identifiers may be divided into common users, customer service roles, team leader roles, or manager roles. Among them, common users and customer service may belong to shared roles, and team leaders and managers may belong to exclusive roles.

[0033] In other embodiments of the present application, different role types may also be set with other role identifiers according to the needs of resource allocation, and are not limited to the role identifiers in this embodiment. The role types corresponding to different role identifiers may also be changed according to the needs of resource allocation.

[0034] S420: Determine the available resource type of the target role according to the role type carried in the reservation request.

[0035] Available resource types include exclusive resources and shared resources. In the above steps, if the role type carried in the reservation request is an exclusive role, the available resource type of the target role is determined to be an exclusive resource; if the role type carried in the reservation request is a shared role, the available resource type of the target role is determined to be a shared resource. Exclusive resources can be used by exclusive roles, and shared resources can be used by shared roles.

[0036] In one embodiment of the present application, there may be only one shared resource, and the role identifiers corresponding to the available resource type of the shared resource are customer service and ordinary users, and the customer and the ordinary user jointly reserve the quota included in the same shared resource.

[0037] In other embodiments of the present application, there may be multiple shared resources, and the role identifier corresponding to the available resource type being a shared resource may reserve places included in different shared resources respectively.

[0038] In one embodiment of the present application, two exclusive resources are provided, namely, a team leader exclusive resource and a manager exclusive resource. The role identifier corresponding to the team leader exclusive resource is the team leader, and the role identifier corresponding to the manager exclusive resource is the manager. The team leader and the manager respectively reserve the quota included in the corresponding exclusive resource.

[0039] In other embodiments of the present application, there may be one or more exclusive resources, and role identifiers corresponding to the available resource type of exclusive resources may jointly reserve places included in the same exclusive resource, or may separately reserve places included in different exclusive resources.

[0040] In one embodiment of the present application, before determining the available resource type of the target role according to the role type carried in the reservation request, a step is also included: in response to the received configuration information, the total resources are divided into shared resources and exclusive resources. This step can be performed before step S410, or after step S410, or simultaneously with step S410, and the purpose is to classify the total resources to facilitate the subsequent execution of corresponding instructions for reservation requests made for different role types and different role identifiers.

[0041] S430: According to the available resource type of the target role, reduce the remaining available resources of the corresponding type of resources.

[0042] Remaining available resources refer to the remaining exclusive or shared resource quotas obtained after the corresponding target role sends a reservation request and the reservation quantity carried in the reservation request is allocated to the target role according to the quota. If it has not been reserved, the remaining available resources are the total quota of the corresponding exclusive or shared resources; if it has been reserved, the remaining available resources are the remaining quota of the exclusive or shared resources obtained after the last reservation.

[0043] In the above steps, if the available resource type of the target role is an exclusive resource, the remaining available resources of the exclusive resource are reduced; if the available resource type of the target role is a shared resource, the remaining available resources of the shared resource are reduced; the amount of the remaining available resources reduced is equal to the reservation amount carried by the reservation request.

[0044] S440: When the resource release time of the exclusive resource is reached, the remaining available resources of the exclusive resource are marked as shared resources.

[0045] In the above steps, different exclusive resources are each set with a corresponding resource release time. When the resource release time of a certain exclusive resource is reached, the remaining available resources of the corresponding exclusive resource are marked as shared resources, and then reserved by the role type corresponding to the shared resource, so as to avoid waste caused by the remaining places in the exclusive resource after reservation being not reserved and used in the end.

[0046] In other embodiments of the present application, a certain exclusive resource may not be set with a resource release time according to resource allocation needs, so that the corresponding role identifier can always reserve the exclusive resource.

[0047] For example, in ticket booking, a part of the ticket quota is reserved as the exclusive resource in this application, and the ticket reservation deadline is set one hour before the vehicle departure, and the reserved part of the tickets is set with a reserved ticket release time. The reserved ticket release time is before the ticket reservation deadline. The ticket booking platform will release the remaining tickets that have been reserved but not booked to the sharing platform for everyone to grab tickets. The resource release time described in this application is the reserved ticket release time. Similarly, ticket reservations, medical platform registration, etc. can also be applied to any embodiment in this application.

[0048] Figure 4 For a flow chart of a resource allocation method provided in an embodiment of the present application, please refer to Figure 4 When the resource release time of the exclusive resource is reached, after marking the remaining available resources of the exclusive resource as the shared resource, the method further includes step S450: updating the remaining available resources of the shared resource.

[0049] In the above steps, after marking the remaining available resources of the exclusive resources as shared resources, the total number of shared resources and the remaining available resources will increase accordingly, so they need to be updated accordingly. At the same time, in step S440 of the embodiment of the present application, because different exclusive resources correspond to different role identifiers, in this step, it is necessary to change the exclusive role corresponding to the role identifier and mark it as a shared role, and change the corresponding available resource type from an exclusive resource and mark it as a shared resource, so that the client 100 where the role identifier is located can continue to reserve a quota from the available resources of the corresponding type.

[0050] Figure 5 For a flowchart of the sub-steps of step S430 provided in an embodiment of the present application, please refer to Figure 5 , according to the available resource type of the target role, reduce the remaining available resources of the corresponding type of resources. This step includes the following sub-steps:

[0051] S431: Determine the maximum available quantity of the configuration corresponding to the role identifier according to the reservation request.

[0052] The role identifier can be an identifier corresponding to the role, such as 110, 118, 130, 140, etc., or a role name, such as a common user, a customer service role, a team leader role, or a manager role. The maximum available quantity corresponding to different role identifier configurations. The maximum available quantity refers to the maximum number of reservations that can be made for the role.

[0053] In the above steps, during the resource allocation process, different role identifiers are configured with their own maximum available quantities. Similarly, the available resource types corresponding to different role identifiers will also be configured with a certain number of quotas when the total resources are divided. After receiving reservation requests from different role identifiers, the remaining available resources of the corresponding available resources are reduced while the resources are allocated. If the reservation has not started, the remaining available resources are the number of quotas configured when the total resources are divided. When the client 100 where the role is located has not started the reservation, please refer to the following table for details.

[0054]

[0055] S432: Calculate the remaining available quantity of the role identifier according to the reserved quantity corresponding to the role identifier and the maximum available quantity.

[0056] The number of reservations made refers to the value obtained by accumulating and summing the number of reservations carried in each reservation request from the time when the corresponding role ID has not made a reservation in the beginning until the last reservation request is made.

[0057] The remaining available quantity refers to the value obtained by subtracting the reserved quantity of the role from the maximum available quantity configured by the corresponding role identifier until the most recent reservation request is issued.

[0058] In the above steps, different role IDs are configured with their corresponding maximum available quantities. During the resource allocation process, the reservation quantities carried in each reservation request are automatically counted and summed, and the sum value is the reserved quantity of the role ID. Based on the reserved quantity, the remaining available resources of the available resource type corresponding to the role ID are calculated, and the remaining available quantity corresponding to the role ID is calculated based on the maximum available quantity.

[0059] S433: Make resource reservations according to the remaining available quantity, the remaining available resources, and the reservation quantity carried in the reservation request, reduce the remaining available resources, and increase the reserved quantity.

[0060] In one embodiment of the present application, when the client 100 of each role starts to reserve resources, see the following table for details:

[0061]

[0062] S434: If the remaining available quantity is zero, stop reserving resources for the reservation request.

[0063] In the above steps, while responding to the reservation request of the role identifier, the remaining available quantity corresponding to the role identifier and the remaining available resources of the corresponding available resource type must also be automatically confirmed. If either the remaining available quantity or the remaining available resources is zero, the reservation request cannot be responded to, and the role identifier stops making reservations; if either the remaining available quantity or the remaining available resources is less than the reservation quantity carried in the reservation request, the reservation request needs to be made a second time, and at this time, a prompt of insufficient quantity is issued to the client 100, and the client can choose to reduce the reservation quantity or give up the reservation; if both the remaining available quantity and the remaining available resources are greater than or equal to the reservation quantity carried in the reservation request, the reservation request proceeds normally, and the remaining available resources are reduced according to the reservation quantity, and the reserved quantity is increased.

[0064] In one embodiment of the present application, if the role identifier carried in the reservation request is the team leader, and the corresponding available resource type is the corresponding team leader exclusive resource, then before the reservation starts, the remaining available quota of the team leader exclusive resource is the quota configured when the total resources are initially divided. After the reservation starts, in response to the received reservation request, the remaining available resources of the team leader exclusive resource will be reduced accordingly, and the amount of reduction will be equal to the reservation amount carried in the reservation request; the corresponding reserved amount will be increased, and the amount of increase will be equal to the reservation amount carried in the reservation request. At the same time, the remaining available quantity of the team leader is calculated based on the reserved quantity of the team leader and the maximum available quantity of the team leader.

[0065] Among them, if either the remaining amount of the team leader's reservable quantity or the remaining available resources of the team leader's exclusive resources is zero, the reservation request cannot be responded to; if either the remaining amount of the team leader's reservable quantity or the remaining available resources of the team leader's exclusive resources is less than the reservation quantity carried in the team leader's reservation request, the reservation request needs to be booked for the second time. At this time, a reminder of insufficient amount will be issued to the team leader, and the team leader can choose to reduce the reservation quantity or give up the reservation; if both the remaining amount of the team leader's reservable quantity or the remaining available resources of the team leader's exclusive resources are greater than or equal to the reservation quantity carried in the team leader's reservation request, the reservation request will proceed normally, and the remaining available resources will be reduced accordingly according to the reservation quantity, and the reserved quantity will be increased.

[0066] In other embodiments of the present application, the reservation and resource allocation steps for other role identifiers such as manager, ordinary user, customer service, etc. are the same as those in the above embodiments and will not be repeated here.

[0067] In an embodiment of the present application, when marking the remaining available resources of the exclusive resources as shared resources and updating the remaining available resources of the shared resources, the following steps are also included:

[0068] When the remaining available resources of the exclusive resource are marked as the shared resource and the remaining available resources of the shared resource are updated, the exclusive role corresponding to the role identifier is also changed to a shared role, and the role identifier corresponding to the shared resource is increased. The maximum reducible number configured by the role identifier corresponding to the shared resource remains unchanged.

[0069] In other embodiments of the present application, the maximum reducible number configured for the role identifier corresponding to the shared resource may also be increased.

[0070] In one embodiment of the present application, if the role identifier is a team leader, and the corresponding team leader exclusive resources reach the resource release time, the remaining available resources of the team leader exclusive resources are marked as shared resources. At this time, the role identifiers corresponding to the shared resources are ordinary users, customer service and team leaders, and all three can reserve places from the shared resources. For details, see the following table.

[0071] In other embodiments of the present application, if the resource release time of the exclusive resources corresponding to the manager is reached, the specific steps are similar to the above content, please refer to the above description.

[0072]

[0073] After marking the remaining available resources of the exclusive resources as shared resources and updating the remaining available resources of the shared resources, the client 100 where the character is located continues to make normal reservations. The specific steps are basically similar to the features of steps S431-S434 of this application. Please refer to the above description and will not be repeated here.

[0074] Figure 6For a schematic diagram of the structure of a resource allocation device 500 provided in an embodiment of the present application, please refer to Figure 6 The present application provides a resource allocation device 500, including a receiving module 510, a judging module 520, an executing module 530 and a marking module 540.

[0075] The receiving module 510 is used to receive a reservation request of a target role.

[0076] The determination module 520 is used to determine the available resource type of the target role according to the role type carried in the reservation request, wherein the available resource type includes exclusive resources and shared resources.

[0077] The execution module 530 is used to reduce the remaining available resources of the corresponding type of resources according to the available resource type of the target role.

[0078] The marking module 540 is used to mark the remaining available resources of the exclusive resources as shared resources when the resource release time of the exclusive resources is reached.

[0079] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned resource allocation method, which will not be repeated here.

[0080] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0081] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0082] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory 10 (ROM, Read-Only Memory), random access memory 10 (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

Claims

1. A resource allocation method, characterized in that: include: Receive appointment requests from target roles; Determining the available resource type of the target role according to the role type carried in the reservation request; The available resource types include exclusive resources and shared resources, and each role type includes at least one role identifier; According to the available resource type of the target role, reducing the remaining available resources of the corresponding type of resources; There are multiple exclusive resources. When the resource release time of the exclusive resource that can be released is reached, the remaining available resources of the exclusive resource that can be released are marked as the shared resource, the exclusive role corresponding to the role identifier is also changed to a shared role, and the remaining available resources of the shared resource are updated, so that the number of the role identifiers corresponding to the latest shared resource increases; the maximum number of reconcilables configured for each role identifier corresponding to the latest shared resource increases; the resource release time is not set for the exclusive resource that cannot be released, so that the role identifier corresponding to it can always reserve the exclusive resource; The reducing the remaining available resources of the corresponding type of resources according to the available resource type of the target role includes: determining the maximum available quantity configured corresponding to the role identifier according to the role identifier carried in the reservation request; calculating the remaining available quantity of the role identifier according to the reserved quantity and the maximum available quantity corresponding to the role identifier; if the remaining available quantity or the remaining available resources is zero, stopping the resource reservation for the reservation request; if the remaining available quantity or the remaining available resources is less than the reservation quantity carried in the reservation request, issuing a prompt of insufficient amount; if the remaining available quantity or the remaining available resources is greater than or equal to the reservation quantity carried in the reservation request at the same time, reducing the remaining available resources according to the reservation quantity and increasing the reserved quantity; Before determining the available resource type of the target role according to the role type carried in the reservation request, the method further includes: dividing the total resources into shared resources and exclusive resources in response to the received configuration information.

2. The method according to claim 1, characterized in that The determining the available resource type of the target role according to the role type carried in the reservation request includes: if the role type carried in the reservation request is an exclusive role, determining the available resource type of the target role is an exclusive resource; According to the available resource type of the target role, the remaining available resources of the corresponding type of resources are reduced, including: if the available resource type of the target role is an exclusive resource, reducing the remaining available resources of the exclusive resource.

3. The method according to claim 1, characterized in that The determining the available resource type of the target role according to the role type carried in the reservation request includes: if the role type carried in the reservation request is a shared role, determining the available resource type of the target role is a shared resource; According to the available resource type of the target role, the remaining available resources of the corresponding type of resources are reduced, including: if the available resource type of the target role is a shared resource, reducing the remaining available resources of the shared resource.

4. A resource allocation device, characterized in that: include: A receiving module, used for receiving a reservation request from a target role; A judgment module, used to determine the available resource type of the target role according to the role type carried in the reservation request; the available resource type includes exclusive resources and shared resources, and each role type includes at least one role identifier; An execution module is used to reduce the remaining available resources of the corresponding type of resources according to the available resource type of the target role, and the execution module is also used to: Determine, according to the role identifier carried in the reservation request, the maximum available quantity of the configuration corresponding to the role identifier; Calculate the remaining available quantity for the role identifier according to the reserved quantity corresponding to the role identifier and the maximum available quantity; If the remaining available quantity or the remaining available resources is zero, stop reserving resources for the reservation request; if the remaining available quantity or the remaining available resources is less than the reservation quantity carried in the reservation request, issue a reminder of insufficient quantity; If both the remaining available quantity and the remaining available resources are greater than or equal to the reservation quantity carried in the reservation request, the remaining available resources are reduced according to the reservation quantity and the reserved quantity is increased; A marking module is used to mark the remaining available resources of the releasable exclusive resources as the shared resources when the resource release time of the releasable exclusive resources is reached, and the exclusive role corresponding to the role identifier is also changed to a shared role; update the remaining available resources of the shared resources so that the number of the role identifiers corresponding to the latest shared resources increases, and the maximum number of reconcilables configured for each role identifier corresponding to the latest shared resource increases; there are multiple exclusive resources; the resource release time is not set for the exclusive resources that cannot be released, so that the corresponding role identifier can always reserve the exclusive resources; Before determining the available resource type of the target role according to the role type carried in the reservation request, the judgment module is further used to: divide the total resources into shared resources and exclusive resources in response to the received configuration information.

5. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to execute the resource allocation method described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the resource allocation method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Cloud platform resource management method, device and system

    CN106712998A