Task execution method and device, computer equipment and storage medium

By creating task execution threads and communication objects in the main process, PSO compilation tasks can be executed directly in the main process, solving the problems of resource consumption and task interruption caused by creating new processes, and achieving efficient and sequential task execution.

CN121614232APending Publication Date: 2026-03-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511729744.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing technologies require the creation of new processes when performing PSO compilation tasks, resulting in resource consumption and time consumption. Furthermore, the reclamation of processes may cause task execution to be interrupted, affecting the sequential execution of tasks.

Method used

The task execution thread and communication object are created in the main process, and the target task is executed directly in the main process without creating a new process. The task execution is completed using a multi-threaded architecture.

Benefits of technology

This avoids the resource and time consumption of creating new processes, ensures the sequential execution of tasks, prevents task interruption, and improves application efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121614232A_ABST
    Figure CN121614232A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a task execution method and device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the steps of obtaining a task execution instruction through a host process, wherein the task execution instruction is used for indicating execution of a target task; in response to the task execution instruction, creating a task execution thread and a communication object corresponding to the task execution thread in the host process; calling a communication object through the host process, and sending a target task to a task execution thread; and executing the target task through the task execution thread. According to the method and the device, resources and time consumed in the process of creating the new process are avoided, execution interruption of the target task caused by recovery of the process is avoided, and sequential execution of the target task is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a task execution method, apparatus, computer device, and storage medium. Background Technology

[0002] In recent years, with the increasing variety of game applications, the tasks that game applications can perform have become more diverse, and the amount of tasks that need to be performed has also become very large.

[0003] Taking the PSO (Pipeline State Object) compilation task as an example, executing a PSO compilation task requires an architecture based on service components and multiple processes. When the main process receives the instruction to execute the PSO task, a child process is created to run the service component. The main process then issues the PSO compilation task to the child process, which executes the PSO compilation task through its UI (User Interface) thread and reports the PSO compilation result back to the main process.

[0004] However, the above solution requires the creation of new processes, which consumes a lot of resources. Summary of the Invention

[0005] This application provides a task execution method, apparatus, computer device, and storage medium, which avoids the resource and time consumption of creating new processes and prevents the interruption of target task execution due to process recycling, thus ensuring the sequential execution of the target task. The technical solution is as follows: On the one hand, a task execution method is provided, the method comprising: The task execution instruction is obtained through the main process, and the task execution instruction is used to instruct the execution of the target task; In response to the task execution instruction, a task execution thread and a corresponding communication object for the task execution thread are created in the main process; The main process invokes the communication object to send the target task to the task execution thread; The target task is executed through the task execution thread.

[0006] On the other hand, a task execution device is provided, the device comprising: The instruction acquisition module is used to acquire task execution instructions through the main process, wherein the task execution instructions are used to instruct the execution of a target task. A creation module is used to create a task execution thread and a corresponding communication object in the main process in response to the task execution instruction. The task sending module is used to send the target task to the task execution thread by calling the communication object through the main process; The task execution module is used to execute the target task through the task execution thread.

[0007] In one possible implementation, the creation module includes: The notification unit is used to respond to the task execution instruction by sending a target task execution notification to the main thread in the main process through the main process. A creation unit is used to create the task execution thread and the communication object based on the target task execution notification through the main thread.

[0008] In one possible implementation, the creation unit is used to read configuration information in a configuration file based on the target task execution notification via the main thread; and based on the configuration information, create the task execution thread and the communication object corresponding to the service component, wherein the configuration information is used to instruct the service component to run in the main process, and the service component is used to execute the target task.

[0009] In one possible implementation, the device further includes: A configuration processing module is used to obtain the configuration file, which includes first configuration information and second configuration information. The first configuration information is used to declare the service component, and the second configuration information is used to declare the process name corresponding to the service component, so as to indicate that the service component runs in the process corresponding to the process name and is different from the main process; the second configuration information in the configuration file is deleted to indicate that the service component runs in the main process.

[0010] In one possible implementation, the creation module is configured to, in response to the task execution instruction, create the task execution thread in the main process; create a processing object for the task execution thread; and encapsulate the processing object to obtain a message passing object for the task execution thread.

[0011] In one possible implementation, the target task is a pipeline state object (PSO) compilation task, and the apparatus further includes: The instruction sending module is used to send an initialization instruction to the task execution thread by calling the processing object through the main thread; An initialization module is used to initialize the compilation environment based on the initialization instructions through the task execution thread.

[0012] In one possible implementation, the creation module is used to encapsulate the processing object after receiving the initialization completion notification of the task execution thread from the main thread, thereby obtaining the message passing object of the task execution thread.

[0013] In one possible implementation, the device further includes: The handle sending module is used to send the notification handle corresponding to the communication object to the main process through the main thread. The notification handle is used to send a message to the task execution thread to which the communication object belongs after being invoked.

[0014] In one possible implementation, the task sending module is used to send the target task to the task execution thread by invoking the notification handle through the main process.

[0015] In one possible implementation, the device further includes: The result processing module is used to obtain the execution result of the target task through the task execution thread; and to send the execution result to the main process through the task execution thread.

[0016] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the task execution method as described above.

[0017] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the task execution method as described above.

[0018] On the other hand, a computer program product is provided, including a computer program that is loaded and executed by a processor to perform the operations performed by the task execution method as described above.

