业务服务建立方法、装置、计算机设备和存储介质

By constructing a three-tier service model, obtaining service requirement information and instance templates, and creating service instances, components, and container groups, the problem of low efficiency in establishing business services in traditional technologies is solved, and the generalization and efficient deployment of business services are realized.

CN119149164BActive Publication Date: 2026-11-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310713387.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2026-11-24
Estimated Expiration
2043-06-15

AI Technical Summary

Technical Problem

In traditional technologies, the establishment of business services is inefficient and cannot achieve universal deployment, forcing developers to deploy from scratch, which is inefficient.

Method used

By acquiring the service requirements information and preset instance templates of the target business services, a collection of service instances, components, and container groups is created to build a three-tier service model, enabling the abstraction and generalized deployment of business services.

Benefits of technology

It improved the efficiency of business service creation, enabled the universality and orderly deployment of business services, and enhanced the efficiency of business service creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149164B_ABST
    Figure CN119149164B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, storage medium, and computer program product for establishing a business service. The method includes: creating a service instance corresponding to the target business service based on service requirement information for the target business service and a preset target instance template for the target business service; creating service components based on component declaration information contained in the service instance, obtaining various service components corresponding to the target business service; creating a set of container groups corresponding to the service components based on container group declaration information contained in the service components, obtaining a set of container groups corresponding to each service component; and obtaining a service model corresponding to the target business service based on the service instance, each service component, and the set of container groups corresponding to each service component; the service model is used to provide the target business service to the requester corresponding to the service requirement information. This method can improve the efficiency of establishing business services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer technology and cloud-native technology, and in particular to a business service establishment method, apparatus, computer equipment, storage medium and computer program product. Background Technology

[0002] With the development of computer technology, various business services have emerged. A business service is a service that enables a certain business, such as database services and middleware services.

[0003] In traditional technologies, deploying and building any business service on a server usually requires developers to start from scratch, making it impossible to build general-purpose business services and resulting in low efficiency in business service creation. Summary of the Invention

[0004] Therefore, it is necessary to provide a business service creation method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the efficiency of business service creation in response to the above-mentioned technical problems.

[0005] This application provides a method for establishing a business service. The method includes:

[0006] Obtain service requirement information for the target business service, and obtain a preset instance template for the target business service as the target instance template;

[0007] Create a service instance corresponding to the target business service based on the service requirement information and the target instance template;

[0008] Service components are created based on the component declaration information contained in the service instance, thereby obtaining each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that respectively match the component types specified in the target instance template;

[0009] Based on the container group declaration information contained in the service component, a container group set corresponding to the service component is created, thus obtaining the container group set corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance;

[0010] Based on the service instance, each service component, and the container group set corresponding to each service component, a service model corresponding to the target business service is obtained; the service model is used to provide the target business service to the demand party corresponding to the service demand information.

[0011] This application also provides a business service establishment apparatus. The apparatus includes:

[0012] The data acquisition module is used to acquire service requirement information for the target business service and acquire a preset instance template for the target business service as the target instance template.

[0013] The instance creation module is used to create a service instance corresponding to the target business service based on the service requirement information and the target instance template.

[0014] The component creation module is used to create service components based on the component declaration information contained in the service instance, thereby obtaining each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that respectively match the component types specified in the target instance template;

[0015] The container creation module is used to create a set of container groups corresponding to the service component based on the container group declaration information contained in the service component, thereby obtaining the set of container groups corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance;

[0016] The model determination module is used to obtain the service model corresponding to the target business service based on the service instance, each service component, and the container group set corresponding to each service component; the service model is used to provide the target business service to the demand party corresponding to the service demand information.

[0017] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps described in the above-described business service establishment method.

[0018] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps described in the above-described business service establishment method.

[0019] A computer program product includes a computer program that, when executed by a processor, implements the steps described in the above-described business service establishment method.

[0020] The aforementioned business service establishment method, apparatus, computer equipment, storage medium, and computer program product acquire service requirement information for the target business service and obtain a pre-defined instance template for the target business service as the target instance template. Based on the service requirement information and the target instance template, a service instance corresponding to the target business service is created. Service components are created based on the component declaration information contained in the service instance, resulting in various service components corresponding to the target business service. The component declaration information is used to indicate the creation of service components that match the component types specified in the target instance template. Based on the container group declaration information contained in the service component, a set of container groups corresponding to the service component is created, resulting in the container group set corresponding to each service component. The container group declaration information contained in the service component is obtained from the service instance. Based on the service instance, each service component, and the container group set corresponding to each service component, a service model corresponding to the target business service is obtained. The service model is used to provide the target business service to the requester corresponding to the service requirement information. In this way, instance templates corresponding to various business services are pre-set to quickly establish the corresponding business services. For a target business service, the personalized service requirements and corresponding instance templates of the target business service are combined to obtain a service instance. Based on the component declaration information contained in the service instance, various service components are created for the target business service. Based on the container group declaration information contained in the service component, a set of container groups corresponding to the service component is created. The service instance, service components, and their respective container group sets constitute a service model for providing the target business service. This business service is abstracted into a three-layer model, including service instances, service components, and their corresponding container group sets. Service instances manage the creation of service components and container group sets, while each component manages the creation of its own container group set, enabling orderly business service establishment. Various business services can be abstracted into this three-layer model, ensuring strong versatility and improving the efficiency of business service establishment. Based on this three-layer model, business services are containerized in a cloud-native manner. Attached Figure Description

[0021] Figure 1 A diagram illustrating the application environment of a service establishment method in one embodiment;

[0022] Figure 2 This is a flowchart illustrating a service establishment method in one embodiment.

[0023] Figure 3 This is a schematic diagram of a service model in one embodiment;

[0024] Figure 4 This is a schematic diagram of the process for generating the configuration file corresponding to the container group in one embodiment;

[0025] Figure 5 This is a schematic diagram illustrating how the container group configuration component generates the configuration file corresponding to the container group in one embodiment.

[0026] Figure 6 This is a schematic diagram illustrating the initialization of the storage specifications of a container group in one embodiment;

[0027] Figure 7 This is a schematic diagram illustrating the monitoring of the service component's operational status via probes in one embodiment;

[0028] Figure 8 This is a schematic diagram of horizontal expansion of a container group in one embodiment;

[0029] Figure 9 This is a schematic diagram of vertical upgrade of container groups in one embodiment;

[0030] Figure 10 This is a schematic diagram illustrating the generation of a data snapshot for a container group in one embodiment;

[0031] Figure 11 This is a schematic diagram of a service recovery instance in one embodiment;

[0032] Figure 12 A structural block diagram of a service establishment apparatus in one embodiment;

[0033] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0035] The business service establishment method provided in this application involves cloud technology.

[0036] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.

[0037] A database, simply put, can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, capable of being shared by multiple users, with minimal redundancy, and independent of application programs.

[0038] A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or XML (Extensible Markup Language); or according to the type of computer they support, such as server clusters or mobile devices; or according to the query language used, such as SQL (Structured Query Language) or XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages.

[0039] The service establishment method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on other servers. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0040] Specifically, the server can obtain service requirement information for the target business service from the terminal. The server obtains a pre-defined instance template for the target business service as the target instance template, and creates a service instance corresponding to the target business service based on the service requirement information and the target instance template. The server creates service components based on the component declaration information contained in the service instance, obtaining each service component corresponding to the target business service. The component declaration information indicates the creation of service components that match the component types specified in the target instance template. The server creates a set of container groups corresponding to each service component based on the container group declaration information contained in the service component, obtaining the container group set corresponding to each service component. The container group declaration information contained in the service component is obtained from the service instance. Based on the service instance, each service component, and the container group set corresponding to each service component, a service model corresponding to the target business service is obtained. The service model is used to provide the target business service to the requester corresponding to the service requirement information. The server can return the access point of the service model to the terminal so that the terminal can use the target business service.

[0041] In one embodiment, such as Figure 2 As shown, a method for establishing a business service is provided, with an example of applying this method to a processing server. (Reference) Figure 2 The business service establishment method includes the following steps:

[0042] Step S202: Obtain service requirement information for the target business service, and obtain a preset instance template for the target business service as the target instance template.

[0043] The processing server handles business service establishment requests and establishes and deploys business services on relevant devices. For example, the processing server can deploy business services on a cloud server.

[0044] A target business service refers to a business service that is currently to be deployed or established. For example, various entry points for establishing business services can be provided to users, from which users can select the desired business service. The selected business service is then used as the target business service, which is established and deployed on the node cluster for the user. The access point for the successfully established target business service is then returned to the user so that they can use the target business service.

[0045] When selecting the desired business services, users can simultaneously submit service requests. These requests can include requirements regarding service deployment location, deployment scale, and so on. Service request information refers to the personalized requirements of the requesting party for the target business service. For example, for a database service, service request information could include deployment region requirements, availability zone requirements, disk space requirements, backup requirements, and node requirements.

