Resource management method and related device
By receiving resource allocation requests in the message queue system, obtaining load information, determining candidate message queue instances and target storage space, and configuring storage space according to the specified time, the problem of low resource utilization in the message queue system is solved, and more efficient resource management and utilization is achieved.
Patent Information
- Application Number
- CN202311248862.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, the resource utilization rate of the message queue system is low, resulting in waste of storage space and idle resources.
By receiving resource allocation requests, obtaining message queue instances and their load information, determining candidate message queue instances and target storage space, and configuring the target storage space according to the specified time.
It achieves more precisely meeting users' needs for use of storage space, avoiding waste of storage space and idle resources, and improving resource utilization.
Smart Images

Figure CN119690634A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of message queues, and in particular to a resource management method and related devices. Background Art
[0002] A message queue system is a software system that provides message storage, delivery, and processing functions. It can be composed of multiple message queue instances, each of which is an independent running entity and provides the infrastructure for message processing. Since each message queue instance requires a certain amount of memory, disk space, and computing resources to process messages, the more message queue instances there are, the more resources the message queue system will occupy.
[0003] Currently, a script is used to manage the message queue instances in the message queue system, for example, the instances can be managed through a command line. However, this script-based management of the message queue instances in the message queue system will result in low resource utilization in the message queue system. Summary of the invention
[0004] The embodiments of the present application provide a resource management method and related devices, which solve the problem of low resource utilization of the message queue system in the prior art.
[0005] One aspect of the present application provides a resource management method, comprising:
[0006] receiving a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for using a storage space, and the specified time information is used to represent a time for using the storage space;
[0007] Obtain N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, and the load information is used to characterize the usage of the message queue instance, and both N and M are integers greater than or equal to 1;
[0008] According to the N load information, K candidate message queue instances are determined from the N message queue instances, wherein the load information corresponding to each candidate message queue instance in the K candidate message queue instances is less than or equal to the load threshold, and K is an integer greater than or equal to 1 and less than N;
[0009] Determine a target storage space from K×M storage spaces corresponding to the K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes the specified time information;
[0010] Configure the target storage space according to the specified time.
[0011] Another aspect of the present application provides a resource management device, including: a resource allocation request receiving module, a message queue instance and load information acquisition module, a candidate message queue instance determination module, a target storage space determination module and a storage space configuration module; specifically:
[0012] A resource allocation request receiving module, used to receive a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for use of a storage space, and the specified time information is used to represent a time for using the storage space;
[0013] A message queue instance and load information acquisition module, used to acquire N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, and the load information is used to characterize the usage of the message queue instance, and N and M are both integers greater than or equal to 1;
[0014] A candidate message queue instance determination module is used to determine K candidate message queue instances from N message queue instances according to N load information, wherein the load information corresponding to each candidate message queue instance in the K candidate message queue instances is less than or equal to the load threshold, and K is an integer greater than or equal to 1 and less than N;
[0015] A target storage space determination module is used to determine a target storage space from K×M storage spaces corresponding to K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes designated time information;
[0016] The storage space configuration module is used to configure the target storage space according to the specified time.
[0017] In another implementation of the embodiment of the present application, the target storage space determination module is further configured to:
[0018] Obtain K×M idle time information corresponding to K×M storage spaces corresponding to K candidate message queue instances;
[0019] Determine L candidate storage spaces from the K×M storage spaces according to the designated time information and the K×M idle time information, wherein the L idle time information corresponding to the L candidate storage spaces all include the designated time information, and L is an integer greater than or equal to 1;
[0020] The target storage space is determined based on the P load information of the P candidate message queue instances corresponding to the L candidate storage spaces, wherein the load information of the candidate message queue instance to which the target storage space belongs is the minimum value of the P load information, and P is an integer greater than or equal to 1 and less than or equal to K.
[0021] In another implementation of the embodiment of the present application, the target storage space determination module is further configured to:
[0022] Determine P candidate message queue instances corresponding to the L candidate storage spaces;
[0023] Determine a target candidate message queue according to P load information corresponding to the P candidate message queue instances, wherein the load information of the target candidate message queue is the minimum value of the P load information;
[0024] A target storage space is determined from the target candidate information queue.
[0025] In another implementation of the embodiment of the present application, the resource allocation request further carries object identification information and demand tag information, wherein the object identification information is identification information of the target object for sending the resource allocation request, and the demand tag information is used to characterize the usage information of the target object for the storage space;
[0026] The storage space configuration module is also used to:
[0027] Name the target storage space according to the required tag information;
[0028] The target storage space is configured according to the object identification information and the specified time, and a configuration data table is generated.
[0029] In another implementation of the embodiment of the present application, the resource management device further includes: a configuration clearing module; specifically, the configuration clearing module is used to:
[0030] Get the usage status of the target storage space within the specified time;
[0031] If the target storage space is in an idle state within the specified time, the configuration of the target storage space is cleared.
[0032] In another implementation of the embodiment of the present application, the clearing module is configured to:
[0033] receiving a resource clearing request, wherein the resource clearing request is used to instruct to clear the configuration of the target storage space;
[0034] Clear the configuration of the target storage space according to the resource clearing request.
[0035] In another implementation of the embodiment of the present application, the clearing module is configured to:
[0036] Back up the storage information of the target storage space;
[0037] After the information is backed up, clear the configuration of the target storage space and delete the storage information of the target storage space.
[0038] In another implementation of the embodiment of the present application, the clearing module is configured to:
[0039] Statistics are collected on usage of N×M storage spaces in N message queue instances to determine H named storage spaces, where the named storage spaces are used to represent storage spaces with time configuration information.
[0040] Obtaining H configuration data tables corresponding to the H named storage spaces, wherein each of the H configuration data tables includes a specified time for the named storage space to store information;
[0041] At every preset time period, H named storage spaces are screened to obtain G named storage spaces to be cleared, wherein the named storage spaces to be cleared are used to represent named storage spaces that have not stored information within a specified time, and G is an integer less than or equal to H;
[0042] Clear the configuration of the G named storage spaces to be cleared.
[0043] In another implementation of the embodiment of the present application, the clearing module is configured to:
[0044] Get H specified times corresponding to H named storage spaces;
[0045] Every preset time period, within H specified time periods, obtain the usage status of H named storage spaces;
[0046] The named storage spaces whose usage status of the named storage spaces is idle within the specified time are taken as the named storage spaces to be cleared, and G named storage spaces to be cleared are obtained.
[0047] In another implementation of the embodiment of the present application, the resource management device further includes: a message queue instance adding module; specifically, the message queue instance adding module is used to:
[0048] Receive a request for adding a new message queue instance, wherein the request for adding a new message queue instance carries identification information of the newly added message queue instance;
[0049] Obtain a message queue instance data table, wherein the message queue instance data table is used to store identification information of the current message queue instance;
[0050] According to the identification information of the newly added message queue instance and the message queue instance data table, determining that the identification information of the newly added message queue instance is not included in the message queue instance data table;
[0051] The identification information of the newly added message queue instance is stored in the message queue instance data table.
[0052] In another implementation of the embodiment of the present application, a new module is added to the message queue instance, and is also used for:
[0053] Availability verification is performed on the newly added message queue instance. If the newly added message queue instance passes the availability verification, identification information of the newly added message queue instance is stored in the message queue instance data table.
[0054] Another aspect of the present application provides a computer device, comprising:
[0055] memories, transceivers, processors, and bus systems;
[0056] Wherein, the memory is used to store programs;
[0057] The processor is used to execute the program in the memory, including executing the above-mentioned methods;
[0058] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
[0059] Another aspect of the present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the above-mentioned methods.
[0060] Another aspect of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided by the above aspects.
[0061] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0062] The present application provides a resource management method and a related device, the method comprising: first, receiving a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for use of a storage space, and the specified time information is used to represent the time of using the storage space; second, obtaining N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, the load information is used to represent the use of the message queue instance, and N and M are both integers greater than or equal to 1; then, according to the N load information, determining K candidate message queue instances from the N message queue instances, wherein the load information corresponding to each of the K candidate message queue instances is less than or equal to a load threshold, and K is an integer greater than or equal to 1 and less than N; then, determining a target storage space from the K×M storage spaces corresponding to the K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes the specified time information; finally, configuring the target storage space according to the specified time. The method provided in the embodiment of the present application configures the storage space according to the specified time information, which can more accurately meet the user's demand for storage space usage, and realize the allocation of storage space to the user on demand, thereby avoiding the waste of storage space; by determining the target storage space from the storage space corresponding to the candidate message queue instance, and configuring the target storage space according to the specified time, the storage space can be allocated and managed more flexibly, avoiding idleness and waste of storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A schematic diagram of the architecture of a resource management system provided in a certain embodiment of the present application;
[0064] Figure 2 An architectural diagram of a message queue system provided for one embodiment of the present application;
[0065] Figure 3 A schematic diagram of the interaction between the management console and the management system provided in a certain embodiment of the present application;
[0066] Figure 4 A flowchart of a resource management method provided in an embodiment of the present application;
[0067] Figure 5 A flowchart of a resource management method provided by another embodiment of the present application;
[0068] Figure 6 A flowchart of a resource management method provided by another embodiment of the present application;
[0069] Figure 7 A flowchart of a resource management method provided by another embodiment of the present application;
[0070] Figure 8 A schematic diagram of message queue resource allocation provided in a certain embodiment of the present application;
[0071] Fig. 9 A flowchart of a resource management method provided by another embodiment of the present application;
[0072] Fig.10 A flowchart of a resource management method provided by another embodiment of the present application;
[0073] Fig.11 A schematic diagram of a user manually triggering resource recycling provided in an embodiment of the present application;
[0074] Fig.12 A flowchart of a resource management method provided by another embodiment of the present application;
[0075] Fig.13 A flowchart of a resource management method provided by another embodiment of the present application;
[0076] Fig.14 A schematic diagram of message queue resource recycling provided in an embodiment of the present application;
[0077] Fig.15 A flowchart of a resource management method provided by another embodiment of the present application;
[0078] Fig.16 A flowchart of a resource management method provided in another embodiment of the present application;
[0079] Fig.17 A schematic diagram of importing a new instance of a message queue provided in an embodiment of the present application;
[0080] Fig.18 A schematic diagram of the structure of a resource management device provided in one embodiment of the present application;
[0081] Fig.19 A schematic diagram of the structure of a resource management device provided in another embodiment of the present application;
[0082] Fig. 20 A schematic diagram of the structure of a resource management device provided in another embodiment of the present application;
[0083] Fig.21 A schematic diagram of a server structure provided for a certain embodiment of the present application. DETAILED DESCRIPTION
[0084] An embodiment of the present application provides a resource management method, which configures storage space according to specified time information, can more accurately meet the user's demand for storage space usage, allocate storage space to users on demand, and thus avoid waste of storage space; by determining the target storage space from the storage space corresponding to the candidate message queue instance and configuring the target storage space according to the specified time, the storage space can be allocated and managed more flexibly, avoiding idleness and waste of storage space.
[0085] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0086] First, a brief introduction to the technologies involved in the embodiments of this application is given:
[0087] 1) Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0088] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0089] 2) Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0090] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0091] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0092] Next, to facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:
[0093] 1) Message queue system: It is an application architecture pattern used to implement the sending and receiving of messages in a distributed system. It usually consists of a message sender, a message queue, and one or more message receivers. The message sender sends the message to the message queue, which stores the message and passes it to one or more message receivers. The message receiver obtains the message from the message queue and processes it.
[0094] 2) Message queue instance: refers to a running message queue service. It is a specific implementation of the message queue system, providing message storage, delivery and processing functions. Message queue instances usually consist of a group of processes or threads, which are responsible for receiving messages, storing messages, delivering messages to recipients, and processing message-related operations. Message queue instances usually run on independent servers and provide certain reliability, availability and scalability guarantees.
[0095] Message queue instances can be configured and managed in a variety of ways, such as setting the location of message storage, the method of message delivery, and the strategy of message processing. In addition, message queue instances also provide some management interfaces and tools for obtaining and managing the operation status of message queues. Message queue instances are the core components of message queue systems. They provide the infrastructure for message processing, allowing senders and receivers of messages to communicate and collaborate in different systems, platforms, and network environments.
[0096] 3) Resource pool: refers to the logical container that stores and manages message queue instance resources, realizing resource allocation and recycling based on demand; resource pool is also a collection of shared resources, such as computing resources, storage resources, etc. In the message queue system, the resource pool can include message storage, computing resources, etc.
[0097] 4) Resources: In most scenarios, resources used in the embodiments of this application are used to describe a namespace of an instance in a resource pool. For users, each "resource" is independent of each other, and messages will not affect each other;
[0098] 5) Namespace: refers to the storage space used to identify resources and objects in the message queue system. Each tenant has its own namespace, which contains the message queue instance, channel, queue and other resources and objects used by the tenant. The namespace provides an independent identification space for a functional module in the message queue instance, which is used to isolate message queue messages in different logical spaces.
[0099] 6) The relationship between the message queue system, message queue instance, resource pool and tenant is as follows:
[0100] The message queue system contains multiple message queue instances, each of which is an independent running entity and provides the infrastructure for message processing.
[0101] Message queue instances run in a resource pool and share computing and storage resources in the resource pool.
[0102] Each tenant has its own namespace in the message queue system, which contains the message queue instances, channels, queues and other resources and objects used by the tenant.
[0103] Tenants can manage and use their own message queue instances and resources through their own namespaces, while also being managed and controlled by the message queue system.
[0104] 7) Requirement tag: refers to the custom tag string that users need to enter when requesting message queue resources, which describes the actual resource requirements so that the management system can allocate appropriate resources.
[0105] Currently, the most common way to manage message queue instances in a message queue system is to use scripts. For example, instances can be managed through command lines: For example, RabbitMQ provides the rabbitmq-ctl command line tool, which can be used to create, start, stop, and obtain instances.
[0106] However, this method of managing message queue instances in the message queue system using scripts will result in low resource utilization in the message queue system, mainly including:
[0107] 1. Memory usage: When a script is running, it needs to occupy a certain amount of memory space. If the script runs for a long time or there are a large number of scripts running, the system memory usage will increase, affecting the system performance.
[0108] 2. CPU usage: When the script is running, it needs to occupy a certain amount of CPU resources. If the script runs for a long time or there are a large number of scripts running, the system CPU usage will increase, affecting the system performance.
[0109] 3. Network bandwidth: If the script needs to interact with the message queue system frequently, it will occupy more network bandwidth, thus affecting the overall performance of the system.
[0110] 4. Disk space: If the script needs to persist messages to disk, it will take up a certain amount of disk space. If the disk space usage is too high, it will affect the performance of the system.
[0111] 5. System resource competition: If multiple scripts run at the same time, it may cause system resource competition, thus affecting system performance.
[0112] The embodiment of the present application provides a resource management method, which maintains idle message queue resources by purchasing and using storage space in batches, realizes user-demand allocation and dynamic management, and improves the utilization rate of storage space. When a message queue is not used for a period of time, the system will automatically recycle resources and clear unconsumed messages, thereby optimizing resource allocation and realizing efficient, scalable, and easy-to-manage message queue resource management. Specifically:
[0113] The present application provides a resource management method and related devices, the method comprising: first, receiving a resource allocation request carrying specified time information; second, obtaining N message queue instances and N load information corresponding to the N message queue instances; then, according to the N load information, determining K candidate message queue instances whose load information is less than or equal to a load threshold from the N message queue instances; then, determining a target storage space whose idle time information includes the specified time information from K×M storage spaces corresponding to the K candidate message queue instances; finally, configuring the target storage space according to the specified time.
[0114] The method provided in the embodiment of the present application configures the storage space according to the specified time information, which can more accurately meet the user's demand for storage space usage, and realize the allocation of storage space to the user on demand, thereby avoiding the waste of storage space; by determining the target storage space from the storage space corresponding to the candidate message queue instance, and configuring the target storage space according to the specified time, the storage space can be allocated and managed more flexibly, avoiding idleness and waste of storage space.
[0115] For easier understanding, see Figure 1 , Figure 1 FIG. 1 is an application environment diagram of the resource management method in the embodiment of the present application, such as Figure 1 As shown, the resource management method in the embodiment of the present application is applied to the resource management system. The resource management system includes: a server and a terminal device; wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application.
[0116] First, the server receives a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for use of a storage space, and the specified time information is used to represent the time for using the storage space; secondly, the server obtains N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, the load information is used to represent the use of the message queue instance, and N and M are both integers greater than or equal to 1; then, the server determines K candidate message queue instances from the N message queue instances based on the N load information, wherein the load information corresponding to each of the K candidate message queue instances is less than or equal to a load threshold, and K is an integer greater than or equal to 1 and less than N; then, the server determines a target storage space from the K×M storage spaces corresponding to the K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes the specified time information; finally, the server configures the target storage space according to the specified time.
[0117] In order to better understand the resource management method for the message queue system provided in the embodiment of the present application, the message queue system is briefly introduced first:
[0118] The message queue system mainly consists of three parts: tenant management module, resource pool management module and message queue resource management module.
[0119] 1) The tenant management module includes three main sub-modules: tenant registration sub-module, tenant modification sub-module and tenant query sub-module. Specifically:
[0120] The tenant registration submodule is used by users to register tenants. Users can register tenants through the tenant registration submodule in the tenant management module in the message queue system and fill in the necessary registration information, including but not limited to user name, email address, contact information, etc. After the user successfully registers the tenant, an independent resource pool will be allocated to the new tenant. There is no message queue instance in the resource pool, and the user needs to import an idle message queue instance.
[0121] The tenant modification submodule is used by users to modify tenant information. Users can modify registered tenant information, update personal information or team information such as contact information and email, and maintain the accuracy of the information. After the modification is completed, the message queue system will automatically update the tenant information in the resource pool.
[0122] The tenant query submodule is used by administrators to query information. Administrators can query the information of all registered tenants to allocate and manage resource pools.
[0123] It is understandable that the administrator is the administrator of the message queue system and is responsible for managing the operation and maintenance of the entire system. The administrator can create, modify, and delete tenants and allocate a certain amount of message queue resources to each tenant.
[0124] Users are individuals who use the message queue system. They can register to become users of the system. Users can log in to the system, create, modify and delete their own message queues, and use the various functions provided by the system to send and receive messages.
[0125] A tenant is a collection of resources that an administrator allocates to a user. Each tenant has an independent resource pool that contains a certain number of message queue resources. Tenants can create, modify, and query resource pools through the management system, and allocate message queue resources to them.
[0126] Therefore, the relationship between administrators, users, and tenants is interrelated. Administrators are responsible for managing the operation and maintenance of the system and allocating resources to users; users use the resources allocated to them to send and receive messages; tenants are the entities to which administrators allocate resources.
[0127] 2) The resource pool management module includes two main sub-modules: the resource pool creation sub-module and the message queue new instance import sub-module.
[0128] The resource pool creation submodule is used to create and allocate storage space in the resource pool. Users can create storage space through the resource pool creation submodule and dynamically allocate storage space in the corresponding message queue. The initial number of resources can be set when creating storage space, and it can be dynamically expanded or contracted according to actual needs.
[0129] The message queue new instance import submodule is used to import new message queue instances. Users can use the message queue new instance import submodule to import the purchased batch message queue new instances into the specified resource pool. The resource pool to which the resources belong and the initial namespace need to be specified.
[0130] It can be understood that the resource pool creation submodule and the message queue new instance import submodule work together to achieve the management and control of the resource pool and the message queue instance. Through the resource pool creation submodule, users can create and manage their own resource pools and dynamically expand or shrink them as needed. Through the message queue new instance import submodule, users can easily import new message queue instances into the specified resource pool and manage and control them.
[0131] 3) The message queue resource management module includes three main submodules: a message queue resource allocation submodule, a message queue resource recovery submodule and a message queue resource acquisition submodule. It should be noted that the resource management method proposed in this application is mainly aimed at the implementation process of the message queue resource management module.
[0132] Message queue resource allocation submodule: Users enter demand tags according to their needs and specify the allowed resource idle time, and obtain message queue resources by using the management system. The system returns resource configuration information, including but not limited to the message queue tenant ID, message queue namespace, message queue producer configuration information, and message queue consumer configuration information. Users can directly use the returned configuration information for message production and consumption. The message queue namespace is consistent with the demand tag entered by the user. For different message queue types, the message queue namespace is created in different ways, and there is no restriction on the creation method. It should be noted that tenants are not associated with users, but only to distinguish the message queue resources of different tenants.
[0133] Message queue resource recycling submodule: The management system regularly checks the usage of message queue resources. When the resource is not used for a period of time that exceeds the allowed resource idle time, the system automatically recycles the resource and clears the unconsumed messages in the current namespace. Users can also manually recycle message queue resources through the management system. Resource recycling refers to deleting the namespace of the message queue. When deleting a namespace, the messages and topics in the namespace need to be cleared. In addition to automatic recycling, users can also manually recycle message queue namespace resources through the management system.
[0134] Message queue resource acquisition submodule: Users can view the usage of the resource pool to which the current tenant belongs through the management system, including but not limited to the accumulated messages, the number of messages sent, the amount of messages consumed, the delay in message consumption, etc. By obtaining resource usage in real time, users can manage and adjust the configuration of the resource pool more effectively.
[0135] For easier understanding, see Figure 2 , Figure 2 This is an architecture diagram of the message queue system provided in the embodiment of the present application. Assume that there are three tenants: tenant A, tenant B and tenant C, where tenant A has a corresponding relationship with resource pool 1 and resource pool 2, tenant B has a corresponding relationship with resource pool 3, and tenant C has a corresponding relationship with resource pool 4; the corresponding relationship means that tenants can create, configure and manage their own storage space and other resources in the resource pool to meet their specific business needs.
[0136] The message queue system is implemented through the management console and the management system. The management console refers to the front-end platform of the message queue system, and the management system refers to the back-end service of the message queue system. Figure 3 , Figure 3 It is a schematic diagram of the interaction between the management console and the management system provided in an embodiment of the present application.
[0137] The management console mainly implements the user interface and API calls.
[0138] 1) The user interface includes: tenant management operation interface, resource pool management operation interface and resource acquisition interface;
[0139] Tenant management operation interface: includes functions such as registration, modification, query, and deletion. Form validation is used to ensure the legitimacy of input data. When users make modifications and inquiries, they are only allowed to query tenants whose responsible persons are themselves. When users delete, they are only allowed to delete tenants whose responsible persons are themselves.
[0140] Resource pool management operation interface: users can create resource pools, import purchased message queues into resource pools, set relevant policies and set responsible persons; when managing resource pools, only relevant responsible persons are allowed to manage them; when users delete resource pools, in order to prevent misoperation, they need to delete all message queues in the resource pool before deleting the resource pool.
[0141] Resource acquisition interface: Use charts and tables to display relevant statistics and alarm information of tenants and resource pools; users can subscribe to relevant alarm information and select notification methods on this interface. When abnormal situations occur, users will be notified by means including but not limited to phone calls, SMS, emails, etc.;
[0142] 2) API call: The front end interacts with data by calling the RESTful API provided by the back end, including submitting form data, obtaining resource configuration information, etc.; JSON format can be used for data transmission and parsing; during transmission, the request body is authenticated through the token in the HEADER.
[0143] The management system adopts a layered architecture, including a control layer (Controller) and a service layer (Service), to achieve good modularity and decoupling; the layered architecture can make the system more modular, easier to maintain, expand and optimize, and improve development efficiency and system stability.
[0144] 1) Control layer: Receives requests from the front end; verifies request parameters to ensure that they conform to the expected format and range, prevents illegal requests and improves system security; pre-processes data and hands it over to the service layer for business processing; receives the results processed by the service layer, encapsulates and formats the results, converts the data into JSON format, and finally returns it to the front end.
[0145] 2) Service layer: handles specific business logic, such as resource allocation and recycling, resource acquisition and data acquisition, and calls the data access layer for data access; performs permission checks on user-initiated requests to ensure the security and stability of the system; the management system can obtain the load status of each message queue instance through the cloud service provider's API, select resource instances with lower resource loads and open one or more namespaces for their use. The collection of one or more namespaces is called a "resource pool".
[0146] The following is an introduction to the resource management method in this application from the perspective of the service layer in the management system. Figure 4 The resource management method provided in the embodiment of the present application includes: step S110 to step S150.
[0147] Specific:
[0148] S110: Receive a resource allocation request.
[0149] The resource allocation request carries the specified time information, the resource allocation request is used to represent the request for using the storage space, and the specified time information is used to represent the time for using the storage space.
[0150] It is understandable that the user initiates a resource allocation request through the management station (the front end of the message queue system), and the management station calls the management system (the back end of the message queue system) API to send the resource allocation request to the service layer in the management system. When the user creates a resource allocation request, the user needs to specify the usage time of the storage space. When the user obtains a certain storage space, the storage space can only be used within the specified time when the user creates the resource allocation request, and the storage space cannot be used during non-specified time. For example, user A creates a resource allocation request and specifies that the time for using the storage space is 8:00-15:30 every day. After the user obtains a certain storage space, he can only use the storage space from 8:00-15:30 every day; and user B creates a resource allocation request and specifies that the time for using the storage space is 20:00-24:00 from Monday to Friday. User B can share the storage space with user A, that is, user A uses the storage space from 8:00-15:30 from Monday to Sunday, and user B uses the storage space from 20:00-24:00 from Monday to Friday. Compared with providing user A and user B with their own storage space respectively, this application can effectively utilize the storage space resources.
[0151] Preferably, the specified time can also be used to represent the duration of resource idleness. When creating a resource allocation request, the user needs to set the duration of resource idleness allowed for the storage space. If the user does not use the resource for more than the set duration of resource idleness allowed, the user's use of the resource is reclaimed.
[0152] Step S110 is used to describe the process of the system receiving a resource allocation request. Among them, "resource allocation request" refers to a request made by a user to the system for the use of storage space. This request carries "specified time information", that is, the time when the user wants to use the storage space. The system receives the user's resource allocation request, and the request contains the time information when the user wants to use the storage space. This request represents the user's request for the use of storage space, and the specified time information is used to represent the specific time when the user wants to use the storage space. In this way, the system can allocate storage space to the user according to the user's request and ensure that the user can only use the storage space within the specified time, thereby realizing effective management and utilization of the storage space.
[0153] S120. Obtain N message queue instances and N load information corresponding to the N message queue instances.
[0154] Each of the N message queue instances includes M storage spaces, each storage space carries idle time information, and the load information is used to characterize the usage of the message queue instance. Both N and M are integers greater than or equal to 1.
[0155] It is understandable that a message queue instance refers to an independent message processing unit in the system, which can receive and send messages. Each message queue instance includes M storage spaces, which are used to store messages. Each storage space carries idle time information, indicating the time the storage space is allowed to be used. Load information is used to characterize the usage of the message queue instance. It can be a numerical value or other representation method, used to indicate the number of messages stored in the message queue instance or other load indicators. For example, load information can be expressed as the number of messages in the queue or the utilization rate of the storage space. Both N and M are integers greater than or equal to 1, which means that there may be multiple message queue instances in the system, and each message queue instance contains multiple storage spaces. The specific values of N and M depend on the design and actual needs of the system.
[0156] Specifically, the message queue system includes N message queue instances, and each message queue instance corresponds to a load information, which is used to characterize the usage of the storage space in the message queue instance. The load information may include but is not limited to the following: 1) Number of messages: indicating the number of messages stored in the current message queue; 2) Message size: indicating the average size of the messages stored in the current message queue; 3) Queue length: indicating the total length of the messages in the current message queue; 4) Waiting time: indicating the time the message waits to be processed in the message queue; 5) Throughput: indicating the number of messages processed by the message queue per unit time; The load information can be used to understand the usage of the message queue, thereby determining the storage space allocated to the user.
[0157] Storage space can be used to store messages. Each storage space has its own idle time information, indicating whether the space is currently idle and the length of idle time. This idle time information can help better manage and allocate storage space and improve the efficiency of message queues. For example, in message queue instance 1, there is storage space a, and the idle time information of storage space a is 7:30-15:50 every day, which means that within this idle time, storage tasks can be allocated to storage space a.
[0158] Preferably, by calling the cloud service provider API interface, N load information corresponding to N message queue instances can be queried.
[0159] S130. Determine K candidate message queue instances from the N message queue instances according to the N load information.
[0160] The load information corresponding to each of the K candidate message queue instances is less than or equal to the load threshold, and K is an integer greater than or equal to 1 and less than N.
[0161] It can be understood that, according to the N load information corresponding to the N message queue instances, the message queue instances whose load information is less than or equal to the load threshold are determined as candidate message queue instances. Only when the load information of the message queue instance is less than or equal to the load threshold will the message queue instance be selected as a candidate message queue instance. Selecting a candidate message queue instance that meets the load requirements based on the load information can improve the stability, reliability and performance of the system, thereby better meeting business needs.
[0162] Specifically, the selection criteria for candidate message queue instances is that their corresponding load information must be less than or equal to the load threshold. The load information can be the number of messages in the queue, the usage rate of the storage space, etc. The load threshold is a pre-set value that represents the maximum load that the system can withstand. According to this selection criteria, the system will select K candidate message queue instances whose load information is less than or equal to the load threshold from N message queue instances. These K candidate message queue instances will be used as candidates for subsequent processing. It should be noted that the selection of K candidate message queue instances is not necessarily unique, because there may be multiple message queue instances whose load information is less than or equal to the load threshold. In actual applications, how to select candidate message queue instances can be determined based on specific needs and strategies.
[0163] S140 . Determine a target storage space from the K×M storage spaces corresponding to the K candidate message queue instances.
[0164] The idle time information corresponding to the target storage space includes designated time information.
[0165] It can be understood that the candidate message queue instance refers to a qualified message queue instance selected according to the load information, and each message queue instance corresponds to M storage spaces. Therefore, the number of storage spaces corresponding to K candidate message queue instances is K×M. The target storage space refers to the storage space for storing messages that needs to be determined. The determination of the target storage space needs to consider its idle time information. The idle time information includes specified time information, which indicates the idle time of the storage space within the specified time range. When determining the target storage space, the system will select the storage space with the longest idle time as the target storage space according to the specified time information. This can ensure that the message can be stored in the most idle storage space, thereby improving the utilization of the storage space and the performance of the system. It should be noted that the method for determining the target storage space can be adjusted according to actual needs and policies. For example, the target storage space can be selected based on factors such as the priority and size of the message.
[0166] Each candidate message queue instance includes M storage spaces, and the storage space whose idle time information includes the specified time information is determined as the target storage space from the K×M storage spaces corresponding to the K candidate message queue instances. The idle time information corresponding to the target storage space includes the specified time information, which means that the time range covered by the idle time information corresponding to the target storage space includes the specified time information. Specifically: first, obtain the K×M idle time information corresponding to the K×M storage spaces corresponding to the K candidate message queue instances; then, according to the specified time information and the K×M idle time information, determine L candidate storage spaces from the K×M storage spaces, wherein the L idle time information corresponding to the L candidate storage spaces all include the specified time information; finally, determine the target storage space according to the P load information of the P candidate message queue instances corresponding to the L candidate storage spaces, wherein the load information of the candidate message queue instance to which the target storage space belongs is the minimum value of the P load information, and P is an integer greater than or equal to 1 and less than or equal to K.
[0167] S150: Configure the target storage space according to the specified time.
[0168] It is understandable that after the target storage space is configured according to the specified time, the user has the right to use the target storage space during the specified time.
[0169] In a preferred embodiment, the resource allocation request also carries object identification information and requirement tag information, wherein the object identification information is the identification information of the target object that sends the resource allocation request, and the requirement tag information is used to characterize the usage information of the target object for the storage space; therefore, in addition to configuring the target storage space according to the specified time, it is also necessary to name the target storage space according to the requirement tag information, and configure the target storage space according to the object identification information and the specified time, and generate a configuration data table.
[0170] To better understand the resource management method provided by the embodiment of the present application, the resource management method provided by the embodiment of the present application is illustrated. User A requests resource allocation through the management station and specifies the time for using the storage space as 8:00-15:30 every day. The management station (the front end in the message queue system) first generates a resource allocation request with the specified time information according to the request of user A, and then the management station calls the management system (the back end in the message queue system) API to send the resource allocation request to the service layer in the management system.
[0171] The management system first receives a resource allocation request. Next, it determines N message queue instances (S1, S2, . . . , S n ), the N message queue instances may be all the message queue instances in the message queue system, or may be the message queue instances in the message queue system that can also store messages, which is not limited in the embodiment of the present application, and each of the N message queue instances includes M storage spaces ({P 1-1 , P 1-2 、···、P 1-m}、{P 2-1 , P 2-2 、···、P 2-m}、···、{P n-1 , P n-2 、···、P n-m}), by looking up the table, the idle time information corresponding to each storage space can be obtained. After determining N message queue instances, the N load information corresponding to the N message queue instances can be queried by calling the cloud service provider API interface. Then, based on the N load information, the message queue instances whose load information is less than or equal to the load threshold are determined from the N message queue instances to obtain K candidate message queue instances ({P 1-1 , P 1-2 、···、P 1-m}、{P 4-1 , P 4-2 、···、P 4-mThen, according to the K×M idle time information corresponding to the K×M storage spaces, the target storage space P whose idle time information includes the designated time information is determined. 1-2 , where the target storage space P 1-2 The idle time information of the target storage space P is 7:00-15:50. Finally, the target storage space P is allocated according to the specified time. 1-2 Configuration, the target storage space after configuration P 1-2 The free time information is 7:30-8:00 and 15:30-15:50; and user A can store messages in the target storage space from 8:00 to 15:30 every day.
[0172] The resource management method provided in the embodiment of the present application configures the storage space according to the specified time information, which can more accurately meet the user's demand for storage space usage, realize the on-demand allocation of storage space to the user, and thus avoid the waste of storage space; by determining the target storage space from the storage space corresponding to the candidate message queue instance and configuring the target storage space according to the specified time, the storage space can be allocated and managed more flexibly, avoiding idleness and waste of storage space.
[0173] In this application Figure 4 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Figure 5 , step S140 also includes sub-steps S141 to S143. Specifically:
[0174] S141 . Obtain K×M idle time information corresponding to K×M storage spaces corresponding to K candidate message queue instances.
[0175] It is understandable that there are K candidate message queue instances, each of which has M storage spaces. It is necessary to obtain the idle time information of each storage space in the K candidate message queue instances, and it is necessary to obtain the idle time information of K×M storage spaces in total.
[0176] The idle time corresponding to each storage space can be obtained by looking up a table. Specifically, in one embodiment, when the storage space is configured, the configuration information is stored in an information table, which records the time each storage space is occupied (i.e., the specified time in the resource allocation request), and the idle time corresponding to the storage space can be calculated based on the time each storage space is occupied; in another embodiment, the information of K candidate message queue instances and their corresponding K×M storage spaces, including the idle time information of each storage space, is stored in a table or database, and the idle time information of each storage space can be obtained by querying this table or database.
[0177] Preferably, a two-dimensional array can be established to store this information. The length of one-dimensional array is K, which indicates the number of candidate message queue instances; the length of another-dimensional array is K×M, which indicates the number of storage spaces corresponding to each candidate message queue instance. For each storage space, the corresponding idle time information can be recorded.
[0178] For example, suppose there are 3 candidate message queue instances, each with 2 storage spaces. A two-dimensional array [3][2] can be created to store this information. For each storage space, its corresponding idle time can be recorded, for example:
[0179] [0][0]:10:00-11:00;
[0180] [0][1]:11:00-12:00;
[0181] [1][0]:12:00-13:00;
[0182] [1][1]:13:00-14:00;
[0183] [2][0]:14:00-15:00;
[0184] [2][1]:15:00-16:00;
[0185] The free time information of each storage space can be obtained by querying the two-dimensional array.
[0186] S142. Determine L candidate storage spaces from the K×M storage spaces according to the designated time information and the K×M idle time information.
[0187] The L idle time information corresponding to the L candidate storage spaces all include designated time information, and L is an integer greater than or equal to 1.
[0188] It can be understood that, according to the designated time information and the K×M idle time information, L candidate storage spaces whose idle time information all include the designated time information are determined from the K×M storage spaces. When selecting the L idle time information, factors such as the degree of matching between the designated time information and the idle time information, the availability of the storage space, and the size of the storage space need to be considered in order to select the most suitable L candidate storage spaces.
[0189] S143. Determine a target storage space according to P load information of P candidate message queue instances corresponding to the L candidate storage spaces.
[0190] The load information of the candidate message queue instance to which the target storage space belongs is the minimum value of P load information, where P is an integer greater than or equal to 1 and less than or equal to K.
[0191] It can be understood that the candidate message queue instances corresponding to the L candidate storage spaces are determined, and the load information of each candidate message queue instance is obtained, and the candidate storage space in the candidate message queue instance with the smallest load information is selected as the target storage space. Specifically: first, the P candidate message queue instances corresponding to the L candidate storage spaces are determined; then, based on the P load information corresponding to the P candidate message queue instances, the target candidate message queue is determined, wherein the load information of the target candidate message queue is the minimum value among the P load information; finally, the target storage space is determined from the target candidate message queue.
[0192] For example, the message queue system includes 10 (N=10) message queue instances (S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S25, S26, S27, S28, S29 10 ). First. According to the load information corresponding to the 10 message queue instances, the 6 message queue instances (S1, S2, S3, S4, S5, S6) whose load information is less than or equal to the load threshold are determined as candidate message queue instances. Then, the idle time information corresponding to each storage space in the 6 candidate message queue instances is obtained, and the idle time information corresponding to each storage space in the 6 candidate message queue instances is compared with the specified time information to obtain: the storage space P in the message queue instance S1 1-2 The corresponding idle time information includes the specified time information, the storage space P in the message queue instance S1 1-4 The corresponding idle time information includes the specified time information, the storage space P in the message queue instance S3, and the 3-3 The corresponding idle time information includes the specified time information, the storage space P in the message queue instance S6 6-4 The corresponding idle time information includes the specified time information; then, the load information of the message queue instance S1 is the minimum value of the load information corresponding to the three message queue instances (message queue instance S1, message queue instance S3, message queue instance S6), then the storage space P in the message queue instance S1 is 1-2 With storage space P 1-4 Determine the target storage space.
[0193] The resource management method provided in the embodiment of the present application can more accurately understand the usage of each storage space in the system by obtaining the idle time information of the storage space corresponding to the candidate message queue instance, thereby more effectively utilizing the idle storage space and improving the utilization rate of the storage space.
[0194] In this application Figure 5 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Figure 6, step S143 further includes sub-steps S1431 to S1433. Specifically:
[0195] S1431. Determine P candidate message queue instances corresponding to L candidate storage spaces.
[0196] It is understandable that the message queue instance corresponding to each candidate storage space is determined. Since there are multiple candidate storage spaces corresponding to the same candidate message queue instance, there is no corresponding relationship between L and P in terms of quantity.
[0197] S1432. Determine a target candidate message queue according to the P load information corresponding to the P candidate message queue instances.
[0198] The load information of the target candidate information queue is the minimum value among the P load information.
[0199] It is understandable that the candidate message queue instances can be sorted according to the load information to determine the target candidate message queue corresponding to the minimum load information. Preferably, the sorting algorithm can be used to achieve the sorting.
[0200] S1433. Determine the target storage space from the target candidate information queue.
[0201] It is understandable that the storage space whose idle time information and the specified time information are most matched in the candidate storage space in the candidate message queue instance with the smallest load information can be selected as the target storage space. The most matched means that the difference value obtained when the idle time information and the specified time information are subtracted is the smallest.
[0202] For example, the message queue system includes 10 (N=10) message queue instances (S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14, S15, S16, S17, S18, S19, S20, S21, S22, S23, S24, S25, S26, S27, S28, S29 10 ). First. According to the load information corresponding to the 10 message queue instances, the 6 message queue instances (S1, S2, S3, S4, S5, S6) whose load information is less than or equal to the load threshold are determined as candidate message queue instances. Then, the idle time information corresponding to each storage space in the 6 candidate message queue instances is obtained, and the idle time information corresponding to each storage space in the 6 candidate message queue instances is compared with the specified time information to obtain: the storage space P in the message queue instance S1 1-2 The corresponding idle time information includes the specified time information, the storage space P in the message queue instance S1 1-4 The corresponding idle time information includes the specified time information, the storage space P in the message queue instance S3, and the 3-3 The corresponding idle time information includes the specified time information, the storage space P in the message queue instance S66-4 The corresponding idle time information includes the specified time information; then, the load information of the message queue instance S1 is the minimum value of the load information corresponding to the three message queue instances (message queue instance S1, message queue instance S3, message queue instance S6), then the storage space P in the message queue instance S1 1-2 With storage space P 1-4 Determine the target storage space between the two; finally, obtain the storage space P 1-2 The free time information is 7:00-15:50, and the storage space P 1-4 The free time information is 06:00-22:00. Since the specified time 8:00-15:30 is the same as the storage space P 1-2 The free time information of the storage space P is more consistent (the specified time 8:00-15:30 is consistent with the storage space P 1-2 The time difference between the free time information 7:00-15:50 is 7:00-8:00 and 15:30-15:50; the specified time 8:00-15:30 and the storage space P 1-4 The time difference of free time information 6:00-22:00 is 6:00-8:00, and 15:30-20:00; storage space P 1-2 The time difference with the specified time is less than the storage space P 1-4 time difference from the specified time).
[0203] The resource management method provided in the embodiment of the present application can reasonably allocate and use storage space and message queue instances through the correspondence between candidate storage space and candidate message queue instances, thereby avoiding waste of storage space and message queue instances, thereby improving resource utilization; by determining the target storage space from the target candidate message queue, the storage space can be allocated to the message queue instance that needs it most, thereby avoiding idleness and waste of storage space, thereby improving resource utilization.
[0204] In this application Figure 4 In an optional embodiment of the resource management method provided by the corresponding embodiment, the resource allocation request also carries object identification information and demand tag information, wherein the object identification information is the identification information of the target object sending the resource allocation request, and the demand tag information is used to characterize the usage information of the target object for the storage space. Figure 7 , step S150 also includes sub-steps S151 to S152. Specifically:
[0205] S151. Name the target storage space according to the required label information.
[0206] It is understandable that the demand tag information may be directly used as the name of the target storage space to facilitate the management and use of the storage space.
[0207] S152: Configure the target storage space according to the object identification information and the specified time, and generate a configuration data table.
[0208] It is understandable that the object identification information may be an identifier that identifies the target object, such as an object ID, etc. The configuration data table is a table used to record and manage configuration information, which includes object identification information and related configuration information such as designated time.
[0209] The resource management method provided in the embodiment of the present application can more easily identify and manage the storage space by giving a meaningful name to the storage space, thereby avoiding confusion and misuse of the storage space.
[0210] To better understand the resource management method provided in this application embodiment, please refer to Figure 8 , Figure 8 A schematic diagram of message queue resource allocation provided for an embodiment of the present application. The user initiates a resource allocation request through the management station, and the management station establishes a communication channel with the management system by calling the management system API, and sends the resource allocation request to the management system. The management system first receives the resource allocation request submitted by the management station, including the demand tag and the allowed resource idle time; secondly, the management system queries the database to find the message queue resources that are idle and meet the demand tag, and obtains the full list of available instances under the current tenant; then, by calling the cloud service provider API interface, query the usage load of each instance, and select the instance resource with the lowest load; the load is not limited to the amount of messages and the consumption speed, and the definition of load has different interpretations and emphases in different scenarios. Then, the management system determines the target storage space in the instance with the lowest load by calling the cloud service provider API interface, and uses the demand tag as the namespace name; then, the management system creates and generates configuration information, including the message queue tenant ID, namespace name (demand tag passed in by the user), producer and consumer configuration information; finally, the management system returns the configuration information to the management station, and adds this demand tag and instance information to the database namespace table, and the resource status is a record in use.
[0211] In this application Figure 4 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Fig. 9 , after step S150, it also includes steps S160 to S170. Specifically:
[0212] S160: Obtain the usage status of the target storage space within a specified time.
[0213] It is understandable that obtaining the usage status of the target storage space can be achieved in a variety of ways, such as querying a log file, querying the usage status of the storage space, and the like.
[0214] S170: If the usage status of the target storage space is idle within the specified time, clear the configuration of the target storage space.
[0215] It is understandable that after the target storage space is configured according to the specified time, the user should use the target storage space within the specified time, that is, the target storage space is in use (non-idle state) within the specified time; however, if the user does not use the target storage space within the specified time, that is, the target storage space is in idle state within the specified time, then the target storage space needs to be released, and the configuration information of the target storage space needs to be released or cleared. Clearing the configuration may include deleting related files, database records, permission settings, etc., and the specific operation depends on the type and usage of the target storage space.
[0216] The resource management method provided in the embodiment of the present application can release unused storage space in time and improve the utilization rate of system resources by regularly checking the usage status of the storage space.
[0217] In this application Figure 4 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Fig.10 , after step S150, steps S180 to S190 are also included. Specifically:
[0218] S180: Receive a resource clearing request.
[0219] The resource clearing request is used to instruct to clear the configuration of the target storage space.
[0220] It is understandable that the user can delete the target storage space with usage summary through the management station. The management station generates a resource clearing request based on the user's deletion operation and sends the resource clearing request to the management system. The management system receives the resource clearing request from the management station. A resource clearing request refers to a request for instructing a clearing operation on the configuration of the target storage space. The request may be initiated by the user on the management station, for example, by clicking the delete button to delete the target storage space with usage summary. After receiving the user's request, the management station generates a corresponding resource clearing request and sends it to the management system.
[0221] S190: Clear the configuration of the target storage space according to the resource clearing request.
[0222] It is understandable that the management system performs a configuration clearing operation on the target storage space according to the received resource clearing request. Specifically, the management system finds the corresponding storage space configuration according to the information contained in the request, such as the identifier of the target storage space, the name of the usage summary, etc., and deletes it from the system.
[0223] The resource management method provided in the embodiment of the present application, by receiving resource clearing requests, the management system can dynamically configure and manage the storage space according to the user's needs, thereby improving the flexibility of the system; through resource clearing requests, only authorized users can perform operations such as deletion on the storage space, thereby improving the security of the system; by providing a management console, users can conveniently manage and configure the storage space, thereby improving the user experience.
[0224] To facilitate understanding of the method provided in the embodiments of the present application, please refer to 11, Fig.11 This is a diagram of a user manually triggering resource recycling. The user manually deletes a resource in use through the management console. The management console establishes a communication channel with the management system by calling the management system API and sends a resource removal request to the management system. The management system first receives the resource removal request, calls the cloud service provider API, and completes the removal operation. The removal content includes but is not limited to the topic and accumulated messages, messages, and names in the current storage space, and sets the status information of the storage space to the deleted state in the storage space table in the database.
[0225] In this application Fig.10 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Fig.12 , step S190 further includes sub-steps S191 to S192. Specifically:
[0226] S191. Back up the storage information of the target storage space.
[0227] Understandably, in order to ensure that no important data is lost in the subsequent steps, backup can be achieved through various methods, such as copying the data to other storage devices or cloud storage services.
[0228] S192: After completing the information backup, clear the configuration of the target storage space and delete the storage information of the target storage space.
[0229] It is understood that the configuration and storage information of the target storage space are completely cleared so that the storage space can be reused. Clearing the configuration may include deleting related files, registry entries or other system configuration information. Deleting the storage information may include deleting the file system or other storage structure on the storage device.
[0230] The resource management method provided in the embodiment of the present application can release the storage space for other purposes by deleting the storage information of the target storage space.
[0231] In this application Figure 4 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Fig.13 The resource management method further includes steps S210 to S240. Specifically:
[0232] S210: Count usage of N×M storage spaces in N message queue instances to determine H named storage spaces.
[0233] The named storage space is used to represent the storage space with time configuration information.
[0234] It is understandable that the storage space in use in all message queue instances in the message queue system is regularly screened to find out the storage space that has not been used within the specified time and release it. Each storage space in use is also called a named storage space, and each storage space in use has configuration information, wherein the configuration information includes time configuration information, and the time configuration information is used to characterize when the storage space will be used by the user. The read and write operations of the storage space are recorded through a counter or log record so that the usage of the storage space can be obtained.
[0235] S220: Obtain H configuration data tables corresponding to the H named storage spaces.
[0236] Each of the H configuration data tables includes a designated time for storing information in a named storage space.
[0237] It is understandable that the configuration data table is generated when each storage space is configured, and contains time configuration information related to the named storage space. The configuration data table can be stored in a database or managed in other ways.
[0238] S230 . Screen H named storage spaces every preset time period to obtain G named storage spaces to be cleared.
[0239] The named storage space to be cleared is used to represent the named storage space that has not stored information within a specified time, and G is an integer less than or equal to H.
[0240] It is understandable that the usage of each named storage space is screened regularly, specifically, whether it is in use within the specified time corresponding to each namespace is determined. If the state of the namespace is not in use within the specified time, the configuration information of the named storage space will be cleared. The H named storage spaces are checked regularly to determine which named storage spaces are not used within the specified time. The specific screening method may include checking the read and write operation records, access frequency, etc. of the storage space.
[0241] G is an integer less than or equal to H. This means that during the screening process, some storage spaces may not be marked as "named storage spaces to be cleared" because they are still used within the specified time. Therefore, the number of G named storage spaces to be cleared may be less than or equal to the number of H named storage spaces.
[0242] S240: Clear configurations of the G named storage spaces to be cleared.
[0243] It can be understood that the configuration information related to the named storage space to be cleared is deleted or cleared.
[0244] The resource management method provided in the embodiment of the present application can release storage space by regularly screening and clearing unused storage space so that available storage resources can be better utilized and the utilization rate of storage space can be improved; by reducing the amount of unused storage space, storage costs can be reduced because there is no need to pay for unused storage space, thereby reducing storage costs and improving system performance.
[0245] For easier understanding, see Fig.14 , Fig.14 This is a schematic diagram of message queue resource recycling. Specifically, through the scheduled task method, the management system scans all namespaces in use every day, with no limit on the scanning frequency; then the management system calls the cloud service provider API to obtain the latest message production time, thereby filtering out all namespaces whose latest messages exceed the allowed idle time; then the management system calls the cloud service provider API to complete the clearing operation: including but not limited to the topic, message and namespace in the current namespace; finally, the management system sets the namespace resource status to the deleted status in the namespace table in the database.
[0246] In this application Fig.13 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Fig.15 , step S230 further includes sub-steps S231 to S233. Specifically:
[0247] S231. Obtain H designated times corresponding to H named storage spaces.
[0248] It can be understood that the specified time corresponding to each named storage space is obtained by querying the configuration data table.
[0249] S232. Obtain usage status of H named storage spaces within H specified times at every preset time period.
[0250] It is understandable that this can be achieved by periodically polling the named storage space, or by setting a notification mechanism on the named storage space, and when the state of the named storage space changes, a notification is sent to the system.
[0251] S233: taking the named storage spaces whose usage status of the named storage spaces is idle within the specified time as the named storage spaces to be cleared, and obtaining G named storage spaces to be cleared.
[0252] It is understandable that the named storage spaces whose usage status is idle within the specified time are screened out and used as the named storage spaces to be cleared. This can be achieved by comparing the usage status of the named storage spaces at the specified time point with a preset idle status standard.
[0253] The resource management method provided in the embodiment of the present application can release storage space by regularly clearing unused storage space, thereby improving storage utilization.
[0254] In this application Figure 4 In an optional embodiment of the resource management method provided in the corresponding embodiment, please refer to Fig.16 The resource management method further includes steps S310 to S340. Specifically:
[0255] S310: Receive a request for adding a new message queue instance.
[0256] The request for adding a new message queue instance carries identification information of the newly added message queue instance.
[0257] It is understandable that when a user needs to add a new message queue instance to the message queue system, the management station generates a request for adding a new message queue instance through user operations, calls the management system API, establishes a communication channel with the management system, and sends the request for adding a new message queue instance to the management system. The management system receives the request for adding a new message queue instance, and the identification information of the request for adding a new message queue instance can be the ID information of the message queue instance set by the user.
[0258] S320: Obtain a message queue instance data table.
[0259] The message queue instance data table is used to store the identification information of the current message queue instance.
[0260] It can be understood that a data table corresponding to a message queue instance existing in the message queue is obtained, and the data table records the ID information of each message instance stored in the message queue.
[0261] S330: According to the identification information of the newly added message queue instance and the message queue instance data table, determine that the identification information of the newly added message queue instance is not included in the message queue instance data table.
[0262] It is understandable that, by looking up the table, it is determined that there is no identification information of the message queue instance that is the same as the identification information of the newly added message queue instance in the message queue instance data table.
[0263] S340: Store the identification information of the newly added message queue instance in the message queue instance data table.
[0264] It is understandable that when it is determined that there is no identification information of the message queue instance identical to the identification information of the newly added message queue instance in the message queue instance data table, the identification information of the newly added message queue instance is inserted into the message queue instance data table.
[0265] Preferably, step S340 further includes: performing availability verification on the newly added message queue instance, and if the newly added message queue instance passes the availability verification, storing identification information of the newly added message queue instance in the message queue instance data table.
[0266] The resource management method provided in the embodiment of the present application receives a request for a new message queue instance, and the system can dynamically add a new message queue instance according to user needs and business needs, thereby improving the flexibility and scalability of the system; by storing the identification information of the newly added message queue instance in the message queue instance data table, the system can improve the efficiency of subsequent operations, such as query and update.
[0267] For easier understanding, see Fig.17 , Fig.17Schematic diagram of importing a new instance of a message queue. The user imports message queue instance resources for the tenant through the management console. The management console calls the management system API to establish a communication channel between the management console and the management system. The management console receives the new instance import request submitted from the front end and determines whether the instance resource already exists. If not, it calls the cloud service provider API to verify the availability of the instance; if it passes the availability test, it imports the new instance into the specified resource pool and updates the database. Specifically: First, call the cloud service provider API to verify the availability of the new message queue instance; methods for verifying availability include but are not limited to creating a dedicated verification namespace, and then deleting the dedicated verification namespace after successful creation. Then, query the message queue instance table in the database, and again use the instance ID to ensure that the instance does not exist in the database. Finally, insert the new instance data into the message queue instance table.
[0268] Finally, the database design used in this application is introduced:
[0269] Select a relational database for data storage, such as MySQL, and design the following data tables:
[0270] 1. Tenant table: saves tenant information, including tenant ID, user name, contact information, email address and other fields;
[0271] 2. Resource pool table: saves resource pool information, including resource pool ID, tenant ID, number of resources, etc.;
[0272] 3. Message queue instance table: saves message queue instance information, including instance ID, resource pool ID, instance type, instance status, etc.;
[0273] 4. Namespace table: stores message queue namespace information, including namespace ID, instance ID, requirements, and status.
[0274] The resource management method provided in the embodiment of the present application realizes dynamic allocation and recovery of message queue resources through resource pool technology, and can expand or shrink the resource pool according to actual needs, so as to make resource utilization higher; avoid the need to re-apply and purchase message queue resources at each stage in the software development and testing environment, improve the convenience of resource acquisition and use, and reduce the cost of resource purchase; users do not need to care about the resource pool and instance to which the resources belong, but only need to use the message queue producer and consumer configuration information provided by the management system to simplify the use process, thereby reducing operating costs; as a general message queue solution, the present invention is suitable for different types of message queue systems, easy to expand and adapt to diverse application scenario requirements, and has the advantages of flexibility and scalability; isolation of message queue resources of different tenants is realized through resource pools and namespaces, which ensures data security and system stability and realizes resource isolation; real-time acquisition of resource usage, including indicators such as message accumulation, sending volume, consumption and consumption delay, helps users quickly understand resource usage, and facilitates adjustment of strategies and optimization of resource management.
[0275] The resource management device in this application is described in detail below. Fig.18 . Fig.18 This is a schematic diagram of an embodiment of a resource management device 10 in an embodiment of the present application. The resource management device 10 includes: a resource allocation request receiving module 110, a message queue instance and load information acquisition module 120, a candidate message queue instance determination module 130, a target storage space determination module 140 and a storage space configuration module 150; specifically:
[0276] The resource allocation request receiving module 110 is used to receive a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for using the storage space, and the specified time information is used to represent the time for using the storage space;
[0277] The message queue instance and load information acquisition module 120 is used to acquire N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, and the load information is used to characterize the usage of the message queue instance, and N and M are both integers greater than or equal to 1;
[0278] A candidate message queue instance determination module 130 is used to determine K candidate message queue instances from N message queue instances according to N load information, wherein the load information corresponding to each candidate message queue instance in the K candidate message queue instances is less than or equal to the load threshold, and K is an integer greater than or equal to 1 and less than N;
[0279] The target storage space determination module 140 is used to determine the target storage space from the K×M storage spaces corresponding to the K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes the specified time information;
[0280] The storage space configuration module 150 is used to configure the target storage space according to the specified time.
[0281] The resource management device provided in the embodiment of the present application configures the storage space according to the specified time information, which can more accurately meet the user's demand for storage space usage, realize the on-demand allocation of storage space to the user, and thus avoid the waste of storage space; by determining the target storage space from the storage space corresponding to the candidate message queue instance and configuring the target storage space according to the specified time, the storage space can be allocated and managed more flexibly, avoiding idleness and waste of storage space.
[0282] In this application Fig.18 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.18 The target storage space determination module 140 is further configured to:
[0283] Obtain K×M idle time information corresponding to K×M storage spaces corresponding to K candidate message queue instances;
[0284] Determine L candidate storage spaces from the K×M storage spaces according to the designated time information and the K×M idle time information, wherein the L idle time information corresponding to the L candidate storage spaces all include the designated time information, and L is an integer greater than or equal to 1;
[0285] The target storage space is determined based on the P load information of the P candidate message queue instances corresponding to the L candidate storage spaces, wherein the load information of the candidate message queue instance to which the target storage space belongs is the minimum value of the P load information, and P is an integer greater than or equal to 1 and less than or equal to K.
[0286] The resource management device provided in the embodiment of the present application can more accurately understand the usage of each storage space in the system by obtaining the idle time information of the storage space corresponding to the candidate message queue instance, thereby more effectively utilizing the idle storage space and improving the utilization rate of the storage space.
[0287] In this application Fig.18 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.18 The target storage space determination module 140 is further configured to:
[0288] Determine P candidate message queue instances corresponding to the L candidate storage spaces;
[0289] Determine a target candidate message queue according to P load information corresponding to the P candidate message queue instances, wherein the load information of the target candidate message queue is the minimum value of the P load information;
[0290] A target storage space is determined from the target candidate information queue.
[0291] The resource management device provided in the embodiment of the present application can reasonably allocate and use storage space and message queue instances through the correspondence between candidate storage space and candidate message queue instances, thereby avoiding waste of storage space and message queue instances, and thus improving resource utilization; by determining the target storage space from the target candidate information queue, the storage space can be allocated to the message queue instance that needs it most, thereby avoiding idleness and waste of storage space, and thus improving resource utilization.
[0292] In this application Fig.18 In an optional embodiment of the resource management device provided by the corresponding embodiment, the resource allocation request also carries object identification information and demand tag information, wherein the object identification information is the identification information of the target object for which the resource allocation request is sent, and the demand tag information is used to characterize the usage information of the target object for the storage space; please refer to Fig.18 The storage space configuration module 150 is further used for:
[0293] Name the target storage space according to the required tag information;
[0294] The target storage space is configured according to the object identification information and the specified time, and a configuration data table is generated.
[0295] The resource management device provided in the embodiment of the present application can more easily identify and manage the storage space by giving a meaningful name to the storage space, thereby avoiding confusion and misuse of the storage space.
[0296] In this application Fig.18 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.19 The resource management device further includes: a configuration clearing module 160; specifically, the configuration clearing module 160 is used to:
[0297] Get the usage status of the target storage space within the specified time;
[0298] If the target storage space is in an idle state within the specified time, the configuration of the target storage space is cleared.
[0299] The resource management device provided in the embodiment of the present application can release unused storage space in time and improve the utilization rate of system resources by regularly checking the usage status of the storage space.
[0300] In this application Fig.19 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.19 , the configuration clearing module 160 is also used for:
[0301] receiving a resource clearing request, wherein the resource clearing request is used to instruct to clear the configuration of the target storage space;
[0302] Clear the configuration of the target storage space according to the resource clearing request.
[0303] The resource management device provided in the embodiment of the present application receives a resource clearing request, and the management system can dynamically configure and manage the storage space according to the user's needs, thereby improving the flexibility of the system; through the resource clearing request, only authorized users can perform operations such as deletion on the storage space, thereby improving the security of the system; by providing a management console, users can conveniently manage and configure the storage space, thereby improving the user experience.
[0304] In this application Fig.19 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.19 , the configuration clearing module 160 is also used for:
[0305] Back up the storage information of the target storage space;
[0306] After the information is backed up, clear the configuration of the target storage space and delete the storage information of the target storage space.
[0307] The resource management device provided in the embodiment of the present application can release the storage space for other purposes by deleting the storage information of the target storage space.
[0308] In this application Fig.19 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.19 , the configuration clearing module 160 is also used for:
[0309] Statistics are collected on usage of N×M storage spaces in N message queue instances to determine H named storage spaces, where the named storage spaces are used to represent storage spaces with time configuration information.
[0310] Obtaining H configuration data tables corresponding to the H named storage spaces, wherein each of the H configuration data tables includes a specified time for the named storage space to store information;
[0311] At every preset time period, H named storage spaces are screened to obtain G named storage spaces to be cleared, wherein the named storage spaces to be cleared are used to represent named storage spaces that have not stored information within a specified time, and G is an integer less than or equal to H;
[0312] Clear the configuration of the G named storage spaces to be cleared.
[0313] The resource management device provided in the embodiment of the present application can release storage space by regularly screening and clearing unused storage space so that available storage resources can be better utilized and the utilization rate of storage space can be improved; by reducing the amount of unused storage space, storage costs can be reduced because there is no need to pay for unused storage space, thereby reducing storage costs and improving system performance.
[0314] In this application Fig.19 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig.19 , the configuration clearing module 160 is also used for:
[0315] Get H specified times corresponding to H named storage spaces;
[0316] Every preset time period, within H specified time periods, obtain the usage status of H named storage spaces;
[0317] The named storage spaces whose usage status of the named storage spaces is idle within the specified time are taken as the named storage spaces to be cleared, and G named storage spaces to be cleared are obtained.
[0318] The resource management device provided in the embodiment of the present application can release storage space by regularly clearing unused storage space, thereby improving storage utilization.
[0319] In this application Fig.18 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig. 20 The resource management device 10 further includes: a message queue instance adding module 170; specifically, the message queue instance adding module 170 is used to:
[0320] Receive a request for adding a new message queue instance, wherein the request for adding a new message queue instance carries identification information of the newly added message queue instance;
[0321] Obtain a message queue instance data table, wherein the message queue instance data table is used to store identification information of the current message queue instance;
[0322] According to the identification information of the newly added message queue instance and the message queue instance data table, determining that the identification information of the newly added message queue instance is not included in the message queue instance data table;
[0323] The identification information of the newly added message queue instance is stored in the message queue instance data table.
[0324] The resource management device provided in the embodiment of the present application receives a request for adding a new message queue instance. The system can dynamically add a new message queue instance according to user needs and business needs, thereby improving the flexibility and scalability of the system; by storing the identification information of the newly added message queue instance in the message queue instance data table, the system can improve the efficiency of subsequent operations, such as query and update.
[0325] In this application Fig. 20 In an optional embodiment of the resource management device provided in the corresponding embodiment, please refer to Fig. 20 , the message queue instance newly added module 170 is also used for:
[0326] Availability verification is performed on the newly added message queue instance. If the newly added message queue instance passes the availability verification, identification information of the newly added message queue instance is stored in the message queue instance data table.
[0327] Fig.21 : is a schematic diagram of a server structure provided in an embodiment of the present application. The server 300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 322 (for example, one or more processors) and memory 332, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 342 or data 344. Among them, the memory 332 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 322 can be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the server 300.
[0328] The server 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and / or one or more operating systems 341, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0329] The steps performed by the server in the above embodiment can be based on the Fig.21 The server structure shown.
[0330] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0331] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0332] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0333] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0334] If the integrated unit is implemented in the form of a software functional unit 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 all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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 (ROM), random access memory (RAM), disk or optical disk, etc., and other media that can store program codes.
[0335] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource management method, characterized in that: include: receiving a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for use of a storage space, and the specified time information is used to represent a time for using the storage space; Obtain N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, and the load information is used to characterize the usage of the message queue instance, and N and M are both integers greater than or equal to 1; According to the N load information, determine K candidate message queue instances from the N message queue instances, wherein the load information corresponding to each candidate message queue instance in the K candidate message queue instances is less than or equal to a load threshold, and K is an integer greater than or equal to 1 and less than N; Determine a target storage space from the K×M storage spaces corresponding to the K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes the specified time information; The target storage space is configured according to the specified time.
2. The resource management method according to claim 1, characterized in that: The determining of the target storage space from the K×M storage spaces corresponding to the K candidate message queue instances includes: Obtain K×M idle time information corresponding to K×M storage spaces corresponding to K candidate message queue instances; Determine L candidate storage spaces from the K×M storage spaces according to the designated time information and the K×M idle time information, wherein the L idle time information corresponding to the L candidate storage spaces all include the designated time information, and L is an integer greater than or equal to 1; The target storage space is determined based on the P load information of the P candidate message queue instances corresponding to the L candidate storage spaces, wherein the load information of the candidate message queue instance to which the target storage space belongs is the minimum value of the P load information, and P is an integer greater than or equal to 1 and less than or equal to K.
3. The resource management method according to claim 2, characterized in that: The determining the target storage space according to the P load information of the P candidate message queue instances corresponding to the L candidate storage spaces includes: Determine P candidate message queue instances corresponding to the L candidate storage spaces; Determine a target candidate message queue according to the P load information corresponding to the P candidate message queue instances, wherein the load information of the target candidate message queue is a minimum value among the P load information; A target storage space is determined from the target candidate information queue.
4. The resource management method according to claim 1, characterized in that: The resource allocation request also carries object identification information and demand tag information, wherein the object identification information is identification information of the target object that sends the resource allocation request, and the demand tag information is used to represent the usage information of the target object for the storage space; The configuring the target storage space according to the specified time includes: Naming the target storage space according to the required label information; The target storage space is configured according to the object identification information and the specified time, and a configuration data table is generated.
5. The resource management method according to claim 1, characterized in that: After configuring the target storage space according to the specified time, the method further includes: Within the specified time, obtaining the usage status of the target storage space; If the usage status of the target storage space is idle within the specified time, the configuration of the target storage space is cleared.
6. The resource management method according to claim 1, characterized in that: After configuring the target storage space according to the specified time, the method further includes: receiving a resource clearing request, wherein the resource clearing request is used to instruct to clear the configuration of the target storage space; According to the resource clearing request, clear the configuration of the target storage space.
7. The resource management method according to any one of claims 5 or 6, characterized in that: The clearing of the configuration of the target storage space includes: Backing up the storage information of the target storage space; After the information backup is completed, the configuration of the target storage space is cleared and the storage information of the target storage space is deleted.
8. The resource management method according to claim 1, characterized in that: The method further comprises: Performing statistics on usage of N×M storage spaces in the N message queue instances to determine H named storage spaces, wherein the named storage spaces are used to represent storage spaces with time configuration information; Acquire H configuration data tables corresponding to the H named storage spaces, wherein each of the H configuration data tables includes a specified time for the named storage space to store information; At every preset time period, the H named storage spaces are screened to obtain G named storage spaces to be cleared, wherein the named storage spaces to be cleared are used to represent named storage spaces that have not stored information within a specified time, and G is an integer less than or equal to H; Clear configurations of the G named storage spaces to be cleared.
9. The resource management method according to claim 8, characterized in that: The H named storage spaces are screened at every preset time period to obtain G named storage spaces to be cleared, including: Obtain H specified times corresponding to the H named storage spaces; At every preset time period, within the H specified time periods, obtaining the usage status of the H named storage spaces; The named storage spaces whose usage status of the named storage spaces is idle within the specified time are taken as the named storage spaces to be cleared, and G named storage spaces to be cleared are obtained.
10. The resource management method according to claim 1, characterized in that: The method further comprises: Receive a request for adding a new message queue instance, wherein the request for adding a new message queue instance carries identification information of the newly added message queue instance; Obtaining a message queue instance data table, wherein the message queue instance data table is used to store identification information of the current message queue instance; According to the identification information of the newly added message queue instance and the message queue instance data table, determining that the identification information of the newly added message queue instance is not included in the message queue instance data table; The identification information of the newly added message queue instance is stored in the message queue instance data table.
11. The resource management method according to claim 10, characterized in that: The storing the identification information of the newly added message queue instance in the message queue instance data table further includes: Availability verification is performed on the newly added message queue instance. If the newly added message queue instance passes the availability verification, identification information of the newly added message queue instance is stored in the message queue instance data table.
12. A resource management device, characterized in that: include: A resource allocation request receiving module, used to receive a resource allocation request, wherein the resource allocation request carries specified time information, the resource allocation request is used to represent a request for use of a storage space, and the specified time information is used to represent a time for using the storage space; A message queue instance and load information acquisition module, used to acquire N message queue instances and N load information corresponding to the N message queue instances, wherein each of the N message queue instances includes M storage spaces, each storage space carries idle time information, and the load information is used to characterize the usage of the message queue instance, and N and M are both integers greater than or equal to 1; A candidate message queue instance determination module, configured to determine K candidate message queue instances from the N message queue instances according to the N load information, wherein the load information corresponding to each candidate message queue instance in the K candidate message queue instances is less than or equal to a load threshold, and K is an integer greater than or equal to 1 and less than N; a target storage space determination module, configured to determine a target storage space from the K×M storage spaces corresponding to the K candidate message queue instances, wherein the idle time information corresponding to the target storage space includes the specified time information; A storage space configuration module is used to configure the target storage space according to the specified time.
13. A computer device, characterized in that: include: memories, transceivers, processors, and bus systems; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory, including executing the resource management method according to any one of claims 1 to 11; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
14. A computer-readable storage medium comprising instructions, characterized in that: When the resource management method is executed on a computer, the resource management method enables the computer to execute the resource management method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that The computer program is executed by a processor to implement the resource management method according to any one of claims 1 to 11.