Instance resource scheduling method and device, electronic equipment and storage medium

By computing the resource use feature vectors of the instance and determining the corresponding resource scheduling strategy, the problem of resource competition among multiple instances in cloud computing on the same node is solved, and the performance of application services is improved.

CN120104309APending Publication Date: 2025-06-06DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510071816.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In the field of cloud computing, multiple instances are in resource competition on the same node for a long time, resulting in a degradation in the performance of application services.

Method used

By obtaining the resource usage of the instance of the service application within the set historical time range, calculating its resource usage feature vector, and determining the resource scheduling strategy based on the vector similarity to avoid resource competition in the instance on the same node.

Benefits of technology

It effectively avoids resource competition among instances, improves the performance of application services, and ensures reasonable allocation of resources and load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104309A_ABST
    Figure CN120104309A_ABST
Patent Text Reader

Abstract

The invention provides an instance resource scheduling method and device, electronic equipment and a storage medium, and relates to the technical field of resource management. In the application, the first feature vector can represent the resource utilization rate of the first instance in the plurality of time periods within the set historical time range, and the second feature vector represents the resource utilization rate of the second instance in the plurality of time periods. Therefore, the vector similarity between the first feature vector and the second feature vector can reflect the resource use coincidence degree of the first instance and the second instance. Therefore, in combination with the preset similarity threshold, whether the first instance and the second instance use the resources at the same time for a long time can be determined. Once it is determined that the first instance and the second instance use the resources at the same time for a long time, the resources on the same resource node are not scheduled to the first instance and the second instance, so that the situation of resource competition or contention between the first instance and the second instance is avoided, and the performance of an application service is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of resource management technology, and in particular to an example resource scheduling method, device, electronic device and storage medium. Background Art

[0002] In the field of cloud computing, one or more instances of application services run on nodes in a resource node cluster. In order to ensure that each instance can obtain sufficient resources to ensure normal operation and to balance the instance resource requirements of each node, resource scheduling for instances usually focuses on resource allocation and load balancing.

[0003] However, with the above resource scheduling method, multiple instances on a node may use more resources of the node simultaneously for a long time, resulting in resource competition (or contention), which in turn leads to a degradation in the performance of the application service.

[0004] In view of this, it is an urgent problem to schedule resources for instances more reasonably to avoid multiple instances competing for resources on the same node for a long time. Summary of the invention

[0005] The embodiments of the present application provide a resource scheduling method, device, electronic device and storage medium for an instance, which are used to more reasonably schedule resources for the instance to avoid a situation where multiple instances are in resource competition on the same node for a long time, thereby improving the performance of the application service.

[0006] In a first aspect, an embodiment of the present application provides a resource scheduling method of an example, the method comprising:

[0007] Obtain resource usage of a first instance and a second instance of a service application within a set historical time range;

[0008] Obtaining a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance based on the resource usage; wherein the first feature vector represents the resource usage rate of the first instance in multiple time periods within a set historical time range, and the second feature vector represents the resource usage rate of the second instance in multiple time periods;

[0009] Determine a resource scheduling strategy for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold; the resource scheduling strategy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance;

[0010] Based on the resource scheduling policy, resources are scheduled for the first instance and the second instance.

[0011] In an optional embodiment, obtaining a first feature vector of a first instance and a second feature vector of a second instance based on resource usage includes:

[0012] From the resource usage, obtain first resource usage rates corresponding to the first instance in multiple time periods, and second resource usage rates corresponding to the second instance in multiple time periods;

[0013] Obtaining an initial feature vector of a first instance based on a plurality of first resource usage rates, and obtaining an initial feature vector of a second instance based on a plurality of second resource usage rates;

[0014] The initial feature vector of the first instance and the initial feature vector of the second instance are respectively subjected to standardization processing and normalization processing in sequence to obtain a first feature vector and a second feature vector.

[0015] In an optional embodiment, determining a resource scheduling strategy for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold includes:

[0016] Perform binary processing on the first eigenvector and the second eigenvector respectively to obtain two binary vectors;

[0017] The element overlap of the first vector elements in the two binary vectors is used as the vector similarity; wherein each first vector element represents that the corresponding time period is the resource usage peak period of the corresponding instance;

[0018] If the vector similarity is less than the similarity threshold, determining the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node;

[0019] If the vector similarity is greater than or equal to the similarity threshold, then the resource scheduling strategy is determined to schedule resources for the first instance and the second instance on different resource nodes.

[0020] In an optional embodiment, the element overlap of the first vector elements in two binary vectors is used as the vector similarity, including:

[0021] Perform multiplication operation on the vector elements at the same position in two binary vectors to obtain a result vector;

[0022] Obtaining element coincidence based on the number of first vector elements corresponding to the two binary vectors and the result vector respectively;

[0023] The element overlap is regarded as the vector similarity.

[0024] In an optional embodiment, determining a resource scheduling strategy for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold includes:

[0025] The distance measurement result between the first eigenvector and the second eigenvector is used as the vector similarity;

[0026] If the vector similarity is less than the similarity threshold, determining the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node;

[0027] If the vector similarity is greater than or equal to the similarity threshold, then the resource scheduling strategy is determined to schedule resources for the first instance and the second instance on different resource nodes.

[0028] In an optional embodiment, performing resource scheduling on the first instance and the second instance based on the resource scheduling policy includes:

[0029] If the resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes, the first resource node and the second resource node are selected from a preset resource node set;

