Service containerization platform, service containerization method, device and electronic equipment

Through the service generation module and container operation and maintenance module of the service containerization platform, the container construction is automated, which solves the problems of complexity and high error rate of Dockerfile script file writing and improves the efficiency of container construction.

CN114615138BActive Publication Date: 2024-11-08WUBA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210182566.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2024-11-08
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

In the prior art, the application of containerized Dockerfile script files is complicated and error-prone, resulting in low efficiency in container construction and inability to automate.

Method used

Provide a service containerization platform, including a service generation module and a container operation and maintenance module, generate bytecode by receiving service configuration information, and establish containers to provide target services on the service application platform, avoiding the need to artificially write Dockerfile script files.

Benefits of technology

Improve container construction efficiency, avoid container construction failure caused by Dockerfile script file accuracy issues, and realize container automation construction of application services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114615138B_ABST
    Figure CN114615138B_ABST
Patent Text Reader

Abstract

The present application provides a service containerization platform, a service containerization method, a device and an electronic device, and relates to the field of computer technology. The service containerization platform includes: a service generation module and a container operation and maintenance module; the service generation module is used to receive the service configuration information of the target service sent by the service providing terminal, generate the bytecode of the target service according to the service configuration information, and transmit the bytecode to the container operation and maintenance module, the service configuration information includes: service type, network protocol, service framework type and service function information, the service function information is used to reflect the function of the target service; the container operation and maintenance module is used to establish a first container that provides the target service on the service application platform based on the bytecode. The present application improves the efficiency of container construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a service containerization platform, a service containerization method, a device and an electronic device. Background Art

[0002] Application containerization, that is, deploying applications into containers for running, is currently a more mainstream technical direction. At present, the realization of application containerization mainly relies on manually written Dockerfile script files for building application containers. Electronic devices build containers for providing application services by running Dockerfile script files. However, since the Dockerfile script file not only has high format requirements, but also involves the understanding and application of multiple Docker commands, this makes it easy for manually written Dockerfile script files to fail to run, which leads to low container construction efficiency. Therefore, there is an urgent need for an efficient way to build application containers. Summary of the invention

[0003] In view of this, the present application provides a service containerization platform, a service containerization method, an apparatus and an electronic device, which improve the efficiency of container construction to a certain extent.

[0004] According to a first aspect of the present application, a service containerization platform is provided, the service containerization platform comprising: a service generation module and a container operation and maintenance module;

[0005] A service generation module is used to receive service configuration information of a target service sent by a service providing terminal, generate bytecode of the target service according to the service configuration information, and transmit the bytecode to a container operation and maintenance module, wherein the service configuration information includes: service type, network protocol, service framework type, and service function information, wherein the service function information is used to reflect the function of the target service;

[0006] The container operation and maintenance module is used to establish a first container that provides the target service on a service application platform based on the bytecode.

[0007] According to a second aspect of the present application, a service containerization method is provided, which is applied to the service containerization platform, and the method includes:

[0008] Receiving service configuration information of a target service sent by a service providing terminal, the service configuration information including: service type, network protocol, service framework type and service function information, the service function information is used to reflect the function of the target service;

[0009] Generate the bytecode of the target service according to the service configuration information;

[0010] A first container providing the target service is established on a service application platform based on the bytecode.

[0011] According to a third aspect of the present application, a service containerization device is provided, which is applied to the service containerization platform, and the device includes:

[0012] A receiving module, used to receive service configuration information of a target service sent by a service providing terminal, wherein the service configuration information includes: service type, network protocol, service framework type and service function information, wherein the service function information is used to reflect the function of the target service;

[0013] A generation module, used to generate the bytecode of the target service according to the service configuration information;

[0014] A building module is used to build a first container providing the target service on a service application platform based on the bytecode.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the service containerization method described in the first aspect are implemented.

[0016] In a fifth aspect, the present application provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the service containerization method described in the first aspect are implemented.

[0017] Compared with the prior art, this application has the following advantages:

[0018] The service containerization platform, service containerization method, device and electronic device provided in the embodiments of the present application, the service containerization platform includes a service generation module and a container operation module. Since the service generation module can be used to receive the service configuration information of the target service sent by the service providing terminal, generate the bytecode of the target service according to the service configuration information, and transmit the bytecode to the container operation and maintenance module. The container operation and maintenance module can be used to establish a first container that provides the target service on the service application platform based on the bytecode. Therefore, the automatic construction of the container of the application service can be realized through the service containerization platform. Compared with the related art, there is no need to manually write the Dockerfile script file, thereby avoiding the failure of container construction due to the accuracy problem of the Dockerfile script file, and improving the efficiency of container construction. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is an implementation environment of a service containerization method provided in an embodiment of the present application;

[0020] Figure 2 It is a block diagram of a service containerization platform provided in an embodiment of the present application;

[0021] Figure 3 is a block diagram of another service containerization platform provided in an embodiment of the present application;

[0022] Figure 4 It is a block diagram of a commercial operation and maintenance system provided by an embodiment of the present application;

[0023] Figure 5 is a flow chart of a service containerization method provided in an embodiment of the present application;

[0024] Figure 6 is a flowchart of another service containerization method provided in an embodiment of the present application;

[0025] Figure 7 is a flowchart of another service containerization method provided in an embodiment of the present application;

[0026] Figure 8 is a block diagram of a service containerization device provided in an embodiment of the present application;

[0027] Fig. 9 It is a block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] The embodiment of the present application provides a service containerization method that can be executed by a service containerization platform, and the service containerization platform can be run on an electronic device. The electronic device can be a personal computer, a server, or a cloud server cluster.

[0030] Please refer to Figure 1 , which shows an implementation environment of a service containerization method provided by an embodiment of the present application. The implementation environment can also be considered as a containerized access system where the service containerization platform is located. Figure 1 As shown, the implementation environment includes: an electronic device 101 running a service containerization platform and a service providing terminal 102. The electronic device 101 and the service providing terminal 102 are connected via a network.

[0031] Among them, the service providing terminal 102 is a terminal held by the service provider. The service providing terminal can be used to send the service configuration information of the target service to the service containerization platform. The service containerization platform 101 is used to execute the service containerization method provided in the embodiment of the present application to build a container that provides the target service after receiving the service configuration information sent by the service providing terminal. For example, the electronic device 101 can be a personal computer, one or more servers or a cloud service cluster, etc. The service providing terminal 102 can be a mobile phone, a personal computer, a tablet computer or a wearable device, etc.

[0032] Optional, please continue to refer to Figure 1 The implementation environment may also include a service user terminal 103. The service user terminal 103 is connected to the electronic device 101 through a network. The service user terminal 103 is a terminal held by the service user. The service user terminal 103 may be connected to a container for providing a target service through a service containerization platform running on the electronic device 101. For example, the service user terminal 103 may be a mobile phone, a personal computer, a tablet computer, or a wearable device.

[0033] Optionally, the implementation environment may further include a registration center. The registration center may be connected to the service containerization platform via a network. The registration center is used at least to store the address information and service identifier of the container constructed by the service containerization platform, and the service identifier indicates the target service provided by the container. For example, the registration center may be a personal computer, one or more servers, or a cloud service cluster. In the embodiment of the present application, the registration center may be a Nacos registration center.

[0034] Please refer to Figure 2 , which shows a block diagram of a service containerization platform provided by an embodiment of the present application. The service containerization platform can be applied to the aforementioned Figure 1 The implementation environment shown runs on Figure 1 The electronic device in the implementation environment shown. In the embodiment of the present application, the service containerization platform can be a commercial platform. The commercial platform is a bridge between the service user and the service provider, which can facilitate the service user to use the service output by the service provider. Figure 2 As shown, the service containerization platform includes:

[0035] The service generation module 201 can be used to receive the service configuration information of the target service sent by the service providing terminal, generate the bytecode of the target service according to the service configuration information, and transmit the bytecode to the container operation and maintenance module. The service configuration information includes: service type, network protocol, service framework type and service function information, and the service function information is used to reflect the function of the target service.

[0036] The container operation and maintenance module 202 may be used to establish a first container providing a target service on a service application platform based on bytecodes.

[0037] In the embodiment of the present application, the service provider can send the service configuration information of the target service to be created through the service providing terminal, so that the service generation module of the service containerization platform can receive the service configuration information of the target service and generate the bytecode of the target service according to the service configuration information. Among them, the service configuration information includes: service type (abilitytype), network protocol (abilitynetworktype), service framework type (abilityframetype) and service function information (methods).