[0019] The solution provided in this application embodiment, when the main process obtains the task execution instruction, creates a task execution thread and a corresponding communication object in the main process, and calls the communication object to send the target task to the task execution thread. The target task can then be executed through the task execution thread instead of through a thread independent of the main process. Therefore, it is not necessary to create a new process during the execution of the target task, thus avoiding the resources and time consumed by creating a new process, and preventing the interruption of the target task execution due to the recycling of the process, ensuring the sequential execution of the target task. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the 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 an implementation environment provided in an embodiment of this application.

[0022] Figure 2 This is a flowchart of a task execution method provided in an embodiment of this application.

[0023] Figure 3 This is a flowchart of another task execution method provided in the embodiments of this application.

[0024] Figure 4 This is a schematic diagram of original configuration information provided in an embodiment of this application.

[0025] Figure 5 This is a schematic diagram of a modified configuration information provided in an embodiment of this application.

[0026] Figure 6 This is a schematic diagram of a multi-process architecture provided in an embodiment of this application.

[0027] Figure 7 This is a schematic diagram of a multi-threaded architecture provided in an embodiment of this application.

[0028] Figure 8 This is a schematic diagram illustrating the operation flow of a PSO compilation task executed by the UI thread in the main process, as provided in an embodiment of this application.

[0029] Figure 9 This is a schematic diagram illustrating the operation flow of a PSO compilation task executed by a compilation thread in the main process, as provided in an embodiment of this application.

[0030] Figure 10 This is a schematic diagram of the structure of a task execution device provided in an embodiment of this application.

[0031] Figure 11 This is a schematic diagram of another task execution device provided in an embodiment of this application.

[0032] Figure 12 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application.

[0033] Figure 13 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0035] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, first configuration information may be referred to as second configuration information, and similarly, second configuration information may be referred to as first configuration information.

[0036] Here, "at least two" refers to two or more configuration pieces. For example, "at least two configuration pieces" can be any integer number of configuration pieces greater than or equal to two, such as two configuration pieces or three configuration pieces. "Each" refers to each of the at least two configuration pieces. For example, "each configuration piece" refers to each of the at least two configuration pieces. If the at least two configuration pieces are three configuration pieces, then "each configuration piece" refers to each of the three configuration pieces.

[0037] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals (including but not limited to signals transmitted between user terminals and other devices) involved in this application have all been fully authorized by the user or relevant parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0038] First, the terms used in the embodiments of this application are explained as follows: 1. Android: An open-source operating system based on the Linux kernel, primarily used for mobile devices such as smartphones and tablets. Android boasts many features, including a vast application ecosystem, a user-friendly interface, regular version releases bringing new features and security improvements, and powerful development tools and resources to support Android application development. Crucially, Android is open-source, meaning developers are free to view, modify, and distribute its source code. This openness makes Android highly flexible, allowing for extensive customization and application across a wide range of devices.

[0039] 2. PSO (Pipeline State Object): A core mechanism in modern graphics APIs (Application Programming Interfaces) for encapsulating all states of the rendering pipeline. Its design goal is to significantly improve rendering efficiency through pre-compilation and unified management of pipeline states. PSO is a pre-compiled encapsulation of all fixed states in the graphics rendering pipeline (such as shaders, blending modes, depth testing, etc.), packaging these states into an immutable object. During rendering, the complete pipeline configuration is quickly switched by binding to the PSO. Its core functions include: performance optimization, compilation verification and unified binding, reducing runtime state switching overhead (such as driver verification, resource binding, etc.), state isolation (different PSOs represent completely independent rendering configurations, avoiding state conflicts), cross-platform compatibility, and enabling cross-platform compilation of shader code through an intermediate representation.

[0040] 3. Unreal Engine (UE): A game engine widely used in various types of games and other real-time 3D applications, such as virtual reality, filmmaking, and architectural visualization. UE is renowned for its powerful graphics rendering capabilities, achieving realistic lighting and high-quality visual effects. It provides an intuitive visual scripting system called Blueprints, allowing developers to create complex game logic without writing code. It supports multiple platforms, including PCs, consoles, mobile devices, and virtual reality devices. It offers a complete set of development tools and editors to help developers with level design, material editing, and animation creation. It also boasts a large developer community and a rich resource library, including tutorials, plugins, and assets, helping developers quickly develop projects. Furthermore, UE's source code is open, allowing developers to access and modify the engine's underlying code to meet specific needs. On the Android platform, UE primarily uses a combination of Java and C++ for program design and development. The latest version of UE is UE5, which adds many new features, including improvements to PSO compilation.

[0041] 4. Service Component: This is a core component in the Android system used to perform background tasks. Its design goal is to provide applications with headless, persistent background service capabilities. Its core characteristics are headless operation, the ability to run independently of the Activity component, and suitability for scenarios such as music playback, file download, and network communication. It supports IPC (Inter-Process Communication), enabling cross-process interaction through bound services, such as data transfer or method calls between an Activity and a Service. Service components are commonly used to perform background tasks.

[0042] The method provided in this application embodiment is used in a computer device. Optionally, the computer device is a terminal. Optionally, the terminal is a smartphone, tablet computer, laptop computer, desktop computer, smartwatch, smart voice interaction device, virtual reality device, augmented reality device, etc., but is not limited to these. Optionally, the computer device includes a terminal and a server. The server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0043] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. The implementation environment includes a terminal 110 and a server 120. The terminal 110 is connected to the server 120 via a wireless network or a wired network.

[0044] Terminal 110 has an application 111 installed and running. This application 111 can be a game application, a live streaming application, a social application, a video playback application, or other types of applications. When terminal 110 runs application 111, the user interface of application 111 is displayed on the screen of terminal 110. Terminal 110 is the terminal used by user 112.

