Component processing methods, apparatus, products, equipment and media

By acquiring component deployment information, the automated construction and deployment of containerized components solves the problem of cumbersome deployment processes in existing technologies, improves efficiency, and enriches the types of components.

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

Patent Information

Application Number
CN202310078066.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-13
Publication Date
2026-11-17
Estimated Expiration
2043-01-13

AI Technical Summary

Technical Problem

The process of deploying application components in existing applications is complicated, resulting in low deployment efficiency.

Method used

By obtaining component deployment information, indicating the location of the source code required to build the component, obtaining the source code of the target component, building the target component image and generating the runtime file, and finally deploying it to the target business cluster, the business devices can run the containerized component.

Benefits of technology

It automates and improves the efficiency of component deployment, simplifies the build and deployment process, and enriches the categories of containerized components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349225B_ABST
    Figure CN118349225B_ABST
Patent Text Reader

Abstract

This application discloses a component processing method, apparatus, product, device, and medium. The method includes: acquiring component deployment information; the component deployment information includes source code indication information, which indicates the location of the component source code required to build the component; acquiring the target component source code required to build the component according to the indication of the component deployment information; building a target component image based on the target component source code, and generating a component runtime file based on the target component image; deploying the component runtime file to a target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file. Using this application can improve the efficiency of deploying containerized components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more particularly to a component processing method, apparatus, product, device, and medium. Background Technology

[0002] An application component is a simple encapsulation of data and methods. It is a specific object obtained through encapsulation. By running one or more application components, the corresponding application functions can be realized.

[0003] In existing applications, technicians typically first compile the binary code used to build the components, then package the binary code to build the corresponding application components. Subsequently, the technicians select the various business devices that need to deploy the components, and then send the components to the selected business devices for operation.

[0004] It is evident that the application components deployed in existing applications are typically in binary code form, and the process of building and deploying these application components is complex, resulting in low efficiency in deployment. Summary of the Invention

[0005] This application provides a component processing method, apparatus, product, device, and medium that can improve the efficiency of deploying containerized components.

[0006] This application provides a component processing method, which includes:

[0007] Obtain component deployment information; the component deployment information includes source code indication information, which indicates the location of the component source code required to build the component;

[0008] Obtain the source code of the target component required to build the component, based on the instructions in the component deployment information;

[0009] Build a target component image based on the target component source code, and generate component runtime files based on the target component image;

[0010] Deploy the component runtime file to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file.

[0011] This application provides a component processing apparatus, the apparatus comprising:

[0012] The acquisition module is used to obtain component deployment information; the component deployment information includes source code indication information, which indicates the location of the component source code required to build the component.

[0013] The acquisition module is used to obtain the source code of the target component required to build the component, based on the instructions in the component deployment information.

[0014] The generation module is used to build a target component image based on the target component source code and generate the component runtime file based on the target component image;

[0015] The deployment module is used to deploy component runtime files to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime files.

[0016] Optionally, there are N source code repositories, each of which has one or more repository branches containing component source code, where N is a positive integer. The source code indication information is used to indicate the repository branch in the N source code repositories to which the component source code required to build the component belongs.

[0017] The acquisition module obtains the source code of the target component required to build the component according to the instructions in the component deployment information, including:

[0018] Retrieve the component source code contained in the repository branches indicated by the source code indication information in N source code repositories, and use them as the target component source code for building the component.

[0019] Optionally, the above-mentioned device is also used for:

[0020] Select K source code repositories from N source code repositories containing the source code of the components needed to build the components; K is a positive integer and K is less than or equal to N;

[0021] Determine the repository branch containing the component source code required to build the component from each of the K source code repositories, and generate source code instruction information based on the branch identifier of the determined repository branch.

[0022] Optionally, the acquisition module retrieves the component source code contained in the repository branches indicated by the source code indication information in N source code repositories, using these as the target component source code for building the component. This includes:

[0023] Based on the component update cycle, at any cycle node, obtain the component source code contained in the repository branch indicated by the source code indication information in N source code repositories, and use it as the target component source code;

[0024] The generation module builds the target component image based on the target component's source code in the following ways:

[0025] If the source code of the target component obtained at any cycle node is different from the source code of the component contained in the previous cycle node of the repository branch indicated by the source code indication information, then the target component image is built based on the target component source code.

[0026] Optionally, after building the target component image based on the target component source code, the above apparatus is further used for:

[0027] Store the constructed target component image in an image repository;

[0028] The generation module generates component runtime files based on the target component image in the following ways:

[0029] Obtain the image identifier of the target component image, and generate the component runtime file based on the image identifier.

[0030] Optionally, the generation module can generate component runtime files based on the image identifier in the following ways:

[0031] Obtain additional runtime information for running components;

[0032] Generate component runtime files based on additional runtime information and image identifiers;

[0033] The additional operational information includes resource indication information, which indicates the hardware resources required for the running components. Each business device uses the hardware resources indicated by the resource indication information to run the containerized component to which the target component image belongs.

[0034] Optionally, each business device can obtain the target component image from the image repository based on the image identifier in the component runtime file;

[0035] Each business device is used to run the corresponding containerized component based on the target component image obtained from the image repository.

[0036] Optionally, the above-mentioned device is applied to a component processing equipment, which is equipped with a container orchestration system;

[0037] The component processing device is used to call the configured container orchestration system to execute the following steps: obtaining the target component source code required for building the component according to the instructions of the component deployment information; building the target component image based on the target component source code; and generating the component runtime file based on the target component image.

[0038] Optionally, a component management system is integrated into the container orchestration system configured within the component processing appliance;

[0039] The deployment module deploys component runtime files to the target business cluster in the following ways:

[0040] Call the component management system to obtain the file version information of the generated component runtime files, and visualize the file version information;

[0041] In response to the confirmation action regarding the file version information displayed in the visualization, the component runtime file is deployed to the target business cluster.

[0042] Optionally, the component deployment information includes connection information, which is used to indicate the target business cluster where the component needs to be deployed;

[0043] The deployment module deploys component runtime files to the target business cluster in the following ways:

[0044] Based on the connection information, the component runtime files are deployed to the target business cluster.

[0045] Optionally, each business device is configured with a container orchestration system, and each business device is used to run the containerized component corresponding to the target component image within the configured container orchestration system.

[0046] Each business device is used to execute client tasks initiated by the associated client based on the running containerized components.

[0047] This application provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method of this application.

[0048] This application provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described above.

[0049] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative embodiments described above.

[0050] This application first obtains component deployment information, which includes source code indication information indicating the location of the component source code required to build the component. Then, based on the indications in the component deployment information, it obtains the target component source code required to build the component. Next, it builds a target component image based on the target component source code and generates a component runtime file based on the target component image. Finally, it deploys the component runtime file to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file. Therefore, the method proposed in this application only requires providing component deployment information, which triggers and automatically executes the series of processes of obtaining component source code, building a component image, and deploying the component to the target business cluster. This improves the efficiency of component deployment. Furthermore, this application innovatively allows for convenient deployment of containerized components in the target business cluster and enriches the types of components that can be deployed. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram of a network architecture provided in this application;

