Method, apparatus, device, and storage medium for executing program instruction
Patent Information
- Application Number
- HK42023078268
- Authority / Receiving Office
- HK · HK
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-01-17
AI Technical Summary
The problem of wasted graphics processing unit (GPU) resources in cloud servers is mainly due to the long switching time between virtual machines and GPUs, resulting in low resource utilization.
By obtaining the instruction attribute information of the program instructions and the processing attribute information of the target processor, program instructions that meet the execution conditions of the target processor are selected, and the target processor is called to execute these instructions according to the resource information, thus avoiding the switching between the virtual machine and the processor manager.
It improves processor resource utilization, reduces resource contention and interference between program instructions, and improves execution accuracy.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a method, apparatus, device and storage medium for executing program instructions. Background Technology
[0002] With the development of cloud computing technology, cloud gaming, which relies on cloud computing, is becoming increasingly common. Cloud gaming is an online gaming technology based on cloud computing. In a cloud gaming scenario, the game is typically run by a cloud server, which renders the game scene as audio and video streams and transmits these streams to the player's terminal device via the network. The terminal device does not need to have powerful graphics processing and data processing capabilities; it only needs basic streaming media playback capabilities, the ability to receive player input commands, and the ability to send commands to the cloud server.
[0003] In practice, it has been found that cloud servers typically need to run multiple games simultaneously. Therefore, cloud servers use different virtual machines to run different games. However, the number of graphics processors (GPUs) used to render game scenes on a cloud server is limited. Currently, the main method is to switch between virtual machines and GPUs through a processor manager. Since the switching process between virtual machines and GPUs is time-consuming, it leads to a waste of GPU resources. Summary of the Invention
[0004] The technical problem to be solved by the embodiments of this application is to provide a program instruction execution method, apparatus, device and storage medium that can improve the resource utilization of the processor.
[0005] One embodiment of this application provides a method for executing program instructions, including: Obtain instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor; The agent process is invoked to filter program instructions that meet the execution conditions of the target processor from the application process based on the instruction attribute information and the processing attribute information, and these program instructions are selected as target program instructions. Based on the instruction attribute information, first resource information is predicted to describe the resources required by the target processor to execute the target program instructions; The target processor is invoked according to the first resource information to execute the target program instructions. One embodiment of this application provides a program instruction execution apparatus, including: The acquisition module is used to acquire instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor. The filtering module is used to call the agent process and, based on the instruction attribute information and the processing attribute information, filter out program instructions that meet the execution conditions of the target processor from the application process, and use them as target program instructions. The prediction module is used to predict, based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program instruction; An execution module is used to invoke the target processor based on the first resource information and execute the target program instructions.
[0006] Optionally, the instruction attribute information includes the instruction type of the program instruction and the application to which the program instruction belongs; The filtering module invokes the agent process to filter program instructions from the application process that meet the execution conditions of the target processor, based on the instruction attribute information and the processing attribute information, as target program instructions, including: The agent process is invoked to filter program instructions of the graphics processing type from the application process to obtain candidate program instructions; Based on the application to which the candidate program instruction belongs, predict second resource information for describing the resources required by the target processor to execute the candidate program instruction; Based on the second resource information and the processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process and used as target program instructions.
[0007] Optionally, the filtering module filters program instructions that meet the execution conditions of the target processor from the application process based on the second resource information and the processing attribute information, as target program instructions, including: If the second resource information is used to reflect the time resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required time resources are greater than the time limit are determined as the target program instructions that meet the execution conditions of the target processor; the time limit is determined based on the processing attribute information. If the second resource information is used to reflect the computing resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required computing resources are greater than the limited computing resources are determined as the target program instructions that meet the execution conditions of the target processor; the limited computing resources are determined based on the processing attribute information.
[0008] Optionally, the number of target program instructions is at least two, and the prediction module predicts first resource information based on the instruction attribute information to describe the resources required by the target processor to execute the target program instructions, including: Using a target resource identification model, the target program instruction P is identified. i Resource identification is performed using instruction attributes to obtain the instruction P that describes the target processor executing the target program. i Initial resource information required; i is a positive integer less than or equal to N, where N is the number of program instructions in at least two target program instructions; Based on the initial resource information corresponding to the remaining program instructions, the target program instruction P is... i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The first resource information of the required resources; the remaining program instructions are the at least two target program instructions excluding the target program instruction P. i Other than target program instructions.
[0009] Optionally, the initial resource information is used to reflect the execution of the target program instruction P by the target processor within a unit execution time slice. i At that time, the initial resource utilization rate of the target processor; the prediction module, based on the initial resource information corresponding to the remaining program instructions, adjusts the target program instruction P. i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The primary resource information required includes: For the target program instruction P i The initial resource utilization rate is summed with the initial resource utilization rate corresponding to the remaining program instructions to obtain the total initial resource utilization rate. The target program instruction P i The ratio between the corresponding initial resource utilization rate and the sum of the initial resource utilization rates is determined as the target program instruction P. i The corresponding adjusted resource utilization rate; The target program instruction P i The corresponding corrected resource utilization rate is determined as the rate used to describe the target processor executing the target program instruction P. i The first resource information required.
[0010] Optionally, the above-mentioned device also includes an adjustment module; The adjustment module is used to obtain instruction attribute information of the sample program instructions and labeled initial resource information to describe the resources required by the target processor to execute the sample program instructions; the sample program instructions are program instructions that satisfy the execution conditions of the target processor. A candidate resource identification model is used to predict the resources of the instruction attributes of the sample program instructions, so as to obtain the predicted initial resource information describing the resources required by the target processor to execute the sample program instructions; Based on the predicted initial resource information and the labeled initial resource information, the candidate resource identification model is adjusted to obtain the target resource identification model.
[0011] Optionally, the adjustment module adjusts the candidate resource identification model based on the predicted initial resource information and the labeled initial resource information to obtain the target resource identification model, including: Based on the predicted initial resource information and the labeled initial resource information, the resource prediction error of the candidate resource identification model is determined; If the resource prediction error is not in a convergent state, the candidate resource identification model is adjusted according to the resource prediction error; The adjusted candidate resource identification model is determined as the target resource identification model.
[0012] Optionally, the adjustment module sample program instructions belong to at least two game scenes of the game application, and the step of obtaining labeled initial resource information describing the resources required by the target processor to execute the sample program instructions includes: The sample program instructions obtained belong to the game scene Q. j At that time, the candidate resource utilization rate of the target processor executing the sample program instructions within a historical unit execution time slice; j is a positive integer less than or equal to M, where M is the number of game scenes in the game application; Based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instructions, the initial labeled resource information is determined to describe the resources required by the target processor to execute the sample program instructions.
[0013] Optionally, the execution module invokes the target processor based on the first resource information to execute the target program instructions, including: Obtain the unit execution time slice of the target processor; Based on the unit execution time slice and the target program instruction P i Based on the corresponding first resource information, the target program instruction P is determined. i The execution period; The target program instruction P is determined according to the execution time period.i Arranged in the instruction queue; According to the target program instruction P i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i .
[0014] Optionally, the execution module determines the execution time slice and the target program instruction P based on the unit execution time slice. i Based on the corresponding first resource information, the target program instruction P is determined. i The execution time period includes: According to the target program instruction P i The target program instruction P is determined by multiplying the corresponding modified resource utilization rate by the unit execution time slice. i Execution time; Based on the target program instruction P i The generation time is used to determine the target program instruction P. i The execution order; Based on the execution duration and the execution order, the target program instruction P is determined. i The execution period.
[0015] Optionally, the execution module executes the target program instruction P. i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i ,include: The proxy process is invoked as the target program instruction P. i Create an execution thread; When arranged in the target program instruction P i When all previous target program instructions have been executed, the execution thread is invoked to read the target program instruction P from the instruction queue. i The target processor is invoked to execute the target program instruction Pi.
[0016] Optionally, the execution module is further configured to obtain the execution result of the target program instructions from the target processor when the target program instructions have been executed; The proxy process is invoked to send the execution result back to the associated program instruction; the associated program instruction is a program instruction that has not been executed in the application process to which the target program instruction belongs and is related to the target program instruction.
[0017] This application provides a computer device, including: a processor and a memory; The aforementioned memory is used to store computer programs, and the aforementioned processor is used to invoke the aforementioned computer programs to perform the following steps: Obtain instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor; The agent process is invoked to filter program instructions that meet the execution conditions of the target processor from the application process based on the instruction attribute information and the processing attribute information, and these program instructions are selected as target program instructions. Based on the instruction attribute information, first resource information is predicted to describe the resources required by the target processor to execute the target program instructions; The target processor is invoked based on the first resource information to execute the target program instructions.
[0018] One embodiment of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the following steps: Obtain instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor; The agent process is invoked to filter program instructions that meet the execution conditions of the target processor from the application process based on the instruction attribute information and the processing attribute information, and these program instructions are selected as target program instructions. Based on the instruction attribute information, first resource information is predicted to describe the resources required by the target processor to execute the target program instructions; Based on the first resource information, the target processor is invoked to execute the target program instructions. One embodiment of this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements the steps of the above-described method: Obtain instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor; The agent process is invoked to filter program instructions that meet the execution conditions of the target processor from the application process based on the instruction attribute information and the processing attribute information, and these program instructions are selected as target program instructions. Based on the instruction attribute information, first resource information is predicted to describe the resources required by the target processor to execute the target program instructions; The target processor is invoked based on the first resource information to execute the target program instructions.
[0019] In this application, when an application needs to be run, the computing device can run the application process of that application, obtain the instruction attribute information of the program instructions in the application process, and the processing attribute information of the target processor, which is the processor used to execute the program instructions. A proxy process is invoked, and based on the instruction attribute information and processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process as target program instructions. For example, the target program instructions are graphics processing type program instructions that take a long time to execute or require a lot of computing resources, such as graphics rendering instructions in a game application. Based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program is predicted, and the target processor is invoked based on the first resource information to execute the target program instructions. In other words, by using a proxy process to monitor the target program instructions that need to be executed by the target processor, the target processor can be invoked through the proxy process without switching between the virtual machine, processor manager, and target processor, which can improve the resource utilization of the processor. At the same time, program instructions that do not meet the execution conditions of the target processor (i.e., non-target program instructions) do not need to be executed by the target processor, which can achieve isolation between target program instructions and non-target program instructions, avoid the problems of resource contention and mutual interference between program instructions, and improve the execution accuracy of program instructions. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the architecture of a program instruction execution system provided in this application; Figure 2 This application provides an intentional scenario for the interaction between a server and a terminal in a program instruction execution system. Figure 3 This is a flowchart illustrating the first program instruction execution method provided in this application; Figure 4 This is a flowchart illustrating the first program instruction execution method provided in this application; Figure 5 This is a schematic diagram illustrating the scenario for training the candidate resource identification model provided in this application; Figure 6 This is a schematic diagram of a scenario for obtaining initial resource information of sample program instructions provided in this application; Figure 7This is a schematic diagram of a scenario for generating an instruction queue, as provided in this application; Figure 8 This is a schematic diagram of a scenario where a target program instruction in an instruction queue is executed, as provided in this application. Figure 9 This is a schematic diagram of the structure of a program instruction execution device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0023] First, let's introduce the terms used in the embodiments of this application: Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, resources in the "cloud" appear infinitely scalable, readily available, on-demand, and expandable, with payment based on usage.
[0024] As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established. Various types of virtual resources are deployed in the resource pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices.
[0025] Based on logical function, a PaaS (Platform as a Service) layer can be deployed on top of the IaaS (Infrastructure as a Service) layer, and a SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. Alternatively, SaaS can be deployed directly on top of IaaS. PaaS is a platform for running software, such as databases and web containers. SaaS refers to various types of business software, such as web portals and bulk SMS senders. Generally speaking, SaaS and PaaS are upper layers compared to IaaS.
[0026] Cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing. It enables thin clients with relatively limited graphics processing and data processing capabilities to run high-quality games. In cloud gaming, the game does not reside on the player's terminal but runs on a cloud server. The cloud server renders the game scene as a video and audio stream, which is then transmitted to the player's terminal via the network. The player's terminal does not need powerful graphics processing and data processing capabilities; it only needs basic streaming media playback capabilities and the ability to receive player input commands and send them to the cloud server.
[0027] Target processor: can refer to a processor used to execute program instructions that consume a lot of resources, such as program instructions for graphics processing. Specifically, the target processor can refer to the graphics processing unit (GPU), also known as the display core, visual processor, or display chip. It is a microprocessor that is specifically used in personal computers, workstations, game consoles, and some mobile devices (such as tablets and smartphones) to perform image and graphics-related calculations.
[0028] To address the resource waste caused by switching between the virtual machine and the graphics processor (GPU) using a graphics manager, this application proposes a program instruction execution method. This method includes: when an application needs to be run, the computing device can run the application process of that application; obtain instruction attribute information of the program instructions in the application process, as well as processing attribute information of the target processor, where the target processor is the processor used to execute the program instructions; invoke a proxy process, and based on the instruction attribute information and processing attribute information, filter program instructions from the application process that meet the execution conditions of the target processor as target program instructions. For example, the target program instructions are graphics processing type program instructions that take a long time to execute or require a lot of computing resources, such as graphics rendering instructions in a game application; predict first resource information describing the resources required by the target processor to execute the target program based on the instruction attribute information; and invoke the target processor according to the first resource information to execute the target program instructions. In other words, by using a proxy process to monitor the target program instructions that need to be executed by the target processor, the target processor can be invoked through the proxy process without switching between the virtual machine, processor manager, and target processor, which can improve the resource utilization of the processor. At the same time, program instructions that do not meet the execution conditions of the target processor (i.e., non-target program instructions) do not need to be executed by the target processor, which can achieve isolation between target program instructions and non-target program instructions, avoid the problems of resource contention and mutual interference between program instructions, and improve the execution accuracy of program instructions.
[0029] To facilitate a clearer understanding of this application, we will first introduce the program instruction execution system that implements the program instruction execution method of this application, such as... Figure 1 As shown, the program instruction execution system includes, for example, Figure 1 As shown, the program instruction execution system includes server 10 and a terminal cluster. The terminal cluster can include one or more terminals; the number of terminals will not be limited here. Figure 1 As shown, the terminal cluster may specifically include terminal 1, terminal 2, ..., terminal n; it can be understood that terminal 1, terminal 2, terminal 3, ..., terminal n can all connect to server 10 via the network so that each terminal can interact with server 10 via the network connection.
[0030] In this context, server 10 can refer to a device used to provide backend services for an application. For example, the server can refer to a device running a game application, which could be a game application, a social application, a video application, a multimedia webpage, etc. Specifically, server 10 can determine the processor used to execute program instructions based on the instruction attribute information of the application's program instructions and the processor's processing attribute information, and then, through a proxy process, call the corresponding processor to execute the program instructions.
[0031] A server may include one or more processors. For example, a server may include a graphics processor and an intermediate processor. The central processing unit (CPU) is the core of a computer system for operation and control. It is the final execution unit for information processing and program execution. A CPU can refer to a processor used to execute program instructions that consume relatively few resources.
[0032] Each terminal can refer to a user-facing device. Terminals can be used to receive program instructions, send program instructions to the server, and display the execution results of program instructions, etc.
[0033] The server can be a single physical server, a server cluster or distributed system consisting of at least two physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal can specifically refer to smartphones, smart speakers, speakers with screens, smartwatches, etc., but is not limited to these. Various terminals and servers can be directly or indirectly connected via wired or wireless communication. The number of terminals and servers can be one or at least two; this application does not impose any restrictions.
[0034] This application can be applied to multimedia application scenarios such as cloud gaming, live video streaming, and audio / video streaming. Figure 2 Taking cloud gaming as an example, this application will be explained. In the cloud gaming scenario, the target processor can be a graphics processor, and the agent process can refer to a graphics instruction agent process. Figure 2 In this context, the program instruction execution method may include a resource allocation process and a program instruction execution process.
[0035] The resource allocation process includes determining the target processor for executing program instructions and determining when the target processor should execute the program instructions. Specifically, assuming that the game players on terminals 1, 2, and 3 respectively want to run game application 1, game application 2, and game application 3, terminals 1, 2, and 3 respectively generate execution instructions for game application 1, game application 2, and game application 3, and send these instructions to the server. Upon receiving the execution instructions, the server executes game process A (for game application 1), game process B (for game application 2), and game process C (for game application 3) according to the instructions. These game processes contain multiple program instructions, each used to implement different functions. Then, a graphics instruction agent process is invoked to monitor each game process, obtaining instruction attribute information and graphics processor processing attribute information for the program instructions in each game process. Based on this instruction attribute information and processing attribute information, target program instructions that meet the execution conditions of the graphics processor are selected from the program instructions of each game process; for example, if the target program instruction is a graphics instruction. Then, the target program instruction is input into the operating system module. The graphics instruction agent process predicts the resource utilization of the graphics processor when it executes the target program instruction in a unit execution time based on the instruction attribute information of the target program instruction in the operating system module. Based on the unit execution time and resource utilization of the graphics processor, the execution time period of the graphics processor executing the target program instruction is determined.
[0036] The program instruction execution process includes generating an instruction queue and executing program instructions according to the instruction queue. Specifically, the server can arrange the target program instructions in the instruction queue according to their execution time periods. The server can then invoke the graphics processor to execute each target program instruction in the order it appears in the instruction queue. Optionally, the server can sequentially transmit the target program instructions in the instruction queue to the file management driver module, the program file driver module, and the display port driver module. In the display driver module, the graphics processor is invoked, and the target program instructions are executed sequentially according to their order in the instruction queue. The server can generate audio and video streams related to the game based on the execution results of these target program instructions from the graphics processor. For example, it can generate audio and video stream 1 based on the execution results of the target program instructions in game process A and return it to terminal 1; generate audio and video stream 2 based on the execution results of the target program instructions in game process B and return it to terminal 2; and generate audio and video stream 3 based on the execution results of the target program instructions in game process C and return it to terminal 3.
[0037] It should be noted that the computer device can arrange target program instructions belonging to the same game process in the same instruction queue, or it can arrange target program instructions generated within the same time period in the same instruction queue (i.e., target program instructions from different game processes are allowed to be arranged in the same instruction queue). Optionally, when the computer device arranges target program instructions belonging to the same game process in the same instruction queue, the computer device can determine the execution order of the instruction queue based on the process attribute information of the game process. The process attribute information includes one or more of the following: the generation time of the game process, the game application corresponding to the game process, etc. For example, if the process attribute information includes the game application corresponding to the game process, the computer device can obtain the number of users and / or online time of the game application corresponding to the game process, etc., determine the execution priority level of the game application corresponding to the game process based on the number of users and / or online time, etc., and determine the execution order of the instruction queue corresponding to the game process based on the execution priority level. Optionally, when the computer device arranges target program instructions generated within the same time period in the same instruction queue, the computer device can determine the execution time of the instruction queue according to the generation time period corresponding to the target program instructions in the instruction queue.
[0038] It should be noted that the aforementioned operating system module, file management driver module, program file driver module, and display port driver module can be determined based on the server's operating system. For example, if the server's operating system is Windows, then the operating system module can refer to the module including win32u.dll, the file management driver can refer to the module including win32k.sys, the program file driver module can refer to the module including Dxgkrnl.sys, and the display port driver module can refer to the display miniport driver.
[0039] Further, please see Figure 3 This is a flowchart illustrating a program instruction execution method provided in an embodiment of this application. Figure 3 As shown, this method can be derived from... Figure 1 It can be executed by the terminal in the middle, or by Figure 1 The server in the middle can be used to execute it, or it can be executed by... Figure 1 The method is executed jointly by a terminal and a server. The device used to execute this method in this application can be collectively referred to as a computer device. The program instruction execution method may include the following steps S101~S104: S101. Obtain instruction attribute information of program instructions in the application process, and processing attribute information of the target processor.
[0040] In this application, when an application needs to be run, the computer device runs a program instance of that application, which can be referred to as the application process of that application. This application process can include one or more program instructions, each used to implement different functions of the application. For example, the program instruction might be a user interface login instruction used to authorize a user to log in to a specific interface; or, the program instruction might be a graphics rendering instruction in a game scene used to render the game scene. The computer device can obtain instruction attribute information of the program instructions in the application process, as well as processing attribute information of the target processor. The instruction attribute information includes the application to which the program instruction belongs, the instruction type of the program instruction, the application scenario of the application to which the program instruction belongs, etc. The instruction type of the program instruction includes data calculation type or graphics processing type, etc. The processing attribute information can include processing efficiency, the amount of resources included, etc.
[0041] S102. Invoke the agent process, and based on the instruction attribute information and the processing attribute information, filter out the program instructions that meet the execution conditions of the target processor from the application process, and use them as the target program instructions.
[0042] In this application, since the target processor is suitable for processing program instructions that consume a lot of time or computing resources, the computer device can call a proxy process to filter program instructions from the application process that meet the execution conditions of the target processor based on the instruction attribute information and the processing attribute information, and use these program instructions as target program instructions. The target program instructions are program instructions suitable for execution by the target processor, such as graphics processing program instructions that require a large amount of time or computing resources. The proxy process can refer to a process used to allocate processors for program instructions in the application process and to call the processor to execute program instructions. Alternatively, the proxy process can be described as a process with hooking characteristics. Hooking is similar to an interrupt mechanism; when a program instruction triggers the hooking process, a predefined hook callback routine (i.e., the target program instruction) is triggered. After the callback routine completes execution, execution returns to the original program instruction location to continue.
[0043] It should be noted that, in this application, program instructions in the application process that do not meet the processing conditions of the target processor can be executed by the central processing unit or other hardware devices in the computer device, and this application does not limit this.
[0044] S103. Based on the instruction attribute information, predict the first resource information used to describe the resources required by the target processor to execute the target program instruction.
[0045] In this application, a computer device can predict first resource information based on the instruction attribute information to describe the resources required by the target processor to execute the target program instruction. The first resource information is used to describe the time or computing resources required by the target processor to execute the target program instruction, or the first resource information is used to describe the resource utilization rate of the target processor when the target processor executes the target program instruction.
[0046] S104. Based on the first resource information, the target processor is invoked to execute the target program instructions.
[0047] In this application, when the target processor executes to the location of the target program instruction, the computer device can invoke the target processor to execute the target program instruction according to the first resource information, obtain the execution result, and the target processor returns the execution result to the program instructions associated with the target program instruction that have not been executed, and continues to execute the above step S101 on the program instructions in the application process that are located after the target program instruction. By adaptively selecting the processor to execute the program instructions according to the instruction attribute information and processing attribute information, the efficiency of executing program instructions can be improved.
[0048] In this application, when an application needs to be run, the computing device can run the application process of that application, obtain the instruction attribute information of the program instructions in the application process, and the processing attribute information of the target processor, which is the processor used to execute the program instructions. A proxy process is invoked, and based on the instruction attribute information and processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process as target program instructions. For example, the target program instructions are graphics processing type program instructions that take a long time to execute or require a lot of computing resources, such as graphics rendering instructions in a game application. Based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program is predicted, and the target processor is invoked based on the first resource information to execute the target program instructions. In other words, by monitoring target program instructions that need to be executed by the target processor through a proxy process, the target processor can be invoked directly without switching between the virtual machine, processor manager, and target processor, thus improving processor resource utilization. Simultaneously, program instructions that do not meet the execution conditions of the target processor (i.e., non-target program instructions) do not need to be executed by the target processor, achieving isolation between target program instructions and non-target program instructions, avoiding resource contention and interference issues between program instructions, and improving the accuracy of program instruction execution. Furthermore, by limiting the target program instructions from consuming excessive resources of the target processor through primary resource information, it can be ensured that other program instructions can be executed normally.
[0049] Further, please see Figure 4This is a flowchart illustrating a program instruction execution method provided in an embodiment of this application. Figure 4 As shown, this method can be derived from... Figure 1 It can be executed by the terminal in the middle, or by Figure 1 The server in the middle can be used to execute it, or it can be executed by... Figure 1 The method is executed jointly by a terminal and a server. The device used to execute this method in this application can be collectively referred to as a computer device. The program instruction execution method may include the following steps S201-S207: S201. Obtain instruction attribute information of program instructions in the application process, and processing attribute information of the target processor.
[0050] S202. Invoke the agent process, and based on the instruction attribute information and the processing attribute information, filter out the program instructions that meet the execution conditions of the target processor from the application process, and use them as the target program instructions.
[0051] Optionally, the instruction attribute information includes the instruction type of the program instruction and the application to which the program instruction belongs; the above-mentioned calling agent process, based on the instruction attribute information and the processing attribute information, filters program instructions that meet the execution conditions of the target processor from the application process as target program instructions, including: calling the agent process to filter program instructions whose instruction type belongs to the graphics processing type from the application process to obtain candidate program instructions; predicting second resource information describing the resources required by the target processor to execute the candidate program instructions according to the application to which the candidate program instructions belong; and filtering candidate program instructions that meet the execution conditions of the target processor from the candidate program instructions according to the second resource information and the processing attribute information as target program instructions.
[0052] Graphics processing (GPC) instructions typically take a long time to execute or consume significant computational resources. Therefore, computer devices can invoke a proxy process to filter GPC instructions from the application process, obtaining candidate instructions. Further, based on the application to which the candidate instructions belong, second resource information describing the resources required for the target processor to execute the candidate instructions is predicted. This second resource information can refer to one or more of the time and computational resources required for the target processor to execute the candidate instructions. Based on this second resource information and the processing attribute information, candidate instructions that meet the execution conditions of the target processor are selected as the target instructions. Through the proxy process, based on the instruction attribute information and the target processor's processing attribute information, a suitable processor is selected to execute the program instructions, improving the efficiency of program instruction execution.
[0053] Optionally, the above-mentioned selection of candidate program instructions that meet the execution conditions of the target processor from the candidate program instructions based on the second resource information and the processing attribute information, as the target program instructions, includes: if the second resource information is used to reflect the time resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required time resources are greater than the time limit are determined as target program instructions that meet the execution conditions of the target processor; the time limit is determined based on the processing attribute information; if the second resource information is used to reflect the computing resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required computing resources are greater than the computing limit are determined as target program instructions that meet the execution conditions of the target processor; the computing limit is determined based on the processing attribute information.
[0054] When the second resource information reflects the time resources required by the target processor to execute the candidate program instructions, the computer device can filter out target program instructions that meet the execution conditions from the candidate program instructions based on the time resources. For example, the computer device can determine the limited time resources that the target processor can provide for the program instructions based on the processing attribute information of the target processor, i.e., the limited time resources are the maximum time resources, i.e., the maximum time resources that the target processor can provide for the program instructions; then, the candidate program instructions whose required time resources are greater than the limited time resources are determined as target program instructions that meet the execution conditions of the target processor. By filtering out target program instructions that meet the execution conditions of the target processor based on the time resources required by the target processor to execute the candidate program instructions, it is beneficial for the target processor to provide more time resources for the target program, thereby improving the execution efficiency of the program instructions.
[0055] When the second resource information reflects the computing resources required by the target processor to execute the candidate program instructions, the computer device can filter out target program instructions that meet the execution conditions from the candidate program instructions based on the computing resources. For example, the computer device can determine the limited computing resources that the target processor can provide for the program instructions based on the processing attribute information of the target processor, i.e., the limited computing resources are the maximum computing resources that the target processor can provide for the program instructions; then, the candidate program instructions whose required computing resources are greater than the limited computing resources are determined as target program instructions that meet the execution conditions of the target processor. By filtering out target program instructions that meet the execution conditions of the target processor based on the computing resources required by the target processor to execute the candidate program instructions, it is beneficial to provide more computing resources for executing the target program instructions and improve the execution accuracy of the target program.
[0056] It should be noted that the aforementioned target program instructions may refer to graphics instructions related to graphics processing functions. Graphics processing functions may include one or more of the following: functions for creating a graphics device (NtGdiDdDDICreateDevice), functions for creating a graphics device context (NtGdiDdDDICreateContext), functions for creating graphics resources (textures, etc.) (NtGdiDdDDICreateAllocation), functions for submitting rendering commands (NtGdiDdDDISubmitCommand), rendering functions (NtGdiDdDDIRender), graphics rendering functions (NtGdiDdDDIPresent), etc.
[0057] S203. Based on the instruction attribute information, predict the first resource information used to describe the resources required by the target processor to execute the target program instruction.
[0058] Optionally, the number of target program instructions is at least two, and step S203 includes: using a target resource identification model to identify the target program instructions P. i Resource identification is performed using instruction attributes to obtain instructions P that describe the target processor executing the target program. i Initial resource information required; i is a positive integer less than or equal to N, where N is the number of program instructions in at least two target program instructions. Based on the initial resource information corresponding to the remaining program instructions, for the target program instruction P... i The corresponding initial resource information is corrected to obtain the instruction P used to describe the execution of the target program by the target processor. i The first resource information of the required resources, the remaining program instructions being the at least two target program instructions excluding the target program instruction P. i Other than target program instructions.
[0059] The target resource identification model is used to predict the resource information corresponding to the resources required by the target processor to execute program instructions. Therefore, computer devices can use the target resource identification model to identify the resources required by the target program instruction P. i Resource identification is performed using instruction attributes to obtain the instruction P that describes the target processor executing the target program. i Initial resource information required. The target program instruction P is executed on the target processor. i At that time, the remaining program instructions on the target program instruction P iThis has a certain impact. For example, if the unit execution time slice is 4 microseconds, and 3 microseconds of time resources are allocated to target program instruction P1, then only 3 microseconds of time resources can be allocated to target program instruction P2. Therefore, the computer device can determine the appropriate time resource allocation for target program instruction P2 based on the initial resource information corresponding to the remaining program instructions. i The corresponding initial resource information is corrected to obtain the instruction P used to describe the execution of the target program by the target processor. i The first resource information required is obtained through the target program instruction P. i Correcting the corresponding initial resource information can ensure the resources required by each target program instruction, thereby improving the execution efficiency and accuracy of each target program.
[0060] The unit execution time slice refers to the duration for the target processor to execute one target program instruction in the instruction queue. The target processor executes the target program instructions in the instruction queue in a linear execution manner, meaning that the target processor executes only one target program instruction at a time. If the unit execution time slice is large, the execution time of a single target program instruction is long, resulting in a longer waiting time for subsequent target program instructions; if the unit execution time slice is small, the execution time of a single target program instruction is short, and some target applications may require multiple unit execution time slices to complete. In other words, the unit execution time slice can be determined based on one or more of the time resources required for the execution of each target program instruction in the instruction queue, and the number of target program instructions, or it can be a default value for the target processor. The instruction queue includes one or more target program instructions, which are obtained from application processes (the same application process or different application processes) according to their generation time periods. For example, when the target program instructions in the instruction queue are obtained from different application processes according to the generation time period, the computer device generates a first instruction queue from the program instructions generated in each application process within 0-10 microseconds that meet the execution conditions of the target processor; and generates a second instruction queue from the program instructions generated in each application process within 11-20 microseconds that meet the execution conditions of the target processor. Therefore, the aforementioned remaining program instructions can refer to program instructions belonging to the same instruction queue as the target program instructions. That is, the remaining program instructions and the target program instructions belong to the same application process, or, alternatively, the remaining program instructions and the target program instructions were generated within the same generation time period.
[0061] Optionally, this initial resource information is used to reflect the target processor's execution of the target program instruction P within a unit execution time slice. i At that time, the initial resource utilization of the target processor; the above-mentioned initial resource information corresponding to the remaining program instructions, for the target program instruction P iThe corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The first resource information required includes: the target program instruction P i The initial resource utilization rate corresponding to the remaining program instructions is summed to obtain the total initial resource utilization rate; the target program instruction P is then used to calculate the total initial resource utilization rate. i The ratio between the corresponding initial resource utilization rate and the sum of the initial resource utilization rates is determined as the target program instruction P. i The corresponding corrected resource utilization rate; the target program instruction P i The corresponding corrected resource utilization rate is determined as the rate used to describe the target processor executing the target program instruction P. i The first resource information required.
[0062] Computer equipment can sum the initial resource utilization of each target application to obtain a total initial resource utilization, and then apply this to the target program instruction P. i The ratio between the corresponding initial resource utilization rate and the sum of those initial resource utilization rates is determined as the target program instruction P. i The corresponding adjustment to resource utilization rate will be applied to the target program instruction P. i The corresponding modified resource utilization rate is determined to be the value used to describe the target processor executing the target program instruction P. i First resource information of the required resources. This is obtained through the target program instruction P. i Correcting the initial resource utilization rate helps limit the resource utilization of each target program instruction, thereby improving its execution efficiency and accuracy. It is particularly important to note that when the corrected resource utilization rate for a target program instruction is relatively low, the computer can, based on the corrected resource utilization rate for each instruction, call upon the target processor to execute multiple target program instructions simultaneously.
[0063] Optionally, assume that the target program instruction P i The corresponding initial resource utilization rate is x i The initial total resource utilization rate is: y = x1 + x2 + ... + x N The target program instruction P i The corresponding adjusted resource utilization rate can be expressed by the following formula (1): (1) For example, if the initial resource utilization rates of target program instructions P1, P2, and P3 are 0.2, 0.4, and 0.8 respectively, then the corrected resource utilization rates of target program instructions P1, P2, and P3 are 0.14, 0.28, and 0.58 respectively. It can be seen that the relationship between the initial resource utilization rates of target program instructions P1, P2, and P3 is the same as the relationship between the corrected resource utilization rates of target program instructions P1, P2, and P3. In other words, correcting the initial resource utilization rates of each target program instruction does not change the relationship between their respective resource utilization rates; however, by correcting the initial resource utilization rates of each target program instruction, the sum of the corrected resource utilization rates of all target program instructions can be limited to 1.
[0064] Optionally, the computer device can train a candidate resource identification model to obtain a target resource identification model, thereby improving the resource identification accuracy of the target resource identification model. Specifically, it acquires instruction attribute information of sample program instructions and labeled initial resource information describing the resources required by the target processor to execute the sample program instructions; the sample program instructions are program instructions that do not meet the execution conditions of the target processor; using the candidate resource identification model, it performs resource prediction on the instruction attributes of the sample program instructions to obtain predicted initial resource information describing the resources required by the target processor to execute the sample program instructions; based on the predicted initial resource information and the labeled initial resource information, it adjusts the candidate resource identification model to obtain the target resource identification model.
[0065] like Figure 5As shown, the computer device can acquire instruction attribute information of the sample program instructions, as well as labeled initial resource information describing the resources required by the target processor to execute the sample program instructions. This labeled initial resource information can be obtained by multiple manual annotations and reviews of the sample program instructions, or it can be determined based on log data of the target processor executing the sample program instructions over a historical period. Further, a candidate resource identification model can be used to predict resources based on the instruction attributes of the sample program instructions, obtaining predicted initial resource information describing the resources required by the target processor to execute the sample program instructions. If the predicted initial resource information is the same as or similar to the labeled initial resource information, it indicates that the resource prediction accuracy of the candidate resource identification model is relatively high; if the difference between the predicted initial resource information and the labeled initial resource information is relatively large, it indicates that the resource prediction accuracy of the candidate resource identification model is relatively low. Therefore, the computer device can adjust the candidate resource identification model based on the predicted initial resource information and the labeled initial resource information to obtain the target resource identification model. By training the candidate asset identification model based on the sample program instructions, the target resource identification model is obtained, improving the resource identification accuracy of the target resource identification model.
[0066] Optionally, adjusting the candidate resource identification model based on the predicted initial resource information and the labeled initial resource information to obtain the target resource identification model includes: determining the resource prediction error of the candidate resource identification model based on the predicted initial resource information and the labeled initial resource information; if the resource prediction error is not in a convergent state, adjusting the candidate resource identification model based on the resource prediction error; and determining the adjusted candidate resource identification model as the target resource identification model.
[0067] like Figure 5 As shown, the computer device can obtain the loss function of the candidate resource identification model, substitute the predicted initial resource information and the labeled initial resource information into the loss function, and obtain the resource prediction error of the candidate resource identification model. If the resource prediction error is in a convergent state, it indicates that the resource prediction accuracy of the candidate resource identification model is relatively high. Therefore, the candidate resource identification model can be directly determined as the target resource identification model. If the resource prediction error is not in a convergent state, it indicates that the resource prediction accuracy of the candidate resource identification model is relatively low. Therefore, the computer device can adjust the candidate resource identification model according to the resource prediction error; and determine the adjusted candidate resource identification model as the target resource identification model. By adjusting the candidate resource identification model according to its resource prediction error, the target resource identification model is obtained, thereby improving the resource identification accuracy of the target resource identification model.
[0068] Optionally, the aforementioned sample program instructions belong to at least two game scenes of the game application, and the aforementioned acquisition of labeled initial resource information describing the resources required by the target processor to execute the sample program instructions includes: acquiring the game scene Q to which the sample program instructions belong. j At that time, the candidate resource utilization rate of the target processor executing the sample program instruction within a historical unit execution time slice; j is a positive integer less than or equal to M, where M is the number of game scenes in the game application. Based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instruction, the initial labeled resource information used to describe the resources required by the target processor to execute the sample program instruction is determined.
[0069] The aforementioned sample program instructions belong to at least two game scenarios within a game application. Game scenarios include single-player games, multiplayer games, practice games, combat games, etc. A single sample program instruction can belong to multiple game scenarios within a game application. When a sample program instruction belongs to different game scenarios, the resources required for the target processor to execute that instruction differ. Therefore, the computer device can determine that the sample program instruction belongs to game scenario Q. j At that time, the candidate resource utilization rate of the sample program instruction executed by the target processor within a historical unit execution time slice is determined. Based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instruction, initial labeled resource information is determined to describe the resources required by the target processor to execute the sample program instruction. The initial labeled resource information is automatically obtained by using the candidate resource utilization rate of the sample program instruction executed within a historical unit execution time slice of the target processor, eliminating the need for manual labeling and improving the efficiency and accuracy of obtaining the initial labeled resource information. Furthermore, determining the initial labeled resource information based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instruction helps to provide sufficient resources for the sample program instructions in various game scenarios.
[0070] For example, such as Figure 6 As shown, assuming the sample program instruction belongs to game scene A, game scene B, and game scene C, the computer device can obtain the candidate resource utilization rates 1, 2, and 3 corresponding to the target processor when the sample program instruction belongs to game scene A, game scene B, and game scene C, respectively, when the target processor executes the sample program instruction within the historical execution time slice, based on the processing log data of the target processor. According to the average or maximum candidate resource utilization rate among candidate resource utilization rates 1, 2, and 3, the initial resource information of the annotation used to describe the resources required by the target processor to execute the sample program instruction is determined.
[0071] It should be noted that when the sample program instruction belongs to only one game scene, the resource utilization rate of the target processor when the target processor executes the sample program instruction within the historical unit execution time slice is used to determine the initial resource information used to describe the resources required by the target processor to execute the sample program instruction, based on the fact that the sample program instruction belongs to that game scene.
[0072] S204. Obtain the unit execution time slice of the target processor.
[0073] In this application, if the unit execution time slice is large, the execution time of a single target program instruction is long, resulting in a longer waiting time for subsequent target program instructions; if the unit execution time slice is small, the execution time of a single target program instruction is short, and some target applications require multiple unit execution time slices to complete. The computer device can determine the unit execution time slice of the target processor based on the number of target program instructions and one or more of the time resources required for each target program instruction to be executed, or it can set the default value of the target processor as the unit execution time slice of the target processor.
[0074] S205. Based on the unit's execution time slice and the target program instruction P i The corresponding first resource information determines the target program instruction P. i The execution period.
[0075] In this application, the computer device can execute a time slice and the target program instruction P according to the unit. i The corresponding first resource information determines the target program instruction P. i Furthermore, the execution time can be determined randomly, or the execution order of each target program instruction can be determined based on its instruction attributes. The execution time and order of the target program instruction P can then be used to determine its execution order. i The execution time period. The instruction attribute information of the target program instruction here may include the generation time of the target program instruction, the application to which the target program instruction belongs, etc.
[0076] Optionally, step S205 above may include: according to the target program instruction P i The target program instruction P is determined by multiplying the corresponding modified resource utilization rate by the unit execution time slice. i Execution time; based on the target program instruction P i The generation time is used to determine the target program instruction P. i The execution order; based on the execution duration and the execution order, determine the target program instruction P. i The execution period.
[0077] Computer devices can transmit the target program instruction P i The product of the corresponding modified resource utilization rate and the unit execution time slice is determined as the target program instruction P. i The execution time is then determined, and then, based on the target program instruction P... i The generation time is used to determine the target program instruction P. i The execution order is determined based on the execution duration and the execution order, thus determining the target program instruction P. i The execution period.
[0078] For example, the target processor's unit execution time slice is 4 microseconds. The modified resource utilization rates corresponding to target program instructions P1, P2, and P3 are 0.14, 0.28, and 0.58, respectively. The execution durations of target program instructions P1, P2, and P3 are 0.56 microseconds, 1.12 microseconds, and 2.32 microseconds, respectively. The generation times of target program instructions P1, P2, and P3, from first to last, are: 0~0.56 microseconds, 0.56~1.68 microseconds, and 1.68~4 microseconds, respectively.
[0079] S206. The target program instruction P is executed according to the execution time period. i They are arranged in the instruction queue.
[0080] S207, according to the target program instruction P i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i .
[0081] Optionally, step S207 above includes: invoking the agent process as the target program instruction P. i Establish an execution thread; when the target program instruction P is arranged... i When all previous target program instructions have been executed, the execution thread is invoked to read the target program instruction P from the instruction queue. i The target processor is invoked to execute the target program instruction Pi.
[0082] Computer devices can invoke the agent process as the target program instruction P. i The corresponding application establishes an execution thread, which is arranged in the target program instruction P. i When all previous target program instructions have been executed, it indicates that execution has reached the target program instruction P. iAt the location where the computer device is located, the execution thread can be invoked to read the target program instruction P from the instruction queue. i The agent process invokes the target processor to execute the target program instruction Pi. By using an agent process to execute the target program instruction on the target processor, switching between the virtual machine, processor manager, and processor is eliminated, improving processor resource utilization and execution efficiency. Therefore, the target processor only needs to execute one target program instruction at a time, achieving isolation between target program instructions, avoiding resource contention and interference issues, and improving execution accuracy.
[0083] Optionally, when the target program instruction is executed, the execution result of the target program instruction is obtained from the target processor; the proxy process is invoked to return the execution result to the associated program instruction; the associated program instruction is a program instruction that has not been executed in the application process to which the target program instruction belongs and is related to the target program instruction.
[0084] When the target program instruction is executed, the computer device can obtain the execution result of the target program instruction from the target processor, call the agent process, return the execution result to the associated program instruction, and call the target processor to execute the program instructions that have not been executed in the application process.
[0085] For example, such as Figure 7 and Figure 8 As shown, when the target processor is a graphics processing unit (GPU), and a game process is running on the computer device, the computer device can call the graphics instruction interface to obtain program instructions belonging to the game process. These program instructions are then sequentially input into the GPU driver module and the operating system module. An agent process is invoked to filter GPU instructions from the operating system module that meet the processing conditions of the GPU, obtain the instruction attribute information of the GPU instructions, predict the first resource information describing the resources required by the GPU to execute the GPU instruction based on the instruction attribute information, determine the execution time period of the GPU instruction based on the first resource information and the GPU's unit execution time slice, and arrange the GPU instructions in the instruction queue according to the execution time period. For example, Figure 7In the game process, graphics instructions that meet the execution conditions of the graphics processor include graphics instruction 1, graphics instruction 2, graphics instruction 3, graphics instruction 4, graphics instruction 5, and so on. If we sort the execution time slots of graphics instruction 1, graphics instruction 2, graphics instruction 3, graphics instruction 4, and graphics instruction 5 in ascending order, we get: graphics instruction 1, graphics instruction 2, graphics instruction 3, graphics instruction 4, graphics instruction 5. That is, graphics instruction 1 is executed by the graphics processor first, and graphics instruction 5 is executed last. When the execution time of a certain instruction queue is reached, the graphics instructions in that queue are input into the kernel, and the graphics processor in the kernel executes the graphics instructions in that queue, while instructions in other queues wait. When the next unit of execution time slice arrives, the execution result of the graphics instructions in that queue is returned to the game process, and the next instruction queue is allowed to enter the kernel, where the graphics processor executes the graphics instructions in that next queue, and so on.
[0086] like Figure 7 In this context, the graphics instruction interface includes graphics instruction interfaces of types such as DX, OpenGL, and Vulkan. The DX type graphics instruction interface can include DX9, DX10, DX11, and DX12, etc. The graphics processor driver corresponding to the DX type graphics instruction interface is the DX graphics processor driver, and the graphics processor driver corresponding to the OpenGL type graphics instruction is the OpenGL graphics processor driver.
[0087] In this application, when an application needs to be run, the computing device can run the application process of that application, obtain the instruction attribute information of the program instructions in the application process, and the processing attribute information of the target processor, which is the processor used to execute the program instructions. A proxy process is invoked, and based on the instruction attribute information and processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process as target program instructions. For example, the target program instructions are graphics processing type program instructions that take a long time to execute or require a lot of computing resources, such as graphics rendering instructions in a game application. Based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program is predicted, and the unit execution time slice of the target processor is obtained. The execution time period of the target program is determined based on the unit execution time slice and the first resource information. Furthermore, the target program instructions Pi are arranged in an instruction queue according to the execution time period. The target processor is invoked to execute the target program instructions Pi according to the order of Pi in the instruction queue. This achieves queued management of the target program instructions, improving the execution efficiency of the target program instructions. Simultaneously, by monitoring target program instructions that require execution by the target processor through the proxy process, the target processor can be invoked without switching between the virtual machine, processor manager, and target processor, thus improving processor resource utilization. Program instructions that do not meet the execution conditions of the target processor (i.e., non-target program instructions) do not need to be executed by the target processor, achieving isolation between target program instructions and non-target program instructions, avoiding resource contention and mutual interference between program instructions, and improving the execution accuracy of program instructions. In addition, by limiting the target program instructions to consume excessive resources of the target processor through the first resource information, it can be ensured that other program instructions can be executed normally.
[0088] Please see Figure 9 This is a schematic diagram of a program instruction execution device provided in an embodiment of this application. The aforementioned program instruction execution device can be a computer program (including program code) running on a computer device; for example, the program instruction execution device is application software. This device can be used to execute corresponding steps in the method provided in the embodiments of this application. Figure 9 As shown, the program instruction execution device may include: an acquisition module 901, a filtering module 902, a prediction module 903, an execution module 904, and an adjustment module 905.
[0089] The acquisition module is used to acquire instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor. The filtering module is used to call the agent process and, based on the instruction attribute information and the processing attribute information, filter out program instructions that meet the execution conditions of the target processor from the application process, and use them as target program instructions. The prediction module is used to predict, based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program instruction; An execution module is used to invoke the target processor based on the first resource information and execute the target program instructions.
[0090] Optionally, the instruction attribute information includes the instruction type of the program instruction and the application to which the program instruction belongs; The filtering module invokes the agent process to filter program instructions from the application process that meet the execution conditions of the target processor, based on the instruction attribute information and the processing attribute information, as target program instructions, including: The agent process is invoked to filter program instructions of the graphics processing type from the application process to obtain candidate program instructions; Based on the application to which the candidate program instruction belongs, predict second resource information for describing the resources required by the target processor to execute the candidate program instruction; Based on the second resource information and the processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process and used as target program instructions.
[0091] Optionally, the filtering module filters program instructions that meet the execution conditions of the target processor from the application process based on the second resource information and the processing attribute information, as target program instructions, including: If the second resource information is used to reflect the time resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required time resources are greater than the time limit are determined as the target program instructions that meet the execution conditions of the target processor; the time limit is determined based on the processing attribute information. If the second resource information is used to reflect the computing resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required computing resources are greater than the limited computing resources are determined as the target program instructions that meet the execution conditions of the target processor; the limited computing resources are determined based on the processing attribute information.
[0092] Optionally, the number of target program instructions is at least two, and the prediction module predicts first resource information based on the instruction attribute information to describe the resources required by the target processor to execute the target program instructions, including: Using a target resource identification model, the target program instruction P is identified. i Resource identification is performed using instruction attributes to obtain the instruction P that describes the target processor executing the target program. i Initial resource information required; i is a positive integer less than or equal to N, where N is the number of program instructions in at least two target program instructions; Based on the initial resource information corresponding to the remaining program instructions, the target program instruction P is... i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The first resource information of the required resources; the remaining program instructions are the at least two target program instructions excluding the target program instruction P. i Other than target program instructions.
[0093] Optionally, the initial resource information is used to reflect the execution of the target program instruction P by the target processor within a unit execution time slice. i At that time, the initial resource utilization rate of the target processor; the prediction module, based on the initial resource information corresponding to the remaining program instructions, adjusts the target program instruction P. i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The primary resource information required includes: For the target program instruction P i The initial resource utilization rate is summed with the initial resource utilization rate corresponding to the remaining program instructions to obtain the total initial resource utilization rate. The target program instruction P i The ratio between the corresponding initial resource utilization rate and the sum of the initial resource utilization rates is determined as the target program instruction P. i The corresponding adjusted resource utilization rate; The target program instruction P i The corresponding corrected resource utilization rate is determined as the rate used to describe the target processor executing the target program instruction P. i The first resource information required.
[0094] Optionally, the above-mentioned device also includes an adjustment module; The adjustment module is used to obtain instruction attribute information of the sample program instructions and labeled initial resource information to describe the resources required by the target processor to execute the sample program instructions; the sample program instructions are program instructions that satisfy the execution conditions of the target processor. A candidate resource identification model is used to predict the resources of the instruction attributes of the sample program instructions, so as to obtain the predicted initial resource information describing the resources required by the target processor to execute the sample program instructions; Based on the predicted initial resource information and the labeled initial resource information, the candidate resource identification model is adjusted to obtain the target resource identification model.
[0095] Optionally, the adjustment module adjusts the candidate resource identification model based on the predicted initial resource information and the labeled initial resource information to obtain the target resource identification model, including: Based on the predicted initial resource information and the labeled initial resource information, the resource prediction error of the candidate resource identification model is determined; If the resource prediction error is not in a convergent state, the candidate resource identification model is adjusted according to the resource prediction error; The adjusted candidate resource identification model is determined as the target resource identification model.
[0096] Optionally, the adjustment module sample program instructions belong to at least two game scenes of the game application, and the step of obtaining labeled initial resource information describing the resources required by the target processor to execute the sample program instructions includes: The sample program instructions obtained belong to the game scene Q. j At that time, the candidate resource utilization rate of the target processor executing the sample program instructions within a historical unit execution time slice; j is a positive integer less than or equal to M, where M is the number of game scenes in the game application; Based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instructions, the initial labeled resource information is determined to describe the resources required by the target processor to execute the sample program instructions.
[0097] Optionally, the execution module invokes the target processor based on the first resource information to execute the target program instructions, including: Obtain the unit execution time slice of the target processor; Based on the unit execution time slice and the target program instruction P i Based on the corresponding first resource information, the target program instruction P is determined. i The execution period; The target program instruction P is determined according to the execution time period.i Arranged in the instruction queue; According to the target program instruction P i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i .
[0098] Optionally, the execution module determines the execution time slice and the target program instruction P based on the unit execution time slice. i Based on the corresponding first resource information, the target program instruction P is determined. i The execution time period includes: According to the target program instruction P i The target program instruction P is determined by multiplying the corresponding modified resource utilization rate by the unit execution time slice. i Execution time; Based on the target program instruction P i The generation time is used to determine the target program instruction P. i The execution order; Based on the execution duration and the execution order, the target program instruction P is determined. i The execution period.
[0099] Optionally, the execution module executes the target program instruction P. i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i ,include: The proxy process is invoked as the target program instruction P. i Create an execution thread; When arranged in the target program instruction P i When all previous target program instructions have been executed, the execution thread is invoked to read the target program instruction P from the instruction queue. i The target processor is invoked to execute the target program instruction Pi.
[0100] Optionally, the execution module is further configured to obtain the execution result of the target program instructions from the target processor when the target program instructions have been executed; The proxy process is invoked to send the execution result back to the associated program instruction; the associated program instruction is a program instruction that has not been executed in the application process to which the target program instruction belongs and is related to the target program instruction.
[0101] According to one embodiment of this application, Figure 3 The steps involved in the program instruction execution method shown can be derived from... Figure 9 The program instructions are executed by the various modules in the program execution device shown. For example, Figure 3 Step S101 shown can be performed by Figure 9 The acquisition module 901 in the middle is used to execute, Figure 3 Step S102 shown can be performed by Figure 9 The filtering module 902 in the middle is used to perform the operation; Figure 3 Step S103 shown can be performed by Figure 9 The prediction module 903 in the middle is used to perform the operation; Figure 3 Step S104 shown can be derived from Figure 9 The execution module 904 in the middle.
[0102] Similarly, according to one embodiment of this application, Figure 4 The steps involved in the program instruction execution method shown can be derived from... Figure 9 The program instructions are executed by the various modules in the program execution device shown. For example, Figure 4 Step S201 shown can be performed by Figure 9 The acquisition module 901 in the middle is used to execute, Figure 4 Step S202 shown can be performed by Figure 9 The filtering module 902 in the middle is used to perform the operation; Figure 4 Step S203 shown can be performed by Figure 9 The prediction module 903 in the middle is used to perform the operation; Figure 4 Steps S204 to S207 shown can be derived from Figure 9 The execution module 904 in the middle is used to execute it.
[0103] According to one embodiment of this application, Figure 9 The modules in the illustrated program instruction execution device can be individually or entirely combined into one or more units, or one or more of these units can be further divided into at least two functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical functional division. In practical applications, the function of one module can be implemented by at least two units, or the function of at least two modules can be implemented by one unit. In other embodiments of this application, the program instruction execution device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by at least two units.
[0104] According to one embodiment of this application, a general-purpose computer device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), can perform operations such as... Figure 3 The computer program (including program code) involved in each step of the corresponding method shown, to construct such... Figure 9The program instruction execution apparatus shown herein, and the program instruction execution method for implementing the embodiments of this application, are described. The computer program described above can be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and executed therein.
[0105] In this application, when an application needs to be run, the computing device can run the application process of that application, obtain the instruction attribute information of the program instructions in the application process, and the processing attribute information of the target processor, which is the processor used to execute the program instructions. A proxy process is invoked, and based on the instruction attribute information and processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process as target program instructions. For example, the target program instructions are graphics processing type program instructions that take a long time to execute or require a lot of computing resources, such as graphics rendering instructions in a game application. Based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program is predicted, and the target processor is invoked based on the first resource information to execute the target program instructions. In other words, by monitoring target program instructions that need to be executed by the target processor through a proxy process, the target processor can be invoked directly without switching between the virtual machine, processor manager, and target processor, thus improving processor resource utilization. Simultaneously, program instructions that do not meet the execution conditions of the target processor (i.e., non-target program instructions) do not need to be executed by the target processor, achieving isolation between target program instructions and non-target program instructions, avoiding resource contention and interference issues between program instructions, and improving the accuracy of program instruction execution. Furthermore, by limiting the target program instructions from consuming excessive resources of the target processor through primary resource information, it can be ensured that other program instructions can be executed normally.
[0106] Please see Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 10 As shown, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a media interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The media interface 1003 may include a display screen and a keyboard; optionally, the media interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi). I -F I(Interface). Memory 1005 can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, memory 1005 can also be at least one storage device located remotely from the aforementioned processor 1001. Figure 10 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a media interface module, and a device control application.
[0107] exist Figure 10 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the media content interface 1003 is mainly used to provide an input interface for the media content; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to achieve: Obtain instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor; The agent process is invoked to filter program instructions that meet the execution conditions of the target processor from the application process based on the instruction attribute information and the processing attribute information, and these program instructions are selected as target program instructions. Based on the instruction attribute information, first resource information is predicted to describe the resources required by the target processor to execute the target program instructions; The target processor is invoked based on the first resource information to execute the target program instructions.
[0108] Optionally, the instruction attribute information includes the instruction type of the program instruction and the application to which the program instruction belongs; the processor 1001 can be used to call the device control application stored in the memory 1005 to realize the calling of the agent process, and based on the instruction attribute information and the processing attribute information, to filter out program instructions that meet the execution conditions of the target processor from the application process as target program instructions, including: The agent process is invoked to filter program instructions of the graphics processing type from the application process to obtain candidate program instructions; Based on the application to which the candidate program instruction belongs, predict second resource information for describing the resources required by the target processor to execute the candidate program instruction; Based on the second resource information and the processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process and used as target program instructions.
[0109] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to filter program instructions that meet the execution conditions of the target processor from the application process according to the second resource information and the processing attribute information, as target program instructions, including: If the second resource information is used to reflect the time resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required time resources are greater than the time limit are determined as the target program instructions that meet the execution conditions of the target processor; the time limit is determined based on the processing attribute information. If the second resource information is used to reflect the computing resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required computing resources are greater than the limited computing resources are determined as the target program instructions that meet the execution conditions of the target processor; the limited computing resources are determined based on the processing attribute information.
[0110] Optionally, the number of target program instructions is at least two. Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to predict, based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program instructions, including: Using a target resource identification model, the target program instruction P is identified. i Resource identification is performed using instruction attributes to obtain the instruction P that describes the target processor executing the target program. i Initial resource information required; i is a positive integer less than or equal to N, where N is the number of program instructions in at least two target program instructions; Based on the initial resource information corresponding to the remaining program instructions, the target program instruction P is... i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The first resource information of the required resources; the remaining program instructions are the at least two target program instructions excluding the target program instruction P. i Other than target program instructions.
[0111] Optionally, the initial resource information is used to reflect the execution of the target program instruction P by the target processor within a unit execution time slice. i At that time, the initial resource utilization rate of the target processor; optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to realize the target program instruction P according to the initial resource information corresponding to the remaining program instructions. iThe corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The primary resource information required includes: For the target program instruction P i The initial resource utilization rate is summed with the initial resource utilization rate corresponding to the remaining program instructions to obtain the total initial resource utilization rate. The target program instruction P i The ratio between the corresponding initial resource utilization rate and the sum of the initial resource utilization rates is determined as the target program instruction P. i The corresponding adjusted resource utilization rate; The target program instruction P i The corresponding corrected resource utilization rate is determined as the rate used to describe the target processor executing the target program instruction P. i The first resource information required.
[0112] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to obtain the instruction attribute information of the sample program instructions and the labeled initial resource information used to describe the resources required by the target processor to execute the sample program instructions; the sample program instructions are program instructions that satisfy the execution conditions of the target processor. A candidate resource identification model is used to predict the resources of the instruction attributes of the sample program instructions, so as to obtain the predicted initial resource information describing the resources required by the target processor to execute the sample program instructions; Based on the predicted initial resource information and the labeled initial resource information, the candidate resource identification model is adjusted to obtain the target resource identification model.
[0113] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to adjust the candidate resource identification model according to the predicted initial resource information and the labeled initial resource information to obtain the target resource identification model, including: Based on the predicted initial resource information and the labeled initial resource information, the resource prediction error of the candidate resource identification model is determined; If the resource prediction error is not in a convergent state, the candidate resource identification model is adjusted according to the resource prediction error; The adjusted candidate resource identification model is determined as the target resource identification model.
[0114] Optionally, the sample program instructions belong to at least two game scenes of the game application. Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to obtain labeled initial resource information describing the resources required by the target processor to execute the sample program instructions, including: The sample program instructions obtained belong to the game scene Q. j At that time, the candidate resource utilization rate of the target processor executing the sample program instructions within a historical unit execution time slice; j is a positive integer less than or equal to M, where M is the number of game scenes in the game application; Based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instructions, the initial labeled resource information is determined to describe the resources required by the target processor to execute the sample program instructions.
[0115] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to invoke the target processor according to the first resource information and execute the target program instructions, including: Obtain the unit execution time slice of the target processor; Based on the unit execution time slice and the target program instruction P i Based on the corresponding first resource information, the target program instruction P is determined. i The execution period; The target program instruction P is determined according to the execution time period. i Arranged in the instruction queue; According to the target program instruction P i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i .
[0116] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the execution time slice and the target program instruction P according to the unit. i Based on the corresponding first resource information, the target program instruction P is determined. i The execution time period includes: According to the target program instruction P i The target program instruction P is determined by multiplying the corresponding modified resource utilization rate by the unit execution time slice. i Execution time; Based on the target program instruction P i The generation time is used to determine the target program instruction P. i The execution order; Based on the execution duration and the execution order, the target program instruction P is determined. i The execution period.
[0117] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the target program instruction P. i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i ,include: The proxy process is invoked as the target program instruction P. i Create an execution thread; When arranged in the target program instruction P i When all previous target program instructions have been executed, the execution thread is invoked to read the target program instruction P from the instruction queue. i The target processor is invoked to execute the target program instruction Pi.
[0118] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to obtain the execution result of the target program instruction from the target processor when the target program instruction is executed. The proxy process is invoked to send the execution result back to the associated program instruction; the associated program instruction is a program instruction that has not been executed in the application process to which the target program instruction belongs and is related to the target program instruction.
[0119] In this application, when an application needs to be run, the computing device can run the application process of that application, obtain the instruction attribute information of the program instructions in the application process, and the processing attribute information of the target processor, which is the processor used to execute the program instructions. A proxy process is invoked, and based on the instruction attribute information and processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process as target program instructions. For example, the target program instructions are graphics processing type program instructions that take a long time to execute or require a lot of computing resources, such as graphics rendering instructions in a game application. Based on the instruction attribute information, first resource information describing the resources required by the target processor to execute the target program is predicted, and the target processor is invoked based on the first resource information to execute the target program instructions. In other words, by monitoring target program instructions that need to be executed by the target processor through a proxy process, the target processor can be invoked directly without switching between the virtual machine, processor manager, and target processor, thus improving processor resource utilization. Simultaneously, program instructions that do not meet the execution conditions of the target processor (i.e., non-target program instructions) do not need to be executed by the target processor, achieving isolation between target program instructions and non-target program instructions, avoiding resource contention and interference issues between program instructions, and improving the accuracy of program instruction execution. Furthermore, by limiting the target program instructions from consuming excessive resources of the target processor through primary resource information, it can be ensured that other program instructions can be executed normally.
[0120] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 3 and the preceding text Figure 4 The description of the above program instruction execution method in the corresponding embodiment can also be executed as described above. Figure 9 The description of the program instruction execution device in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.
[0121] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned program instruction execution device, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the aforementioned... Figure 3 and Figure 4 The description of the program instruction execution method in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.
[0122] As an example, the above program instructions can be deployed and executed on a computer device, or deployed and executed on at least two computer devices in one location, or executed on at least two computer devices distributed in at least two locations and interconnected by a communication network. At least two computer devices distributed in at least two locations and interconnected by a communication network can form a blockchain network.
[0123] The aforementioned computer-readable storage medium may be a program instruction execution device provided in any of the foregoing embodiments or a central storage unit of the aforementioned computer device, such as a hard disk or central storage of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium may include both the central storage unit and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0124] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish content in different media, rather than to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0125] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the foregoing description. Figure 4 and Figure 7 The description of the program instruction execution method in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer program product involved in this application, please refer to the description of the method embodiments of this application.
[0126] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0127] The methods and related apparatus provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable program instruction execution device to create a machine, such that instructions executed by the processor of the computer or other programmable program instruction execution device generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable program instruction execution device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable program instruction execution device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0128] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A method for executing program instructions, characterized in that, include: Obtain instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor; The agent process is invoked to filter program instructions from the application process that meet the execution conditions of the target processor based on the instruction attribute information and the processing attribute information, and these program instructions are selected as target program instructions; the number of target program instructions is at least two. Using a target resource identification model, the target program instruction P is identified. i Resource identification is performed using instruction attributes to obtain the instruction P that describes the target processor executing the target program. i Initial resource information required; i is a positive integer less than or equal to N, where N is the number of program instructions in at least two target program instructions; Based on the initial resource information corresponding to the remaining program instructions, the target program instruction P is... i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The first resource information of the required resources; the remaining program instructions are the at least two target program instructions excluding the target program instruction P. i Other than the target program instructions, the first resource information is used to describe the target processor executing the target program instruction P. i The required time or computing resources, or the first resource information, are used to describe the target processor executing the target program instruction P. i At that time, the resource utilization rate of the target processor; The target processor is invoked based on the first resource information to execute the target program instructions.
2. The method as described in claim 1, characterized in that, The instruction attribute information includes the instruction type of the program instruction and the application to which the program instruction belongs; The calling proxy process, based on the instruction attribute information and the processing attribute information, filters program instructions from the application process that meet the execution conditions of the target processor, as target program instructions, including: The agent process is invoked to filter program instructions of the graphics processing type from the application process to obtain candidate program instructions; Based on the application to which the candidate program instruction belongs, predict second resource information for describing the resources required by the target processor to execute the candidate program instruction; Based on the second resource information and the processing attribute information, program instructions that meet the execution conditions of the target processor are selected from the application process and used as target program instructions.
3. The method as described in claim 2, characterized in that, The step of selecting program instructions that meet the execution conditions of the target processor from the application process based on the second resource information and the processing attribute information, and using them as target program instructions, includes: If the second resource information is used to reflect the time resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required time resources are greater than the time limit are determined as the target program instructions that meet the execution conditions of the target processor; the time limit is determined based on the processing attribute information. If the second resource information is used to reflect the computing resources required by the target processor to execute the candidate program instructions, then the candidate program instructions whose required computing resources are greater than the limited computing resources are determined as the target program instructions that meet the execution conditions of the target processor; the limited computing resources are determined based on the processing attribute information.
4. The method as described in claim 1, characterized in that, The initial resource information is used to reflect the target processor's execution of the target program instruction P within a unit execution time slice. i At that time, the initial resource utilization rate of the target processor; The target program instruction P is then processed based on the initial resource information corresponding to the remaining program instructions. i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The primary resource information required includes: For the target program instruction P i The initial resource utilization rate is summed with the initial resource utilization rate corresponding to the remaining program instructions to obtain the total initial resource utilization rate. The target program instruction P i The ratio between the corresponding initial resource utilization rate and the sum of the initial resource utilization rates is determined as the target program instruction P. i The corresponding adjusted resource utilization rate; The target program instruction P i The corresponding corrected resource utilization rate is determined as the rate used to describe the target processor executing the target program instruction P. i The first resource information required.
5. The method as described in claim 1, characterized in that, The method further includes: Obtain instruction attribute information of the sample program instructions, and labeled initial resource information for describing the resources required by the target processor to execute the sample program instructions; the sample program instructions are program instructions that satisfy the execution conditions of the target processor. A candidate resource identification model is used to predict the resources of the instruction attributes of the sample program instructions, so as to obtain the predicted initial resource information describing the resources required by the target processor to execute the sample program instructions; Based on the predicted initial resource information and the labeled initial resource information, the candidate resource identification model is adjusted to obtain the target resource identification model.
6. The method as described in claim 5, characterized in that, The step of adjusting the candidate resource identification model based on the predicted initial resource information and the labeled initial resource information to obtain the target resource identification model includes: Based on the predicted initial resource information and the labeled initial resource information, the resource prediction error of the candidate resource identification model is determined; If the resource prediction error is not in a convergent state, the candidate resource identification model is adjusted according to the resource prediction error; The adjusted candidate resource identification model is determined as the target resource identification model.
7. The method as described in claim 5, characterized in that, The sample program instructions belong to at least two game scenes of the game application. Initial resource information, labeled to describe the resources required by the target processor to execute the sample program instructions, is obtained, including: The sample program instructions obtained belong to the game scene Q. j At that time, the candidate resource utilization rate of the target processor executing the sample program instructions within a historical unit execution time slice; j is a positive integer less than or equal to M, where M is the number of game scenes in the game application; Based on the maximum resource utilization rate among the candidate resource utilization rates corresponding to the sample program instructions, the initial labeled resource information is determined to describe the resources required by the target processor to execute the sample program instructions.
8. The method as described in claim 4, characterized in that, The step of invoking the target processor and executing the target program instructions based on the first resource information includes: Obtain the unit execution time slice of the target processor; Based on the unit execution time slice and the target program instruction P i Based on the corresponding first resource information, the target program instruction P is determined. i The execution period; The target program instruction P is determined according to the execution time period. i Arranged in the instruction queue; According to the target program instruction P i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i .
9. The method as described in claim 8, characterized in that, The execution time slice and the target program instruction P are based on the unit execution time slice. i Based on the corresponding first resource information, the target program instruction P is determined. i The execution time period includes: According to the target program instruction P i The target program instruction P is determined by multiplying the corresponding modified resource utilization rate by the unit execution time slice. i Execution time; Based on the target program instruction P i The generation time is used to determine the target program instruction P. i The execution order; Based on the execution duration and the execution order, the target program instruction P is determined. i The execution period.
10. The method as described in claim 8, characterized in that, The target program instruction P is followed i The order of the instructions in the instruction queue determines the target processor's execution of the target program instruction P. i ,include: The proxy process is invoked as the target program instruction P. i Create an execution thread; When arranged in the target program instruction P i When all previous target program instructions have been executed, the execution thread is invoked to read the target program instruction P from the instruction queue. i The target processor is invoked to execute the target program instruction P. i .
11. The method as described in claim 1, characterized in that, The method further includes: Once the target program instructions have been executed, the execution result of the target program instructions is obtained from the target processor. The proxy process is invoked to send the execution result back to the associated program instruction; the associated program instruction is a program instruction that has not been executed in the application process to which the target program instruction belongs and is related to the target program instruction.
12. A program instruction execution device, characterized in that, include: The acquisition module is used to acquire instruction attribute information of program instructions in the application process, as well as processing attribute information of the target processor. A filtering module is used to invoke a proxy process to filter program instructions that meet the execution conditions of the target processor from the application process based on the instruction attribute information and the processing attribute information, and to select them as target program instructions; the number of target program instructions is at least two. The prediction module is used to apply a target resource identification model to the target program instruction P. i Resource identification is performed using instruction attributes to obtain the instruction P that describes the target processor executing the target program. i Initial resource information required; i is a positive integer less than or equal to N, where N is the number of program instructions in at least two target program instructions; Based on the initial resource information corresponding to the remaining program instructions, the target program instruction P is... i The corresponding initial resource information is corrected to obtain the target program instruction P used to describe the target processor executing the target program instruction P. i The first resource information of the required resources; the remaining program instructions are the at least two target program instructions excluding the target program instruction P. i Other than the target program instructions, the first resource information is used to describe the target processor executing the target program instruction P. i The required time or computing resources, or the first resource information, are used to describe the target processor executing the target program instruction P. i At that time, the resource utilization rate of the target processor; An execution module is used to invoke the target processor based on the first resource information and execute the target program instructions.
13. A computer device, characterized in that, include: Processor and memory; The processor is connected to a memory; the memory is used to store program code, and the processor is used to call the program code to execute the method as described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-11.