[0046] An object is instantiated to obtain a corresponding instance. A business service is instantiated to obtain a corresponding service instance. Various business services have their own characteristics, and corresponding instance templates can be pre-defined for each business service. An instance template is a pre-defined specification template for the characteristics of a business service. Instance templates are used to declare the common metadata required to establish a business service. For example, an instance template includes the component types required by the business service, common component configuration parameters, and common container group configuration parameters. It can be understood that the component types contained in a business service are fixed. For example, for the ClickHouse database service, ClickHouse consists of two components: ZooKeeper and ClickHouse. ZooKeeper is used for ClickHouse's metadata management, and ClickHouse is used for ClickHouse's data storage and computation. For example, the ClickHouse database service is deployed on a cluster containing multiple nodes. ZooKeeper is responsible for scheduling and communication between nodes in the cluster, and ClickHouse is responsible for data storage and computation on the nodes in the cluster.

[0047] Specifically, the user determines the target business service and the service requirement information for the target business service on the terminal. The terminal sends the service requirement information for the target business service to the processing server, and then the processing server obtains the preset instance template for the target business service as the target instance template, and deploys the target business service based on the service requirement information and the target instance template.

[0048] Step S204: Create a service instance corresponding to the target business service based on the service requirement information and the target instance template.

[0049] Specifically, after determining the service requirement information and target instance template for the target business service, the service requirement information and target instance template are combined to create a personalized service instance corresponding to the target business service. The service instance corresponding to the target business service is used to indicate the various metadata required to establish the target business service.

[0050] In one embodiment, the service instance corresponding to a business service is a Cluster, which represents a cluster instance created by a business service and is implemented by a Kubernetes CRD. The instance template corresponding to the business service is a ClusterPreset, which represents a pre-configured specification template for a Cluster. For example, a ClusterPreset corresponding to a business service includes information such as the image, CPU / memory, and parameter configuration of the component corresponding to that business service. ClusterPreset is implemented by a Kubernetes CRD. Kubernetes (K8s) is a container orchestration system widely used in the cloud-native field, possessing characteristics such as high scalability, high availability, fault self-healing, and an open-source ecosystem. As a foundation, it can support large-scale production-grade cluster deployments. A CRD (Custom Resource Definition) is a resource type defined by the user in Kubernetes. It does not require modifying the Kubernetes source code to create a custom API server, greatly improving the scalability of Kubernetes. User-defined CRDs can implement corresponding functionalities through a correspondingly designed CRD controller.

[0051] In one embodiment, the target instance template is a YAML file for custom resource types implemented based on K8s CRD. The YAML file has already filled in the general information required by the target business service. The service requirement information for the target business service is personalized information. The service requirement information is filled into the YAML file, and a service instance corresponding to the target business service is created based on the filled YAML file.

[0052] Step S206: Create service components based on the component declaration information contained in the service instance to obtain each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that match the component types specified in the target instance template.

[0053] A business service typically consists of one or more components, each responsible for different functions within the service. For example, the ClickHouse database service comprises two components: ZooKeeper and ClickHouse. ZooKeeper manages the metadata of the ClickHouse database, while ClickHouse handles data storage and computation. The ZooKeeper and ClickHouse components work together to implement the ClickHouse database service.

[0054] Component declaration information is used to declare and indicate the metadata required for creating the components needed to create the business service. The service instance corresponding to the target business service includes the component declaration information for the target business service, which includes the component types required by the target business service, component configuration parameters, startup dependencies between components, and other information.

[0055] It's understandable that the component types required by the target business service are determined based on its service characteristics, and the required component types are specified in the instance template corresponding to the target business service. For example, for the ClickHouse database service, ClickHouse consists of two components: ZooKeeper and ClickHouse. The instance template for the ClickHouse database service specifies that two components are required: ZooKeeper and ClickHouse. The startup dependencies between the components required by the target business service are also determined based on its service characteristics, and the startup dependencies between the components are specified in the instance template. For example, for the ClickHouse database service, ClickHouse consists of two components: ZooKeeper and ClickHouse. The ZooKeeper component must start successfully before the ClickHouse component, which depends on ZooKeeper, can start. Therefore, the instance template for the ClickHouse database service specifies the startup dependency between the ZooKeeper and ClickHouse components. The component configuration parameters for the components required by the target business service include general configuration parameters and adjustable configuration parameters. The general configuration parameters are specified in the instance template corresponding to the target business service. The adjustable configuration parameters can be adjusted according to user needs, or default parameters can be used. The default parameters for adjustable configuration parameters can be specified in the instance template corresponding to the target business service.

[0056] Specifically, the processing server creates service components based on the component declaration information contained in the service instance. The component declaration information includes the component configuration parameters of various components required by the target business service. Based on the component configuration parameters, the corresponding components can be created, and the various service components corresponding to the target business service can be obtained.

[0057] Step S208: Create a set of container groups corresponding to the service component based on the container group declaration information contained in the service component, and obtain the set of container groups corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance.

[0058] A component's functionality can be implemented by one or more container groups. A container group consists of a set of related containers, also known as a pod. A container is an isolated unit that packages and unifies the resources required to run an application. A container includes the application code, its libraries and dependencies, any configuration files, and other system tools it depends on. Containers enable cross-platform portability, inter-process isolation, and efficient development and deployment. The various container groups required by a component constitute the container group set corresponding to that component.

[0059] Container group declarations declare and indicate the metadata required for creating a component's container group set. The container group declaration for the target business service includes information such as the number of pods required by the component and pod configuration parameters. For example, it might include the number of pods required, the image required for each pod, the CPU / memory requirements for each pod, and the disk specifications required for each pod. The service instance corresponding to the target business service also includes its container group declaration. Service components can obtain this information from the service instance corresponding to the target business service; that is, they inherit the container group declaration from the service instance.

[0060] It is understandable that the container group configuration parameters of the container group set required by the service components corresponding to the target business service include general configuration parameters and adjustable configuration parameters. The instance template corresponding to the target business service specifies the general configuration parameters. The adjustable configuration parameters can be adjusted according to user needs, or default parameters can be used. The instance template corresponding to the target business service can specify the default parameters of the adjustable configuration parameters.

[0061] Specifically, the processing server creates a set of container groups corresponding to the service component based on the container group declaration information contained in the service component. The container group declaration information includes the container group configuration parameters of each container group in the set of container groups required by the service component of the target business service. Based on the container group configuration parameters, the corresponding container group can be created. The container groups corresponding to the same service component form a set of container groups, and finally, the set of container groups corresponding to each service component is obtained.

[0062] Step S210: Based on the service instance, each service component, and the container group set corresponding to each service component, obtain the service model corresponding to the target business service; the service model is used to provide the target business service to the demand party corresponding to the service demand information.

[0063] Specifically, the processing server sequentially creates service instances corresponding to the target business service, various service components, and their respective container sets. Then, it combines these service components and container sets into a service model for the target business service. This service model is then used to provide the target business service to the requesting party corresponding to the service requirement information. Within the service model, service instances are used for global management, with a parent-child relationship between service instances and service components. Service components are used to manage container sets, with a parent-child relationship between service components and their corresponding container sets. The container sets are used for data processing specific to the target business service.

[0064] Taking ClickHouse database service as an example, when a user needs ClickHouse database service, the service request information submitted by the user includes the number of pod shards, the number of pod replicas, and the required disk size for each pod. The number of pod shards determines how many pods the data stored in the database needs to be distributed across in a distributed manner. The number of pod replicas determines how many pods are needed as backup pods to back up the data stored in the database. The required disk size for each pod determines the capacity of the pod to store business data. The processing server receives a business service establishment request for ClickHouse database service, which carries the service request information. The processing server obtains the ClusterPreset corresponding to the ClickHouse database service, combines the service request information and ClusterPreset to create the Cluster corresponding to the ClickHouse database service, which is denoted as Cluster1. Using a Clustermanager (instance controller) designed based on Kubernetes, a ZooKeeper component is created based on the ZooKeeper-related configuration parameters in Cluster1, and denoted as set1. set1 inherits the relevant configuration parameters of the pods required by the ZooKeeper component from Cluster1. Using a Kubernetes-based Cluster Manager (instance controller), a ClickHouse component is created based on the ClickHouse configuration parameters in Cluster1. This ClickHouse component is designated as set2, and set2 inherits the necessary pod configuration parameters from Cluster1. Similarly, using a Kubernetes-based Set Controller (component controller), the set of pods required for the ZooKeeper component is created based on the pod configuration parameters in the ZooKeeper component. Finally, using the same Kubernetes-based Set Controller, the set of pods required for the ClickHouse component is created based on the pod configuration parameters in the ClickHouse component. (Reference) Figure 3 The ClickHouse database service model required by users comprises a three-tier structure: Cluster1, representing the ClickHouse database instance; set1 and set2, representing the ClickHouse database components; and the individual pods required by each ClickHouse database component. The processing server can return the service access point corresponding to the established ClickHouse database service to the user, allowing the user to utilize the ClickHouse database service through this access point.

[0065] In the above-described business service establishment method, instance templates corresponding to various business services are pre-set to facilitate the rapid establishment of corresponding business services. For a target business service, the personalized service requirement information of the target business service and the corresponding instance template are combined to obtain a service instance corresponding to the target business service. Based on the component declaration information contained in the service instance, various service components corresponding to the target business service are created. Based on the container group declaration information contained in the service component, a set of container groups corresponding to the service component is created. The service instance corresponding to the target business service, each service component, and the set of container groups corresponding to each service component constitute a service model for providing the target business service. The business service is abstracted into a three-layer model, including service instances, service components, and the set of container groups corresponding to the service components. The service instance manages the information related to the creation of service components and container groups, and each component manages the information related to the creation of its own set of container groups, achieving orderly business service establishment. Various business services can be abstracted into a three-layer model, demonstrating strong versatility and ensuring the generality of business service establishment, thus improving the efficiency of business service establishment. Based on this three-layer model, business services are containerized in a cloud-native manner.