[0053] Figure 2 This is a schematic diagram illustrating a component deployment scenario provided in this application;

[0054] Figure 3 This is a flowchart illustrating a component processing method provided in this application;

[0055] Figure 4 This is a schematic diagram illustrating a scenario for obtaining component source code provided in this application;

[0056] Figure 5 This is a schematic diagram illustrating a scenario of configuration information provided in this application;

[0057] Figure 6 This is a schematic diagram illustrating a component configuration and deployment scenario provided in this application;

[0058] Figure 7 This is a schematic diagram illustrating another component deployment scenario provided in this application;

[0059] Figure 8 This is a schematic diagram of a component deployment architecture provided in this application;

[0060] Figure 9 This is a schematic diagram illustrating the principle of component deployment provided in this application;

[0061] Figure 10 This is a schematic diagram of the structure of a component processing device provided in this application;

[0062] Figure 11 This is a schematic diagram of the structure of a computer device provided in this application. Detailed Implementation

[0063] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0064] This application relates to blockchain-related technologies. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer. A blockchain consists of a series of blocks sequentially generated in chronological order. Once a new block is added to the blockchain, it cannot be removed. Each block records the data submitted by nodes in the blockchain system.

[0065] In this application, the target business cluster for deploying containerized components can be a blockchain node cluster (i.e., a cluster composed of various blockchain nodes in a blockchain network). In other words, the business devices in the target business cluster can be blockchain node devices. By deploying and running the containerized component in the blockchain node cluster, the security and reliability of the running containerized component can also be improved.

[0066] This application also relates to cloud technology. Cloud technology refers to a managed technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computing, storage, processing, and sharing of data.

[0067] Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.

[0068] The cloud technology involved in this application can refer to the data interaction between various business devices in the target business cluster via the "cloud", and the data interaction between the component processing device and the business devices in the target business cluster via the "cloud".

[0069] It should be noted that all data collected in this application (such as component source code, component deployment information, and other related data) was collected with the consent and authorization of the data subject (such as users, organizations, or enterprises), and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0070] This application primarily concerns the construction and deployment of containerized components. Containerization is a method of distributing applications or systems that isolates the application or system and its dependencies from the underlying infrastructure. It is a form of operating system-level virtualization that allows users to deploy and run distributed applications or systems in containers without having to start an entire virtual machine for each application. The operation of containerized components depends on images (also known as container images). A container image is a template for a container, and a container is a running instance of that image. A container image contains a packaged application, its dependencies, and information about the processes it runs at startup.

[0071] The relevant technical concepts involved in this application are described here:

[0072] K8s (Kubernetes): A container orchestration system used in the cloud-native field, featuring high scalability, high availability, fault self-healing, and open-source ecosystem. As a foundation, it can support large-scale production-grade cluster deployment.

[0073] Pod: The most basic resource management object in Kubernetes, it is an abstract resource composed of a group of related containers. A Pod typically contains a main container and zero or more auxiliary containers.

[0074] CI (Continuous Integration): Continuous integration refers to a workflow in which multiple developers can frequently merge lines of code together without affecting each other while developing different functional code (such as component source code).

[0075] CD (Continuous Delivery): Continuous delivery is the process of automating the building, testing, and deployment of code to an online environment using certain tools or platforms to deliver high-quality products. It represents the update and iteration rate of a development team.

[0076] SSOT (Single Source Of Truth) is a practice in information system design theory that involves building information models and relational schemas to ensure that each data element can only be accessed in one place.

[0077] CRD (Custom Resource Definition): A user-defined resource type in Kubernetes. It does not require modifying the Kubernetes source code to create a custom API server (application service). This feature greatly improves the scalability of Kubernetes. A corresponding CRD controller is required to implement the corresponding functional characteristics.

[0078] Kops (Kubernetes operations): The name of the CI / CD system provided in this application is a high-efficiency automated CI / CD system implemented using the Kubernetes CRD cloud-native approach.

[0079] YAML is a highly readable format used to express data serialization. It is the default serialization input and output data format for resources in Kubernetes.

[0080] Kbuild (Kops build): This application provides a custom resource type for K8s CRD, whose main function is to support the free combination of multiple repositories (such as multiple source code repositories) and multiple branches (such as multiple repository branches) for implementing the compilation, building, and image push processes of the code repository.

[0081] Kgenerate: This application provides a custom resource type for K8s CRD, whose main function is to generate deployment manifests (manifest files, which are YAML files) corresponding to multiple business repositories.

[0082] Kdeploy: This application provides a custom resource type for K8s CRD, whose main function is to deploy the generated manifest file to the target K8s cluster environment.

[0083] Job: is a built-in resource type in Kubernetes. Its main function is to execute one-time tasks in a containerized manner and to determine the task status of the Job based on the exit code of the container process.

[0084] CronJob is a built-in resource type in Kubernetes. Its main function is to execute tasks periodically in a containerized manner. The task status of the corresponding Job is determined by the exit code of the container process. Users can customize the scheduling period and configure it by year, month, day, hour, minute, or week.

[0085] ArgoCD is an open-source cloud-native CD tool that uses Kubernetes containerization to deploy related components and supports multiple operation methods, including visual and command-line interfaces.

[0086] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in this application. For example... Figure 1 As shown, the network architecture may include component processing devices and target service clusters. The target service cluster may contain multiple service devices, the specific number of which can be determined based on the actual application scenario. The component processing devices can deploy containerized components within the target service cluster. These component processing devices can be as follows: Figure 3 The component processing device in the corresponding embodiment.

[0087] like Figure 1 The business equipment shown can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, or a virtual machine. The component processing device can be any terminal such as a smartphone, tablet, laptop, desktop computer, smart TV, or in-vehicle terminal. Alternatively, the component processing device may not be a terminal device but other devices; there are no restrictions on this.

[0088] Please see also Figure 2 , Figure 2 This is a schematic diagram illustrating a component deployment scenario provided in this application. For example... Figure 2 As shown, users (such as relevant technical personnel) can configure themselves to obtain component deployment information and provide this information to the component processing device. This component deployment information may include information related to component building and deployment.

[0089] The component deployment information may include source code indication information indicating the location of the component source code required to build the component. The component processing device can obtain the target component source code required to build the component according to the indication in the component deployment information, and can generate a target component image based on the obtained target component source code. The target component image can be understood as a carrier for running the containerized component, or it can be understood as another way of expressing the containerized component. The target component image may contain relevant information such as the binary, program, file system, and OS (operating system) dependencies required for the component to run.

