Portrayal generation method of elastic container instance and scheduling method of elastic container instance
Generating the portrait of the elastic container instance through the online portrait generation model solves the problem that the portrait of the elastic container instance cannot be accurately judged in the prior art, and improves the accuracy of the scheduling of the elastic container instance.
Patent Information
- Application Number
- CN202311493191.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art cannot accurately judge the portrait of the elastic container instance, resulting in poor accuracy of the elastic container instance scheduling.
By receiving the image generation request sent by the scheduling platform, the instance characteristics of the elastic container instance are obtained, and the online image generation model is called to generate the image of the elastic container instance based on the instance characteristics, and finally the generated image results are returned to the scheduling platform.
It realizes accurate judgment of elastic container instance portraits, improves the accuracy of elastic container instance scheduling, and solves the problem that the elastic container instance portrait cannot be accurately judged.
Smart Images

Figure CN119987982A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing, and more specifically, to a method for generating a profile of an elastic container instance and a method for scheduling an elastic container instance. Background Art
[0002] Elastic container instance is one of the many products used in cloud servers. It has the characteristics of large creation volume and low price. At present, there are a lot of idle resources in elastic container instance. In order to improve resource utilization and reduce costs, the scheduling system of elastic container instance can select elastic container instances with different performance for scheduling according to the requirements of different ECI requests in terms of life cycle, storage IOPS load, CPU load, etc., that is, according to the profiles of different elastic container instances. However, the current scheduling system cannot accurately judge the profile of elastic container instance, resulting in poor accuracy of elastic container instance scheduling.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method for generating a portrait of an elastic container instance and a method for scheduling an elastic container instance, so as to at least solve the technical problem that the portrait of the elastic container instance cannot be accurately determined.
[0005] According to one aspect of an embodiment of the present application, a method for generating a portrait of an elastic container instance is provided, including: receiving a portrait generation request sent by a scheduling platform, wherein the portrait generation request is used to request generation of a portrait of the elastic container instance; based on the portrait generation request, obtaining instance features corresponding to the elastic container instance; calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features; and when the online portrait generation model successfully generates an online portrait result of the elastic container instance, returning the online portrait result to the scheduling platform.
[0006] According to another aspect of an embodiment of the present application, a scheduling method for an elastic container instance is also provided, including: obtaining instance features corresponding to the elastic container instance; calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features; and when the online portrait generation model successfully generates an online portrait result of the elastic container instance, scheduling the elastic container instance based on the online portrait result.
[0007] According to another aspect of an embodiment of the present application, a portrait generation system for an elastic container instance is also provided, including: a portrait generation device, connected to a scheduling platform, for receiving a portrait generation request sent by the scheduling platform, the portrait generation request being used to request generation of a portrait of the elastic container instance; an algorithm platform, connected to the portrait generation device, for obtaining instance features corresponding to the elastic container instance based on the portrait generation request, and calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features, wherein the online portrait generation model is deployed on the algorithm platform; the portrait generation device is also used to return the online portrait result to the scheduling platform when the online portrait generation model successfully generates the online portrait result of the elastic container instance.
[0008] According to another aspect of an embodiment of the present application, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for instantiating the program, wherein the program instantiation executes any one of the above methods.
[0009] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is instantiated, the device where the storage medium is located is controlled to execute any one of the above methods.
[0010] In an embodiment of the present application, a portrait generation request is received from a scheduling platform, wherein the portrait generation request is used to request generation of a portrait of an elastic container instance; based on the portrait generation request, instance features corresponding to the elastic container instance are obtained; an online portrait generation model is called to generate a portrait of the elastic container instance based on the instance features; when the online portrait generation model successfully generates an online portrait result of the elastic container instance, the online portrait result is returned to the scheduling platform. It is easy to notice that, based on the portrait generation request, the instance features corresponding to the elastic container instance can be obtained, and the online portrait generation model is called to generate a portrait of the elastic container instance based on the instance features, that is, for portraits of different elastic container instances, elastic container instances with different performances are selected for scheduling, so that the portrait of the elastic container instance can be accurately judged, thereby solving the technical problem of being unable to accurately judge the portrait of the elastic container instance.
[0011] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0013] Figure 1It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating a portrait of an elastic container instance according to an embodiment of the present application;
[0014] Figure 2 is a structural block diagram of a computing environment according to an embodiment of the present application;
[0015] Figure 3 is a structural block diagram of a service grid according to an embodiment of the present application;
[0016] Figure 4 is a flowchart of a method for generating an image of an elastic container instance according to Embodiment 1 of the present application;
[0017] Figure 5 is a schematic diagram of a scheduling platform deployment according to an embodiment of the present application;
[0018] Figure 6 is a flow chart for constructing an online service model according to an embodiment of the present application;
[0019] Figure 7 is a flowchart of offline portrait construction according to an embodiment of the present application;
[0020] Figure 8 is an overall schematic diagram of a method for generating a portrait of an elastic container instance according to an embodiment of the present application;
[0021] Fig. 9 is a flowchart of a method for scheduling elastic container instances according to Embodiment 2 of the present application;
[0022] Fig.10 is a flowchart of a method for training a portrait generation model according to Example 3 of the present application;
[0023] Fig.11 is a schematic diagram of a system for generating an image of an elastic container instance according to Embodiment 4 of the present application;
[0024] Fig.12 is a schematic diagram of a device for generating an image of an elastic container instance according to Embodiment 5 of the present application;
[0025] Fig.13 is a schematic diagram of a scheduling device for an elastic container instance according to Embodiment 6 of the present application;
[0026] Fig.14 is a schematic diagram of a training device for a portrait generation model according to Example 7 of the present application;
[0027] Fig.15 It is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0031] ECS: Elastic Compute Service, cloud server, is a cloud computing service with high performance, stability, reliability and elastic expansion.
[0032] ECI: Elastic Container Instance, a container running service that combines container and Serverless technologies. Serverless is a computing model. By using ECI, there is no need to purchase and manage cloud servers ECS. You only need to provide a packaged Docker image to run the container on the service. The Docker image is a lightweight, independent executable software package.
[0033] QPS: Queries Per Second, query efficiency per second, is a measure of the amount of traffic processed by a specific query server within a specified time. The unit of QPS is the number of requests per second, that is, the number of response requests per second, which is also the maximum throughput.
[0034] EAS: Elastic Algorithm Service, a model service deployment platform used to achieve real-time response to model loading and data requests based on heterogeneous hardware.
[0035] LightGBM: Light Gradient Boosting Machine, a fast, distributed, high-performance gradient boosting framework using a tree-based learning algorithm.
[0036] PMML: Predictive Model Markup Language, a model representation language that is independent of platform and environment.
[0037] Example 1
[0038] According to an embodiment of the present application, a method for generating a portrait of an elastic container instance is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating a portrait of an elastic container instance according to an embodiment of the present application. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0040] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image generation method of the elastic container instance in the embodiment of the present application. The processor 102 performs various functional applications and data processing through the software programs and modules stored in the memory 104 by example, that is, the image generation method of the elastic container instance described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0042] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] The display may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0044] Figure 1 The hardware structure block diagram shown can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, Figure 2 The block diagram shows the use of the above Figure 1The computer terminal 10 (or mobile device) shown is an embodiment of a computing node in the computing environment 201. Figure 2 is a structural block diagram of a computing environment according to an embodiment of the present application, such as Figure 2 As shown, computing environment 201 includes multiple computing nodes (such as servers) instantiated on a distributed network (illustrated by 210-1, 210-2, ..., in the figure). The computing nodes all contain local processing and memory resources, and end users 202 can remotely instantiate applications or store data in computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3 and 220-4 in computing environment 201, representing services "A", "D", "E" and "H" respectively.
[0045] The end user 202 can provide and access services through a web browser or other software application on the client, and in some embodiments, the end user 202's provision and / or request can be provided to the entry gateway 230. The entry gateway 230 can include a corresponding agent to handle the provision and / or request for the service (one or more services provided in the computing environment 201).
[0046] Services are provided or deployed based on various virtualization technologies supported by the computing environment 201. In some embodiments, services can be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual machine-based virtualization can be to simulate a real computer by initializing a virtual machine to execute programs and applications without directly contacting any actual hardware resources. While the virtual machine virtualizes the machine, according to container-based virtualization, a container can be started to virtualize the entire operating system (OS) so that multiple workloads can be instantiated on a single operating system instance.
[0047] In an embodiment based on container virtualization, several containers of a service can be assembled into a Pod (e.g., a Kubernetes Pod). Figure 2 As shown, service 220-2 can be equipped with one or more Pods 240-1, 240-2, ..., 240-N (collectively referred to as Pods). Pods can include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers). One or more containers in a Pod process requests related to one or more corresponding functions of the service, and the proxy 245 generally controls network functions related to the service, such as routing, load balancing, etc. Other services can also be equipped with similar Pods.
[0048] During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201, and executing one or more functions of a service may require invoking one or more functions of another service. Figure 2 As shown, service "A" 220-1 receives a user request from end user 202 from ingress gateway 230, service "A" 220-1 may call service "D" 220-2, and service "D" 220-2 may request service "E" 220-3 to perform one or more functions.
[0049] The computing environment described above can be a cloud computing environment, where the allocation of resources is managed by the cloud service provider, allowing the development of functions without considering the implementation, adjustment or expansion of servers. The computing environment allows developers to execute code in response to events without building or maintaining complex infrastructure. Services can be divided into a set of functions that can be automatically and independently scaled, rather than expanding a single hardware device to handle potential loads.
[0050] In another optional embodiment, Figure 3 The block diagram shows the use of the above Figure 1 The computer terminal 10 (or mobile device) is shown as an embodiment of the service grid. Figure 3 is a structural block diagram of a service grid according to an embodiment of the present application, such as Figure 3 As shown, the service grid 300 is mainly used to facilitate secure and reliable communication between multiple microservices. Microservices refer to decomposing an application into multiple smaller services or instances and distributing them on different clusters / machine instances.
[0051] like Figure 3 As shown, the microservice may include an application service instance A and an application service instance B, which form a functional application layer of the service grid 300. In one embodiment, the application service instance A is instantiated in a machine / workload container group 314 (Pod) in the form of a container / process 308, and the application service instance B is instantiated in a machine / workload container group 316 (Pod) in the form of a container / process 310.
[0052] In one implementation, application service instance A may be a product query service, and application service instance B may be a product ordering service.
[0053] like Figure 3As shown, application service instance A and grid agent (sidecar) 303 coexist in machine workload container group 614, and application service instance B and grid agent 305 coexist in machine workload container 314. Grid agent 303 and grid agent 305 form the data plane layer (dataplane) of service grid 300. Among them, grid agent 303 and grid agent 305 are respectively instantiated in the form of container / process 304 and container / process 306, and can receive request 312 for commodity query service, and grid agent 303 and application service instance A can communicate bidirectionally, and grid agent 305 and application service instance B can communicate bidirectionally. In addition, grid agent 303 and grid agent 305 can also communicate bidirectionally.
[0054] In one embodiment, the traffic of application service instance A is routed to a suitable destination through grid proxy 303, and the network traffic of application service instance B is routed to a suitable destination through grid proxy 305. It should be noted that the network traffic mentioned here includes but is not limited to Hyper Text Transfer Protocol (HTTP), Representational State Transfer (REST), high-performance, general open source framework (google Remote Procedure Call, gRPC), open source in-memory data structure storage system (Redis), etc.
[0055] In one embodiment, the function of extending the data plane layer can be realized by writing a custom filter for the proxy (Envoy) in the service grid 300. The service grid proxy configuration can be to enable the service grid to correctly proxy service traffic and realize service intercommunication and service governance. The grid proxy 303 and the grid proxy 305 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability.
[0056] like Figure 3 As shown, the service grid 300 also includes a control plane layer. The control plane layer may be a set of services instantiated in a dedicated namespace, and these services are hosted by a hosting control plane component 301 in a machine / workload container group (machine / Pod) 302. Figure 3As shown, the managed control plane component 301 performs bidirectional communication with the grid agent 303 and the grid agent 305. The managed control plane component 301 is configured to perform some control management functions. For example, the managed control plane component 301 receives telemetry data transmitted by the grid agent 303 and the grid agent 305, and can further aggregate the telemetry data. For these services, the managed control plane component 301 can also provide a user-oriented application programming interface (Application Programming Interface, API) to more easily manipulate network behavior and provide configuration data to the grid agent 303 and the grid agent 305.
[0057] In the above example environment, this application provides Figure 4 The image generation method of the elastic container instance shown. Figure 4 1 is a flowchart of a method for generating an image of an elastic container instance according to Embodiment 1 of the present application. Figure 4 As shown, the method is executed by the portrait generation server 410, and the portrait generation server 410 can be connected to the scheduling platform 420 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The scheduling platform 420 can schedule the elastic container instance based on the portrait generated by the portrait generation server 410. Specifically, the method may include the following steps:
[0058] Step S402: receiving a portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request generation of a portrait of the elastic container instance.
[0059] The above-mentioned scheduling platform is a software tool or system used to manage and optimize resource scheduling. The scheduling platform usually involves the following functions:
[0060] Resource management: The scheduling platform can help manage and monitor various resources, determine the availability and utilization of resources, and help make reasonable resource allocation decisions.
[0061] Task Scheduling: The scheduling platform can arrange and assign tasks to ensure that they are completed on time. It can automatically assign tasks to appropriate personnel or equipment based on factors such as task priority and resource requirements, and provide task progress tracking and reporting.
[0062] Optimization algorithm: Scheduling platforms usually use some optimization algorithms to help solve resource scheduling problems. These algorithms can automatically find scheduling solutions based on different goals, such as maximizing resource utilization, minimizing waiting time, etc.
[0063] Data analysis and reporting: The scheduling platform can collect and analyze various data, such as task completion time, resource utilization, etc., and provide real-time data analysis and reporting.
[0064] User interface: The scheduling platform usually provides a user-friendly interface to facilitate users to perform tasks, resource management and other operations. Users can view task status, modify task assignments, etc. through the interface.
[0065] Optionally, in the present application, when it is necessary to use a portrait generation service to generate a portrait of an elastic container instance, a portrait generation request can be sent to the portrait generation server through the scheduling platform, so that the portrait generation server can generate a portrait of the elastic container instance according to the portrait generation request of the elastic container instance sent by the scheduling platform, wherein the portrait generation server can be a server-side algorithm platform.
[0066] The above-mentioned portrait generation request can be a request message (also called Hyper Text Transfer Protocol request, HTTP request for short) from the scheduling platform to the portrait generation server, which is used to request the generation of a portrait of an elastic container instance, wherein the HTTP request includes the resource request method, resource identifier and the protocol used in the first line of the message.
[0067] Among them, elastic container instance can be a containerized computing resource, which can be dynamically adjusted and automatically scaled according to the needs of the application, and can automatically expand or shrink capacity according to the load to provide better performance and resource utilization. Elastic container instance usually consists of the following components:
[0068] Container Engine: Responsible for managing the life cycle of containers, including operations such as creating, starting, stopping, and destroying containers.
[0069] Resource Manager: Responsible for monitoring the load of containers and automatically expanding or shrinking capacity as needed.
[0070] Scheduler: Responsible for allocating containers to available computing resources to ensure that the containers can run normally.
[0071] Monitoring and logging system: used to monitor the operating status and performance indicators of the container and record the log information of the container.
[0072] The above elastic container instance profile may include the following:
[0073] Architecture diagram: shows the overall architecture and components of an elastic container instance, including container instances, containers, images, networks, storage, etc.
[0074] Deployment diagram: describes the deployment method and topology of elastic container instances, including the number, location, and relationship of container instances.
[0075] Functional diagram: shows the various functions and features provided by elastic container instances, such as automatic scaling, load balancing, container orchestration, etc.
[0076] Performance graph: describes the performance indicators and monitoring data of the elastic container instance, such as CPU utilization, memory usage, network bandwidth, etc.
[0077] Dependency diagram: shows the dependency between elastic container instances and other components or services, such as databases, message queues, and log services.
[0078] In an optional embodiment, a portrait generation request for the elastic container instance can be sent to the portrait generation server through the scheduling platform. Optionally, after receiving the portrait generation request for the elastic container instance sent by the scheduling platform, the portrait generation server can generate a portrait of the elastic container instance according to the portrait generation request for the elastic container instance sent by the scheduling platform.
[0079] Step S404: based on the portrait generation request, obtain instance features corresponding to the elastic container instance.
[0080] In an optional embodiment, the portrait generation request may include some or all instance features corresponding to the elastic container instance. When receiving the portrait generation request, if the request data of the portrait generation request includes all instance features corresponding to the elastic container instance, the portrait generation server may parse the portrait generation request according to the model configuration file to obtain all instance features corresponding to the elastic container instance; if the request data of the portrait generation request only includes some instance features corresponding to the elastic container instance, the portrait generation server may parse the portrait generation request according to the model configuration file to obtain some instance features corresponding to the elastic container instance. For other instance features not provided in the portrait generation request, the algorithm platform may directly query the data bound to the bottom layer of the feature service through its own online feature service, thereby obtaining the partial instance features. For example, for the ECI portrait generation server, the scheduling platform only needs to pass in the ECI request features, and other features, such as user static information features, are obtained by the portrait generation server through the online feature service.
[0081] Step S406: calling the online portrait generation model to generate a portrait of the elastic container instance based on the instance features.
[0082] The above-mentioned portrait generation model can be a machine learning model for generating a portrait of an elastic container instance from given input data, that is, generating a portrait of an elastic container instance based on instance features. Optionally, the portrait generation model can use deep learning technology, such as a generative adversarial network or a variational autoencoder, to learn the instance features of the input portrait generation model, thereby being able to generate portraits of elastic container instances similar to the instance features. Optionally, the online portrait generation model can be a publicly available model, or a model trained according to the needs of those skilled in the art.
[0083] It should be noted that the portrait generation model can be deployed in the algorithm platform of the portrait generation server, so that the portrait generation server can call the model inference results based on the HTTP request protocol. At the same time, the algorithm iteration and scheduling platform can be decoupled. When deploying the algorithm, the model must first be deployed to the cloud server EAS, and then the EAS service is called on the algorithm platform according to the features passed in the request and the features in the feature library to perform efficient model inference.
[0084] Step S408: When the online portrait generation model successfully generates an online portrait result of the elastic container instance, the online portrait result is returned to the scheduling platform.
[0085] In an optional embodiment, after finally acquiring all the features required by the online portrait generation model, the algorithm platform will pass the feature values into the online portrait generation model for reasoning. Optionally, assuming that the online portrait generation model calculates the portrait of the elastic container instance after reasoning based on the instance features, that is, successfully generates the online portrait result of the elastic container instance, then the online portrait result can be returned to the scheduling platform. Optionally, assuming that the online portrait generation model fails to calculate the portrait of the elastic container instance after reasoning based on the instance features, that is, fails to successfully generate the online portrait result of the elastic container instance, then the online portrait generation model can be used to obtain the offline portrait result, and the offline portrait result is returned to the scheduling platform, wherein the offline portrait result is obtained by aggregating the portraits of other elastic container instances generated before the portrait of this elastic container instance is generated, or directly returning error information to the scheduling platform through the portrait generation model.
[0086] In an embodiment of the present application, a portrait generation request is received from a scheduling platform, wherein the portrait generation request is used to request generation of a portrait of an elastic container instance; based on the portrait generation request, instance features corresponding to the elastic container instance are obtained; an online portrait generation model is called to generate a portrait of the elastic container instance based on the instance features; when the online portrait generation model successfully generates an online portrait result of the elastic container instance, the online portrait result is returned to the scheduling platform. It is easy to notice that, based on the portrait generation request, the instance features corresponding to the elastic container instance can be obtained, and the online portrait generation model is called to generate a portrait of the elastic container instance based on the instance features, that is, for portraits of different elastic container instances, elastic container instances with different performances are selected for scheduling, so that the portrait of the elastic container instance can be accurately judged, thereby solving the technical problem of being unable to accurately judge the portrait of the elastic container instance.
[0087] In the above embodiment of the present application, obtaining instance features corresponding to the elastic container instance includes: obtaining a model configuration file corresponding to the online portrait generation model; and obtaining instance features from the portrait generation request based on the model configuration file.
[0088] The above-mentioned model configuration file can be a file that can obtain parameters and hyperparameters of instance features from a portrait generation request. It defines the structure of instance features and the format of input and output. The model configuration file is usually a text file.
[0089] In an optional embodiment, assuming that the online portrait generation model is a publicly available model, relevant resources of the model can be searched to obtain a configuration file of the online portrait generation model. If the online portrait generation model is a model trained according to the needs of technical personnel in this field, the model configuration file can be obtained by viewing the documentation of the framework or library used when training the model. Further, instance features can be obtained from the portrait generation request based on the model configuration file. When obtaining instance features from the portrait generation request based on the model configuration file, the following steps can be performed:
[0090] Image data is obtained from the portrait generation request, where the image data may be information such as pixel values, size, and format of the portrait of the elastic container instance to be generated.
[0091] Preprocess the image data according to the preprocessing steps defined in the model configuration file, where the preprocessing may include adjusting the image to the size required by the model, normalizing pixel values, etc.
[0092] According to the model architecture defined in the model configuration file, the preprocessed image data is input into the online portrait generation model for inference, which may involve loading model weights, defining model inputs and outputs, etc.
[0093] Instance features are extracted from the output of the online portrait generation model, wherein features of a specific layer can be selected to be extracted as instance features according to the output layer or intermediate layer defined in the model configuration file, or the output of the entire online portrait generation model can be used as instance features.
[0094] Figure 5 is a schematic diagram of a scheduling platform deployment according to an embodiment of the present application, such as Figure 5As shown, after the start, you can first input a portrait generation request to the scheduling platform, and further, perform a configuration file query based on the portrait generation request, that is, obtain the instance features corresponding to the elastic container instance. Optionally, if the portrait generation request does not include all features, obtain the remaining features from the feature service, and then perform reasoning through the online portrait generation model. If the portrait generation request includes all features, all the acquired features can be directly input into the online portrait generation model for reasoning, and the online portrait result can be obtained, and finally the online portrait result is returned to the scheduling platform, that is, the request result is returned.
[0095] In the above embodiment of the present application, instance features are obtained from a portrait generation request based on a model configuration file, including: determining whether the portrait generation request contains instance features based on the model configuration file; if the portrait generation request contains instance features, obtaining the instance features from the portrait generation request; if the portrait generation request contains some features of the instance features, obtaining the remaining features of the instance features except the some features from an online feature library.
[0096] The above-mentioned online feature library may contain multiple different instance features for generating portrait results. Optionally, the online feature library may be deployed on an online service, so that when the portrait generation request does not contain all instance features, the algorithm platform can obtain the part of instance features not included in the portrait generation request through the online feature library.
[0097] In an optional embodiment, when obtaining instance features from a portrait generation request through a model configuration file, it is possible to first determine whether the portrait generation request contains all instance features. If the portrait generation request contains all instance features, all instance features can be directly obtained from the portrait generation request. If the portrait generation request does not contain all instance features, the instance features contained in the portrait generation request can be obtained from the portrait generation request, and the remaining instance features can be obtained from an online feature library, that is, obtained by the algorithm platform through online services.
[0098] In the above embodiment of the present application, the method also includes: obtaining historical instance data of multiple elastic container instances; performing feature extraction on the historical instance data to obtain historical instance features of multiple elastic container instances, wherein the historical instance features are synchronized to an online feature library; based on a preset number of feature categories, online training samples are screened out from the historical instance features; and based on the online training samples, an initial online model is trained to obtain an online portrait generation model.
[0099] The above historical instance data may be other instance data obtained before generating the online profile result of the elastic container instance this time. Optionally, each time instance data is obtained and used, the obtained instance data may be stored in the online feature library as historical instance data.
[0100] The above-mentioned preset number of feature categories may be the number of feature categories of training samples to be used when training the initial online model.
[0101] In an optional embodiment, online portrait generation results can be generated by constructing an online portrait generation model, that is, constructing an online service model. Optionally, when performing feature selection, the online service model no longer needs to consider the number of portraits and the daily increment of portraits, but needs to consider the model reasoning speed. At the same time, the online service model adds user static information for selection, and the feature selection space is increased. Optionally, based on a preset number of feature categories, online training samples can be screened out from historical instance features, and the initial online model can be trained based on the online training samples to obtain an online portrait generation model.
[0102] Figure 6 is a flow chart of constructing an online service model according to an embodiment of the present application, such as Figure 6 As shown, you can first obtain training data, that is, filter out online training samples from historical instance features, and then further perform feature engineering technology, that is, perform feature extraction on historical instance data. Furthermore, since the features in ECI requests and user static information are mostly category features of string type, and features with too many categories will have a greater impact on the operating efficiency of the LightGBM model, it is necessary to train the LightGBM model, that is, control the number of features so that the initial online model can be trained to obtain the online portrait generation model, and export the online portrait generation model.
[0103] In the above embodiment of the present application, online training samples are screened out from historical instance features based on a preset number of feature categories, including: determining the feature importance of the historical instance features, wherein the feature importance is used to characterize the number of times the initial online model uses the historical instance features as branch features; determining a screening index for the historical instance features based on the feature importance and the preset number of feature categories; and screening out online training samples from history based on the screening index.
[0104] The branch features mentioned above may be instance features used when generating online portraits using the initial online model.
[0105] In an optional embodiment, since most of the features in ECI requests and user static information are category features of string type, and features with too many categories will have a greater impact on the operating efficiency of the LightGBM model, it is necessary to introduce screening indicators for determining historical instance features. Optionally, the screening indicators for historical instance features can be determined by feature importance and the preset number of feature categories, so that as many features as possible can be selected in descending order according to the feature screening indicator values while satisfying the algorithm's operating efficiency.
[0106] Optionally, the quotient of the feature importance and the square root of the preset feature category quantity may be determined to obtain a screening index of the historical instance feature, and online training samples may be screened out from the history based on the screening index of the historical instance feature.
[0107] Specifically, it can be calculated by the following formula:
[0108]
[0109] Among them, r represents the screening index, feature_importance represents the feature importance, and distinct_count represents the number of preset feature categories.
[0110] In the above embodiment of the present application, the historical instance data includes at least one of the following: request data of the elastic container instance, user data corresponding to the elastic container instance, and label data of the elastic container instance.
[0111] The user data corresponding to the elastic container instance may be user static data.
[0112] The label data of the elastic container instance may be label data of the ECI.
[0113] In an optional embodiment, the creation request field of each ECI mainly comes from two parts, a large part of which comes from the data filled in when the user creates the ECI, and a small part comes from the log data filled back by the ECI management after completing the entire ECI creation process. Both parts are stored in the database. When processing data, the ECI request data needs to aggregate the two parts of data according to the ECI instance address to obtain the ECI request data. Optionally, since the user static data includes user level, user type, province and city, etc., this information also exists in the feature library and is the data obtained by the server based on user behavior statistics. Therefore, the user static data can be obtained through the feature library. Optionally, the actual operation status of the ECI instance can be obtained from the server, including the instance survival time, central processing unit utilization, and storage input / output operations per second (IOPS), and then, according to the server rules, these data are classified and labeled to obtain the label data of the ECI.
[0114] In the above embodiment of the present application, when the online portrait generation model fails to successfully generate an online portrait result of the elastic container instance, the method also includes: obtaining an offline portrait result of the elastic container instance from a portrait result database, wherein the portrait result database is used to store portrait results generated by the offline portrait generation model based on historical instance features of multiple elastic container instances; and returning the offline portrait result to the scheduling platform.
[0115] In an optional embodiment, an offline portrait, that is, a portrait result database, can be constructed, so that when the online portrait generation model fails to successfully generate an online portrait result of the elastic container instance, the offline portrait result of the elastic container instance can be obtained from the portrait result database. Optionally, the portraits of other elastic container instances generated before the portrait generation of the current elastic container instance can be aggregated to obtain the portrait result database, that is, the offline portrait is constructed by using the portrait results generated by the offline portrait generation model based on the historical instance features of multiple elastic container instances.
[0116] In the above embodiment of the present application, the method also includes: obtaining periodic instance data of multiple elastic container instances according to a preset period; performing feature extraction on the periodic instance data to obtain periodic instance features of multiple elastic container instances; based on the feature importance of the periodic instance features, screening out target instance features from the periodic instance features, wherein the feature importance is used to characterize the number of times the initial online model uses historical instance features as branch features; calling the offline portrait generation model to generate portraits of multiple elastic container instances based on the target instance features, to obtain periodic portrait results of the multiple elastic container instances; and storing the periodic portrait results in a portrait result database.
[0117] In an optional embodiment, assuming that the preset cycle, that is, the scheduling cycle is daily, that is, the periodic portrait results will be produced based on the periodic example data every day, the periodic portrait results and the portrait results can be aggregated and provided to the scheduling platform for use. In order to ensure a balance between the number of portraits, the daily increment of portraits and the quality of portraits, the life cycle of the periodic portrait results and the portrait results, the storage IOPS load, and the central processing unit load portrait selected features can be pre-screened, wherein the screening index is the feature importance of the online portrait generation model, that is, it indicates the number of times a certain feature is used as a branch feature in the online portrait generation model. Optionally, when training the online portrait generation model, the training data can be determined as the ECI instance request data 5 days before the generation of the periodic portrait results. For example, if the current date is T, the data of the date [T-5, T-1] will be selected as the training set. In terms of portrait aggregation, taking into account the changes in user usage habits, for the same portrait specification (that is, the portrait result with the same feature values), if the latest portrait result generated by the daily scheduling conflicts with the historical portrait, the latest portrait result can be retained.
[0118] Figure 7 is a flowchart of offline portrait construction according to an embodiment of the present application, such as Figure 7 As shown, the training data can be obtained first, and then feature engineering technology can be performed, that is, feature extraction can be performed on the training data. Furthermore, since the features in the ECI request and user static information are mostly category features of string type, and features with too many categories will have a greater impact on the operating efficiency of the LightGBM model, it is necessary to train the LightGBM model, and then perform model inference and remove duplicate offline portrait results. Furthermore, portrait aggregation can be performed to obtain the total portrait.
[0119] In the above embodiment of the present application, storing the periodic portrait results in the portrait result database includes: obtaining the portrait results of multiple elastic container instances already stored in the portrait result database; when the portrait results of multiple elastic container instances are inconsistent with the periodic portrait results, deleting the portrait results of multiple elastic container instances from the portrait result database, and storing the periodic portrait results in the portrait result database; when the portrait results of multiple elastic container instances are consistent with the periodic portrait results, prohibiting the storage of the periodic portrait results.
[0120] In an optional embodiment, when storing the stored portrait results of multiple elastic container instances in a portrait result database, if the stored portrait results conflict with the periodic portrait results, indicating that the portrait results have been updated, the stored portrait results can be deleted from the portrait result database, and the periodic portrait results can be stored in the portrait result database. That is, when the portrait results of multiple elastic container instances are inconsistent with the periodic portrait results, the portrait results of multiple elastic container instances are deleted from the portrait result database, and the periodic portrait results are stored in the portrait result database. At the same time, when the portrait results of multiple elastic container instances are consistent with the periodic portrait results, the storage of the periodic portrait results is prohibited.
[0121] In the above embodiment of the present application, the method also includes: obtaining historical instance data of multiple elastic container instances; performing feature extraction on the historical instance data to obtain historical instance features of multiple elastic container instances; based on the feature importance of the historical instance features, screening offline training samples from the historical instance features; training the initial offline model based on the offline training samples to obtain an offline portrait generation model.
[0122] In an optional embodiment, the initial offline model can also be trained based on the offline training samples to obtain an offline portrait generation model, wherein, when determining the offline training samples, the historical instance features of multiple elastic container instances can be obtained by extracting features from the historical instance data, and the offline training samples are screened out from the historical instance features based on the feature importance of the historical instance features. Optionally, when screening the offline training samples, a small number of high-importance features are selected to train the initial offline model due to the need for further feature selection and processing, and the offline portrait generation model can be updated and inferred daily by configuring the scheduling of the offline portrait generation model, and the daily generated offline portrait results can be aggregated with the historical portraits to obtain a portrait result database. Therefore, it is necessary to control the number of offline training samples, so that when the online portrait generation model fails to successfully generate the online portrait result of the elastic container instance, the offline portrait result can be obtained and returned to the scheduling platform.
[0123] Figure 8 is an overall schematic diagram of a method for generating an image of an elastic container instance according to an embodiment of the present application, such as Figure 8As shown, the whole work can be divided into an online operation part and an offline operation part, wherein the online operation part may include elastic container instance portrait query and algorithm platform calculation, wherein after starting the elastic container instance portrait query, it is possible to determine whether the online model call is abnormal. If no abnormality occurs, the judgment ends. If an abnormality occurs, an offline portrait query can be performed. During the algorithm platform calculation, the query request can be processed through the online service model, and feature services can be performed. When processing the query request, online prediction services can be performed through the model service deployment platform. Optionally, the offline operation part may include synchronizing the instance features in the portrait generation request with the data in the online feature library during the offline portrait query, and synchronizing the historical instance features with the online feature library. Further, the offline data is stored in the offline feature library, and offline model training and reasoning are performed. The offline database is obtained by extracting features from the data through feature engineering. After obtaining the offline feature library, the offline database can be used for online model training, and the trained model can be exported for model deployment.
[0124] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0125] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including several instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0127] Example 2
[0128] According to an embodiment of the present application, a method for scheduling an elastic container instance is also provided. Fig. 9 is a flowchart of a scheduling method for elastic container instances according to Embodiment 2 of the present application, such as Fig. 9 As shown, the method includes a cloud server 910, which can be connected to one or more clients 920 via a local area network connection, a wide area network connection, an Internet connection, or other types of data networks, and the client 920 can use the elastic container instance scheduled by the cloud server 910. The method includes the following steps:
[0129] Step S902: Obtain instance features corresponding to the elastic container instance.
[0130] Step S904: calling the online portrait generation model to generate a portrait of the elastic container instance based on the instance features.
[0131] Step S906: When the online portrait generation model successfully generates an online portrait result of the elastic container instance, the elastic container instance is scheduled based on the online portrait result.
[0132] In an optional embodiment, instance features corresponding to the elastic container instance may be obtained, and an online portrait generation model may be used to generate a portrait of the elastic container instance based on the instance features. Furthermore, when the online portrait generation model successfully generates an online portrait result of the elastic container instance, the elastic container instance may be scheduled based on the online portrait result.
[0133] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 2 as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 2.
[0134] Example 3
[0135] According to an embodiment of the present application, a method for training a portrait generation model is also provided. Fig.10 is a flowchart of a training method for a portrait generation model according to Example 3 of the present application, such as Fig.10 As shown, the method includes a cloud server 1010, which can be connected to one or more clients 1020 via a local area network connection, a wide area network connection, an Internet connection, or other types of data networks, and the client 1020 can use the elastic container instance scheduled by the cloud server 1010. The method includes the following steps:
[0136] Step S1002: Acquire historical instance data of multiple elastic container instances;
[0137] Step S1004: extracting features from historical instance data to obtain historical instance features of multiple elastic container instances, wherein the historical instance features are synchronized to an online feature library;
[0138] Step S1006: based on the preset number of feature categories, select online training samples from historical instance features;
[0139] Step S1008: Train the initial online model based on the online training samples to obtain an online portrait generation model, wherein the online portrait generation model is used to generate an online portrait result of the elastic container instance based on the instance features corresponding to the elastic container instance, and return the online portrait result to the scheduling platform.
[0140] In an optional embodiment, historical instance data of multiple elastic container instances can be obtained first, and then features can be extracted from the historical instance data to obtain historical instance features of the multiple elastic container instances. Furthermore, the historical instance features can be synchronized to an online feature library, and online training samples can be screened from the historical instance features based on a preset number of feature categories, so that the initial online model can be trained to obtain an online portrait generation model.
[0141] Optionally, when training the online portrait generation model, the initial offline model can be trained based on the offline training samples to obtain the offline portrait generation model. When determining the offline training samples, the historical instance features of multiple elastic container instances can be obtained by extracting features from the historical instance data, and the offline training samples can be screened out from the historical instance features based on the feature importance of the historical instance features. Optionally, when screening offline training samples, a small number of high-importance features are selected to train the initial offline model due to the need for further feature selection and processing, and the offline portrait generation model scheduling is configured so that the offline portrait generation model can be updated and inferred daily, and the daily generated offline portrait results can be aggregated with the historical portraits to obtain a portrait result database. Therefore, it is necessary to control the number of offline training samples so that when the online portrait generation model fails to successfully generate the online portrait results of the elastic container instance, the offline portrait results can be obtained and returned to the scheduling platform.
[0142] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 3, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 3.
[0143] Example 4
[0144] According to an embodiment of the present application, a system for generating a portrait of an elastic container instance is also provided. Fig.11is a schematic diagram of a system for generating an image of an elastic container instance according to Embodiment 4 of the present application. Fig.11 As shown, the system includes:
[0145] The portrait generation device 1102 is connected to the scheduling platform 410 and is used to receive a portrait generation request sent by the scheduling platform, where the portrait generation request is used to request generation of a portrait of the elastic container instance.
[0146] The algorithm platform 1104 is connected to the portrait generation device, and is used to obtain instance features corresponding to the elastic container instance based on the portrait generation request, and call the online portrait generation model to generate a portrait of the elastic container instance based on the instance features, wherein the online portrait generation model is deployed on the algorithm platform.
[0147] The portrait generation device is also used to return the online portrait result to the scheduling platform when the online portrait generation model successfully generates the online portrait result of the elastic container instance.
[0148] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0149] Example 5
[0150] According to an embodiment of the present application, a device for implementing the above-mentioned method for generating an image of an elastic container instance is also provided. Fig.12 is a schematic diagram of an image generating device of an elastic container instance according to Embodiment 5 of the present application, such as Fig.12 As shown, the device includes: a receiving module 1202 , an acquiring module 1204 , a calling module 1206 , and a returning module 1208 .
[0151] Among them, the receiving module 1202 is used to receive the portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request the generation of a portrait of the elastic container instance; the acquisition module 1204 is used to obtain the instance features corresponding to the elastic container instance based on the portrait generation request; the calling module 1206 is used to call the online portrait generation model to generate a portrait of the elastic container instance based on the instance features; the return module 1208 is used to return the online portrait result to the scheduling platform when the online portrait generation model successfully generates the online portrait result of the elastic container instance.
[0152] It should be noted that the receiving module 1202, the acquiring module 1204, the calling module 1206, and the returning module 1208 correspond to steps S402 to S408 in Embodiment 1, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules or units may be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the modules may also be instantiated in the computer terminal 10 provided in Embodiment 1 as part of the device.
[0153] In the above embodiment of the present application, the acquisition module 1204 includes: a first acquisition unit, used to acquire a model configuration file corresponding to the online portrait generation model; and a second acquisition unit, used to acquire instance features from the portrait generation request based on the model configuration file.
[0154] In the above embodiment of the present application, the second acquisition unit includes: a first sub-determination unit, used to determine whether the portrait generation request contains instance features based on the model configuration file; a first sub-acquisition unit, used to obtain instance features from the portrait generation request when the portrait generation request contains instance features; and a third sub-acquisition unit, used to obtain the remaining features of the instance features except some features from the online feature library when the portrait generation request contains some features of the instance features.
[0155] In the above embodiment of the present application, the device also includes: a second acquisition module, used to obtain historical instance data of multiple elastic container instances; a first extraction module, used to extract features from the historical instance data to obtain historical instance features of multiple elastic container instances, wherein the historical instance features are synchronized to an online feature library; a first screening module, used to screen out online training samples from the historical instance features based on a preset number of feature categories; and a first training module, used to train the initial online model based on the online training samples to obtain an online portrait generation model.
[0156] In the above embodiment of the present application, the first screening module includes: a second determination unit, used to determine the feature importance of historical instance features, wherein the feature importance is used to characterize the number of times the initial online model uses the historical instance features as branch features; a third determination unit, used to determine the screening index of the historical instance features based on the feature importance and the preset number of feature categories; and a screening unit, used to screen out online training samples from the history based on the screening index.
[0157] In the above embodiment of the present application, the device also includes: a third acquisition module, used to obtain offline portrait results of the elastic container instance from a portrait result database, wherein the portrait result database is used to store portrait results generated by using an offline portrait generation model based on historical instance features of multiple elastic container instances; a second return module, used to return the offline portrait results to the scheduling platform.
[0158] In the above embodiment of the present application, the device also includes: a fourth acquisition module, used to obtain period instance data of multiple elastic container instances according to a preset period; a second extraction module, used to extract features from the period instance data to obtain period instance features of multiple elastic container instances; based on the feature importance of the period instance features, the target instance features are screened out from the period instance features; a generation module, used to call the offline portrait generation model to generate portraits of multiple elastic container instances based on the target instance features, and obtain period portrait results of multiple elastic container instances; a storage module, used to store the period portrait results in a portrait result database.
[0159] In the above embodiment of the present application, the storage module also includes: a fourth acquisition unit, used to obtain the stored portrait results of multiple elastic container instances stored in the portrait result database; a deletion unit, used to delete the stored portrait results from the portrait result database when the stored portrait results conflict with the periodic portrait results, and store the periodic portrait results in the portrait result database.
[0160] In the above embodiment of the present application, the device also includes: a fifth acquisition module, used to obtain historical instance data of multiple elastic container instances; a third extraction module, used to extract features from the historical instance data to obtain historical instance features of multiple elastic container instances; a second screening module, used to screen out offline training samples from the historical instance features based on the feature importance of the historical instance features; and a second training module, used to train the initial offline model based on the offline training samples to obtain an offline portrait generation model.
[0161] Example 6
[0162] According to an embodiment of the present application, a device for implementing the above-mentioned scheduling method of elastic container instances is also provided. Fig.13 is a schematic diagram of a scheduling device for an elastic container instance according to Embodiment 6 of the present application, such as Fig.13 As shown, the device includes: an acquisition module 1302 , a calling module 1304 , and a scheduling module 1306 .
[0163] Among them, the acquisition module 1302 is used to obtain the instance features corresponding to the elastic container instance; the calling module 1304 is used to call the online portrait generation model to generate a portrait of the elastic container instance based on the instance features; the scheduling module 1306 is used to schedule the elastic container instance based on the online portrait result when the online portrait generation model successfully generates the online portrait result of the elastic container instance.
[0164] It should be noted here that the above-mentioned acquisition module 1302, calling module 1304, and scheduling module 1306 correspond to steps S902 to S906 in Example 2. The instances and application scenarios implemented by the modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 2.
[0165] Example 7
[0166] According to an embodiment of the present application, a device for implementing the training method of the above-mentioned portrait generation model is also provided. Fig.14 is a schematic diagram of a training device for a portrait generation model according to Example 7 of the present application, such as Fig.14 As shown, the device includes: an acquisition module 1402, an extraction module 1404, a screening module 1406, and a training module 1408.
[0167] Among them, the acquisition module 1402 is used to obtain historical instance data of multiple elastic container instances; the extraction module 1404 is used to extract features from the historical instance data to obtain historical instance features of multiple elastic container instances, wherein the historical instance features are synchronized to the online feature library; the screening module 1406 is used to screen out online training samples from the historical instance features based on a preset number of feature categories; the training module 1408 is used to train the initial online model based on the online training samples to obtain an online portrait generation model, wherein the online portrait generation model is used to generate an online portrait result of the elastic container instance based on the instance features corresponding to the elastic container instance, and return the online portrait result to the scheduling platform.
[0168] It should be noted here that the above-mentioned acquisition module 1402, extraction module 1404, screening module 1406, and training module 1408 correspond to steps S1002 to S1008 in Example 3, and the instances and application scenarios implemented by the modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 3.
[0169] Example 8
[0170] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.
[0171] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0172] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the portrait generation method of the elastic container instance: receiving a portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request generation of a portrait of the elastic container instance; based on the portrait generation request, obtaining instance features corresponding to the elastic container instance; calling the online portrait generation model to generate a portrait of the elastic container instance based on the instance features; and when the online portrait generation model successfully generates an online portrait result of the elastic container instance, returning the online portrait result to the scheduling platform.
[0173] Optionally, Fig.15 is a structural block diagram of a computer terminal according to an embodiment of the present application. Fig.15 As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 1502, a memory 1504, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.
[0174] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image generation method and device of the elastic container instance in the embodiment of the present application. The processor uses the software programs and modules stored in the memory by example to perform various functional applications and data processing, that is, to implement the image generation method of the elastic container instance mentioned above. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0175] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: receive a portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request generation of a portrait of the elastic container instance; based on the portrait generation request, obtain instance features corresponding to the elastic container instance; call the online portrait generation model to generate a portrait of the elastic container instance based on the instance features; and when the online portrait generation model successfully generates an online portrait result of the elastic container instance, return the online portrait result to the scheduling platform.
[0176] Optionally, the processor may also execute program code of the following steps: obtaining a model configuration file corresponding to the online portrait generation model; and obtaining instance features from the portrait generation request based on the model configuration file.
[0177] Optionally, the processor may also execute the program code of the following steps: determining whether the portrait generation request contains instance features based on the model configuration file; obtaining the instance features from the portrait generation request if the portrait generation request contains instance features; and obtaining the remaining features of the instance features except the partial features from the online feature library if the portrait generation request contains some features of the instance features.
[0178] Optionally, the processor may also execute program code of the following steps: obtaining historical instance data of multiple elastic container instances; performing feature extraction on the historical instance data to obtain historical instance features of multiple elastic container instances, wherein the historical instance features are synchronized to an online feature library; based on a preset number of feature categories, selecting online training samples from the historical instance features; and training an initial online model based on the online training samples to obtain an online portrait generation model.
[0179] Optionally, the processor may also execute the program code of the following steps: determining the feature importance of historical instance features, wherein the feature importance is used to characterize the number of times the initial online model uses historical instance features as branch features; determining screening indicators for historical instance features based on feature importance and a preset number of feature categories; and screening out online training samples from history based on the screening indicators.
[0180] Optionally, the processor may also execute the program code of the following steps: when the online portrait generation model fails to successfully generate an online portrait result of the elastic container instance, obtaining an offline portrait result of the elastic container instance from a portrait result database, wherein the portrait result database is used to store portrait results generated by the offline portrait generation model based on historical instance features of multiple elastic container instances; and returning the offline portrait result to the scheduling platform.
[0181] Optionally, the processor may also execute program code of the following steps: obtaining periodic instance data of multiple elastic container instances according to a preset period; performing feature extraction on the periodic instance data to obtain periodic instance features of multiple elastic container instances; screening out target instance features from the periodic instance features based on feature importance of the periodic instance features, wherein the feature importance is used to characterize the number of times the initial online model uses historical instance features as branch features; calling an offline portrait generation model to generate portraits of multiple elastic container instances based on the target instance features to obtain periodic portrait results of the multiple elastic container instances; and storing the periodic portrait results in a portrait result database.
[0182] Optionally, the processor may also execute the program code of the following steps: obtaining the portrait results of multiple elastic container instances already stored in the portrait result database; when the portrait results of multiple elastic container instances are inconsistent with the periodic portrait results, deleting the portrait results of multiple elastic container instances from the portrait result database, and storing the periodic portrait results in the portrait result database; when the portrait results of multiple elastic container instances are consistent with the periodic portrait results, prohibiting the storage of the periodic portrait results.
[0183] Optionally, the processor may also execute program code of the following steps: obtaining historical instance data of multiple elastic container instances; performing feature extraction on the historical instance data to obtain historical instance features of multiple elastic container instances; screening offline training samples from the historical instance features based on feature importance of the historical instance features; and training the initial offline model based on the offline training samples to obtain an offline portrait generation model.
[0184] In an embodiment of the present application, a portrait generation request is received from a scheduling platform, wherein the portrait generation request is used to request generation of a portrait of an elastic container instance; based on the portrait generation request, instance features corresponding to the elastic container instance are obtained; an online portrait generation model is called to generate a portrait of the elastic container instance based on the instance features; when the online portrait generation model successfully generates an online portrait result of the elastic container instance, the online portrait result is returned to the scheduling platform. It is easy to notice that, based on the portrait generation request, the instance features corresponding to the elastic container instance can be obtained, and the online portrait generation model is called to generate a portrait of the elastic container instance based on the instance features, that is, for portraits of different elastic container instances, elastic container instances with different performances are selected for scheduling, so that the portrait of the elastic container instance can be accurately judged, thereby solving the technical problem of being unable to accurately judge the portrait of the elastic container instance.
[0185] Those skilled in the art will appreciate that the structure shown in the figure is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Fig.15 It does not limit the structure of the above electronic device. For example, the computer terminal A may also include Fig.15 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.15 Different configurations shown.
[0186] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0187] Example 9
[0188] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed for generating the image of the elastic container instance provided in the first embodiment.
[0189] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0190] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving a portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request generation of a portrait of the elastic container instance; based on the portrait generation request, obtaining instance features corresponding to the elastic container instance; calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features; and when the online portrait generation model successfully generates an online portrait result of the elastic container instance, returning the online portrait result to the scheduling platform.
[0191] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0192] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0193] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0194] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0195] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0196] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0197] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a portrait of an elastic container instance, characterized in that: include: Receiving a portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request generation of a portrait of an elastic container instance; Based on the portrait generation request, obtaining instance features corresponding to the elastic container instance; Calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features; When the online portrait generation model successfully generates the online portrait result of the elastic container instance, the online portrait result is returned to the scheduling platform.
2. The method according to claim 1, characterized in that Obtaining instance features corresponding to the elastic container instance, including: Obtain a model configuration file corresponding to the online portrait generation model; The instance features are obtained from the portrait generation request based on the model configuration file.
3. The method according to claim 2, characterized in that Acquiring the instance feature from the portrait generation request based on the model configuration file includes: Determining whether the portrait generation request includes the instance feature based on the model configuration file; In a case where the portrait generation request includes the instance feature, obtaining the instance feature from the portrait generation request; In the case that the portrait generation request includes some features of the instance features, the remaining features of the instance features except the some features are acquired from the online feature library.
4. The method according to claim 1, characterized in that: The method further comprises: Get historical instance data for multiple elastic container instances; Performing feature extraction on the historical instance data to obtain historical instance features of the multiple elastic container instances, wherein the historical instance features are synchronized to an online feature library; Based on a preset number of feature categories, selecting online training samples from the historical instance features; The initial online model is trained based on the online training samples to obtain the online portrait generation model.
5. The method according to claim 4, characterized in that Based on the preset number of feature categories, online training samples are selected from the historical instance features, including: Determining the feature importance of the historical instance feature, wherein the feature importance is used to characterize the number of times the initial online model uses the historical instance feature as a branch feature; Determining a screening index for the historical instance feature based on the feature importance and the number of preset feature categories; The online training samples are screened out from the history based on the screening index.
6. The method according to claim 4, characterized in that The historical instance data includes at least one of the following: request data of the elastic container instance, user data corresponding to the elastic container instance, and label data of the elastic container instance.
7. The method according to claim 1, characterized in that In the case that the online portrait generation model fails to successfully generate an online portrait result of the elastic container instance, the method further includes: Obtaining an offline portrait result of the elastic container instance from a portrait result database, wherein the portrait result database is used to store portrait results generated by using an offline portrait generation model based on historical instance features of multiple elastic container instances; The offline portrait result is returned to the scheduling platform.
8. The method according to claim 7, characterized in that The method further comprises: Obtain periodic instance data of multiple elastic container instances according to a preset period; Performing feature extraction on the periodic instance data to obtain periodic instance features of the multiple elastic container instances; Based on the feature importance of the periodic instance features, a target instance feature is selected from the periodic instance features, wherein the feature importance is used to characterize the number of times the initial online model uses the historical instance feature as a branch feature; Calling the offline portrait generation model to generate portraits of the multiple elastic container instances based on the target instance features, and obtaining periodic portrait results of the multiple elastic container instances; The periodic portrait results are stored in the portrait result database.
9. The method according to claim 8, characterized in that Storing the periodic portrait results in the portrait result database includes: Obtaining the portrait results of the plurality of elastic container instances stored in the portrait result database; When the portrait results of the multiple elastic container instances are inconsistent with the periodic portrait results, deleting the portrait results of the multiple elastic container instances from the portrait result database, and storing the periodic portrait results in the portrait result database; When the portrait results of the multiple elastic container instances are consistent with the periodic portrait result, storing the periodic portrait result is prohibited.
10. The method according to claim 7, characterized in that The method further comprises: Get historical instance data for multiple elastic container instances; Performing feature extraction on the historical instance data to obtain historical instance features of the multiple elastic container instances; Based on the feature importance of the historical instance features, selecting offline training samples from the historical instance features; The initial offline model is trained based on the offline training samples to obtain the offline portrait generation model.
11. A method for scheduling an elastic container instance, characterized in that: include: Get the instance characteristics corresponding to the elastic container instance; Calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features; When the online portrait generation model successfully generates an online portrait result of the elastic container instance, the elastic container instance is scheduled based on the online portrait result.
12. A method for training a portrait generation model, characterized in that: include: Get historical instance data for multiple elastic container instances; Performing feature extraction on the historical instance data to obtain historical instance features of the multiple elastic container instances, wherein the historical instance features are synchronized to an online feature library; Based on a preset number of feature categories, selecting online training samples from the historical instance features; The initial online model is trained based on the online training samples to obtain an online portrait generation model, wherein the online portrait generation model is used to generate an online portrait result of the elastic container instance based on the instance features corresponding to the elastic container instance, and return the online portrait result to the scheduling platform.
13. A system for generating an image of an elastic container instance, characterized in that: include: A portrait generation device, connected to the scheduling platform, for receiving a portrait generation request sent by the scheduling platform, wherein the portrait generation request is used to request generation of a portrait of an elastic container instance; an algorithm platform, connected to the portrait generation device, for obtaining instance features corresponding to the elastic container instance based on the portrait generation request, and calling an online portrait generation model to generate a portrait of the elastic container instance based on the instance features, wherein the online portrait generation model is deployed on the algorithm platform; The portrait generation device is also used for returning the online portrait result to the scheduling platform when the online portrait generation model successfully generates the online portrait result of the elastic container instance.
14. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to instantiate the program, wherein the program instantiation executes the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is instantiated, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 12.