[0045] In one possible implementation, user 112 controls a virtual character on terminal 110 to perform activities in a virtual environment (such as walking, running, jumping, riding vehicles, using attack items, releasing skills, etc.), or manipulates virtual items owned by the virtual character. The virtual character can be referred to as user 112's virtual character. User 112 can assemble, disassemble, and unload virtual items owned by the virtual character; this application does not limit this. Illustratively, the virtual character can be a realistic human character or an anime character.

[0046] Those skilled in the art will understand that the number of terminals described above can be more or less. For example, there may be only one terminal (e.g., a user playing a game with artificial intelligence), or there may be 10 terminals (e.g., 10 users participating in the same game), or more. This application does not limit the number or type of terminals in its embodiments.

[0047] It should be noted that, Figure 1 Only one terminal is shown in the diagram, but in different embodiments, multiple other terminals 130 can access the server 120. Optionally, one or more terminals 130 may also be terminals corresponding to developers, on which an application development and editing platform is installed. Developers can edit and update applications on terminals 130 and transmit the updated application installation package to the server 120 via wired or wireless network. Terminal 110 can download the application installation package from the server 120 to update the application.

[0048] Server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 120 is used to provide background services for applications supporting one or more virtual environments. Optionally, server 120 undertakes the primary computing work, and the terminal undertakes the secondary computing work; or, server 120 undertakes the secondary computing work, and the terminal undertakes the primary computing work; or, server 120 and the terminal use a distributed computing architecture for collaborative computing.

[0049] In one possible implementation, server 120 includes processor 122, user account database 123, battle service module 124, and user-facing input / output interface (I / O interface) 125. Processor 122 loads instructions stored in server 120 and processes data in user account database 123 and battle service module 124. User account database 123 stores user account data used by terminal 110 and other terminals 130, such as user account avatars, nicknames, combat power indices, and service regions. Battle service module 124 provides multiple battle rooms for users to engage in battles, such as 1v1, 3v3, and 5v5 battles. User-facing I / O interface 125 establishes communication and exchanges data with terminal 110 and other terminals 130 via wireless or wired networks.

[0050] In one possible implementation, at least one of the multiple terminals supports a touchscreen, on which one or more touch controls are displayed. The user uses the one or more touch controls to control the activities of the virtual character and / or manipulate the virtual items owned by the virtual character.

[0051] In one possible implementation, at least one of the multiple terminals supports peripheral devices, including but not limited to: physical keyboards, mice, game controllers, etc. The peripheral devices include one or more physical buttons. Users use these one or more physical buttons to control the activities of virtual characters and / or manipulate virtual items owned by the virtual characters.

[0052] Figure 2 This is a flowchart illustrating a task execution method provided in an embodiment of this application. This embodiment is executed by a computer device, which is as follows: Figure 1 The terminal 110, server 120, or other devices shown are examples. See also... Figure 2 The method includes: 201. Computer devices obtain task execution instructions through the main process. The task execution instructions are used to instruct the execution of the target task.

[0053] In one possible implementation, the computer device's operating system is Android, iOS (an operating system), or another system. The computer device runs an application that executes the methods provided in this application's embodiments. This application can be a game application, a live streaming application, a social application, a video playback application, or other types of applications. The application includes a main process, which is created when the application starts and serves as the default runtime container for all components within the application. It carries the core lifecycle and basic functionality of the application, and the name of the main process is, by default, the same as the application's package name. If the application includes other processes, the main process can communicate across processes.

[0054] This application describes the process of a computer device executing a target task. The computer device obtains a task execution instruction through the main process. This task execution instruction can be initiated by the main process or initiated by a caller and then sent to the main process. The target task can be a PSO compilation task or other tasks. In one possible implementation, the target task is a preset high-time-consuming task, and executing the target task requires a long time. If the target task is executed through the main thread in the main process, it is likely to block the main thread due to the long execution time, causing the application to lag.

[0055] For example, game applications often contain scenarios that require dynamic compilation of PSOs, such as when the game application is installed for the first time, when there is no local PSO cache data, when entering the login page, the lobby page, or the farm and other gameplay pages. In these cases, the PSO compilation task execution command is initiated.

[0056] 202. In response to a task execution instruction, the computer device creates a task execution thread and a corresponding communication object in the main process.

[0057] The task execution thread can be a Handler Thread (processing thread) or other types of threads. Handler Thread is a lightweight utility class in the Android system that combines threads (Thread) and message loops (Looper / Handler). It is designed to simplify background task management and has a built-in message loop mechanism that can send messages to the queue through the processing object to achieve asynchronous task scheduling.

[0058] The task execution thread is used to execute the target task. The communication object corresponding to the task execution thread can be of type Handler or Messenger. The communication object is used to send messages to the task execution thread after being invoked.

[0059] In this embodiment of the application, the computer device no longer adopts a "multi-process" architecture, but a "multi-thread" architecture. That is, each time a target task needs to be executed, a separate thread is created in the main process, and each thread executes its own target task, instead of creating a new process.

[0060] 203. Computer devices send target tasks to task execution threads by calling communication objects through the main process.

[0061] 204. Computer devices execute target tasks through task execution threads.

[0062] Since the communication object is used to send messages to the task execution thread after being invoked, the computer device can send the target task to the task execution thread by invoking the communication object through the main process, so as to instruct the task execution thread to execute the target task.