[0090] The component processing device can store the constructed target component image in an image repository, which can contain several component images (including component image 1 to component image 5 in this case). The component processing device can also generate a component runtime file (this runtime file is a component declaration file, also known as a component declaration file) based on the relevant identifiers of the constructed target component image (identifiers used to locate the target component image, such as the image identifier of the target component image). This runtime file does not contain the actual target component image; it is a manifest file and may contain instructions (such as identification information) for related files required to run the component.

[0091] The component processing device can deploy component runtime files to the target business cluster. In other words, the component processing device can provide component runtime files to various business devices within the target business cluster, enabling each business device to run the containerized component to which the target component image belongs, based on the component runtime file. For example, each business device can retrieve the target component image from the image repository based on the image identifier of the target component image in the component runtime file, and then start (i.e. run) the corresponding container using the target component image. This running container can be understood as a containerized component.

[0092] Using the method provided in this application, users only need to provide one component deployment information to quickly and automatically complete the entire process of building and deploying containerized components.

[0093] Please see Figure 3 , Figure 3 This is a flowchart illustrating a component processing method provided in this application. The execution entity in the embodiments of this application can be a component processing device, which can be a single computer device or a cluster of multiple computer devices. The computer device can be a server, a terminal device, or other devices. The component processing device can be a physical machine or a virtual machine, etc., without limitation. Figure 3 As shown, the method may include:

[0094] Step S101: Obtain component deployment information; the component deployment information includes source code indication information, which is used to indicate the location of the component source code required to build the component.

[0095] Specifically, the component processing device can obtain component deployment information for deploying containerized components. This component deployment information can include information related to deploying containerized components. This component deployment information can be a YAML (a highly readable format for expressing data serialization) file obtained by abstracting the information related to deploying containerized components. This YAML file can be called a configuration file.

[0096] The component processing device can be configured with a container orchestration system, which can enable the deployment and operation of containerized components. The container orchestration system can be a K8s system, and YAML can be a file format that is recognized and used by default within the K8s system.

[0097] Optionally, component deployment information may include basic environment information (Basic info), connectivity information (K8sinfo), and component configuration information (Components info).

[0098] Since containerized components can be deployed to business clusters in the future, this basic environment information can be used to indicate the environment in which the containerized components need to be deployed. The environments in which containerized components can be deployed include development environment (dev), stable environment (stable), test environment (test), production environment (prod, i.e., the formal environment for users), etc. Different deployment environments can correspond to different business clusters. Therefore, the basic environment information can be used to indicate the environment in which the containerized components need to be deployed among these multiple environments.

[0099] Since there can be several business clusters, which can be used to process different businesses (such as different types of businesses), the connection information in the component deployment information can be used to indicate which of these business clusters needs to be connected. The business cluster that needs to be connected is the business cluster where the component needs to be deployed. The business cluster that needs to be connected indicated by the connection information can be called the target business cluster.

[0100] The component configuration information mentioned above may include information related to building and deploying the component, such as the number of components to be built (i.e., the number of replicas of the component to run) and their names (i.e., identifiers). The component configuration information may also include source code indication information, which indicates the location of the component source code required to build the component.

[0101] There can be one or more components that need to be built and deployed (containerized components), and the principle of building and deploying each component is the same. Therefore, this application will use the building and deployment of one component as an example for illustration.

[0102] This application can be pre-initialized with N source code repositories. These N source code repositories are used to store the source code (which can be called component source code) required for configuring various components. N is a positive integer, and the specific value of N can be determined according to the actual application scenario.

[0103] Each of the N source code repositories can have one or more repository branches. Each repository branch can contain the corresponding component source code. The component source code of different repository branches can come from different coding devices, meaning that the component source code of different repository branches can be written by different technicians on different devices. In other words, the component source code of each repository branch can be collaboratively written by multiple technicians, and the writing of component source code by each technician does not affect each other.

[0104] Therefore, the above source code indication information can be used to indicate the repository branch in the N source code repositories to which the component source code required to build the component belongs, and the repository branch is the location of the component source code required to build the component.

[0105] This source code indication information can be pre-configured. For example, you can first select K source code repositories from N source code repositories, where K is an integer and K is less than or equal to N. The specific value of K can be determined according to the actual application scenario. Then, you can determine the specific repository branch where the component source code required to build the component is located from each of the selected K source code repositories. Then, you can generate the above source code indication information based on the identifier of the repository branch where the component source code required to build the component is located (which can be called the branch identifier, or the name of the repository branch).

[0106] The source code indication information can be a custom resource type of K8s CRD (i.e., a custom resource type in the K8s system) proposed in this application. It can be used to carry out a free combination of multiple repositories (such as K repositories) and multiple branches (such as the repository branch where the source code of the component used to build the component is located, determined from the K repositories). The source code indication information can be represented as the name Kbuild (Kops build).

[0107] Step S102: Obtain the source code of the target component required to build the component according to the instructions in the component deployment information.

[0108] Specifically, the component processing device can obtain the component source code contained in the repository branch indicated by the aforementioned source code indication information from N source code repositories, and use it as the component source code for building the component. For example, if the component processing device can obtain the component source code in the repository branch indicated by the branch identifier contained in the source code indication information, and use it as the component source code for building the component, the obtained component source code used for building the component can be referred to as the target component source code.

[0109] The target component source code can contain custom component source code from multiple repository branches originating from various source code repositories. Furthermore, the component processing device can further combine the several repository branches indicated by the source code instruction information (understandably, these several repository branches always exist independently, only with additional references) to obtain a combined custom target branch. This target branch can be understood as a branch quickly combined from several repository branches according to the current needs of building the component, and the component source code contained in this target branch is the target component source code.

[0110] By using the method of this application, different source code instruction information can be configured according to different needs of building components through custom configuration of source code instruction information. The component source code of different repository branches of different source code repositories can be freely combined and merged, thereby improving the efficiency of building components and simplifying the process of obtaining the component source code required for building components.

[0111] Optionally, a component to be built can correspond to one source code instruction. If multiple components need to be built, there can be multiple source code instruction messages. Multiple source code instruction messages are used to combine the component source code of different repository branches in different source code repositories, so as to build different components through the combined component source code.

[0112] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating a scenario for obtaining component source code, as provided in this application. For example... Figure 4 As shown, the above N source code repositories may include source code repository C1, source code repository C11, and source code repository C111.

[0113] Among them, source code repository C1 may include repository branch f1, repository branch f2 and repository branch f3, source code repository C11 may include repository branch f11, repository branch f22 and repository branch f33, and source code repository C111 may include repository branch f111, repository branch f221 and repository branch f331.

[0114] The source code instruction information may include the branch identifier f1 of repository branch f1, the branch identifier f22 of repository branch f22, and the branch identifier f333 of repository branch f333. Therefore, the component processing device can construct the target branch through the repository branch f1 in the source code repository C1, the repository branch f22 in the source code repository C11, and the repository branch f333 in the source code repository C111, and obtain the component source code contained in the target branch as the target component source code required to construct the component.