[0038] Among them, the service type may include a platform service or an interface service. The functions of a platform service are usually more complex, so a platform service usually needs to call multiple functional interfaces to provide services together. The functions of an interface service are usually more single, so an interface service calls a single functional interface to provide services. For example, a platform service may be an application. An interface service may be a node of a microservice. The network protocol is a transmission protocol for a request to call a target service. For example, the network protocol may be Hyper Text Transfer Protocol (HTTP) 1.0, HTTP2.0, or Transmission Control Protocol (TCP). The service framework type is a bytecode encoding framework for the target service. For example, the framework type may include a service communication foundation framework (SCF), a WF framework, a microservice (springcloud, SC) framework, and / or a GRPC framework. The WF framework is a java framework based on a view, model, and controller (Model View Controller, MVC) architecture, which can be used to implement the development of a target service. The GRPC framework is a remote procedure call (RPC) for implementing remote procedure calls.

[0039] In an optional case, the service generation module 201 can be used to generate the bytecode of the target service through the bytecode enhancement component according to the service configuration information.

[0040] In the embodiment of the present application, in a Java program, the code written by the developer during development is a Java source code, and the Java source code is compiled to obtain a bytecode, which is an instruction format that can be directly recognized by a Java virtual machine. The bytecode is usually stored in the form of a Java class file. The bytecode enhancement component can be used to modify the existing bytecode or dynamically generate a new bytecode.

[0041] Optionally, the bytecode enhancement component can be an ASM component. The ASM component is a Java bytecode manipulation framework, which is a code generation, code analysis and modification tool based on the Java bytecode level. It can dynamically generate the required code without providing source code. The goal of ASM is to generate, convert and analyze compiled Java class files. The ASM tool can be used to read / write / convert JVM instruction sets. For the need to manually manipulate bytecode, the ASM tool can be used to directly generate .class bytecode files, and the class behavior can also be dynamically modified before the class is loaded into the JVM.

[0042] Specifically, the ASM component can analyze the bytecode of a specified class, and modify the bytecode of this class through the customized modification rules in the ASM component to generate the bytecode of a new class. In this way, the bytecode of the original class can be combined to generate a new bytecode that conforms to the service configuration information.

[0043] Optionally, the ASM component has built-in bytecode modification logic corresponding to each parameter information included in the service configuration information and bytecode blocks corresponding to various functions. After receiving the service configuration information, the service generation module 201 calls the ASM component so that the ASM component queries the bytecode modification logic corresponding to the parameter information in the service configuration information, executes the bytecode modification logic on the bytecode block corresponding to the function of the target service, and obtains a new bytecode that conforms to the service configuration information. The bytecode generated according to the service configuration information is used to implement the service function of the target service. The bytecode generated according to the service configuration information can be used to provide an application programming interface (API) for calling the target service, and the API interface is adapted to the transmission protocol of the service protocol type.

[0044] In another optional case, the service containerization platform can store multiple bytecode blocks, including bytecode blocks for platform services and bytecode blocks for interface services. The Java source code corresponding to any bytecode block can be encoded using service frameworks of different service framework types to implement set functions. And the API interface provided by any bytecode block for calling the set function corresponding to the bytecode is adapted to at least one transmission protocol.

[0045] The service generation module may store a code block call file, which is used to store the storage address of the bytecode block, the set function of the bytecode block, the service type of the bytecode block, the service framework of the bytecode block, and the transmission protocol corresponding to the bytecode block. The service generation module 102 may be used to search the storage address of the bytecode block that meets the service configuration information from the code block call file according to the service configuration information, and obtain the bytecode block from the storage address.

[0046] Further optionally, the service function information may also include: at least one function description information (methods). The function description information may include: a function identifier, a type of calling method, and parameter information of the calling method. The calling method is used to call the service that provides the function indicated by the function description information. The function description information may also include at least one of the following information: an execution type of the calling method, a main method identifier, and the method identifier is used to indicate whether the calling method is the main method. In an embodiment of the present application, when the number of function description information is multiple, for the function description information that the method identifier indicates is not the main method, it may also include: the calling relationship between the calling method included in the function description information and the main method. Based on this, the bytecode generated according to the service configuration information can be used to implement the functions indicated by each service function information according to the execution type of the calling method using the calling method indicated in each function description information.

[0047] Optionally, the function identifier may include a function identifier (methodskey) and a function name (methodsname). The calling method may be an HTTP request call or an RPC. The execution type of the calling method may be a synchronous call or an asynchronous call.

[0048] In an optional case, the service generation module 201 is further used to call the bytecode enhancement component to generate a bytecode that implements the calling method and meets the execution type of the calling method according to the service framework type and each service function information. According to the calling relationship included in each service function information, the bytecode corresponding to each service function information is added to the bytecode of the main method to obtain the bytecode of the target service.

[0049] For example, it is assumed that at least one service function information includes: first service function information and second service function information. And the main method identifier in the first service function information indicates that the calling method is the main method. The calling relationship of the second service function information indicates that the main method calls the calling method of the second service function information after execution. The service generation module 201 is used to call the first bytecode generated by the bytecode enhancement component according to the service framework type and the first service function information. Call the second bytecode generated by the bytecode enhancement component according to the service framework type and the second service function information. Insert the second bytecode at the end of the first bytecode.

[0050] Further optionally, the service configuration information may also include: a service billing mode. The service billing mode includes: a billing mode based on usage time or a billing mode based on the number of usages. The bytecode generated according to the service configuration information may be used to implement the functions indicated by each service function information and the billing functions indicated by the service billing mode by using the calling method indicated in each function description information according to the execution type of the calling method.

[0051] In the embodiment of the present application, the service configuration information may further include: a service identifier and a version of the target service. The service identifier is used to identify the target service. The service identifier may include a service identifier (abilitykey) and a service name (abilityname).

[0052] Further optionally, the service generation module 201 can be used to compile the service configuration information received from the service providing terminal using a domain-specific language (DSL) to obtain the compiled service configuration information. Accordingly, the service generation module 201 can be used to generate the bytecode of the target service through the bytecode enhancement component according to the compiled service configuration information. Among them, the service generation module 201 can be used to convert the service configuration information received by the service providing terminal into the service configuration information of the DSL according to the language rules of the DSL. The language rules of the DSL can be user-defined grammar rules. In this way, the service configuration information of each service providing terminal is converted into the service configuration information in a unified language, so that the service generation module can extract the content used to generate the bytecode from the service configuration information. In addition, the service configuration information in a unified language is convenient for secondary editing.

[0053] Optionally, the service configuration information may further include: a version of the service configuration information, and the service generation module 201 is used to compile the received service configuration information using the DSL of the version to obtain the compiled service configuration information.

[0054] For example, assuming that in the language rules of DSL, the data format of the DSL language file is a JsonPath expression, then the service configuration information of the converted DSL is a JsonPath expression. The service generation module 201 can be used to receive an HTTP request including service configuration information sent by a service providing terminal, parse the HTTP request to obtain the service configuration information. The language rules of DSL are used to extract the information included in the service configuration information, generate the service configuration information in the data format of a JsonPath expression, and obtain the service configuration information of DSL.

[0055] Among them, if the service configuration information sent by the service providing terminal includes: service identification number: X1, service name: name1, service type: platform service, service billing mode: billing mode based on the number of times used, network protocol: HTTP, service framework type: GRPC, service function information: function description information: function identification number: M1, function name: name_m1, execution type of calling method: synchronous, type of calling method and parameter information of calling method, main method identification: 1, target service version: YYY and version of service configuration information: UUU. Among them, the main method identification value is 1, indicating that the calling method is the main method. The service configuration information of DSL is {"Service ID": X1, "Service name": name1, "Service type": platform service, "Service details": {"Billing model": billing model based on usage}, "Network protocol": HTT1, "Service framework type": GRPC, "Service function information": [{"Function ID": M1, "Function name": name_m1, "Execution type of calling method": synchronous, "Method details": the type of calling method and parameter information of calling method, "Main method ID": 1}], "Target service version": YYY, "Version of service configuration information": UUU}.

[0056] The container operation and maintenance module 202 may be used to establish a first container providing a target service on a service application platform based on bytecodes.

[0057] In an embodiment of the present application, the container operation and maintenance module 202 is used to obtain the target Dockerfile script file corresponding to the bytecode after receiving the bytecode, and run the target Dockerfile script file to establish the image corresponding to the target service. The container operation and maintenance module 202 is used to transmit the image corresponding to the target service to the service application platform, so that the service application platform runs the image and completes the construction of the first container in the service application platform. Among them, the service application platform is the platform for the target service to be launched. The target Dockerfile script file can be pre-stored in the service containerization platform, or the target Dockerfile script file can be received from the service provider terminal, and the target Dockerfile script file can be a Dockerfile script file manually written by the service provider for the target service.

[0058] The target Dockerfile script file is at least used to implement the functions of the Dockerfile basic commands. The Dockerfile basic commands at least include: a command for specifying the basic image corresponding to the target service, a command for copying the bytecode to the instruction directory in the image, a command for executing the Dockerfile script file, and a command for setting environment variables.

