Service deployment method and device

By obtaining service portraits, selecting the container with the best performance for deployment, the service performance instability caused by container dispersion is solved, and high-quality and efficient service deployment is achieved.

CN114237631BActive Publication Date: 2025-08-29BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111320523.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-09
Publication Date
2025-08-29
Estimated Expiration
2041-11-09

AI Technical Summary

Technical Problem

In a virtualized environment, containers are scattered on different machines, resulting in unstable service performance, affecting the stability of service performance and waste of resources.

Method used

By obtaining the service portrait of the target service, selecting the best performance container from multiple containers based on the service portrait for deployment, considering the affinity and performance parameters of the container type to avoid resource waste.

Benefits of technology

The high-quality and precise deployment of target services has been achieved, and the stability of service performance and resource utilization efficiency have been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237631B_ABST
    Figure CN114237631B_ABST
Patent Text Reader

Abstract

The present disclosure provides a service deployment method and apparatus, relating to the field of computer technology, and more particularly, to the field of container-based service deployment technology. The implementation scheme comprises: obtaining a service profile of a target service, wherein the service profile indicates the affinity of the target service for each of multiple container types, and the affinity characterizes the performance of the target service on a container of the corresponding container type; and, based on the service profile, obtaining a target container from multiple service containers to deploy the target service, wherein each of the multiple service containers corresponds to one of the multiple container types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to container-based service deployment technology, and specifically to a service deployment method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Art

[0002] In large-scale business systems running in virtualized environments, services are often deployed in multiple containers. Container-encapsulated service runtime environments have attracted widespread attention due to their lighter weight, faster startup times, and reduced resource usage.

[0003] The approaches described in this section are not necessarily approaches that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any approach described in this section is prior art simply by virtue of its inclusion in this section. Similarly, unless otherwise indicated, the issues raised in this section should not be considered as having been recognized in any prior art. Summary of the Invention

[0004] The present disclosure provides a service deployment method, apparatus, electronic device, computer-readable storage medium, and computer program product.

[0005] According to one aspect of the present disclosure, a service deployment method is provided, comprising: obtaining a service profile of a target service, wherein the service profile indicates an affinity of the target service corresponding to each of a plurality of container types, the affinity characterizing performance of the target service on a container of the corresponding container type; and obtaining a target container from a plurality of service containers based on the service profile to deploy the target service, wherein each of the plurality of service containers corresponds to a container type of the plurality of container types.

[0006] According to another aspect of the present disclosure, a service deployment apparatus is provided, comprising: a first acquisition unit configured to obtain a service profile of a target service, wherein the service profile indicates an affinity of the target service corresponding to a container of each container type of a plurality of types, the affinity characterizing performance of the target service on the container of the corresponding container type; and a second acquisition unit configured to schedule a target container from a plurality of containers based on the service profile to deploy the target service, wherein the plurality of containers correspond to one or more types of the plurality of types.

[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor implements the above-mentioned method.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to implement the above method.

[0009] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.

[0010] According to one or more embodiments of the present disclosure, a target service is deployed by obtaining a target container for deploying the service from multiple containers corresponding to multiple container types based on a service profile of the target service to be deployed. Because the service profile indicates the affinity of the target service for each of the multiple container types, and this affinity characterizes the performance of the target service on the corresponding container type, a container with good performance for the target service can be obtained based on the service profile, achieving high-quality and accurate deployment of the target service and avoiding waste of container resources.

[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.

[0013] Figure 1 A flowchart of a service deployment method according to an embodiment of the present disclosure is shown;

[0014] Figure 2 A flowchart showing a process of obtaining a service portrait of a target service in a service deployment method according to an embodiment of the present disclosure is shown;

[0015] Figure 3 A flowchart of a process of scheduling a target container from multiple containers based on a service profile in a service deployment method according to an embodiment of the present disclosure is shown;

[0016] Figure 4 A flowchart illustrating a process of obtaining a target container based on at least one candidate container in a service deployment method according to some embodiments is shown;

[0017] Figure 5 A flowchart illustrating a process of obtaining a target container based on at least one candidate container in a service deployment method according to some embodiments is shown;

[0018] Figure 6 A flowchart illustrating a process of obtaining a candidate container type corresponding to a first service on a candidate container from one or more container types corresponding to multiple containers in a service deployment method according to an embodiment of the present disclosure is shown;

[0019] Figure 7 shows a structural block diagram of a service deployment apparatus according to an embodiment of the present disclosure; and

[0020] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0021] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0022] In this disclosure, unless otherwise specified, the use of terms such as "first" and "second" to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements. Such terms are only used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, while in some cases, based on the context of the description, they may also refer to different instances.

