Resource scheduling method and device and server

By obtaining the instruction flow characteristics of the application and determining its resource allocation mode, and optimizing resource allocation, the problem of inaccurate resource scheduling in the existing technology is solved and the resource utilization rate is improved.

CN119862022APending Publication Date: 2025-04-22HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311364133.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art is difficult to effectively schedule the demand for multiple physical resources by different applications, resulting in low resource utilization.

Method used

By obtaining the instruction flow characteristics of the application, determining its resource allocation mode, and optimizing resource allocation based on this mode to achieve more accurate resource scheduling.

Benefits of technology

It improves the utilization rate of physical resources, makes resource allocation more in line with the execution needs of the application, and reduces resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862022A_ABST
    Figure CN119862022A_ABST
Patent Text Reader

Abstract

The invention discloses a resource scheduling method and device and a server, and relates to the technical field of communication. Under the condition that an execution request of a first application program is received, a first instruction stream feature of the first application program is obtained, and the first instruction stream feature indicates features of a plurality of first instructions included in the first application program; determining a first resource allocation mode of the first application program according to the first instruction stream feature and a physical resource called by the first application program; and optimizing the physical resources called by the first application program based on the first resource allocation mode. The resource allocation mode determined through the instruction stream characteristics of the application program is matched with the multiple instructions included in the application program, and then the physical resources called by the application program optimized based on the resource allocation mode are matched with the multiple instructions, so that resource scheduling based on application program driving is realized, the granularity of resource scheduling is relatively fine, and the resource scheduling efficiency is improved. And the resource utilization rate for different application programs 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 communication technology, and in particular to a resource scheduling method, device and server. Background Art

[0002] With the explosive growth of data and model parameters, the concept of decoupled composable architecture has been proposed. Decoupled composable architecture aims to accurately schedule multiple resources for different applications based on their different needs for computing, storage, or acceleration resources, thereby improving resource utilization.

[0003] Among them, multiple resources may refer to physical resources of different types, structures or formats. For example, multiple resources include but are not limited to central processing unit (CPU), graphics processing unit (GPU), data processing unit (DPU), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), storage unit, memory unit, etc.

[0004] The operation of different applications of the same business or different businesses requires the use of physical resources. Therefore, how to optimize the resources called by different applications to achieve resource scheduling is an urgent problem to be solved. Summary of the invention

[0005] The present application provides a resource scheduling method, device and server for optimizing physical resources called by an application program.

[0006] In a first aspect, a resource scheduling method is provided, the method comprising: upon receiving an execution request of a first application, obtaining a first instruction stream characteristic of the first application, the first application comprising a plurality of first instructions, the first instruction stream characteristic indicating characteristics of the plurality of first instructions; determining a first resource allocation mode of the first application based on the first instruction stream characteristic and physical resources called by the first application; and optimizing the physical resources called by the first application based on the first resource allocation mode.

[0007] In this method, since the instruction stream characteristics indicate the characteristics of multiple instructions included in the application, the resource allocation mode determined by the instruction stream characteristics of the application is adapted to the multiple instructions included in the application, and then the physical resources called by the application are optimized based on the resource allocation mode, so that the optimized physical resources can be adapted to the multiple instructions included in the application, and resource scheduling driven by the application is realized, so that the granularity of resource scheduling is finer, thereby improving the resource utilization of physical resources for different applications.

[0008] In a possible implementation, the method of determining the first resource allocation mode of the first application program according to the first instruction stream feature and the physical resources called by the first application program includes: determining the resource allocation mode corresponding to the first instruction stream feature based on the first mapping relationship between the instruction stream feature and the resource allocation mode; determining the first resource allocation mode of the first application program according to the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application program. The first resource allocation mode is determined by the first mapping relationship obtained in advance, so that the determination efficiency of the first resource allocation mode is higher.

[0009] In a possible implementation, based on the first mapping relationship between instruction stream features and resource allocation patterns, before determining the resource allocation pattern corresponding to the first instruction stream feature, it is necessary to obtain the first mapping relationship. The method of obtaining the first mapping relationship includes, in the process of executing the historical application, sampling according to time intervals to obtain multiple groups of instruction stream features and device operation features, a group of instruction stream features and device operation features corresponding to the same time interval; classifying the multiple groups of instruction stream features and device operation features to obtain multiple categories, the similarity between device operation features of different categories is greater than the first similarity threshold, the similarity between device operation features of the same category is less than the second similarity threshold, and the distance between instruction stream features of the same category is less than the distance threshold; for any category in the multiple categories, obtaining the resource allocation pattern corresponding to any category according to the device operation features included in any category; obtaining the first mapping relationship based on the resource allocation patterns corresponding to the multiple categories and at least one instruction stream feature included in the multiple categories.

[0010] Since the instruction stream characteristics in the first mapping relationship are obtained through real sampling, the obtained first mapping relationship is more authentic. Since the resource allocation pattern in the first mapping relationship is obtained through classification, the operating characteristics of devices of the same category can be classified into one resource allocation pattern, which makes the obtained first mapping relationship more accurate, and thus makes the first resource allocation pattern determined based on the first mapping relationship more accurate.

[0011] In a possible implementation, a method of classifying multiple groups of instruction flow features and device operation features to obtain multiple categories includes clustering multiple device operation features in the multiple groups of instruction flow features and device operation features based on a first quantity, obtaining multiple clustering clusters according to the clustering results, wherein the similarity between device operation features of different clustering clusters is greater than a first similarity threshold, and the similarity between device operation features of the same clustering cluster is less than a second similarity threshold; if the distance between instruction flow features in any clustering cluster of the multiple clustering clusters is less than a distance threshold, multiple categories are obtained according to the first number of clustering clusters. Thus, classification between multiple device operation features can be achieved through clustering, and whether the distance between instruction flow features of the same category is less than the distance threshold can be verified by judging the distance threshold.

[0012] In a possible implementation, after clustering multiple device operation features in multiple groups of instruction flow features and device operation features based on a first quantity, multiple clustering clusters are obtained according to the clustering results, and the similarity between device operation features of different clustering clusters is greater than a first similarity threshold, and the similarity between device operation features of the same clustering cluster is less than a second similarity threshold, if the distance between instruction flow features in any clustering cluster in the multiple clustering clusters is not less than a distance threshold, then clustering multiple device operation features in multiple groups of instruction flow features and device operation features is performed again based on a second quantity, and multiple clustering clusters are reacquired, and if the distance between instruction flow features in any clustering cluster in the reacquired multiple clustering clusters is less than the distance threshold, multiple categories are obtained according to the second number of reacquired clustering clusters. The accuracy of the multiple categories obtained can be improved by clustering multiple times.

[0013] In a possible implementation, the method of determining the first resource allocation mode of the first application program according to the first instruction stream feature and the physical resources called by the first application program may also include: determining the resource allocation mode corresponding to the first instruction stream feature based on a resource calculation model, the resource calculation model is used to output the corresponding resource allocation mode according to the input instruction stream feature; determining the first resource allocation mode of the first application program according to the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application program. Determining the first resource allocation mode by using the resource calculation model acquired in advance makes the determination efficiency of the first resource allocation mode higher.

[0014] In one possible implementation, the method for optimizing the physical resources called by the first application based on the first resource allocation mode includes: obtaining the first physical resources corresponding to the first resource allocation mode based on the second mapping relationship between the resource allocation mode and the physical resources; and optimizing the physical resources called by the first application according to the first physical resources. The first physical resource is determined by the second mapping relationship obtained in advance, so that the determination efficiency of the first physical resource is high. In addition, since the first physical resource corresponds to the first resource allocation mode, and the first resource allocation mode corresponds to the characteristics of multiple first instructions included in the first application, the first physical resource corresponds to the first application, so that the physical resources called by the first application are optimized according to the first physical resources, and the optimized physical resources are more in line with the execution requirements of the first application, avoiding resource waste and effectively improving resource utilization.

[0015] In a possible implementation, the physical resources include a CPU, a GPU, an ASIC, an FPGA, a storage unit, and a memory unit; based on a second mapping relationship between a resource allocation mode and physical resources, a method of obtaining a first physical resource corresponding to a first resource allocation mode includes, when the first resource allocation mode is target resource intensive, the first physical resource includes a first proportion of target resources and a second proportion of other resources, the target resource is any resource among the physical resources, the other resource is a resource among the physical resources except the target resource, and the first proportion is greater than the second proportion. By allocating corresponding physical resources to different resource allocation modes through multiple resources at different proportions, the allocation granularity of physical resources is finer, thereby making the first physical resources obtained according to the first resource allocation mode more accurate.