[0063] It should be noted that the embodiments of this application adopt a "multi-threaded" architecture to execute the target task. The target task may include one or more types of tasks. For tasks that are different from the target task, i.e., non-target tasks, a "multi-process" architecture or other methods may be used to execute them.

[0064] The method provided in this application embodiment, when the main process obtains the task execution instruction, creates a task execution thread and a corresponding communication object in the main process, and calls the communication object to send the target task to the task execution thread. The target task can then be executed through the task execution thread instead of through a thread independent of the main process. Therefore, it is not necessary to create a new process during the execution of the target task, thus avoiding the resources and time consumed by creating a new process, and preventing the interruption of the target task execution due to the recycling of the process, ensuring the sequential execution of the target task.

[0065] In the above Figure 2 Based on the illustrated embodiments, this application also provides another task execution method. Figure 3 This is a flowchart of another task execution method provided in this application embodiment. This application embodiment is executed by a computer device, which is as follows: Figure 1 The terminal 110, server 120, or other devices shown are examples. See also... Figure 3 The method includes: 301. Computer devices obtain task execution instructions through the main process. The task execution instructions are used to instruct the execution of the target task.

[0066] Step 301 is the same as step 201 above, and will not be repeated here.

[0067] 302. In response to a task execution instruction, the computer device sends a target task execution notification to the main thread in the main process through the main process.

[0068] The main process includes the main thread, which is created when the application starts. In one possible implementation, the main thread can be the UI (User Interface) thread. The UI thread handles UI-related operations, such as drawing the interface and responding to controls. It also executes critical lifecycle methods of various components and communicates with child threads other than the main thread. Alternatively, the main thread can be other types of threads.

[0069] In one possible implementation, the main process is configured with a task allocation center. In response to a task execution instruction, the computer device sends a target task execution notification to the main thread through the task allocation center. The task allocation center is used to allocate the various tasks to be executed. Furthermore, the target task execution notification is used to instruct the main thread to execute the target task.

[0070] 303. The computer device, through the main thread, creates a task execution thread and a corresponding communication object based on the target task execution notification.

[0071] Because the main thread needs to handle UI-related operations and other critical tasks, it cannot execute time-consuming tasks, as this could block the main thread, causing application lag and affecting its normal operation. Therefore, after receiving a target task execution notification through the main thread, the computer device does not execute the target task through the main thread, but rather through an independent thread. To this end, the computer device creates a task execution thread and a corresponding communication object through the main thread.

[0072] In one possible implementation, step 303 includes: the computer device, through the main thread, executes a notification based on the target task and reads the configuration information in the configuration file; based on the configuration information, it creates a task execution thread and a communication object corresponding to the service component, wherein the configuration information is used to instruct the service component to run in the main process and the service component is used to execute the target task.

[0073] This configuration information is used to configure the service components that need to execute the target task. Since the configuration information instructs the service components to run in the main process, rather than in other independent processes, after the main thread reads the configuration information, it will create the task execution thread and communication object according to the instructions in the configuration information. This ensures the accuracy of executing the target task and avoids runtime errors. Furthermore, the configuration information in the configuration file can be modified and updated adaptively as needed, improving flexibility.

[0074] In one example of this implementation, the method further includes: obtaining a configuration file, which includes first configuration information and second configuration information, wherein the first configuration information is used to declare the service component and the second configuration information is used to declare the process name corresponding to the service component, so as to indicate that the service component runs in a process corresponding to the process name and different from the main process; and deleting the second configuration information in the configuration file to indicate that the service component runs in the main process.

[0075] For example, this configuration file is the manifest file of the Android system. If the process field is not configured in the configuration information of the manifest file, or if the process field is configured as the application's package name, it means that the component runs in the main process. If the process field is configured, it means that the component runs in the process corresponding to the process name in the process field.

[0076] Taking a PSO compilation task as an example, the configuration information of the service components used to execute the PSO compilation task in the manifest file is as follows: Figure 4 As shown. In Figure 4The configuration information shown registers eight service components for performing PSO compilation tasks, each running in a different process. Taking the first configuration entry as an example, "android:process=":psoprogramservice"" indicates that the service component needs to run in a process named "psoprogramservice". To run the service component in the main process, [the following is missing from the original text]. Figure 4 The `process` declaration in each of the configuration entries shown has been deleted. The configuration entries after deletion are as follows: Figure 5 As shown.

[0077] In this embodiment, by changing the configuration information of the service components, the service components used to execute the target task are uniformly placed in the main process instead of in a separate process, thus avoiding the situation of multi-process execution. This changes the multi-process architecture to a multi-threaded architecture, and is simple to operate, highly scalable, applicable to different types of target tasks, and has a wide range of applications.

[0078] In another possible implementation, the communication objects may include a Handler object and a Messenger object. Accordingly, step 303 includes: in response to a task execution instruction, the computer device creates a task execution thread in the main process; creates a Handler object for the task execution thread; and encapsulates the Handler object to obtain the Messenger object for the task execution thread.

[0079] The `processor` object is a class used for message passing and task scheduling between different threads within the same process, enabling one thread to send messages to another. The `message` object is a message passing tool implemented based on the `processor` object; it's a cross-process invocation component encapsulated by the Android system, capable of passing messages between different threads or processes. The `message` object holds the `processor` object and supports cross-process passing and invocation. Therefore, by creating a `processor` object and a `message` object for the task execution thread, messages can be sent to the task execution thread simply by calling the `message` object, eliminating the need to manually handle the underlying message passing code. This simplifies the complexity of inter-thread communication and ensures communication security and ordering.