[0059] Optionally, when the service configuration information includes the version of the target service, the bytecode generated by the service generation module has a version attribute. The container operation and maintenance module can store the service identifier and version of the target service in association with the target bytecode, where the target bytecode is the bytecode received by the container operation and maintenance module for the target service of that version.

[0060] The container operation and maintenance module 202 can be used to receive the container configuration information of the target service sent by the service providing terminal, and the container configuration information includes: the service identifier and version of the target service. The bytecode of the target service of this version is obtained according to the container configuration information, and the target Dockerfile script file is generated according to the bytecode of the target service and the Dockerfile script file template with the service identifier added. The image corresponding to the target service is established according to the target Dockerfile script file. The image is transmitted to the service application platform so that the service application platform runs the image and completes the construction of the first container in the service application platform.

[0061] In an embodiment of the present application, when a service provider wants to deploy a first container that provides a target service, the service provider can generate container configuration information for the target service through the service provider terminal. For example, the service provider terminal can display a container deployment page. The service provider can write container configuration information on the container deployment page. In response to the write operation of the service provider terminal, the container configuration information written on the container deployment page is received, and the container configuration information is sent to the container operation and maintenance module of the service containerization platform.

[0062] Since the Dockerfile script file is relatively complex, it is relatively difficult to write. In the embodiment of the present application, the container operation and maintenance module 202 can store a Dockerfile script file template for implementing the functions of the basic Dockerfile commands. That is, a Dockerfile script file template that includes reusable scripts deployed for each container. The service provider needs to write specific information for the target service (such as the service identifier and version of the target service) on the container deployment page, so that the container operation and maintenance module generates the target Dockerfile script file template for the target service according to the Dockerfile script file template after receiving the specific information for the target service, and builds the image corresponding to the target service. Therefore, the generation process of the target Dockerfile script file provided in the embodiment of the present application does not need to care about the writing ability of the Dockerfile script file, which improves the generation efficiency of the Dockerfile script file.

[0063] Optionally, the service containerization platform further includes: a platform management module 203 and multiple gateway modules 204, and one gateway module 204 corresponds to one user cluster identifier.

[0064] The platform management module 203 is used to receive a service application request for a target service sent by a service user terminal, where the service application request includes a service identifier of the target service.

[0065] In the implementation of this application, the service user terminal can send a service application request to the platform management module 203 of the service containerization platform to request to call the target service. For example, the service user terminal can display a service application page. When the service user wants to apply to call the target service, he can click the target service identifier on the service application page. After receiving the click operation on the target service identifier, the service user terminal generates a service application request in response to the click operation and sends the service application request to the platform management module.

[0066] Optionally, the service application request may also include usage frequency information for the target service. The service user may also write an expected usage frequency on the service application page. The service user terminal obtains the expected usage frequency written on the service application page, and generates usage frequency information based on the expected usage frequency.

[0067] Alternatively, when the service configuration information includes a service billing mode, the service user can also select the purchase time or purchase frequency for the target service on the service application page. The longer the purchase time, the higher the usage frequency; the more purchase frequency, the higher the usage frequency. The service user terminal can obtain the purchase time or purchase frequency for the target service on the service application page and generate usage frequency information, which includes: the purchase time or purchase frequency for the target service.

[0068] The platform management module 203 is used to allocate a target gateway module from multiple gateway modules to the service user terminal. Optionally, the platform management module 203 can be used to use any gateway module from the multiple gateway modules as the target gateway module and allocate the target gateway module to the service user terminal.

[0069] In the case where the service application request includes the usage frequency information for the target service, the platform management module 203 is used to allocate the target gateway module to the service user terminal from the plurality of gateway modules based on the usage frequency information. The higher the usage frequency indicated by the usage frequency information, the fewer the number of service user terminals that can be connected to the target gateway module, that is, the higher the usage frequency indicated by the usage frequency information, the gateway module with fewer allocation times is allocated to the service user terminal.

[0070] For example, the platform management module 203 can be used to record the number of allocations of each gateway module, and divide multiple gateway modules into multiple gateway sets according to the number of allocations of each gateway module, and one gateway set corresponds to a purchase time interval and / or a purchase number interval. The platform management module 203 can be used to, when the usage frequency information includes the purchase time, use any gateway module in the gateway set corresponding to the purchase time interval to which the purchase time belongs as the target gateway module, and allocate the target gateway module to the service user terminal. When the usage frequency information includes the number of purchases, use any gateway module in the gateway set corresponding to the purchase number interval to which the purchase number belongs as the target gateway module, and allocate the target gateway module to the service user terminal.

[0071] The platform management module 203 is used to send the user cluster identifier corresponding to the target gateway module to the service user terminal, so that the service user terminal can obtain the target service deployed in the container after connecting to the container through the gateway module corresponding to the user cluster identifier.

[0072] Among them, the platform management module 203 can store the user cluster identifiers corresponding to each gateway module. The platform management module 203 is used to query the user cluster identifier corresponding to the target gateway module after determining the target gateway module assigned to the service user terminal, and send the queried user cluster identifier to the service user terminal. In the embodiment of the present application, the service user terminal connects to the container through the gateway module corresponding to the user cluster identifier, and the explanation of the implementation method of obtaining the target service deployed in the container is detailed in the introduction to the gateway module.

[0073] In an optional case, the container operation and maintenance module 202 is used to send a registration request to the registration center after establishing the first container. The registration request includes the address information of the first container and the service identifier of the target service. Among them, the registration center can store the address information of each container established by the container operation and maintenance module and the service identifier of the service provided by the container. For example, the registration center can be a Nacos registration center.

[0074] The gateway module 204 is used to receive a service use request for a target service sent by a service use terminal, where the service use request includes a service identifier of the target service.

[0075] In the embodiment of the present application, after receiving the user cluster identifier sent by the platform management module, the service usage terminal can send a service usage request for the target service to the gateway module to call the target service through the gateway module to connect to the container providing the target service.

[0076] In an optional case, the service user terminal can obtain the correspondence between each gateway module and the user cluster identifier, as well as the address information of each gateway module from the service containerization platform. After receiving the user cluster identifier sent by the platform management module, the service user terminal can query the address information of the gateway module corresponding to the user cluster identifier. Based on the address information, a service use request is sent to the gateway module.

[0077] In another optional case, the service usage request may also include: a user cluster identifier received by the service usage terminal. The service usage terminal may send a service usage request to the service containerization platform. The service containerization platform is used to parse the service usage request after receiving the service usage request sent by the service usage terminal to obtain the user cluster identifier included in the service usage request. The service containerization platform forwards the service usage request to the gateway module corresponding to the user cluster identifier. The service usage request received by the gateway module may be forwarded by the service containerization platform according to the user cluster identifier included in the service usage terminal.

[0078] Optionally, the service containerization platform may include a proxy (nginx) module. The proxy module may be used to receive a service usage request sent by a service usage terminal, parse the service usage request to obtain a user cluster identifier included in the service usage request, and forward the service usage request to a gateway module corresponding to the user cluster identifier.

[0079] The gateway module 204 is used to search the address information of the first container in the registration center according to the service identifier of the target service, and make the first container respond to the service use request according to the address information.

[0080] Optionally, the gateway module 204 may be used to send an address query request to the registration center after receiving the service use request, and the address query request includes the service identifier of the target service. The gateway module 204 may be used to receive the address information of the first container providing the target service sent by the registration center, and the address information is the address information of the first container corresponding to the service identifier, which is queried by the registration center based on the service identifier included in the address query request. The correspondence between the service identifier and the address information is established based on the service provided by the container of the address information.

[0081] In the embodiment of the present application, since the container operation and maintenance module can be used to send a registration request for the container to the registration center after the container is established, the registration center can timely perceive the deployment status of the container. Therefore, when the container deployment status changes, the registration center can timely perceive the change, and thus assign new container address information to the gateway module based on the changed container deployment status, realize dynamic update routing, and improve the stability of providing services to service users.

[0082] It should be noted that the information stored in the registration center for the first container is: the correspondence between the service identifier of the target service and the address information of the first container. Any gateway module can obtain the address information of the first container by sending the service identifier to the registration center. Therefore, any gateway module can be connected to the first container, and the first container can be understood as a public container. That is, the first container can be connected to any service user terminal through the gateway module to provide the target service to the service user terminal.

[0083] However, when the service user has a large demand for calling the target service, frequent connections to the first container may affect the stability of the first container. Therefore, the containerization platform can deploy private containers for service users with large demand for calling the target service to ensure stable use of the service user.