[0030] Among them, the resources on the first resource node are not allocated to the instance whose vector similarity with the first feature vector is less than the similarity threshold, and the resources on the second resource node are not allocated to the instance whose vector similarity with the second feature vector is less than the similarity threshold.

[0031] In an optional embodiment, performing resource scheduling on the first instance and the second instance based on the resource scheduling policy includes:

[0032] If the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node, a third resource node is selected from the preset resource node set;

[0033] The resources on the third resource node are not allocated to instances whose vector similarity with the first feature vector is less than a similarity threshold and instances whose vector similarity with the second feature vector is less than a similarity threshold.

[0034] In a second aspect, an embodiment of the present application further provides a resource scheduling device of an example, the device comprising:

[0035] A data acquisition module, used to acquire resource usage of a first instance and a second instance of a service application within a set historical time range;

[0036] A feature extraction module, used to obtain a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance based on resource usage; wherein the first feature vector represents the resource usage rate of the first instance in multiple time periods within a set historical time range, and the second feature vector represents the resource usage rate of the second instance in multiple time periods;

[0037] A policy determination module, used to determine the resource scheduling policy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold; the resource scheduling policy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance;

[0038] The resource scheduling module is used to schedule resources for the first instance and the second instance based on the resource scheduling policy.

[0039] In an optional embodiment, when obtaining the first feature vector of the first instance and the second feature vector of the second instance based on the resource usage, the feature extraction module is specifically used to:

[0040] From the resource usage, obtain first resource usage rates corresponding to the first instance in multiple time periods, and second resource usage rates corresponding to the second instance in multiple time periods;

[0041] Obtaining an initial feature vector of a first instance based on a plurality of first resource usage rates, and obtaining an initial feature vector of a second instance based on a plurality of second resource usage rates;

[0042] The initial feature vector of the first instance and the initial feature vector of the second instance are respectively subjected to standardization processing and normalization processing in sequence to obtain a first feature vector and a second feature vector.

[0043] In an optional embodiment, when determining the resource scheduling strategy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold, the strategy determination module is specifically used to:

[0044] Perform binary processing on the first eigenvector and the second eigenvector respectively to obtain two binary vectors;

[0045] The element overlap of the first vector elements in the two binary vectors is used as the vector similarity; wherein each first vector element represents that the corresponding time period is the resource usage peak period of the corresponding instance;

[0046] If the vector similarity is less than the similarity threshold, determining the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node;

[0047] If the vector similarity is greater than or equal to the similarity threshold, then the resource scheduling strategy is determined to schedule resources for the first instance and the second instance on different resource nodes.

[0048] In an optional embodiment, when the element overlap of the first vector elements in two binary vectors is used as the vector similarity, the strategy determination module is specifically used to:

[0049] Perform multiplication operation on the vector elements at the same position in two binary vectors to obtain a result vector;

[0050] Obtaining element coincidence based on the number of first vector elements corresponding to the two binary vectors and the result vector respectively;

[0051] The element overlap is regarded as the vector similarity.

[0052] In an optional embodiment, when determining the resource scheduling strategy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold, the strategy determination module is specifically used to:

[0053] The distance measurement result between the first eigenvector and the second eigenvector is used as the vector similarity;

[0054] If the vector similarity is less than the similarity threshold, determining the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node;

[0055] If the vector similarity is greater than or equal to the similarity threshold, then the resource scheduling strategy is determined to schedule resources for the first instance and the second instance on different resource nodes.

[0056] In an optional embodiment, when performing resource scheduling on the first instance and the second instance based on the resource scheduling policy, the resource scheduling module is specifically used to:

[0057] If the resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes, the first resource node and the second resource node are selected from a preset resource node set;

[0058] Among them, the resources on the first resource node are not allocated to the instance whose vector similarity with the first feature vector is less than the similarity threshold, and the resources on the second resource node are not allocated to the instance whose vector similarity with the second feature vector is less than the similarity threshold.

[0059] In an optional embodiment, when performing resource scheduling on the first instance and the second instance based on the resource scheduling policy, the resource scheduling module is specifically used to:

[0060] If the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node, a third resource node is selected from the preset resource node set;

[0061] The resources on the third resource node are not allocated to instances whose vector similarity with the first feature vector is less than a similarity threshold and instances whose vector similarity with the second feature vector is less than a similarity threshold.

[0062] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0063] Processor; and

[0064] Memory for storing programs,

[0065] The program includes instructions, which, when executed by a processor, cause the processor to execute the resource scheduling method of the example described in the first aspect.

[0066] In a fourth aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the resource scheduling method of the example described in the first aspect.

[0067] In a fifth aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the resource scheduling method of the example described in the first aspect.

[0068] The beneficial effects of this application are as follows:

[0069] In the resource scheduling method of the instance provided in the embodiment of the present application, the resource usage of the first instance and the second instance of the service application within a set historical time range is obtained; based on the resource usage, a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance are obtained; the first feature vector represents the resource usage rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource usage rate of the second instance in multiple time periods; based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold, the resource scheduling strategy of the first instance and the second instance is determined, wherein the resource scheduling strategy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance; based on the resource scheduling strategy, resources are scheduled for the first instance and the second instance.