[0016] In a possible implementation, the execution request of the first application may be received within a first time period; if the execution request of the second application is received within a second time period, the second instruction stream feature of the second application is obtained, the second application includes multiple second instructions, and the second instruction stream feature indicates the features of the multiple second instructions; the second resource allocation mode of the second application is determined according to the second instruction stream feature and the physical resources called by the second application; the physical resources called by the second application are optimized based on the second resource allocation mode. For different applications in different time periods, different physical resources can be flexibly scheduled, so that the time granularity of resource scheduling is finer.

[0017] In a possible implementation, the first instruction stream feature includes an instruction unit distribution feature, a basic block vector (BBV) distribution feature, and a hotspot function feature. The first instruction stream feature is represented by a plurality of different first instruction features, so that the first instruction stream feature is more accurate and can better indicate the features of the plurality of first instructions.

[0018] In a possible implementation, the device operation characteristics include front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, translation lookaside buffer (TLB) performance, operating system (OS) performance, instruction mix dependency, high-latency instruction distribution, cache behavior, and branch behavior. The device operation characteristics are represented by a variety of different device operation characteristics, making the device operation characteristics more accurate and better indicating the characteristics generated by the device running the application.

[0019] In a second aspect, a resource scheduling device is provided, the device comprising:

[0020] an acquisition module, configured to acquire, upon receiving an execution request of a first application, a first instruction stream feature of the first application, wherein the first application includes a plurality of first instructions, and the first instruction stream feature indicates features of the plurality of first instructions;

[0021] A determination module, configured to determine a first resource allocation mode of the first application program according to a first instruction stream feature and physical resources called by the first application program;

[0022] The optimization module is used to optimize the physical resources called by the first application based on the first resource allocation mode.

[0023] In one possible implementation, a determination module is used to determine the resource allocation mode corresponding to the first instruction stream feature based on a first mapping relationship between the instruction stream feature and the resource allocation mode; and to determine the first resource allocation mode of the first application based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

[0024] In a possible embodiment, the device also includes: a sampling module, which is used to obtain multiple groups of instruction flow features and device operation features by sampling at time intervals during the execution of historical applications, and a group of instruction flow features and device operation features correspond to the same time interval; a classification module, which is used to classify the multiple groups of instruction flow features and device operation features to obtain multiple categories, the similarity between device operation features of different categories is greater than a first similarity threshold, the similarity between device operation features of the same category is less than a second similarity threshold, and the distance between instruction flow features of the same category is less than a distance threshold; the acquisition module is also used to obtain a resource allocation pattern corresponding to any category among the multiple categories according to the device operation features included in any category, and obtain a first mapping relationship based on the resource allocation patterns corresponding to the multiple categories and at least one instruction flow feature included in the multiple categories.

[0025] In one possible implementation, a classification module is used to cluster multiple device operation features among multiple groups of instruction stream features and device operation features based on a first quantity, and obtain multiple clusters according to the clustering results, wherein the similarity between device operation features of different clusters is greater than a first similarity threshold, and the similarity between device operation features of the same cluster is less than a second similarity threshold; if the distance between instruction stream features within any cluster among the multiple clusters is less than a distance threshold, multiple categories are obtained according to the first number of clusters.

[0026] In one possible implementation, a classification module is used to cluster multiple device operation features among multiple groups of instruction flow features and device operation features based on a first quantity, and obtain multiple clustering clusters according to the clustering results, wherein the similarity between device operation features of different clustering clusters is greater than a first similarity threshold, and the similarity between device operation features of the same clustering cluster is less than a second similarity threshold; if the distance between instruction flow features within any clustering cluster among the multiple clustering clusters is not less than the distance threshold, cluster multiple device operation features among the multiple groups of instruction flow features and device operation features based on a second quantity, and reacquire multiple clustering clusters; if the distance between instruction flow features within any clustering cluster among the reacquired multiple clustering clusters is less than the distance threshold, obtain multiple categories according to the second number of reacquired clustering clusters.

[0027] In one possible implementation, a determination module is used to determine a resource allocation mode corresponding to a first instruction stream feature based on a resource calculation model, and the resource calculation model is used to output a corresponding resource allocation mode according to an input instruction stream feature; and to determine a first resource allocation mode for the first application based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

[0028] In a possible implementation, the optimization module is used to obtain the first physical resource corresponding to the first resource allocation mode based on the second mapping relationship between the resource allocation mode and the physical resource; and optimize the physical resource called by the first application according to the first physical resource.

[0029] In one possible implementation, the physical resources include a CPU, a GPU, an ASIC, an FPGA, a storage unit, and a memory unit; and the optimization module is used for, when the first resource allocation mode is target resource intensive, the first physical resources include a first proportion of target resources and a second proportion of other resources, the target resources are any type of resource among the physical resources, the other resources are resources among the physical resources except the target resources, and the first proportion is greater than the second proportion.

[0030] In one possible implementation, an acquisition module is used to acquire a first instruction stream characteristic of a first application upon receiving an execution request of the first application within a first time period; the acquisition module is also used to acquire a second instruction stream characteristic of a second application upon receiving an execution request of the second application within a second time period, the second application including a plurality of second instructions, the second instruction stream characteristic indicating characteristics of the plurality of second instructions; the determination module is also used to determine a second resource allocation mode of the second application based on the second instruction stream characteristic and the physical resources called by the second application; the optimization module is also used to optimize the physical resources called by the second application based on the second resource allocation mode.

[0031] In a possible implementation, the first instruction stream feature includes an instruction unit distribution feature, a BBV distribution feature, and a hotspot function feature.

[0032] In one possible implementation, the device operating characteristics include front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, TLB performance, OS performance, instruction mix dependency, high-latency instruction distribution, cache behavior, and branch behavior.

[0033] In a third aspect, a server is provided, comprising: a processor, the processor being coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor so that the network device implements the resource scheduling method as described in the first aspect or any one of the first aspects.

[0034] In a fourth aspect, a network device is provided, comprising: a processor, the processor being coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor, so that the network device implements the resource scheduling method as described in the first aspect or any one of the first aspects.

[0035] Optionally, the number of the processors is one or more, and the number of the memories is one or more.

[0036] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0037] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.

[0038] In a fifth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to enable a computer to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0039] In a sixth aspect, a computer program (product) is provided, the computer program (product) comprising: a computer program code, when the computer program code is executed by a computer, the computer executes the methods in the above aspects.

[0040] In a seventh aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.

[0041] In an eighth aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the methods in the above aspects.

[0042] It should be understood that the beneficial effects achieved by the technical solutions of the second to eighth aspects of the present application and the corresponding possible implementation methods can be referred to the technical effects of the first aspect and its corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of an implementation environment of a resource scheduling method provided in an embodiment of the present application;

[0044] Figure 2 A flowchart of a resource scheduling method provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a resource scheduling process provided in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of a resource scheduling method provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of the structure of a resource scheduling device provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of a network device provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of the structure of another network device provided in an embodiment of the present application;

[0050] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0052] With the rapid development of communication technology, data and model parameters have exploded, which has led to an increasing demand for memory, storage capacity and bandwidth from applications. Information technology (IT) infrastructure, including hardware resources, is unable to meet the demand. Therefore, the concept of a separate composable architecture has been proposed. The separate composable architecture can accurately match heterogeneous resources according to the application's needs for computing, storage and acceleration, thereby flexibly allocating multiple resources. Among them, the resources obtained by combining multiple resources can be called heterogeneous resources.

[0053] The infrastructure based on the separated composable architecture includes a variety of separated resources, and the various resources may include a variety of computing power resources, a variety of storage resources or a variety of acceleration resources, etc., that is, heterogeneous resources may include heterogeneous computing power or heterogeneous storage, etc. For example, a variety of resources include but are not limited to physical resources such as CPU, GPU, DPU, ASIC, FPGA, storage unit, memory unit, etc. Among them, different resources are suitable for providing different services. For example, CPU resources are suitable for computing or data processing, and GPU resources are suitable for accelerated processing. Therefore, how to adaptively combine and schedule suitable heterogeneous resources based on different applications to achieve reasonable allocation of multiple resources has become a challenge. In other words, it is urgent to provide an automatic scheduling method for multiple resources driven by an application, so as to realize the natural integration of the infrastructure based on the separable combinatorial architecture and the software tool chain based on the application-driven resource scheduling, so as to maximize the potential of data processors, global shared computing power, and storage systems.