[0084] Optionally, when the service application request includes the usage frequency information, the platform management module 203 may be used to display the deployment review page for the target service when it is determined that the usage frequency information meets the high frequency requirement. The high frequency requirement may be determined according to the implementation situation. Optionally, when the usage frequency information includes the purchase time, the high frequency requirement may be a time threshold. When the usage frequency information includes the number of purchases, the high frequency requirement may be a number threshold.

[0085] In the embodiment of the present application, the platform management module 203 can be used to determine whether the usage frequency information included in the service application request meets the high frequency requirement after receiving the service application request for the target service from the service user. If the usage frequency information does not meet the high frequency requirement, a target gateway module can be allocated to the service user terminal from multiple gateway modules. If the usage frequency information meets the high frequency requirement, a deployment review page for the target service can be displayed.

[0086] If the administrator of the service containerization platform agrees to deploy a private container for providing the target service to the service user, he can perform a private deployment operation on the service user terminal in the deployment review page. If the administrator disagrees to deploy a private container for providing the target service to the service user, he can perform a rejection of private deployment operation on the service user terminal in the deployment review page.

[0087] The platform management module 203 is used to, when receiving a rejection of a private deployment operation, allocate a target gateway module from a plurality of gateway modules to the service user terminal in response to the rejection of the private deployment operation. The platform management module 203 is used to, when receiving a trigger for a private deployment operation for a service user terminal on the deployment review interface, generate a private deployment instruction and send the private deployment instruction to the container operation and maintenance module.

[0088] The container operation and maintenance module 202 is used to establish a second container providing the target service on the service application platform based on the bytecode when receiving the private deployment instruction. The second container corresponds to the target user cluster identifier among the multiple user cluster identifiers. Among them, the interpretation and implementation of establishing the second container providing the target service on the service application platform based on the bytecode is the same as the interpretation and implementation of establishing the first container providing the target service on the service application platform based on the bytecode, and this embodiment of the application will not be repeated.

[0089] Optionally, the target user cluster identifier corresponding to the second container may be the user cluster identifier corresponding to the gateway module that has been allocated the least number of times. In this way, the operation stability of the gateway module is ensured when the service user terminal is connected to the second container through the gateway module.

[0090] The platform management module 203 is used to use the gateway module corresponding to the target user cluster identifier as the target gateway module and allocate the target gateway module to the service user terminal. The platform management module 203 is used to send the target user cluster identifier to the service user terminal so that the service user terminal is connected to the second container through the gateway module corresponding to the target user cluster identifier.

[0091] Optionally, the container operation and maintenance module 202 is used to send a registration request to the registration center after establishing the second container. The registration request includes the address information of the second container, the service identifier of the target service, and the target user cluster identifier. After receiving the registration request for the second container sent by the container operation and maintenance module 202, the registration center can store the information included in the registration request.

[0092] The gateway module 204 is used to receive a service use request for a target service sent by a service use terminal. The service use request includes a service identifier of the target service and a user cluster identifier received by the service use terminal.

[0093] In the embodiment of the present application, the gateway module 204 is used to receive a service usage request for a target service sent by a service usage terminal, parse the service usage request, and obtain the service identifier of the target service included in the service usage request and the user cluster identifier received by the service usage terminal.

[0094] The gateway module 204 is used to search for address information of a container corresponding to the service identifier and the user cluster identifier received by the service usage terminal in the registration center according to the service identifier and the user cluster identifier received by the service usage terminal, and make the second container respond to the service usage request according to the address information, wherein when the user cluster identifier received by the service usage terminal matches the target user cluster identifier, the found address information is the address information of the second container; when the user cluster identifier received by the service usage terminal does not match the target user cluster identifier, the found address information is the address information of the first container.

[0095] Optionally, the container operation and maintenance module 202 may also be used to establish a first container providing the target service in a sandbox environment based on bytecode before establishing a first container providing the target service in a service application platform based on bytecode. The implementation method of establishing a first container providing the target service in a sandbox environment based on bytecode may refer to the implementation method of establishing a first container based on a service application platform based on bytecode, which will not be described in detail in the present embodiment of the application.

[0096] The service generation module 201 is also used to receive the test data of the target service sent by the service providing terminal, and use the test data to perform service testing on the first container. Optionally, the service providing terminal can send mock test data of the target service to use the mock test data to perform mock testing on the first container in the sandbox environment. Mock testing is a testing method that uses a virtual object to create some objects that are not easy to construct or obtain during the testing process for testing.

[0097] Optionally, the container application platform also includes a monitoring and warning module 205. The monitoring and warning module 205 is used to send an alarm message to the maintenance personnel terminal corresponding to the first container when an abnormality is detected in the target service, and the alarm message indicates that the target service has an operation abnormality. Optionally, the first container sends an alarm message to the monitoring and warning module 205 when an operation abnormality is detected. The monitoring and warning module 205 is used to determine that an abnormality is detected in the target service when receiving the alarm message sent by the first container. The monitoring and warning module 205 can store the address information of the terminal of the maintenance personnel (i.e., the alarm receiving personnel) corresponding to each container. The monitoring and warning module 205 is used to send an alarm message to the maintenance personnel terminal according to the address information.

[0098] In an embodiment of the present application, multiple containers (including a first container and a second container) constructed by the service application platform can be divided into container clusters according to the services provided by the containers. All containers included in a container cluster are used to provide a service. Each container in a container cluster can be connected to the same early warning device. When the early warning device detects that the number of containers with abnormal operation in the container cluster accounts for the number threshold of the total number of containers, the early warning device sends an early warning message to the monitoring early warning module.

[0099] In summary, an embodiment of the present application provides a service containerization platform, which includes a service generation module and a container operation and maintenance module. Since the service generation module can be used to receive the service configuration information of the target service sent by the service providing terminal, generate the bytecode of the target service according to the service configuration information, and transmit the bytecode to the container operation and maintenance module. The container operation and maintenance module can be used to establish a first container that provides the target service on the service application platform based on the bytecode. Therefore, the automatic construction of containers for application services can be achieved through the service containerization platform. Compared with the related technology, there is no need to manually write the Dockerfile script file, thereby avoiding the failure of container construction due to the accuracy of the Dockerfile script file, and improving the efficiency of container construction.

[0100] Please refer to Figure 3 , which shows a block diagram of another service containerization platform provided in an embodiment of the present application. The service containerization platform can be applied to the aforementioned Figure 1 The implementation environment shown runs on Figure 1 The electronic device in the implementation environment shown. Figure 3 As shown, the service containerization platform includes:

[0101] Capability management system 301 , service support system 302 , gateway module 303 , platform management module 304 , user system 305 , capability system 306 , monitoring and early warning module 307 and data management module 308 .

[0102] Among them, the capability management system 301 may include a service generation module 3011, a capability operation and maintenance module 3012, a localization processing module 3013, a content security verification module 3014, a device fingerprint management module 3015, a portrait management module 3016, and a hunter platform 6017.

[0103] The service generation module 3011 is also called a capability access module. The service generation module 3011 is used to implement at least Figure 2The functions of the service generation module 201 in the service containerization platform shown. Optionally, the service generation module 3011 may include the functions of capability configuration, method configuration, generalization mechanism, asynchronous mechanism and execution container. Method configuration refers to the function of providing service configuration information including service function information. Capability configuration refers to the function of providing and receiving service configuration information. The execution container refers to the implementation process of generating the bytecode of the target service according to the service configuration information. The generalization mechanism provides the generalized call function of the bytecode. The asynchronous mechanism provides the asynchronous execution function of calling the method in the bytecode. The capability operation and maintenance module 3012 may include the functions of capability publishing, capability updating and version control. Capability publishing refers to the publishing function of the bytecode for the target service. Capability updating refers to the updating function of the bytecode for the target service. Version control refers to the setting function of the published version of the bytecode for the target service and the version of the bytecode for building the container. The localization processing module 3013 can be for the management function of the authorization license of the target service, the code protection management function for the target service and the script deployment management function involved in the bytecode generation process for the target service. The content security verification module 3014 can be used to verify the security of each data transmitted by the capability management system 301. The device fingerprint management module 3015 can be used to manage the fingerprint corresponding to the login account of the service containerization platform. The login account of the service containerization platform can include the login account of the service provider, the login account of the service user, and the login account of the platform manager. The portrait management module 3016 can be used to manage the user portraits of users such as service providers and service users.

[0104] The service support system 302 includes: a content management system (CMS) 3021, a commercial user system 3022, a safe authority management system 3023, a commercial operation and maintenance system 3024, a commercial localization system 3025 and a hunter system 3026.