[0070] Based on the above method, since the first feature vector can represent the resource utilization rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource utilization rate of the second instance in multiple time periods. Therefore, the vector similarity between the first feature vector and the second feature vector can reflect the degree of overlap in resource usage between the first instance and the second instance. In this way, combined with the preset similarity threshold, it can be determined whether the first instance and the second instance use resources at the same time for a long time. Once it is determined that the first instance and the second instance use resources at the same time for a long time (for example, the overlap during the peak period of resource usage is high), the resources on the same resource node will not be scheduled to the first instance and the second instance, thereby avoiding resource competition (or contention) between the first instance and the second instance, thereby improving the performance of the application service.

[0071] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described here are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0073] Figure 1 A schematic diagram of an optional system architecture applicable to the embodiments of the present application;

[0074] Figure 2 A schematic diagram of an implementation flow of a resource scheduling method provided as an example in an embodiment of the present application;

[0075] Figure 3 A schematic diagram of a scenario for obtaining a first eigenvector and a second eigenvector provided in an embodiment of the present application;

[0076] Figure 4 A logical schematic diagram for determining the overlap of resource usage peak periods provided in an embodiment of the present application;

[0077] Figure 5 A method based on the embodiment of the present application is provided Figure 2 Schematic diagram of the

[0078] Figure 6 A schematic diagram of the structure of a resource scheduling device according to an example provided in an embodiment of the present application;

[0079] Figure 7A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.

[0081] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.

[0082] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0083] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0084] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0085] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0086] (1) Instance: refers to a specific copy of a running application or service.

[0087] (2) Resource allocation: refers to the rational distribution of computing resources (such as central processing unit (CPU), memory, storage and network bandwidth) to different applications or service instances.

[0088] (3) Load balancing: used to evenly distribute workloads across multiple computing resources to achieve optimal resource utilization efficiency and service quality.

[0089] (4) Resource usage peak period: The period of time during which the resource usage of a system or application service is significantly higher than the average resource usage within a set period of time (e.g., a day or a week).

[0090] Based on the above-mentioned nouns and related terminology explanations, the design concept of the embodiments of the present application is briefly introduced below:

[0091] In the related art, the resource scheduling method for instances focuses on resource allocation and load balancing, that is, ensuring that each instance can obtain sufficient resources to ensure normal operation, and ensuring that the instance resource requirements on resource nodes (such as physical servers) are balanced, thereby avoiding the problem of some resource nodes being overloaded while other resource nodes have idle resources.

[0092] It can be seen that the above-mentioned resource scheduling method for instances may cause resource competition or contention. In other words, it lacks consideration of the peak period of resource usage of the instance, resulting in resource contention and performance degradation. In addition, since the peak period of resource usage of the instance is not considered, it may cause poor performance of the resource node, thereby affecting the performance of the entire application service. In other words, the resource usage pattern between instances (such as the peak period of resource usage) is not fully considered.

[0093] Therefore, multiple instances with the same or similar resource usage peaks may be scheduled to run on the same resource node. This arrangement will lead to increased competition for resources among multiple instances at the same time, causing performance bottlenecks. When multiple high-demand instances request resources at the same time, the resources of a single resource node may not be sufficient to meet all demands, resulting in longer response times and reduced service quality. Moreover, due to the lack of an effective scheduling mechanism to identify and separate instances with overlapping resource usage peaks, existing resource scheduling methods usually cannot achieve optimal load distribution. As a result, some resource nodes may be overloaded due to carrying too many instances that are active during resource usage peaks, while other resource nodes may be underutilized most of the time due to less instance activity on them. Such unbalanced resource utilization not only wastes computing resources, but may also reduce the stability and reliability of the entire system.

[0094] In view of this, in order to solve or improve the above-mentioned problems, an embodiment of the present application proposes a resource scheduling method for an instance, which may specifically include: first, obtaining the resource usage of a first instance and a second instance of a service application within a set historical time range; secondly, obtaining a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance based on the resource usage; wherein the first feature vector represents the resource usage rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource usage rate of the second instance in multiple time periods; then, based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold, determining the resource scheduling strategy of the first instance and the second instance, wherein the resource scheduling strategy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance; finally, based on the resource scheduling strategy, performing resource scheduling on the first instance and the second instance.

[0095] Based on the above method, since the first feature vector can represent the resource utilization rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource utilization rate of the second instance in multiple time periods. Therefore, the vector similarity between the first feature vector and the second feature vector can reflect the degree of overlap in resource usage between the first instance and the second instance. In this way, combined with the preset similarity threshold, it can be determined whether the first instance and the second instance use resources at the same time for a long time. Once it is determined that the first instance and the second instance use resources at the same time for a long time (for example, the overlap during the peak period of resource usage is high), the resources on the same resource node will not be scheduled to the first instance and the second instance, thereby avoiding resource competition (or contention) between the first instance and the second instance, thereby improving the performance of the application service.

[0096] In particular, the preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments of the present application and the features in the embodiments may be combined with each other if there is no conflict.

[0097] See also Figure 1As shown, it is a schematic diagram of a system architecture applicable to an embodiment of the present application, and the system architecture may include: a terminal device (101a, 101b) and a server 102. The terminal device (101a, 101b) and the server 102 may exchange information through a communication network, wherein the communication mode adopted by the communication network may include: a wireless communication mode and a wired communication mode. Exemplarily, the terminal device (101a, 101b) may access the network through cellular mobile communication technology and communicate with the server 102. Wherein, the cellular mobile communication technology, for example, includes the fifth generation mobile communication (5th generation mobile networks, 5G) technology or the next generation mobile communication technology. Optionally, the terminal device (101a, 101b) may access the network through a short-range wireless communication mode and communicate with the server 102. Wherein, the short-range wireless communication mode, for example, includes wireless fidelity (wireless fidelity, Wi-Fi) technology.