[0066] In one embodiment, creating a service instance corresponding to the target business service based on service requirement information and a target instance template includes:

[0067] The service requirement information is populated into the target instance template to obtain the service instance corresponding to the target business service. The target instance template includes a component declaration area and a container group declaration area. The component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.

[0068] The target instance template includes a component declaration area and a container group declaration area. The component declaration area indicates component declaration information; that is, the content contained in the component declaration area constitutes the component declaration information. The container group declaration area indicates container group declaration information; that is, the content contained in the container group declaration area constitutes the container group declaration information.

[0069] Specifically, after the processing server obtains the service requirement information for the target business service, it populates the service requirement information into the target instance template, and obtains the service instance corresponding to the target business service based on the populated target instance template. The target instance template can be a key-value template file. The service requirement information includes at least one requirement item. When populating the target instance template, the server queries the target instance template for the key that matches each requirement item, and uses the specific information of the requirement item as the value corresponding to the matching key.

[0070] In the above embodiments, the service requirement information for the target business service is filled into the target instance template for the target business service, which can quickly create a service instance corresponding to the target business service.

[0071] In one embodiment, service components are created based on the component declaration information contained in the service instance, resulting in various service components corresponding to the target business service, including:

[0072] Based on the component declaration information contained in the service instance, determine the types of each component required by the target business service and the component configuration information corresponding to each component type; based on the configuration information of each component, create service components that match the corresponding component types to obtain the service components corresponding to the target business service.

[0073] Specifically, the component declaration information includes the various component types required by the target business service. The component types determine what types of components the target business service needs. The component declaration information also includes the component configuration information corresponding to each component type required by the target business service. The component configuration information determines the configuration parameters of the components required by the target business service and includes various fields needed to create components of the corresponding component types. Based on the component declaration information contained in the service instance, the processing server determines the various component types required by the target business service and the corresponding component configuration information. Based on the component configuration information, it creates service components that match the corresponding component types, thus obtaining the various service components corresponding to the target business service.

[0074] In the above embodiments, the component declaration information declares the various component types required by the target business service and the component configuration information corresponding to each component type. Based on the component declaration information, various service components corresponding to the target business service can be quickly created.

[0075] In one embodiment, a set of container groups corresponding to a service component is created based on the container group declaration information contained in the service component, resulting in a set of container groups corresponding to each service component, including:

[0076] For any service component among the various service components, based on the container group declaration information contained in the service component, determine the number of container groups required by the service component, and create each container group to be configured that matches the number of container groups; based on the container group declaration information contained in the service component, determine the container group configuration information corresponding to each container group to be configured; based on the container group configuration information, initialize the corresponding container group to be configured to obtain the configured container group; and obtain the container group set corresponding to the service component based on each configured container group.

[0077] Specifically, the container group declaration information includes the number of container groups required by the service component, which determines how many pods the service component needs. The processing server can create various container groups to be configured, matching the number of container groups. The container group declaration information also includes the container group configuration information required by the service component, which determines the configuration parameters of the pods. Each pod has its own corresponding container group configuration information. Based on the container group configuration information, the processing server can initialize the corresponding container groups to be configured, resulting in configured container groups. Ultimately, these configured container groups form the container group set corresponding to the service component.

[0078] In one embodiment, initializing the container group to be configured includes initializing the namespace (NS) of the container group. Kubernetes uses namespaces to group related resources within the same namespace to achieve resource isolation and access control. Pods corresponding to a single business service are placed in the same namespace, while pods corresponding to different business services are placed in different namespaces to achieve business service isolation. For example, the pods corresponding to user A's MySQL database service are placed in namespace 'a', and the pods corresponding to user B's MySQL database service are placed in namespace 'b'.

[0079] In one embodiment, initializing the container group to be configured includes initializing the storage specifications of the container group. The storage specifications of a pod determine the storage capacity and storage directory for the data within the pod. The storage specifications of a pod can be configured according to user needs.

[0080] In one embodiment, initializing the container group to be configured includes initializing the network of the container group to be configured. The network of a pod is used for communication between different pods.

[0081] In one embodiment, initializing the container group to be configured includes initializing the configuration file for the container group. The pod's configuration file is used for the pod's process execution. The pod's configuration file can be set using Kubernetes' built-in ConfigMap or using other custom components.

[0082] In the above embodiments, the container group declaration information declares the number of container groups required by the service components and the container group configuration information. Based on the container group declaration information, the container group set corresponding to each service component can be quickly created.

[0083] In one embodiment, such as Figure 4 As shown, based on the container group configuration information, the corresponding container group to be configured is initialized to obtain the configured container group, including:

[0084] Step S402: For any container group to be configured, obtain the container group runtime-specific information corresponding to the container group to be configured through the container group configuration component, and render the personalized information and container group runtime-specific information in the container group configuration information to obtain the container group personalized configuration information corresponding to the container group to be configured.

[0085] Step S404: Obtain the container group configuration file template corresponding to the target business service through the container group configuration component, render the container group personalized configuration information and the container group configuration file template to obtain the target configuration file corresponding to the container group to be configured.

[0086] Step S406: The target configuration file is distributed to the container to be configured through the container group configuration component, and the configured container group initialized on the configuration file is obtained.

[0087] The container group configuration component is a pre-configured component used to configure the final configuration file required by the container group. Container group runtime-specific information refers to the information used by the container group to identify itself during runtime. For example, container group runtime-specific information includes the pod's name, domain name, IP address, and status.

[0088] It's understandable that container group configuration information refers to parameters relevant before the container group runs; this configuration information exists before the pod is created. Personalized information within the container group configuration is determined based on the service requirements submitted by the user. Container group runtime-specific information refers to parameters relevant to the container group during runtime; this runtime-specific information only exists after the pod is created. For example, before creating a pod, only the number of pods and their image information are known; only after the pod is created are identifiers such as the pod's name, domain name, IP address, and status generated.

[0089] Each business service has its own corresponding container group configuration file template. These templates are provided by the business development team of the respective business and are specific to each pod. For example, for database services, this includes various database services such as MySQL, MariaDB, PostgreSQL, SQL Server, ClickHouse, MongoDB, and Redis. Taking the MySQL database service as an example, the MySQL database service belongs to the MySQL database provider, and the engineers responsible for MySQL will write the configuration file templates for the pods required by the MySQL database.

[0090] The container group configuration file template includes existing basic configuration parameters and customizable configuration parameters to be added. Basic configuration parameters are common to different pods of the same type, while customizable configuration parameters are specific to each pod. Adding the customizable configuration parameters to the template will result in a complete configuration file.

[0091] Specifically, the processing server can generate target configuration files for each container group to be configured through the container group configuration component, and distribute each target configuration file to the corresponding container group to be configured, thereby obtaining each configured container group initialized on the configuration file.

[0092] When generating the target configuration file, the container group configuration component first obtains the runtime-specific information of the container group to be configured. The personalized information and runtime-specific information from the container group configuration information are then rendered; that is, the container group configuration information and runtime-specific information are combined to obtain the personalized configuration information for the container group to be configured. Next, the container group configuration component obtains the container group configuration file template corresponding to the target business service. The personalized configuration information and the container group configuration file template are then rendered; that is, the personalized configuration information is populated into the container group configuration file template, ultimately resulting in the target configuration file for the container group to be configured.

[0093] In the above embodiments, the container group configuration component renders the personalized information and runtime-specific information of the container group configuration information to obtain personalized container group configuration information. Then, it renders the personalized container group configuration information and the container group configuration file template to obtain the complete target configuration file. The container group configuration component can quickly generate the configuration files required for a container group.

[0094] In one embodiment, the container group configuration component obtains the container group configuration file template corresponding to the target business service, including:

[0095] The container group configuration component retrieves the template index of the container group configuration file template for the target business service from the container group declaration information. Based on the template index, the container group configuration file template is retrieved from the preset storage area. The container group configuration file template is submitted to the preset storage area through the template unification tool. The template unification tool is used to unify the format of the container group configuration file templates provided by multiple business developers corresponding to the business type of the target business service.

[0096] Within this framework, business services are categorized into corresponding business types. For instance, various database services correspond to the business type "database," and various middleware services correspond to the business type "middleware." The business developers are the companies or vendors that develop the services. For example, regarding databases, this includes various databases such as MySQL, MariaDB, PostgreSQL, SQL Server, ClickHouse, MongoDB, and Redis. The MySQL database developer will provide the necessary pod configuration file templates, and the ClickHouse database developer will provide the necessary pod configuration file templates.

[0097] The template unification tool is a pre-configured tool used to standardize the format of configuration file templates. It converts container group configuration files provided by multiple business developers for the same business type into a unified format for subsequent processing of container group configuration components.

[0098] Upload container group configuration file templates provided by multiple business developers for the same business type to the template unification tool. The template unification tool converts each container group configuration file template into a unified format and then submits the unified format container group configuration file templates to a preset storage area for storage.