[0023] The terms used in the descriptions of the various examples described in this disclosure are for the purpose of describing specific examples only and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element may be one or more. In addition, the term "and / or" used in this disclosure encompasses any one and all possible combinations of the listed items.

[0024] The inventors discovered that when mixed deployment of services in a virtualized environment, since containers are often scattered on different machines, and the hardware and software configurations of the machines vary greatly, the affinity of services for machines with different configurations is different. This is specifically reflected in the differences in performance indicators when services are deployed in containers distributed on different machines. As a result, the online services running in a distributed architecture take different amounts of time, that is, the service performance is sometimes good and sometimes bad, affecting the stability of the service performance.

[0025] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0026] See Figure 1 According to some embodiments of the present disclosure, a service deployment method 100 includes:

[0027] Step S110: Obtain a service profile of the target service, wherein the service profile indicates an affinity of the target service corresponding to each of a plurality of container types, the affinity representing the performance of the target service on a container of the corresponding container type;

[0028] Step S120: Based on the service profile, a target container is obtained from a plurality of service containers to deploy the target service, wherein each of the plurality of service containers corresponds to a container type among the plurality of container types.

[0029] According to one or more embodiments of the present disclosure, a target service is deployed by obtaining a target container for deploying the service from multiple containers corresponding to multiple container types based on a service profile of the target service to be deployed. Because the service profile indicates the affinity of the target service for each of the multiple container types, and this affinity characterizes the performance of the target service on the corresponding container type, a container with good performance for the target service can be obtained based on the service profile, achieving high-quality and accurate deployment of the target service and avoiding waste of container resources.

[0030] In related technologies, processors (CPUs) with different configurations are normalized to a certain number of cores, each processor is measured using a standard number of cores, and a consistent number of standard cores is assigned to each container to deploy services in a predetermined number of containers that match their performance. The normalization of the core counts of processors (CPUs) with different configurations is performed using the same test program, such as a benchmark test program. Because the test program is fixed and differs from the target service to be deployed, the measurement of the normalized core count of the processor based on this test program is biased, making the measurement inaccurate. Furthermore, the normalization of the core counts of processors (CPUs) with different configurations often only considers the hardware model. However, when the processor is used with different system parameter configurations and operating system configurations, it also affects the performance of the programs running on it, making the normalized core count measurement inaccurate.

[0031] According to an embodiment of the present disclosure, since a service profile of a target service to be deployed corresponds to different container types, a target container is obtained to deploy the service. The obtained target container is obtained based on a service profile that can reflect the performance of the target service thereon, which is more accurate.

[0032] In some embodiments, the target service may be any application or part of an application to be deployed on the container, such as a data storage application or a computing application, etc., which is not limited here.

[0033] In some embodiments, the container type may include multiple parameter combinations consisting of multiple processor (CPU) type parameters, multiple graphics processor (GPU) type parameters, multiple memory type parameters, multiple memory capacity parameters, multiple hard disk type parameters, multiple hard disk capacity parameters, multiple network type parameters, etc., wherein each parameter combination includes one processor type parameter among the multiple processor type parameters, one graphics processor type parameter among the multiple graphics processor type parameters, one memory type parameter among the multiple memory type parameters, one memory capacity parameter among the multiple memory capacity parameters, one hard disk capacity parameter among the multiple hard disk capacity parameters, and one network type parameter among the multiple network type parameters.

[0034] For example, the processor (CPU) type parameter may include the processor brand, model, etc., the graphics processor (GPU) type parameter may include the graphics processor brand and model, etc., the memory type may include the memory brand and model, etc., and the network type parameter may include the network provider, etc.

[0035] In some embodiments, the multiple containers may be a PaaS-based container cluster, and service deployment is achieved by scheduling the containers through PaaS.

[0036] See Figure 2, the service profile of the target service includes:

[0037] Step S210: Acquire performance data of the target service on each of a plurality of test containers and performance parameters of each of the plurality of test containers when running the target service, wherein the plurality of test containers correspond to the plurality of container types;

[0038] Step S220: determining an affinity of the target service corresponding to each of the multiple container types based on performance data of the target service on each of the multiple test containers and performance parameters of each of the multiple test containers when running the target service; and

[0039] Step S230: constructing the service profile based on the affinity of the target service corresponding to each container type in the multiple container types.