[0080] It should be noted that this implementation takes the communication object as including a processing object and a message passing object as an example. In another implementation, the communication object may include a processing object instead of creating a message passing object, or the communication object may be other objects.

[0081] In another possible implementation, the target task is a PSO compilation task. Before executing the PSO task, the compilation environment needs to be initialized. This initialization process can be performed after the creation of the processing object and before the creation of the message passing object. That is, after the processing object is created, the method also includes: calling the processing object through the main thread to send an initialization instruction to the task execution thread; and initializing the compilation environment through the task execution thread based on the initialization instruction. Subsequently, after the compilation environment is initialized by the task execution thread, an initialization completion notification is sent to the main thread. Upon receiving the initialization completion notification from the task execution thread, the main thread encapsulates the processing object to obtain the message passing object of the task execution thread.

[0082] 304. Computer devices send target tasks to task execution threads by calling communication objects through the main process.

[0083] In one possible implementation, after the computer device creates a communication object through the main thread, the main thread sends a notification handle corresponding to the communication object to the main process. This notification handle, when invoked, sends a message to the task execution thread to which the communication object belongs. Thus, by invoking this notification handle through the main process, the target task can be sent to the task execution thread.

[0084] The notification handle is a unique identifier corresponding to the communication object. Based on the notification handle, operations such as locating and invoking the communication object can be performed. When a notification is sent to the task execution thread by invoking the notification handle, the notification can be directly located, enabling precise and efficient full lifecycle control of the notification and ensuring accurate and error-free operations.

[0085] Taking a message passing object as an example, the main thread generates a notification handle corresponding to the message passing object and sends it to the main process. After the main process obtains the notification handle, it can call the message passing object to send a message including the target task. This message can then be received and processed by the thread associated with the processing object encapsulated by the message passing object, i.e., the task execution thread.

[0086] 305. Computer devices execute target tasks and obtain the execution results of target tasks through task execution threads.

[0087] 306. Computer devices send execution results to the main process through task execution threads.

[0088] Once a computer device receives a target task through a task execution thread, it can execute the task, obtain the execution result, and send it to the main process. The main process then retrieves the execution result and reports it to the caller that initiated the task execution command, ensuring the complete execution of the target task.

[0089] Furthermore, the execution of the target task is not performed on the main thread. Even if the execution process takes a long time, it will not affect the operation of the main thread and will not cause the application to lag.

[0090] The method provided in this application embodiment, when the main process obtains the task execution instruction, creates a task execution thread and a corresponding communication object in the main process, and calls the communication object to send the target task to the task execution thread. The target task can then be executed through the task execution thread instead of through a thread independent of the main process. Therefore, it is not necessary to create a new process during the execution of the target task, thus avoiding the resources and time consumed by creating a new process, and preventing the interruption of the target task execution due to the recycling of the process, ensuring the sequential execution of the target task.

[0091] In addition, the target task is executed through the task execution thread in the main process without affecting the main thread in the main process. Even if the execution time of the target task is long, it will not cause the main thread to freeze or the application to freeze, thus ensuring the normal operation of the application.

[0092] In addition, since there is no need to create a new process or perform cross-process communication, only inter-thread communication within the main process is required. This avoids the limitation of the maximum data volume of cross-process communication on the amount of data transmitted, and reduces the probability of execution result transmission failure.

[0093] It should be noted that the above Figure 2 and Figure 3 The embodiments shown can be combined in any form to form optional solutions for the embodiments of this application, which will not be described in detail here.

[0094] This application's embodiments can be applied to game scenarios. Game applications include multiple functions and require the execution of various types of tasks, such as interactive feedback tasks, virtual character rendering tasks, virtual scene rendering tasks, gameplay control tasks, state management tasks, data storage tasks, data synchronization tasks, resource management tasks, PSO compilation tasks, etc., requiring a large number of tasks to be executed. Using the method provided in this application's embodiments, the target tasks in the game application can be executed online, saving the resources and time consumed by the target tasks, without affecting the normal display of the game screen or causing lag, ensuring the normal operation of the game application, and improving the user experience for game players. Furthermore, this application's embodiments can also be applied to other scenarios, with the execution process being the same, and will not be elaborated further here.

[0095] In Android systems, the traditional UE engine uses the RHI (Rendering Hardware Interface) thread to perform PSO compilation tasks. The RHI thread is responsible for rendering game visuals and can directly call graphics framework APIs such as OpenGL (Open Graphics Library) and Vulkan. However, performing PSO compilation tasks consumes the RHI thread, causing rendering stuttering and other issues. OpenGL is a cross-language, cross-platform application programming interface for rendering 2D (Two-Dimensional) and 3D vector graphics, while Vulkan is a low-level, cross-platform graphics and computing API designed to provide efficient, fine-grained control over modern hardware.

[0096] Therefore, related technologies have introduced methods for executing PSO compilation tasks based on service components and a multi-process architecture. A schematic diagram of the multi-process architecture is shown below. Figure 6 As shown. When the caller initiates a task execution instruction, the main process receives the instruction and, through the PSO compilation task allocation center, creates a separate child process to run the service component. Then, through Binder IPC, the PSO compilation task is assigned to the selected service component for execution. Binder is the core mechanism for implementing inter-process communication (IPC) in the Android system, designed to provide efficient, secure, and easy-to-use interaction capabilities between different processes. Based on a Client / Service architecture, it features zero-copy memory mapping, dynamic thread pool management, and a strict security model, becoming the cornerstone of high-performance IPC in the Android system. However, all Binder transactions share a 1MB kernel transaction buffer; transferring large amounts of data (such as images) requires fragmentation or using ParcelFileDescriptor (a class in the Android system) to pass file handles.

