Task allocation method and device, electronic equipment and computer readable storage medium

By splitting the initial target task of the target application and determining asynchronous subtasks, using the task thread pool for thread asynchronous processing, the problem of increasing application startup time is solved and user experience and task processing performance is improved.

CN119862026APending Publication Date: 2025-04-22BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411774564.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

As the application functions increase, the startup time increases linearly, resulting in poor user experience and decreased user compliance, which in turn affects DAU and retention.

Method used

By responding to the target operation, the initial target task of the target application is obtained and subtask splits it to obtain multiple initial business subtasks. Based on these subtasks, asynchronous subtasks are determined and threads are processed asynchronously through the task thread pool.

Benefits of technology

This method effectively reduces the execution time of the target application, improves task processing performance, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862026A_ABST
    Figure CN119862026A_ABST
Patent Text Reader

Abstract

The invention provides a task allocation method and device, and relates to the technical field of information, in particular to the technical field of cloud computing and the like. According to the specific implementation scheme, in response to received target operation on a target application, an initial target task of the target application is obtained; performing subtask splitting on the initial target task to obtain a plurality of initial service subtasks; and determining an asynchronous subtask based on the plurality of initial business subtasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of information technology, specifically to technical fields such as cloud computing, and in particular to a task allocation method and device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In the early stages of an application project, the startup time is generally short. However, as product iterations and functions continue to increase, a lot of business-related initialization logic will be added to the startup phase of the application, such as various SDK (Software Development Kit) initialization, data monitoring, hot fixes, etc., and the startup time will also increase linearly. This results in poor user experience and reduced user compliance with the application, leading to negative results such as decreased DAU (Daily Active User) and retention. Summary of the invention

[0003] The present disclosure provides a task allocation method and device, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] According to a first aspect, a task allocation method is provided, the method comprising: in response to receiving a target operation on a target application, obtaining an initial target task of the target application; splitting the initial target task into subtasks to obtain multiple initial business subtasks; and determining an asynchronous subtask based on the multiple initial business subtasks.

[0005] According to the second aspect, another task allocation method is provided, which includes: collecting configuration information of a task thread pool and the last asynchronous task execution result of an asynchronous subtask running in the task thread pool; obtaining the asynchronous subtask using a task allocation method such as any implementation method of the first aspect; determining the thread attributes of the asynchronous subtask this time based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located; adjusting the configuration information based on the thread attributes to obtain the adjusted configuration information; sending the adjusted configuration information and thread attributes to the device, so that the device uses the task thread pool with the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask.

[0006] According to the third aspect, a task allocation device is provided, which includes: an acquisition unit, configured to acquire an initial target task of a target application in response to receiving a target operation on a target application; a splitting unit, configured to split the initial target task into subtasks to obtain a plurality of initial business subtasks; and a task determination unit, configured to determine an asynchronous subtask based on the plurality of initial business subtasks.

[0007] According to the fourth aspect, a task allocation device is provided, which includes: a collection unit, configured to collect configuration information of a task thread pool, and the last asynchronous task execution result of an asynchronous subtask running in the task thread pool; the asynchronous subtask is obtained using a task allocation method such as any implementation method of the third aspect; a determination unit, configured to determine the thread attributes of the asynchronous subtask this time based on the configuration information, the asynchronous task execution result, and the device information of the device where the asynchronous subtask is located; and an adjustment unit, configured to send the adjusted configuration information and thread attributes to the device, so that the device uses the task thread pool with the adjusted configuration information to perform asynchronous processing on the asynchronous subtask execution thread.

[0008] According to the fifth aspect, an electronic device is provided, which includes: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any implementation manner of the first aspect.

[0009] According to a sixth aspect, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method described in any implementation of the first aspect.

[0010] According to a seventh aspect, a computer program product is provided, comprising a computer program, which implements the method described in any implementation manner of the first aspect when executed by a processor.

[0011] The task allocation method and device provided by the embodiment of the present disclosure first obtain the initial target task of the target application in response to receiving the target operation of the target application; secondly, split the initial target task into subtasks to obtain multiple initial business subtasks; finally, determine the asynchronous subtask based on the multiple initial business subtasks. Thus, a method for splitting asynchronous subtasks is provided, which facilitates asynchronous processing of asynchronous subtask execution threads in the task thread pool, thereby reducing the execution time of the target application.

[0012] The task allocation method and device provided by the embodiment of the present disclosure first collect the configuration information of the task thread pool and the last asynchronous task execution result of the asynchronous subtask running in the task thread pool; secondly, based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located, determine the thread attribute of the asynchronous subtask this time; then, adjust the configuration information based on the thread attribute; finally, use the task thread pool after adjusting the configuration information to perform thread asynchronous processing on the asynchronous subtask. Therefore, by adjusting the attributes of the thread and thread pool of the configuration information, device information and historical asynchronous subtasks, and performing thread asynchronous processing after the adjustment, the asynchronous subtasks in the thread pool can be reasonably sorted each time the asynchronous subtask is executed, the load of the threads in the thread pool is balanced, the task execution time is reduced, and the task processing performance is improved.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0015] Figure 1 is a flow chart of an embodiment of a task allocation method according to the present disclosure;

[0016] Figure 2 It is a schematic diagram of the structure of the initial business subtask splitting in the present disclosure;

[0017] Figure 3 is a structural schematic diagram of thread attributes allocated to initial business subtasks in the present disclosure;

[0018] Figure 4 is a flow chart of an embodiment of a task allocation method according to the present disclosure;

[0019] Figure 5 It is a structural diagram of the last asynchronous task execution result in this disclosure;

[0020] Figure 6 is a timing diagram of the task allocation method disclosed in the present invention;

[0021] Figure 7 is a structural schematic diagram of a data flywheel in the present disclosure;

[0022] Figure 8 is a structural schematic diagram of an embodiment of a task allocation device according to the present disclosure;

[0023] Fig. 9is a structural schematic diagram of another embodiment of the task allocation device according to the present disclosure;