[0098] The embodiment of the present application does not impose any restriction on the number of communication devices involved in the above system architecture. For example, the above system architecture may include more terminal devices, or fewer terminal devices, or other network devices. Figure 1 As shown, only the terminal devices (101a, 101b) and the server 102 are described as examples, and the above communication devices and their respective functions are briefly introduced below.

[0099] The terminal device (101a, 101b) is a device that can provide voice and / or data connectivity to users, and can be a device that supports wired and / or wireless connection.

[0100] Exemplarily, the terminal devices (101a, 101b) may include, but are not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in unmanned driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.

[0101] In addition, a related client may be installed on the terminal device (101a, 101b), and the client may be software, such as an application (APP), a browser, a short video software, etc., or a web page, a mini-program, etc.; it should be noted that the terminal device (101a, 101b) in the embodiment of the present application may enable the above-mentioned client related to the resource scheduling of the instance to send a resource scheduling request for one or more instances (such as the first instance and the second instance) corresponding to the application service to the server 102, so as to subsequently perform method steps such as resource scheduling for the aforementioned one or more instances.

[0102] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0103] It is worth mentioning that the server 102 in the embodiment of the present application can obtain the resource usage of the first instance and the second instance of the service application within a set historical time range; based on the resource usage, obtain the first feature vector corresponding to the first instance and the second feature vector corresponding to the second instance; wherein the first feature vector represents the resource usage rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource usage rate of the second instance in multiple time periods; based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold, determine the resource scheduling strategy of the first instance and the second instance; the resource scheduling strategy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance; based on the resource scheduling strategy, perform resource scheduling on the first instance and the second instance.

[0104] The following describes the resource scheduling method of the example provided by the exemplary embodiment of the present application in combination with the above-mentioned system architecture and with reference to the accompanying drawings. It should be noted that the above-mentioned system architecture is only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this respect.

[0105] See also Figure 2 As shown, it is a schematic diagram of an implementation process of a resource scheduling method provided in an embodiment of the present application. The execution subject takes a server as an example. The specific implementation process of the method is as follows:

[0106] S201: Obtain resource usage of a first instance and a second instance of a service application within a set historical time range.

[0107] The above service application can be an application program or a service, etc., and the specific type of the service application is not limited in the embodiment of the present application. Moreover, the first instance and the second instance can be different instances of the same application service, different instances of different application services, or the same instance of the same application service.

[0108] The resource usage within the above-mentioned set historical event range is also called historical resource usage. For example, the server can obtain the resource usage of the first instance and the second instance in the past hour, day, or week. The aforementioned resource usage may include the usage of resources such as CPU, memory, storage resources, and network bandwidth.

[0109] Exemplarily, when executing step S201, the server may collect resource usage of the first instance and the second instance within a set historical time range through the hypertext transfer protocol (HTTP). After collecting the resource usage, the server may store the collected data in a database.

[0110] Optionally, the data type of the resource usage status may be data in JS object notation (JSON) format. Of course, it may also be data in other formats, which is not limited in the embodiments of the present application.

[0111] S202: Obtain a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance based on resource usage.

[0112] The first feature vector may represent the resource usage of the first instance in multiple time periods within a set historical time range, and the second feature vector may represent the resource usage of the second instance in multiple time periods.

[0113] Take the above setting of the historical time range as 1 day, and the above multiple time periods as 1440 minutes within 1 day as an example. Then, the above first feature vector can represent the resource utilization rate corresponding to the first instance in 1440 minutes, and the above second feature vector can represent the resource utilization rate corresponding to the second instance in 1440 minutes. It can be seen that the above first feature vector and the above second feature vector are both 1440-dimensional vectors that can be used to represent the resource utilization rate of the instance within 1 day. In other words, the resource utilization data of each instance can be stored as a 1440-dimensional vector.

[0114] In an optional implementation, when the server obtains the first feature vector of the first instance and the second feature vector of the second instance based on resource usage, it can obtain the first resource usage rates of the first instance corresponding to the above-mentioned multiple time periods, and the second resource usage rates of the second instance corresponding to the above-mentioned multiple time periods from the resource usage; then, obtain the initial feature vector of the first instance based on the multiple first resource usage rates, and obtain the initial feature vector of the second instance based on the multiple second resource usage rates; finally, perform standardization and normalization on the initial feature vector of the first instance and the initial feature vector of the second instance, respectively, to obtain the first feature vector and the second feature vector.

[0115] In this way, by performing data normalization on the initial eigenvector of the first instance and the initial eigenvector of the second instance, the two initial eigenvectors after normalization have the characteristics of zero mean and unit variance (e.g., variance is 1), which helps to eliminate the deviation caused by different scales or magnitudes while maintaining the basic shape of the data distribution.

[0116] Furthermore, by performing data normalization on the two initial eigenvectors after the normalization process, not only can the multiple vector elements respectively included in the two initial eigenvectors after the normalization process be compressed into a fixed interval (i.e., (0, 1)), but also a smooth transition effect can be obtained. This normalized data processing is particularly suitable for situations where probability output is required or when the goal is to retain the relative size relationship while limiting the range of variables.

