CN111857950A - Resource pool management container, management method and storage medium thereof - Google Patents

Resource pool management container, management method and storage medium thereof Download PDF

Info

Publication number
CN111857950A
CN111857950A CN202010616619.0A CN202010616619A CN111857950A CN 111857950 A CN111857950 A CN 111857950A CN 202010616619 A CN202010616619 A CN 202010616619A CN 111857950 A CN111857950 A CN 111857950A
Authority
CN
China
Prior art keywords
resource
resource pool
pool
interface
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010616619.0A
Other languages
Chinese (zh)
Inventor
李秋波
郭锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010616619.0A priority Critical patent/CN111857950A/en
Publication of CN111857950A publication Critical patent/CN111857950A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a resource pool management container, includes: the resource pool factory is used for storing the resource pool by a preset resource leasing interface; the resource interface is arranged in the resource pool factory and used for providing resource use service for the resource pool; the container agent is used for providing an external interaction interface of the resource pool management container; and the configuration center is used for providing configuration values for the resource pool. According to the resource pool decoupling method and device, the resource pools in the system are concentrated through the resource pool management container, a user can directly obtain the resources from the resource pool management container when the resources are utilized, attention to each independent resource pool is not needed, the resources and the resource pools are decoupled, and the service efficiency of the resource pools is improved. The application also provides a resource pool management method and a computer readable storage medium, which have the beneficial effects.

Description