[0024] Fig.10 It is a block diagram of an electronic device used to implement the task allocation method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0026] The startup process of most mobile applications is divided into two phases and two intervals, which are arranged in chronological order: Application phase, Handle Message phase, Activity phase, and data loading phase. Among them, the onCreate() duration and business logic of the Application phase often account for a very high proportion of the entire phase. Optimizing the code and business logic in onCreate() can generally achieve great benefits in terms of duration.

[0027] Generally, there will be a lot of initialization operations in onCreate, and the initialization logic details of each application are different. However, from the perspective of business features, they are all similar. For example, the initialization of logs, statistics, monitoring SDKs, and advertising SDKs. All tasks in the Application phase are run in the Main Thread, and multiple business initializations are serial. The optimization of duration is also optimized for each business logic Case By Case. Even if each business is optimized, the total time is still very long after accumulation.

[0028] In view of the defects in the traditional technology, this disclosure proposes a task allocation method. Figure 1 A process 100 according to an embodiment of a task allocation method disclosed in the present invention is shown. The task allocation method comprises the following steps:

[0029] Step 101 : in response to receiving a target operation on a target application, obtaining an initial target task of the target application.

[0030] In this embodiment, the target application is an application program with a target task, and the target application has corresponding functions. The target operation is an operation of an external subject on the target application, such as clicking, triggering, sliding, etc.

[0031] In this embodiment, the initial target task is a task that needs to be completed by the target application before it is upgraded. For example, the target application is a communication application, and the initial target task of the target application is to complete communication between multiple entities.

[0032] Step 102: split the initial target task into subtasks to obtain a plurality of initial business subtasks.

[0033] In this embodiment, the above-mentioned sub-task splitting of the initial target task to obtain multiple initial business sub-tasks includes: obtaining the business code of the initial target task, decoupling the business code, splitting the decoupled business code according to the business scope and feature dimensions to obtain multiple task block subclasses, each task block subclass has a responsibility, so that each task block subclass serves as an initial business subtask.

[0034] Optionally, task block subclasses can be abstracted based on common features. Task block subclasses need to implement the following capabilities: run method (to actually perform initialization operations), whether it depends on other task blocks, current task name, and current execution thread. The business logic of the startup scene is split and abstracted into tasks. Each task has a single responsibility, and the dependencies and execution processes between tasks are clear. The coupling is low, and the scalability and readability are improved, which saves maintenance labor costs and improves development efficiency.

[0035] In this optional implementation, each task block subclass is atomic, that is, single responsibility. For example, the push service initialization requires the user's identity information, but the identity information is obtained after the login service initialization. Figure 2 As shown, starting from the starting point, task block subclass A is responsible for initializing the push service; task block subclass B is responsible for login initialization; task block subclass C is responsible for sharing initialization; task block subclass A depends on task block subclass B, and task block subclass C depends on task block subclass B.

[0036] Step 103: Determine an asynchronous subtask based on the multiple initial business subtasks.

[0037] In this embodiment, multiple initial business subtasks are divided into main threads and asynchronous threads according to the execution thread dimension, and corresponding thread attributes are configured. The initial business subtasks belonging to the asynchronous subtasks and the initial business subtasks belonging to the serial subtasks are determined through the thread attributes. Among them, the thread attribute refers to the thread to which the initial business subtask belongs and

[0038] This optional implementation provides a method for splitting asynchronous subtasks, which encapsulates and abstracts all business logic, splits it into multiple task blocks, and reduces coupling. It adds a thread pool, and asynchronously and concurrently executes and initializes some task blocks in the sub-threads in the thread pool, making full use of the multi-core CPU characteristics of the device, improving execution efficiency, and reducing the overall duration.

[0039] The task allocation method provided by the embodiment of the present disclosure first obtains the initial target task of the target application in response to receiving the target operation of the target application; secondly, the initial target task is split into subtasks to obtain multiple initial business subtasks; finally, based on the multiple initial business subtasks, an asynchronous subtask is determined. Thus, a method for splitting asynchronous subtasks is provided, which facilitates asynchronous processing of asynchronous subtask execution threads in the task thread pool, thereby reducing the execution time of the target application.

[0040] The above-mentioned task configuration method also includes: receiving configuration information sent by the server, creating a task thread pool based on the configuration information, and using the task thread pool to perform thread asynchronous processing on the asynchronous subtask.

[0041] The task allocation method further includes: receiving adjusted configuration information sent by the server, creating a new task thread pool based on the adjusted configuration information, and using the new task thread pool to perform thread asynchronous processing on the asynchronous subtask.

[0042] In some embodiments of the present disclosure, the above-mentioned task allocation method also includes: in response to receiving upgrade information of the target application, obtaining an upgrade target task of the target application; splitting the upgrade target task into subtasks to obtain multiple upgrade business subtasks; based on the upgrade business subtasks, determining new asynchronous subtasks, and replacing the asynchronous subtasks with the new asynchronous subtasks.

[0043] The task allocation method provided by this optional implementation method obtains the upgrade target task of the target application after receiving the upgrade information of the target application; splits the upgrade target task into subtasks to obtain multiple upgrade business subtasks; based on the upgrade business subtasks, determines a new asynchronous subtask, and replaces the asynchronous subtask with the new asynchronous subtask. Therefore, after the target application is upgraded, the upgrade business subtask of the target application can be obtained at any time, and a new asynchronous subtask can be generated, which provides reliable implementation conditions for updating the asynchronous subtasks at any time and improves the reliability of obtaining the asynchronous subtasks.

[0044] In some embodiments of the present disclosure, the above-mentioned determining of asynchronous subtasks based on multiple initial business subtasks includes: determining the thread attributes of each initial business subtask based on the business codes of the multiple initial business subtasks; and screening out asynchronous subtasks from the multiple initial business subtasks based on the thread attributes.

[0045] In this optional implementation, the business code of the initial business subtask carries parameters that indicate whether the task can be executed synchronously or asynchronously. The business code is split into multiple task block subclasses, and each of the split task block subclasses is divided into main thread and asynchronous thread according to the execution thread dimension. The thread properties of the asynchronous task block (the thread in the thread pool, the execution priority) are configured, and the task block subclass belonging to the asynchronous thread is treated as an asynchronous subtask, and the thread properties of the task block subclass are used as the properties of the asynchronous subtask.