[0040] Since the deployment of services often involves multiple containers, the performance parameters reflected when running the same service are often different for different containers. For example, when the performance data of the services are the same, the memory utilization rate of the container with a large memory is lower. In an embodiment of the present disclosure, when obtaining the service profile of the target service, while considering the performance data of the target service on the test container, the performance parameters of the test container when running the target service are also considered, so that the service profile not only indicates the quality of the performance data of the target service, but also indicates the stability of the container when running the target service, that is, the affinity indicated by the service profile characterizes the performance quality and performance stability of the target service on the container corresponding to the corresponding container type, so that the target container obtained according to the service profile is more in line with the requirements of the target service and is therefore more accurate.

[0041] In some embodiments, in step S210, performance data is collected through a service agent of the target service. For example, the agent pulls the performance data of the target service on each test container and the performance parameters of the test container.

[0042] In some embodiments, in step S210, performance data is collected by server polling, for example, by centrally initiating a request to obtain asynchronously returned performance data of the target service and performance parameters of the test container.

[0043] In some embodiments, the performance data of the target service includes service time consumption data, concurrent processing capability of the service, etc.

[0044] In some embodiments, the performance parameters of the test container include: processor (CPU) performance data, graphics processing unit (GPU) performance data, memory performance data, input / output performance data, network throughput data, etc.

[0045] In some embodiments, in step S210, performance data of the target service and performance parameters of the test container are obtained, and the container type of the test container is also obtained. For example, the container type of the test container is obtained by collecting the processor (CPU) model, graphics processing unit (GPU) model, memory model, network card model, disk model, operating system model, basic library version, and various system configuration parameters of the test container.

[0046] In some embodiments, in step S220, affinity scores of the target service corresponding to different test containers are calculated using the performance data of the target service and the performance parameters of the test container obtained in step S210. The affinity scores are the affinity of the target service corresponding to the corresponding container type.

[0047] For example, based on the performance data of the target service and the performance parameters of the test container, an affinity score is assigned to each test container, where the affinity score is inversely proportional to the service duration data of the target service, directly proportional to the concurrent processing capability of the target service, and directly proportional to the performance parameters of the test container.

[0048] In some embodiments, in step S230 , a service profile is obtained based on the affinity scores obtained in step S220 and the container types corresponding to the test containers.

[0049] In some examples, a service profile is a mapping between an affinity score and a container type. For example, a service profile is described as a tuple consisting of the affinity score, processor (CPU) model, graphics processor (GPU) model, memory model, network card model, disk model, operating system model, basic library version, and various system configuration parameters.

[0050] In some embodiments, as Figure 3 As shown, based on the service profile, obtaining a target container from multiple containers includes:

[0051] Step S310: Based on the service profile, a first number of candidate container types is obtained from one or more container types corresponding to the multiple containers, wherein, for each container type in the first number of candidate container types, the affinity of the target service corresponding to the container type meets a preset condition;

[0052] Step S320: Based on the candidate container type, obtain at least one candidate container from the multiple containers;

[0053] Step S330: Acquire the target container based on the at least one candidate container.

[0054] A first number of candidate container types whose corresponding affinities meet preset conditions are selected from one or more container types corresponding to the multiple containers, and a target container is obtained from the candidate containers corresponding to the first number of candidate container types, so that the performance of the target service on the obtained target container exceeds a preset performance threshold, thereby achieving accurate deployment of the target service.

[0055] In some embodiments, for each container type in the first number of candidate container types, the affinity of the target service corresponding to the container type is higher than a preset affinity threshold, so that the performance of the target service on the obtained target container is better than a preset performance threshold.

[0056] In some embodiments, the first number of candidate container types is a preset number of candidate container types, such as 2 candidate container types.

[0057] In some embodiments, as Figure 4 As shown, based on the service profile, obtaining a target container from multiple service containers includes:

[0058] Step S410: obtaining a service status of each candidate container in the at least one candidate container, wherein the service status includes one of occupied and idle; and

[0059] Step S420: In response to a service status of each of one or more candidate containers in the at least one candidate container being idle, determining a target container from the one or more candidate containers.

[0060] By obtaining the service status of the candidate containers, the target container is determined from the candidate containers with idle service status, so that the target service is deployed on the candidate container with idle service status, avoiding conflicts between services deployed on the containers.

[0061] In some embodiments, the target container includes a first container having the greatest affinity to the target service among the at least one candidate container.