[0099] Storing container group configuration file templates in a preset storage area means storing the templates in a pre-defined storage area. This preset storage area can be configured according to actual needs. After storing the container group configuration file template, you will obtain the template index corresponding to that template, which allows you to quickly find the corresponding container group configuration file template.

[0100] After obtaining the template index corresponding to the container group configuration file template by storing the container group configuration file template, the template index of the container group configuration file template can be written into the instance template corresponding to the corresponding business service in advance, so that the template index can be passed between the service instances and service components corresponding to the corresponding business service in the future.

[0101] Specifically, container group configuration file templates provided by multiple business developers corresponding to the business type of the target business service can be obtained in advance. A template unification tool is then used to standardize the format of each container group configuration file template, and these standardized templates are submitted to a pre-defined storage area. For any given business service, the template index corresponding to its container group configuration file template is obtained, and this index is written into the corresponding instance template.

[0102] For a target business service, when obtaining the corresponding container group configuration file template through the container group configuration component, the template index of the container group configuration file template for the target business service can be obtained from the container group declaration information through the container group configuration component, and the container group configuration file template can be obtained from the preset storage area based on the template index.

[0103] In the above embodiments, the container group configuration file templates provided by multiple business developers corresponding to the business type of the target business service are standardized in advance using a template unification tool. This makes it convenient for the container group configuration component to write logic based on only one format. Pre-writing the template index of the container group configuration file template for the target business service into the container group declaration information allows the container group configuration component to quickly obtain the container group configuration file template to generate the required configuration file for the container group.

[0104] In one embodiment, the configuration required for each component's pod in a business service may differ, necessitating the maintenance of a configuration for each pod. Pods often also need to be aware of their own shard ID, allocated CPU, allocated memory, and information such as the IP addresses and domain names of other pods in the cluster. This information is typically recorded in the pod's configuration file and provided to the processes within the pod. The method in this application generates pod configuration files using the ConfigCenter component (a container group configuration component).

[0105] refer to Figure 5 ClusterParams represents the personalized parameter configuration of the service requester (i.e., the user of the service). Typically, the upper-layer service obtains ClusterParams based on the requester's configuration and then passes it to the instance controller, Cluster Manager, via Cluster. The instance controller, Cluster Manager, passes ClusterParams to the ConfigCenter component by accessing its internal API.

[0106] ConfigTemplates represent configuration file templates for pods, and by default, Go Template rendering is supported. Taking databases as an example, different database ConfigTemplates are written by engineers working with different databases. ConfigTemplates are submitted to object storage (ObjectStorage) by the ConfigCli tool (i.e., a template unification tool). The ConfigCenter component can retrieve ConfigTemplates from ObjectStorage through StorageProvider, which is the external storage interface for accessing the external ObjectStorage object.

[0107] ValueRender (the first rendering module) means rendering the passed ClusterParams parameter and the pod runtime information, that is, merging ClusterParams and container group runtime-specific information to obtain the required variable value Value.

[0108] ConfigRender is the central module of the ConfigCenter component. It can be viewed as a stateless string template rendering function. It renders the variable value Value obtained in the previous step with ConfigTemplates, that is, it merges the variable value Value with ConfigTemplates to generate the target configuration file ConfigArtifacts. ConfigArtifacts is the configuration file generated by the ConfigCenter component, which can be directly distributed to the corresponding Pod for process use. The ConfigCenter component distributes ConfigArtifacts to the pod through an HTTP server, which is an external interface.

[0109] In one embodiment, based on container group configuration information, the corresponding container group to be configured is initialized to obtain a configured container group, including:

[0110] Create a target persistent volume declaration that matches the storage specifications in the container group configuration information; generate target persistent volume content based on the target persistent volume template contained in the target persistent volume declaration, and associate the target persistent volume content with the hard disk that matches the storage specifications in the container group configuration information; bind the target persistent volume content and the target persistent volume declaration, write the target persistent volume declaration to the container group to be configured, and obtain the configured container group initialized on the storage specifications; the data in the configured container group is used to write to the hard disk.

[0111] The container group configuration information includes storage specifications, which indicate the storage capacity of the pod for storing business data.

[0112] A volume is used to bind and mount a directory on a hard drive to a directory within a pod. A persistent volume refers to a directory on the hard drive that possesses "persistence," meaning its contents will not be deleted when the pod is deleted. Thus, when the pod is restarted or rebuilt on another node, it can still access these contents by mounting the volume. "Persistence" means that files written to the pod's own directory are saved on the hard drive, giving the directory "persistence." Various disks are supported, including local hard drives and cloud disks. Cloud disks allow dynamic plugging and unplugging; if a directory within a pod is bound and mounted to a directory on a cloud disk, the pod can be restored to another node. However, for local hard drives, restoration is limited to the original node unless data migration is performed.

[0113] A persistent volume template (StorageClass, SC) is a pre-defined storage type template. It categorizes different hard drives into specific storage types based on specifications, performance levels, etc., allowing businesses to choose according to their needs and flexibly control costs. A persistent volume content (PersistentVolume, PV) represents the underlying storage abstraction of the hard drive and is associated with the actual hard drive. A persistent volume claim (PersistentVolumeClaim, PVC) represents the underlying storage object abstracted for use by Pods, declaring the required storage capacity (e.g., 100GB), whether it's exclusive or shared by the Node, and whether it's a file system or block device. In essence, the SC is a template for creating PVs, used to dynamically create PVs. A PV defines a directory for persistent storage on the hard drive. A PVC describes the attributes of the persistent storage that the Pod wants to use, such as the size of the volume storage and read / write permissions.

[0114] Specifically, the target business service can be a stateful service. A stateful service is one that requires persistent storage of data, sessions, or service state, and whose startup, operation, and recovery strictly depend on the correctness and consistency of the stored data. For example, database services are stateful services, including various database services such as MySQL, MariaDB, PostgreSQL, SQL Server, ClickHouse, MongoDB, and Redis. Middleware services are also stateful services, including various message middleware services such as RabbitMQ, RocketMQ, ActiveMQ, Kafka, ZeroMQ, and MetaMQ. Multiple Pods within the components required by a stateful service typically need to persistently store business data; therefore, a PVC needs to be set up for each Pod to declare the required storage specifications.

[0115] When configuring a PVC for a pod, a target PVC matching the storage specifications in the container group configuration information is created by calling the relevant interfaces provided by Kubernetes. A corresponding target PV is generated based on the target SC contained in the target PVC. The target PV is associated with a hard disk (local hard disk or cloud hard disk) that matches the storage specifications in the container group configuration information. The target PV and target PVC are bound together. The target PVC is written to the container group to be configured, and the configured container group initialized on the storage specifications is obtained.

[0116] refer to Figure 6 A pod mounts a corresponding PVC to declare its required storage specifications, such as a storage capacity of 20 Gi and a filesystem volume mode. The PVC is bound to a corresponding PV, and the underlying CSI plugin implements the specific persistent storage of the PV. PV attributes include storage capacity (20 Gi), storage type (StorageClass), and deletion retention policy (Retain means that the corresponding PV is retained when the PVC is deleted). The PV is associated with the actual disk system, and its attributes include region, availability zone, capacity (20 Gi), and type (SSD). In this way, data written by the pod in its own directory can find the corresponding PV through the PVC, find the disk through the PV, and finally be written to the directory on the disk.

[0117] In the above embodiments, the storage specifications of the container group are initialized, and the business data stored on the container group can be ultimately stored on a remote hard disk through persistent volume declaration, which helps to achieve persistent data storage.

[0118] In one embodiment, the business service establishment method further includes:

[0119] Based on the service component startup dependency order provided by the component declaration information, each service component is started in an orderly manner; the running status of each service component is monitored by probes set for each service component; after the probe set for the service component with high startup priority detects that each container group in the container group set managed by the service component has started successfully, the service component with the next startup priority is triggered to start; after each service component starts successfully, a creation success message corresponding to the target business service is returned to the requester.

[0120] Specifically, the service components required by the target business service have a startup dependency order. The target business service can only operate normally if the service components are started in the order of their startup dependencies. The component declaration information provided by the service instance corresponding to the target business service records the startup dependency order of the service components. The startup dependency order is used to start each service component in an orderly manner after the service component and the corresponding container group set are created, so as to realize the operation of the target business service.

[0121] After creating the service components and their corresponding container sets, probes are set up for each service component. These probes monitor the running status of the service components, which is reflected in the running status of each container group within the service component's container set. After creating the service components and their corresponding container sets, the service components are started sequentially according to their startup dependencies. The running status of the service components that need to be started first is detected by probes. Only after all container groups under the service component that needs to be started first have successfully started and are running normally is the next service component started. That is, once the probe set for a service component with a high startup priority detects that all container groups in the container set managed by the service component have successfully started, the next service component with the next startup priority is triggered to start. After all service components have started successfully, it indicates that the target business service is operating normally. At this point, a creation success message for the target business service can be returned to the requester of the target business service.