[0115] Step S103: Build the target component image based on the target component source code, and generate the component runtime file based on the target component image.

[0116] Specifically, the component processing device can compile and build (i.e. generate) the corresponding image (which can be called a component image) using the source code of the target component obtained above. This built component image can be called the target component image. Here, an image is a specification for containerized operation. The target component image is a file, which can be understood as another way of expressing the containerized component. Through this target component image, the component can be run within a container, thereby realizing component containerization.

[0117] In essence, an image can be understood as containing a packaged program (such as a component), the program's dependencies, information about the processes running at startup, the file system, and OS dependencies. In other words, an image can package the relevant information and resources needed to run a program (such as a component) within a container.

[0118] Furthermore, the container orchestration system of the component processing device can include a pre-defined Git (version controller, which can be used to integrate component source code from different repository branches) with source code pull permissions. The process of building the target component image from the target component source code can be configured by this Git, and the business logic of building the target component image from the target component source code can be pre-configured in Git.

[0119] After building a target component image from the target component source code, the component processing device can also store the built target component image in an image repository. Optionally, the image repository can be located locally on the component processing device, or it can be located on another remote device (such as a public cloud repository on another remote device). The specific location of the image repository can be determined according to the actual application scenario and is not restricted in this regard.

[0120] The component processing device can generate component runtime files from the target component image built above in the container orchestration system. These component runtime files are used to implement component deployment. The component runtime files can also be YAML format files, as described below.

[0121] The component processing device can obtain the image identifier (such as the name of the target component image) of the generated target component image. The component processing device can generate a component runtime file using the image identifier, and the component runtime file can contain the image identifier.

[0122] Furthermore, the component processing device can also acquire additional runtime information for running the component. The component processing device can also generate a component runtime file using this additional runtime information and the image identifier. This component runtime file can contain the additional runtime information and the image identifier. The additional runtime information can include information related to running the component.

[0123] Optionally, the additional runtime file may contain resource indication information, which can be used to indicate the hardware resources required to run the component. Subsequently, after deploying the containerized component to which the target component image belongs in the target service cluster, each service device in the target service cluster can run the containerized component using the hardware resources indicated by the resource indication information. For example, the hardware resources indicated by the resource indication information may be the CPU (processor) resources required to run the component.

[0124] Furthermore, the additional runtime files may also contain information such as the number of image replicas (which can be the number of replicas of the component running), the name of the deployed containerized component, and other relevant information.

[0125] Since the component processing device is equipped with a container orchestration system, the steps described above—obtaining the target component source code required for building the component according to the instructions of the component deployment information, building the target component image based on the obtained target component source code, and generating the component runtime file based on the target component image—can all be executed by the component processing device calling the configured container orchestration system. This series of steps can be executed within the container orchestration system of the component processing device.

[0126] Optionally, the aforementioned component runtime files (also known as manifest files) can be generated using Dhall (a configurable programming language), Ytt (a template tool for YAML), Kustomize (a general-purpose tool for customizing YAML), or Helm (a management tool for Kubernetes).

[0127] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating a scenario of configuration information provided in this application. For example... Figure 5As shown, Kbuild can include spec (specification information) and status (status information). The specification information can be the source code indication information mentioned above. This specification information can include the repository branch where the source code of the component required to build the component resides. For example, here, repo1, repo2, and repo3 represent different source code repositories. The specification information can also include URLs (links) for repo1 ("git@git.xxx.com / repo1.git"), repo2 ("git@git.xxx.com / repo2.git"), and repo3 ("git@git.xxx.com / repo3.git"). This specification information can include the master branch in repo1, repo2, and repo3 of the source code repository that needs to be referenced. It should be noted that the same branch identifier (e.g., master) indicates different repository branches in different source code repositories.

[0128] Status information can represent the build status of the repository branches referenced in each source code repository (such as the status of building a component image using the component source code within the repository branch). Here, phase: Success indicates that the corresponding component image was successfully built using the component source code of the repository branch referenced in the corresponding source code repository. Update Time can represent the time when the corresponding component image was built using the component source code of the repository branch in the corresponding source code repository (also known as the update time). ImageTag represents the identifier (such as the name) of the component image built using the component source code of the repository branch in the corresponding source code repository.

[0129] Step S104: Deploy the component runtime file to the target business cluster, so that each business device in the target business cluster can run the containerized component to which the target component image belongs based on the component runtime file.

[0130] Specifically, the component processing device can directly deploy the aforementioned component runtime files to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the aforementioned target component image belongs through the component runtime files.

[0131] The component deployment information mentioned above may also include connection information for indicating the business cluster where the component needs to be deployed. This connection information can be used to indicate the target business cluster where the component needs to be deployed (such as a cluster identifier for indicating the target business cluster). Therefore, the component processing device can deploy the component runtime file to the target business cluster according to the indication of the connection information.

[0132] The component processing device can obtain the communication addresses of each service device in the target service cluster through the indication of this connection information, and then deploy the component runtime files to the target service cluster through these communication addresses. As described below.

[0133] The component processing device can send the above component runtime file to the target business cluster. Each business device in the target business cluster can also be configured with a container orchestration system (such as the above K8s system). After obtaining the component runtime file, each business device can run the component runtime file in its own container orchestration system. Each business device is also used to extract the image identifier of the above target component image from the running component runtime file.

[0134] Furthermore, each business device can obtain (i.e. pull) the target component image from the specified image repository through the image identifier, and each business device can run the corresponding containerized component through the target component image obtained from the image repository.

[0135] The mechanism by which a business device runs a corresponding containerized component by obtaining a target component image may include: the business device can start a corresponding container in the container orchestration system by obtaining the target component image and run the container. The running container can be understood as a containerized component (i.e., a containerized component), and the running container may contain the relevant processes that the containerized component needs to run.

[0136] In some practical business scenarios, each business device in the target business cluster can execute client tasks initiated by associated clients based on the running containerized components. The running containerized components can be understood as background components (i.e., background programs) of the client. The running background components can be used to execute related client tasks initiated by the client, such as identity registration, data retrieval, etc. The specific client tasks executed by the running containerized components can be determined according to the actual application scenario, and there are no restrictions on this.

[0137] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating a component configuration and deployment scenario provided in this application. For example... Figure 6 As shown, users can configure component deployment information, which can include basic information (Basic info, i.e., the basic environment information mentioned above), connection information (K8s info), and component configuration information (Components).

[0138] The basic information may include the region where the business cluster to be deployed is located, such as s city, i.e., city s. The basic information may also include product, which here indicates that the component managed by kops in this application can be a component of the lifecycle of a stateful service (MySQL is a stateful service). The basic information may also include isProd: true, which indicates that the business environment of the business cluster of the component to be deployed is a production environment.