[0062] By deploying the target service in the first container with the highest affinity among at least one candidate container, and determining it as the target container, the target service achieves optimal performance while providing services. Furthermore, in some examples, when the affinity also indicates the performance parameters of the container when the target service runs on a container of the corresponding container type, deploying the target service in the first container also achieves optimal stability while providing services.

[0063] In some embodiments, as Figure 5 As shown, based on the at least one candidate container, obtaining the target container further includes:

[0064] Step S510: in response to the candidate service status of each candidate container in the at least one candidate container being occupied, obtaining a first service on each candidate container in the at least one candidate container;

[0065] Step S520: For each candidate container of the at least one candidate container, obtain an alternative container type corresponding to the first service on the candidate container from one or more container types corresponding to the multiple containers; and

[0066] Step S530: For each candidate container of the at least one candidate container, in response to a service status of a first container corresponding to the candidate type in the multiple containers being idle, scheduling the first service from the container to the first container, so that the service status of the candidate container changes from occupied to idle.

[0067] By scheduling the first service on the candidate container to the candidate container corresponding to the first service, the service state of the candidate container corresponding to the target service is changed from occupied to idle, so that the target service can be deployed on the candidate container with the best performance, thereby achieving the optimal deployment of the target service.

[0068] In some embodiments, based on the priority of the target service over the first service, the process of scheduling the first service to deploy the target service in steps S510 to S530 is performed.

[0069] In some embodiments, as Figure 6 As shown, obtaining a candidate container type corresponding to the first service on the candidate container from one or more container types corresponding to the multiple containers includes:

[0070] Step S610: Acquire performance data of the first service on each of one or more test containers, where the one or more test containers correspond to one or more container types corresponding to the multiple containers; and

[0071] Step S620: Based on the performance data of the first service on each test container in the one or more test containers, obtain the alternative container type, wherein the performance data of the first service on the test container corresponding to the alternative container type is not lower than the performance data of the first service on any test container in the one or more test containers that is different from the test container corresponding to the alternative container type.

[0072] By obtaining performance data of the first service on each of one or more test containers corresponding to one or more container types corresponding to the multiple containers, the obtained performance data corresponding to the selected container type for the first service is ensured to be no less than the performance data corresponding to the container types corresponding to the other test containers. This allows the first service to be scheduled to the first container of the selected container type without degrading its runtime performance, while achieving optimal deployment of the target service, that is, achieving optimal overall performance of service deployment on the container cluster.

[0073] According to another aspect of the present disclosure, a service scheduling device is also provided. Figure 7 As shown, the apparatus 700 includes: a first acquisition unit 710, configured to obtain a service profile of a target service, wherein the service profile indicates the affinity of the target service corresponding to a container of each container type in a plurality of types, and the affinity characterizes the performance of the target service on the container of the corresponding container type; and a second acquisition unit 720, configured to obtain a target container from a plurality of containers based on the service profile to deploy the target service, wherein the plurality of containers correspond to one or more types in the plurality of types.

[0074] In some embodiments, the first acquisition unit 710 includes: a first acquisition sub-unit, configured to acquire performance data of the target service on each of a plurality of test containers corresponding to the plurality of types and performance parameters of each of the plurality of test containers when running the target service; a second acquisition sub-unit, configured to acquire the affinity of the target service corresponding to the test container of each container type in the plurality of types based on the performance data of the target service on each of the plurality of test containers and performance parameters of each of the plurality of test containers when running the target service; and a construction unit, configured to construct the service profile based on the affinity of the target service corresponding to the test container of each container type in the plurality of types.

[0075] In some embodiments, the second acquisition unit 720 includes: a candidate type acquisition unit configured to acquire a first number of candidate container types from one or more container types corresponding to the multiple containers based on the service profile, wherein, for each container type in the first number of candidate container types, the affinity of the target service corresponding to the container type meets a preset condition; a candidate container acquisition unit configured to acquire at least one candidate container from the multiple containers based on the candidate container type; and a target container acquisition unit configured to acquire the target container based on the at least one candidate container.

[0076] In some embodiments, the target container acquiring unit includes: a service status acquiring unit configured to acquire a service status of each of the at least one candidate container, where the service status includes one of occupied and idle; and a first determining unit configured to determine a target container from the one or more candidate containers in response to the service status of each of the one or more candidate containers in the at least one candidate container being idle.

[0077] In some embodiments, the target container includes a first container having the greatest affinity to the target service among the at least one candidate container.