[0054] In the related art, the resource allocation method is determined based on whether the amount of data cache calculation of the user exceeds a set threshold, and two types of resource allocation methods are provided for selection, namely, efficiency resource allocation method and fairness resource allocation method. However, the two types of resource scheduling methods are selected only by whether the amount of data cache calculation exceeds the threshold, which makes the judgment granularity of resource scheduling too coarse, and thus makes the accuracy of resource scheduling low.

[0055] The embodiment of the present application provides a resource scheduling method, which schedules resources that match the resource allocation mode of the application according to the instruction stream characteristics of the application, thereby achieving more accurate resource scheduling based on the application, and effectively improving resource utilization. The embodiment of the present application does not limit the heterogeneous resources to be scheduled, and can be any resource combination including multiple resources. For example, the heterogeneous resources can be a variety of resources included in the infrastructure based on the separated combinable architecture, or can be a variety of computing power included in a heterogeneous computing power chip. Optionally, the application scenarios of the method provided in the embodiment of the present application include but are not limited to super chips that integrate diversified computing power, heterogeneous computing power chips, public clouds, private clouds, heterogeneity within a chip, heterogeneity between chips, and heterogeneous clusters.

[0056] Among them, the super chip with integrated diversified computing power is a chip with extremely high performance and functions that integrates diversified computing power. Heterogeneous computing power chip is a chip that uses computing units of different types of instruction sets and architectures to form a system computing method. Public cloud is an entity that uses basic resources to provide cloud services to users in the cloud computing model. Public cloud can also be considered as a cloud environment. Public cloud includes cloud data center, which includes a large number of basic resources owned by cloud service providers, including computing resources, storage resources and network resources. The computing resources included in the cloud data center can be a computing device cluster, which includes at least one computing device, and the computing device can be a server or terminal device. Private cloud is built for a single customer, thus providing the most effective control over data, security and service quality. Intra-chip heterogeneity refers to the integration of multiple computing powers through one chip. Inter-chip heterogeneity refers to the heterogeneous integration of multiple computing powers through multiple chips. Heterogeneous cluster refers to a cluster composed of nodes with different configurations.

[0057] For example, see Figure 1 , Figure 1 A schematic diagram of an implementation environment of a resource scheduling method provided in an embodiment of the present application, the implementation environment includes a resource scheduling device, the resource scheduling device includes a business operation module, a heterogeneous resource pool and a resource scheduling module. Among them, the business operation module is used to execute the application corresponding to the business based on the resources in the heterogeneous resource pool to realize the operation of the business; the heterogeneous resource pool includes a variety of different types of callable physical resources; the resource scheduling module is used to call the physical resources in the heterogeneous resource pool for the business operation module according to the resource allocation mode corresponding to the instruction stream characteristics of the application executed in the business operation module.

[0058] See also Figure 2 , Figure 2 A flowchart of a resource scheduling method provided in an embodiment of the present application, which can be applied to Figure 1 In the implementation environment shown, for example, Figure 1 The resource scheduling device shown executes the method. Figure 2 As shown, the resource scheduling method includes but is not limited to the following steps 201 to 203.

[0059] Step 201, upon receiving an execution request of a first application, obtaining a first instruction stream feature of the first application, the first application including a plurality of first instructions, the first instruction stream feature indicating features of the plurality of first instructions.

[0060] In the embodiment of the present application, the first application can be an application required to be executed for any business operation, and the resource scheduling device runs the business by calling the resource execution application. Among them, the first application can include multiple first instructions, and the multiple first instructions can refer to multiple logically independent instruction sequences, and the multiple independent execution instruction sequences are instruction streams. The resource scheduling device completes the function of the first application by executing the instruction stream. Optionally, the instruction sequence may include jump instructions, data processing instructions, access instructions, load or store instructions, etc.

[0061] The present application embodiment does not limit the instruction stream characteristics of the application program, and can indicate the characteristics of multiple instructions included in the application program. Exemplarily, the instruction stream characteristics may include at least one of the instruction unit distribution characteristics, the BBV distribution characteristics, and the hot function characteristics. Among them, the instruction unit distribution characteristics may refer to the characteristics of the distribution of different types of instruction sequences in the application program, the BBV distribution characteristics may refer to the characteristics of the BBV distribution in the instruction sequence included in the application program, and the hot function characteristics may refer to the characteristics of the hot function in the instruction sequence included in the application program, and the hot function refers to the function with the longest execution time in the application program. Exemplarily, BBV is a multidimensional vector with a length of a positive integer, and BBV represents the number information of different basic blocks (basic blocks, BB), and BB includes the instruction sequence between two adjacent jump instructions. The length of BBV is the number of types of BBs contained in the entire application program, and each dimensional vector in BBV represents a BB, and the vector value is the number of BBs in the entire application program multiplied by the weight of BB, and the weight is usually the number of instructions contained in the BB.

[0062] Optionally, in the case where the instruction stream features include instruction unit distribution features, BBV distribution features, and hotspot function features, the first instruction stream features of the first application can be obtained by using a simulation point (simpoint) tool. The simpoint tool cuts the application into multiple segments, obtains the features of each segment, clusters the multiple segments based on the features of each segment, and then selects an instruction segment as a representative in each cluster, executes the selected instruction segment using a simulator, and then weights the executed instruction segment according to the size of each cluster, thereby significantly reducing program analysis and simulation time, and providing an accurate representation of the complete program, and obtaining the instruction unit distribution features, BBV distribution features, and hotspot function features included in the program through accurate representation of the program.

[0063] Step 202: Determine a first resource allocation mode of the first application program according to the first instruction stream characteristics and the physical resources called by the first application program.

[0064] Since the first instruction stream feature indicates the features of multiple first instructions included in the first application, the execution of instructions with different features requires different physical resources. Therefore, the first instruction stream feature can characterize the physical resources required for the resource scheduling device to execute the multiple first instructions, that is, different instruction stream features correspond to different physical resource consumption situations. In an embodiment of the present application, different physical resource consumption situations are classified into multiple resource allocation modes, so that the resource allocation mode corresponding to the first instruction stream feature can be determined, and then the resource allocation mode corresponding to the determined first instruction stream feature is processed according to the physical resources currently called by the first application, and the first resource allocation mode corresponding to the first application can be determined. Then the first resource allocation mode of the first application not only matches the basic first instruction stream feature, but also adapts to the called physical resources.

[0065] The embodiment of the present application does not limit the resource allocation mode, and can be flexibly configured according to the application scenario and the type of physical resources. Optionally, the resource allocation mode can be CPU-intensive, GPU-intensive, ASIC-intensive, FPGA-intensive or memory-access intensive, etc. Among them, CPU-intensive may refer to an allocation mode that mainly allocates CPU resources, GPU-intensive may refer to an allocation mode that mainly allocates GPU resources, ASIC-intensive may refer to an allocation mode that mainly allocates ASIC resources, FPGA-intensive may refer to an allocation mode that mainly allocates FPGA resources, and ASIC-intensive may refer to an allocation mode that mainly allocates access resources and storage resources. Optionally, determining the first resource allocation mode of the first application based on the first instruction stream characteristics and the physical resources called by the first application may include the following two methods.

[0066] Method 1: Based on the first mapping relationship between instruction stream characteristics and resource allocation patterns, determine the resource allocation pattern corresponding to the first instruction stream characteristics; determine the first resource allocation pattern of the first application according to the resource allocation pattern corresponding to the first instruction stream characteristics and the physical resources called by the first application.

[0067] In method one, it is necessary to obtain in advance a first mapping relationship between instruction stream features and resource allocation patterns. The first mapping relationship includes multiple instruction stream features, and each instruction stream feature includes a corresponding resource allocation pattern. Optionally, the instruction stream features and the resource allocation pattern can be a one-to-one relationship or a many-to-one relationship. Therefore, in the case of obtaining the first mapping relationship between the instruction stream features and the resource allocation pattern, after obtaining the first instruction stream feature of the first application, the first instruction stream feature can be found in the first mapping relationship, and then the resource allocation pattern corresponding to the first instruction stream feature can be determined in the first mapping relationship.

[0068] The embodiment of the present application does not limit the method of obtaining the first mapping relationship. For example, it can be obtained by manual configuration based on experience, or it can be learned by machine learning methods based on the execution status of historical applications. In a possible implementation, obtaining the first mapping relationship between instruction stream features and resource allocation modes can include but are not limited to the following steps 1 to 4.