[0139] The connection information can include the server address (https: / / xxx), which can be the network address of the target business cluster to be connected to. The connection information can also include ca-data and key-data. ca-data represents the Transport Layer Protocol (TLS) certificate, and key-data represents the TLS key, which the component processing device can use when interacting with the business device.

[0140] The component configuration information can include the name of the component to be deployed. Here, it includes the names of three components to be deployed: comp1, comp2, and comp3. These three components can have different configurations, represented by their respective val values. The val value can be used to represent the component's configuration indication information. This configuration indication information can be used to indicate and obtain the corresponding source code indication information of the component. For example, the configuration indication information for the component comp1 to be deployed here can be val1, the configuration indication information for the component comp2 to be deployed can be val2, and the configuration indication information for the component comp3 to be deployed can be val3.

[0141] Optionally, the component configuration information may directly include source code indication information associated with the component to be deployed, or it may not include such information. This source code indication information can be associated with the component's configuration indication information in the component configuration information. The component processing device can also obtain the source code indication information associated with the component to be deployed through this configuration indication information. This source code indication information is the aforementioned Kbuild name, which can be the name of the target branch obtained by combining multiple repository branches from multiple source code repositories.

[0142] Users can input component deployment information into Kops (a highly efficient and automated CI / CD system implemented using a Kubernetes cloud-native approach). Inputting component deployment information into Kops can be understood as providing the component deployment information to the container orchestration system in the component processing device. Then, in Kops, the above process can be used to generate component runtime files, and these runtime files can be deployed to a Kubernetes cluster. This Kubernetes cluster can be composed of the container orchestration systems of various business devices in the target business cluster.

[0143] Please see Figure 7 , Figure 7 This is a schematic diagram illustrating another component deployment scenario provided in this application. For example... Figure 7 As shown, this application can deploy multiple containerized components simultaneously in a business cluster. The source code required for deploying these multiple containerized components can be from pre-configured source code repositories, such as repo1 to repo4. Furthermore, the component processing device can deploy multiple containerized components in the target business cluster via Kops. These multiple containerized components run in multiple pods (including pod1 to pod4 in this case) on the business device. A pod represents the smallest unit in Kubernetes, meaning that each business device in the target business cluster can run and deploy multiple containerized components in multiple pods. These multiple containerized components can be used together to achieve corresponding business functions.

[0144] Furthermore, the container orchestration system of the component processing device can also integrate a component management system (ArgoCD). This component management system can be used to interface with the container orchestration system in the business devices. The aforementioned component runtime files can be deployed to the container orchestration systems of various business devices in the target business cluster based on this component management system. This component management system in the container orchestration system of the component processing device can be used to achieve efficient, convenient, and visual management of containerized components deployed in the container orchestration system, as described below.

[0145] Optionally, after generating the aforementioned component runtime files, the component processing device can also call the component management system to obtain the file version information of the generated component runtime files, and can visualize the file version information (e.g., through a webpage provided by ArgoCD). This operation can be called a diff operation (used to view the version release differences of component runtime information (e.g., the difference between the current version and previous versions)). The file version information is the latest version information of the containerized component to be deployed. Relevant technical personnel can use the file version information to confirm whether the containerized component to be deployed is the correct and valid version. If confirmed, it indicates that the version of the currently generated component runtime file is correct and valid. Then, the component management system in the component processing device can perform a confirmation operation on the displayed file version information. The component processing device can respond to the confirmation operation and deploy the component runtime files to the target business cluster.

[0146] Furthermore, the aforementioned component management system also enables visual operations such as sync (which allows for automatic or manual updates and configuration of deployed containerized components) and delete (which quickly deletes containerized components deployed in the business cluster).

[0147] Furthermore, this application can also set a component update cycle, and at each cycle node of the component update cycle, it can obtain the component source code (i.e., the target component source code required to build the component) contained in the repository branch indicated by the source code indication information in N source code repositories. In other words, the aforementioned target component source code can be actively pulled by the component processing device from N source code repositories at any cycle node.

[0148] If the source code of the target component obtained at any cycle node is different from the source code of the component in the previous cycle node indicated by the source code indication information, it indicates that the source code of the target component obtained at any cycle node has changed (i.e. updated) compared to the source code used to build the component obtained at the previous cycle node. Then, step S102 can be executed, that is, the target component image is built by the target component source code obtained at any cycle node, and the component runtime file generated at this time based on the target component image can be redeployed to the target business cluster. That is, the component runtime file (which can also be understood as the deployed containerized component) deployed by the component processing device in the target business cluster at the previous cycle node has been updated (which can be understood as a version update, such as a new feature or bug (vulnerability) fix version to be released). At this time, it is necessary to redeploy the component runtime file generated at any cycle node in the target business cluster (the target component image generated at this time is different from the component image generated at the previous cycle node) to update the containerized component deployed in the target business cluster.

[0149] Conversely, if the source code of the target component obtained at any given cycle node is the same as the source code used to build the component obtained at the previous cycle node (the repository branches to which the source code obtained at each cycle node belong are the same), it indicates that the source code of the target component obtained at any given cycle node has not changed (i.e., it has not been updated) compared to the source code used to build the component obtained at the previous cycle node. This means that the deployed containerized component does not need to be updated. In this case, it is not necessary to perform the subsequent process of building the target component image, generating the component runtime file based on the target component image, and deploying the component runtime file to the target business cluster based on the currently obtained target component source code.

[0150] In other words, this application can detect and update the deployed containerized components according to the above-mentioned component update cycle. If the component source code contained in the target branch (i.e., a combination of several repository branches indicated by the source code indication information) is found to have changed and been updated at a cycle node, the process of building the target component image, generating the component runtime file according to the target component image, and deploying the component runtime file to the target business cluster can be re-executed based on the updated component source code of the target branch.

[0151] For example, the component update cycle can be 3 minutes. This means that the component processing device can actively pull the component source code under the target branch every 3 minutes (i.e., every 3 minutes is a cycle node), and check whether the pulled component source code has been updated compared to the previous cycle node. If it has been updated, the above steps are re-executed to redeploy the containerized component.

[0152] By actively pulling the source code of components under the target branch, instead of passively receiving messages about whether the source code of components under the target branch has been updated, even if the source code of components under the target branch is frequently updated multiple times within a short period of time (such as within a component update cycle, such as within 3 minutes), it is not necessary to redeploy the containerized component every time the source code of the component under the target branch is updated. This enables flexible control over the update frequency (also known as the release frequency) of the deployed containerized components and improves the update efficiency of the deployed containerized components.

[0153] The implementation principle of updating deployed containerized components based on the component update cycle can be summarized as follows: First, the component processing device can trigger the container orchestration system to generate a corresponding CronJob task (a task executed periodically in a containerized manner within the container orchestration system). This CronJob task actively pulls the component source code from the target branch at each cycle node based on the component update cycle. This CronJob task can be referred to as a source code periodic pull task.