[0097] Figure 6 Taking child process 1 to child process N, a total of N child processes, as an example, where N is a positive integer, from... Figure 6 As can be seen, the thread executing the PSO compilation task is the UI thread of the process where the Service resides, and the lifecycle notifications of the service component run on the UI thread by default. The entire execution process includes initializing the compilation environment, executing the PSO compilation task, and returning the compilation result. After the PSO compilation task is completed on the UI thread, the compilation result is returned to the main process via Binder IPC, and finally, the compilation result is returned to the caller that initiated the task execution instruction.

[0098] However, the solutions provided by these technologies have the following problems: 1. Consumes memory resources.

[0099] Because of the multi-process architecture, each service component executing the PSO compilation task runs in an independent process. However, launching a new process on the Android platform requires creating an Android virtual machine, loading the target application, etc., which consumes relatively more memory resources. Since applications integrating the UE engine are larger, the increase in memory resources caused by launching a new process is even more significant. Furthermore, multiple service components executing PSO compilation tasks typically need to be configured to achieve parallel compilation during multi-task compilation; when multiple processes are launched simultaneously, the increase in memory resources becomes unacceptable.

[0100] 2. May cause applications to become unresponsive.

[0101] PSO compilation tasks are computationally intensive. By default, the UE engine executes PSO compilation tasks in a new process's UI thread, which can cause UI thread lag. Although the service component itself does not have an interactive interface, according to Android system design, performing time-consuming operations within the UI thread will cause the Android system to display an application unresponsive message if the time exceeds a certain limit (more than 5 seconds for the service component), affecting user experience. Furthermore, the process corresponding to the service component will be forcibly closed.

[0102] 3. The amount of data that can be transferred via Binder IPC is limited.

[0103] Android's Binder IPC data transfer framework limits the amount of data that can be directly transferred to no more than 1MB (due to the limitation of the Binder driver kernel cache size). When the data size of the PSO compilation result is large (close to or exceeding 1MB), the data transfer will fail due to the limitation of Binder IPC, and the PSO compilation result cannot be returned to the main process.

[0104] 4. Background processes are easily reclaimed by the system automatically.

[0105] Background processes used to perform PSO compilation tasks have a lower priority than foreground interactive processes with a display interface. When system memory is low, these background processes are automatically reclaimed first. The reclamation of background processes will interrupt the PSO compilation tasks they are executing, directly affecting the PSO compilation results.

[0106] 5. Startup process time.

[0107] When a PSO compilation task needs to be executed, a new process needs to be started. Starting a new process takes more time than starting a new thread. On some low-performance devices, starting a process may take 2-3 seconds.

[0108] In the embodiments of this application, see Figure 7When the caller initiates a task execution instruction, the main process obtains the task execution instruction and then distributes the PSO compilation task to the compilation unit through the PSO compilation task allocation center. The compilation unit in the main process executes the PSO compilation task, and after the PSO compilation task is completed, it returns the compilation result to the main process. Finally, the compilation result is returned to the caller who initiated the task execution instruction. Figure 7 Taking N compilation units as an example, where N is a positive integer. Furthermore, if multiple PSO compilation tasks share the UI thread of the main process, it can lead to longer execution times for the UI thread, potentially causing lag. Therefore, in this embodiment, the compilation unit includes a UI thread and a compilation thread, with the compilation thread specifically executing the PSO compilation tasks.

[0109] For ease of comparison, the embodiments of this application provide Figure 8 and Figure 9 Diagrams illustrating the two operating procedures.

[0110] first, Figure 8 In the illustrated workflow, the PSO compilation task is executed by the UI thread in the main process, and the service components corresponding to multiple PSO compilation tasks share the UI thread. See also... Figure 8 The operation process for executing a PSO compilation task includes: 801. When the caller initiates a task execution instruction, the main process obtains the task execution instruction, compiles the task allocation center through the main process's PSO, calls the bindService method, and binds the service component.

[0111] Among them, bindService is a way to start and bind service components in the Android system. It can establish a long-term association between the calling component and the service component, and realize bidirectional communication between the calling component and the service component.

[0112] 802. The main process sends a PSO compilation task to the UI thread.

[0113] Since the onBind lifecycle method of the service component is fixed to be executed on the UI thread, a PSO compilation task is sent to the UI thread.

[0114] 803. After the UI thread initializes the compilation environment, it generates the UI thread's processing object and the UI thread's message passing object.

[0115] 804. The UI thread sends the notification handle corresponding to the message passing object to the main process.

[0116] 805. The main process calls the notification handle to send a processing message (HandlerMessage) for the processing object to the UI thread. The processing message includes the PSO compilation task.

[0117] 806. The UI thread receives and processes messages, executes the PSO compilation task, and obtains the compilation results.

[0118] 807. The UI thread returns the compilation results to the main process.

[0119] 808. The main process sends the compilation results to the caller, and the caller receives the compilation results.

[0120] Secondly Figure 9 In the illustrated workflow, the PSO compilation task is executed by the compilation process and does not occupy the UI thread. See also Figure 9 The operation process for executing a PSO compilation task includes: 901. When the caller initiates a task execution instruction, the main process obtains the task execution instruction, compiles the task allocation center through the main process's PSO, calls the bindService method, and binds the service component.

[0121] 902. The main process sends a PSO compilation task to the UI thread.