[0117] Exemplarily, after obtaining the initial feature vector of the first instance (e.g., the first initial vector of 1440 dimensions) and the initial feature vector of the second instance (e.g., the second initial vector of 1440 dimensions), the server can perform normalization processing on the vector elements included in the first initial vector and the second initial vector through a preset data normalization method, such as Z-score normalization, so as to obtain the standardized first initial vector and the standardized second initial vector.

[0118] Optionally, the above Z-score normalization formula can be specifically expressed as follows:

[0119]

[0120] Wherein, X′ represents the vector element after Z-score standardization, X represents the vector element in the first initial vector or the second initial vector, μ represents the average value of the vector elements in the first initial vector or the second initial vector, and σ represents the standard deviation of the vector elements in the first initial vector or the second initial vector.

[0121] Then, after obtaining the first initial vector and the second initial vector after Z-score normalization processing, the server can normalize the vector elements included in the first initial vector and the second initial vector after the Z-score normalization processing through a preset data normalization method, such as the Sigmoid function, so as to obtain the normalized first initial vector and the normalized second initial vector.

[0122] Optionally, the functional formula of the Sigmoid function can be specifically expressed as follows:

[0123]

[0124] Among them, f(x) represents the vector element after Sigmoid normalization, and its value range is (0, 1), and x represents the vector element after Z-score normalization. That is, the Sigmoid function can map any real number to the range of (0, 1).

[0125] Based on the above method, see Figure 3 As shown, the server (e.g., computer room service) collects data in JSON format (i.e., data on resource usage) through HTTP, thereby obtaining a first initial vector and a second initial vector of 1440 dimensions based on the JSON data, and then performing Z-score standardization and Sigmoid normalization processing on the first initial vector and the second initial vector in turn, thereby obtaining a first eigenvector and a second eigenvector.

[0126] S203: Determine resource scheduling strategies for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold.

[0127] The resource scheduling strategy can be used to determine whether to schedule resources on the same resource node for the first instance and the second instance. For example, if the vector similarity is greater than or equal to a preset similarity threshold, it can be determined that the resource scheduling strategy can be used to schedule resources for the first instance and the second instance on different resource nodes.

[0128] If the vector similarity is less than a preset similarity threshold, it can be determined that the resource scheduling strategy can schedule resources for the first instance and the second instance on the same resource node.

[0129] In an optional implementation, when executing step S203, the server may perform binary processing on the first feature vector and the second feature vector respectively to obtain two binary vectors; then, the element overlap of the first vector elements in the two binary vectors is used as the vector similarity between the first feature vector and the second feature vector; finally, the resource scheduling strategy of the first instance and the second instance is determined based on the obtained vector similarity and a preset similarity threshold.

[0130] Each first vector element included in each binary vector may represent that the corresponding time period is a peak period of resource usage of the corresponding instance. For example, "1" may be used to indicate that the corresponding time period is a peak period of resource usage of the instance, and "0" may be used to indicate that the corresponding time period is not a peak period of resource usage of the instance.

[0131] Exemplarily, the server can determine a binary vector that can characterize when the first instance is at a resource usage peak, and a binary vector that can characterize when the second instance is at a resource usage peak, based on a preset resource usage threshold, and a plurality of vector elements respectively included in the first feature vector and the second initial vector, i.e., threshold filtering. Assuming that the aforementioned preset resource usage threshold is T, then when the resource usage Y(t) of an instance (e.g., the first instance or the second instance) within a certain time period t>T, the time period t can be considered to be the resource usage peak of the instance.

[0132] For each instance k, a 1440-dimensional binary vector V_k can be generated for 1440 time periods (or minutes or time points) every day, wherein if a certain time period t is the resource usage peak period of instance k, then it can be determined that the vector element V_k[t] corresponding to the time period t in the binary vector is 1; otherwise, V_k[t] is 0. The binary vector corresponding to the first instance above can be represented as V_i, and the binary vector corresponding to the second instance above can be represented as V_j.

[0133] Next, the server can perform multiplication operations on the vector elements at the same position in the two binary vectors (i.e., V_i and V_j) to obtain a result vector (which can be expressed as: V_r), thereby obtaining the element overlap based on the number of first vector elements corresponding to the two binary vectors and the result vector respectively, and then using the element overlap as the vector similarity.

[0134] The matching degree of the resource usage peak periods between the first instance and the second instance can be determined according to the number of first vector elements (i.e., "1") in the result vector V_r. If the number of first vector elements in the result vector V_r is greater, it indicates that the resource usage peak periods between the first instance and the second instance are more similar.

[0135] Optionally, the number of first vector elements in the above result vector V_r can be expressed as overlap_count. Since the number of first vector elements in the result vector V_r, overlap_count, is determined based on the multiplication result of the vector elements at the same position in the binary vector V_i and the binary vector V_j, overlap_countt=sum(V_i*V_j). It should be understood that the above overlap_count is also the number of overlaps during the peak period of resource usage in the first instance and the second instance.

[0136] The above-mentioned element overlap can be determined according to the maximum value of the number of first vector elements in the result vector V_r and the number of first vector elements corresponding to the above-mentioned two binary vectors (i.e., V_i and V_j). For example, the calculation formula of the above-mentioned element overlap can be specifically expressed as follows:

[0137] overlap_ratio=overlap_count / max(sum(V_i),sum(V_j))

[0138] Wherein, overlap_ratio represents the overlap of elements, overlap_count represents the number of first vector elements in the result vector V_r, and max(sum(V_i), sum(V_j)) represents the maximum value of the number of first vector elements corresponding to binary vector V_i and binary vector V_j, respectively. It should be understood that overlap_ratio measures the ratio of peak overlap between two instances.