[0154] If the component source code pulled at any cycle node changes compared to the previous cycle node, the component processing device can also trigger the container orchestration system to generate a corresponding Job task (a one-time task in the container orchestration system). This Job task can be a task that regenerates the component runtime file based on the currently pulled component source code. Through this Job task, the corresponding component runtime file can be regenerated based on the component source code under the target branch pulled at any cycle node according to the principle described above. Subsequently, the regenerated component runtime file can be redeployed to the target business cluster according to the configured deployment strategy (such as automatic or manual deployment strategy).

[0155] The above process allows for the use of CronJob tasks to achieve automatic triggering. This is based on whether the component source code under the target branch has changed and SSOT (Single Source of Fact). If a change occurs, a Job task is automatically generated, which in turn triggers the redeployment (i.e., update) process of the containerized component.

[0156] If the source code of the component pulled at any given cycle node has not changed compared to the previous cycle node, then there is no need to redeploy the component runtime file, and the above process can continue to be executed periodically in the next cycle node based on the CronJob task mentioned above.

[0157] In addition, if containerized components require manual triggering or rapid debugging (investigation and debugging) for deployment, the Kops task process (i.e., the process of obtaining the target component source code, building the target component image based on the target component source code, generating the component runtime file based on the target component image, and deploying the component runtime file on the target business cluster) can be triggered immediately and directly before the next cycle node is reached, so as to realize the redeployment (i.e., update deployment) of containerized components through the component source code under the current target branch.

[0158] Optionally, the above-mentioned method of immediately and directly triggering the Kops task process before reaching the next cycle node can include: Since the Git repository of the container orchestration system (which includes and manages various source code repositories) can have annotation attribute values, these annotation attribute values ​​can contain change indication information for each repository branch in the Git repository (including various repository branches in the source code repository, as well as the target branch built according to the source code indication information). This change indication information can be used to indicate whether the corresponding repository branch has changed (i.e., whether the component source code of the corresponding repository branch has changed). This change indication information can contain current-xxx (used to indicate the current information of the component source code in the corresponding repository branch, such as the current version information) and latest-xxx (used to indicate the latest information of the component source code in the corresponding repository branch, such as the latest version information). If the current-xxx and latest-xxx corresponding to a repository branch are different, it indicates that the repository branch has changed (i.e., the component source code of the repository branch has been updated). At this time, the container orchestration system will automatically trigger the rebuilding and deployment of containerized components that reference the component source code of that repository branch.

[0159] Therefore, it is understandable that this application can flexibly control the updating of change instruction information corresponding to each repository branch in the container orchestration system. For example, under normal circumstances, the change instruction information corresponding to each repository branch in the container orchestration system can be controlled not to be updated, so that under normal circumstances, the deployed containerized components can be updated periodically according to the aforementioned component update cycle, instead of immediately rebuilding and deploying the corresponding containerized components once the component source code in the repository branch is updated. However, when it is necessary to immediately and directly trigger the start of the Kops task process before the next cycle node is reached, the change instruction information corresponding to the corresponding repository branch (such as the target branch) can be modified (such as updating the latest-xxx of the repository branch so that the latest-xxx of the repository branch is different from the current-xxx of the repository branch) to automatically trigger the rebuilding and deployment of the containerized components that reference the component source code of the corresponding repository branch.

[0160] Using the method provided in this application, users (such as relevant technical personnel) only need to provide a kops-values.yaml file (i.e., component deployment information) to quickly deploy containerized components in the corresponding business cluster (such as the target business cluster). Furthermore, by introducing source code instruction information (kbuild name), users can freely expand the source code repository of their business as needed, arbitrarily combine different repository branches of different source code repositories to achieve the construction and deployment of corresponding containerized components, improving the flexibility and efficiency of building containerized components. Moreover, the same repository sub-repository of the source code repository can be referenced simultaneously in multiple places after being built (e.g., referenced by the source code instruction information associated with multiple different containerized components to be deployed), which can improve the efficiency of building and deploying various containerized components.

[0161] Furthermore, since containerized components are easy to port and deploy to various business environments (such as public cloud environments and private cloud environments) and can shield the relevant characteristics of the underlying physical machine environment, the method provided in this application can be used to conveniently deploy containerized components to various business environments, with higher adaptability to various business environments and wider application scenarios.

[0162] This application first obtains component deployment information, which includes source code indication information indicating the location of the component source code required to build the component. Then, based on the indications in the component deployment information, it obtains the target component source code required to build the component. Next, it builds a target component image based on the target component source code and generates a component runtime file based on the target component image. Finally, it deploys the component runtime file to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file. Therefore, the method proposed in this application only requires providing component deployment information, which triggers and automatically executes the series of processes of obtaining component source code, building a component image, and deploying the component to the target business cluster. This improves the efficiency of component deployment. Furthermore, this application innovatively allows for convenient deployment of containerized components in the target business cluster and enriches the types of components that can be deployed.

[0163] Please see Figure 8 , Figure 8 This is a schematic diagram of a component deployment architecture provided in this application. For example... Figure 8 As shown, this application can use CronJob in K8s to periodically and automatically trigger the entire process of generating images of containerized components to be deployed, generating component runtime files, and deploying component runtime files.

[0164] First, this application can generate an image of the component to be deployed (such as the target component image mentioned above) using Kbuild. Then, it can generate a corresponding manifest file (such as the component runtime file mentioned above) based on the target component image using Kgenerate. Furthermore, it can implement pre-deploy, Kdeploy, and post-deploy using ArgoCD (a component management system, also known as a component deployment system). Pre-deploy means that pre-deployment tasks can be executed before deploying the component runtime file. For example, this preparatory operation can include checking the component processing device and various business devices in the target business cluster. The system checks whether the networks between the devices are interconnected. If not, it performs tasks to establish network connectivity and configures permissions (such as permission configuration related to component deployment between component processing devices). Kdeploy is used to deploy the generated component runtime files to the target business cluster, that is, to a K8scluster (a cluster of several container orchestration systems) composed of K8s from various business devices in the target business cluster. post-deploy indicates that after successfully deploying the containerized component, post-deployment tasks can be executed, such as scripts that check whether the containerized component is running healthily (i.e., whether it is normal and legal).