[0122] 903. The UI thread creates a separate compilation thread and generates the processing objects for that compilation thread.

[0123] This compilation thread is the Handler Thread in the Android system.

[0124] 904. The UI thread sends initialization instructions to the compilation thread by processing objects, instructing the compilation thread to initialize the compilation environment.

[0125] 905. After the compilation thread initializes the compilation environment, the UI thread generates the compilation thread's message passing object.

[0126] In this process, after the UI thread sends the initialization command, it is blocked and waits for the compilation thread to complete the initialization of the compilation environment before returning to normal.

[0127] 906. The UI thread sends the notification handle corresponding to the message passing object to the main process.

[0128] 907. The main process calls the notification handle to send a processing message for the processing object to the compilation thread. The processing message includes the PSO compilation task.

[0129] 908. The compilation thread receives and processes messages, executes the PSO compilation task, and obtains the compilation results.

[0130] 909. The compilation thread returns the compilation results to the main process.

[0131] 910. The main process sends the compilation results to the caller, and the caller receives the compilation results.

[0132] By comparison Figure 8 and Figure 9 As can be seen from the operation flow shown, compared with executing PSO compilation tasks through the UI thread, the Android system's Handler Thread is used to create the compilation thread required for PSO compilation tasks, initialize the compilation environment and execute PSO compilation tasks through the compilation thread, and change the PSO compilation tasks from being assigned to the main thread to being assigned to the newly created compilation thread.

[0133] In summary, the embodiments of this application have the following beneficial effects: 1. PSO compilation tasks are no longer executed through a thread independent of the main process. Therefore, there is no need to start a new process during the execution of PSO compilation tasks, and no memory resources or time are consumed.

[0134] 2. The PSO compilation task is executed through the compilation thread in the main process without affecting the UI thread in the main process. Even if the PSO compilation task takes a long time to execute, it will not cause the UI thread to lag or the application to lag, thus avoiding page lag and ensuring the normal operation of the application.

[0135] 3. Since there is no need to create a new process or perform cross-process communication, only inter-thread communication within the main process is required. This avoids the limitation of the maximum data volume of cross-process communication on the amount of data transmitted, and reduces the probability of execution result transmission failure.

[0136] 4. Since no new process needs to be created, and it only runs within the main process, the PSO compilation task execution is not interrupted due to the recycling of other processes besides the main process, thus ensuring the sequential execution of the PSO compilation task.

[0137] Figure 10 This is a schematic diagram of the structure of a task execution device provided in an embodiment of this application. See also... Figure 10 The device includes: The instruction acquisition module 1001 is used to acquire task execution instructions through the main process. The task execution instructions are used to instruct the execution of the target task. Create module 1002 to create a task execution thread and a corresponding communication object in the main process in response to a task execution command. The task sending module 1003 is used to send the target task to the task execution thread by calling the communication object through the main process; Task execution module 1004 is used to execute the target task through the task execution thread.

[0138] In one possible implementation, see [link to relevant documentation]. Figure 11 Create module 1002, which includes: The notification unit 1011 is used to respond to the task execution instruction and send the target task execution notification to the main thread in the main process through the main process; Create unit 1012, which is used to create task execution threads and communication objects through the main thread, based on the target task execution notification.

[0139] In one possible implementation, a creation unit 1012 is used to read configuration information from a configuration file by executing a notification based on a target task through the main thread; based on the configuration information, a task execution thread and a communication object corresponding to the service component are created, and the configuration information is used to instruct the service component to run in the main process, and the service component is used to execute the target task.

[0140] In one possible implementation, see [link to relevant documentation]. Figure 11 The device also includes: The configuration processing module 1005 is used to obtain a configuration file, which includes first configuration information and second configuration information. The first configuration information is used to declare the service component, and the second configuration information is used to declare the process name corresponding to the service component, so as to indicate that the service component runs in a process corresponding to the process name and different from the main process; the second configuration information in the configuration file is deleted to indicate that the service component runs in the main process.

[0141] In one possible implementation, module 1002 is created to create a task execution thread in the main process in response to a task execution instruction; a processing object for the task execution thread is created; and the processing object is encapsulated to obtain a message passing object for the task execution thread.

[0142] In one possible implementation, the target task is the Pipeline State Object (PSO) compilation task; see [link to relevant documentation]. Figure 11 The device also includes: The instruction sending module 1006 is used to send initialization instructions to the task execution thread by calling the processing object through the main thread; Initialization module 1007 is used to initialize the compilation environment based on initialization instructions through the task execution thread.

[0143] In one possible implementation, module 1002 is created to encapsulate the processing object after receiving the initialization completion notification of the task execution thread from the main thread, thereby obtaining the message passing object of the task execution thread.

[0144] In one possible implementation, see [link to relevant documentation]. Figure 11 The device also includes: The handle sending module 1008 is used to send the notification handle corresponding to the communication object to the main process through the main thread. The notification handle is used to send a message to the task execution thread to which the communication object belongs after being called.

[0145] In one possible implementation, the task sending module 1003 is used to send the target task to the task execution thread by calling the notification handle through the main process.

[0146] In one possible implementation, see [link to relevant documentation]. Figure 11 The device also includes: The result processing module 1009 is used to obtain the execution result of the target task through the task execution thread; and to send the execution result to the main process through the task execution thread.

[0147] It should be noted that the task execution device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the task execution device and the task execution method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0148] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed in the task execution method of the above embodiments.

[0149] Optionally, the computer device is provided as a terminal. Figure 12 A schematic diagram of the structure of a terminal 1200 provided in an exemplary embodiment of this application is shown.