[0105] Among them, CMS3021 is a software system located between the Web front-end and back-end office systems or processes (content creation, editing). Relevant users of the service containerization platform (for example, content creators, editors, and publishers) use the content management system to submit, modify, approve, and publish content. The "content" referred to here may include files, tables, pictures, data in the database, and bytecode of the target service. The commercial user system 3022 is used to support the functions of modules such as the platform management module 304, the user system 305, and the capability system 306. The safe permission management system 3023 is used to manage the access rights of users including service providers, service users, and platform managers to the service containerization platform. The commercial operation and maintenance system 3024 is used to implement at least the following Figure 2The functions of the container operation and maintenance module 202 in the service containerization platform are shown. The commercial localization system 3025 is used to support the functions of the localization processing module 3013. The hunter system 3026 is used to support the functions of the hunter platform 6017.

[0106] Optional, please refer to Figure 4 , which shows a block diagram of a commercial operation and maintenance system provided by an embodiment of the present application. Figure 4 As shown, the commercial operation and maintenance system 3024 may include: a console 401 , a service support module 402 , a monitoring and early warning module 403 , an interface module 404 and a data management module 405 .

[0107] The console 401 includes an account management module 4011 , an application management module 4012 , a project management module 4013 , a project version management module 4014 , a project deployment management module 4015 and a monitoring management module 4016 .

[0108] The account management module 4011 can be used to manage the login account of the commercial operation and maintenance system connected to the service containerization platform. The application management module 4012 can be used to manage the built containers. The project management module 4013 is used to manage the dockerfile script file for building the container. The project version management module 4014 is used to set the version of the dockerfile script file. The project deployment management module 4015 is used to manage the service application platform for container deployment. The monitoring management module 4016 is used to monitor the generation process of the dockerfile script file and the container construction process.

[0109] The service support module 402 includes an application construction module 4021, an engineering construction module 4022, and an engineering deployment module 4023. Among them, the application construction module 4021 may include the functions of application creation, cluster configuration, and script configuration. Application creation refers to the function of building a container on the service application platform. Cluster configuration refers to the function of configuring a container cluster for the container to be created. Script configuration refers to the function of configuring a script for executing the creation of a container. The engineering construction module 4022 is used to generate a corresponding target Dockerfile script file for the bytecode of the target service. The engineering construction module 4022 may include the functions of group configuration, script configuration, and script parsing. Group configuration refers to the function of receiving the service configuration information of the service providing terminal. Script configuration refers to the function of configuring the Dockerfile script file template. Script parsing refers to the function of obtaining the bytecode of the target service of the version according to the container configuration information, and generating the target Dockerfile script file according to the bytecode of the target service and the Dockerfile script file template with the service identifier added. The engineering deployment module 4023 may include the functions of version control, deployment control, and deployment record. Version control refers to the version setting function for the Dockerfile script file template. Deployment control refers to the function of setting the deployment location of the container to be built. Deployment record refers to recording the deployment status of each container.

[0110] The monitoring and early warning module 403 may include a memory monitoring module 4031, a central processing unit (CPU) monitoring module 4032, and a thread monitoring module 4033. Among them, the memory monitoring module 4031 can at least be used to monitor the memory information occupied by the commercial operation and maintenance system during operation and monitor the memory occupancy corresponding to the data of the commercial operation and maintenance system. The CPU monitoring module 4032 is used to monitor the CPU operation of the device where the commercial operation and maintenance system is located. The thread monitoring module 4033 is used to monitor the thread operation of the device where the commercial operation and maintenance system is located.

[0111] The interface module 404 may include an engineering construction application programming interface (Application Programming Interface, API), an engineering deployment API, a node expansion API, a node reduction API, a node restart API, and a node query API. Among them, the engineering construction API is used to call the functions of the engineering construction module. The engineering deployment API is used to call the functions of the engineering deployment module. The node expansion API is used to call the expansion function of nodes such as the equipment where the commercial operation and maintenance system is located and the equipment where the container is located. The node reduction API is used to call the reduction function of nodes such as the equipment where the commercial operation and maintenance system is located and the equipment where the container is located. The node query API is used to call the capacity query function of nodes such as the equipment where the commercial operation and maintenance system is located and the equipment where the container is located.

[0112] The data management module 405 includes various types of databases to store various types of data involved in the operation of the commercial operation and maintenance system. The data management module 405 includes: Mysql, kafka, hive, clickhouse.

[0113] The gateway module 303 can be regarded as a traffic entry device running between an external terminal and a content service. The external terminal refers to a terminal connected to a service containerization platform and a container, such as a service providing terminal and a service using terminal. Internal services refer to service containerization platforms, containers that provide target services, etc. The gateway module 303 includes a security authentication module 3031, a capability routing module 3032, a load balancing module 3033, a flow and speed limiting module 3034, and a billing statistics module 3035.

[0114] The security authentication module 3031 may be used to perform parameter verification on the request sent by the external terminal. The request sent by the external terminal may include the aforementioned service application request, service use request, etc. The capability routing module 3032 is used to implement at least the aforementioned Figure 2 The function of the gateway module in the service containerization platform shown is to at least realize the connection between the service user and the container. The load balancing module 3033 is at least used to realize load balancing processing for multiple containers when there are multiple containers providing the target service. The flow and speed limiting module 3034 is at least used to realize traffic management processing for the service containerization platform, containers and other devices connected to the gateway. The billing statistics module 3035 can be used to realize billing statistics for the service user based on the charging module of the target service and the data flow related to the container used to provide the target service. It should be noted that Figure 3 The service containerization platform shown may include multiple gateway modules. Figure 3 The service containerization platform includes a gateway module as an example. Figure 3 The gateway module shown can be used to implement at least the above Figure 2The function of a gateway module in the service containerization platform is shown.

[0115] In an embodiment of the present application, the gateway module 303 may also present another structure. For example, the gateway module 303 may include: an access restriction module, a business management module, and a routing management module. The access restriction module is used to implement functions such as parameter verification, authentication, anti-replay attack, anti-traffic attack, speed limit, flow limit, fuse degradation, and risk control. The business management module is used to implement functions such as calculation statistics, log recording, and other data statistics. The routing management module is used to implement functions such as service discovery (container discovery), load balancing, grayscale control, and container calling. Among them, container calling refers to connecting a container to a service user.

[0116] The platform management module 304 is also called the platform system. The platform management module 304 can at least be used to implement the above-mentioned Figure 2 The functions of the platform management module in the service containerization platform shown in the figure. The platform management module 304 may include: an account management module 3041, a permission management module 3042, a user management module 3043, a capability management module 3044, a release operation and maintenance management module 3045, and a data center module 3046.

[0117] Among them, the account management module 3041 is used to manage the login accounts that can log in to the service containerization platform. The permission management module 3042 is used to manage the usage permissions of different login accounts. The user management module 3043 is used to manage the login accounts of service users registered on the service containerization platform. The user management module 3043 is used to manage the login accounts of service providers registered on the service containerization platform. The publishing operation and maintenance management module 3045 is used to manage the built containers. The data center module 3046 is used to store the relevant data of the service containerization platform.

[0118] The user system 305 can at least be used to manage the services applied for by the service user. The user system 305 includes: an account management module 3051, a capability introduction module 3052, a capability trial module 3053, an application management module 3054, a service order management module 3055 and a data center 3056.

[0119] Among them, the account management module 3051 is used to manage the login account of the service user registered on the service containerization platform. The capability introduction module 3052 is used to transmit the services provided by each container built by the service containerization platform to the service user terminal, so that the service user terminal can display each service. The capability trial module 3053 is used to control the service user terminal to establish a connection with the container for a set duration or a set number of times, so that the container provides the service user terminal with a set number of times or a set duration. The application management module 3054 is used to manage the services requested by the service user terminal by sending a service application request. The service order management module 3055 is used to manage the data flow between the service user terminal and the service containerization platform. The data center 3056 is used to store the relevant data transmitted between the service user terminal and the service containerization platform.

[0120] The capability party system 306 can at least be used to manage the services provided by the service provider. The capability party system 306 includes: an account management module 3061 , a permission management module 3062 , a capability management module 3063 , a method management module 3064 , a release management module 3065 and a data center 3066 .

[0121] Among them, the account management module 3061 is used to manage the login account of the service provider registered on the service containerization platform. The authority management module 3062 is used to manage the use authority of the login account of different service providers registered on the service containerization platform. The capability management module 3063 is at least used to manage the containers built to provide different services. The method management module 3064 is at least used to manage the bytecodes of each service generated by the service containerization platform. The release management module 3065 is at least used to manage the process of building containers based on bytecodes. The data center 3066 is used to store the relevant data transmitted between the service provider terminal and the service containerization platform.