[0069] Step 1: During the execution of a historical application, multiple groups of instruction stream features and device operation features are obtained by sampling at time intervals, wherein one group of instruction stream features and one group of device operation features correspond to the same time interval.

[0070] Among them, the historical application refers to the application executed before the execution of the first application, and the historical application can be an application executed in the process of running any business before the execution of the first application. Optionally, the setting of the time interval is not limited in the embodiment of the present application, and can be a time interval of fixed length, for example, sampling is performed once every 10 minutes; or it can be a time interval of variable length, for example, the first time is sampled once every 10 minutes, the second time is sampled once every 11 minutes, the third time is sampled once every 12 minutes, and so on. Each time sampling is performed, the corresponding instruction stream characteristics and device operation characteristics will be obtained. After multiple samplings are performed to obtain multiple instruction stream characteristics and multiple device operation characteristics, the multiple instruction stream characteristics and multiple device operation characteristics can be time-aligned so that the same time interval corresponds to a set of instruction stream characteristics and device operation characteristics. For example, time interval 1 corresponds to instruction stream characteristics 1 and device operation characteristics 1, and time interval 2 corresponds to instruction stream characteristics 2 and device operation characteristics 2.

[0071] In a possible implementation, the device operation characteristics may include at least one of front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, TLB performance, OS performance, instruction mixed dependency, high-latency instruction distribution, cache behavior and branch behavior. In addition, the device operation characteristics may also include other characteristics that can indicate the operation status of the device. Among them, the front end is the front-end part of the processor, for example, the front-end server that interacts with the user, the front-end latency refers to the time consumed by the request data initiated by the user to be transmitted to the front end through the network, and the front-end bandwidth refers to the ability of the front end to transmit data. The back end runs in the background and is responsible for processing data and logic to control the content of the front end. The back-end execution occupancy refers to the memory occupied by the back-end execution business, and the back-end memory subsystem occupancy refers to the memory occupied by the back-end execution system software. The pipeline full load rate refers to the ratio of instructions carried on the pipeline of instruction execution. Memory access performance refers to the speed and efficiency of the access system when accessing data, and the speed and efficiency of the storage system when processing data. TLB performance refers to the ability of TLB to implement address translation. OS performance refers to the ability of OS to allocate hardware resources through resource management and task scheduling. Instruction mixed dependency refers to the resource dependency between instructions. High latency instruction distribution refers to the distribution of instructions that take a long time for the processor to execute. Cache behavior refers to the behavior of caching data in the cache area. Branch behavior refers to the behavior of operations separated from the main line of the program.

[0072] Optionally, the method of sampling to obtain instruction stream features can refer to the method of obtaining the first instruction stream features in step 201, which will not be repeated here. The method of sampling to obtain device operation features can be, through the performance (performance, ferf) tool, sampling to obtain architecture-related features in device operation features, for example, architecture-related features include front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, TLB performance and OS performance; through the xtrace tool, sampling to obtain architecture-independent features in device operation features, for example, architecture-independent features include instruction mixed dependency, cache behavior and branch behavior. Among them, the perf tool is a performance analysis tool for Linux, which can perform hot spot searches at the function level and instruction level, and can be used to analyze the CPU occupancy of hot functions in the program, so as to locate performance bottlenecks; the xtrace tool is a system call tracking tool used in the operating system, and its function is to be able to display the path of the system call and the functions passed through in the form of a stack.

[0073] Step 2, classify multiple groups of instruction flow features and device operation features to obtain multiple categories, the similarity between device operation features of different categories is greater than a first similarity threshold, the similarity between device operation features of the same category is less than a second similarity threshold, and the distance between instruction flow features of the same category is less than a distance threshold.

[0074] In an embodiment of the present application, the sampled multiple groups of instruction stream features and device operation features are divided into multiple categories according to the similarity of the device operation features, so that the similarity between the device operation features of different categories is greater than the first similarity threshold, and the similarity between the device operation features of the same category is less than the second similarity threshold. Among them, the first similarity threshold is greater than the second similarity threshold, and the values ​​of the first similarity threshold and the second similarity threshold can be flexibly set according to the application scenario, so that the device operation features with greater similarity can be classified into the same category, and the similarity between the device operation features of different categories is smaller. Since the device operation feature is a feature generated by the instruction of the device operation, and the instruction stream feature is a feature corresponding to the instruction of the operation, if the similarity between the two device operation features is large, then the similarity between the instruction stream features corresponding to the two device operation features is also large, so that when the multiple groups of instruction stream features and the device operation features are divided into multiple categories according to the similarity of the device operation features, the distance between the instruction stream features in the same category is less than the distance threshold. The distance threshold is related to the second similarity threshold, for example, the difference between the distance threshold and the second similarity threshold is small.

[0075] In one possible implementation, a method for classifying multiple groups of instruction flow features and device operation features to obtain multiple categories may be: clustering multiple device operation features in the multiple groups of instruction flow features and device operation features based on a first quantity, obtaining multiple clustering clusters according to the clustering results, wherein the similarity between device operation features of different clustering clusters is greater than a first similarity threshold, and the similarity between device operation features of the same clustering cluster is less than a second similarity threshold; if the distance between instruction flow features in any clustering cluster among the multiple clustering clusters is less than a distance threshold, obtaining multiple categories according to the first number of clustering clusters; if the distance between instruction flow features in any clustering cluster among the multiple clustering clusters is not less than the distance threshold, clustering multiple device operation features in the multiple groups of instruction flow features and device operation features based on a second quantity, reacquiring multiple clustering clusters, and if the distance between instruction flow features in any clustering cluster among the reacquired multiple clustering clusters is less than the distance threshold, obtaining multiple categories according to the second number of reacquired clustering clusters. Among them, the first number and the second number can be flexibly set according to experience or application scenarios, and the embodiments of the present application do not limit it. That is, clustering is attempted according to different numbers until the clustering result meets the classification requirements.

[0076] Among them, the clustering algorithm used to cluster the operation characteristics of multiple devices is not limited in the embodiment of the present application. Optionally, the clustering algorithm includes but is not limited to: a hierarchical clustering algorithm, a K-means clustering algorithm (k-means clustering algorithm, K-means), an expectation-maximization (EM) algorithm, a K-nearest neighbor algorithm (kNN) or a density-based clustering method, etc. The density-based clustering method includes a density-based spatial clustering of applications with noise (DBSCAN) algorithm and a maximum density clustering application (MDCA) algorithm. The embodiment of the present application does not limit the type of similarity between the operation characteristics of the devices. For example, the similarity between the instruction stream features can be the Euclidean distance, Manhattan distance, Chebyshev distance or Minkowski distance between the instruction stream features.

[0077] Step 3: for any category among the multiple categories, obtain a resource allocation mode corresponding to any category according to the equipment operation characteristics included in any category.

[0078] After multiple categories are obtained through classification, each category includes at least one device operation feature. When there are multiple at least one device operation feature, the similarity between the multiple device operation features is greater than the first similarity threshold, that is, the multiple device operation features have similar commonalities. In an embodiment of the present application, device operation features with similar commonalities can be determined as a resource allocation mode. For example, if the device operation features included in any category all indicate that the CPU occupancy ratio is the largest, that is, the common point of the device operation features included in any category is that the CPU occupancy ratio is large, then the resource allocation mode corresponding to any category can be determined to be CPU intensive. Therefore, the resource allocation mode corresponding to any category can be obtained based on the commonalities between the device operation features included in any category.

[0079] Optionally, obtaining the resource allocation pattern corresponding to any category based on the device operation characteristics included in any category may include obtaining the resource allocation pattern corresponding to any category based on the device operation characteristics that are closest to the center of the cluster in any category; or, obtaining the resource allocation pattern corresponding to any category based on K device operation characteristics that are closer to the center of the cluster in any category, where K is a positive integer.

[0080] Step 4: Acquire a first mapping relationship based on the resource allocation modes corresponding to the multiple categories and at least one instruction stream feature included in the multiple categories.

[0081] After obtaining the resource allocation mode corresponding to any category according to the device operation characteristics included in any category, the resource allocation modes corresponding to multiple categories can be obtained, and each category includes at least one instruction stream feature, and then the correspondence between at least one instruction stream feature included in any category and the resource allocation mode corresponding to the category can be obtained, that is, the first mapping relationship is obtained. Exemplarily, category 1 includes instruction stream feature 1 and device operation feature 1, instruction stream feature 2 and device operation feature 2, and instruction stream feature 3 and device operation feature 3, and device operation feature 1, device operation feature 2, and device operation feature 3 correspond to resource allocation mode 1. Then, in the first mapping relationship, instruction stream feature 1 corresponds to resource allocation mode 1, instruction stream feature 2 corresponds to resource allocation mode 1, and instruction stream feature 3 corresponds to resource allocation mode 1.