[0078] In some embodiments, the target container acquisition unit further includes: a second determination unit configured to, in response to a candidate service status of each of the at least one candidate container being occupied, acquire a first service on each of the at least one candidate container; and a scheduling unit configured to, for each of the at least one candidate container, acquire an alternative type corresponding to the one or more types of the first service on the candidate container, and, in response to a service status of a first container corresponding to the alternative type among the multiple containers being idle, schedule the first service from the container to the first container, so that the service status of the candidate container changes from occupied to idle.

[0079] In some embodiments, the scheduling unit is further configured to obtain, for each candidate container in the at least one candidate container, performance data of the first service on each test container in one or more test containers corresponding to the one or more types; and obtain the alternative type based on the performance data of the first service on each test container in the one or more test containers, wherein the performance data of the first service on the test container corresponding to the alternative type is not lower than the performance data of the first service on any type of test container in the one or more types that is different from the alternative type.

[0080] In some embodiments, the performance data of the target service on each of the multiple test containers includes at least one of the following items: service running time and service concurrent processing capability; and the performance parameters of each of the multiple test containers when running the target service include at least one of the following items: central processing unit occupancy, graphics processing unit occupancy, memory occupancy, and network resource occupancy.

[0081] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program, and the computer program implements the above method when executed by the at least one processor.

[0082] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing a computer program is further provided, wherein the computer program implements the above method when executed by a processor.

[0083] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.

[0084] According to an embodiment of the present disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.

[0085] refer to Figure 8 , a block diagram of an electronic device 800 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0086] like Figure 8 As shown, electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of electronic device 800. Computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to bus 804.

[0087] Multiple components within electronic device 800 are connected to I / O interface 805, including an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. Input unit 806 can be any type of device capable of inputting information into electronic device 800. Input unit 806 can receive input numeric or character information and generate key signal input related to user settings and / or function control of the electronic device. It may include, but is not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 807 can be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, an audio / visual output terminal, a vibrator, and / or a printer. Storage unit 808 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 809 allows electronic device 800 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks. It may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0088] The computing unit 801 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as method 100. For example, in some embodiments, method 100 can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of method 100 described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform method 100 in any other suitable manner (e.g., via firmware).

[0089] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0090] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0091] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0092] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0093] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0094] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0095] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0096] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. In addition, the steps may be performed in an order different from that described in this disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after this disclosure.

Claims

1. A service deployment method, comprising: Obtain a service profile of a target service, wherein the service profile indicates an affinity of the target service corresponding to each of a plurality of container types, wherein the service profile is a correspondence between the affinity and the corresponding container type, and the affinity characterizes performance of the target service on a container of the corresponding container type, wherein the service profile of the target service is obtained based on the following operations: Acquire performance data of the target service on each of a plurality of test containers and performance parameters of each of the plurality of test containers when running the target service, the plurality of test containers corresponding to the plurality of container types; Determine, based on performance data of the target service on each of the multiple test containers and performance parameters of each of the multiple test containers when running the target service, the affinity of the target service corresponding to each of the multiple container types, wherein the performance data of the target service on each of the multiple test containers includes: service running time and service concurrent processing capability, and the performance parameters of each of the multiple test containers when running the target service include at least one of the following: central processing unit occupancy, graphics processing unit occupancy, memory occupancy, and network resource occupancy, wherein the affinity is inversely proportional to the service running time of the target service, directly proportional to the service concurrent processing capability of the target service, and directly proportional to the performance parameters of the corresponding test container; and Building the service profile based on the affinity of the target service corresponding to each container type of the multiple container types; and Based on the service profile, a target container is obtained from a plurality of service containers to deploy the target service, wherein each service container in the plurality of service containers corresponds to a container type in the plurality of container types.

2. The method according to claim 1, wherein The acquiring a target container from a plurality of service containers based on the service profile includes: Based on the service profile, obtaining a first number of candidate container types from one or more container types corresponding to the multiple service containers, wherein, for each container type in the first number of candidate container types, an affinity of the target service corresponding to the container type meets a preset condition; Based on the candidate container type, obtaining at least one candidate container from the plurality of containers; and The target container is acquired based on the at least one candidate container.

3. The method according to claim 2, wherein: The acquiring the target container based on the at least one candidate container includes: Obtaining a service status of each candidate container of the at least one candidate container, wherein the service status includes one of occupied and idle; and In response to a service status of each of one or more candidate containers in the at least one candidate container being idle, a target container is determined from the one or more candidate containers.

4. The method according to claim 3, wherein: The target container includes a first container having the greatest affinity to the target service among the at least one candidate container.

5. The method according to claim 3, wherein The acquiring the target container based on the at least one candidate container further includes: In response to a candidate service status of each of the at least one candidate container being occupied, acquiring a first service on each of the at least one candidate container; and For each candidate container of the at least one candidate container, Obtaining a candidate container type corresponding to the first service on the candidate container from one or more container types corresponding to the multiple service containers; and In response to a service status of a first container corresponding to the candidate container type among the multiple containers being idle, the first service is scheduled from the candidate container to the first container, so that the service status of the candidate container changes from occupied to idle.

6. The method according to claim 5, wherein: The acquiring of a candidate container type corresponding to the first service on the candidate container from one or more container types corresponding to the multiple service containers includes: Obtaining performance data of the first service on each of one or more test containers, the one or more test containers corresponding to one or more container types corresponding to the multiple service containers; and Based on the performance data of the first service on each test container in the one or more test containers, the alternative container type is obtained, wherein the performance data of the first service on the test container corresponding to the alternative container type is not lower than the performance data of the first service on any test container in the one or more test containers that is different from the test container corresponding to the alternative container type.

7. A service scheduling device comprising: A first acquiring unit is configured to obtain a service profile of a target service, wherein the service profile indicates an affinity of the target service corresponding to each of a plurality of container types, wherein the service profile is a correspondence between the affinity and the corresponding container type, and the affinity represents performance of the target service on a container of the corresponding container type, wherein the service profile of the target service is obtained based on the following operations: Acquire performance data of the target service on each of a plurality of test containers and performance parameters of each of the plurality of test containers when running the target service, the plurality of test containers corresponding to the plurality of container types; Determine, based on performance data of the target service on each of the multiple test containers and performance parameters of each of the multiple test containers when running the target service, the affinity of the target service corresponding to each of the multiple container types, wherein the performance data of the target service on each of the multiple test containers includes: service running time and service concurrent processing capability, and the performance parameters of each of the multiple test containers when running the target service include at least one of the following: central processing unit occupancy, graphics processing unit occupancy, memory occupancy, and network resource occupancy, wherein the affinity is inversely proportional to the service running time of the target service, directly proportional to the service concurrent processing capability of the target service, and directly proportional to the performance parameters of the corresponding test container; and Building the service profile based on the affinity of the target service corresponding to each container type of the multiple container types; and A second acquisition unit is configured to acquire a target container from a plurality of service containers based on the service profile to deploy the target service, wherein each of the plurality of service containers corresponds to a container type among the plurality of container types.

8. The device according to claim 7, wherein The second acquiring unit includes: a candidate type acquisition unit configured to acquire, based on the service profile, a first number of candidate container types from one or more container types corresponding to the multiple service containers, wherein, for each container type in the first number of candidate container types, an affinity of the target service corresponding to the container type meets a preset condition; a candidate container acquiring unit, configured to acquire at least one candidate container from the plurality of containers based on the candidate container type; and The target container acquiring unit is configured to acquire the target container based on the at least one candidate container.

9. The device according to claim 8, wherein The target container acquiring unit includes: a service status acquiring unit configured to acquire a service status of each of the at least one candidate container, wherein the service status includes one of occupied and idle; and The first determining unit is configured to determine a target container from one or more candidate containers in the at least one candidate container in response to a service status of each candidate container being idle.

10. The device according to claim 9, wherein The target container includes a first container having the greatest affinity to the target service among the at least one candidate container.

11. The device according to claim 9, wherein The target container acquisition unit further includes: a second determining unit configured to, in response to a candidate service status of each of the at least one candidate container being occupied, acquire a first service on each of the at least one candidate container; and A scheduling unit is configured to obtain, for each candidate container of the at least one candidate container, an alternative container type corresponding to the first service on the candidate container from one or more container types corresponding to the multiple service containers, and In response to a service status of a first container corresponding to the candidate container type among the multiple containers being idle, the first service is scheduled from the candidate container to the first container, so that the service status of the candidate container changes from occupied to idle.

12. The device according to claim 11, wherein The scheduling unit is further configured to, for each candidate container of the at least one candidate container, Obtaining performance data of the first service on each of one or more test containers, where the one or more test containers correspond to one or more container types corresponding to the multiple service containers; as well as Based on the performance data of the first service on each test container in the one or more test containers, the alternative container type is obtained, wherein the performance data of the first service on the test container corresponding to the alternative container type is not lower than the performance data of the first service on any test container in the one or more test containers that is different from the test container corresponding to the alternative container type.

13. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

15. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Container application migration method and device, electronic equipment and computer readable medium

    CN112559125A