[0046] like Figure 3 As shown, for onCreate() in the target application, the onCreate() is divided into multiple initial business subtasks, namely: log initialization, monitoring initialization, advertising initialization, payment initialization, etc., and thread attributes are added to each of the multiple initial business subtasks; according to the thread attributes of each initial business subtask, asynchronous subtasks and serial subtasks are determined. Figure 3 In the example, according to the thread attributes, the initial business subtask is divided into multiple serial subtasks belonging to the main thread ( Figure 3 There are n serial subtasks, serial subtask 1...serial subtask n, n>1,), and multiple asynchronous subtasks belonging to the task thread pool ( Figure 3 There are m asynchronous subtasks, asynchronous subtask 1…asynchronous subtask m, m>1).

[0047] The method for determining asynchronous subtasks provided by this optional implementation method determines the thread attributes of each initial business subtask based on the business codes of multiple initial business subtasks; based on the thread attributes, the asynchronous subtasks among the multiple initial business subtasks are screened out, and the asynchronous subtasks are determined by assigning thread attributes to each initial business subtask, thereby improving the reliability and accuracy of obtaining asynchronous subtasks.

[0048] In some optional implementations of the present disclosure, the above-mentioned task allocation method further includes: obtaining thread requirement information of the asynchronous subtask based on the code of the initial target task; and creating a task thread pool based on the thread requirement information.

[0049] In this optional implementation, the initial target task refers to the target task when the target application is run for the first time, for example, the startup task when the target application is started.

[0050] In this optional implementation, the subclass of the initial target task is determined by decoupling the code of the initial target task; the subclass of the initial target task is split into two tasks, a serial subtask and an asynchronous subtask; and based on the code of the asynchronous subtask, the thread requirement information of the asynchronous subtask is determined.

[0051] In this optional implementation, a task thread pool having threads required by the thread requirement information of the asynchronous subtasks is constructed; based on the number of asynchronous subtasks executed in the threads required by the thread requirement information of the asynchronous subtasks, each thread of the task thread pool is set to a maximum capacity equal to the number of asynchronous subtasks, to obtain the final task thread pool.

[0052] The method for creating a task thread pool provided by this optional implementation method obtains the thread requirement information of the asynchronous subtask based on the code of the initial target task; based on the thread requirement information, a task thread pool is created, which provides a reliable implementation method for obtaining the task thread pool and improves the reliability of obtaining the task thread pool.

[0053] In some optional implementations of the present disclosure, the above-mentioned thread requirement information includes: the number of asynchronous threads and the asynchronous thread load; based on the thread requirement information, creating a task thread pool includes: determining the maximum number of threads based on the number of asynchronous threads; determining the task load based on the asynchronous thread load; determining the number of core threads based on device information; creating a task thread pool based on the maximum number of threads, the number of core threads and the task load.

[0054] In this optional implementation, a thread pool is a pool of threads that allows reuse of threads to reduce the overhead of thread creation and destruction. A thread pool is usually composed of the following core components:

[0055] Task Queue: It is used to store tasks to be executed. The threads in the thread pool will take tasks from the task queue and execute them.

[0056] Core Pool Size: The minimum number of threads that are always kept in the thread pool, even if they are idle.

[0057] Maximum Pool Size: The maximum number of threads allowed in the thread pool. When the task queue is full and the core threads are executing tasks, the thread pool will create new threads until the maximum number of threads is reached.

[0058] Thread Keep-Alive Time: When threads in the thread pool are idle for a period of time, they will be recycled to reduce resource usage.

[0059] Task Rejection Policy: When the task queue is full and the thread pool has reached the maximum number of threads, new tasks will be rejected. The task rejection policy defines how to handle these rejected tasks.

[0060] The above core components are conventional components of the thread pool. The task thread pool of the present disclosure only needs to determine the maximum number of threads and the number of core threads, and the specific values ​​of components other than the maximum number of threads and the number of core threads can be set according to requirements.

[0061] In this optional implementation, the number of asynchronous threads refers to the number of threads that need to be accommodated in the task thread pool. Setting the maximum number of threads to be greater than or equal to the number of asynchronous threads can maximize the number of asynchronous threads that the task thread pool can meet.

[0062] In this optional implementation, the device information is the hardware or software information reflecting the device where the asynchronous subtask is located. The number of core threads that the device where the asynchronous subtask is located can be determined through the device information.

[0063] In this optional implementation, the asynchronous thread load is the number of asynchronous subtasks that the threads in the task thread pool can accommodate. Only when the task load of the task thread pool is less than or equal to the asynchronous thread load, the constructed task thread pool is a qualified task thread pool.

[0064] The method for creating a task thread pool provided by this optional implementation method determines the maximum number of threads based on the number of asynchronous threads; determines the task load based on the asynchronous thread load; determines the number of core threads based on device information; and creates a task thread pool based on the maximum number of threads, the number of core threads, and the task load, providing a reliable implementation method for obtaining a task thread pool and improving the reliability of obtaining a task thread pool.

[0065] Figure 4 A process 400 according to an embodiment of a task allocation method disclosed in the present invention is shown. The task allocation method includes the following steps:

[0066] Step 401, collect the configuration information of the task thread pool and the last asynchronous task execution result of the asynchronous subtask running in the task thread pool.

[0067] In this embodiment, the asynchronous subtask is obtained by using the task allocation method of the above embodiment.

[0068] In this embodiment, an asynchronous subtask is at least one subtask in an initial target task or an upgrade target task that can be processed asynchronously. The initial target task is a task that needs to be implemented by the target application in the initial version, and the upgrade target task is a task that needs to be implemented by the target application after the version is upgraded, such as the task of generating a window of the target application, which is the initial code before the target application is upgraded and the upgrade code after the target application is upgraded.

[0069] In this embodiment, the task thread pool is a thread pool created in advance for asynchronous subtasks. There are multiple asynchronous threads in the task thread pool. Each asynchronous thread executes one or more asynchronous subtasks, and the execution of several asynchronous subtasks by each asynchronous thread is managed by the thread pool manager of the task thread pool.