[0139] Therefore, the two binary vectors obtained based on the binary vector representation can be used to analyze the overlap times and overlap ratios of the resource usage peak period of the first instance and the resource usage peak period of the second instance. In addition, the binary vectors obtained using the binary representation greatly reduce the use of data storage space.

[0140] In an optional implementation, when executing step S203, the server may also use the distance measurement result between the first eigenvector and the second eigenvector as the vector similarity between the first eigenvector and the second eigenvector. That is, the server may obtain the degree of overlap that can characterize the resource usage peak period of the first instance and the resource usage peak period of the second instance by performing distance measurement on the first eigenvector and the second eigenvector represented by floating point numbers. The first eigenvector and the second eigenvector are both normalized eigenvectors, which can eliminate the differences between data of different scales.

[0141] Exemplarily, the server may determine the distance measurement result between the first feature vector and the second feature vector by using a distance measurement method such as Euclidean distance or cosine similarity. If the aforementioned distance measurement result is smaller, it indicates that the resource usage patterns (e.g., resource usage peak period) of the first instance and the second instance are closer. Conversely, if the aforementioned distance measurement result is larger, it indicates that the difference in resource usage patterns of the first instance and the second instance is greater.

[0142] Therefore, see Figure 4 As shown, the server can determine the overlap of the resource usage peak periods between the first instance and the second instance based on both binary representation and floating-point representation, that is, the relevant calculation of the resource usage peak period. Based on the binary representation, two binary vectors can be obtained by performing threshold filtering on the first eigenvector and the second eigenvector (that is, determining or distinguishing the resource usage peak period), and then the number of overlaps and the overlap ratio of the resource usage peak periods of the first instance and the second instance within the set historical time range can be determined based on the peak period matching degree. Based on the floating-point representation, the first eigenvector and the second eigenvector can be distance-measured (e.g., Euclidean distance measurement), so as to determine the degree of overlap of the resource usage peak periods of the first instance and the second instance within the set historical time range based on the distance measurement result.

[0143] S204: Perform resource scheduling on the first instance and the second instance based on the resource scheduling policy.

[0144] In an optional implementation, when executing step S204, if the above-mentioned resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes, the server can filter out the first resource node and the second resource node from the preset resource node set. Among them, the resources on the first resource node are not allocated to the instance whose vector similarity with the first feature vector is less than the similarity threshold, and the resources on the second resource node are not allocated to the instance whose vector similarity with the second feature vector is less than the similarity threshold. In this way, once it is determined that the resource usage peak period of the first instance and the resource usage peak period of the second instance are highly overlapped, resources on different resource nodes can be scheduled for the first instance and the second instance to avoid resource competition or contention between the first instance and the second instance.

[0145] Optionally, if the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node, a third resource node is selected from the preset resource node set, wherein the resources on the third resource node are not allocated to the instance whose vector similarity with the first feature vector is less than the similarity threshold, and the resources on the third resource node are not allocated to the instance whose vector similarity with the second feature vector is less than the similarity threshold.

[0146] In this way, by staggering the peak periods of resource usage, the load on each resource node is more balanced, preventing some resource nodes from experiencing performance bottlenecks due to carrying multiple high-demand instances at the same time. In addition, the reasonable allocation of computing resources can reduce the risk of service interruption due to single point failure or local overload, and improve the stability and reliability of the entire service architecture. By analyzing historical data and adjusting the instance layout accordingly, existing hardware resources can be used more effectively, that is, resource utilization is optimized and operating costs are reduced. Based on the understanding of past patterns, it helps the operation and maintenance team to better predict possible demand peaks in the future and make corresponding capacity planning and emergency plans in advance. Combined with resource utilization monitoring tools, it can realize automatic collection, analysis of data and adjustment of deployment plans, reducing the need for manual intervention and improving operation and maintenance efficiency.

[0147] Based on the resource scheduling method of the example recorded in the above steps S201 to S204, refer to Figure 5 As shown, the server can implement instance resource scheduling based on the peak period of resource usage. The server can implement the following functions based on the peak period of resource usage:

[0148] Real-time monitoring and alarming: For example, Prometheus is used as the core monitoring tool, and its powerful data capture capabilities are used to collect key performance indicators of each instance. At the same time, combined with visualization tools such as Grafana, intuitive and easy-to-understand chart displays are provided for operation and maintenance personnel to quickly understand the system status. To ensure that alarm information can be received and processed in a timely manner, the system supports multiple notification methods, including but not limited to email, SMS, and Slack message push. This not only covers different communication preferences, but also increases the success rate of information transmission, ensuring that key events are not ignored.

[0149] Scaling decision: When selecting new resource nodes to deploy instances, give priority to those resource nodes that have the least overlap in resource usage peaks with existing instances, thereby reducing the risk of resource contention that may occur in the future. Scaling recommendations: When you need to reduce the size of a resource node collection (i.e., a cluster), give priority to starting with resource nodes that have a high overlap in peak usage between internal instances. Even if such resource nodes are reduced, they are unlikely to have a serious impact on overall performance.

[0150] Automatic migration and scheduling (i.e., migration guidance): For resource nodes with severe resource usage peak overlap, the system can recommend the best target resource node list so that operation and maintenance personnel can manually perform migration operations or trigger automated processes.