[0165] Please see Figure 9 , Figure 9 This is a schematic diagram illustrating the principle of component deployment provided in this application. For example... Figure 9 As shown, during the image generation stage via Kbuild, for containerized components that need to be deployed in different cluster environments (including master, dev, and stable environments), corresponding tasks can be initiated through the Job resources within K8s (the component processing device's K8s) to build component images corresponding to various cluster environments based on the principles of steps S101 to S102 above.

[0166] Furthermore, during the component runtime file generation stage via Kgenerate, for containerized components that need to be deployed in different cluster environments, corresponding tasks can be initiated through the Job resources within K8s (the component processing device's K8s) to generate component runtime files for various cluster environments.

[0167] Furthermore, during the component deployment phase using Kdeploy, for containerized components that need to be deployed in different cluster environments, ArgoCD can be used to deploy the corresponding component runtime files to the K8s cluster in the business cluster of the corresponding cluster environment. Before deploying the component runtime files to the corresponding K8s cluster, the corresponding pre-job can be initiated through the Job resources within K8s (the K8s of the component processing device). After deploying the component runtime files to the corresponding K8s cluster, the corresponding post-job can also be initiated through the Job resources within K8s (the K8s of the component processing device).

[0168] The method provided in this application enables a cloud-native automated CI / CD system (Kops) for containerized components. This system features rapid business access (access can be achieved through a single component deployment information), scalable repository branches (e.g., expanding corresponding target branches according to needs), high build efficiency, automatic triggering, containerized component deployment, and visual management of deployed components.

[0169] Please see Figure 10 , Figure 10 This is a schematic diagram of a component processing apparatus provided in this application. The component processing apparatus can be a computer program (including program code) running on a computer device; for example, the component processing apparatus is application software. This component processing apparatus can be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 10 As shown, the component processing device 1 may include: an acquisition module 11, a generation module 12, and a deployment module 13.

[0170] Module 11 is used to obtain component deployment information; the component deployment information includes source code indication information, which indicates the location of the component source code required to build the component.

[0171] Module 11 is used to obtain the source code of the target component required to build the component according to the instructions of the component deployment information;

[0172] Module 12 is used to build a target component image based on the target component source code and generate component runtime files based on the target component image;

[0173] Deployment module 13 is used to deploy the component runtime files to the target business cluster, so that each business device in the target business cluster can run the containerized component to which the target component image belongs based on the component runtime files.

[0174] Optionally, there are N source code repositories, each of which has one or more repository branches containing component source code, where N is a positive integer. The source code indication information is used to indicate the repository branch in the N source code repositories to which the component source code required to build the component belongs.

[0175] Module 11 obtains the component source code required to build the component according to the instructions in the component deployment information, including:

[0176] Retrieve the component source code contained in the repository branches indicated by the source code indication information in N source code repositories, and use them as the target component source code for building the component.

[0177] Optionally, the above-mentioned device 1 is also used for:

[0178] Select K source code repositories from N source code repositories containing the source code of the components needed to build the components; K is a positive integer and K is less than or equal to N;

[0179] Determine the repository branch containing the component source code required to build the component from each of the K source code repositories, and generate source code instruction information based on the branch identifier of the determined repository branch.

[0180] Optionally, module 11 retrieves the component source code contained in the repository branches indicated by source code indication information in N source code repositories, using it as the target component source code for building the component, including:

[0181] Based on the component update cycle, at any cycle node, obtain the component source code contained in the repository branch indicated by the source code indication information in N source code repositories, and use it as the target component source code;

[0182] The generation module 12 builds the target component image based on the target component source code in the following ways:

[0183] If the source code of the target component obtained at any cycle node is different from the source code of the component contained in the previous cycle node of the repository branch indicated by the source code indication information, then the target component image is built based on the target component source code.

[0184] Optionally, after building the target component image based on the target component source code, the above-mentioned device 1 is further used for:

[0185] Store the constructed target component image in an image repository;

[0186] The generation module 12 generates component runtime files based on the target component image in the following ways:

[0187] Obtain the image identifier of the target component image, and generate the component runtime file based on the image identifier.

[0188] Optionally, the generation module 12 can generate component runtime files based on the image identifier in the following ways:

[0189] Obtain additional runtime information for running components;

[0190] Generate component runtime files based on additional runtime information and image identifiers;

[0191] The additional operational information includes resource indication information, which indicates the hardware resources required for the running components. Each business device uses the hardware resources indicated by the resource indication information to run the containerized component to which the target component image belongs.

[0192] Optionally, each business device can obtain the target component image from the image repository based on the image identifier in the component runtime file;

[0193] Each business device is used to run the corresponding containerized component based on the target component image obtained from the image repository.

[0194] Optionally, the above-mentioned device 1 is applied to a component processing equipment, which is equipped with a container orchestration system;

[0195] The component processing device is used to call the configured container orchestration system to execute the following steps: obtaining the target component source code required for building the component according to the instructions of the component deployment information; building the target component image based on the target component source code; and generating the component runtime file based on the target component image.

[0196] Optionally, a component management system is integrated into the container orchestration system configured within the component processing appliance;

[0197] Deployment module 13 deploys component runtime files to the target business cluster in the following ways:

[0198] Call the component management system to obtain the file version information of the generated component runtime files, and visualize the file version information;

[0199] In response to the confirmation action regarding the file version information displayed in the visualization, the component runtime file is deployed to the target business cluster.

[0200] Optionally, the component deployment information includes connection information, which is used to indicate the target business cluster where the component needs to be deployed;

[0201] Deployment module 13 deploys component runtime files to the target business cluster in the following ways:

[0202] Based on the connection information, the component runtime files are deployed to the target business cluster.

[0203] Optionally, each business device is configured with a container orchestration system, and each business device is used to run the containerized component corresponding to the target component image within the configured container orchestration system.

[0204] Each business device is used to execute client tasks initiated by the associated client based on the running containerized components.

[0205] According to one embodiment of this application, Figure 3 The steps involved in the component processing method shown can be derived from... Figure 10 The various modules in the component processing device 1 shown are used to perform this operation. For example, Figure 3 Steps S101 and S102 shown can be derived from... Figure 10 The acquisition module 11 in the middle is used to execute, Figure 3 Step S103 shown can be performed by Figure 10 The generation module 12 in the middle is used to execute, Figure 3 Step S104 shown can be derived from Figure 10 The deployment module 13 in the middle is used to execute it.

[0206] This application first obtains component deployment information, which includes source code indication information indicating the location of the component source code required to build the component. Then, based on the indications in the component deployment information, it obtains the target component source code required to build the component. Next, it builds a target component image based on the target component source code and generates a component runtime file based on the target component image. Finally, it deploys the component runtime file to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file. Therefore, the method proposed in this application only requires providing component deployment information, which triggers and automatically executes the series of processes of obtaining component source code, building a component image, and deploying the component to the target business cluster. This improves the efficiency of component deployment. Furthermore, this application innovatively allows for convenient deployment of containerized components in the target business cluster and enriches the types of components that can be deployed.

[0207] According to one embodiment of this application, Figure 10The modules in the component processing device 1 shown can be individually or entirely combined into one or more units, or some of the units can be further divided into multiple functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical function division. In practical applications, the function of one module can also be implemented by multiple units, or the function of multiple modules can be implemented by one unit. In other embodiments of this application, the component processing device 1 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0208] According to one embodiment of this application, a general-purpose computer device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), can perform operations such as... Figure 3 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 10 The component processing apparatus 1 shown herein, and the component processing method for implementing the embodiments of this application, are described. The computer program described above may be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and run therein.