[0070] In this embodiment, the configuration information of the task thread pool is information related to the task thread pool, and the configuration information of the task thread pool includes: thread pool size, thread pool load information, wherein the thread pool load information includes: total thread execution time, and the size of the asynchronous subtask executed.

[0071] In this embodiment, the asynchronous task execution result is the result of the asynchronous subtask running in the thread of the task thread pool, and the asynchronous task execution result of the asynchronous subtask is obtained each time the target application is run. After the target application is upgraded, the asynchronous task execution result is the running result of the asynchronous subtask obtained each time the upgraded target application is run.

[0072] In this embodiment, each asynchronous task execution result includes: the execution time of the asynchronous subtask, the waiting time, the task priority, and the thread in which it is located. The last asynchronous task execution result of the asynchronous subtask refers to the asynchronous task execution result of the last asynchronous subtask before running the target application, that is, the asynchronous task execution result of the last asynchronous subtask before running the asynchronous subtask. Figure 5 As shown, it is a structural diagram of the last asynchronous task execution result in this disclosure. Figure 5 In the task thread pool, there are N (N>1) asynchronous subtasks, namely asynchronous subtask 1... asynchronous subtask N. The task thread pool performs concurrent processing of multiple tasks, but there is still an unreasonable execution sequence of asynchronous subtasks in the thread pool ( Figure 5 Thread 1 has three asynchronous subtasks, and the thread load is large), which causes a thread in the thread pool to be overloaded and take too long to execute, which in turn drags down the overall duration. This is the long board effect of the wooden barrel.

[0073] In this embodiment, the execution entity on which the task allocation method runs can be the server, and the task thread pool and the asynchronous subtasks running in the task thread pool are all arranged on the client. The client records the asynchronous execution results of each asynchronous subtask. The server can communicate with the client and obtain the asynchronous task execution results of each asynchronous subtask from the client.

[0074] Step 402: Determine the thread attribute of the asynchronous subtask based on the configuration information, the asynchronous task execution result, and the device information of the device where the asynchronous subtask is located.

[0075] In this embodiment, the thread attribute is configured for the asynchronous subtask, identifies the thread where the asynchronous subtask is located in the task thread pool or the adjusted task thread pool, and the priority of the asynchronous subtask in the thread. The thread attributes of different asynchronous subtasks are different. Specifically, the thread attributes of this time can change with the change of the execution result of the previous asynchronous task.

[0076] In this embodiment, the device information of the device is the information of the device where the target application is located, and the device information includes: the number of cores of the central processing unit of the device, the peak memory size of the device, and the memory usage size in the device startup scenario.

[0077] In this embodiment, the above step 402 includes: determining the number of asynchronous subtasks that can be run simultaneously on the device based on the device information of the device where the asynchronous subtask is located and the last asynchronous task execution result; and determining the thread attributes of the asynchronous subtask this time based on the number and configuration information.

[0078] Step 403: Adjust the configuration information based on the thread attribute to obtain the adjusted configuration information.

[0079] In this embodiment, the thread attributes include: the thread where the asynchronous subtask is located and the priority of the thread; the above step 403 includes: detecting whether the thread where the asynchronous subtask is located in the thread attributes is the same as the configuration thread of the asynchronous subtask in the configuration information; if the thread where the asynchronous subtask is located in the thread attributes is different from the configuration thread of the asynchronous subtask in the configuration information, setting the configuration thread of the asynchronous subtask in the configuration information to the thread where the asynchronous subtask is located in the thread attributes.

[0080] Optionally, the above step 403 also includes: if the thread where the asynchronous subtask in the thread attributes is located is the same as the configuration thread of the asynchronous subtask in the configuration information, detecting whether the priority of the asynchronous subtask in the thread is the same as the priority of the asynchronous subtask in the configuration information; if not, adjusting the priority of the asynchronous subtask in the thread in the configuration information to the priority of the asynchronous subtask in the thread in the thread attributes, and obtaining the adjusted configuration information.

[0081] In this embodiment, the load of the thread pool is balanced by adjusting the configuration information; by adjusting the configuration information, each asynchronous subtask can dynamically adjust its execution sequence (priority) and the thread in which it is located, such as Figure 5 The asynchronous subtask 2 in thread 1 is adjusted to thread 4. By adjusting the configuration information, you can also increase the adjustment of asynchronous tasks and asynchronous threads. Figure 6 It is a timing diagram of the execution of relevant optimization measures combined with the startup process. Figure 6 Threads in the task thread pool (such as Figure 6 Thread 1 ... Thread 4) have their own load configuration, and the load configuration is limited to each thread.

[0082] Step 404: Send the adjusted configuration information and thread attributes to the device, so that the device uses the task thread pool of the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask.

[0083] In this embodiment, the device can be a client that communicates with the execution entity on which the task allocation method runs. The client can build a task thread pool, and when the execution entity sends the adjusted configuration information once, the client builds a task thread pool once. The task thread pool built each time can be different based on the adjusted configuration information.

[0084] In this embodiment, the above step 404 includes: sending the adjusted configuration information and thread attributes to the device, so that the device determines the size of the task thread pool after the adjusted configuration information based on the adjusted configuration information; based on the adjusted configuration information, determining the thread of the asynchronous subtask in the task thread pool after the adjusted configuration information, and the priority of the thread; and using the thread in the task thread pool after the adjusted configuration information to execute the asynchronous subtask.

[0085] In this embodiment, the execution subject on which the task allocation method runs can be a server, which receives data reported by the client, and uses the ability of the big model to continuously learn, optimize, and update configuration information, and then sends the adjusted configuration information to different devices.

[0086] In this embodiment, the server controls the client to use the task thread pool with adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask.

[0087] In this embodiment, the client determines the size of the device asynchronous thread pool based on the adjusted configuration information sent by the server, adjusts and determines the execution thread and priority of each task. After the startup task is completed, the execution results, configuration information, setting information and other data of the running asynchronous task are uniformly reported to the server, thereby achieving Figure 7 The data flywheel shown is based on the last asynchronous task execution result reported by the client (such as Figure 7 The asynchronous task execution result report in the asynchronous task execution result report) determines the thread attributes and adjusts the configuration information; the adjusted configuration information is sent to the client to use the newly configured task thread pool to execute the asynchronous subtask and obtain the asynchronous task execution result of this time, so that the client will report the asynchronous task execution result of this time to the server.