[0122] Taking ClickHouse database service as an example, refer to Figure 7The ClickHouse database service model includes Cluster1, representing the ClickHouse database instance; set1 and set2, representing the ClickHouse database components; and pods, representing database processes. The ClickHouse database service consists of two components: ZooKeeper and ClickHouse. The ZooKeeper component must start successfully before the ClickHouse component, which depends on ZooKeeper, can start. The Kubernetes readiness probe is used to detect which component starts first. Once all pods under set1 show as "Running" and are functioning normally, the next component is started sequentially.

[0123] It is understandable that if there are no dependencies between some components, probes do not need to be configured, and the Pods of these components can be started in parallel.

[0124] In the above embodiments, based on the service component startup dependency order provided by the component declaration information, and with the help of probes set for each service component, each service component is started in an orderly manner, which can ensure that each service component starts in an orderly manner, thereby ensuring that the target business service can run successfully.

[0125] In one embodiment, the business service establishment method further includes:

[0126] Obtain the container group adjustment request for the target business service; the container group adjustment request carries container group adjustment parameters; update the container group declaration information contained in the service instance based on the container group adjustment parameters; based on the updated container group declaration information, update the corresponding service component and the corresponding container group set.

[0127] Container group adjustment requests are used to adjust pods, specifically for scaling up, down, or upgrading pods. Container group adjustment parameters indicate the adjustment requirements for a pod. Scaling up or down a pod refers to adding or removing pods; for example, increasing the number of pods can increase the number of replicas. Upgrading or down a pod refers to increasing or decreasing its storage specifications, such as vertically upgrading or downgrading the CPU, memory, or disk required by a pod.

[0128] Specifically, as the workload of the target business service increases or decreases, the pods in the service model corresponding to the target business service can be flexibly adjusted accordingly. The processing server can obtain container group adjustment requests for the target business service. The container group adjustment request carries container group adjustment parameters, and the container group declaration information contained in the service instance is updated based on the container group adjustment parameters. For example, if the container group adjustment request is used for pod scaling, the number of pods in the container group declaration information is adjusted; if the container group adjustment request is used for pod upgrade, the pod storage specifications in the container group declaration information are adjusted. If the service instance changes, the service components and the corresponding container group set will be updated synchronously. For example, the component controller monitors changes in information in the service instance in real time. If it detects a change in the corresponding container group declaration information in the service instance, it will synchronously update the corresponding container group set based on the updated container group declaration information.

[0129] For example, taking database services as an example, a Cluster Manager (instance controller) implemented based on Kubernetes CRDs controls the underlying Kubernetes StatefulSets to achieve dynamic scaling (i.e., increasing or decreasing the number of replicas, also known as horizontal scaling) and vertical upgrade / degrade (adjusting Pod specifications such as CPU / Memory / Disk). For information on dynamic database scaling, please refer to [link / reference]. Figure 8 Two more pods were added to set1. For vertical upgrades of the database, please refer to [reference needed]. Figure 9 The storage specifications of the pods under set1 have increased from 4 cores and 8GB to 8 cores and 16GB. Correspondingly, dynamic scaling down of the database involves reducing the number of replicas, while vertical degradation of the database involves reducing the storage specifications.

[0130] Furthermore, to avoid impacting the normal operation of upper-layer services, during dynamic scaling up / down or vertical upgrade / downgrade operations, network traffic to the relevant pods is removed beforehand. Once the underlying pods undergoing scaling up / down or upgrade / downgrade detect normal operation, service traffic is reinstated, achieving smooth operation without affecting services. Taking a database service as an example, when the database service is running, if it needs to query data stored in the database, it can determine the target pod from among the pods used for data storage and computation based on a load balancing strategy, and then query the required data from the target pod. If vertical upgrade / downgrade is needed for pod1, which is used for data storage and computation, the target pod is determined from among the other pods used for data storage and computation besides pod1. After pod1 completes its vertical upgrade / downgrade, pod1 can be considered when determining the target pod.

[0131] In the above embodiments, the container group set corresponding to the service component supports dynamic scaling and vertical upgrades and downsizing, providing high flexibility.

[0132] In one embodiment, the business service establishment method further includes:

[0133] When the destruction of a service instance is triggered, the service instance is backed up to obtain a backup instance. Each service component's corresponding container group set is designated as a first container group. A persistent volume snapshot declaration is created based on the persistent volume declaration of the first container group, and persistent volume snapshot content is created based on the persistent volume content of the first container group. The persistent volume snapshot declaration and persistent volume snapshot content are bound together. A data snapshot is generated based on the bound persistent volume snapshot declaration and persistent volume snapshot content of the first container group. The container group's runtime identifier information and the data snapshot are associated and stored together. The backup instance and the data snapshots corresponding to each container group in each service component's corresponding container group set are associated and stored together.

[0134] A snapshot is used to record the system state and data at a specific point in time. A persistent volume snapshot declaration (VSS) represents an abstract resource object of a persistent volume snapshot. A persistent volume snapshot content (VSC) represents an abstract resource object of the persistent volume snapshot content, associated with the actual backend snapshot storage resource, such as COS / NFS. COS (Cloud Object Storage) is a distributed, high-volume storage system for unstructured objects. NFS (Network File System) is a distributed, high-volume storage system. Container group runtime identification information is used to identify container groups; for example, it could be the name of a pod.

[0135] Specifically, when the destruction of a service instance corresponding to a target business service is triggered, a snapshot backup is automatically initiated to back up the data stored in the service instance and the container group collection, so as to facilitate the subsequent recovery of the service instance. When the destruction of a service instance corresponding to a target business service is triggered, the service instance is backed up to obtain a backup instance. The backup instance includes the same metadata as the service instance, which is used to restore the service model corresponding to the target business service.

[0136] When the destruction of a service instance corresponding to a target business service is triggered, the business data stored in the pod is backed up so that the business data stored in the pod can be synchronously restored when the service model is restored. Each service component's corresponding container group set is designated as the first container group. For any first container group, relevant Kubernetes interfaces are called to create a VSS based on the PVC corresponding to the first container group, and relevant Kubernetes interfaces are called to create a VSC based on the PV corresponding to the first container group. The VSS and VSC are then bound, and a data snapshot of the first container group is generated based on the bound VSS and VSC. Furthermore, the container group runtime identifier information corresponding to the first container group is associated and stored with the data snapshot, using the container group runtime identifier information to indicate which pod the data snapshot belongs to.

[0137] Finally, the backup instance and the data snapshots corresponding to each container group in the container group set corresponding to each service component are associated and stored for subsequent data recovery.

[0138] It's understandable that, in addition to initiating a snapshot backup of the business data in the pod when the service instance is destroyed, it's also possible to initiate a snapshot backup of the business data in the pod periodically. Data snapshots can be created based on Block technology or XFS Reflink technology.

[0139] For example, regarding the generation of data snapshots for business data within a pod, refer to... Figure 10 By calling the relevant interfaces provided by Kubernetes, a Virtual Private Server (VSS) is created from the PVC mounted to the pod, and a Virtual Private Server (VSC) is created from the PV bound to the PVC mounted to the pod. The VSS and VSC are then bound together, and a Snapshot is created based on the data stored in the relevant directory on the disk associated with the PV of the pod. Snapshot requests are initiated at different points in time, and the generated Snapshots store the data at the corresponding points in time. That is, N Snapshots can be generated for the same disk, and each Snapshot stores data from the relevant directory on the disk at different points in time.

[0140] In the above embodiments, when the destruction of a service instance is triggered, timely backup of the business data stored in the service instance and container group set helps to quickly restore the service instance in the future.

[0141] In one embodiment, the business service establishment method further includes:

[0142] When a recovery of a service instance is triggered, a backup instance is obtained; service components are created based on the component declaration information contained in the backup instance, resulting in various recovery components; a set of container groups corresponding to the recovery components is created based on the container group declaration information contained in the recovery components, resulting in a set of container groups corresponding to each recovery component; the container groups in the set of container groups corresponding to each recovery component are respectively used as second container groups; the corresponding data snapshot is obtained based on the container group running identifier information of the second container group; a persistent volume snapshot declaration and persistent volume snapshot content of the second container group are generated based on the data snapshot of the second container group; persistent volume content of the second container group is generated based on the persistent volume snapshot content of the second container group; persistent volume declaration of the second container group is generated based on the persistent volume snapshot declaration of the second container group; the persistent volume content and persistent volume declaration of the second container group are bound; and the persistent volume declaration of the second container group is applied to the second container group.

[0143] Specifically, the process of restoring service instances can be initiated at any time according to user needs. When the restoration of the service instance corresponding to the target business service is triggered, a pre-backed-up backup instance is obtained, the service model is restored based on the backup instance, a pre-backed-up data snapshot is obtained, and the business data stored on the pod in the service model is restored based on the data snapshot.

[0144] When restoring a service model based on a backup instance, similar to the process of creating service components and corresponding container group sets through a service instance, service components are created based on the component declaration information contained in the backup instance, resulting in various recovery components. Container group sets corresponding to the recovery components are created based on the container group declaration information contained in the recovery components, resulting in the container group sets corresponding to each recovery component. The backup instance, each recovery component, and the container group sets corresponding to each recovery component together form the service model restored for the target business service.