[0151] To summarize, in the resource scheduling method of the instance provided in the embodiment of the present application, first, the resource usage of the first instance and the second instance of the service application within a set historical time range can be obtained; then, based on the resource usage, the first feature vector corresponding to the first instance and the second feature vector corresponding to the second instance are obtained; further, based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold, the resource scheduling strategy of the first instance and the second instance is determined; finally, based on the resource scheduling strategy, resources are scheduled for the first instance and the second instance.

[0152] Based on the above method, through the collection and analysis of historical data (i.e., resource usage), statistical methods are used to achieve intelligent identification of peak resource usage periods. Moreover, unlike the traditional scheduling method that only focuses on the current load, the resource scheduling method of the present application takes into account the peak resource usage periods that may occur in the future and pre-allocates accordingly. This forward-looking approach helps to reduce service interruptions or performance degradation caused by unforeseen demand peaks. By distributing instances with peak periods in different time periods on different resource nodes, resource contention at the same point in time can be effectively avoided.

[0153] In addition, considering the variability of user behavior patterns, the latest resource consumption trends of all instances can be re-evaluated regularly, and the location arrangement of instances can be automatically adjusted based on new information, that is, dynamic adjustment of instance resource scheduling is achieved. Such adaptive capabilities ensure that the optimal resource configuration state can be maintained even in the face of changing demand patterns. In addition, by making more reasonable and effective use of existing hardware facilities, the need for investment in additional equipment is reduced, which not only improves the utilization rate of existing resources, but also reduces energy consumption, indirectly reducing the operation and maintenance costs of resource nodes.

[0154] Further, based on the same technical concept, the embodiment of the present application provides an example of a resource scheduling device, and the resource scheduling device of the example is used to implement the above method flow of the embodiment of the present application. Figure 6 As shown, the resource scheduling device 600 of this example may include: a data acquisition module 601, a feature extraction module 602, a strategy determination module and a resource scheduling module 604, wherein:

[0155] The data acquisition module 601 is used to acquire resource usage of the first instance and the second instance of the service application within a set historical time range;

[0156] A feature extraction module 602 is used to obtain a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance based on resource usage; wherein the first feature vector represents the resource usage rate of the first instance in multiple time periods within a set historical time range, and the second feature vector represents the resource usage rate of the second instance in multiple time periods;

[0157] A policy determination module 603 is used to determine a resource scheduling policy for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold; the resource scheduling policy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance;

[0158] The resource scheduling module 604 is used to schedule resources for the first instance and the second instance based on the resource scheduling policy.

[0159] In an optional embodiment, when obtaining the first feature vector of the first instance and the second feature vector of the second instance based on the resource usage, the feature extraction module 602 is specifically used to:

[0160] From the resource usage, obtain first resource usage rates corresponding to the first instance in multiple time periods, and second resource usage rates corresponding to the second instance in multiple time periods;

[0161] Obtaining an initial feature vector of a first instance based on a plurality of first resource usage rates, and obtaining an initial feature vector of a second instance based on a plurality of second resource usage rates;

[0162] The initial feature vector of the first instance and the initial feature vector of the second instance are respectively subjected to standardization processing and normalization processing in sequence to obtain a first feature vector and a second feature vector.

[0163] In an optional embodiment, when determining the resource scheduling policy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold, the policy determination module 603 is specifically used to:

[0164] Perform binary processing on the first eigenvector and the second eigenvector respectively to obtain two binary vectors;

[0165] The element overlap of the first vector elements in the two binary vectors is used as the vector similarity; wherein each first vector element represents that the corresponding time period is the resource usage peak period of the corresponding instance;

[0166] If the vector similarity is less than the similarity threshold, determining the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node;

[0167] If the vector similarity is greater than or equal to the similarity threshold, then the resource scheduling strategy is determined to schedule resources for the first instance and the second instance on different resource nodes.

[0168] In an optional embodiment, when the element overlap of the first vector elements in two binary vectors is used as the vector similarity, the strategy determination module 603 is specifically used to:

[0169] Perform multiplication operation on the vector elements at the same position in two binary vectors to obtain a result vector;

[0170] Obtaining element coincidence based on the number of first vector elements corresponding to the two binary vectors and the result vector respectively;

[0171] The element overlap is regarded as the vector similarity.

[0172] In an optional embodiment, when determining the resource scheduling policy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold, the policy determination module 603 is specifically used to:

[0173] The distance measurement result between the first eigenvector and the second eigenvector is used as the vector similarity;

[0174] If the vector similarity is less than the similarity threshold, determining the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node;

[0175] If the vector similarity is greater than or equal to the similarity threshold, then the resource scheduling strategy is determined to schedule resources for the first instance and the second instance on different resource nodes.

[0176] In an optional embodiment, when performing resource scheduling on the first instance and the second instance based on the resource scheduling policy, the resource scheduling module 604 is specifically used to:

[0177] If the resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes, the first resource node and the second resource node are selected from a preset resource node set;

[0178] Among them, the resources on the first resource node are not allocated to the instance whose vector similarity with the first feature vector is less than the similarity threshold, and the resources on the second resource node are not allocated to the instance whose vector similarity with the second feature vector is less than the similarity threshold.

[0179] In an optional embodiment, when performing resource scheduling on the first instance and the second instance based on the resource scheduling policy, the resource scheduling module 604 is specifically used to:

[0180] If the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node, a third resource node is selected from the preset resource node set;