[0082] Thus, the first mapping relationship is obtained through the above steps 1-4. Since the instruction stream features in the first mapping relationship are obtained through real sampling, the first mapping relationship obtained is more authentic. Since the resource allocation mode in the first mapping relationship is obtained through classification, the operating features of devices of the same category can be classified into one resource allocation mode, making the first mapping relationship obtained more accurate. In addition, the accuracy of the multiple categories obtained can be improved by multiple clustering methods.

[0083] Method 2: Determine the resource allocation mode corresponding to the first instruction stream feature based on the resource calculation model, and the resource calculation model is used to output the corresponding resource allocation mode according to the input instruction stream feature; determine the first resource allocation mode of the first application based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

[0084] In the second method, it is necessary to obtain the resource calculation model in advance. The method of obtaining the resource calculation model is not limited in the embodiment of the present application, and the resource calculation model can be used to output the corresponding resource allocation mode according to the input instruction stream characteristics. Optionally, the method of obtaining the resource calculation model is similar to the method of obtaining the first mapping relationship. In the process of executing the historical application, multiple groups of instruction stream characteristics and device operation characteristics are sampled according to time intervals, and a group of instruction stream characteristics and device operation characteristics correspond to the same time interval; the initial calculation model is trained based on the multiple groups of instruction stream characteristics and device operation characteristics, and the resource calculation model is obtained according to the trained initial calculation model.

[0085] Regardless of the above-mentioned method 1 or method 2, after determining the resource allocation mode corresponding to the first instruction stream feature, the first resource allocation mode of the first application can be determined based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources currently called by the first application. For example, if the resource allocation mode corresponding to the first instruction stream feature is FPGA-intensive, and the physical resources currently called by the first application include FPGA, then the first resource allocation mode of the first application is determined to be FPGA-intensive.

[0086] Step 203: Optimize the physical resources called by the first application based on the first resource allocation mode.

[0087] In the embodiment of the present application, since the resource allocation mode can indicate the ratio mode of the physical resources to be called, the physical resources matching the first resource allocation mode can be obtained based on the first resource allocation mode, and then the physical resources called by the first application are optimized according to the physical resources matching the first resource allocation mode, so that the optimized physical resources match the first resource allocation mode, that is, the optimized physical resources match the executed first application. The physical resources can be heterogeneous resources composed of multiple resources in different proportions, for example, 50% of memory plus 50% of CPU; the physical resources can also be heterogeneous resources composed of multiple resources in different unit quantities, for example, 10 megabytes (MB) of memory plus 3 megahertz (MHz) of CPU.

[0088] In a possible implementation, the method for optimizing the physical resources called by the first application based on the first resource allocation mode can be, based on the second mapping relationship between the resource allocation mode and the physical resource, obtaining the first physical resource corresponding to the first resource allocation mode; optimizing the physical resource called by the first application according to the first physical resource. The second mapping relationship between the resource allocation mode and the physical resource includes a one-to-one correspondence between multiple resource allocation modes and multiple physical resources. Therefore, on the basis of obtaining the second mapping relationship between the resource allocation mode and the physical resource, after determining the first resource allocation mode corresponding to the first application, the first resource allocation mode can be queried in the second mapping relationship, and then the first physical resource corresponding to the first resource allocation mode can be determined in the second mapping relationship.

[0089] The embodiment of the present application does not limit the method for obtaining the second mapping relationship between the resource allocation mode and the physical resources. Optionally, the second mapping relationship between the resource allocation mode and the physical resources can be manually configured according to experience or experimental methods, or reasonable physical resources can be automatically configured for different resource allocation modes through a machine learning model. Optionally, physical resources may include CPU, GPU, ASIC, FPGA, storage unit and memory unit; then based on the second mapping relationship between the resource allocation mode and the physical resources, obtaining the first physical resource corresponding to the first resource allocation mode may include, when the first resource allocation mode is target resource intensive, the first physical resource includes a first proportion of target resources and a second proportion of other resources, the target resource is any one of the physical resources, and the other resources are resources other than the target resources in the physical resources, and the first proportion is greater than the second proportion. The value of the second proportion of the first proportion can be set according to experience, or flexibly adjusted according to the application scenario.

[0090] Combination Figure 3 and Figure 4 The schematic diagram shown in the figure describes the process of obtaining the first mapping relationship and the second mapping relationship by example. Among them, the business input module runs the business by building a business operation enabling platform and a background configuration environment. The business can include businesses in the computing and storage fields, such as big data, databases, distributed storage, virtualization, artificial intelligence (AI) computing, high performance computing (HPC) computing, rendering and other related platforms and corresponding test cases.

[0091] The time interval sampling module samples the equipment operation characteristics and instruction flow characteristics during the business operation process at time intervals. The equipment operation characteristics are obtained through operation state sampling, including but not limited to calculation characteristics, memory access characteristics and input output (IO) characteristics; instruction flow characteristics are obtained through instruction flow sampling, including but not limited to instruction distribution characteristics, BBV distribution characteristics and hot function characteristics. The time alignment module aligns the equipment operation characteristics and instruction flow characteristics of different time intervals according to the timestamp to obtain multiple sets of paired equipment operation characteristics and instruction flow characteristics.

[0092] The clustering module uses an adaptive unsupervised clustering method to give an initial number of clusters. For example, the initial number of clusters is 3. The device operation characteristics and instruction flow characteristics of different time intervals can be called device operation characteristics and instruction flow characteristics of different time slices. Cluster different time slices based on the device operation characteristics to obtain multiple cluster cluster results. The time slices closest to and farthest from the cluster center in each cluster are traversed, and the Euclidean distance between the instruction flow characteristics included in the nearest and farthest time slices is counted. If the Euclidean distance is greater than the set threshold, the number of clusters is modified and clustering is performed again; if the Euclidean distance is less than the set threshold, clustering is completed and the next resource allocation mode module is entered.

[0093] The resource allocation mode module analyzes the typical resource allocation mode corresponding to each cluster based on the cluster results. For example, it extracts K device operation features that are closer to the center of the cluster, where K is a positive integer, and counts the common points of the K device operation features or the device operation features that play a leading role in the K device operation features, and then determines the typical resource allocation mode representing the cluster based on the common points or the device operation features that play a leading role. Exemplarily, the resource allocation mode may include CPU intensive, GPU intensive, ASIC intensive, FPGA intensive, or memory intensive. Thus, the first mapping relationship is obtained based on the instruction stream features included in each cluster and the resource allocation mode corresponding to each cluster.

[0094] The physical resource module allocates the most suitable physical resources for each resource allocation mode. The physical resources can be obtained by heterogeneous combination of multiple resources in the resource pool, and then the second mapping relationship between the resource allocation mode and the physical resources is obtained. The resource pool may include a CPU pool, a memory pool, a storage pool, a GPU acceleration pool, an ASIC pool, and an FPGA pool. Therefore, the automatic selection of various resources can be achieved through the first mapping relationship and the second mapping relationship, which not only provides a standardized process for the reasonable scheduling and combination of heterogeneous computing power and storage hardware resources, but also can realize fine-grained resource scheduling and realize the proportional combination of heterogeneous resources, so as to achieve the purpose of adaptively adjusting the hardware configuration for different applications.

[0095] Optionally, the execution request of the first application may be received within the first time period; then, when the execution request of the second application is received within the second time period, the second instruction stream feature of the second application is also obtained, the second application includes multiple second instructions, and the second instruction stream feature indicates the features of multiple second instructions; the second resource allocation mode of the second application is determined according to the second instruction stream feature and the physical resources called by the second application; the physical resources called by the second application are optimized based on the second resource allocation mode. Among them, the first application and the second application may be applications of the same business or applications of different businesses, the second time period may be a time period after the first time period, and optionally, the second time period may also be adjacent to the first time period. For different applications in different time periods, different physical resources can be flexibly scheduled to make the time granularity of resource scheduling finer. Resource scheduling refers to optimizing the physical resources that have been called so that the optimized physical resources match the resource scheduling mode corresponding to the instruction stream feature.