[0088] The task allocation method provided by the embodiments of the present invention combines the multi-core characteristics of the device's central processing unit with concurrent initialization to improve efficiency and reduce startup time; the traditional main thread serial initialization is optimized to split the startup logic into multiple tasks, and the main thread and task thread pool are initialized in parallel for multiple tasks, making full use of the characteristics of the multi-core central processing unit, improving efficiency, reducing user waiting time, and improving the product's usage experience.

[0089] The task allocation method provided by the embodiment of the present disclosure first collects the configuration information of the task thread pool and the last asynchronous task execution result of the asynchronous subtask running in the task thread pool; secondly, based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located, the thread attribute of the asynchronous subtask is determined; then, based on the thread attribute, the configuration information is adjusted to obtain the adjusted configuration information; finally, the adjusted configuration information and thread attribute are sent to the device, so that the device uses the task thread pool with the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask. Thus, by adjusting the attributes of the thread and thread pool of the configuration information, device information and historical asynchronous subtasks, and performing thread asynchronous processing after the adjustment, the asynchronous subtasks in the thread pool can be reasonably sorted each time the asynchronous subtask is executed, the load of the threads in the thread pool is balanced, the task execution time is reduced, and the task processing performance is improved.

[0090] In some embodiments of the present disclosure, the above-mentioned task allocation method also includes: collecting the last main task execution result of the serial subtask running in the main thread; determining the sorting attributes of the serial subtask this time based on the configuration information, the main task execution result and the device information; and sending the sorting attributes to the device so that the device uses the main thread to perform serial processing on the serial subtask.

[0091] In this embodiment, the serial subtask is at least one subtask in the initial target task or the upgraded target task that needs to be processed serially in sequence, and the serial subtask is a subtask in the initial target task or the upgraded target task except the asynchronous subtask.

[0092] In this embodiment, the main task execution result is the running result of the serial subtask in the thread of the task thread pool, and the main task execution result of the serial subtask is obtained each time the target application is run. After the target application is upgraded, the main task execution result is the running result of the serial subtask obtained each time the upgraded target application is run.

[0093] In this embodiment, the sorting attribute refers to the sorting order of the serial subtasks in the main thread. By optimizing the sorting attribute, the execution order of the serial subtasks in the main thread can be guaranteed to be optimal.

[0094] In this embodiment, the above-mentioned determination of the sorting attributes of the serial subtask this time based on the configuration information, the execution result of the main task and the device information includes: determining all sorting orders of the serial subtasks in the main thread based on the device information of the device where the serial subtask is located and the execution result of the last serial subtask; calculating the time corresponding to each sorting order in all sorting orders; and selecting the sorting order with the shortest time as the sorting attribute this time.

[0095] The task allocation method provided in this embodiment collects the last main task execution result of the serial subtask running in the main thread; determines the sorting attribute of the serial subtask this time based on the configuration information, the main task execution result and the device information; sends the sorting attribute to the device so that the device uses the main thread to perform serial processing on the serial subtask, thereby improving the running efficiency of the task running in the main thread of the target application.

[0096] In some optional implementations of the present disclosure, determining the sorting attributes of the serial subtasks this time based on the configuration information, the main task execution results and the device information includes: inputting the configuration information, the main task execution results and the device information into the large language model, and obtaining the sorting attributes of the serial subtasks this time output by the large language model.

[0097] In this optional implementation, a large language model (LLM) refers to a deep learning model trained with a large amount of text data that can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question answering, and dialogue, and are an important path to artificial intelligence.

[0098] The method for determining the sorting attributes provided by this optional implementation inputs the configuration information, the main task execution results and the device information into the large language model to obtain the sorting attributes of the serial subtasks output by the large language model. With the help of the capabilities of the large language model, the accuracy of the sorting attributes of the serial subtasks is improved.

[0099] In some optional implementations of the present disclosure, the above-mentioned sending sorting attributes to the device so that the device adopts the main thread to perform serial processing on the serial subtasks includes: sending a main thread identifier to the device so that the device determines the main thread where the serial subtask is located; sending the sorting attributes to the device so that the device determines the first priority of the serial subtask in the main thread based on the sorting attributes, and adopts the main thread to process the serial subtask according to the first priority.

[0100] In this optional implementation, the main thread identifier is a unique identifier for identifying the main thread.

[0101] This optional implementation provides a method for using a main thread to perform serial processing on serial subtasks, sending a main thread identifier to a device so that the device can determine the main thread where the serial subtask is located; sending a sorting attribute to the device so that the device can determine the first priority of the serial subtask in the main thread based on the sorting attribute, and using the main thread to process the serial subtask according to the first priority, thereby improving the reliability of the execution of the serial subtasks.

[0102] In some optional implementations of the present disclosure, determining the thread attributes of the asynchronous subtask based on the configuration information, the asynchronous task execution result, and the device information of the device where the asynchronous subtask is located includes: inputting the configuration information, the asynchronous task execution result, and the device information of the device where the asynchronous subtask is located into a large language model, and obtaining the thread attributes of the asynchronous subtask output by the large language model.

[0103] The method for determining thread attributes provided by this optional implementation inputs configuration information, asynchronous task execution results, and device information of the device where the asynchronous subtask is located into a large language model, and obtains the thread attributes of the asynchronous subtask output by the large language model. With the help of the capabilities of the large language model, the accuracy of obtaining the thread attributes is improved.

[0104] In some optional implementations of the present disclosure, the above-mentioned configuration information is adjusted based on thread attributes to obtain the adjusted configuration information, including: determining the number of asynchronous threads based on the asynchronous thread identifier in the thread attributes; detecting whether the number of asynchronous threads is greater than the maximum number of threads in the configuration information; in response to detecting that the number of asynchronous threads is greater than the maximum number of threads, modifying the maximum number of threads in the configuration information to the number of asynchronous threads, to obtain the adjusted configuration information.

[0105] In this optional implementation, the asynchronous thread identifier is an identifier that uniquely identifies a thread. The number of identifiers is calculated to determine the number of asynchronous threads. The number of asynchronous threads can be determined by the number of asynchronous thread identifiers.

[0106] In this optional implementation, when the number of asynchronous threads is greater than the maximum number of threads in the configuration information, it is determined that the maximum number of threads in the current configuration information cannot meet the requirements, and the maximum number of threads in the configuration information needs to be adjusted.

[0107] The method for adjusting configuration information provided by this optional implementation method determines the number of asynchronous threads based on the asynchronous thread identifier in the thread attributes; detects whether the number of asynchronous threads is greater than the maximum number of threads in the configuration information; in response to detecting that the number of asynchronous threads is greater than the maximum number of threads, modifies the maximum number of threads in the configuration information to the number of asynchronous threads, thereby providing a reliable implementation method for adjusting the maximum number of threads in the configuration information and improving the reliability of the adjustment of the maximum number of threads.

[0108] Optionally, in response to the number of asynchronous threads being less than the maximum number of threads, the number of subtasks is determined based on the identifier of the asynchronous subtask in the thread attributes; the number of subtasks is divided by the asynchronous thread identifier to obtain an average value of the subtasks in each thread determined by the asynchronous subtasks; and the average value is detected to see whether it is greater than the task load in the configuration information; in response to detecting that the average value is greater than the task load in the configuration information, the task load in the configuration information is modified to the average value.

[0109] In some optional implementations of the present disclosure, the above-mentioned sending the adjusted configuration information and thread attributes to the device so that the device adopts the task thread pool of the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask includes: sending the adjusted configuration information to the device so that the device creates the task thread of the adjusted configuration information; sending the thread attributes to the device so that the device determines the asynchronous thread of the asynchronous subtask in the task thread pool of the adjusted configuration information and the second priority of the asynchronous subtask in the asynchronous thread, and adopts the asynchronous thread in the task thread pool of the adjusted configuration information to process the asynchronous subtask according to the second priority.

[0110] The method for executing thread asynchronous processing provided by this optional implementation sends the adjusted configuration information to the device so that the device creates a task thread for the adjusted configuration information;

[0111] Thread attributes are sent to the device so that the device can determine the asynchronous thread of the asynchronous subtask in the task thread pool of the adjusted configuration information and the second priority of the asynchronous subtask in the asynchronous thread, and use the asynchronous thread in the task thread pool of the adjusted configuration information to process the asynchronous subtask according to the second priority, thereby improving the thread asynchronous processing effect.

[0112] Further references Figure 8 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a task allocation device, which is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically used in various electronic devices.

[0113] like Figure 8 As shown, the task allocation device 800 provided in this embodiment includes: an acquisition unit 801, a splitting unit 802, and a task determination unit 803. The acquisition unit 801 can be configured to acquire the initial target task of the target application in response to receiving a target operation on the target application. The splitting unit 802 can be configured to split the initial target task into subtasks to obtain multiple initial business subtasks. The task determination unit 803 can be configured to determine an asynchronous subtask based on multiple initial business subtasks.

[0114] In this embodiment, in the task allocation device 800, the specific processing of the acquisition unit 801, the splitting unit 802, and the task determination unit 803 and the technical effects thereof can be referred to in Figure 1 The relevant descriptions of step 101, step 102, and step 103 in the corresponding embodiment are not repeated here.

[0115] In some embodiments of the present disclosure, the above-mentioned device 900 also includes: an upgrade unit (not shown in the figure), and the above-mentioned upgrade unit is configured to: in response to receiving upgrade information of the target application, obtain an upgrade target task of the target application; split the upgrade target task into subtasks to obtain multiple upgrade business subtasks; based on the upgrade business subtasks, determine a new asynchronous subtask, and use the new asynchronous subtask to replace the asynchronous subtask.

[0116] In some optional implementations of this embodiment, the task determination unit 803 is configured to: determine the thread attributes of each initial business subtask based on the business codes of the multiple initial business subtasks; and filter out asynchronous subtasks from the multiple initial business subtasks based on the thread attributes.

[0117] In some embodiments of the present disclosure, the above-mentioned device 900 also includes: a pool creation unit (not shown in the figure), and the above-mentioned pool creation unit is configured to: obtain thread requirement information of asynchronous subtasks based on the code of the initial target task; and create a task thread pool based on the thread requirement information.

[0118] In some embodiments of the present disclosure, thread requirement information includes: the number of asynchronous threads and the asynchronous thread load; the pool creation unit is configured to: determine the maximum number of threads based on the number of asynchronous threads; determine the task load based on the asynchronous thread load; determine the number of core threads based on device information; and create a task thread pool based on the maximum number of threads, the number of core threads and the task load.

[0119] Further references Fig. 9 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a task allocation device, which is similar to Figure 4 Corresponding to the method embodiment shown, the device can be specifically used in various electronic devices.

[0120] like Fig. 9As shown, the task allocation device 900 provided in this embodiment includes: a collection unit 901, a property determination unit 902, an adjustment unit 903, and an asynchronous execution unit 904. Among them, the above-mentioned collection unit 901 can be configured to collect the configuration information of the task thread pool and the last asynchronous task execution result of the asynchronous subtask running in the task thread pool; the asynchronous subtask is obtained using the task allocation method in the above-mentioned embodiment. The above-mentioned property determination unit 902 can be configured to determine the thread attribute of the asynchronous subtask this time based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located. The above-mentioned adjustment unit 903 can be configured to adjust the configuration information based on the thread attribute to obtain the adjusted configuration information. The above-mentioned asynchronous execution unit 904 can be configured to send the adjusted configuration information and thread attributes to the device, so that the device uses the task thread pool with the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask.

[0121] In this embodiment, in the task allocation device 900, the specific processing of the collection unit 901, the attribute determination unit 902, the adjustment unit 903, and the asynchronous execution unit 904 and the technical effects thereof can be referred to in Figure 4 The relevant descriptions of step 401, step 402, step 403, and step 404 in the corresponding embodiment are not repeated here.