[0122] The monitoring and warning module 307 is used to monitor the running status of the container, so as to send an alarm message to the maintenance personnel terminal corresponding to the container when an abnormal operation is detected. The monitoring and warning module 307 may include: a system monitoring module 3071 and a business monitoring module 3072. The system monitoring module 3071 can be used to monitor the business running status between the service providing terminal and the service containerization platform, the service using terminal and the service containerization platform, the service containerization platform and the container and other business-related devices. Among them, the system monitoring module 3071 can run the sentry system to realize the operation monitoring of the cloud platform where the container is located and / or the service containerization platform. The sentry system is a monitoring system that can support the monitoring of the server and the client, and can also perform error analysis and alarm when abnormal situations are monitored. The business monitoring module 3072 can be used to monitor the running status of the cloud platform where the container is located and / or the running status of the service containerization platform. The business monitoring module 3072 can run the Prometheus system, Grafana components and Flink framework. The business monitoring module 3072 implements operation monitoring and monitoring result visualization for the cloud platform where the container is located and / or the service containerization platform based on the Prometheus system, Grafana components and Flink framework. Among them, the Prometheus system is a distributed monitoring system used to monitor the entire platform infrastructure. The Grafana component is a data visualization tool that can perform data monitoring, data statistics and data visualization. The Flink framework is a computing framework for distributed data stream processing and batch data processing. It provides functions that support two types of applications, stream processing and batch processing. It can realize the processing of internal platform stream data and extract the required monitoring operation data.

[0123] The data management module 308 includes multiple types of databases to store various types of data involved in the operation of the service containerization platform. The data management module 308 includes eight databases: Mysql, redis, wmb, kafka, hive, and clickhouse.

[0124] In an embodiment of the present application, the service containerization platform can be used to receive service configuration information of a target service sent by a service providing terminal, generate bytecode of the target service according to the service configuration information, and transmit the bytecode to a container operation and maintenance module. Thus, a first container providing the target service can be established on the service application platform based on the bytecode. Therefore, the automated construction of containers for application services can be achieved through the service containerization platform. Compared with related technologies, there is no need to manually write Dockerfile script files, thus avoiding the failure of container construction due to accuracy issues of the Dockerfile script files and improving the efficiency of container construction.

[0125] Please refer to Figure 5, which shows a flow chart of a service containerization method provided by an embodiment of the present application. The service containerization method can be applied to Figure 1 The implementation environment shown is composed of Figure 1 , Figure 2 or Figure 3 The service containerization platform shown is executed, and the method includes:

[0126] Step 501: Receive service configuration information of a target service sent by a service providing terminal. The service configuration information includes: service type, network protocol, service framework type and service function information, and the service function information is used to reflect the function of the target service.

[0127] Step 502: Generate bytecode for the target service according to the service configuration information.

[0128] Step 503: Establish a first container for providing the target service on the service application platform based on the bytecode.

[0129] The steps 501 to 503 may refer to the aforementioned Figures 2 to 3 The relevant descriptions of the functions of each module in the service containerization platform are not repeated here for comparison with the embodiments of the present application.

[0130] In summary, the service containerization method provided in the embodiment of the present application generates the bytecode of the target service according to the service configuration information by receiving the service configuration information of the target service sent by the service providing terminal, and transmits the bytecode to the container operation and maintenance module. Thus, a first container providing the target service can be established on the service application platform based on the bytecode. Therefore, the automatic construction of containers for application services can be achieved through the service containerization platform. Compared with the related art, there is no need to manually write the Dockerfile script file, thereby avoiding the failure of container construction caused by the accuracy problem of the Dockerfile script file, and improving the efficiency of container construction.

[0131] Please refer to Figure 6 , which shows a flow chart of a service containerization method provided by an embodiment of the present application. The service containerization method can be applied to Figure 1 The implementation environment shown is composed of Figure 1 , Figure 2 or Figure 3 The service containerization platform shown is executed, and the method includes:

[0132] Step 601: The service providing terminal sends service configuration information of the target service to the service containerization platform. The service configuration information includes: service type, network protocol, service framework type and service function information, and the service function information is used to reflect the function of the target service.

[0133] Optionally, the service function information includes: at least one type of function description information, at least one type of function description information includes: function identifier, type of calling method and parameter information of calling method, the calling method is used to call the service that provides the function indicated by the function description information. At least one type of function description information also includes at least one of the following information: execution type of the calling method, main method identifier, the method identifier is used to indicate whether the calling method is the main method.

[0134] Step 602: The service containerization platform generates bytecode for the target service according to the service configuration information.

[0135] Optionally, the process of the service containerization platform generating the bytecode of the target service according to the service configuration information may include: the service containerization platform generates the bytecode of the target service through a bytecode enhancement component according to the service configuration information.

[0136] Step 603: The service containerization platform establishes a first container providing the target service on the service application platform based on the bytecode.

[0137] In an optional implementation, the process of the service containerization platform establishing a first container providing a target service on the service application platform based on the bytecode may include:

[0138] The service containerization platform receives the container configuration information of the target service sent by the service providing terminal, and the container configuration information includes: the service identifier of the target service. The bytecode of the target service is obtained according to the container configuration information, and the target Dockerfile script file is generated according to the bytecode of the target service and the Dockerfile script file template with the service identifier added, and the Dockerfile script file template is used to implement the functions of the Dockerfile basic commands at least. The service containerization platform creates an image corresponding to the target service according to the target Dockerfile script file, and transmits the image to the service application platform so that the service application platform runs the image and completes the construction of the first container in the service application platform.

[0139] In another optional implementation, the service configuration information also includes a version of the target service. The process of the service containerization platform establishing a first container providing the target service on the service application platform based on the bytecode may include:

[0140] The service containerization platform receives the container configuration information of the target service sent by the service provider terminal, and the container configuration information includes: the service identifier and version of the target service. The bytecode of the target service version is obtained according to the container configuration information, and the target Dockerfile script file is generated according to the bytecode of the target service and the Dockerfile script file template with the service identifier added. The Dockerfile script file template is used to implement the functions of the Dockerfile basic commands at least. The service containerization platform creates an image corresponding to the target service according to the target Dockerfile script file, and transmits the image to the service application platform so that the service application platform runs the image and completes the construction of the first container in the service application platform.

[0141] Step 604: The service containerization platform sends a registration request to the registration center, where the registration request includes the address information of the first container and the service identifier of the target service.

[0142] Step 605: The registration center stores the address information of the first container and the service identifier of the target service.

[0143] Optionally, when the service containerization platform further includes a plurality of gateway modules corresponding one-to-one to the user cluster identifiers, the method further includes:

[0144] In an optional implementation, the service containerization platform receives the service application request sent by the service usage terminal so that the service containerization platform controls the first container to respond to the service usage request. The process may include the following steps 606 to 610. The method includes:

[0145] Step 606: The service user terminal sends a service application request for the target service to the service containerization platform, where the service application request includes a service identifier of the target service.

[0146] Step 607: The service containerization platform allocates a target gateway module to the service user terminal from the multiple gateway modules.

[0147] Optionally, when the service application request also includes frequency of use information indicating the target service, the process of the service containerization platform allocating a target gateway module to the service usage terminal from multiple gateway modules includes: the service containerization platform allocating a target gateway module to the service usage terminal from multiple gateway modules based on the frequency of use information, the higher the frequency of use indicated by the frequency of use information, the fewer the number of service usage terminals that can be connected to the target gateway module.

[0148] In an embodiment of the present application, when the service configuration information also includes a service billing mode, the service billing mode includes: a billing mode based on usage time or a billing mode based on usage count, and the usage frequency information includes: the purchase time or purchase count for the target service.

[0149] Step 608: The service containerization platform sends the user cluster identifier corresponding to the target gateway module to the service user terminal.

[0150] Among them, the service containerization platform sends the user cluster identifier corresponding to the target gateway module to the service user terminal, so that the service user terminal connects to the container through the gateway module corresponding to the user cluster identifier and obtains the target service deployed in the container.

[0151] Step 609: The service usage terminal sends a service usage request for the target service to the target gateway module of the service containerization platform, where the service usage request includes a service identifier of the target service.

[0152] Step 610: The service containerization platform searches for address information of the first container in the registration center according to the service identifier of the target service through the target gateway module, and enables the first container to respond to the service use request according to the address information.

[0153] In another optional case, the service application request also includes information indicating the frequency of use of the target service. The process of the service containerization platform receiving the service application request sent by the service use terminal so that the service containerization platform controls the first container to respond to the service use request may include the following steps 701 to 710, such as Figure 7 As shown, the method includes:

[0154] Step 701: The service user terminal sends a service application request for a target service to the service containerization platform. The service application request includes a service identifier of the target service and information indicating the frequency of use of the target service.

[0155] Step 702: When the service containerization platform determines that the usage frequency information meets the high frequency requirement, the deployment review page for the target service is displayed.

[0156] Step 703: When the service containerization platform receives a trigger for a private deployment operation for a service user terminal in the deployment review interface, it generates a private deployment instruction.

[0157] Step 704: The service containerization platform establishes a second container providing the target service on the service application platform based on the bytecode, and the second container corresponds to the target user cluster identifier among the multiple user cluster identifiers.

