CN114090268A - Container management method and container management system - Google Patents
Container management method and container management system Download PDFInfo
- Publication number
- CN114090268A CN114090268A CN202210024557.3A CN202210024557A CN114090268A CN 114090268 A CN114090268 A CN 114090268A CN 202210024557 A CN202210024557 A CN 202210024557A CN 114090268 A CN114090268 A CN 114090268A
- Authority
- CN
- China
- Prior art keywords
- container
- service
- information
- container group
- group
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a container management method and a container management system. The method comprises the steps of inquiring whether preset container group definition information corresponding to a service request exists or not under the condition of receiving the service request sent by a client; and calling the container resource in the container group corresponding to the preset container group definition information under the condition that the preset container group definition information corresponding to the service request exists. Therefore, in the process of calling the container resource in the service cluster to execute the service, the container resource corresponding to the service request is used for executing the service related to the service request, and the start-stop operation of the container resource in the service cluster is avoided, so that the time for starting and closing the service cluster is saved, and the service processing efficiency of the container resource is improved.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a container management method and a container management system.
Background
With the further increase of the service cluster size, it is difficult to process a large amount of newly added data by using a single distributed system, and on the basis, the micro-service technology is applied. At present, a code file corresponding to a service can be bound to a container resource in a service cluster to operate in a service containerization mode, so that the utilization rate of the service cluster is improved.
However, in the case of a newly added service, a new container resource needs to be bound to a newly defined code, and in the above process, start and stop operations are frequently performed on the container resource in the service cluster, which consumes a lot of time, thereby reducing the processing efficiency of the service using the container resource.
Disclosure of Invention
An object of embodiments of the present invention is to provide a container management method and a container management system, which solve the technical problem of low processing efficiency of services using container resources in the prior art.
In order to solve the above technical problem, an embodiment of the present invention provides a container management method, where the method includes:
under the condition of receiving a service request sent by a client, inquiring whether preset container group definition information corresponding to the service request exists or not;
and under the condition that preset container group definition information corresponding to the service request exists, calling container resources in a container group corresponding to the preset container group definition information.
Optionally, after querying whether there is preset container group definition information corresponding to the service request, the method further includes:
under the condition that preset container group definition information corresponding to the service request does not exist, a target container group is created in a service cluster according to the service request; the target container group comprises at least one container resource;
and calling the container resource in the target container group.
Optionally, the creating, according to the service request, a target container group in a service cluster includes:
analyzing the service request to generate container group definition information; the container group definition information comprises container quantity information and container configuration information obtained by analyzing the service request;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
the number of the container resources included in the target container group is the same as the number represented by the container number information, and the configuration of the container resources included in the target container group is the same as the configuration represented by the container configuration information.
Optionally, the creating, according to the service request, a target container group in a service cluster includes:
analyzing the service request to obtain service information and data information to be processed;
generating container group definition information according to the service information and the data information to be processed; the container group definition information comprises container quantity information and container configuration information determined based on the service information and the to-be-processed data information;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
the number of the container resources included in the target container group is the same as the number represented by the container number information, and the configuration of the container resources included in the target container group is the same as the configuration represented by the container configuration information.
Optionally, the generating the container group definition information according to the service information and the to-be-processed data information includes:
inquiring the service information and the to-be-processed data information in a preset database to obtain historical container group information; the database stores the mapping relation between the service information and the to-be-processed data information and historical container group information, and the historical container group information comprises container quantity information and container configuration information;
determining the history container group information as the container group definition information.
Optionally, the invoking the container resource in the container group corresponding to the preset container group definition information includes:
calling a main container in the container group to obtain a service code and data to be processed, and distributing the service code and the data to be processed to a slave container in the container group; the service code and the data to be processed are associated with the service request;
and calling the container resources in the container group to execute the service based on the corresponding service codes and the data to be processed.
Optionally, before the calling the main container in the container group to obtain the service code and the data to be processed, the method further includes:
determining a main container in the container group based on container configuration information of each container resource in the container group and/or an operating environment corresponding to the container group;
sending interface information to the client; the interface information comprises an address corresponding to the main container.
Optionally, after the calling the container resource in the container group executes a service based on the corresponding service code and the data to be processed, the method further includes:
under the condition that the container group finishes the operation of the service code, sending an operation result of the service code to the client;
and performing initialization processing on the container group.
Optionally, the method further comprises:
under the condition that a deletion instruction which is sent by a client and is associated with preset container group definition information is received, closing a container group corresponding to the preset container group definition information; or the like, or, alternatively,
and under the condition that the container resources in the container group included by the service cluster are monitored to be abnormal, deleting the container group definition information corresponding to the container group so as to close the container group.
An embodiment of the present invention further provides a container management system, where the container management system includes:
the system comprises an inquiry module, a service request sending module and a service processing module, wherein the inquiry module is used for inquiring whether preset container group definition information corresponding to the service request exists or not under the condition of receiving the service request sent by a client;
and the first calling module is used for calling the container resource in the container group corresponding to the preset container group definition information under the condition that the preset container group definition information corresponding to the service request exists.
The embodiment of the invention also provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; a memory for storing a computer program; the processor is configured to implement the container management method described above when executing the program stored in the memory.
Embodiments of the present invention also provide a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the container management method described above.
Embodiments of the present invention also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the container management method as described above.
In the embodiment of the invention, under the condition of receiving the service request, whether preset container group definition information corresponding to the service request exists is inquired; and under the condition that the preset container group definition information corresponding to the service request exists, calling the container resource in the container group corresponding to the preset container group definition information. Therefore, in the process of calling the container resource in the service cluster to execute the service, the container resource corresponding to the service request is used for executing the service related to the service request, and the start-stop operation of the container resource in the service cluster is avoided, so that the time for starting and closing the service cluster is saved, and the service processing efficiency of the container resource is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flow chart illustrating a method for managing containers according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a container management system according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an application scenario of a container management method according to an embodiment of the present invention;
FIG. 4 is a second schematic structural diagram of a container management system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a container management method according to an embodiment of the present invention. The container management method provided by the embodiment of the invention comprises the following steps:
s101, under the condition of receiving a service request sent by a client, inquiring whether preset container group definition information corresponding to the service request exists.
The embodiment of the present invention may be applied to a container management system, where the container management system is in communication with a client and a service cluster, where a service cluster may be understood as a cluster including a plurality of servers, and each server may be regarded as a container resource.
In this step, when a service request sent by a client is received, it is checked whether container group definition information corresponding to the service request exists. The container group definition information includes the number of container resources in a preset container group and the configuration information of each container resource.
And S102, under the condition that the preset container group definition information corresponding to the service request exists, calling the container resource in the container group corresponding to the preset container group definition information.
In this step, in the presence of the preset container group definition information, the container resource in the container group corresponding to the preset container group definition information, that is, the container resource in the preset container group, is called. Please refer to the following embodiments for a specific technical solution of how to call a container resource in a container group corresponding to preset container group definition information.
In the embodiment of the invention, under the condition of receiving the service request, whether preset container group definition information corresponding to the service request exists is inquired; and calling the container resource in the container group corresponding to the preset container group definition information under the condition that the preset container group definition information corresponding to the service request exists and the execution request sent by the client is received. Therefore, in the process of calling the container resource in the service cluster to execute the service, the container resource corresponding to the service request is used for executing the service related to the service request, and the start-stop operation of the container resource in the service cluster is avoided, so that the time for starting and closing the service cluster is saved, and the service processing efficiency of the container resource is improved.
Optionally, after querying whether there is preset container group definition information corresponding to the service request, the method further includes:
under the condition that preset container group definition information corresponding to the service request does not exist, a target container group is created in a service cluster according to the service request;
and calling the container resource in the target container group.
In this step, in the absence of the preset container group definition information corresponding to the service request, that is, in the absence of the preset container group, the target container group is created according to the service request. Wherein the target container group comprises at least one container resource. Please refer to the following embodiments, specifically how to create a target container group in a service cluster according to a service request. Further, after the target container group is created, the container resource in the target container group is called, and the service corresponding to the service request is executed.
Optionally, a load component may be configured in each container resource of the service cluster, and the container resource is managed by using the load component.
Optionally, the creating, according to the service request, a target container group in a service cluster includes:
analyzing the service request to generate container group definition information;
and determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group.
The service request includes container quantity information and container configuration information, where the container quantity information indicates the quantity of container resources in the target container group, and the container configuration information indicates the configuration corresponding to each container resource in the target container group, where the container configuration information includes, but is not limited to, CPU parameters of the container resources and memory space of the container resources.
After receiving a service request sent by a client, analyzing the service request to obtain container quantity information and container configuration information, and further generating container group definition information based on the container quantity information and the container configuration information. The container group definition information includes container number information and container configuration information obtained by analyzing the service request.
In this embodiment, the container resource corresponding to the container group definition information in the service cluster is determined as the container resource in the target container group. It should be understood that the number of container resources in the target container group is the same as the number represented by the container number information, and the configuration of container resources in the target container group is the same as the configuration represented by the container configuration information.
In this embodiment, the service request includes container quantity information and container configuration information, and the container quantity information and the container configuration information are used to generate container group definition information, thereby determining container resources in the container group. Therefore, in the subsequent service processing process, the target container group is used for processing the service, the starting and stopping operation of the container resources in the service cluster is avoided, the time for starting and closing the service cluster is saved, and the processing efficiency of the container resources on the service is improved.
Optionally, the creating, according to the service request, a target container group in a service cluster includes:
analyzing the service request to obtain service information and data information to be processed;
generating container group definition information according to the service information and the data information to be processed;
and determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group.
The service request comprises service information and data to be processed information, the service information comprises but is not limited to the type of the service request, and the data to be processed information comprises the data volume size of the service corresponding to the service request and the response speed corresponding to the service.
In this embodiment, the service request is analyzed to obtain service information and to-be-processed data information, and then, based on the service information and the to-be-processed data information, container group definition information is generated. As described above, the container group definition information includes the container number information and the container configuration information determined based on the service information and the to-be-processed data information, and please refer to the following embodiments in order to describe how to generate the container group definition information according to the service information and the to-be-processed data information.
In this embodiment, the container resource corresponding to the container group definition information in the service cluster is determined as the container resource in the target container group. It should be understood that the number of container resources in the target container group is the same as the number represented by the container number information, and the configuration of container resources in the target container group is the same as the configuration represented by the container configuration information.
In this embodiment, the service request includes service information and to-be-processed data information, and the number information of the containers and the configuration information of the containers are determined by using the service information and the to-be-processed data information, so as to determine container group definition information and determine container resources in the target container group. Therefore, in the subsequent service processing process, the target container group is used for processing the service, the starting and stopping operation of the container resources in the service cluster is avoided, the time for starting and closing the service cluster is saved, and the processing efficiency of the container resources on the service is improved.
The following specifically explains how to generate the technical scheme of the container group definition information according to the service information and the to-be-processed data information:
optionally, the generating the container group definition information according to the service information and the to-be-processed data information includes:
inquiring the service information and the to-be-processed data information in a preset database to obtain historical container group information;
determining the history container group information as the container group definition information.
In this embodiment, a database is preset, and the database stores mapping relationships between service information, to-be-processed data information, and historical container group information, where the historical container group information is container group definition information of a container group created by a container management system.
After the service request is analyzed to obtain service information and data information to be processed, the service information and the data information to be processed are input into a database to be inquired to obtain historical container group information, and the historical container group information is determined to be container group definition information, wherein the historical container group information comprises container quantity information and container configuration information. Further, the container resource corresponding to the container group definition information in the service cluster is determined as the container resource in the target container group, it should be understood that the number of the container resources in the target container group is the same as the number represented by the container number information, and the configuration of the container resource in the target container group is the same as the configuration represented by the container configuration information.
That is, the container management system may determine, based on the service information and the pending data information in the service request, historical container group information, that is, a container group created by the container management system, and further determine the historical container group information as container group definition information.
Optionally, the generating the container group definition information according to the service information and the to-be-processed data information includes: analyzing and predicting the service information and the to-be-processed data information based on a pre-trained container resource recommendation model to obtain a prediction result; determining the prediction result as the container group definition information. And the prediction result comprises the number of the container resources in the container group and the container configuration information of each container resource.
Specifically, the training process of the container resource recommendation model includes: and counting historical service execution information to obtain sample data, wherein the historical service execution information comprises historical service information, processing data corresponding to each historical service and container group definition information corresponding to the historical service information. Taking historical service information and processing data corresponding to each historical service as characteristic data, and taking container group definition information as target data to obtain sample data; and then, outputting the sample data to an operator model to be trained for model training to obtain the container resource recommendation model. Therefore, the container resource recommendation model is used for predicting the service information and the to-be-processed data information to obtain the container group definition information automatically recommended by the system, so that the automatic creation of the container group is realized, and the operation difficulty of a user is reduced.
Optionally, the invoking the container resource in the container group corresponding to the preset container group definition information to execute the service corresponding to the service request includes:
calling a main container in the container group to obtain a service code and data to be processed, and distributing the service code and the data to be processed to a slave container in the container group; the service code and the data to be processed are associated with the service request;
and calling the container resources in the container group to execute the service based on the corresponding service codes and the data to be processed.
In this embodiment, the client may further send an execution request to the container management system, where the execution request includes a service code and data to be processed, and the execution request is associated with the service request. In this way, the master container in the container group acquires the service code and the data to be processed, and distributes the service code and the data to be processed to other slave containers in the container group.
After each container resource of the container group acquires the service code and the data to be processed, the container resource in the container group is called to run the service code and the data to be processed, and the service is executed. Wherein, in case the container group runs the service code, sending an execution log to the client.
Optionally, before the calling of the main container in the container group to obtain the service code and the data to be processed, the method includes:
and determining a main container in the container group based on the container configuration information of each container resource in the container group and/or the operating environment corresponding to the container group.
As described above, the container configuration information includes, but is not limited to, CPU parameters of the container resource, and memory space of the container resource. The service request further comprises an environment parameter, and the environment parameter is used for representing the running environment corresponding to the target container group.
In this embodiment, after the service request is analyzed, the container configuration information and the environment parameter representing the operating environment of the target container group are obtained, and further, the main container in the container group may be determined based on the container configuration information and the operating environment corresponding to the target container group.
In an optional embodiment, the operating environment corresponding to the container group is a tensoflow framework, in this case, the container group may be arranged according to the configuration information corresponding to each container resource, and the container resource with the highest container resource configuration is determined to be the main container. For example, the container resource with the largest memory space is determined as the main container.
Another optional implementation manner is that the operating environment corresponding to the container group is a Spak framework, and the main container in the container group can be directly determined based on the Spak framework.
In this embodiment, after a container group is created and a master container in the container group is determined, interface information is sent to a client, where the interface information may be transmitted through a connection session (podSession) established between the client and a container management system, and the interface information includes an address corresponding to the master container.
It should be noted that, selecting one container resource from the multiple container resources of the container group as a main container, obtaining the service code and the data to be processed from the client by using the main container, and distributing the service code and the data to be processed by the main container, can ensure that each container resource in the container group executes the same service and the accuracy of service operation.
Optionally, after the calling the container resource in the container group executes a service based on the corresponding service code and the data to be processed, the method further includes:
under the condition that the container group finishes the operation of the service code, sending an operation result of the service code to the client;
and performing initialization processing on the container group.
In this embodiment, when the container group completes the operation of the service code, the operation result of the service code is asynchronously sent to the client, where the operation result includes a code operation success result or a code operation failure result.
Further, after sending the operation result to the client, the container management system performs initialization processing on the container group, where the initialization processing includes cleaning processes, work directories, environment variables, and the like in the container group to implement environment reset, so that the container group can be reused continuously when a next service request is received.
Optionally, after querying whether there is preset container group definition information corresponding to the service request in the case of receiving the service request sent by the client, the method further includes:
under the condition that a deletion instruction which is sent by a client and is associated with preset container group definition information is received, closing a container group corresponding to the preset container group definition information; or the like, or, alternatively,
and under the condition that the container resources in the container group included by the service cluster are monitored to be abnormal, deleting the container group definition information corresponding to the container group so as to close the container group.
In an alternative embodiment, the client may send a deletion instruction to the container management system, where the deletion instruction is associated with the preset container group definition information. And under the condition of receiving a deletion instruction, deleting the preset container group definition information so as to close the container group corresponding to the preset container group definition information.
Another optional embodiment is that the container management system is provided with a monitoring component, where the monitoring component is configured to monitor a container group in the service cluster, and delete container group definition information corresponding to an abnormal container group to close the container group in order to guarantee normal operation of the container management system when it is monitored that a container resource in the container group included in the service cluster is abnormal.
In this embodiment, the container resources in the target container group are closed by deleting the container group definition information, so as to ensure the operation consistency among the containers in the target container group.
In other embodiments, the container management system provided by the present embodiment includes a service management component, a container cluster, and a network file system. Referring to fig. 2, the app in fig. 2 represents a client, podManager represents a container management component, severManager represents a service management component, k8s represents a container cluster, and nfs represents a network file system.
In the scenario shown in fig. 2, the client communicates with the container management component and the service management component, and the middleware communicates with the container management component and the service management component, wherein the container cluster communicates with the service management component through a service interface, which may be sevelapi. The network file system is communicated with the service management component and the container cluster, the shared directory of the network file system is uniformly mounted on the container resources in the service cluster, and different execution programs are designated in the container resources through the change of the code directory path.
It should be understood that, after receiving the execution request sent by the client, the service management component may send the service code in the execution request to the network file system, and the container cluster reads the service code from the network file system in response to the execution request and calls the container group to run the service code.
To facilitate understanding of the overall technical solution, please refer to fig. 3, and fig. 3 is an application scenario diagram of a container management method according to an embodiment of the present invention. The client in fig. 3 represents a client, the severManager represents a service management component, the podManager represents a container management component, k8s/pod represents a container cluster, crd represents container group definition information, podSession represents session connection, and url represents an address.
In the scenario shown in fig. 3, the client sends a service request to the service management component to start the container, where the service request includes container configuration information and container quantity information, the quantity of the container resource represented by the container quantity information is 2, and the container configuration represented by the container configuration information configures 2 CPUs and 2G memories for each container. And the service management component sends the service request to the container management component, and the container management component creates the container group definition information and sends the container group definition information to the container cluster after receiving the service request. Wherein the generation and deletion of the container group definition information can be monitored in the container management component using a watch event.
After successful creation of the container group definition information in the container cluster, the container cluster asynchronously sends the results of the successful creation to the container management component. The container cluster creates a target container group including a plurality of containers in the service cluster according to the container group definition information, and determines a master container in the target container group, which is a master node in fig. 3.
After the creation of the container group is successful, the container management component sends interface information to the service management component, wherein the interface information comprises the address of the master container, i.e. the container master node url in fig. 3, and the service management component sends the interface information to the client.
When receiving an execution request sent by a client, the service management component sends the execution request to the master container, which is the execution code request in fig. 3. And the container cluster synchronization sends an execution log to the service management component, and sends an execution result to the service management component after the target container group runs the service code in the execution request. And the service management component sends the execution log and the execution result to the client.
As shown in fig. 4, an embodiment of the present invention further provides a container management system 200, where the container management system 200 includes:
the query module 201 is configured to query whether there is preset container group definition information corresponding to a service request when the service request sent by a client is received;
a first calling module 202, configured to, in a case that there is preset container group definition information corresponding to the service request, call a container resource in a container group corresponding to the preset container group definition information.
Optionally, the container management system 200 further comprises:
the creating module is used for creating a target container group in a service cluster according to the service request under the condition that preset container group definition information corresponding to the service request does not exist; the target container group comprises at least one container resource;
and the second calling module is used for calling the container resources in the target container group.
Optionally, the creating module is specifically configured to:
analyzing the service request to generate container group definition information;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
the number of the container resources included in the target container group is the same as the number represented by the container number information, and the configuration of the container resources included in the target container group is the same as the configuration represented by the container configuration information.
Optionally, the creating module is further specifically configured to:
analyzing the service request to obtain service information and data information to be processed;
generating container group definition information according to the service information and the data information to be processed; the container group definition information comprises container quantity information and container configuration information determined based on the service information and the to-be-processed data information;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
the number of the container resources included in the target container group is the same as the number represented by the container number information, and the configuration of the container resources included in the target container group is the same as the configuration represented by the container configuration information.
Optionally, the creating module is further specifically configured to:
inquiring the service information and the to-be-processed data information in a preset database to obtain historical container group information; the database stores the mapping relation between the service information and the to-be-processed data information and historical container group information, and the historical container group information comprises container quantity information and container configuration information;
determining the history container group information as the container group definition information.
Optionally, the first invoking module 202 is specifically configured to:
calling a main container in the container group to obtain a service code and data to be processed, and distributing the service code and the data to be processed to a slave container in the container group; the service code and the data to be processed are associated with the service request;
and calling the container resources in the container group to execute the service based on the corresponding service codes and the data to be processed.
Optionally, the first invoking module 202 is further specifically configured to:
determining a main container in the container group based on container configuration information of each container resource in the container group and/or an operating environment corresponding to the container group;
sending interface information to the client; the interface information comprises an address corresponding to the main container.
Optionally, the container management system 200 further includes:
the sending module is used for sending the operation result of the service code to the client under the condition that the operation of the container group is finished;
and the first processing module is used for carrying out initialization processing on the container group.
Optionally, the container management system 200 further comprises:
the second processing module is used for closing the container group corresponding to the preset container group definition information under the condition of receiving a deletion instruction which is sent by the client and is associated with the preset container group definition information; or the like, or, alternatively,
and the third processing module is used for deleting the container group definition information corresponding to the container group to close the container group when monitoring that the container resources in the container group included in the service cluster are abnormal.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304.
A memory 303 for storing a computer program;
a processor 301, configured to, when executing the program stored in the memory 303, query whether there is preset container group definition information corresponding to a service request sent by a client when the computer program is executed by the processor 301 and the service request is received;
and under the condition that preset container group definition information corresponding to the service request exists, calling container resources in a container group corresponding to the preset container group definition information.
Optionally, the computer program, when executed by the processor 301, is further configured to create a target container group in a service cluster according to the service request in the absence of preset container group definition information corresponding to the service request;
and calling the container resource in the target container group.
Optionally, the computer program, when executed by the processor 301, is further configured to parse the service request, and generate container group definition information;
and determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group.
Optionally, the computer program, when executed by the processor 301, is further configured to parse the service request, and obtain service information and data information to be processed;
generating container group definition information according to the service information and the data information to be processed;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
optionally, when being executed by the processor 301, the computer program is further configured to query the service information and the to-be-processed data information in a preset database, so as to obtain historical container group information;
determining the history container group information as the container group definition information.
Optionally, the computer program, when executed by the processor 301, is further configured to call a master container in the container group to obtain service codes and data to be processed, and distribute the service codes and the data to be processed to slave containers in the container group;
and calling the container resources in the container group to execute the service based on the corresponding service codes and the data to be processed.
Optionally, the computer program, when executed by the processor 301, is further configured to determine a main container in the container group based on container configuration information of each container resource in the container group and/or a running environment corresponding to the container group;
and sending interface information to the client.
Optionally, the computer program, when executed by the processor 301, is further configured to send a running result of the service code to the client if the container group runs to complete the service code;
and performing initialization processing on the container group.
Optionally, the computer program, when executed by the processor 301, is further configured to close a container group corresponding to preset container group definition information when a deletion instruction associated with the preset container group definition information and sent by a client is received; or the like, or, alternatively,
and under the condition that the container resources in the container group included by the service cluster are monitored to be abnormal, deleting the container group definition information corresponding to the container group so as to close the container group.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, and when the instructions are executed on a computer, the instructions cause the computer to execute the container management method according to any one of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of container management as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (12)
1. A method of container management, comprising:
under the condition of receiving a service request sent by a client, inquiring whether preset container group definition information corresponding to the service request exists or not;
and under the condition that preset container group definition information corresponding to the service request exists, calling container resources in a container group corresponding to the preset container group definition information.
2. The method according to claim 1, wherein after querying whether there is preset container group definition information corresponding to the service request, the method further comprises:
under the condition that preset container group definition information corresponding to the service request does not exist, a target container group is created in a service cluster according to the service request; the target container group comprises at least one container resource;
and calling the container resource in the target container group.
3. The method of claim 2, wherein the creating a target group of containers in a service cluster according to the service request comprises:
analyzing the service request to generate container group definition information; the container group definition information comprises container quantity information and container configuration information obtained by analyzing the service request;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
the number of the container resources included in the target container group is the same as the number represented by the container number information, and the configuration of the container resources included in the target container group is the same as the configuration represented by the container configuration information.
4. The method of claim 2, wherein the creating a target group of containers in a service cluster according to the service request comprises:
analyzing the service request to obtain service information and data information to be processed;
generating container group definition information according to the service information and the data information to be processed; the container group definition information comprises container quantity information and container configuration information determined based on the service information and the to-be-processed data information;
determining the container resource corresponding to the container group definition information in the service cluster as the container resource in the target container group;
the number of the container resources included in the target container group is the same as the number represented by the container number information, and the configuration of the container resources included in the target container group is the same as the configuration represented by the container configuration information.
5. The method according to claim 4, wherein the generating of the container group definition information according to the service information and the to-be-processed data information comprises:
inquiring the service information and the to-be-processed data information in a preset database to obtain historical container group information; the database stores the mapping relation between the service information and the to-be-processed data information and historical container group information, and the historical container group information comprises container quantity information and container configuration information;
determining the history container group information as the container group definition information.
6. The method according to claim 1, wherein the invoking the container resource in the container group corresponding to the preset container group definition information comprises:
calling a main container in the container group to obtain a service code and data to be processed, and distributing the service code and the data to be processed to a slave container in the container group; the service code and the data to be processed are associated with the service request;
and calling the container resources in the container group to execute the service based on the corresponding service codes and the data to be processed.
7. The method of claim 6, wherein prior to said invoking the master container in the set of containers to obtain the service code and the pending data, the method further comprises:
determining a main container in the container group based on container configuration information of each container resource in the container group and/or an operating environment corresponding to the container group;
sending interface information to the client; the interface information comprises an address corresponding to the main container.
8. The method of claim 6, wherein after the invoking of the container resource in the container group executes the service based on the corresponding service code and the data to be processed, the method further comprises:
under the condition that the container group finishes the operation of the service code, sending an operation result of the service code to the client;
and performing initialization processing on the container group.
9. The container management method according to any one of claims 1 to 8, wherein the method further comprises:
under the condition that a deletion instruction which is sent by a client and is associated with preset container group definition information is received, closing a container group corresponding to the preset container group definition information; or the like, or, alternatively,
and under the condition that the container resources in the container group included by the service cluster are monitored to be abnormal, deleting the container group definition information corresponding to the container group so as to close the container group.
10. A container management system, comprising:
the system comprises an inquiry module, a service request sending module and a service processing module, wherein the inquiry module is used for inquiring whether preset container group definition information corresponding to the service request exists or not under the condition of receiving the service request sent by a client;
and the first calling module is used for calling the container resource in the container group corresponding to the preset container group definition information under the condition that the preset container group definition information corresponding to the service request exists.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the container management method of any one of claims 1 to 9 when executing a program stored in the memory.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the container management method according to any one of claims 1 to 9.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210024557.3A CN114090268B (en) | 2022-01-11 | 2022-01-11 | Container management method and container management system |
PCT/CN2022/125906 WO2023134247A1 (en) | 2022-01-11 | 2022-10-18 | Container management method and container management system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210024557.3A CN114090268B (en) | 2022-01-11 | 2022-01-11 | Container management method and container management system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114090268A true CN114090268A (en) | 2022-02-25 |
CN114090268B CN114090268B (en) | 2022-04-15 |
Family
ID=80308504
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210024557.3A Active CN114090268B (en) | 2022-01-11 | 2022-01-11 | Container management method and container management system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114090268B (en) |
WO (1) | WO2023134247A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023134247A1 (en) * | 2022-01-11 | 2023-07-20 | 北京九章云极科技有限公司 | Container management method and container management system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107766157A (en) * | 2017-11-02 | 2018-03-06 | 山东浪潮云服务信息科技有限公司 | Distributed container cluster framework implementation method based on domestic CPU and OS |
CN108833532A (en) * | 2018-06-13 | 2018-11-16 | 中国联合网络通信集团有限公司 | Service processing method, device and system based on internet of things |
CN110221901A (en) * | 2019-06-06 | 2019-09-10 | 深圳前海微众银行股份有限公司 | Container asset creation method, apparatus, equipment and computer readable storage medium |
CN110311973A (en) * | 2019-06-28 | 2019-10-08 | 东北大学 | A kind of image cloud service system and method towards multi-tenant |
CN111212116A (en) * | 2019-12-24 | 2020-05-29 | 湖南舜康信息技术有限公司 | High-performance computing cluster creating method and system based on container cloud |
US20200267210A1 (en) * | 2019-02-15 | 2020-08-20 | International Business Machines Corporation | Tool for managing and allocating resources in a clustered computing environment |
CN112424751A (en) * | 2018-07-19 | 2021-02-26 | 纳木技术株式会社 | Cluster resource allocation and management method on cloud platform |
US20210141655A1 (en) * | 2019-11-13 | 2021-05-13 | Vmware, Inc. | Unified resource management for containers and virtual machines |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10608896B2 (en) * | 2016-11-10 | 2020-03-31 | International Business Machines Corporation | Enforce pre-optimized service contracts associated with containers |
CN112650553B (en) * | 2020-12-09 | 2023-07-14 | 湖南麒麟信安科技股份有限公司 | Universal container management method and system |
CN114090268B (en) * | 2022-01-11 | 2022-04-15 | 北京九章云极科技有限公司 | Container management method and container management system |
-
2022
- 2022-01-11 CN CN202210024557.3A patent/CN114090268B/en active Active
- 2022-10-18 WO PCT/CN2022/125906 patent/WO2023134247A1/en unknown
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107766157A (en) * | 2017-11-02 | 2018-03-06 | 山东浪潮云服务信息科技有限公司 | Distributed container cluster framework implementation method based on domestic CPU and OS |
CN108833532A (en) * | 2018-06-13 | 2018-11-16 | 中国联合网络通信集团有限公司 | Service processing method, device and system based on internet of things |
CN112424751A (en) * | 2018-07-19 | 2021-02-26 | 纳木技术株式会社 | Cluster resource allocation and management method on cloud platform |
US20200267210A1 (en) * | 2019-02-15 | 2020-08-20 | International Business Machines Corporation | Tool for managing and allocating resources in a clustered computing environment |
CN110221901A (en) * | 2019-06-06 | 2019-09-10 | 深圳前海微众银行股份有限公司 | Container asset creation method, apparatus, equipment and computer readable storage medium |
CN110311973A (en) * | 2019-06-28 | 2019-10-08 | 东北大学 | A kind of image cloud service system and method towards multi-tenant |
US20210141655A1 (en) * | 2019-11-13 | 2021-05-13 | Vmware, Inc. | Unified resource management for containers and virtual machines |
CN111212116A (en) * | 2019-12-24 | 2020-05-29 | 湖南舜康信息技术有限公司 | High-performance computing cluster creating method and system based on container cloud |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023134247A1 (en) * | 2022-01-11 | 2023-07-20 | 北京九章云极科技有限公司 | Container management method and container management system |
Also Published As
Publication number | Publication date |
---|---|
CN114090268B (en) | 2022-04-15 |
WO2023134247A1 (en) | 2023-07-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108696581B (en) | Distributed information caching method and device, computer equipment and storage medium | |
US9535754B1 (en) | Dynamic provisioning of computing resources | |
CN108416449B (en) | Operation and maintenance method and device | |
CN109426510B (en) | Software processing method and device, electronic equipment and computer readable storage medium | |
CN104991821A (en) | Monitor task batch processing method and apparatus | |
CN112905323B (en) | Data processing method, device, electronic equipment and storage medium | |
CN112118352B (en) | Method and device for processing notification trigger message, electronic equipment and computer readable medium | |
CN109828830B (en) | Method and apparatus for managing containers | |
CN113760677A (en) | Abnormal link analysis method, device, equipment and storage medium | |
CN115935035A (en) | RPA flow visualization management method, device, equipment and readable storage medium | |
CN114090268B (en) | Container management method and container management system | |
CN111831503B (en) | Monitoring method based on monitoring agent and monitoring agent device | |
CN108132836B (en) | Task distribution method and device and electronic equipment | |
CN108696559B (en) | Stream processing method and device | |
CN110309028B (en) | Monitoring information acquisition method, service monitoring method, device and system | |
CN114595075A (en) | Network scheduling asynchronous task execution method based on distributed scheduling | |
CN111240998A (en) | Test case processing method and device | |
CN110955460A (en) | Service process starting method and device, electronic equipment and storage medium | |
CN115580522A (en) | Method and device for monitoring running state of container cloud platform | |
CN115373886A (en) | Service group container shutdown method, device, computer equipment and storage medium | |
CN113778780B (en) | Application stability determining method and device, electronic equipment and storage medium | |
CN113138772B (en) | Construction method and device of data processing platform, electronic equipment and storage medium | |
CN114816866A (en) | Fault processing method and device, electronic equipment and storage medium | |
CN114610413A (en) | Method, device, equipment and storage medium for executing synchronous and asynchronous tasks based on Java | |
CN113014456A (en) | Monitoring data transmission system, method, device, equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |