Service instance creation method and device, electronic equipment and storage medium
By creating service instances on the cloud server side and using node status scoring to filter cloud server nodes, the problems of high resource consumption and repetitive configuration in traditional integrated development environments are solved, thus achieving efficient software development environment setup and resource utilization.
Patent Information
- Application Number
- CN202511048700.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
Traditional integrated development environments rely on local storage and computing resources, resulting in high resource consumption, cumbersome installation and configuration, and the need for repeated installation and configuration when changing development equipment.
By responding to user requests on the cloud server side, determining the status scores of historically scheduled stopped nodes and candidate schedulable nodes, filtering target schedulable nodes, downloading image files from the pre-built image repository and instantiating them to the target node, and allocating service resources to obtain the instance creation results.
It avoids the tedious work of setting up a development environment, frees up local computer resources, improves the overall resource utilization rate, simplifies the application development difficulty, and improves the efficiency of software development.
Smart Images

Figure CN120950180A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software development technology, and in particular to a service instance creation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Traditional integrated development environments (IDEs) rely heavily on local storage and computing resources, which presents several challenges for software development. First, their installation and configuration are cumbersome, requiring the setup of the development environment on the local machine and the installation of operating system-specific software packages. Second, these IDEs are often resource-intensive, consuming significant amounts of disk and memory. Furthermore, changing development equipment leads to the need for repeated installation and configuration. Summary of the Invention
[0003] This invention provides a service instance creation method, apparatus, electronic device, and storage medium to avoid cumbersome development environment setup, free up local computer resources, improve overall resource utilization, simplify application development, and increase software development efficiency.
[0004] According to one aspect of the present invention, a service instance creation method is provided, the method being applied to a cloud server, comprising:
[0005] In response to an instance creation request from the user, the node status scores of the historical scheduling filtering stopped nodes and each candidate schedulable node in the cloud server cluster are determined; each candidate schedulable node is obtained by traversing the cloud server cluster starting from the historical scheduling filtering stopped node.
[0006] Based on the node status scores of each candidate schedulable node, target schedulable nodes are selected from the cloud server cluster.
[0007] Download the target image file from the pre-built image repository and instantiate the target image file into the target schedulable node;
[0008] Allocate service resources in the target schedulable node to obtain the instance creation result, and send the instance creation result to the client in the form of a Uniform Resource Locator (URL).
[0009] According to another aspect of the present invention, a service instance creation apparatus is provided, which is integrated into a cloud server and includes:
[0010] The node status determination module is used to respond to an instance creation request from the user and determine the node status scores of historically scheduled nodes that have stopped and each candidate schedulable node in the cloud server cluster; each candidate schedulable node is obtained by traversing the cloud server cluster starting from the historically scheduled nodes that have stopped.
[0011] The node filtering module is used to filter out target schedulable nodes from the cloud server cluster based on the node status scores of each candidate schedulable node.
[0012] The image file instantiation module is used to download the target image file from the pre-built image repository and instantiate the target image file into the target schedulable node;
[0013] The result response module is used to allocate service resources in the target schedulable node to obtain the instance creation result, and send the instance creation result to the client in the form of a Uniform Resource Locator (URL).
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the service instance creation method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the service instance creation method according to any embodiment of the present invention.
[0019] The technical solution of this invention addresses the problem of traditional integrated development environments relying heavily on local storage and computing resources, leading to significant resource consumption and the need for repeated installation and configuration when changing development equipment. This avoids cumbersome development environment setup, frees up local computer resources, improves overall resource utilization, simplifies application development, and increases software development efficiency. It avoids the tedious work of setting up development environments, frees up local computer resources, improves overall resource utilization, simplifies application development, and increases software development efficiency.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1a This is a flowchart of a service instance creation method provided in Embodiment 1 of the present invention;
[0023] Figure 1b This embodiment provides a system architecture example diagram for implementing a service instance creation method;
[0024] Figure 1c This embodiment provides a schematic diagram illustrating the working principle of a system that enables a service instance creation method.
[0025] Figure 1d This is a schematic diagram of an instance allocation process provided in this embodiment;
[0026] Figure 2 This is a schematic diagram of the structure of a service instance creation device provided in Embodiment 2 of the present invention;
[0027] Figure 3 A schematic diagram of the structure of an electronic device that implements the service instance creation method of this invention. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0030] Example 1
[0031] Figure 1a This is a flowchart of a service instance creation method provided in Embodiment 1 of the present invention. This embodiment can be applied to the creation of service instances during software development. The method can be executed by a service instance creation device, which can be implemented in hardware and / or software and can be configured in a server on a cloud server side.
[0032] To enable those skilled in the art to better understand the technical solution of this embodiment, Figure 1bThis embodiment provides a system architecture example diagram for a service instance creation method. The system may include a user terminal, a cloud server terminal, and a target machine terminal. The user terminal is the user's hardware at the hardware layer, the user's operating system at the operating system layer, and a web browser at the application layer. The server terminal is the cloud infrastructure at the hardware layer, the cloud server operating system at the operating system layer, and multiple container instances and a multi-instance management platform for managing these container instances at the application layer. Complete software development tools are encapsulated using Docker container technology. Each container instance contains the basic framework (WebIDE framework), development tool plugins, and backend service programs required for the cloud development environment. These are rapidly deployed to the cloud as container instances and are the primary objects managed by the cloud platform. The basic framework can use Code Server, the development tool plugins can be developed using TypeScript and can be shared and distributed as compressed packages, and the backend service programs may include the GCC compiler and GDB debugger used for cross-compilation and debugging.
[0033] based on Figure 1b The system shown, Figure 1c This embodiment provides a schematic diagram illustrating the working principle of a system for creating service instances. The system mainly comprises three modules: image management, status monitoring, and instance scheduling. The image management module stores and distributes Docker images based on the Harbor open-source repository and deploys a highly available private image repository cluster to achieve data synchronization between multiple nodes. The status monitoring module uses the Prometheus monitoring framework in conjunction with the NodeExporter agent to collect and store cluster monitoring data long-term. The instance scheduling module focuses on the allocation of cloud resources and is a core functional module used by cloud server users. It manages container instance resources in the cloud server cluster, and the solution is implemented as a Kubernetes scheduler plugin. The image management module interacts with the image repository, supporting image querying, uploading, downloading, and deleting. When deploying services, images can be directly pulled from the private repository without needing to be pulled from the internet, thereby reducing service deployment response time and improving confidentiality. An asynchronous data synchronization mechanism is provided between private image repositories; images can be uploaded to any node and automatically distributed after upload, ensuring rapid deployment capabilities. The status monitoring module is responsible for managing the metadata information of registered physical nodes in the platform, monitoring the load status information of nodes and instances, etc. All this information will serve as the data source for the instance scheduling algorithm. Specifically, when a user initiates a request to use a cloud service (such as an instance creation request), the instance scheduling module uses the algorithm to select a node, maintains the mapping relationship between the target node and the instance, then allocates resources and deploys the instance on the target node, and finally returns the service URL to the user.
[0034] Support for load monitoring of application instances and physical nodes in the development environment: This ensures the correct operation of container instances and clusters and guarantees the quality of service for users. The platform needs to provide real-time monitoring capabilities for the status of container instances and the load of physical hosts, which is also the source of data for dynamic scheduling of container instances.
[0035] Supports scheduling of application instances in the development environment: Users can create, start, close, and delete development environment instances through the platform to meet their software development needs without needing to worry about the underlying instance scheduling implementation. The management platform uses a scheduling algorithm to select the best node in the cluster based on node performance, resource usage, and other information to allocate instances to users, thereby simplifying the cloud-based software development process, allowing users to focus on application business requirements, and improving development efficiency.
[0036] Building a private image repository in the cloud can ensure rapid deployment capabilities and improve the quality of cloud development services and application confidentiality.
[0037] like Figure 1a As shown, the service instance creation method in this embodiment includes:
[0038] S110. In response to an instance creation request from the user, determine the node status scores of the historical scheduling screening stopped nodes and each candidate schedulable node in the cloud server cluster; each candidate schedulable node is obtained by traversing the cloud server cluster starting from the historical scheduling screening stopped node.
[0039] The instance creation request can be a request sent to the cloud server generated by a user selecting an instance creation button through their browser. An instance refers to an independently running service unit, which is the basic unit of resource scheduling and management. A cloud server cluster can include multiple server nodes registered on a multi-instance management platform. The historical scheduling filter stop node refers to the stop position of the cloud server's filtering of nodes in the cloud server cluster during historical node scheduling. Candidate schedulable nodes refer to nodes selected from the cloud server cluster that can be used for this instance creation. Node status score refers to the status evaluation result of each candidate schedulable node.
[0040] In one optional implementation, determining the historical scheduling filtering stop node in the cloud server cluster may include: obtaining a target variable; the target variable is used to record the server node that was stopped in the previous scheduling filtering; and determining the historical scheduling filtering stop node based on the value of the target variable.
[0041] Because a cloud server cluster contains a large number of servers, not all nodes will run instances in each scheduling process. Therefore, to ensure that all nodes in the cloud server cluster have a fair chance to run instances, a variable (i.e., a target variable) can be maintained to record the position of the list of nodes that stopped during the previous scheduling process. This variable will serve as the starting position for the current node selection, allowing for a round-robin approach that covers all server nodes. This variable can be updated after each scheduling cycle.
[0042] The node scheduling algorithm in this embodiment can determine which node in the cloud server cluster to start filtering from in this scheduling based on the current value of the target variable, and finally determine the node to be used for the creation of this instance.
[0043] In one alternative implementation, each candidate schedulable node can be obtained by: obtaining the number of nodes in the cloud server cluster; calculating a quantity threshold for candidate schedulable nodes based on the number of nodes; starting from the historical scheduling and screening stopped nodes, traversing the cloud server cluster, and obtaining available nodes that meet the quantity threshold as candidate schedulable nodes.
[0044] In this embodiment, the cloud server cluster can be initially screened based on strategies such as port occupancy, resource availability, and mounted file volumes to obtain candidate schedulable nodes. However, for large-scale cloud server clusters, traversing the entire cluster is extremely costly because the scheduler applies the aforementioned node screening strategies to each node for layer-by-layer filtering, resulting in high scheduling latency. Therefore, this embodiment can avoid traversing the entire cluster and instead calculate a threshold based on the cluster size, stopping the search after finding enough candidate schedulable nodes. Optionally, the threshold calculation formula is as follows:
[0045]
[0046] Where n represents the number of nodes in the cloud server cluster, and f(n) represents the threshold number of candidate schedulable nodes.
[0047] It is understood that this embodiment can start with the historical scheduling and screening of stopped nodes, and perform preliminary screening of the cloud server cluster based on strategies such as whether the port is occupied, whether the resources meet the requirements, and whether the mounted file volume meets the requirements. After screening out the schedulable nodes that meet the quantity threshold, candidate schedulable nodes are obtained.
[0048] In one optional implementation, determining the node status score of each candidate schedulable node may include: obtaining real-time monitoring values of status indicators for each candidate schedulable node, including CPU load, memory load, disk I / O load, and network I / O load; calculating a status score for each status indicator based on the real-time monitoring values; calculating a node resource balancing score for each candidate schedulable node based on CPU load and memory load; and determining the average of the calculated status score and the node resource balancing score for each indicator as the node status score for each candidate schedulable node.
[0049] In this embodiment, the status indicators of each candidate schedulable node can be obtained through the aforementioned status monitoring module. In this embodiment, the scores for each status indicator can be set between 0 and 10. Therefore, the formula for calculating CPU load is cpuScore = 10 - cpuload * 10, the formula for calculating memory load is memScore = 10 - memload * 10, the formula for calculating disk I / O is diskScore = 10 - diskIO * 10, and the formula for calculating network I / O is netScore = 10 - netIO * 10. The node resource balancing score B_Score can be determined by the absolute value of the difference between CPU load and memory load. The node status score of each candidate schedulable node can be determined by the following formula.
[0050] S120. Based on the node status scores of each candidate schedulable node, select the target schedulable node from the cloud server cluster.
[0051] Optionally, the candidate schedulable node with the highest node status score can be selected as the target schedulable node.
[0052] For example, candidate schedulable nodes can be sorted according to node status scores. If the number of candidate schedulable nodes with the highest scores is 1, it can be determined as the target schedulable node. If the number is not 1, a node can be randomly selected as the target schedulable node.
[0053] S130. Download the target image file from the pre-built image repository and instantiate the target image file to the target schedulable node.
[0054] The pre-built image repository can be a distributed image repository. The image file can be a file containing a complete system environment and pre-configured data, used to provide a standardized template for cloud servers.
[0055] S140. Allocate service resources in the target schedulable node to obtain the instance creation result, and send the instance creation result to the client in the form of a Uniform Resource Locator (URL).
[0056] In one alternative implementation, allocating service resources in the target schedulable node to obtain the instance creation result may include: creating a working directory and copying configuration files in the target schedulable node; creating a service runtime container in the target schedulable node and mounting a user-space file volume to obtain the instance creation result.
[0057] In this embodiment, allocating service resources to the target schedulable node may include creating a working directory, copying configuration files, creating a POD, and mounting development resource file volumes.
[0058] To enable those skilled in the art to better understand the service instance creation method of this embodiment, Figure 1d This is a schematic diagram of an instance allocation process provided in this embodiment.
[0059] The client initiates an instance creation request to the cloud server; the cloud server calls the instance creation business logic to the instance service through the instance service processor; the instance service obtains the target node (i.e., the target schedulable node) through the instance scheduler's node pre-selection (i.e., the operation of filtering candidate schedulable nodes) and node optimization (i.e., the operation of filtering the target schedulable node from the candidate schedulable nodes); the instance service obtains the Kubernetes client through the cluster operation interface to bind the instance to the target schedulable node; the instance service creates a user workspace through the workspace service; the instance service creates a POD, mounts the user space file volume or embedded software development resource file volume, and creates a service resource object to proxy the POD (equivalent to assigning an IP or URL to the instance for external services); it returns the service URL to the instance service processor and returns an HTTP (Hypertext Transfer Protocol) response to the client.
[0060] The technical solution of this invention addresses the problem of traditional integrated development environments relying heavily on local storage and computing resources, leading to significant resource consumption and the need for repeated installation and configuration when changing development equipment. This avoids cumbersome development environment setup, frees up local computer resources, improves overall resource utilization, simplifies application development, and increases software development efficiency. It avoids the tedious work of setting up development environments, frees up local computer resources, improves overall resource utilization, simplifies application development, and increases software development efficiency.
[0061] Example 2
[0062] Figure 2 This is a schematic diagram of a service instance creation device provided in Embodiment 2 of the present invention. This device can be integrated into a cloud server, such as... Figure 2 As shown, the device includes: a node status determination module 210, a node filtering module 220, an image file instantiation module 230, and a result response module 240. Wherein:
[0063] The node status determination module 210 is used to respond to an instance creation request from the user terminal and determine the node status scores of the historically scheduled filtering stopped nodes and each candidate schedulable node in the cloud server cluster; the candidate schedulable nodes are obtained by traversing the cloud server cluster starting from the historically scheduled filtering stopped nodes.
[0064] The node filtering module 220 is used to filter out target schedulable nodes from the cloud server cluster based on the node status scores of each candidate schedulable node.
[0065] The image file instantiation module 230 is used to download the target image file from the pre-built image repository and instantiate the target image file to the target schedulable node;
[0066] The result response module 240 is used to allocate service resources in the target schedulable node to obtain the instance creation result, and send the instance creation result to the client in the form of a Uniform Resource Locator (URL).
[0067] The technical solution of this invention addresses the problem of traditional integrated development environments relying heavily on local storage and computing resources, leading to significant resource consumption and the need for repeated installation and configuration when changing development equipment. This avoids cumbersome development environment setup, frees up local computer resources, improves overall resource utilization, simplifies application development, and increases software development efficiency. It avoids the tedious work of setting up development environments, frees up local computer resources, improves overall resource utilization, simplifies application development, and increases software development efficiency.
[0068] Optionally, the node status determination module 210 may include a historical scheduling filtering and stopping node determination unit, used for:
[0069] Obtain the target variable; the target variable is used to record the server nodes that were stopped in the previous scheduling and filtering process.
[0070] The historical scheduling filter stop node is determined based on the value of the target variable.
[0071] Optionally, the node status determination module 210 may include a candidate schedulable node acquisition unit, used for:
[0072] Obtain the number of nodes in the cloud server cluster;
[0073] The number of candidate schedulable nodes is calculated based on the number of nodes mentioned above;
[0074] Starting from the historical scheduling and screening stopped nodes, the cloud server cluster is traversed to obtain available nodes that meet the quantity threshold as candidate schedulable nodes.
[0075] Optionally, the node status determination module 210 may include a node status scoring unit, used for:
[0076] Obtain real-time monitoring values of the status indicators of each candidate schedulable node, including CPU load, memory load, disk I / O load, and network I / O load.
[0077] A status score is calculated for each status indicator based on its real-time monitoring value.
[0078] Calculate a node resource balance score for each candidate schedulable node based on the CPU load and the memory load.
[0079] The average of the calculated status score for each indicator and the node resource balance score is used to determine the node status score for each candidate schedulable node.
[0080] Optional, the node filtering module 220 can be used for:
[0081] The candidate schedulable node with the highest node status score is determined as the target schedulable node.
[0082] Optional, the result response module 240 can be used for:
[0083] Create a working directory and copy the configuration file in the target schedulable node;
[0084] Create a service runtime container in the target schedulable node and mount a user-space file volume to obtain the instance creation result.
[0085] Optionally, the pre-built image repository is a distributed image repository.
[0086] The service instance creation device integrated into the cloud server provided in this embodiment of the invention can execute the service instance creation method applied to the cloud server provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0087] Example 3
[0088] Figure 3 A schematic diagram of an electronic device 300 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers or various forms of mobile devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0089] like Figure 3As shown, the electronic device 300 includes at least one processor 301 and a memory, such as a read-only memory (ROM) 302 or a random access memory (RAM) 303, communicatively connected to the at least one processor 301. The memory stores computer programs executable by the at least one processor. The processor 301 can perform various appropriate actions and processes based on the computer program stored in the ROM 302 or loaded into the RAM 303 from storage unit 308. The RAM 303 can also store various programs and data required for the operation of the electronic device 300. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0090] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0091] Processor 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 301 performs the various methods and processes described above, such as the service instance creation method.
[0092] In some embodiments, the service instance creation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by processor 301, one or more steps of the service instance creation method described above may be performed. Alternatively, in other embodiments, processor 301 may be configured to perform the service instance creation method by any other suitable means (e.g., by means of firmware).
[0093] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0094] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0095] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0096] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0097] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0098] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0099] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0100] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A service instance creation method, applied to a cloud server, characterized in that, include: In response to an instance creation request from the user, determine the node status score of the historically scheduled stopped nodes and each candidate schedulable node in the cloud server cluster; Each candidate schedulable node is obtained by traversing the cloud server cluster starting from the historical scheduling screening stop node. Based on the node status scores of each candidate schedulable node, target schedulable nodes are selected from the cloud server cluster. Download the target image file from the pre-built image repository and instantiate the target image file into the target schedulable node; Allocate service resources in the target schedulable node to obtain the instance creation result, and send the instance creation result to the client in the form of a Uniform Resource Locator (URL).
2. The method according to claim 1, characterized in that, Identify historically scheduled, stopped nodes in the cloud server cluster, including: Obtain the target variable; the target variable is used to record the server nodes that were stopped in the previous scheduling and filtering process. The historical scheduling filter stop node is determined based on the value of the target variable.
3. The method according to claim 1, characterized in that, Each candidate schedulable node is obtained through the following method: Obtain the number of nodes in the cloud server cluster; The number of candidate schedulable nodes is calculated based on the number of nodes mentioned above; Starting from the historical scheduling and screening stopped nodes, the cloud server cluster is traversed to obtain available nodes that meet the quantity threshold as candidate schedulable nodes.
4. The method according to claim 1, characterized in that, Determine the node state score for each candidate schedulable node, including: Obtain real-time monitoring values of the status indicators of each candidate schedulable node, including CPU load, memory load, disk I / O load, and network I / O load. A status score is calculated for each status indicator based on its real-time monitoring value. Calculate a node resource balance score for each candidate schedulable node based on the CPU load and the memory load. The average of the calculated status score for each indicator and the node resource balance score is used to determine the node status score for each candidate schedulable node.
5. The method according to claim 1, characterized in that, Based on the node status scores of each candidate schedulable node, target schedulable nodes are selected from the cloud server cluster, including: The candidate schedulable node with the highest node status score is determined as the target schedulable node.
6. The method according to claim 1, characterized in that, Allocating service resources in the target schedulable node to obtain instance creation results includes: Create a working directory and copy the configuration file in the target schedulable node; Create a service runtime container in the target schedulable node and mount a user-space file volume to obtain the instance creation result.
7. The method according to claim 1, characterized in that, The pre-built image repository is a distributed image repository.
8. A service instance creation device, integrated into a cloud server, characterized in that, include: The node status determination module is used to respond to an instance creation request from the user and determine the node status scores of historically scheduled nodes that have stopped and each candidate schedulable node in the cloud server cluster; each candidate schedulable node is obtained by traversing the cloud server cluster starting from the historically scheduled nodes that have stopped. The node filtering module is used to filter out target schedulable nodes from the cloud server cluster based on the node status scores of each candidate schedulable node. The image file instantiation module is used to download the target image file from the pre-built image repository and instantiate the target image file into the target schedulable node; The result response module is used to allocate service resources in the target schedulable node to obtain the instance creation result, and send the instance creation result to the client in the form of a Uniform Resource Locator (URL).
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the service instance creation method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the service instance creation method according to any one of claims 1-7.