[0158] Step 705: The service containerization platform uses the gateway module corresponding to the target user cluster identifier as the target gateway module, and distributes the target gateway module to the service user terminal.

[0159] Step 706: The service containerization platform sends the user cluster identifier corresponding to the target gateway module to the service user terminal.

[0160] Step 707: The service containerization platform sends a registration request to the registration center. The registration request includes the address information of the second container, the service identifier of the target service, and the target user cluster identifier.

[0161] In the embodiment of the present application, the service containerization platform sends a registration request to the registration center, so that the registration center stores the address information of the second container, the service identifier of the target service, and the target user cluster identifier.

[0162] Step 708: The registration center stores the address information of the second container, the service identifier of the target service, and the target user cluster identifier.

[0163] Step 709: The service usage terminal sends a service usage request for the target service to the target gateway module of the service containerization platform. The service usage request includes the service identifier of the target service and the user cluster identifier received by the service usage terminal.

[0164] Step 710: The service containerization platform searches for address information of a container corresponding to the service identifier and the user cluster identifier received by the service usage terminal in the registration center through the target gateway module, and enables the second container to respond to the service usage request according to the address information.

[0165] When the user cluster identifier received by the service user terminal matches the target user cluster identifier, the found address information is the address information of the second container; when the user cluster identifier received by the service user terminal does not match the target user cluster identifier, the found address information is the address information of the first container.

[0166] Optionally, the service containerization platform may test the first container to be built before establishing the first container providing the target service on the service application platform based on the bytecode. The method further includes: the service containerization platform establishing the first container providing the target service in the sandbox environment based on the bytecode. Receiving test data of the target service sent by the service providing terminal, and using the test data to perform service testing on the first container.

[0167] Optionally, when the service configuration information also includes a version of the service configuration information, before the service containerization platform generates the bytecode of the target service according to the service configuration information, the method further includes: using the version of the DSL to compile the received service configuration information to obtain the compiled service configuration information. In this way, the service containerization platform converts the service configuration information of each service providing terminal into service configuration information in a unified language, which facilitates the service containerization platform to extract the content used to generate the bytecode from the service configuration information. In addition, the service configuration information in a unified language facilitates secondary editing.

[0168] Optionally, the service containerization platform can also detect the operation of the target service to issue an abnormality alarm when the target service is abnormal, effectively ensuring the operation of the target service. The method also includes:

[0169] When the service containerization platform detects that the target service is abnormal, it sends an alarm message to the maintenance personnel terminal corresponding to the first container. The alarm message indicates that the target service is abnormal.

[0170] It should be noted that the steps included in the embodiments of the present application can refer to the aforementioned Figures 2 to 3 The relevant descriptions of the functions of each module in the service containerization platform are not repeated in comparison with the embodiments of the present application.

[0171] In summary, the service containerization method provided in the embodiment of the present application generates the bytecode of the target service according to the service configuration information by receiving the service configuration information of the target service sent by the service providing terminal, and transmits the bytecode to the container operation and maintenance module. Thus, a first container providing the target service can be established on the service application platform based on the bytecode. Therefore, the automatic construction of containers for application services can be achieved through the service containerization platform. Compared with the related art, there is no need to manually write the Dockerfile script file, thereby avoiding the failure of container construction caused by the accuracy problem of the Dockerfile script file, and improving the efficiency of container construction.

[0172] Please refer to Figure 8 , which shows a block diagram of a service containerization device provided by an embodiment of the present invention. Application containerization can be applied to Figures 1 to 3 Any of the service containerization platforms shown. Figure 8 As shown, the service containerization device 800 includes: a receiving module 801, a generating module 802 and a establishing module 803.

[0173] The receiving module 801 is used to receive the service configuration information of the target service sent by the service providing terminal, the service configuration information includes: service type, network protocol, service framework type and service function information, the service function information is used to reflect the function of the target service;

[0174] A generating module 802, used to generate bytecode of a target service according to the service configuration information;

[0175] The establishing module 803 is used to establish a first container providing a target service on the service application platform based on the bytecode.

[0176] Optionally, the generation module 802 is further configured to generate the bytecode of the target service through the bytecode enhancement component according to the service configuration information.

[0177] Optionally, the service function information includes: at least one type of function description information, at least one type of function description information includes: function identifier, type of calling device and parameter information of the calling device, the calling device is used to call the service that provides the function indicated by the function description information, at least one type of function description information also includes at least one of the following information: execution type of the calling device, main device identifier, the device identifier is used to indicate whether the calling device is a main device.

[0178] Optionally, the service containerization platform further includes: a plurality of gateway modules, one gateway module corresponds to one user cluster identifier. The receiving module 801 is further configured to receive a service application request for a target service sent by a service user terminal, the service application request including a service identifier of the target service.

[0179] The device further comprises: an allocating module for allocating a target gateway module for a service user terminal from a plurality of gateway modules;

[0180] The sending module is used to send the user cluster identifier corresponding to the target gateway module to the service user terminal, so that the service user terminal can obtain the target service deployed in the container after connecting to the container through the gateway module corresponding to the user cluster identifier.

[0181] Optionally, the service application request also includes: frequency of use information indicating the target service; an allocation module, further used to allocate a target gateway module to a service usage terminal from a plurality of gateway modules based on the frequency of use information, wherein the higher the frequency of use indicated by the frequency of use information, the smaller the number of service usage terminals that can be connected to the target gateway module.

[0182] Optionally, the service configuration information also includes: a service billing mode, the service billing mode includes: a billing mode based on usage time or a billing mode based on usage times, and the usage frequency information includes: the purchase time or purchase times for the target service.

[0183] Optionally, the sending module is further used to send a registration request to the registration center, where the registration request includes the address information of the first container and the service identifier of the target service;

[0184] The receiving module 801 is further configured to receive a service use request for a target service sent by a service use terminal through a target gateway module, wherein the service use request includes a service identifier of the target service;

[0185] The device also includes: a search module, which is used to search the address information of the first container in the registration center according to the service identifier of the target service through the target gateway module, and make the first container respond to the service use request according to the address information.

[0186] Optionally, the service application request further includes: information for indicating the frequency of use of the target service; and the device further includes:

[0187] The display module is used to display a deployment review page for a target service when it is determined that the usage frequency information meets the high frequency requirement.

[0188] The generating module 802 is further used to generate a private deployment instruction when a private deployment operation triggering a service user terminal is received on the deployment review interface;

[0189] The establishing module 803 is further used to establish a second container providing the target service on the service application platform based on the bytecode, where the second container corresponds to the target user cluster identifier among the multiple user cluster identifiers.

[0190] The allocation module is further used to use the gateway module corresponding to the target user cluster identifier as the target gateway module, and allocate the target gateway module to the service user terminal.

[0191] Optionally, the sending module is further used to send a registration request to the registration center, where the registration request includes the address information of the second container, the service identifier of the target service, and the target user cluster identifier;

[0192] The receiving module 801 is further configured to receive a service use request for a target service sent by a service use terminal through a target gateway module, wherein the service use request includes a service identifier of the target service and a user cluster identifier received by the service use terminal;

[0193] The search module is also used to search for address information of a container corresponding to the service identifier and the user cluster identifier received by the service usage terminal in the registration center through the target gateway module, and make the second container respond to the service usage request according to the address information, wherein when the user cluster identifier received by the service usage terminal matches the target user cluster identifier, the found address information is the address information of the second container; when the user cluster identifier received by the service usage terminal does not match the target user cluster identifier, the found address information is the address information of the first container.

[0194] Optionally, the establishment module 803 is further used to establish a first container providing a target service in a sandbox environment based on the bytecode;

[0195] The receiving module 801 is further configured to receive test data of a target service sent by a service providing terminal, and perform a service test on the first container using the test data.

[0196] Optionally, the service configuration information further includes: a version of the service configuration information, and the device further includes: a compilation module, which is used to use the domain specific language DSL of the version to compile the received service configuration information to obtain the compiled service configuration information.

[0197] Optionally, the service configuration information also includes a version of the target service; the establishment module 803 is further used to:

[0198] Receive container configuration information of a target service sent by a service providing terminal, where the container configuration information includes: a service identifier and a version of the target service;

[0199] Obtain the bytecode of the target service of the version according to the container configuration information, and generate the target Dockerfile script file according to the bytecode of the target service and the Dockerfile script file template with the service identifier added, where the Dockerfile script file template is used to implement at least the functions of the Dockerfile basic commands;

[0200] Create an image corresponding to the target service according to the target Dockerfile script file;

[0201] The image is transmitted to the service application platform so that the service application platform runs the image, thereby completing the construction of the first container in the service application platform.