[0209] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a computer device provided in this application. For example... Figure 11 As shown, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 11 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0210] exist Figure 11 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0211] Obtain component deployment information; the component deployment information includes source code indication information, which indicates the location of the component source code required to build the component;

[0212] Obtain the source code of the target component required to build the component, based on the instructions in the component deployment information;

[0213] Build a target component image based on the target component source code, and generate component runtime files based on the target component image;

[0214] Deploy the component runtime file to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file.

[0215] It should be understood that the computer device 1000 described in the embodiments of this application can perform the foregoing... Figure 3 The description of the component processing method in the corresponding embodiment can also be executed as described above. Figure 10 The description of the component processing device 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.

[0216] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program executed by the aforementioned component processing device 1. The computer program includes program instructions, which, when executed by the processor, enable the execution of the aforementioned... Figure 3 The description of the component processing methods in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.

[0217] As an example, the above program instructions can be deployed and executed on a single computer device, or deployed and executed on multiple computer devices located in one location, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. Multiple computer devices distributed across multiple locations and interconnected via a communication network can form a blockchain network.

[0218] The aforementioned computer-readable storage medium may be the component processing apparatus provided in any of the foregoing embodiments or the internal storage unit of the aforementioned computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium may include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0219] This application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 3 The description of the component processing method in the corresponding embodiments is already provided, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.

[0220] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0221] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0222] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0223] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A component processing method, characterized in that, The method includes: Obtain component deployment information; the component deployment information includes source code indication information, which is used to indicate the location of the component source code required to build the component. The method has N source code repositories, each source code repository has one or more repository branches containing component source code, where N is a positive integer, and the location indicated by the source code indication information is the repository branch to which the component source code required to build the component belongs in the N source code repositories. Obtain the source code of the target component required to build the component according to the instructions in the component deployment information; Build a target component image based on the target component source code, and generate component runtime files based on the target component image; The component runtime file is deployed to the target business cluster, enabling each business device in the target business cluster to run the containerized component to which the target component image belongs based on the component runtime file; The step of obtaining the target component source code required to build the component according to the indication of the component deployment information includes: based on the component update cycle at any cycle node, obtaining the component source code contained in the repository branch indicated by the source code indication information in the N source code repositories as the target component source code; The step of generating a component runtime file based on the target component image includes: obtaining the image identifier of the target component image and generating the component runtime file based on the image identifier; The method for constructing the source code indication information includes: selecting K source code repositories from the N source code repositories where the component source code required for building the component is located; determining the repository branch where the component source code required for building the component is located from each of the K source code repositories, and generating the source code indication information according to the branch identifier of the determined repository branch; K is a positive integer and K is less than or equal to N; The step of constructing a target component image based on the target component source code includes: if the target component source code obtained at any period node is different from the component source code contained in the previous period node of the repository branch indicated by the source code indication information, then constructing the target component image based on the target component source code.

2. The method according to claim 1, characterized in that, After building the target component image based on the target component source code, the method further includes: The constructed target component image is stored in an image repository.

3. The method according to claim 1, characterized in that, The component runtime file is generated based on the image identifier, including: Obtain additional runtime information for running components; The component runtime file is generated based on the additional runtime information and the image identifier; The additional operational information includes resource indication information, which is used to indicate the hardware resources required for running the component. Each service device is used to run the containerized component to which the target component image corresponding to the image identifier belongs using the hardware resources indicated by the resource indication information.

4. The method according to claim 2, characterized in that, Each of the business devices is used to obtain the target component image from the image repository based on the image identifier in the component runtime file; Each of the service devices is used to run the corresponding containerized component based on the target component image obtained from the image repository.

5. The method according to claim 1, characterized in that, The method is executed by a component processing device, which is equipped with a container orchestration system. The component processing device is used to call the configured container orchestration system to execute the steps of obtaining the target component source code required for building the component according to the instruction of the component deployment information, building the target component image based on the target component source code, and generating the component runtime file based on the target component image.

6. The method according to claim 5, characterized in that, The component processing device is equipped with a container orchestration system that integrates a component management system. The step of deploying the component runtime file to the target business cluster includes: The component management system is invoked to obtain the file version information of the generated component runtime file, and the file version information is visualized. In response to the confirmation operation of the file version information displayed in the visualization, the component runtime file is deployed to the target business cluster.

7. The method according to claim 1, characterized in that, The component deployment information includes connection information, which is used to indicate the target service cluster where the component needs to be deployed; The step of deploying the component runtime file to the target business cluster includes: Based on the instructions in the connection information, the component runtime file is deployed to the target business cluster.

8. The method according to claim 1, characterized in that, Each of the aforementioned business devices is equipped with a container orchestration system, and each business device is used to run the containerized component corresponding to the target component image within the configured container orchestration system. Each of the service devices is used to execute client tasks initiated by the associated client based on the running containerized component.

9. A component processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire component deployment information; the component deployment information includes source code indication information, which is used to indicate the location of the component source code required to build the component; the device has N source code repositories, each source code repository has one or more repository branches containing component source code, N is a positive integer, and the location indicated by the source code indication information is the repository branch to which the component source code required to build the component belongs in the N source code repositories; The acquisition module is used to acquire the source code of the target component required to build the component according to the instructions of the component deployment information; The generation module is used to build a target component image based on the target component source code, and generate component runtime files based on the target component image; The deployment module is used to deploy the component runtime file to the target business cluster, so that each business device in the target business cluster can run the containerized component to which the target component image belongs based on the component runtime file; The process of the acquisition module acquiring the target component source code required to build the component according to the instruction of the component deployment information includes: based on the component update cycle at any cycle node, acquiring the component source code contained in the repository branch indicated by the source code instruction information in the N source code repositories as the target component source code; The process of generating a component runtime file based on the target component image by the generation module includes: obtaining the image identifier of the target component image and generating the component runtime file based on the image identifier; The method for constructing the source code indication information includes: selecting K source code repositories from the N source code repositories where the component source code required for building the component is located; determining the repository branch where the component source code required for building the component is located from each of the K source code repositories, and generating the source code indication information according to the branch identifier of the determined repository branch; K is a positive integer and K is less than or equal to N; The process of the generation module constructing a target component image based on the target component source code includes: if the target component source code obtained at any period node is different from the component source code contained in the previous period node of the repository branch indicated by the source code indication information, then constructing the target component image based on the target component source code.

10. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-8.

11. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-8.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Jenkins and K3S-based software environment rapid deployment method

    CN112346752A

  • Automatic application deployment method, system and equipment and readable storage medium

    CN114995835A