[0122] In some embodiments of the present disclosure, the above-mentioned device 900 also includes: a serial execution unit (not shown in the figure), and the above-mentioned serial execution unit is configured to: collect the last main task execution result of the serial subtask running in the main thread; determine the sorting attributes of the serial subtask this time based on the configuration information, the main task execution result and the device information; send the sorting attributes to the device so that the device uses the main thread to perform serial processing on the serial subtask.

[0123] In some optional implementations of this embodiment, the serial execution unit is configured to: input configuration information, main task execution results and device information into the large language model to obtain the sorting attributes of the serial subtasks output by the large language model.

[0124] In some optional implementations of this embodiment, the above-mentioned serial execution unit is configured to: send a main thread identifier to the device so that the device determines the main thread where the serial subtask is located; send a sorting attribute to the device so that the device determines the first priority of the serial subtask in the main thread based on the sorting attribute, and use the main thread to process the serial subtask according to the first priority.

[0125] In some optional implementations of this embodiment, the above-mentioned attribute determination unit 902 is configured to: input the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located into the large language model, and obtain the thread attributes of the asynchronous subtask output by the large language model.

[0126] In some optional implementations of this embodiment, the above-mentioned adjustment unit 903 is configured to: determine the number of asynchronous threads based on the asynchronous thread identifier in the thread attributes; detect whether the number of asynchronous threads is greater than the maximum number of threads in the configuration information; in response to detecting that the number of asynchronous threads is greater than the maximum number of threads, modify the maximum number of threads in the configuration information to the number of asynchronous threads, and obtain the adjusted configuration information.

[0127] In some optional implementations of this embodiment, the above-mentioned asynchronous execution unit 904 is configured to: send the adjusted configuration information to the device so that the device creates the task thread of the adjusted configuration information; send the thread attribute to the device so that the device determines the asynchronous thread of the asynchronous subtask in the task thread pool of the adjusted configuration information and the second priority of the asynchronous subtask in the asynchronous thread, and use the asynchronous thread in the task thread pool of the adjusted configuration information to process the asynchronous subtask according to the second priority. The task allocation device provided by the embodiment of the present disclosure, first, the collection unit 901 collects the configuration information of the task thread pool and the last asynchronous task execution result of the asynchronous subtask running in the task thread pool; secondly, the determination unit 902 determines the thread attribute of the asynchronous subtask this time based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located; then, the adjustment unit 903 adjusts the configuration information based on the thread attribute; finally, the asynchronous execution unit 904 uses the task thread pool after adjusting the configuration information to asynchronously process the asynchronous subtask execution thread. Therefore, by adjusting the properties of threads and thread pools based on configuration information, device information, and historical asynchronous subtasks, and performing thread asynchronous processing after the adjustment, the asynchronous subtasks in the thread pool can be reasonably sorted each time the asynchronous subtasks are executed, thereby balancing the load of threads in the thread pool, reducing task execution time, and improving task processing performance.

[0128] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0129] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0130] Fig.10A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0131] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1001003 are connected to each other via a bus 1001004. An input / output (I / O) interface 1001005 is also connected to the bus 1004.

[0132] A number of components in the device 1000 are connected to the I / O interface 1001005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0133] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as the task allocation method method. For example, in some embodiments, the task allocation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the task allocation method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the task allocation method in any other appropriate manner (e.g., by means of firmware).

[0134] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

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

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

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

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

[0139] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0141] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A task allocation method, the method comprising: In response to receiving a target operation on a target application, obtaining an initial target task of the target application; Splitting the initial target task into subtasks to obtain a plurality of initial business subtasks; Based on the multiple initial business subtasks, an asynchronous subtask is determined.

2. The method according to claim 1, wherein: The method further comprises: In response to receiving the upgrade information of the target application, acquiring the upgrade target task of the target application; Splitting the upgrade target task into subtasks to obtain multiple upgrade business subtasks; Based on the upgraded service subtask, a new asynchronous subtask is determined, and the new asynchronous subtask is used to replace the asynchronous subtask.

3. The method according to claim 1, wherein: The determining of the asynchronous subtask based on the multiple initial business subtasks includes: Determine the thread attribute of each initial business subtask based on the business codes of the multiple initial business subtasks; Based on the thread attribute, asynchronous subtasks from among the multiple initial business subtasks are screened out.

4. The method according to any one of claims 1 to 3, further comprising: Based on the code of the initial target task, obtaining thread requirement information of the asynchronous subtask; Based on the thread requirement information, a task thread pool is created.

5. The method according to claim 4, wherein: The thread requirement information includes: the number of asynchronous threads and the asynchronous thread load; creating a task thread pool based on the thread requirement information includes: determining the maximum number of threads based on the number of asynchronous threads; determining the task load based on the asynchronous thread load; determining the number of core threads based on the device information; and creating a task thread pool based on the maximum number of threads, the number of core threads and the task load.

6. A task allocation method, the method comprising: Collect configuration information of the task thread pool and the last asynchronous task execution result of the asynchronous subtask running in the task thread pool; The asynchronous subtask is obtained by using the task allocation method described in any one of claims 1 to 5; Determine the thread attribute of the asynchronous subtask based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located; Based on the thread attribute, adjusting the configuration information to obtain adjusted configuration information; The adjusted configuration information and the thread attribute are sent to the device, so that the device uses the task thread pool of the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask.

7. The method according to claim 6, further comprising: Collect the last main task execution results of the serial subtasks running in the main thread; Determine the sorting attributes of the serial subtasks based on the configuration information, the execution result of the main task and the device information; The sequencing attribute is sent to the device, so that the device uses the main thread to perform serial processing on the serial subtasks.

8. The method according to claim 6, wherein: The determining the sorting attribute of the serial subtask this time based on the configuration information, the main task execution result and the device information includes: The configuration information, the main task execution result and the device information are input into a large language model to obtain the sorting attributes of the serial subtasks output by the large language model.