[0202] Optionally, the sending module is used to send an alarm message to a maintenance personnel terminal corresponding to the first container when an abnormality is detected in the target service, where the alarm message indicates that an operation abnormality exists in the target service.

[0203] In summary, the service containerization device provided in the embodiment of the present application receives the service configuration information of the target service sent by the service providing terminal, generates the bytecode of the target service according to the service configuration information, and transmits the bytecode to the container operation and maintenance module. Thus, a first container providing the target service can be established on the service application platform based on the bytecode. Therefore, the automatic construction of containers for application services can be achieved through the service containerization platform. Compared with the related art, there is no need to manually write the Dockerfile script file, thereby avoiding the failure of container construction due to the accuracy problem of the Dockerfile script file, and improving the efficiency of container construction.

[0204] The service containerization device provided in the embodiment of the present application has a functional module corresponding to the execution of the service containerization method, and can execute the service containerization method provided in any embodiment of the present application, and can achieve the same beneficial effects.

[0205] In another embodiment provided in the present application, an electronic device is also provided. The electronic device may include: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process of the above-mentioned service containerization method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0206] For example, Fig. 9 As shown, the electronic device may specifically include: a processor 901, a storage device 902, a display screen 903 with a touch function, an input device 904, an output device 905, and a communication device 906. The number of processors 901 in the electronic device may be one or more. Fig. 9 A processor 901 is taken as an example. The processor 901, storage device 902, display screen 903, input device 904, output device 905 and communication device 906 of the electronic device can be connected via a bus or other means.

[0207] In another embodiment provided by the present application, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the service containerization method described in any one of the above embodiments.

[0208] In another embodiment provided by the present application, a computer program product including instructions is also provided. When the computer program product is executed on a computer, the computer executes the service containerization method described in any one of the above embodiments.

[0209] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0210] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0211] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0212] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0213] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0214] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0215] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0216] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0217] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0218] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0219] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A service containerization platform, characterized in that: The service containerization platform includes: a service generation module and a container operation and maintenance module; A service generation module is used to receive service configuration information of a target service sent by a service providing terminal, generate bytecode of the target service according to the service configuration information, and transmit the bytecode to a container operation and maintenance module, wherein the service configuration information includes: service type, network protocol, service framework type, and service function information, wherein the service function information is used to reflect the function of the target service; The container operation and maintenance module is used to obtain the target Dockerfile script file corresponding to the bytecode, establish the image corresponding to the target service according to the target Dockerfile script file, and transmit the image to the service application platform so that the service application platform runs the image to complete the construction of the first container providing the target service in the service application platform. The target Dockerfile script file is at least used to implement the functions of the Dockerfile basic commands.

2. The platform according to claim 1, characterized in that The service generation module is used to generate the bytecode of the target service through a bytecode enhancement component according to the service configuration information.

3. The platform according to claim 2, characterized in that: The service function information includes: at least one kind of function description information, the at least one kind of function description information includes: function identifier, type of calling method and parameter information of the calling method, the calling method is used to call the service that provides the function indicated by the function description information, the at least one kind of function description information also includes at least one of the following information: execution type of the calling method, main method identifier, the method identifier is used to indicate whether the calling method is the main method.

4. The platform according to claim 1, characterized in that: The service containerization platform further includes: a platform management module and a plurality of gateway modules, wherein one gateway module corresponds to one user cluster identifier; The platform management module is used to receive a service application request for the target service sent by the service user terminal, wherein the service application request includes a service identifier of the target service; The platform management module is used to allocate a target gateway module for the service user terminal from the multiple gateway modules; The platform management module is used to send the user cluster identifier corresponding to the target gateway module to the service usage terminal, so that the service usage terminal obtains the target service deployed in the container after connecting to the container through the gateway module corresponding to the user cluster identifier.

5. The platform according to claim 4, characterized in that The service application request further includes: information indicating the usage frequency of the target service; The platform management module is used to allocate a target gateway module to the service user terminal from the multiple gateway modules based on the usage frequency information, and the higher the usage frequency indicated by the usage frequency information, the smaller the number of service user terminals that can be connected to the target gateway module.

6. The platform according to claim 5, characterized in that The service configuration information further includes: a service billing mode, wherein the service billing mode includes: a billing mode based on usage time or a billing mode based on usage times, and the usage frequency information includes: a purchase time or a purchase times for the target service.

7. The platform according to claim 4, characterized in that The container operation and maintenance module is used to send a registration request to a registration center after establishing the first container, where the registration request includes the address information of the first container and the service identifier of the target service; The gateway module is used to receive a service use request for the target service sent by the service use terminal, wherein the service use request includes a service identifier of the target service; The gateway module is used to search the address information of the first container in the registration center according to the service identifier of the target service, and make the first container respond to the service use request according to the address information.

8. The platform according to claim 4, characterized in that The service application request further includes: information indicating the usage frequency of the target service; The platform management module is used to display a deployment review page for the target service when it is determined that the usage frequency information meets the high frequency requirement; The platform management module is configured to generate a private deployment instruction and send the private deployment instruction to the container operation and maintenance module when the deployment review interface receives a trigger for a private deployment operation for a service user terminal; The container operation and maintenance module is configured to establish, on the service application platform, a second container providing the target service based on the bytecode upon receiving the private deployment instruction, wherein the second container corresponds to a target user cluster identifier among the plurality of user cluster identifiers; The platform management module is used to use the gateway module corresponding to the target user cluster identifier as a target gateway module, and allocate the target gateway module to the service use terminal.

9. The platform according to claim 8, characterized in that The container operation and maintenance module is used to send a registration request to a registration center after establishing the second container, where the registration request includes the address information of the second container, the service identifier of the target service, and the target user cluster identifier; The gateway module is configured to receive a service use request for the target service sent by the service use terminal, wherein the service use request includes a service identifier of the target service and a user cluster identifier received by the service use terminal; The gateway module is used to search the registration center for address information of a container corresponding to the service identifier and the user cluster identifier received by the service usage terminal according to the service identifier and the user cluster identifier received by the service usage terminal, and make the second container respond to the service usage request according to the address information, When the user cluster identifier received by the service usage terminal matches the target user cluster identifier, the address information found is the address information of the second container; when the user cluster identifier received by the service usage terminal does not match the target user cluster identifier, the address information found is the address information of the first container.

10. The platform according to claim 1, characterized in that The container operation and maintenance module is used to establish a first container providing the target service in a sandbox environment based on the bytecode before establishing a first container providing the target service on a service application platform based on the bytecode; The service generation module is used to receive the test data of the target service sent by the service providing terminal, and perform a service test on the first container using the test data.

11. The platform according to claim 1, characterized in that The service configuration information also includes: a version of the service configuration information, The service generation module is used to compile the received service configuration information using the version of the domain specific language DSL to obtain compiled service configuration information.

12. The platform according to claim 1, characterized in that The service configuration information also includes the version of the target service; the container operation and maintenance module is used to: Receiving container configuration information of the target service sent by the service providing terminal, the container configuration information including: a service identifier and a version of the target service; Obtain the bytecode of the target service of the version according to the container configuration information, and generate a target Dockerfile script file according to the bytecode of the target service and a Dockerfile script file template to which the service identifier is added, wherein the Dockerfile script file template is at least used to implement the function of the Dockerfile basic command; Create an image corresponding to the target service according to the target Dockerfile script file; The image is transmitted to the service application platform so that the service application platform runs the image, thereby completing the construction of the first container in the service application platform.

13. A service containerization method, characterized in that: Applied to a service containerization platform, the method includes: Receiving service configuration information of a target service sent by a service providing terminal, the service configuration information including: service type, network protocol, service framework type and service function information, the service function information is used to reflect the function of the target service; Generate the bytecode of the target service according to the service configuration information; Obtain the target Dockerfile script file corresponding to the bytecode; Create an image corresponding to the target service according to the target Dockerfile script file; The image is transmitted to the service application platform so that the service application platform runs the image and completes the construction of the first container providing the target service in the service application platform, wherein the target Dockerfile script file is at least used to implement the functions of the Dockerfile basic commands.

14. A service containerization device, characterized in that: Applied to a service containerization platform, the device includes: A receiving module, used to receive service configuration information of a target service sent by a service providing terminal, wherein the service configuration information includes: service type, network protocol, service framework type and service function information, wherein the service function information is used to reflect the function of the target service; A generation module, used to generate the bytecode of the target service according to the service configuration information; A building module is used to obtain a target Dockerfile script file corresponding to the bytecode, build an image corresponding to the target service according to the target Dockerfile script file, transmit the image to a service application platform so that the service application platform runs the image, and complete the construction of a first container providing the target service in the service application platform, wherein the target Dockerfile script file is at least used to implement the functions of the Dockerfile basic commands.

15. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the service containerization method according to claim 13 when executed by the processor.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the service containerization method according to claim 13 are implemented.