[0181] The resources on the third resource node are not allocated to instances whose vector similarity with the first feature vector is less than a similarity threshold and instances whose vector similarity with the second feature vector is less than a similarity threshold.

[0182] Based on the description of the above method embodiment and device embodiment, the exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to enable the electronic device to perform the method according to the embodiment of the present invention when executed by the at least one processor.

[0183] An embodiment of the present application also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute a method according to an embodiment of the present application.

[0184] An embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute a method according to an embodiment of the present application.

[0185] See also Figure 7 As shown, the structured block diagram of the electronic device 700 that can be used as the server or client of the present application will now be described, which is an example of the hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent the computer device of various forms of digital electronics, such as, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0186] like Figure 7As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0187] A plurality of components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the electronic device 700, and the input unit 706 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 707 may be any type of device capable of presenting information, and may include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 708 may include but is not limited to a disk, an optical disk. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a worldwide interoperability for microwave access (WiMax) device, a cellular communication device, and / or the like.

[0188] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a CPU, a graphics processing unit (GPU), various artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above. For example, in some embodiments, the resource scheduling method of the above example may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. In some embodiments, the computing unit 701 may be configured to perform the resource scheduling method of the above example in any other appropriate manner (e.g., by means of firmware).

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

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

[0191] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

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

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

[0194] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0195] Furthermore, it should be understood that what is disclosed above is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope covered by the present application.

Claims

1. A resource scheduling method of an example, characterized in that: include: Obtain resource usage of a first instance and a second instance of a service application within a set historical time range; Based on the resource usage, obtain a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance; the first feature vector represents the resource usage rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource usage rate of the second instance in the multiple time periods; Determine a resource scheduling strategy for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector, and a preset similarity threshold; the resource scheduling strategy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance; Based on the resource scheduling policy, resources are scheduled for the first instance and the second instance.

2. The method according to claim 1, characterized in that The obtaining, based on the resource usage, a first feature vector of the first instance and a second feature vector of the second instance comprises: From the resource usage, obtain first resource usage rates corresponding to the first instance in the multiple time periods, and second resource usage rates corresponding to the second instance in the multiple time periods; Obtaining an initial feature vector of the first instance based on a plurality of first resource usage rates, and obtaining an initial feature vector of the second instance based on a plurality of second resource usage rates; The initial feature vector of the first instance and the initial feature vector of the second instance are respectively subjected to standardization processing and normalization processing in sequence to obtain the first feature vector and the second feature vector.

3. The method according to claim 1, characterized in that The determining of the resource scheduling strategy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold includes: Performing binary processing on the first eigenvector and the second eigenvector respectively to obtain two binary vectors; The element overlap of the first vector elements in the two binary vectors is used as the vector similarity; wherein each first vector element represents that the corresponding time period is the resource usage peak period of the corresponding instance; If the vector similarity is less than the similarity threshold, determining that the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node; If the vector similarity is greater than or equal to the similarity threshold, determining that the resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes.

4. The method according to claim 3, characterized in that The taking the element overlap of the first vector elements in the two binary vectors as the vector similarity comprises: Performing a multiplication operation on the vector elements at the same position in the two binary vectors to obtain a result vector; Obtaining the element coincidence degree based on the number of the first vector elements corresponding to the two binary vectors and the result vector respectively; The element overlap degree is used as the vector similarity.

5. The method according to claim 1, characterized in that The determining of the resource scheduling strategy of the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold includes: Taking the distance measurement result between the first feature vector and the second feature vector as the vector similarity; If the vector similarity is less than the similarity threshold, determining that the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node; If the vector similarity is greater than or equal to the similarity threshold, determining that the resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes.

6. The method according to any one of claims 1 to 5, characterized in that The performing resource scheduling on the first instance and the second instance based on the resource scheduling policy includes: If the resource scheduling strategy is to schedule resources for the first instance and the second instance on different resource nodes, then selecting the first resource node and the second resource node from a preset resource node set; Among them, the resources on the first resource node are not allocated to the instance whose vector similarity with the first feature vector is less than the similarity threshold, and the resources on the second resource node are not allocated to the instance whose vector similarity with the second feature vector is less than the similarity threshold.

7. The method according to any one of claims 1 to 5, characterized in that The performing resource scheduling on the first instance and the second instance based on the resource scheduling policy includes: If the resource scheduling strategy is to schedule resources for the first instance and the second instance on the same resource node, a third resource node is selected from a preset resource node set; The resources on the third resource node are not allocated to instances whose vector similarity with the first feature vector is less than the similarity threshold, and instances whose vector similarity with the second feature vector is less than the similarity threshold.

8. A resource scheduling device of an example, characterized in that: include: A data acquisition module, used to acquire resource usage of a first instance and a second instance of a service application within a set historical time range; a feature extraction module, configured to obtain a first feature vector corresponding to the first instance and a second feature vector corresponding to the second instance based on the resource usage; the first feature vector represents the resource usage rate of the first instance in multiple time periods within the set historical time range, and the second feature vector represents the resource usage rate of the second instance in the multiple time periods; a policy determination module, configured to determine a resource scheduling policy for the first instance and the second instance based on the vector similarity between the first feature vector and the second feature vector and a preset similarity threshold; the resource scheduling policy is used to determine whether to schedule resources on the same resource node for the first instance and the second instance; A resource scheduling module is used to perform resource scheduling on the first instance and the second instance based on the resource scheduling policy.

9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.

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