Resource pool management container, management method and storage medium thereof
Technical Field
The present application relates to the field of servers, and in particular, to a resource pool management container, a resource pool management method, and a storage medium.
Background
For scarce resources that can be reused, resource pooling techniques are now widely used, which can reduce the number of creation of resource objects and improve the performance of programs, especially at high concurrency.
Generally, a resource pool stores a resource and manages the creation, lease, return, and destruction of the resource under its name. For commonly used scarce resources, such as database connections, threads, http connections, etc., the realization of these resource pools already exists, and their performances are good, but the use modes are different. There are various types of resource pools that often exist in a system and are distributed throughout the system, which can present various problems.
1. A user wants to rent a certain resource and must find its resource pool through which to obtain the resource.
2. The user must know the resource renting mode of various resource pools to use.
3. Resource pools have many configuration attributes, and complex resource pools can reach dozens. Such as a maximum number of resources, a minimum number, an initialization number, a timeout wait, an idle wait, and so on. Resource pool configuration may exist anywhere in the system following the resource pool, and resource pool configuration management is difficult.
Disclosure of Invention
An object of the present application is to provide a resource pool management container, a resource pool management method, and a storage medium, which can improve the utilization efficiency of a resource pool.
In order to solve the above technical problem, the present application provides a resource pool management container, which has the following specific technical scheme:
The resource pool factory is used for storing the resource pool by a preset resource leasing interface;
the resource interface is arranged in the resource pool factory and used for providing resource use service for the resource pool;
the container agent is used for providing an external interaction interface of the resource pool management container;
and the configuration center is used for providing configuration values for the resource pool.
Optionally, the method further includes:
the interceptor is used for intercepting the resource pool and executing additional operation on the resource pool;
wherein the additional operations include resource encryption, resource encoding, resource compression, and resource statistics.
Optionally, the resource pool factory includes a newly-built resource pool and an agent resource pool, where the newly-built resource pool is used to store the custom resource pool, and the agent resource pool is used to store the agent resource pool.
Optionally, the proxy resource pool includes an active queue and a free queue, the active queue is used for storing the resource pool that has been leased, and the free queue is used for storing the resource pool that has not been leased.
The application also provides a resource pool management method, which comprises the following steps:
receiving a resource pool;
storing the resource pool to a resource pool factory through a preset resource leasing interface;
And when receiving a resource request of a requester, configuring a resource pool according to the resource request, and calling the preset resource leasing interface through a container agent to perform resource interaction with the requester.
Optionally, after receiving the resource pool, the method further includes:
judging whether the resource pool is a user-defined resource pool or not;
if not, the resource pool is configured by the default configuration value of the configuration center;
and if so, configuring the resource pool by using the user-defined configuration value.
Optionally, the invoking the preset resource leasing interface by the container agent to perform resource interaction with the requester further includes:
and utilizing the interceptor to perform one or any combination of resource encryption, resource encoding, resource compression and resource statistics on the resource pool.
Optionally, after the container agent calls the preset resource leasing interface to perform resource interaction with the requester, the method further includes:
transferring the resource pool from a free queue to an active queue; wherein resource pools located in the activation queue prohibit leasing.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.
The present application further provides a server comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when calling the computer program in the memory.
The application provides a resource pool management container, includes: the resource pool factory is used for storing the resource pool by a preset resource leasing interface; the resource interface is arranged in the resource pool factory and used for providing resource use service for the resource pool; the container agent is used for providing an external interaction interface of the resource pool management container; and the configuration center is used for providing configuration values for the resource pool.
According to the resource pool decoupling method and device, the resource pools in the system are concentrated through the resource pool management container, a user can directly obtain the resources from the resource pool management container when the resources are utilized, attention to each independent resource pool is not needed, the resources and the resource pools are decoupled, and the service efficiency of the resource pools is improved. The present application further provides a resource pool management method and a computer-readable storage medium, which have the above beneficial effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a resource pool management container according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a resource pool management method according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a resource pool management container according to an embodiment of the present application, where the resource pool management container may include:
the resource pool factory is used for storing the resource pool by a preset resource leasing interface;
the resource interface is arranged in the resource pool factory and used for providing resource use service for the resource pool;
the container agent is used for providing an external interaction interface of the resource pool management container;
and the configuration center is used for providing configuration values for the resource pool.
Resource pool factories, as the name implies, are factories that create and destroy resource pools. It itself holds a set of resource pools representing the resource pools currently contained in the entire container. As a preferred embodiment, for a resource pool factory, resource pools can be divided into two categories, namely a newly-built resource pool and an agent resource pool, the newly-built resource pool refers to a custom resource pool created by using a universal resource pool model, the agent resource pool refers to an agent implemented for an existing resource pool, and the agent adapts to a resource renting interface to ensure a uniform resource renting interface. For the newly-built resource pool, the resource pool factory also holds two resource queues corresponding to the newly-built resource pool, an activation queue and an idle queue, wherein the activation queue stores the resource sets which are leased, and the idle queue stores the resource sets which are not leased currently. The resource pool factory, as a carrier of the container, is a core part of the container.
When a new resource pool is accessed, the resource pool factory can allocate a unique resource pool identifier to each resource pool, so that the resource pools can be managed and identified conveniently.
The resource interface is an interface through which each newly created resource pool must be implemented, and includes but is not limited to creating resources, destroying resources, leasing resources, returning resources and waiting. The resource pool factory can invoke the resource interface to maintain the state of the internal resource pool.
And the container agent provides an external interaction interface of the resource pool management container. The interface is an interactive interface between the whole container and a resource applicable party, and provides functions of registering a resource pool to a resource interface, acquiring the resource pool from the resource interface, acquiring certain resource pool configuration, directly renting resources through the container and the like.
The configuration center collects the configuration of each resource pool together, is a hub of the container and is supplemented with the resource pool factory. How and when the resource pool factory changes the state of the resource is determined by the configuration center. The configuration center provides default values for commonly used configurations, particularly when a resource pool configuration is default. Certainly, if the user-defined resource pool is configured, the user-defined configuration value may be adopted, and the configuration is not necessarily configured by adopting a default configuration value. The configuration values included in the configuration center are not limited, and may include a resource pool unique identifier, a resource class, and interceptor list waiting information.
According to the resource pool management method and device, the resource pools in the system are concentrated through the resource pool management container, a user can directly obtain the resources from the resource pool management container when the resources are utilized, the user does not need to pay attention to each independent resource pool, the resources and the resource pools are decoupled, the resource pools are conveniently modified and configured to be checked, and the use efficiency of the resource pools is improved.
Based on the foregoing embodiment, as a preferred embodiment, the resource pool management container may further include:
and the interceptor is used for intercepting the resource pool and executing additional operation on the resource pool.
Additional operations include resource encryption, resource encoding, resource compression, and resource statistics.
The interceptor is a usage enhancement to the resource pool for intercepting the resources to be used by the user, providing additional operations on resource usage. The system interceptor can act on the resources of the whole factory, and the application interceptor can only act on the resources under the name of a certain resource pool. The function of the system is divided into a front interceptor and a rear interceptor, wherein the front interceptor takes effect before the use of the resource, and the rear interceptor takes effect after the use of the resource. The interceptor needs to implement a specified interface, and is optional, and there may be multiple interceptors, each corresponding to an enhanced function. The present embodiment aims to provide additional enhanced functionality for resource usage by a flexible interceptor.
In the following, a resource pool management method provided by an embodiment of the present application is introduced, and a resource pool management method described below and a resource pool management container described above may be referred to in a corresponding manner.
The application also provides a resource pool management method, which comprises the following steps:
s101: receiving a resource pool;
s102: storing the resource pool to a resource pool factory through a preset resource renting interface;
s103: and when receiving a resource request of a requester, configuring a resource pool according to the resource request, and calling a preset resource renting interface through a container agent to perform resource interaction with the requester.
The resource leasing interface is not specifically limited, and may be set by one skilled in the art.
It should be noted that, in this embodiment, S103 is independent from the foregoing two steps, that is, the execution step after receiving the resource pool is independent from the execution step after receiving the resource request, and even the two processes may be performed synchronously.
After receiving the resource request, the resource pool can be configured by using the configuration center according to the requirement of the requester. Particularly, whether the resource pool is a user-defined resource pool or not can be judged, and if not, the resource pool is configured by using a default configuration value of a configuration center; if the resource pool is a custom resource pool, the resource pool can be configured by using the custom configuration value without using the default configuration value. The resource pool can be leased to the requester by calling a preset resource lease interface through the container agent. It should be noted that the external interactive interface provided by the container agent is used for transmitting the resource pool, and the preset resource renting interface is an interface used by the requester for directly using the resource pool, and when the requester rents the resource pool, the two interfaces may be the same interface. And a uniform resource renting interface is adopted, so that the use efficiency of a requester on resources can be improved, and the use rate of a resource pool is optimized.
Based on the above embodiment, as a preferred embodiment, when step S103 is executed, one or any combination of resource encryption, resource encoding, resource compression, and resource statistics may be further executed on the resource pool by using an interceptor. For the description of the interceptor, see above, it is not repeated here.
The following describes a resource pool management container and a resource pool management method provided in the present application in a practical application process of the present application:
1) first, before starting the container, the resource pool already existing can be entrusted with the resource factory management of the resource under its own name. The resource factory will create a proxy for the resource pool and adapt the original resource pool lease interface to the preset resource lease interface. And storing the unique identifier of the resource pool in a configuration center.
2) For the user-defined resource pool, the configuration attribute can be stored in a configuration center, the resource pool has a unique identifier and a resource class; a resource factory implementation class; a list of interceptors; the number of initialized resources, the maximum number of resources, the longest waiting time for acquiring resources, and the like. When the container is started, the resource pool factory can create a user-defined resource pool according to the configuration, and simultaneously initialize corresponding activated queues and idle queues.
3) If desired, system interceptors and application interceptors are added to the container. There may be multiple of these two interceptors, but a defined interceptor interface needs to be implemented. The resource enhancement functions such as resource encryption and decryption, resource coding and decoding, resource compression and decompression, log printing, resource use condition statistics and the like can be realized through the interceptor. If no interceptor is needed, the step is skipped and the step is directly entered into the step 4).
4) Starting a container, initializing a resource pool by a resource pool factory according to configuration, simultaneously initializing corresponding active queues and idle queues,
the idle queue stores initialization resources and the active queue is empty.
5) A resource is acquired by the container agent. And changing the resource state, and taking out the resource from the idle queue to be stored in the active queue. The resource can be acquired in two modes, and the resource pool name of the configuration center is required to exist in the mode; the method has the advantages that the user does not need to pay attention to the name of the resource pool by acquiring the resource type, and the method is suitable for only one type of resource pool in a resource factory.
6) And sequentially executing a front-end system interceptor a, a front-end system interceptor b, a front-end application interceptor c and a front-end application interceptor d according to the interceptor adding sequence. If no interceptor is set, the step is skipped.
7) The user uses the resource.
8) And after the user uses the resources, sequentially executing a post-application interceptor d, a post-application interceptor c, a post-system interceptor b and a post-application interceptor a according to the interceptor adding sequence. If no interceptor is set, the step is skipped.
9) Returning the resource and changing the resource state. Resources are taken from the active queue for storage in the free queue. And 5-10 steps are packaged into a code template, the template can be executed by using a uniform resource leasing interface, and the interface parameters are the unique resource pool identification and the resource use function expression.
10) Destroying resources, destroying a resource pool and destroying a container.
11) The system terminates.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. A resource pool management container, comprising:
the resource pool factory is used for storing the resource pool by a preset resource leasing interface;
the resource interface is arranged in the resource pool factory and used for providing resource use service for the resource pool;
the container agent is used for providing an external interaction interface of the resource pool management container;
and the configuration center is used for providing configuration values for the resource pool.
2. The resource pool management container according to claim 1, further comprising:
the interceptor is used for intercepting the resource pool and executing additional operation on the resource pool;
wherein the additional operations include resource encryption, resource encoding, resource compression, and resource statistics.
3. The resource pool management container according to claim 1, wherein the resource pool factory comprises a new resource pool for storing custom resource pools and a proxy resource pool for storing a proxy resource pool.
4. The resource pool management container according to claim 3, wherein the proxy resource pool comprises an active queue for holding resource pools that have been leased and a free queue for holding resource pools that have not been leased.
5. A resource pool management method is characterized by comprising the following steps:
receiving a resource pool;
storing the resource pool to a resource pool factory through a preset resource leasing interface;
and when receiving a resource request of a requester, configuring a resource pool according to the resource request, and calling the preset resource leasing interface through a container agent to perform resource interaction with the requester.
6. The method of claim 5, further comprising, after receiving the resource pool:
judging whether the resource pool is a user-defined resource pool or not;
if not, the resource pool is configured by the default configuration value of the configuration center;
and if so, configuring the resource pool by using the user-defined configuration value.
7. The resource pool management method according to claim 5, when the container agent calls the predetermined resource leasing interface to perform resource interaction with the requester, further comprising:
and utilizing the interceptor to perform one or any combination of resource encryption, resource encoding, resource compression and resource statistics on the resource pool.
8. The resource pool management method of claim 5, after the calling the pre-configured resource leasing interface by the container agent to perform resource interaction with the requester, further comprising:
Transferring the resource pool from a free queue to an active queue; wherein resource pools located in the activation queue prohibit leasing.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 5 to 8.
CN202010616619.0A 2020-06-30 2020-06-30 Resource pool management container, management method and storage medium thereof Withdrawn CN111857950A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010616619.0A CN111857950A (en) 2020-06-30 2020-06-30 Resource pool management container, management method and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010616619.0A CN111857950A (en) 2020-06-30 2020-06-30 Resource pool management container, management method and storage medium thereof

