Container activation method and system and computing equipment
By deploying an authorization client on the host machine to communicate with the authorization server, a container activation service is established, and the activation request of the container authorization client is received and processed. This solves the problem of authorization spread in the container activation scheme, achieves rapid activation and limits the number of activations, and improves Improve activation efficiency and security.
Patent Information
- Application Number
- CN202410754967.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-11
AI Technical Summary
Existing container activation solutions lead to the problem of authorization creep and cannot effectively limit the number of container activations.
By deploying an authorization client on the host machine to communicate with the authorization server, obtain the host machine activation information and establish a container activation service, receive the activation request from the container authorization client, and send activation information based on the container information and activation limit quantity to achieve rapid activation of containers and Limit the number of activations.
Quickly activate the containers running on the host after activating the host, limit the number of container activations, avoid authorization spread, and improve activation efficiency and security.
Smart Images

Figure CN118760494A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a container activation method, a container activation system, a computing device and a storage medium. Background Art
[0002] The core of container technology is to run the process in a sandbox by limiting and isolating resources, and then package the sandbox into a container image (Image) and transplant it to another machine for direct operation without additional configuration. Among them, Docker is the de facto standard for container technology.
[0003] According to the existing container activation solutions, one is to activate the container by authorizing the container image and installing the container image; the other is to activate the container by purchasing the activation file. Both solutions will lead to the problem of authorization creep.
[0004] Therefore, a container activation method is needed to solve the problems existing in the above technical solutions. Summary of the invention
[0005] To this end, the present invention provides a container activation method and a container activation system to solve or at least alleviate the above problems.
[0006] According to one aspect of the present invention, there is provided a container activation method for activating a container running on a host machine, the method being executed on a host machine authorization client, the host machine authorization client being respectively adapted to communicate and connect with an authorization server and a container authorization client, the method comprising: requesting the authorization server to obtain host machine activation information; activating the host machine based on the host machine activation information; establishing a container activation service, receiving a container activation request sent by the container authorization client based on the container information through the container activation service, wherein the container activation service is used to communicate with the container authorization client for container activation, the container information comprising a container ID; through the container activation service, sending the container activation information to the container authorization client based on the container information and a corresponding container activation limit quantity, so that the container authorization client activates the container based on the container activation information.
[0007] Optionally, in the container activation method according to the present invention, sending the container activation information to the container authorization client based on the container information and the corresponding container activation limit quantity includes: acquiring the container activation limit quantity and the number of activated containers corresponding to the container information; if the container activation limit quantity is greater than the number of activated containers, sending the container activation information to the container authorization client.
[0008] Optionally, in the container activation method according to the present invention, obtaining the container activation limit number corresponding to the container information includes: obtaining the container activation limit number from the host activation information; or when activating the host based on the host activation information, obtaining the container activation limit number returned by the authorization server.
[0009] Optionally, in the container activation method according to the present invention, sending container activation information to the container authorization client based on the container information and the corresponding container activation limit number includes: determining whether the container corresponding to the container information is a container running on the host machine; if so, sending the container activation information to the container authorization client based on the container information and the corresponding container activation limit number.
[0010] Optionally, in the container activation method according to the present invention, the host activation information includes an activation serial number, host hardware information, and host system identification information; activating the host based on the host activation information includes: determining whether the host hardware information and the host system identification information in the host activation information match the host; if they match the host, verifying the validity of the activation serial number; if the verification passes, parsing the host activation information, and activating the host based on the parsed host activation information.
[0011] Optionally, in the container activation method according to the present invention, the host authorization client and the container authorization client are both deployed on the host; establishing a container activation service, and receiving a container activation request sent by the container authorization client based on the container information through the container activation service, including: creating a socket file, and establishing a socket service as a container activation service based on the socket file; and receiving the container activation request sent by the container authorization client based on the container information through the socket service.
[0012] Optionally, in the container activation method according to the present invention, the host authorization client is deployed on the host and is suitable for connecting to the container authorization client through a network communication; establishing a container activation service, and receiving a container activation request sent by the container authorization client based on the container information through the container activation service, including: listening to a port on the host corresponding to the host authorization client, and establishing a TCP service based on the port as a container activation service; and receiving a container activation request sent by the container authorization client based on the container information through the TCP service.
[0013] Optionally, in the container activation method according to the present invention, the container authorization client is suitable for: determining whether there is error information in the container activation information; if no error information exists, parsing the container activation information to extract container hardware information and container activation status information; and activating the container based on the container hardware information and container activation status information.
[0014] According to one aspect of the present invention, there is provided a container activation system, comprising: an authorization server, adapted to generate host activation information; a host authorization client, adapted to be deployed on a host, to be communicatively connected to the authorization server, and to be adapted to execute the method described above to activate the host and activate the container running on the host; and a container authorization client, adapted to be communicatively connected to the host authorization client, and to obtain container activation information from the host authorization client, and to activate the container based on the container activation information.
[0015] According to one aspect of the present invention, there is provided a computing device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for being executed by the at least one processor, and the program instructions include instructions for executing the container activation method as described above.
[0016] According to one aspect of the present invention, a computer program product is provided, comprising a computer program / instruction, wherein the computer program / instruction implements the method as described above when executed by a processor.
[0017] According to one aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the container activation method as described above.
[0018] According to the technical solution of the present invention, a container activation method is provided, in which a container authorization client can request an authorization server to obtain host activation information, and after activating the host based on the host activation information, a container activation service is established to communicate with the container authorization client, and then a container activation request sent by the container authorization client based on the container information can be received, and container activation information is sent to the container authorization client based on the container activation limit number, and the container authorization client activates the container based on the container activation information. It can be seen that according to the technical solution of the present invention, the container running on the host can be quickly activated after the host is activated, and the number of container activations can be limited to avoid the problem of authorization spread.
[0019] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0021] Figure 1 A schematic diagram of a container activation system 100 provided according to an embodiment of the present invention is shown;
[0022] Figure 2 A schematic diagram of a computing device 200 provided according to an embodiment of the present invention is shown;
[0023] Figure 3 A schematic flow chart of a container activation method 300 provided according to an embodiment of the present invention is shown;
[0024] Figure 4 A timing diagram of a container activation method provided according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0026] In view of the problem that the container activation solution in the prior art may cause authorization creep, an embodiment of the present invention provides a container activation method, which can quickly activate the container running on the host machine after activating the host machine, and can limit the number of container activations to avoid the problem of authorization creep.
[0027] The container activation method provided according to the embodiment of the present invention can be implemented in a container activation system. The container activation system of the present invention is described below.
[0028] Figure 1 A schematic diagram of a container activation system 100 provided according to an embodiment of the present invention is shown.
[0029] like Figure 1 As shown, the container activation system 100 includes a host authorization client 120, an authorization server 110, and a container authorization client 130. The host authorization client 120 can be connected to the authorization server 110 in communication, for example, through a wired or wireless network connection. In addition, the host authorization client 120 can be connected to the container authorization client 130 in communication.
[0030] In an embodiment of the present invention, the host authorization client 120 can be deployed on a host, and one or more containers (containers to be activated) can be run on the host. The host can be activated and the container running on the host can be activated by the host authorization client 120. Specifically, after activating the host, the host authorization client 120 can quickly activate the container running on the host.
[0031] The authorization server 110 is used to provide authorization services for the host authorization client 120, and it can be implemented as any computing device capable of providing authorization services in the prior art, and the present invention does not limit the specific type of the authorization server 110. For example, the authorization server 110 can be implemented as a desktop computer, a laptop computer, a processor chip, a mobile phone, a tablet computer, etc., but is not limited thereto. The authorization server 110 can also be a service program resident in a computing device.
[0032] In an embodiment of the present invention, the container authorization client 130 can be deployed on the host together with the host authorization client 120, so that the host authorization client 120 and the container authorization client 130 can communicate through a local socket. Alternatively, the container authorization client 130 can be deployed on other computing devices other than the host, and connected to the host authorization client 120 through network communication.
[0033] In an embodiment of the present invention, the authorization server 110 may pre-generate host activation information. The host authorization client 120 may establish a communication connection with the authorization server 110, and then request the authorization server 110 to obtain the host activation information. The authorization server 110 may return the host activation information to the host authorization client 120 in response to the request of the host authorization client 120. Afterwards, the host authorization client 120 may activate the host based on the host activation information. After the host authorization client 120 activates the host, it may establish a container activation service to activate the container running on the host. Specifically, the host authorization client 120 and the container authorization client 130 may communicate through the container activation service. The container authorization client 130 may send a container activation request to the host authorization client 120 based on the container information through the container activation service. The host authorization client 120 may receive the container activation request sent by the container authorization client 130 based on the container information (including the container ID) through the container activation service. Subsequently, the host authorization client 120 may respond to the container activation request from the container authorization client 130 by sending container activation information to the container authorization client 130 through the container activation service based on the container information (container ID) and the corresponding container activation limit quantity. Further, the container authorization client 130 may activate the container running on the host based on the container activation information.
[0034] It should be noted that a container is a lightweight, independent, and portable operating environment that contains an application and all the components it depends on (such as library files, configuration files, and runtime environment). The container implements resource isolation and restriction at the operating system level, allowing multiple containers to share the host's operating system kernel on the same host machine while running independently without interfering with each other.
[0035] In an embodiment of the present invention, activating a container on a host machine includes activating the container and / or an application in the container.
[0036] According to the container activation system 100 provided by the embodiment of the present invention, the container authorization client requests the authorization server to obtain the host machine activation information. After activating the host machine based on the host machine activation information, a container activation service is established to communicate with the container authorization client, and then the container activation request sent by the container authorization client based on the container information can be received, and the container activation information is sent to the container authorization client based on the container activation limit number, and the container authorization client activates the container based on the container activation information. It can be seen that the container activation system according to the present invention can quickly activate the container running on the host machine after activating the host machine, and can limit the number of container activations to avoid the problem of authorization spread.
[0037] In an embodiment of the present invention, the host authorization client 120 in the container activation system 100 is adapted to execute the container activation method 300. The container activation method 300 of the present invention will be described in detail below.
[0038] In one embodiment, the host machine and the authorization server 110 of the present invention can be implemented as a computing device respectively, so that the container activation method 300 of the present invention can be executed in the computing device.
[0039] Figure 2 FIG. 2 shows a schematic diagram of a computing device 200 provided according to an embodiment of the present invention. Figure 2 As shown, in a basic configuration, the computing device 200 includes at least one processing unit 202 and a system memory 204. According to one aspect, depending on the configuration and type of the computing device, the processing unit 202 can be implemented as a processor. The system memory 204 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, the system memory 204 includes an operating system 205.
[0040] According to one aspect, operating system 205 is suitable for controlling the operation of computing device 200, for example. Furthermore, examples are practiced in conjunction with graphics libraries, other operating systems, or any other application programs, and are not limited to any particular application or system. Figure 2 The basic configuration is shown in FIG. 2 by those components within the dashed lines. According to one aspect, the computing device 200 has additional features or functionality. For example, according to one aspect, the computing device 200 includes additional data storage devices (removable and / or non-removable), such as magnetic disks, optical disks, or tapes. Such additional storage Figure 2 2 is illustrated by a removable storage device 209 and a non-removable storage device 210.
[0041] As stated above, according to one aspect, a program module 203 is stored in the system memory 204. According to one aspect, the program module 203 may include one or more application programs, and the present invention does not limit the type of application program, for example, the application program may include: email and contact application programs, word processing application programs, spreadsheet application programs, database application programs, slide show application programs, drawing or computer-aided application programs, web browser application programs, etc.
[0042] In an embodiment according to the present invention, the program module 203 includes a plurality of program instructions for executing the container activation method 300 of the present invention.
[0043] According to one aspect, the examples may be practiced on a circuit comprising discrete electronic components, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or a single chip containing electronic components or a microprocessor. Figure 2 Each or many components shown in can be integrated into a system on a chip (SOC) on a single integrated circuit to practice examples. According to one aspect, such a SOC device may include one or more processing units, a graphics unit, a communication unit, a system virtualization unit, and various application functions, all of which are integrated (or "burned") into a chip substrate as a single integrated circuit. When operated via SOC, the functions described in this article can be operated via a dedicated logic integrated with other components of the computing device 200 on a single integrated circuit (chip). Other technologies that can perform logical operations (such as AND, OR, and NOT) can also be used to practice embodiments of the present invention, including but not limited to mechanical, optical, fluid, and quantum technologies. In addition, embodiments of the present invention can be practiced in a general-purpose computer or in any other circuit or system.
[0044] According to one aspect, the computing device 200 may also have one or more input devices 212, such as a keyboard, a mouse, a pen, a voice input device, a touch input device, etc. Output devices 214 may also be included, such as a display, a speaker, a printer, etc. The aforementioned devices are examples and other devices may also be used. The computing device 200 may include one or more communication connections 216 that allow communication with other computing devices 218. Examples of suitable communication connections 216 include, but are not limited to: RF transmitters, receivers and / or transceiver circuits; Universal Serial Bus (USB), parallel and / or serial ports.
[0045] The term computer-readable medium as used herein includes computer storage media. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules). System memory 204, removable storage device 209, and non-removable storage device 210 are all examples of computer storage media (i.e., memory storage). Computer storage media may include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices, or any other products that can be used to store information and can be accessed by computing device 200. According to one aspect, any such computer storage medium can be a part of computing device 200. Computer storage media does not include carrier waves or other propagated data signals.
[0046] According to one aspect, communication media is implemented by computer readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transport mechanism), and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more characteristics set or changed in a manner that encodes information in the signal. By way of example and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.
[0047] In an embodiment according to the present invention, the computing device 200 is configured to execute the container activation method 300. The computing device 200 includes one or more processors and one or more readable storage media storing program instructions. When the program instructions are configured to be executed by one or more processors, the computing device executes the container activation method 300 in the embodiment of the present invention, so that the computing device 200 activates the host machine and the container running on the host machine by executing the container activation method 300 of the present invention.
[0048] In some embodiments, the computing device executing the container activation method 300 in the embodiment of the present invention may be a host machine. Specifically, a host authorization client 120 is deployed on the host machine, and the host authorization client 120 may be configured to execute the container activation method 300 in the embodiment of the present invention, so that the container activation method 300 may be executed on the host authorization client 120.
[0049] The container activation method 300 in the embodiment of the present invention is described in detail below.
[0050] Figure 3 FIG. 3 is a flow chart of a container activation method 300 provided according to an embodiment of the present invention. Figure 3 As shown, the container activation method 300 includes the following steps 310-340.
[0051] In step 310 , the host authorization client 120 requests the authorization server 110 to obtain the host activation information.
[0052] Figure 4 FIG. 2 shows a timing diagram of a container activation method provided according to an embodiment of the present invention. Figure 4 As shown, in an embodiment of the present invention, the authorization server 110 may generate host activation information, and may return the host activation information to the host authorization client 120 in response to a request from the host authorization client 120 to obtain the host activation information.
[0053] In step 320 , the host authorization client 120 activates the host based on the host activation information obtained from the authorization server 110 .
[0054] In an embodiment of the present invention, one or more containers (containers to be activated) may be running on the host machine. After activating the host machine, the host machine authorization client 120 will execute the following steps 330 to 340 to activate the container running on the host machine.
[0055] In step 330, the host authorization client 120 establishes a container activation service, which is used for the host authorization client 120 to communicate with the container authorization client 130 to activate the container. Furthermore, the host authorization client 120 can receive a container activation request sent by the container authorization client 130 based on the container information through the container activation service. In an embodiment of the present invention, the container information can specifically include a container ID.
[0056] In an embodiment of the present invention, Figure 4 As shown, after the host authorization client 120 establishes the container activation service, the container authorization client 130 can connect to the container activation service and send a container activation request to the host authorization client 120 through the container activation service. The container activation request includes container information.
[0057] In step 340, the host authorization client 120 may respond to the container activation request from the container authorization client 130 by sending container activation information to the container authorization client 130 through the container activation service based on the container information (container ID) and the corresponding container activation limit quantity. Thereafter, the container authorization client 130 may activate the container running on the host based on the container activation information.
[0058] It should be noted that a container is a lightweight, independent, and portable operating environment that contains an application and all the components it depends on (such as library files, configuration files, and runtime environment). The container implements resource isolation and restriction at the operating system level, allowing multiple containers to share the host's operating system kernel on the same host machine while running independently without interfering with each other.
[0059] In an embodiment of the present invention, activating a container on a host machine includes activating the container and / or an application in the container.
[0060] In an embodiment of the present invention, in step 340, the host authorization client 120 sends the container activation information to the container authorization client 130 based on the container information (container ID) and the corresponding container activation limit number as follows: the host authorization client 120 obtains the container activation limit number (i.e., the total number of containers allowed for penetration activation) and the number of containers activated (i.e., the number of containers that have been currently penetrated and activated) corresponding to the container information, and determines whether the container activation limit number is greater than the number of containers activated. If it is determined that the container activation limit number is greater than the number of containers activated, the container activation information is sent to the container authorization client 130. In this way, the container authorization client 130 can activate the container running on the host based on the container activation information.
[0061] Otherwise, if the container activation limit is less than or equal to the container activated number, it means that the container activated number has reached the container activation limit, and the container can no longer be activated based on the container activation information. In this case, the container activation information is no longer sent to the container authorization client 130.
[0062] In some embodiments, the host authorization client 120 may obtain the container activation limit quantity corresponding to the container information in the following manner: obtain the container activation limit quantity from the host activation information. Specifically, the host activation information includes an activation serial number, host hardware information, and host system identification information. The activation serial number includes container activation limit quantity information. Based on this, the host authorization client 120 may obtain the container activation limit quantity from the activation serial number in the host activation information.
[0063] The host authorization client 120 can also obtain the container activation limit number corresponding to the container information in the following manner: when the host authorization client 120 activates the host based on the host activation information, the authorization server 110 can return the container activation limit number to the host authorization client 120, so that the host authorization client 120 can obtain the container activation limit number returned by the authorization server 110.
[0064] In some embodiments, before sending the container activation information to the container authorization client 130 based on the container information and the corresponding container activation limit number, it can also be first determined whether the container corresponding to the container information (container ID) is a container running on the host machine. If it is determined that the container corresponding to the container information (container ID) is a container running on the host machine, the container activation information is sent to the container authorization client 130 based on the container information and the corresponding container activation limit number. Specifically, the host authorization client 120 obtains the container activation limit number and the number of containers activated corresponding to the container information, and determines whether the container activation limit number is greater than the number of containers activated. If it is determined that the container activation limit number is greater than the number of containers activated, the container activation information is sent to the container authorization client 130. Then, the container authorization client 130 can activate the container running on the host machine based on the container activation information.
[0065] In some embodiments, the host activation information includes an activation serial number, host hardware information, and host system identification information. The process by which the host authorization client 120 activates the host based on the host activation information is as follows: First, determine whether the host hardware information and the host system identification information in the host activation information match the host. If the host hardware information and the host system identification information match the host, then verify the validity of the activation serial number. If the validity verification of the activation serial number passes, the host activation information is parsed, and the host is activated based on the parsed host activation information. For example, the parsed host activation information can be written into a corresponding file locally on the host to activate the host.
[0066] In some embodiments, the parsed host activation information includes activation information for activating the host, and may also include activation information for activating each container running on the host.
[0067] In addition, in some embodiments, before determining whether the host hardware information and the host system identification information in the host activation information match the host, it is also possible to pre-determine whether the host activation information returned by the authorization server 110 is wrong (there is error information). If it is determined that the host activation information is correct (there is no error information), it is then determined whether the host hardware information and the host system identification information in the host activation information match the host.
[0068] In some embodiments, after receiving the container activation information from the host authorization client 120, the container authorization client 130 may activate the container running on the host based on the container activation information in the following manner: the container authorization client 130 first determines whether there is error information in the container activation information, and if there is no error information, parses the container activation information to extract the container hardware information and the container activation status information from the parsed container activation information, and then activates the container running on the host based on the container hardware information and the container activation status information. For example, the container running on the host may be activated by writing the container hardware information and the container activation status information into the host's memory at the same time and saving them to the corresponding local file.
[0069] In an embodiment of the present invention, the host authorization client 120 and the container authorization client 130 may be connected via a local socket communication or a network communication.
[0070] For example, in some embodiments, when the host authorization client 120 and the container authorization client 130 are both deployed on the host, the communication between the host authorization client 120 and the container authorization client 130 is the communication between different local processes, which can be connected through local socket communication. The container activation service established by the host authorization client 120 in step 330 can be specifically a socket service, and the host authorization client 120 and the container authorization client 130 can communicate through the socket service to activate the container. Specifically, in step 330, the host authorization client 120 establishes a container activation service, and receives the container activation request sent by the container authorization client 130 based on the container information through the container activation service. This can be achieved in the following way: the host authorization client 120 creates a socket file, and establishes a socket service as a container activation service based on the socket file, and then, the host authorization client 120 and the container authorization client 130 can be connected through the socket service communication, and the host authorization client 120 can receive the container activation request sent by the container authorization client 130 based on the container information through the socket service. Furthermore, in step 340 , the host authorization client 120 may send container activation information to the container authorization client 130 through the socket service.
[0071] It should be noted that socket is an implementation of the "open->read / write->close" mode, and the socket file provides the function interface corresponding to these operations (read / write, open, close operations).
[0072] In addition, in some embodiments, when the host authorization client 120 is deployed on the host and the container authorization client 130 is not deployed on the host (deployed on other computing devices), the host authorization client 120 and the container authorization client 130 can be connected through network communication. The container activation service established by the host authorization client 120 in step 330 can be specifically a TCP service, and the host authorization client 120 and the container authorization client 130 can communicate through the TCP service to activate the container. Specifically, in step 330, the host authorization client 120 establishes a container activation service, and receives the container activation request sent by the container authorization client 130 based on the container information through the container activation service, which can be achieved in the following manner: the host authorization client 120 monitors the port corresponding to the host authorization client 120 on the host, and establishes a TCP service as a container activation service based on the port, and then, the host authorization client 120 and the container authorization client 130 can be connected through the TCP service communication, and the host authorization client 120 can receive the container activation request sent by the container authorization client 130 based on the container information through the TCP service. Furthermore, in step 340 , the host authorization client 120 may send container activation information to the container authorization client 130 through the TCP service.
[0073] According to the container activation method 300 of the present invention, the container authorization client can request the authorization server to obtain the host activation information. After activating the host based on the host activation information, a container activation service is established to communicate with the container authorization client, and then the container activation request sent by the container authorization client based on the container information can be received, and the container activation information is sent to the container authorization client based on the container activation limit number, and the container authorization client activates the container based on the container activation information. It can be seen that according to the container activation method of the present invention, the container running on the host can be quickly activated after the host is activated, and the number of container activations can be limited to avoid the problem of authorization spread.
[0074] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0075] In the case where the program code is executed on a programmable computer, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the container activation method of the present invention according to the instructions in the program code stored in the memory.
[0076] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0077] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0078] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0079] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof.
[0080] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0081] Unless otherwise specified, the use of ordinal numbers "first", "second", "third", etc. to describe common objects merely indicates that different instances of similar objects are involved and is not intended to imply that the objects so described must have a given order in time, space, order or in any other manner.
Claims
1. A container activation method for activating a container running on a host machine, executed by a host machine authorization client, wherein the host machine authorization client is respectively adapted to communicate with an authorization server and a container authorization client, the method comprising: Requesting the authorization server to obtain host activation information; activating the host machine based on the host machine activation information; Establishing a container activation service, receiving, through the container activation service, a container activation request sent by the container authorization client based on the container information, wherein the container activation service is used to communicate with the container authorization client to perform container activation, and the container information includes a container ID; The container activation service sends container activation information to the container authorization client based on the container information and the corresponding container activation limit quantity, so that the container authorization client activates the container based on the container activation information.
2. The method of claim 1, wherein: Sending container activation information to the container authorization client based on the container information and the corresponding container activation limit quantity includes: Obtain the container activation limit quantity and the container activated quantity corresponding to the container information; If the container activation limit quantity is greater than the container activated quantity, container activation information is sent to the container authorization client.
3. The method of claim 2, wherein: Obtaining the container activation limit quantity corresponding to the container information, including: Obtaining a container activation limit quantity from the host activation information; or When activating the host machine based on the host machine activation information, the container activation limit quantity returned by the authorization server is obtained.
4. The method according to any one of claims 1 to 3, wherein: Sending container activation information to the container authorization client based on the container information and the corresponding container activation limit quantity includes: Determine whether the container corresponding to the container information is a container running on the host machine; If yes, container activation information is sent to the container authorization client based on the container information and the corresponding container activation limit quantity.
5. The method according to any one of claims 1 to 4, wherein: The host activation information includes an activation serial number, host hardware information, and host system identification information; activating the host based on the host activation information includes: Determining whether the host hardware information and the host system identification information in the host activation information match the host; If it matches the host machine, verify the validity of the activation serial number; If the verification is successful, the host activation information is parsed, and the host is activated based on the parsed host activation information.
6. The method according to any one of claims 1 to 5, wherein: The host authorization client and the container authorization client are both deployed on the host; Establishing a container activation service, and receiving, through the container activation service, a container activation request sent by the container authorization client based on the container information, including: Create a socket file, and establish a socket service based on the socket file as a container activation service; A container activation request sent by the container authorization client based on the container information is received through the socket service.
7. The method according to any one of claims 1 to 5, wherein: The host authorization client is deployed on the host and is adapted to be connected with the container authorization client via network communication; Establishing a container activation service, and receiving, through the container activation service, a container activation request sent by the container authorization client based on the container information, including: Listening to a port on the host corresponding to the host authorization client, and establishing a TCP service based on the port as a container activation service; A container activation request sent by the container authorization client based on the container information is received through the TCP service.
8. The method according to any one of claims 1 to 7, wherein: The container authorization client is suitable for: determining whether there is error information in the container activation information; if no error information exists, parsing the container activation information to extract container hardware information and container activation status information; and activating the container based on the container hardware information and container activation status information.
9. A container activation system comprising: An authorization server, adapted to generate host activation information; A host authorization client, adapted to be deployed on a host, to be in communication with the authorization server, and to execute the method according to any one of claims 1 to 8 to activate the host and activate the container running on the host; The container authorization client is adapted to communicate with the host authorization client, and is adapted to obtain container activation information from the host authorization client, and activate the container based on the container activation information.
10. A computing device comprising: at least one processor; and A memory storing program instructions, wherein the program instructions are configured to be processed by the at least one processor, and the program instructions include instructions for processing the method according to any one of claims 1 to 8.
11. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
12. A readable storage medium storing program instructions, which, when read and processed by a computing device, enables the computing device to process the method according to any one of claims 1 to 8.