9. The method according to claim 6, wherein: The sending the sorting attribute to the device so that the device uses the main thread to perform serial processing on the serial subtasks includes: Sending the main thread identifier to the device so that the device determines the main thread where the serial subtask is located; The sorting attribute is sent to the device, so that the device determines a first priority of the serial subtask in the main thread based on the sorting attribute, and uses the main thread to process the serial subtask according to the first priority.

10. The method according to any one of claims 6 to 9, wherein: The determining of the thread attribute of the asynchronous subtask based on the configuration information, the asynchronous task execution result, and the device information of the device where the asynchronous subtask is located includes: The configuration information, the asynchronous task execution result, and the device information of the device where the asynchronous subtask is located are input into a large language model to obtain the thread attribute of the asynchronous subtask output by the large language model.

11. The method according to any one of claims 6 to 9, wherein: The adjusting the configuration information based on the thread attribute to obtain the adjusted configuration information includes: Based on the asynchronous thread identifier in the thread attributes, determine the number of asynchronous threads; Detect whether the number of asynchronous threads is greater than the maximum number of threads in the configuration information; In response to detecting that the number of asynchronous threads is greater than the maximum number of threads, the maximum number of threads in the configuration information is modified to the number of asynchronous threads to obtain adjusted configuration information.

12. The method according to any one of claims 6 to 9, wherein: The sending the adjusted configuration information and the thread attribute to the device so that the device uses the task thread pool of the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask includes: Sending the adjusted configuration information to the device so that the device creates a task thread for the adjusted configuration information; The thread attribute is sent to the device so that the device determines the asynchronous thread of the asynchronous subtask in the task thread pool of the adjusted configuration information and the second priority of the asynchronous subtask in the asynchronous thread, and uses the asynchronous thread in the task thread pool of the adjusted configuration information to process the asynchronous subtask according to the second priority.

13. A task allocation device, comprising: an acquisition unit, configured to acquire an initial target task of the target application in response to receiving a target operation on the target application; A splitting unit is configured to split the initial target task into subtasks to obtain a plurality of initial business subtasks; The task determination unit is configured to determine an asynchronous subtask based on the multiple initial business subtasks.

14. The apparatus according to claim 13, further comprising: An upgrading unit is configured to: in response to receiving the upgrading information of the target application, acquire an upgrading target task of the target application; Splitting the upgrade target task into subtasks to obtain multiple upgrade business subtasks; Based on the upgraded service subtask, a new asynchronous subtask is determined, and the new asynchronous subtask is used to replace the asynchronous subtask.

15. According to the device of claim 13, the task determination unit is configured to: determine the thread attributes of each initial business subtask based on the business codes of multiple initial business subtasks; and screen out asynchronous subtasks from the multiple initial business subtasks based on the thread attributes.

16. The device according to any one of claims 13 to 15, further comprising: A pool creation unit, wherein the pool creation unit is configured to: obtain thread requirement information of the asynchronous subtask based on the code of the initial target task; Based on the thread requirement information, a task thread pool is created.

17. The device according to claim 16, wherein: The thread requirement information includes: the number of asynchronous threads and the asynchronous thread load; the pool creation unit is configured to: determine the maximum number of threads based on the number of asynchronous threads; determine the task load based on the asynchronous thread load; determine the number of core threads based on the device information; and create a task thread pool based on the maximum number of threads, the number of core threads and the task load.

18. A task allocation device, comprising: A collection unit is configured to collect configuration information of a task thread pool and a last asynchronous task execution result of an asynchronous subtask running in the task thread pool; The asynchronous subtask is obtained by using the task allocation method described in any one of claims 13 to 17; An attribute determination unit is configured to determine the thread attribute of the asynchronous subtask based on the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located; an adjusting unit, configured to adjust the configuration information based on the thread attribute to obtain adjusted configuration information; The asynchronous execution unit is configured to send the adjusted configuration information and the thread attribute to the device, so that the device adopts the task thread pool of the adjusted configuration information to perform thread asynchronous processing on the asynchronous subtask.

19. The apparatus according to claim 18, further comprising: A serial execution unit, wherein the serial execution unit is configured to: collect the last main task execution result of the serial subtask running in the main thread; Based on the configuration information, the main task execution result and the device information, the sorting attribute of the serial subtask is determined this time; and the sorting attribute is sent to the device so that the device uses the main thread to perform serial processing on the serial subtask.

20. The device according to claim 19, wherein The serial execution unit is configured to: input the configuration information, the main task execution result and the device information into a large language model, and obtain the current sorting attribute of the serial subtask output by the large language model.

21. The device according to claim 19, wherein The serial execution unit is configured to: send the main thread identifier to the device, so that the device determines the main thread where the serial subtask is located; The sorting attribute is sent to the device, so that the device determines a first priority of the serial subtask in the main thread based on the sorting attribute, and uses the main thread to process the serial subtask according to the first priority.

22. The device according to any one of claims 18 to 21, wherein: The attribute determination unit is configured to: input the configuration information, the asynchronous task execution result and the device information of the device where the asynchronous subtask is located into a large language model, and obtain the thread attribute of the asynchronous subtask output by the large language model.

23. The device according to any one of claims 18 to 21, wherein: The adjustment unit is configured to: determine the number of asynchronous threads based on the asynchronous thread identifier in the thread attributes; detect whether the number of asynchronous threads is greater than the maximum number of threads in the configuration information; in response to detecting that the number of asynchronous threads is greater than the maximum number of threads, modify the maximum number of threads in the configuration information to the number of asynchronous threads, and obtain adjusted configuration information.

24. The device according to any one of claims 18 to 21, wherein: The asynchronous execution unit is configured to: send the adjusted configuration information to the device so that the device creates a task thread of the adjusted configuration information; send the thread attributes to the device so that the device determines the asynchronous thread of the asynchronous subtask in the task thread pool of the adjusted configuration information and the second priority of the asynchronous subtask in the asynchronous thread, and use the asynchronous thread in the task thread pool of the adjusted configuration information to process the asynchronous subtask according to the second priority.

25. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 12.

27. A computer program product, comprising a computer program, which, when executed by a processor, implements the method of any one of claims 1 to 12.