[0096] The method provided in the embodiment of the present application, since the instruction stream characteristics indicate the characteristics of multiple instructions included in the application, the resource allocation pattern determined by the instruction stream characteristics of the application is adapted to the multiple instructions included in the application, and then the physical resources called by the application are optimized based on the resource allocation pattern, so that the physical resources called by the optimized application can be adapted to the multiple instructions included in the application, realizing application-driven resource scheduling, making the granularity of resource scheduling finer, and thereby improving the resource utilization of physical resources for different applications.

[0097] The resource scheduling method of the embodiment of the present application is introduced above. Corresponding to the above method, the embodiment of the present application also provides a resource scheduling device. Figure 5 is a schematic diagram of a resource scheduling device provided in an embodiment of the present application, based on Figure 5 As shown in the following multiple modules, the Figure 5 The resource scheduling device shown can execute Figure 2 It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown, and the embodiments of the present application are not limited to this. Figure 5 As shown, the device comprises:

[0098] The acquisition module 501 is used to acquire a first instruction stream feature of the first application program when receiving an execution request of the first application program, the first application program includes a plurality of first instructions, and the first instruction stream feature indicates features of the plurality of first instructions;

[0099] A determination module 502, configured to determine a first resource allocation mode of the first application program according to a first instruction stream feature and physical resources called by the first application program;

[0100] The optimization module 503 is used to optimize the physical resources called by the first application based on the first resource allocation mode.

[0101] In one possible implementation, the determination module 502 is used to determine the resource allocation mode corresponding to the first instruction stream feature based on a first mapping relationship between the instruction stream feature and the resource allocation mode; and to determine the first resource allocation mode of the first application based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

[0102] In a possible embodiment, the device also includes: a sampling module, which is used to obtain multiple groups of instruction flow features and device operation features by sampling according to time intervals during the execution of historical applications, and a group of instruction flow features and device operation features correspond to the same time interval; a classification module, which is used to classify the multiple groups of instruction flow features and device operation features to obtain multiple categories, the similarity between device operation features of different categories is greater than a first similarity threshold, the similarity between device operation features of the same category is less than a second similarity threshold, and the distance between instruction flow features of the same category is less than a distance threshold; the acquisition module 501 is also used to obtain a resource allocation pattern corresponding to any category among the multiple categories according to the device operation features included in any category, and obtain a first mapping relationship based on the resource allocation patterns corresponding to the multiple categories and at least one instruction flow feature included in the multiple categories.

[0103] In one possible implementation, a classification module is used to cluster multiple device operation features among multiple groups of instruction stream features and device operation features based on a first quantity, and obtain multiple clusters according to the clustering results, wherein the similarity between device operation features of different clusters is greater than a first similarity threshold, and the similarity between device operation features of the same cluster is less than a second similarity threshold; if the distance between instruction stream features within any cluster among the multiple clusters is less than a distance threshold, multiple categories are obtained according to the first number of clusters.

[0104] In one possible implementation, a classification module is used to cluster multiple device operation features among multiple groups of instruction flow features and device operation features based on a first quantity, and obtain multiple clustering clusters according to the clustering results, wherein the similarity between device operation features of different clustering clusters is greater than a first similarity threshold, and the similarity between device operation features of the same clustering cluster is less than a second similarity threshold; if the distance between instruction flow features within any clustering cluster among the multiple clustering clusters is not less than the distance threshold, cluster multiple device operation features among the multiple groups of instruction flow features and device operation features based on a second quantity, and reacquire multiple clustering clusters; if the distance between instruction flow features within any clustering cluster among the reacquired multiple clustering clusters is less than the distance threshold, obtain multiple categories according to the second number of reacquired clustering clusters.

[0105] In one possible implementation, determination module 502 is used to determine the resource allocation mode corresponding to the first instruction stream feature based on a resource calculation model, and the resource calculation model is used to output a corresponding resource allocation mode according to the input instruction stream feature; and to determine the first resource allocation mode of the first application based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

[0106] In a possible implementation, the optimization module 503 is used to obtain the first physical resource corresponding to the first resource allocation mode based on the second mapping relationship between the resource allocation mode and the physical resource; and optimize the physical resource called by the first application according to the first physical resource.

[0107] In one possible implementation, the physical resources include a CPU, a GPU, an ASIC, an FPGA, a storage unit, and a memory unit; the optimization module 503 is used for, when the first resource allocation mode is target resource intensive, the first physical resources include a first proportion of target resources and a second proportion of other resources, the target resources are any type of resource among the physical resources, the other resources are resources among the physical resources except the target resources, and the first proportion is greater than the second proportion.

[0108] In one possible implementation, the acquisition module 501 is used to acquire a first instruction stream characteristic of a first application when an execution request of the first application is received within a first time period; the acquisition module 501 is also used to acquire a second instruction stream characteristic of a second application when an execution request of the second application is received within a second time period, the second application includes multiple second instructions, and the second instruction stream characteristic indicates the characteristics of the multiple second instructions; the determination module 503 is also used to determine a second resource allocation mode of the second application based on the second instruction stream characteristic and the physical resources called by the second application; the optimization module 503 is also used to optimize the physical resources called by the second application based on the second resource allocation mode.

[0109] In a possible implementation, the first instruction stream feature includes an instruction unit distribution feature, a BBV distribution feature, and a hotspot function feature.

[0110] In one possible implementation, the device operating characteristics include front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, TLB performance, OS performance, instruction mix dependency, high-latency instruction distribution, cache behavior, and branch behavior.

[0111] It should be understood that the above Figure 5 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0112] See also Figure 6 , Figure 6 A schematic diagram of the structure of a network device 2000 provided by an exemplary embodiment of the present application is shown. Figure 6 The network device 2000 shown is used to perform the above Figure 2 The operations involved in the resource scheduling method shown. The network device 2000 is, for example, a switch, a router, etc. The network device 2000 can be implemented by a general bus architecture.

[0113] like Figure 6 As shown, the network device 2000 includes at least one processor 2001 , a memory 2003 , and at least one communication interface 2004 .

[0114] The processor 2001 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing units (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0115] Optionally, the network device 2000 further includes a bus. The bus is used to transmit information between the components of the network device 2000. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0116] The memory 2003 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 can also be integrated with the processor 2001.

[0117] The communication interface 2004 uses any transceiver type device for communicating with other devices or communication networks, and the communication network can be Ethernet, radio access network (radio access network, RAN) or wireless local area network (wireless local area networks, WLAN) and the like. The communication interface 2004 can include a wired communication interface and can also include a wireless communication interface. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (Fast Ethernet, FE) interface, a Gigabit Ethernet (Gigabit Ethernet, GE) interface, an Asynchronous Transfer Mode (Asynchronous Transfer Mode, ATM) interface, a wireless local area network (wireless local area networks, WLAN) interface, a cellular network communication interface or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. In an embodiment of the present application, the communication interface 2004 can be used for the network device 2000 to communicate with other devices.

[0118] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as Figure 60 and CPU1 shown in FIG. Each of these processors may be a single-core CPU processor or a multi-core CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0119] In a specific implementation, as an embodiment, the network device 2000 may include multiple processors, such as Figure 6 2001 and 2005 are shown in FIG. Each of these processors may be a single-core CPU or a multi-core CPU. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0120] In a specific implementation, as an embodiment, the network device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and may display information in a variety of ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 2001 and may receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensor device.

[0121] In some embodiments, the memory 2003 is used to store the program code 2010 for executing the solution of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the network device 2000 can implement the resource scheduling method provided by the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself can also store the program code or instruction for executing the solution of the present application.

[0122] In a specific embodiment, the network device 2000 of the embodiment of the present application may correspond to the resource scheduling device in each of the above-mentioned method embodiments, and the processor 2001 in the network device 2000 reads the instruction in the memory 2003, so that Figure 6 The illustrated network device 2000 is capable of performing all or part of the operations performed by a resource scheduling device.

[0123] Specifically, processor 2001 is used to obtain a first instruction stream characteristic of the first application upon receiving an execution request of the first application, the first application including multiple first instructions, and the first instruction stream characteristic indicating characteristics of the multiple first instructions; determine a first resource allocation mode of the first application based on the first instruction stream characteristic and the physical resources called by the first application; and optimize the physical resources called by the first application based on the first resource allocation mode.

[0124] For the sake of brevity, other optional implementations are not described here in detail.