[0150] Terminal 1200 includes a processor 1201 and a memory 1202.

[0151] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0152] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 are used to store at least one computer program, which is used by the processor 1201 to implement the task execution method provided in the method embodiments of this application.

[0153] In some embodiments, the terminal 1200 may also optionally include: a peripheral device interface 1203 and at least one peripheral device. The processor 1201, memory 1202, and peripheral device interface 1203 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1203 via a bus, signal line, or circuit board. Optionally, the peripheral device includes at least one of: a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, and a power supply 1207.

[0154] Peripheral device interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1201 and memory 1202. In some embodiments, processor 1201, memory 1202 and peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1201, memory 1202 and peripheral device interface 1203 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0155] The radio frequency (RF) circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1204 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1204 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1204 can communicate with other devices through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1204 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0156] Display screen 1205 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1205 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1201 for processing. In this case, display screen 1205 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1205, disposed on the front panel of terminal 1200; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1200 or in a folded design; in still other embodiments, display screen 1205 may be a flexible display screen, disposed on a curved or folded surface of terminal 1200. Furthermore, display screen 1205 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1205 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0157] The camera assembly 1206 is used to acquire images or videos. Optionally, the camera assembly 1206 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal 1200, and the rear-facing camera is disposed on the back of the terminal 1200. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1206 may also include a flash. The flash may be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.

[0158] Power supply 1207 is used to power the various components in terminal 1200. Power supply 1207 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1207 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0159] Those skilled in the art will understand that Figure 12The structure shown does not constitute a limitation on terminal 1200 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0160] Optionally, the computer device is provided as a server. Figure 13 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1300 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1301 and one or more memories 1302. The memories 1302 store at least one computer program, which is loaded and executed by the processor 1301 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.

[0161] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to perform the operations of the task execution method described in the above embodiments. This application also provides a computer program product including a computer program loaded and executed by a processor to perform the operations of the task execution method described in the above embodiments.

[0162] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

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

Claims

1. A task execution method characterized by, The method comprises: obtaining a task execution instruction by a main process, the task execution instruction being used for instructing to execute a target task; in response to the task execution instruction, creating a task execution thread and a communication object corresponding to the task execution thread in the main process; calling the communication object by the main process, and sending the target task to the task execution thread; executing the target task by the task execution thread.

2. The method of claim 1, wherein, The response to the task execution instruction, creating a task execution thread and a communication object corresponding to the task execution thread in the main process comprises: in response to the task execution instruction, issuing a target task execution notification to a main thread in the main process by the main process; based on the target task execution notification, creating the task execution thread and the communication object by the main thread.

3. The method of claim 2, wherein, The response to the task execution instruction, creating a task execution thread and a communication object corresponding to the task execution thread in the main process comprises: based on the target task execution notification, reading configuration information in a configuration file by the main thread; based on the configuration information, creating the task execution thread and the communication object corresponding to a service component, the configuration information being used for instructing the service component to run in the main process, and the service component being used for executing the target task.

4. The method of claim 3, wherein, The method further comprises: obtaining the configuration file, the configuration file comprising first configuration information and second configuration information, the first configuration information being used for declaring the service component, and the second configuration information being used for declaring a process name corresponding to the service component, to indicate that the service component runs in a process corresponding to the process name and different from the main process; deleting the second configuration information in the configuration file, to indicate that the service component runs in the main process.

5. The method according to any one of claims 1 to 4, characterized in that, The response to the task execution instruction, creating a task execution thread and a communication object corresponding to the task execution thread in the main process comprises: in response to the task execution instruction, creating the task execution thread in the main process; creating a processing object of the task execution thread; encapsulating the processing object to obtain a message passing object of the task execution thread.

6. The method of claim 5, wherein, The target task is a pipeline state object (PSO) compilation task, and after the processing object of the task execution thread is created, the method further comprises: calling the processing object by the main thread, to send an initialization instruction to the task execution thread; based on the initialization instruction, initializing a compilation environment by the task execution thread.

7. The method of claim 6, wherein, The encapsulation of the processing object to obtain the message passing object of the task execution thread comprises: after receiving an initialization completion notification of the task execution thread by the main thread, encapsulating the processing object to obtain the message passing object of the task execution thread.

8. The method of claim 2, wherein, After the task execution thread and the communication object are created by the main thread, the method further comprises: The main thread sends a notification handle corresponding to the communication object to the main process, and the notification handle is used to send a message to the task execution thread to which the communication object belongs after being invoked.

9. The method of claim 8, wherein, The main process invokes the communication object to send the target task to the task execution thread, and the method further includes: The main process invokes the notification handle to send the target task to the task execution thread.

10. The method according to any one of claims 1 to 9, characterized in that, After the task execution thread executes the target task, the method further includes: The task execution thread obtains an execution result of the target task. The task execution thread sends the execution result to the main process.

11. A task execution apparatus characterized by comprising: The device includes: An instruction obtaining module configured to obtain a task execution instruction by a main process, the task execution instruction being used to indicate a target task; A creating module configured to create a task execution thread and a communication object corresponding to the task execution thread in the main process in response to the task execution instruction; A task sending module configured to invoke the communication object by the main process to send the target task to the task execution thread; A task execution module configured to execute the target task by the task execution thread.

12. A computer device, comprising: The computer device includes a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the task execution method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the task execution method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program, characterized in that, The computer program is loaded and executed by the processor to implement the operations performed by the task execution method according to any one of claims 1 to 10.