[0145] When restoring business data based on data snapshots, each container group in the set of container groups corresponding to each recovery component is treated as a second container group. For any second container group, a corresponding data snapshot is obtained based on the container group runtime identifier information. The relevant interfaces provided by Kubernetes are called to generate the corresponding VSS and VSC for the second container group based on the data snapshot. The relevant interfaces provided by Kubernetes are also called to generate the corresponding PV for the second container group based on the VSC. A corresponding PVC for the second container group is generated based on the VSS. The PVC and PV are bound, and the PVC is applied to the second container group. The second container group can then read business data from the corresponding disk and store it in its own directory. It can be understood that pods created based on the same metadata have the same container group runtime identifier information. For example, if the first pod was named pod1 before destruction, then the first pod will also be named pod1 during restoration.

[0146] For example, refer to Figure 11 Based on cluster1, three pods are created using corresponding sets. When cluster1 is destroyed, it is backed up, and snapshots for pod1, pod2, and pod3 are generated. Within the data snapshot's validity period, the process of restoring cluster1 can be initiated at any time as needed. Cluster2 is generated based on the backup of cluster1. Sets are created based on cluster2, and three pods (pod1', pod2', and pod3') are created from these sets. For the business data that pod1', pod2', and pod3' need to store, snapshots corresponding to pod1', pod2', and pod3' are obtained. Starting from these snapshots, VSS and VSC are created and bound together. Then, PVCs are created using VSS as the data source, and PVs are created using VSC as the data source. PVCs and PVs are bound together, and the PVCs are mounted under the corresponding pods. Finally, pod1', pod2', and pod3' will start running, enabling cluster2 to operate normally.

[0147] In the above embodiments, when a service instance is restored, based on the pre-backed-up backup instance and data snapshot, a service model storing the same business data as before the destruction can be quickly restored, ensuring the continued operation of the target business service.

[0148] In one embodiment, the target business service is a target database service, the service instance is used to indicate the metadata required to establish the target database service, each service component is responsible for implementing the various functions of the target database service, and each container group in the same container group set is used to cooperate to implement the functions provided by the corresponding service components.

[0149] Specifically, with the widespread adoption and production practice of cloud-native technologies, more and more database services need to migrate from traditional physical machine process management to cloud-native containerized management to achieve rapid iteration, efficient deployment, elastic scaling, and underlying difference shielding. The method described in this application can be used for the containerized implementation of database services and is applicable to various database services. Database services typically consist of multiple components; therefore, implementing containerized management of database services requires considering the containerization of multiple components. Different components are responsible for implementing different functions of the target database service. For example, a database service may include a database coordination component and a database engine component. Database services are generally implemented through a node cluster. The database coordination component coordinates communication between node clusters, while the database engine component performs data storage and computation on business data in the database, implementing business data management. Container groups belonging to the same container set cooperate to implement the functions provided by the corresponding service components. For example, for the database engine component, multiple sharded pods and multiple replica pods can be set up. One sharded pod manages a portion of the business data, and the business data managed by each sharded pod is combined to form the complete business data stored in the database. One replica pod is used for data backup of a portion of the business data. For the same portion of business data, multiple replica pods can be set up for multiple backups.

[0150] In one specific embodiment, the method of this application can be applied to scenarios where cloud vendors provide database services to customers. Database services are a typical stateful service, requiring the persistent storage of data, sessions, or service state.

[0151] Traditional technologies typically utilize StatefulSets in Kubernetes to manage individual components of stateful services and provide persistent storage. Their core capabilities include fixed Pod names and persistent data storage, but they lack the ability to manage multiple databases and components universally, such as component dependencies, differentiated configurations, dynamic scaling, dynamic upgrades and downsizing, and data backup and recovery. The method described in this application implements a general model abstraction for database services and the aforementioned core database management capabilities.

[0152] It is understandable that database services consist of multiple components: common database services generally consist of one or more components. Therefore, implementing containerized management of database services requires considering the containerization of multiple components. This application's method abstracts common database services into a general three-layer resource model, from top to bottom: cluster->sets->pods, corresponding to database instances, database components, and database process pods, respectively. This three-layer resource model supports the containerization of various database services. When a customer purchases a database service from a cloud provider, they can select the database type and their personalized requirements for the database service. After receiving the customer's request, the cloud provider's processing server obtains the instance template corresponding to the customer's required database type. Based on the customer's personalized requirements and the instance template, it quickly creates the required database instance. The database instance declares all the metadata needed to implement the user's required database service. Database components are created based on the component declaration information in the database instance, and database process pods corresponding to the database components are created based on the pod declaration information inherited by the database components from the database instance.

[0153] Furthermore, database service components typically have a startup dependency order. For example, the ClickHouse database service consists of two components: ZooKeeper and ClickHouse. The ZooKeeper component must start successfully before the ClickHouse component, which depends on ZooKeeper, can start. The database instance records the startup dependency order of the database components. The method in this application uses the Kubernetes readinessProbe to detect which component starts first. Only after all pods under that component show "Running" as their startup status is confirmed are the next component started in sequence.

[0154] Furthermore, the components of the database service have differentiated configurations, and each component of the database service has specific configurations. Different pods within each component may have different configurations. The method in this application generates the configuration file required by the pod after it is created and quickly distributes the configuration file to the pod to achieve differentiated configuration for the pod.

[0155] Furthermore, the database needs dynamic scaling. As the volume of upper-layer business supported by the database service increases or decreases, the underlying database service needs to support dynamic scaling of the number of replicas without affecting the normal operation of upper-layer business. The database also requires vertical upgrades and downgrades. The database service not only needs to scale the number of replicas but may also need to vertically upgrade or downgrade the specifications of existing pods (such as CPU / Memory / Disk), for example, upgrading CPU / Memory from 4C8G to 8C16G, without affecting the normal operation of upper-layer business. If dynamic scaling or vertical upgrades and downgrades of the database are required, the database instance can be modified. If an update to the database instance is detected, it will be updated synchronously to achieve dynamic scaling or vertical upgrades and downgrades. During dynamic scaling or vertical upgrades and downgrades, the network traffic of the relevant pods will be removed in advance. After the dynamic scaling or vertical upgrades and downgrades are completed, the relevant pods will be connected to business traffic again, achieving smooth operation and maintenance without affecting business.

[0156] Furthermore, databases require backup and recovery. To ensure data security and reliability, database services need to take snapshots periodically during normal operation, such as a full database snapshot backup every 1 hour. Automatic snapshot backups are also required when the database service is destroyed, so that a complete database instance can be quickly restored based on the backup when needed. The method in this application can back up the database instance and the business data stored in the database process pod as needed. It can be understood that database components and database process pods depend on the database instance for creation; only the database instance needs to be backed up to quickly restore the database components and database process pods, but the business data stored in the database process pods needs to be restored separately. The generated snapshot backups support various backend storage options, such as COS object storage, NFS, and cloud snapshots, and their cost is much lower than ordinary cloud disks, thus bringing significant cost reduction and efficiency improvement effects to the business.

[0157] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0158] Based on the same inventive concept, this application also provides a business service establishment apparatus for implementing the business service establishment method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more business service establishment apparatus embodiments provided below can be found in the limitations of the business service establishment method described above, and will not be repeated here.

[0159] In one embodiment, such as Figure 12 As shown, a business service establishment apparatus is provided, including: a data acquisition module 1202, an instance creation module 1204, a component creation module 1206, a container creation module 1208, and a model determination module 1210, wherein:

[0160] The data acquisition module 1202 is used to acquire service requirement information for the target business service and to acquire a preset instance template for the target business service as the target instance template.

[0161] The instance creation module 1204 is used to create service instances corresponding to the target business service based on service requirement information and target instance template.

[0162] The component creation module 1206 is used to create service components based on the component declaration information contained in the service instance, thereby obtaining each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that match the component types specified in the target instance template.

[0163] The container creation module 1208 is used to create a set of container groups corresponding to a service component based on the container group declaration information contained in the service component, thereby obtaining the set of container groups corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance.

[0164] The model determination module 1210 is used to obtain the service model corresponding to the target business service based on the service instance, each service component, and the container group set corresponding to each service component; the service model is used to provide the target business service to the demand party corresponding to the service demand information.

[0165] In one embodiment, the instance creation module 1204 is further configured to:

[0166] The service requirement information is populated into the target instance template to obtain the service instance corresponding to the target business service. The target instance template includes a component declaration area and a container group declaration area. The component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.

[0167] In one embodiment, the component creation module 1206 is further configured to:

[0168] Based on the component declaration information contained in the service instance, determine the types of each component required by the target business service and the component configuration information corresponding to each component type; based on the configuration information of each component, create service components that match the corresponding component types to obtain the service components corresponding to the target business service.

[0169] In one embodiment, the container creation module 1208 is further configured to:

[0170] For any service component among the various service components, based on the container group declaration information contained in the service component, determine the number of container groups required by the service component, and create each container group to be configured that matches the number of container groups; based on the container group declaration information contained in the service component, determine the container group configuration information corresponding to each container group to be configured; based on the container group configuration information, initialize the corresponding container group to be configured to obtain the configured container group; and obtain the container group set corresponding to the service component based on each configured container group.

[0171] In one embodiment, the container creation module 1208 is further configured to:

[0172] For any container group to be configured, the container group configuration component obtains the runtime-specific information of the container group to be configured. The personalized information and runtime-specific information of the container group configuration information are rendered to obtain the personalized configuration information of the container group to be configured. The container group configuration component obtains the container group configuration file template corresponding to the target business service. The personalized configuration information and the container group configuration file template are rendered to obtain the target configuration file corresponding to the container group to be configured. The container group configuration component distributes the target configuration file to the container to be configured to obtain the configured container group initialized on the configuration file.

[0173] In one embodiment, the container creation module 1208 is further configured to:

[0174] The container group configuration component retrieves the template index of the container group configuration file template for the target business service from the container group declaration information. Based on the template index, the container group configuration file template is retrieved from the preset storage area. The container group configuration file template is submitted to the preset storage area through the template unification tool. The template unification tool is used to unify the format of the container group configuration file templates provided by multiple business developers corresponding to the business type of the target business service.

[0175] In one embodiment, the container creation module 1208 is further configured to:

[0176] Create a target persistent volume declaration that matches the storage specifications in the container group configuration information; generate target persistent volume content based on the target persistent volume template contained in the target persistent volume declaration, and associate the target persistent volume content with the hard disk that matches the storage specifications in the container group configuration information; bind the target persistent volume content and the target persistent volume declaration, write the target persistent volume declaration to the container group to be configured, and obtain the configured container group initialized on the storage specifications; the data in the configured container group is used to write to the hard disk.

[0177] In one embodiment, the business service establishment apparatus is further configured to:

[0178] Based on the service component startup dependency order provided by the component declaration information, each service component is started in an orderly manner; the running status of each service component is monitored by probes set for each service component; after the probe set for the service component with high startup priority detects that each container group in the container group set managed by the service component has started successfully, the service component with the next startup priority is triggered to start; after each service component starts successfully, a creation success message corresponding to the target business service is returned to the requester.

[0179] In one embodiment, the business service establishment apparatus is further configured to:

[0180] Obtain the container group adjustment request for the target business service; the container group adjustment request carries container group adjustment parameters; update the container group declaration information contained in the service instance based on the container group adjustment parameters; based on the updated container group declaration information, update the corresponding service component and the corresponding container group set.

[0181] In one embodiment, the business service establishment apparatus is further configured to:

[0182] When the destruction of a service instance is triggered, the service instance is backed up to obtain a backup instance. Each service component's corresponding container group set is designated as a first container group. A persistent volume snapshot declaration is created based on the persistent volume declaration of the first container group, and persistent volume snapshot content is created based on the persistent volume content of the first container group. The persistent volume snapshot declaration and persistent volume snapshot content are bound together. A data snapshot is generated based on the bound persistent volume snapshot declaration and persistent volume snapshot content of the first container group. The container group's runtime identifier information and the data snapshot are associated and stored together. The backup instance and the data snapshots corresponding to each container group in each service component's corresponding container group set are associated and stored together.

[0183] In one embodiment, the business service establishment apparatus is further configured to:

[0184] When a recovery of a service instance is triggered, a backup instance is obtained; service components are created based on the component declaration information contained in the backup instance, resulting in various recovery components; a set of container groups corresponding to the recovery components is created based on the container group declaration information contained in the recovery components, resulting in a set of container groups corresponding to each recovery component; the container groups in the set of container groups corresponding to each recovery component are respectively used as second container groups; the corresponding data snapshot is obtained based on the container group running identifier information of the second container group; a persistent volume snapshot declaration and persistent volume snapshot content of the second container group are generated based on the data snapshot of the second container group; persistent volume content of the second container group is generated based on the persistent volume snapshot content of the second container group; persistent volume declaration of the second container group is generated based on the persistent volume snapshot declaration of the second container group; the persistent volume content and persistent volume declaration of the second container group are bound; and the persistent volume declaration of the second container group is applied to the second container group.

[0185] In one embodiment, the target business service is a target database service, the service instance is used to indicate the metadata required to establish the target database service, each service component is responsible for implementing the various functions of the target database service, and each container group in the same container group set is used to cooperate to implement the functions provided by the corresponding service components.

[0186] The aforementioned business service creation device pre-sets instance templates corresponding to various business services to facilitate rapid creation of those services. For a target business service, the device combines its personalized service requirements with the corresponding instance template to obtain a service instance. Based on the component declaration information contained within the service instance, it creates various service components corresponding to the target business service. Based on the container group declaration information contained within the service components, it creates a set of container groups corresponding to the service components. The service instance, service components, and their respective container group sets constitute a service model for providing the target business service. This model abstracts business services into a three-layer structure, including service instances, service components, and their corresponding container group sets. Service instances manage the creation of service components and container group sets, while each component manages the creation of its own container group set, enabling orderly business service creation. All business services can be abstracted into this three-layer model, ensuring strong versatility and improving the efficiency of business service creation. Based on this three-layer model, business services are containerized using a cloud-native approach.

[0187] Each module in the aforementioned service establishment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.

[0188] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 13 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores instance templates, configuration file templates, and other data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a business service establishment method.

[0189] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0190] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0191] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0192] In one embodiment, a computer program product is provided, the computer program product including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0194] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0195] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0196] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for establishing a business service, characterized in that, The method includes: Obtain service requirement information for the target business service, and obtain a preset instance template for the target business service as the target instance template; Based on the service requirement information and the target instance template, a service instance corresponding to the target business service is created. The service instance is used to indicate the various metadata required to establish the target business service. The service instance includes the component declaration information and the container group declaration information corresponding to the target business service. Service components are created based on the component declaration information contained in the service instance, thereby obtaining each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that match the component types specified in the target instance template, and the component declaration information is used to declare and indicate the metadata required for creating the components needed for the business service; Based on the container group declaration information contained in the service component, a container group set corresponding to the service component is created, thereby obtaining the container group set corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance, and the container group declaration information is used to declare and indicate the metadata required for creating the container group set of the component; Based on the service instance, each service component, and the container group set corresponding to each service component, a service model corresponding to the target business service is obtained. The service model is used to provide the target business service to the demand party corresponding to the service demand information. In the service model corresponding to the target business service, the service instance is used for global management, the service instance and the service component have a parent-child relationship, the service component is used for the management of the container group set, the service component and the corresponding container group set have a parent-child relationship, and the container group set is used for data processing for the target business service.

2. The method according to claim 1, characterized in that, The step of creating a service instance corresponding to the target business service based on the service requirement information and the target instance template includes: The service requirement information is filled into the target instance template to obtain the service instance corresponding to the target business service; the target instance template includes a component declaration area and a container group declaration area; the component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.

3. The method according to claim 1, characterized in that, The process of creating service components based on the component declaration information contained in the service instance, resulting in various service components corresponding to the target business service, includes: Based on the component declaration information contained in the service instance, determine the various component types required by the target business service and the component configuration information corresponding to each component type; Based on the configuration information of each component, service components matching the corresponding component types are created to obtain the service components corresponding to the target business service.

4. The method according to claim 1, characterized in that, The step of creating a set of container groups corresponding to a service component based on the container group declaration information contained in the service component, thereby obtaining the set of container groups corresponding to each service component, includes: For any one of the service components, based on the container group declaration information contained in the service component, determine the number of container groups required for the service component, and create each container group to be configured that matches the number of container groups. Based on the container group declaration information contained in the service component, the container group configuration information corresponding to each container group to be configured is determined. Based on the container group configuration information, the corresponding container group to be configured is initialized to obtain the configured container group. The set of container groups corresponding to the service components is obtained based on each configured container group.

5. The method according to claim 4, characterized in that, The process of initializing the corresponding container group to be configured based on the container group configuration information to obtain a configured container group includes: For any container group to be configured, the container group configuration component is used to obtain the runtime-specific information of the container group to be configured. The personalized information in the container group configuration information and the runtime-specific information of the container group are rendered to obtain the personalized configuration information of the container group to be configured. The container group configuration component is used to obtain the container group configuration file template corresponding to the target business service. The container group personalized configuration information and the container group configuration file template are rendered to obtain the target configuration file corresponding to the container group to be configured. The target configuration file is distributed to the container to be configured through the container group configuration component, resulting in a configured container group initialized on the configuration file.

6. The method according to claim 5, characterized in that, The step of obtaining the container group configuration file template corresponding to the target business service through the container group configuration component includes: The container group configuration component obtains the template index of the container group configuration file template for the target business service from the container group declaration information, and obtains the container group configuration file template from the preset storage area based on the template index. The container group configuration file template is submitted to the preset storage area through a template unification tool. The template unification tool is used to unify the format of container group configuration file templates provided by multiple business developers corresponding to the business type of the target business service.

7. The method according to claim 4, characterized in that, The process of initializing the corresponding container group to be configured based on the container group configuration information to obtain a configured container group includes: Create a target persistent volume declaration that matches the storage specifications in the container group configuration information; The target persistent volume content is generated based on the target persistent volume template contained in the target persistent volume declaration, and the target persistent volume content is associated with the hard disk that matches the storage specifications in the container group configuration information; Bind the target persistent volume content and the target persistent volume declaration, write the target persistent volume declaration into the container group to be configured, and obtain the configured container group initialized on the storage specification; the data in the configured container group is used to write to the hard disk.