[0125] The network device 2000 may also correspond to the above Figure 5 In the resource scheduling device shown, each functional module in the resource scheduling device is implemented by software of the network device 2000. In other words, the functional modules included in the resource scheduling device are generated after the processor 2001 of the network device 2000 reads the program code 2010 stored in the memory 2003.

[0126] in, Figure 2 Each step of the resource scheduling method shown is completed by an integrated logic circuit of hardware or software instructions in the processor of the network device 2000. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0127] See also Figure 7 , Figure 7 FIG. 2 shows a schematic diagram of the structure of a network device 2100 provided by another exemplary embodiment of the present application. Figure 7 The network device 2100 shown is used to perform the above Figure 2 All or part of the operations involved in the resource scheduling method shown. The network device 2100 is, for example, a switch, a router, etc. The network device 2100 can be implemented by a general bus architecture.

[0128] like Figure 7 As shown, the network device 2100 includes: a main control board 2110 and an interface board 2130 .

[0129] The main control board is also called a main processing unit (MPU) or a route processor card. The main control board 2110 is used to control and manage various components in the network device 2100, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes: a central processing unit 2111 and a memory 2112.

[0130] The interface board 2130 is also called a line processing unit (LPU), a line card (linecard) or a service board. The interface board 2130 is used to provide various service interfaces and realize the forwarding of data packets. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET / SDH) interface, etc., and the Ethernet interface is, for example, a Flexible Ethernet Service Interface (Flexible Ethernet Clients, FlexE Clients). The interface board 2130 includes: a central processing unit 2131, a network processor 2132, a forwarding table entry memory 2134 and a physical interface card (physical interface card, PIC) 2133.

[0131] The central processor 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processor 2111 on the main control board 2110 .

[0132] The network processor 2132 is used to implement the forwarding processing of the message. The network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is used to forward the received message based on the forwarding table stored in the forwarding table entry memory 2134. If the destination address of the message is the address of the network device 2100, the message is sent to the CPU (such as the central processor 2131) for processing; if the destination address of the message is not the address of the network device 2100, the next hop and the output interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to the output interface corresponding to the destination address. Among them, the processing of the uplink message may include: processing of the message input interface, forwarding table search; the processing of the downlink message may include: forwarding table search, etc. In some embodiments, the central processor can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that the forwarding chip is not required in the interface board.

[0133] The physical interface card 2133 is used to implement the physical layer docking function, whereby the original traffic enters the interface board 2130, and the processed message is sent out from the physical interface card 2133. The physical interface card 2133, also called a daughter card, can be installed on the interface board 2130, and is responsible for converting the photoelectric signal into a message and forwarding the message to the network processor 2132 for processing after checking the legitimacy of the message. In some embodiments, the central processor 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2132 is not required in the physical interface card 2133.

[0134] Optionally, the network device 2100 includes multiple interface boards, for example, the network device 2100 further includes an interface board 2140, and the interface board 2140 includes: a central processor 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation methods of the components in the interface board 2140 are the same or similar to those of the interface board 2130, and are not described in detail here.

[0135] Optionally, the network device 2100 further includes a switching fabric board 2120. The switching fabric board 2120 may also be referred to as a switch fabric unit (SFU). When the network device 2100 has multiple interface boards, the switching fabric board 2120 is used to complete data exchange between the interface boards. For example, the interface board 2130 and the interface board 2140 may communicate via the switching fabric board 2120.

[0136] The main control board 2110 is coupled to the interface board. For example, the main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane through the system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface board 2130 and the interface board 2140, and the main control board 2110 and the interface board 2130 and the interface board 2140 communicate through the IPC channel.

[0137] Logically, the network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit 2111. The forwarding plane includes various components for performing forwarding, such as a forwarding table entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the network device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 2132 forwards the message received by the physical interface card 2133 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.

[0138] It is worth noting that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly realize load sharing and redundant backup. In a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for the processing function of the service data of the entire system. In a distributed forwarding architecture, the network device may have at least one switching network board, and the switching network board is used to realize data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with distributed architectures are greater than those of network devices with centralized architectures. Optionally, the network device may have only one board, that is, no switching board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two. This type of network device has low data exchange and processing capabilities (for example, low-end switches or routers and other network devices). The specific architecture to be adopted depends on the specific networking deployment scenario, and no limitation is made here.

[0139] In a specific embodiment, the network device 2100 corresponds to the above Figure 5 In some embodiments, Figure 5 The acquisition module 501 , determination module 502 and optimization module 503 in the resource scheduling apparatus shown are equivalent to the central processor 2111 or the network processor 2132 in the network device 2100 .

[0140] Figure 8 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 800 may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and one or more memories 802, wherein the one or more memories 802 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 801, so that the server implements the resource scheduling method provided in the above-mentioned various method embodiments. Of course, the server 800 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 800 may also include other components for implementing device functions, which will not be described in detail here.

[0141] It should be understood that the processor may be a CPU, or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced reduced instruction set machine (ARM) architecture.

[0142] Further, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0143] The memory may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (DR RAM).

[0144] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction is stored. The instruction is loaded and executed by a processor so that a computer implements any of the above resource scheduling methods.

[0145] The embodiments of the present application also provide a computer program (product), which, when executed by a computer, can enable a processor or a computer to execute the corresponding steps and / or processes in the above method embodiments.

[0146] An embodiment of the present application also provides a chip, including a processor, for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes any of the above resource scheduling methods.

[0147] An embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any of the above resource scheduling methods.

[0148] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (solid state disk)), etc.

[0149] Those of ordinary skill in the art will appreciate that, in conjunction with the various method steps and modules described in the embodiments disclosed herein, they can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0150] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0151] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or divided between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.

[0152] The computer program code for realizing the method for the embodiment of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by a computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.

[0153] In the context of the embodiments of the present application, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like.

[0154] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0155] A machine-readable medium may be any tangible medium that contains or stores a program for or related to an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0156] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0157] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.

[0158] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0159] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0160] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0161] In the present application, the terms "first", "second", etc. are used to distinguish between identical or similar items having substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image. Both the first image and the second image may be images, and in some cases, may be separate and different images.

[0162] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0163] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple second messages means two or more second messages. The terms "system" and "network" are often used interchangeably herein.

[0164] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0165] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0166] It should also be understood that the term “comprise” (also known as “includes,” “including,” “comprises” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0167] It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrases "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.

[0168] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.

[0169] It should also be understood that the references to "one embodiment", "an embodiment", or "a possible implementation" throughout the specification mean that specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment", or "a possible implementation" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0170] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A resource scheduling method, characterized in that: The method comprises: Upon receiving an execution request of a first application, obtaining a first instruction stream feature of the first application, wherein the first application includes a plurality of first instructions, and the first instruction stream feature indicates a feature of the plurality of first instructions; Determining a first resource allocation mode of the first application program according to the first instruction stream characteristics and the physical resources called by the first application program; The physical resources called by the first application are optimized based on the first resource allocation mode.

2. The method according to claim 1, characterized in that Determining the first resource allocation mode of the first application program according to the first instruction stream characteristics and the physical resources called by the first application program includes: Based on a first mapping relationship between instruction stream characteristics and resource allocation modes, determining a resource allocation mode corresponding to the first instruction stream characteristics; A first resource allocation mode of the first application is determined according to the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

3. The method according to claim 2, characterized in that Before determining the resource allocation mode corresponding to the first instruction stream feature based on the first mapping relationship between the instruction stream feature and the resource allocation mode, the method further includes: In the process of executing the historical application, multiple groups of instruction stream features and device operation features are obtained by sampling according to time intervals, and one group of instruction stream features and device operation features corresponds to the same time interval; Classifying the multiple groups of instruction flow features and device operation features to obtain multiple categories, wherein the similarity between device operation features of different categories is greater than a first similarity threshold, the similarity between device operation features of the same category is less than a second similarity threshold, and the distance between instruction flow features of the same category is less than a distance threshold; For any category among the multiple categories, acquiring a resource allocation mode corresponding to the any category according to the device operation characteristics included in the any category; The first mapping relationship is acquired based on the resource allocation modes respectively corresponding to the multiple categories and at least one instruction stream feature respectively included in the multiple categories.

4. The method according to claim 3, characterized in that The multiple groups of instruction stream features and device operation features are classified to obtain multiple categories, including: Clustering multiple device operation features in the multiple groups of instruction stream features and device operation features based on the first quantity, and obtaining multiple clusters according to the clustering results, wherein the similarity between the device operation features of different clusters is greater than the first similarity threshold, and the similarity between the device operation features of the same cluster is less than the second similarity threshold; If the distance between the instruction stream features in any cluster of the plurality of clusters is less than the distance threshold, the plurality of categories are obtained according to the first number of clusters.