Publications (1)

Publication Number Publication Date
CN111857950A true CN111857950A (en) 2020-10-30

Family

ID=72989737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010616619.0A Withdrawn CN111857950A (en) 2020-06-30 2020-06-30 Resource pool management container, management method and storage medium thereof

Country Status (1)

Country Link
CN (1) CN111857950A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667408A (en) * 2023-12-07 2024-03-08 北京中科大洋科技发展股份有限公司 GPU resource sharing management scheduling method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667408A (en) * 2023-12-07 2024-03-08 北京中科大洋科技发展股份有限公司 GPU resource sharing management scheduling method and system
CN117667408B (en) * 2023-12-07 2024-05-14 北京中科大洋科技发展股份有限公司 GPU resource sharing management scheduling method and system

Similar Documents

Publication Publication Date Title
US11467890B2 (en) Processing event messages for user requests to execute program code
US9760387B2 (en) Programmatic event detection and message generation for requests to execute program code
JP5744717B2 (en) Method and device for accessing a directory
US9231995B2 (en) System and method for providing asynchrony in web services
CN113656157B (en) Distributed task scheduling method and device, storage medium and electronic equipment
WO2017059331A1 (en) Workflow service using state transfer
CN111221630B (en) Business process processing method, device, equipment, readable storage medium and system
US20180253342A1 (en) Discovery and exposure of transactional middleware server-based applications as consumable service endpoints
WO2021051881A1 (en) Vpp cluster management method and device, computer device and storage medium
US7774779B2 (en) Generating a timeout in a computer software application
JPWO2012008016A1 (en) Multithread processing apparatus, multithread processing system, multithread processing program, and multithread processing method
CN113703862A (en) Configuration-based interface calling method, device, equipment and storage medium
CN111857950A (en) Resource pool management container, management method and storage medium thereof
CN111277983A (en) RFID middleware, publish-subscribe system and data transmission method
CN109819674B (en) Computer storage medium, embedded scheduling method and system
WO2009129745A1 (en) A method and apparatus for interface invoking of distributed system
JP4303828B2 (en) Print management system and method
CN113626001A (en) API dynamic editing method and device based on script
CN110839085A (en) Instruction management method, instruction management device, electronic equipment and storage medium
CN111078206A (en) Form submitting method and system
CN110764903B (en) Method, apparatus, device and storage medium for elastically performing heat container
CN110995798B (en) Data communication method and system for functional mobile phone network application
CN116974730B (en) Large-batch task processing method
EP4383088A1 (en) Monitoring of resource consumption per tenant
CN113507464A (en) Data access method, device, equipment and storage medium based on virtual equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20201030

WW01 Invention patent application withdrawn after publication