8. The method according to claim 1, characterized in that, The method further includes: Based on the service component startup dependency order provided by the component declaration information, the various service components are started in an orderly manner; By monitoring the running status of each service component through probes set for each service component, after the probe set for the service component with high startup priority detects that each container group in the container group set managed by the service component has started successfully, the service component with the next startup priority is triggered to start. After each service component is successfully started, a creation success message corresponding to the target business service is returned to the requesting party.

9. The method according to claim 1, characterized in that, The method further includes: Obtain a container group adjustment request for the target business service; the container group adjustment request carries container group adjustment parameters; The container group declaration information contained in the service instance is updated based on the container group adjustment parameters; Based on the updated container group declaration information, update the corresponding service components and the corresponding container group collection.

10. The method according to claim 1, characterized in that, The method further includes: When the destruction of the service instance is triggered, the service instance is backed up to obtain a backup instance; Each of the service components is designated as the first container group from its corresponding container group set. Based on the persistent volume declaration corresponding to the first container group, a persistent volume snapshot declaration corresponding to the first container group is created. Based on the persistent volume content corresponding to the first container group, persistent volume snapshot content corresponding to the first container group is created. The persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group are bound together. Based on the bound persistent volume snapshot declaration and persistent volume snapshot content corresponding to the first container group, a data snapshot corresponding to the first container group is generated. The container group running identifier information and the data snapshot corresponding to the first container group are associated and stored. The backup instance and the data snapshots corresponding to each container group in the container group set corresponding to each service component are associated and stored.

11. The method according to claim 10, characterized in that, The method further includes: When a recovery for the service instance is triggered, the backup instance is obtained; Service components are created based on the component declaration information contained in the backup instance, resulting in various recovery components; Based on the container group declaration information contained in the recovery component, a container group set corresponding to the recovery component is created, thus obtaining the container group set corresponding to each recovery component. Each of the recovery components is designated as a second container group from the container group set corresponding to its respective recovery component. Based on the container group running identifier information corresponding to the second container group, obtain the corresponding data snapshot, generate the persistent volume snapshot declaration and persistent volume snapshot content corresponding to the second container group based on the data snapshot corresponding to the second container group, generate the persistent volume content corresponding to the second container group based on the persistent volume snapshot content corresponding to the second container group, generate the persistent volume declaration corresponding to the second container group based on the persistent volume snapshot declaration corresponding to the second container group, bind the persistent volume content and the persistent volume declaration corresponding to the second container group, and apply the persistent volume declaration corresponding to the second container group to the second container group.

12. The method according to claim 1, characterized in that, The target business service is a target database service. The service instance is used to indicate the metadata required to establish the target database service. Each service component is responsible for implementing the various functions of the target database service. Each container group in the same container group set is used to cooperate to implement the functions provided by the corresponding service components.

13. A business service establishment device, characterized in that, The device includes: The data acquisition module is used to acquire service requirement information for the target business service and acquire a preset instance template for the target business service as the target instance template. The instance creation module is used to create a service instance corresponding to the target business service based on the service requirement information and the target instance template. The service instance is used to indicate various metadata required to establish the target business service. The service instance includes component declaration information and container group declaration information corresponding to the target business service. The component creation module is used to create service components based on the component declaration information contained in the service instance, thereby obtaining each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that match the component types specified in the target instance template, and the component declaration information is used to declare and indicate the metadata required for creating the components needed for the business service. The container creation module is used to create a set of container groups corresponding to the service component based on the container group declaration information contained in the service component, thereby obtaining the set of container groups corresponding to each service component. The container group declaration information contained in the service component is obtained from the service instance, and the container group declaration information is used to declare and indicate the metadata required for creating the set of container groups required for the component. The model determination module is used to obtain a service model corresponding to the target business service based on the service instance, each service component, and the container group set corresponding to each service component. The service model is used to provide the target business service to the demand party corresponding to the service demand information. In the service model corresponding to the target business service, the service instance is used for global management, the service instance and the service component have a parent-child relationship, the service component is used for the management of the container group set, the service component and the corresponding container group set have a parent-child relationship, and the container group set is used for data processing for the target business service.

14. The apparatus according to claim 13, characterized in that, The instance creation module is also used to fill the service requirement information into the target instance template to obtain the service instance corresponding to the target business service; the target instance template includes a component declaration area and a container group declaration area; the component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.

15. The apparatus according to claim 13, characterized in that, The component creation module is further configured to determine, based on the component declaration information contained in the service instance, the various component types required by the target business service and the component configuration information corresponding to each component type; and based on the component configuration information, to create service components that match the corresponding component types, thereby obtaining the various service components corresponding to the target business service.

16. The apparatus according to claim 13, characterized in that, The container creation module is further configured to, for any one of the service components, determine the number of container groups required by the service component based on the container group declaration information contained in the service component, create each container group to be configured that matches the number of container groups; determine the container group configuration information corresponding to each container group to be configured based on the container group declaration information contained in the service component, initialize the corresponding container group to be configured based on the container group configuration information, and obtain the configured container group; and obtain the container group set corresponding to the service component based on each configured container group.

17. The apparatus according to claim 16, characterized in that, The container creation module is also used to obtain the runtime-specific information of the container group corresponding to the container group to be configured through the container group configuration component for any container group to be configured, and to render the personalized information in the container group configuration information and the runtime-specific information of the container group to obtain the personalized configuration information of the container group to be configured. The container group configuration component is used to obtain the container group configuration file template corresponding to the target business service. The container group personalized configuration information and the container group configuration file template are rendered to obtain the target configuration file corresponding to the container group to be configured. The target configuration file is distributed to the container to be configured through the container group configuration component, resulting in a configured container group initialized on the configuration file.

18. The apparatus according to claim 17, characterized in that, The container creation module is further configured to obtain a template index of the container group configuration file template for the target business service from the container group declaration information through the container group configuration component, and obtain the container group configuration file template from a preset storage area based on the template index; wherein, the container group configuration file template is submitted to the preset storage area and stored through a template unification tool, and the template unification tool is used to unify the format of the container group configuration file templates provided by multiple business developers corresponding to the business type to which the target business service belongs.

19. The apparatus according to claim 16, characterized in that, The container creation module is also used to create a target persistent volume declaration that matches the storage specifications in the container group configuration information; generate target persistent volume content based on the target persistent volume template contained in the target persistent volume declaration; and associate the target persistent volume content with a hard disk that matches the storage specifications in the container group configuration information. Bind the target persistent volume content and the target persistent volume declaration, write the target persistent volume declaration into the container group to be configured, and obtain the configured container group initialized on the storage specification; the data in the configured container group is used to write to the hard disk.

20. The apparatus according to claim 13, characterized in that, The device is also used to start each service component in an orderly manner based on the service component startup dependency order provided by the component declaration information; and to monitor the running status of each service component by setting probes for each service component. After the probes set for the service component with high startup priority detect that each container group in the container group set managed by the service component has been successfully started, the device triggers the startup of the service component with the next startup priority. After each service component is successfully started, a creation success message corresponding to the target business service is returned to the requesting party.

21. The apparatus according to claim 13, characterized in that, The device is further configured to obtain a container group adjustment request for the target business service; the container group adjustment request carries container group adjustment parameters; update the container group declaration information contained in the service instance based on the container group adjustment parameters; and update the corresponding service component and the corresponding container group set based on the updated container group declaration information.

22. The apparatus according to claim 13, characterized in that, The apparatus is further configured to: back up the service instance to obtain a backup instance when the destruction of the service instance is triggered; designate the container groups in the container group sets corresponding to each service component as first container groups; create a persistent volume snapshot declaration corresponding to the first container group based on the persistent volume declaration corresponding to the first container group; create persistent volume snapshot content corresponding to the first container group based on the persistent volume content corresponding to the first container group; bind the persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group; generate a data snapshot corresponding to the first container group based on the bound persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group; associate and store the container group running identifier information and the data snapshot corresponding to the first container group; and associate and store the backup instance and the data snapshots corresponding to each container group in the container group sets corresponding to each service component.

23. The apparatus according to claim 22, characterized in that, The apparatus is further configured to: upon triggering a recovery for the service instance, obtain the backup instance; create service components based on the component declaration information contained in the backup instance, thereby obtaining various recovery components; create a set of container groups corresponding to the recovery components based on the container group declaration information contained in the recovery components, thereby obtaining a set of container groups corresponding to each recovery component; use the container groups in the set of container groups corresponding to each recovery component as second container groups; obtain corresponding data snapshots based on the container group running identifier information corresponding to the second container groups; generate persistent volume snapshot declarations and persistent volume snapshot content corresponding to the second container groups based on the data snapshots corresponding to the second container groups; generate persistent volume content corresponding to the second container groups based on the persistent volume snapshot content; generate persistent volume declarations corresponding to the second container groups based on the persistent volume snapshot declarations corresponding to the second container groups; bind the persistent volume content and the persistent volume declarations corresponding to the second container groups; and apply the persistent volume declarations corresponding to the second container groups to the second container groups.

24. The apparatus according to claim 13, characterized in that, The target business service is a target database service. The service instance is used to indicate the metadata required to establish the target database service. Each service component is responsible for implementing the various functions of the target database service. Each container group in the same container group set is used to cooperate to implement the functions provided by the corresponding service components.

25. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.

26. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

27. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Application development system, operation method, equipment and storage medium

    CN111831269A

  • Method and device for creating persistent data volume and server

    CN114253459A