5. The method according to claim 3, characterized in that: The multiple groups of instruction stream features and device operation features are classified to obtain multiple categories, including: Clustering multiple device operation features in the multiple groups of instruction stream features and device operation features based on the first quantity, and obtaining multiple clusters according to the clustering results, wherein the similarity between the device operation features of different clusters is greater than the first similarity threshold, and the similarity between the device operation features of the same cluster is less than the second similarity threshold; If the distance between the instruction stream features in any one of the multiple clustering clusters is not less than the distance threshold, cluster the multiple groups of instruction stream features and multiple device operation features in the device operation features based on a second number, and reacquire the multiple clustering clusters; if the distance between the instruction stream features in any one of the multiple clustering clusters reacquired is less than the distance threshold, obtain the multiple categories according to the second number of clustering clusters reacquired.

6. The method according to claim 1, characterized in that Determining the first resource allocation mode of the first application program according to the first instruction stream characteristics and the physical resources called by the first application program includes: Determining a resource allocation mode corresponding to the first instruction stream feature based on a resource calculation model, wherein the resource calculation model is used to output a corresponding resource allocation mode according to the input instruction stream feature; A first resource allocation mode of the first application is determined according to the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

7. The method according to any one of claims 1 to 6, characterized in that: The optimizing the physical resources called by the first application based on the first resource allocation mode includes: Based on a second mapping relationship between resource allocation modes and physical resources, obtaining a first physical resource corresponding to the first resource allocation mode; The physical resources called by the first application are optimized according to the first physical resources.

8. The method according to claim 7, characterized in that The physical resources include a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a storage unit, and a memory unit; The acquiring, based on a second mapping relationship between a resource allocation mode and a physical resource, a first physical resource corresponding to the first resource allocation mode includes: When the first resource allocation mode is target resource intensive, the first physical resources include a first proportion of target resources and a second proportion of other resources, the target resource is any one of the physical resources, the other resources are resources in the physical resources other than the target resource, and the first proportion is greater than the second proportion.

9. The method according to any one of claims 1 to 8, characterized in that: The step of obtaining, upon receiving an execution request of a first application, a first instruction stream feature of the first application includes: When receiving an execution request of a first application program within a first time period, obtaining a first instruction stream feature of the first application program; The method further comprises: When receiving an execution request of a second application within a second time period, obtaining a second instruction stream feature of the second application, the second application including a plurality of second instructions, the second instruction stream feature indicating a feature of the plurality of second instructions; Determining a second resource allocation mode of the second application program according to the second instruction stream characteristics and the physical resources called by the second application program; The physical resources called by the second application are optimized based on the second resource allocation mode.

10. The method according to any one of claims 1 to 9, characterized in that: The first instruction stream features include instruction unit distribution features, basic block vector (BBV) distribution features and hotspot function features.

11. The method according to any one of claims 3 to 5, characterized in that: The device operation characteristics include front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, transform index buffer TLB performance, operating system OS performance, instruction mix dependency, high-latency instruction distribution, cache behavior and branch behavior.

12. A resource scheduling device, characterized in that: The device comprises: an acquisition module, configured to acquire, upon receiving an execution request of a first application, a first instruction stream feature of the first application, wherein the first application includes a plurality of first instructions, and the first instruction stream feature indicates a feature of the plurality of first instructions; a determination module, configured to determine a first resource allocation mode of the first application program according to the first instruction stream characteristics and the physical resources called by the first application program; An optimization module is used to optimize the physical resources called by the first application based on the first resource allocation mode.

13. The device according to claim 12, characterized in that The determination module is used to determine the resource allocation mode corresponding to the first instruction stream feature based on a first mapping relationship between the instruction stream feature and the resource allocation mode; and determine the first resource allocation mode of the first application according to the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application.

14. The device according to claim 13, characterized in that The device also includes: A sampling module is used to obtain multiple groups of instruction flow characteristics and device operation characteristics by sampling at time intervals during the execution of historical application programs, wherein a group of instruction flow characteristics and device operation characteristics correspond to the same time interval; a classification module, configured to classify the plurality of groups of instruction stream features and device operation features to obtain a plurality of categories, wherein the similarity between device operation features of different categories is greater than a first similarity threshold, the similarity between device operation features of the same category is less than a second similarity threshold, and the distance between instruction stream features of the same category is less than a distance threshold; The acquisition module is also used to acquire the resource allocation mode corresponding to any category among the multiple categories according to the device operation characteristics included in the any category; and acquire the first mapping relationship based on the resource allocation modes corresponding to the multiple categories and at least one instruction stream feature respectively included in the multiple categories.

15. The device according to claim 14, characterized in that The classification module is used to cluster multiple device operation features among the multiple groups of instruction stream features and device operation features based on a first quantity, and obtain multiple clusters according to the clustering results, the similarity between the device operation features of different clusters is greater than the first similarity threshold, and the similarity between the device operation features of the same cluster is less than the second similarity threshold; if the distance between the instruction stream features within any cluster among the multiple clusters is less than the distance threshold, the multiple categories are obtained according to the first number of clusters.

16. The device according to claim 14, characterized in that The classification module is used to cluster multiple device operation features among the multiple groups of instruction flow features and device operation features based on a first quantity, and obtain multiple clustering clusters according to the clustering results, the similarity between the device operation features of different clustering clusters is greater than the first similarity threshold, and the similarity between the device operation features of the same clustering cluster is less than the second similarity threshold; if the distance between the instruction flow features in any clustering cluster among the multiple clustering clusters is not less than the distance threshold, cluster the multiple device operation features among the multiple groups of instruction flow features and device operation features based on a second quantity, and re-acquire multiple clustering clusters; if the distance between the instruction flow features in any clustering cluster among the re-acquired multiple clustering clusters is less than the distance threshold, obtain the multiple categories according to the second number of re-acquired clustering clusters.

17. The device according to claim 12, characterized in that The determination module is used to determine the resource allocation mode corresponding to the first instruction stream feature based on a resource calculation model, and the resource calculation model is used to output the corresponding resource allocation mode according to the input instruction stream feature; based on the resource allocation mode corresponding to the first instruction stream feature and the physical resources called by the first application, determine the first resource allocation mode of the first application.

18. The device according to any one of claims 12 to 17, characterized in that: The optimization module is used to obtain the first physical resource corresponding to the first resource allocation mode based on the second mapping relationship between the resource allocation mode and the physical resource; and optimize the physical resource called by the first application according to the first physical resource.

19. The device according to claim 18, characterized in that The physical resources include a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a storage unit, and a memory unit; The optimization module is used for, when the first resource allocation mode is target resource intensive, the first physical resources include a first proportion of target resources and a second proportion of other resources, the target resources are any one of the physical resources, the other resources are resources in the physical resources except the target resources, and the first proportion is greater than the second proportion.

20. The device according to any one of claims 12 to 19, characterized in that: The acquisition module is used to acquire a first instruction stream feature of the first application program when receiving an execution request of the first application program within a first time period; The acquisition module is further used to obtain the second instruction stream characteristics of the second application when an execution request of the second application is received within a second time period, the second application includes multiple second instructions, and the second instruction stream characteristics indicate the characteristics of the multiple second instructions; the determination module is further used to determine the second resource allocation mode of the second application based on the second instruction stream characteristics and the physical resources called by the second application; the optimization module is further used to optimize the physical resources called by the second application based on the second resource allocation mode.

21. The device according to any one of claims 12 to 20, characterized in that: The first instruction stream features include instruction unit distribution features, basic block vector (BBV) distribution features and hotspot function features.

22. The device according to any one of claims 14 to 16, characterized in that: The device operation characteristics include front-end latency, front-end bandwidth, back-end execution occupancy, back-end memory subsystem occupancy, pipeline full load rate, memory access performance, transform index buffer TLB performance, operating system OS performance, instruction mix dependency, high-latency instruction distribution, cache behavior and branch behavior.

23. A server, characterized in that: The server includes: a processor, the processor is coupled to a memory, the memory stores at least one program instruction or code, and the at least one program instruction or code is loaded and executed by the processor so that the server implements the resource scheduling method described in any one of claims 1-11.

Citation Information

Cited By

  • Resource scheduling method and apparatus, and server

    EP4783003A1

  • Resource scheduling method and apparatus, and server

    WO2025082300A1