Task processing method and apparatus, electronic device, and storage medium

By intercepting task requests on the client side and executing the computational tasks locally, the problem of remote server processing affecting task efficiency is solved, achieving more efficient and secure computational task processing.

CN119011566BActive Publication Date: 2025-12-09BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411018542.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2025-12-09
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

Remote servers have strong computing power, and when client computing tasks need to be processed remotely, network transmission and server processing capabilities affect task efficiency and security.

Method used

The client intercepts task requests, downloads the code from the remote service center, and executes the computation tasks locally, reducing its dependence on the remote server and enabling localized computation using the service engine.

Benefits of technology

Reduce network latency, lower remote server load, improve data security, and enhance the efficiency of computing tasks and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011566B_ABST
    Figure CN119011566B_ABST
Patent Text Reader

Abstract

The present disclosure provides a task processing method and device, electronic equipment and storage medium, relates to the technical field of computers, in particular to the fields of task processing and cloud computing. The specific implementation scheme is: in the case of preparing to send a first task request to a remote service center, determining whether a first task identifier in the first task request is included in a first task list; in the case that the first task identifier is included in the first task list, intercepting the first task request, and downloading corresponding first code from the remote service center based on a code download address associated with the first task identifier in the first task list; based on the first code, performing a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computers, in particular to the technical field of task processing and cloud computing. The present disclosure specifically relates to a task processing method and device, an electronic device and a storage medium. BACKGROUND

[0002] In some technologies, since the computing capability of a remote server is relatively strong, the computing tasks in each client are generally sent to the remote server for processing. The client interacts with the remote server through an HTTP protocol. Therefore, the data transmission capability of the network and the processing capability of the remote server will have a certain impact on these computing tasks. SUMMARY

[0003] The present disclosure provides a task processing method and device, an electronic device and a storage medium.

[0004] According to an aspect of the present disclosure, a task processing method is provided, applied to a first client, comprising:

[0005] In the case of preparing to send a first task request to a remote service center, determining whether a first task identifier in the first task request is included in a first task list;

[0006] In the case where the first task identifier is included in the first task list, intercepting the first task request, and downloading corresponding first code from the remote service center based on a code download address associated with the first task identifier in the first task list;

[0007] Based on the first code, performing a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.

[0008] According to another aspect of the present disclosure, a task processing method is provided, applied to a remote service center, comprising:

[0009] In response to a task list download request from a first client, sending a first task list to the first client, wherein the first task list is used by the first client to determine whether a first task identifier in a first task request is included in the case of preparing to send the first task request to the remote service center, and the first client is used to intercept the first task request in the case where the first task identifier is included in the first task list, and send a download request to the remote service center based on a code download address associated with the first task identifier in the first task list;

[0010] In response to the download request from the first client, the first code corresponding to the code download address in the download request is acquired.

[0011] The first code is sent to the first client, where the first code is used by the first client to execute a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request

[0012] According to another aspect of the present disclosure, a task processing apparatus applied to a first client is provided, comprising:

[0013] The identification determination module is configured to determine whether the first task identification in the first task request is included in the first task list when the first client is ready to send the first task request to the remote service center.

[0014] The code download module is configured to intercept the first task request when the first task identification is included in the first task list, and download the first code corresponding to the code download address associated with the first task identification in the first task list from the remote service center.

[0015] The task execution module is configured to execute a computing task corresponding to the first task request based on the first code to obtain a computing task result corresponding to the first task request.

[0016] According to another aspect of the present disclosure, a task processing apparatus applied to a remote service center is provided, comprising:

[0017] The first list sending module is configured to send a first task list to a first client in response to a task list download request from the first client, where the first task list is used by the first client to determine whether a first task identification in a first task request is included when the first client is ready to send the first task request to the remote service center, and the first client is configured to intercept the first task request when the first task identification is included in the first task list, and send a download request to the remote service center based on a code download address associated with the first task identification in the first task list.

[0018] The code acquisition module is configured to acquire the first code corresponding to the code download address in the download request based on the code download address in the download request in response to the download request from the first client.

[0019] The code sending module is configured to send the first code to the first client, where the first code is used by the first client to execute a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.

[0020] According to another aspect of the present disclosure, an electronic device is provided, comprising:

[0021] at least one central processor; and

[0022] a memory in communication connection with the at least one central processor; wherein

[0023] the memory stores instructions executable by the at least one central processor, and the instructions are executed by the at least one central processor to enable the at least one central processor to perform any of the task processing methods in the embodiments of the present disclosure.

[0024] According to another aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to perform any of the task processing methods in the embodiments of the present disclosure.

[0025] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements any of the task processing methods in the embodiments of the present disclosure.

[0026] According to the technology of the present disclosure, in the case of preparing to send a first task request to a remote service center, it is determined whether the first task identification in the first task request is included in a first task list; in the case that the first task identification is included in the first task list, the first task request is intercepted, and based on the code download address associated with the first task identification in the first task list, the corresponding first code is downloaded from the remote service center; based on the first code, the computing task corresponding to the first task request is executed to obtain the computing task result corresponding to the first task request. In this way, the remote service can be localized in the client, and the computing task does not have to be processed by the remote service center, which can reduce the load of the remote service center, avoid network delay, and improve data security.

[0027] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0028] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0029] Figure 1 is a flowchart of a task processing method of an embodiment of the present disclosure;

[0030] Figure 2 is a flowchart of a task processing system of an embodiment of the present disclosure;

[0031] Figure 3 is a flowchart of a task processing method according to another embodiment of the present disclosure;

[0032] Figure 4 is a structural block diagram of an application program starting device according to an embodiment of the present disclosure;

[0033] Figure 5 is a structural block diagram of an application program starting device according to another embodiment of the present disclosure;

[0034] Figure 6 is a structural block diagram of an application program starting device according to another embodiment of the present disclosure;

[0035] Figure 7 is a structural block diagram of an application program starting device according to another embodiment of the present disclosure;

[0036] Figure 8 is a block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0037] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are included to provide a thorough understanding of embodiments of the present disclosure by a person of ordinary skill in the art, and should be considered in connection with the following detailed description, but do not limit the scope of the present disclosure. Thus, those skilled in the art will recognize that the embodiments described herein can be practiced with various modifications and alterations, and are not limited to the embodiments described herein. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted herein.

[0038] In order to facilitate understanding of the task processing method provided by the embodiments of the present disclosure, the related technologies of the embodiments of the present disclosure are described as follows, which can be combined with the technical solutions of the embodiments of the present disclosure in any manner as optional solutions, and all of them belong to the protection scope of the embodiments of the present disclosure.

[0039] Figure 1 is a flowchart of a task processing method according to an embodiment of the present disclosure. The method can be applied to an electronic device. The electronic device can be a terminal, a tasker or other processing device, wherein the terminal can be a desktop computer, a mobile device, a PDA (Personal Digital Assistant), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some implementations, the electronic device can realize the task processing method of the embodiments of the present disclosure by calling computer readable instructions stored in the memory through a central processing unit.

[0040] As shown in FIG. 8, the method can be applied to a first client, including the following steps: Figure 1

[0041] ​S110, in a case of preparing to send a first task request to a remote service center, determining whether a first task identification in the first task request is included in a first task list;

[0042] S120, in a case of including the first task identification in the first task list, intercepting the first task request, and downloading corresponding first code from the remote service center based on a code download address associated with the first task identification in the first task list;

[0043] S130, based on the first code, executing a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.

[0044] It can be understood that the first client runs in an electronic device, and the first client can be any application program or browser, etc.

[0045] Exemplarily, the first task request can be a task request received by the first client in a user interface and triggered or output by a user. For example, the first task request can be packaged into an HTTP interface request.

[0046] Exemplarily, the first task request can include a task identification that needs to be executed, such as a service interface API (Application Programming Interface, application programming interface).

[0047] Exemplarily, the first task list is downloaded in advance by the first client from the remote service center. The first task list includes a plurality of task identifications, total digest information generated based on respective codes corresponding to the respective task identifications, and code download addresses corresponding to the respective task identifications. Alternatively, the first task list further includes digest information corresponding to the respective codes. For example, the digest information can be MD5 (Message-Digest Algorithm, digest information algorithm) information.

[0048] It can be understood that intercepting the first task request means not sending the first task request to the remote service center, and keeping the request in the first client.

[0049] It can be understood that the computing tasks corresponding to the task identifications can be localized to the client for execution, and do not have to be executed in the remote service center. The respective codes corresponding to the computing tasks are sent to the corresponding clients by the remote service center.

[0050] Exemplarily, the first task list can further include one or more preloading identifications associated with the task identifications. Based on the code download addresses associated with the task identifications associated with the preloading identifications in the first task list, the first client pre-downloads the corresponding codes and stores them in the first client in a case of obtaining the first task list.

[0051] It can be understood that if the first task identifier corresponding code exists in the first client, and the time length of the update time of the code from the current time exceeds the preset time length, the above-mentioned S120 is executed, and the downloaded first code is compared with the third code corresponding to the first task identifier in the first client. If they are not the same, the downloaded first code is used to perform the above-mentioned step S130, and the third code corresponding to the first task identifier in the first client is replaced.

[0052] Exemplarily, if the third code corresponding to the first task identifier exists in the first client, and the time length of the update time of the code from the current time does not exceed the preset time length, it is not necessary to download the corresponding code, and the third code is taken as the first code, and the above-mentioned step S130 is executed.

[0053] Exemplarily, the first client can be embedded with a service engine for executing the code.

[0054] Exemplarily, in the above-mentioned step S130, the first client calls the service engine, the service engine executes the computing task corresponding to the first task request based on the first code to obtain the computing task result corresponding to the first task request, and returns the computing task result to the first client.

[0055] Exemplarily, the first client can start the service engine in advance, or start the service engine when it is needed to be called or when it is ready to send the first task request, and close the service engine after executing the computing task and returning the computing task result to the first client.

[0056] Exemplarily, according to the computing performance of the first client, the starting mode of the service engine is determined. The starting mode can be the above-mentioned two examples. For example, if the computing performance is lower than a certain threshold or does not meet a certain condition, the first client starts the service engine when it is needed to be called or when it is ready to send the first task request, and closes the service engine after executing the computing task and returning the computing task result to the first client. If the computing performance is higher than a certain threshold or meets all conditions, the first client can start the service engine in advance.

[0057] Exemplarily, the service engine runs the first code and processes the related data involved in the first task request, so as to realize the execution of the computing task corresponding to the first task request, and obtain the computing task result corresponding to the first task request.

[0058] It can be understood that the related data is the context data involved in the execution of the computing task corresponding to the first task request.

[0059] Exemplarily, the function provided by the service engine is integrated in the client, the first code is directly executed by the client, and the related data involved in the first task request is processed, so as to realize the execution of the computing task corresponding to the first task request.

[0060] In an example, when the application is internally ready to initiate the first task request, the request is packaged into an http interface request. The application compares each http interface request to be sent with each computing service api interface listed in the task list. If there is an api interface in the task list that matches the http interface request, the http interface request is intercepted. Then, the code segment corresponding to the computing service api interface corresponding to the http interface request is downloaded from the remote service center at the same time when the service engine is started.

[0061] After the code segment is downloaded, the code segment is compared with the summary information of the corresponding api interface in the task list. In the case where it is determined that the two are matched, the code segment is executed in the service engine.

[0062] The above code segment can also be pre-downloaded. For example, according to the code download address associated with each api interface with a preloading identifier in the task list, the corresponding code segment is downloaded. Thus, the problem of increasing the total task processing time due to the possibility of intercepting code segment download can be reduced.

[0063] In some examples, for the running of the above-mentioned code, it can be resident in the memory corresponding to the first client, or it can be temporarily run in the content corresponding to the first client. Wherein, the code resident in the memory runs, which does not need to be initialized except the first time, and the resources of the computing service are not recycled after the computing service is called. It is suitable for high-frequency and high-priority computing job types. For temporary types, the code of the computing service needs to be initialized every time the computing service is executed, and the resources of the computing service need to be recycled after the execution is completed.

[0064] For example, when the above-mentioned service engine is in a state of always starting, that is, a hot start state, the type of the above-mentioned code running can be resident type or temporary type. For example, when the above-mentioned service engine does not need to be closed when it needs to be started, that is, a cold start state, the type of the above-mentioned code running can be temporary type.

[0065] According to the above embodiment, in the case that the service engine is embedded in the client and the application initiates a task processing request, it is determined whether the task identifier corresponding to the request is recorded in the computing task list. If yes, the computing request is intercepted, and the code is downloaded according to the code block download address of the task recorded in the computing task list, and the service engine is called to execute the code. The remote service localization can be realized in the client, and the computing task does not have to be processed by the remote service center, which can reduce the load of the remote service center, avoid network delay, and improve data security.

[0066] In an embodiment, determining whether the first task identifier in the first task request is included in the first task list comprises:

[0067] In the case that the computing performance of the first client meets the first computing performance condition, it is determined whether the first task identifier in the first task request is included in the first task list.

[0068] It can be understood that the computing performance of the first client is the device performance of the electronic device where the first client is located, such as the computing power of the processor and the storage capacity of the memory, etc. The computing performance can be quantified into a numerical value or multiple performance parameters, and the first computing performance condition can be a numerical value range or a numerical value range of multiple performance parameters.

[0069] It can be understood that in the case that the computing performance of the first client is good, the above steps S110 to S130 are executed.

[0070] According to the above embodiment, the computing task corresponding to the first task request is executed only when the computing performance of the first client meets the preset performance requirement, which can ensure the completion efficiency and quality of the computing task.

[0071] In an embodiment, the above method can further comprise: in the case that the computing performance of the first client does not meet the first computing performance condition, sending the first task request to the remote service center, wherein the first task request is used to instruct the remote service center to determine a second client from the task machine pool and send the first task request to the second client, and the second client is used to determine the corresponding first code in the second client based on the first task identifier in the first task request, execute the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center, and the remote service center is used to receive the computing task result corresponding to the first task request and return it to the first client; receiving the computing task result corresponding to the first task request from the remote service center.

[0072] It can be understood that the task machine pool includes identifiers of multiple clients, and the computing performance of these clients all meets the first computing performance condition.

[0073] It can be understood that the relevant data required for calculation can be carried when the first task request is sent. For example, the relevant data is packaged in the first task request, so that when the remote service center forwards it to the second client, the second client can use the first code to perform the task calculation on the relevant data.

[0074] Exemplarily, one or more second clients are determined from the task machine pool, and the first task request is sent to each second client. The remote service center receives the calculation task results corresponding to the first task request returned by each second client, and can select one result to return to the first client. For example, the calculation task result returned to the remote service center first is returned to the first client.

[0075] Exemplarily, one or more second clients are determined from the task machine pool based on the time when each client in the task machine pool joins the task machine pool. For example, the earlier the joining time of the client to join the task machine pool, the greater the probability of being selected as a second client.

[0076] Exemplarily, when the second client joins the task machine pool, the second client can pre-download the code corresponding to each task identifier according to the task list. In this way, when the second client receives the task request from the remote service center, it does not need to download the code and can directly use the local code to run and perform the corresponding calculation task. Of course, these codes also need to be updated regularly.

[0077] In some examples, if the first code does not exist locally in the second client, the code can be downloaded from the remote service center, and then the calculation task corresponding to the first task request is performed based on the first code.

[0078] In some examples, if the first code exists in the second client, but the time length from the last update time of the first code to the current time exceeds the set time length, the first code is downloaded from the remote service center, and then the calculation task corresponding to the first task request is performed based on the first code. The first code downloaded is used to update the first code stored in the second client, so as to update the update time of the first code.

[0079] In low-end models, due to the limitations of hardware support and running efficiency, there may still be problems such as application program freezing and poor running efficiency when performing calculation tasks, which leads to a decline in user experience. In some cases, there is no available remote or edge node service to serve as a backup role for performing calculation tasks. Due to the limitation of the device where the application program is located, the low-performance device is difficult to perform the calculation task well, and therefore, the present example can solve this problem.

[0080] In practical applications, when the application program in a low-end device with poor hardware performance can only perform a limited computing task, the data or parameters (context content) required for the computing task can be packaged into an object, such as the task request described above. Then, the object is sent to a remote service center. After receiving the task request object sent by the low-end device, the remote service center publishes the object to a high-end device in the machine pool that is waiting to process the computing task of the low-end device. If the number of high-end devices in the machine pool is 0, the computing load of the high-end device is too high, or the high-end device in the machine pool times out, causing the high-end device in the machine pool to be unable to assist the low-end device to perform the computing task, the remote service center notifies the low-end device that the assistance task of the remote service center is unavailable, and thus the low-end device performs the computing task in the local service engine.

[0081] When the application program in a high-end device with good hardware performance starts, if the hardware computing resources are sufficient, the high-end device will try to join the machine pool of the remote task center to assist the low-end device to process the computing task. The high-end device can use a polling mechanism to notify the task center that the device can be used to assist the low-end device to perform the computing task. In addition, as the polling time increases, the assistance weight of the device is gradually reduced, and the high-end device that has been in the machine pool for a longer time is preferentially used to assist the low-end device to process the computing task. When the task center obtains computing resources from the machine pool, in order to prevent the high-end device that receives the assistance task from being unexpectedly interrupted, the remote service center can send a request for assistance task (i.e., context content) to multiple high-end devices at the same time, and then return the result returned by the high-end device that completes the computing task the fastest to the low-end device. Thus, the task taking model of the low-end device publishing a task and the high-end device assisting to process the task is realized.

[0082] In the task taking model, the high-end device is used to assist in processing the computing task taken from the remote service center. These computing tasks are not limited to computing requests sent by the low-end device, but can also include any other type of computing task. Because the high-end device in the task taking model is only responsible for taking the computing task from the remote service center and does not care about the source of the computing task. After the high-end device completes the computing task, the computing result is returned to the remote service center, and then the computing result is transmitted to the source of the computing task by the remote service center, so the source can be a low-end device or other device. This mode can make full use of the end computing resources of each client, thereby improving the computing efficiency and reducing the computing cost

[0083] The present example can constitute a task receiving model, in which a client in a high-end device with good hardware performance assists a client in a low-end device to perform a computing task, so that even without a remote service, an application in the low-end device can still realize localized computing of the remote service, i.e., the application in the high-end device performs the computing task. Moreover, this can improve the efficiency of task computing and reduce the cost of task computing.

[0084] In some embodiments, the above method further comprises: sending first task summary information in the first task list to the remote service center, wherein the first task summary information is used for returning the second task list by the remote service center to the first client in a case where the first task summary information is not identical to second task summary information in a second task list in the remote service center; receiving the second task list from the remote service center; and updating the first task list based on the second task list.

[0085] Exemplarily, the remote service center stores a task list, which records task identifiers (interface signature information or interface names) of various computing tasks (service interfaces api), total MD5 summary information generated based on the codes of the various service interfaces in combination with the ordering of the various service interfaces, various MD5 summary information generated based on the codes of the various service interfaces, and code download addresses of the various service interfaces. In addition, some service interfaces also carry a preloading identifier.

[0086] Exemplarily, the first client can update the first task list according to the present example at a regular time, or can update the first task list according to the present example when the first client is started. Alternatively, the first task list can be updated according to the present example when the first client is ready to send a first task request to the remote service center.

[0087] Understandably, the first task summary information can be MD5 summary information generated by the remote service center based on the codes corresponding to the various task identifiers in the first task list and the ordering positions of the various task identifiers in the list.

[0088] Understandably, the second task summary information can be MD5 summary information generated by the remote service center based on the codes corresponding to the various task identifiers in the second task list and the ordering positions of the various task identifiers in the list.

[0089] Understandably, the second task list stored by the remote service center can be updated according to actual needs, for example, the task identifiers included therein are added or deleted, the code download address corresponding to a certain task identifier is changed, or the code corresponding to a certain task identifier is updated. The version of the code corresponding to each task identifier can be recorded in the task list, and the version information can be used to indicate whether the code is updated.

[0090] In some examples, the remote service center can also directly send the updated second task list to each client when there is an update in the second task list of the remote service center, and each client updates the first task list based on the received second task list.

[0091] In some examples, for a task identifier in the updated first task list carrying a preloading identifier, it is checked whether the version information of the code associated with the identifier recorded in the task list is the same as the version information of the code corresponding to the identifier in the first client. If not, the code needs to be downloaded from the remote service center and the local code needs to be updated. If yes, no processing is needed.

[0092] For example, when the application is not started for the first time, the total MD5 digest information of the first task list is spliced into a specified interface parameter, and the interface parameter is sent to the remote service center. If the remote service center determines that the total MD5 digest content information in the parameter is the same as the total MD5 digest content information in the second task list in the remote service center, the remote service center returns information notifying the application in the client that the task list does not need to be changed, and the application in the client does not perform any operation after receiving the notification. If the remote service center determines that the total MD5 digest content information in the parameter is different from the total MD5 digest content information in the second task list in the remote service center, it means that the service interface or the related information of the interface in the list is updated, and the second task list is returned to the client, and the application in the client updates the first task list when receiving the second task list.

[0093] According to the above embodiment, by comparing the digest information in the two lists stored in the remote service center and the client by the remote service center, if they are not the same, the list stored in the remote service center is used to update the list in the client, and the latest code can be accurately downloaded by the client when performing a computing task.

[0094] In some embodiments, the above method can further include: in the case that the first client is started for the first time and the first client does not include the first task list, sending a task list download request to the remote service center; receiving the first task list from the remote service center; and storing the first task list in the first client.

[0095] In practical application, the remote service center is used to return a list including various service interfaces api, i.e. the above-mentioned task list, to each client. When the application program is started for the first time, the client obtains the list containing all service api interfaces from the remote service center in the form of an access request, which includes the total MD5 digest information generated after sorting all service api interfaces according to ascii up to the time of downloading, the interface name of the service api interface, the corresponding interface code download address of each, the MD5 digest information generated according to the interface code of the service api interface, and the identification of whether the interface code needs to be preloaded.

[0096] According to the above-mentioned embodiment, the client needs to download the task list from the remote service center when it is started for the first time. Thus, when the client needs to perform a computing task, it downloads the corresponding code according to the download address of the code corresponding to the computing task recorded in the task list to perform the computing task.

[0097] In an embodiment, the above-mentioned method can further include: in the case of receiving the first task list from the remote service center, determining whether the computing performance of the first client meets a second computing performance condition; in the case of the computing performance of the first client meeting the second computing performance condition, sending a task machine pool joining request to the remote service center, wherein the task machine pool joining request is used to instruct the remote service center to add the first client to the task machine pool.

[0098] It can be understood that the first computing performance condition can be the same as or different from the second computing performance condition. These computing performance conditions can include the hardware running speed range and other parameters of the device where the client is located.

[0099] In some examples, the computing performance of the first client can also be determined when the first client is started to see whether it meets the second computing performance condition; in the case of the computing performance of the first client meeting the second computing performance condition, a task machine pool joining request can be sent to the remote service center.

[0100] It can be understood that the identification of the first client is added to the task machine pool to indicate that it has been added to the task machine pool.

[0101] According to the above-mentioned embodiment, when the application program in a high-end device with good hardware performance is started or receives a task list, if the hardware computing resources are sufficient, it can try to join the machine pool of the remote task center to assist low-end devices in processing computing tasks. Thus, the efficiency of task computing is improved and the cost of task computing is reduced.

[0102] The high-end device can use a polling mechanism to notify the task center that the device can currently be used to assist the low-end device in performing a computing task. Moreover, as the polling duration increases, the assistance weight of the device is gradually reduced, and the high-end device that has been in the pool for a longer time is preferentially used to assist the low-end device in processing a computing task. When the task center obtains a computing resource from the pool, to prevent the high-end device that receives an assistance task from being unexpectedly interrupted, the task center can simultaneously send a request for an assistance task, that is, context content, to multiple high-end devices, and then the remote service center returns the result returned by the high-end device that completes the computation the fastest to the low-end device. Thus, a task taking model in which a low-end device issues a task and a high-end device assists in processing the task is implemented.

[0103] In an embodiment, the method can further include, in a case where it is determined that the first client is added to the task pool, sending, to the remote service center, a polling signal based on a polling interval time, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task pool.

[0104] It can be understood that the remote service center can notify the first client that the first client has been added to the task pool when the first client has been added to the task pool. When the first client receives the notification, the first client determines that the first client has been added to the task pool.

[0105] For example, the first client sends a polling signal to the remote service center at intervals. The time can be fixed or variable. That is, the polling interval time described above can be a fixed time duration or a variable time duration.

[0106] For example, the last polling interval time used is different from the current polling interval time used. Alternatively, the current polling interval time used is longer than the last polling interval time used.

[0107] In this way, the remote service center can gradually reduce the assistance weight of the device as the polling duration increases, and preferentially use the high-end device that has been in the pool for a longer time to assist the low-end device in processing a computing task.

[0108] According to the above embodiment, a high-performance device or client can use a polling mechanism to notify the remote service center that the device can currently be used to assist a low-performance device or client in performing a computing task.

[0109] In an implementation, the method can further include: updating the polling interval time based on a preset time update frequency, so that the updated polling interval time is longer than the polling interval time before the update; and stopping sending the polling signal to the remote service center in a case that the updated polling interval time is longer than a preset time threshold, wherein the remote service center is configured to delete the first client from the task machine pool in a case that the polling signal from the first client is not received within a preset time.

[0110] It can be understood that the polling interval time is extended periodically according to a certain time interval.

[0111] It can be understood that the first client can determine the time for sending the polling signal this time according to the polling interval time and the time for sending the polling signal last time, and then send the polling signal to the remote service center based on the time for sending the polling signal this time.

[0112] It can be understood that if the polling interval time exceeds the preset time threshold, the first client no longer determines the time for sending the polling signal this time, and stops sending the polling signal to the remote service center.

[0113] Meanwhile, the remote service center also monitors the receiving time of the polling signal, and deletes the first client from the task machine pool in a case that the polling signal from the first client is not received within a preset time.

[0114] It can be understood that the identification of the first client is deleted from the task machine pool to indicate that the first client is deleted from the task machine pool.

[0115] It can be understood that the task machine pool is a set of client identifications.

[0116] According to the above implementation, the polling interval time is extended according to a certain time interval, and the polling signal is no longer sent in a case that the polling interval time exceeds the preset length, so that the remote service center deletes it from the task machine pool. In this way, the client that has joined the task machine pool earlier can be deleted to provide space for the client that has joined the task machine pool most recently.

[0117] In an implementation, the method can further include: in a case that it is determined that the first client is added to the task machine pool, downloading the code corresponding to each task identification from the remote service center based on the code download address associated with each task identification in the first task list; and storing the code corresponding to each task identification in the first client.

[0118] In the example, when the second client joins the task machine pool, the second client can pre-download the code corresponding to each task identifier according to the task list. In this way, when the second client receives the task request from the remote service center, the code does not need to be downloaded, and the local code can be directly used for running and performing the corresponding computing task, improving the efficiency of task computing.

[0119] In an embodiment, the method further includes, in a case where the second task request from the remote service center is received, determining the corresponding second code in the first client based on the second task identifier in the second task request; performing the computing task corresponding to the second task request based on the second code to obtain the computing task result corresponding to the second task request; and returning the computing task result to the remote service center.

[0120] It can be understood that in a case where the first client joins the task machine pool, it can assist other clients to perform the computing task.

[0121] It can be understood that the second task request can be understood as an assistance request for the computing task. The content included in the second task request can be similar to the first task request described above, and specific reference can be made to the introduction content of the first task request, which is not described in detail here.

[0122] It can be understood that the second task request carries relevant data required for performing the computing task, such as context data.

[0123] It can be understood that since the first client has downloaded the corresponding code according to the task list in the first client in a case where the first client joins the task machine pool, when the first client receives the second task request, it does not need to spend time to download the code, and directly uses the locally downloaded code to perform the computing task corresponding to the second task request, improving the efficiency of task processing.

[0124] According to the above embodiment, in a case where the first client joins the task machine pool, the second task request forwarded by the remote service center can be received, so that the remote service center can be assisted to perform the computing task, and the localization of the remote service can be realized.

[0125] In an embodiment, the method further includes, in a case where the first client is started for the first time, determining whether the computing performance of the first client meets a third computing performance condition; and in a case where the computing performance of the first client meets the third computing performance condition, starting the service engine, wherein the service engine is used to perform the computing task.

[0126] Exemplarily, for the first client, its type has multiple types, for example, Android, IOS and windows, etc., for different types of clients, different types of service engines can be selected. For example, JavaScriptCore is used as a service engine in the IOS client. Quickjs is used as a service engine in the Android and windows clients. The browser side uses the quickjs container packaged by the webAssembly technology as a service engine, or uses the built-in service worker as a service engine.

[0127] Exemplarily, two or more service engines can also be used in the same client, so that multiple computing tasks can be executed at the same time.

[0128] It can be understood that the computing performance of the first client can be determined according to the hardware support degree and running efficiency of the electronic device where it is located, and the third computing performance condition can be a hardware support degree range and a running efficiency range, or a range value determined based on the two ranges.

[0129] It can be understood that when the application is started, the computing performance of the application is determined according to the hardware support degree and running efficiency of the electronic device where it is located, for example, low-end performance and high-end performance. For the application running on a high-performance electronic device, the service engine is started in the first time after the completion of the start of the application, so as to support the execution of the computing service in the first time. In this way, when facing the execution demand of the computing service, logical calculation can be immediately executed, and there is no need to wait for the start of the service engine, which is called hot start.

[0130] According to the above embodiment, when the client is started for the first time, if the performance of the client meets the requirements, the service engine is directly started, and subsequent computing tasks are executed by calling the service engine without the operation of starting the service engine, thereby improving the efficiency of task computing.

[0131] In one embodiment, the above method can further include: in the case that the computing performance of the first client does not meet the third computing performance condition, determining whether to prepare to send the first task request to the remote service center; in the case that it is determined to prepare to send the first task request to the remote service center, starting the service engine.

[0132] It can be understood that after the service engine is started, the service engine executes the computing task corresponding to the first task request based on the first code. After the execution is completed, the first client can close the service engine, or can not close the service engine.

[0133] It can be understood that for the application running on the low-end performance electronic device, due to the limitation of hardware device and running efficiency, the forced start of the service engine in the time period from the start of the application to the completion of the main business logic execution may cause the problems such as application lag, death or poor running effect in the device, which seriously affects the user experience.

[0134] According to the above embodiment, the start time of the service engine can be set to start when the computing task demand is received. After the service engine is started, the logic processing operation of the computing task is executed. In this way, the running efficiency of the device where the client is located can be improved.

[0135] In an embodiment, the above method further comprises: in the case where the computing task result provided by the service engine is obtained, the service engine is closed.

[0136] It can be understood that in the preceding example, after the logic processing operation of the computing task is completed, the service engine is closed, and the above operation is repeated again when the next computing task demand is received. This is called cold start.

[0137] According to the above embodiment, compared with hot start, cold start increases the overall delay of task computing, but on a low-end model, the localization of remote service can still be realized without affecting the user experience.

[0138] In practical applications, the remote HTTP service in any of the above embodiments can be deployed in the application of the user's local, which is suitable for fields or scenes that require fast data processing and high response speed, and is also widely applicable to various scenes that require remote server processing requests, such as mobile applications, web applications, etc. Taking a mobile application as an example, through any embodiment of the present disclosure, the application can directly process most of the computing tasks on the user's device, reduce the interaction with the remote server, and thus improve the response speed of task computing and user experience. At the same time, since the related data involved in the execution of the computing task is mainly stored and processed locally, it does not need to be transmitted to the remote service center, which reduces the risk of data leakage.

[0139] Figure 2 is the structure block diagram of the task processing system of an embodiment of the present disclosure.

[0140] As shown in Figure 2 , the task processing system can include a computing task management center and a plurality of user terminal devices, i.e. a plurality of clients. The computing task management center includes a machine pool, a remote service center and a storage OSS system.

[0141] 1. User device, i.e. client (application):

[0142] Different types of service engines are provided for different types of clients. The service engine provides basic IO, computing and network processing capabilities, and the ability of code dynamic execution inside the runtime.

[0143] The service engine is built into the client application, and provides a module that provides unified and standardized computing request sending and interception capabilities in the client application.

[0144] When the application starts, the application evaluates the computing capability of the hardware device where the current client is located. If the computing capability of the device meets the preset conditions, the device is determined as a high-end device, and the device is added to the machine pool of the remote service center by sending a request to the task computing management center. In order to enable the machine pool to obtain the online state of each device in the pool in real time, the devices that have joined the machine pool will use a polling mechanism to establish a heartbeat mechanism to ensure that the devices in the machine pool are always available and can assist in processing computing requests of other devices at any time.

[0145] When the application receives a computing request sent by the user, different computing processing actions are performed according to the device type information that has been determined when the application starts.

[0146] For the application running on a high-end device, the computing request is directly processed, and the computing result is returned to the user after the computation is completed, thereby completing the execution of the computing task.

[0147] For the application running on a low-end device, the computing request is wrapped in a context and then sent to a remote service Agent in the remote task computing management center. The remote service Agent selects a number of user devices from the machine pool using a filtering strategy in the task taking model, and then sends the computing request and context content to these devices. In order to ensure the completeness and accuracy of the computation, a redundancy strategy is used to send the computing request and context content to multiple devices. Moreover, the remote service Agent returns the first returned computing result to the low-end device that assists in processing the request, and the subsequent returned computing results will be discarded. The low-end device transmits the computing result to the user after receiving the computing result, thereby completing the execution of the computing task.

[0148] 2. Task computing management center:

[0149] The software service provider, i.e. the service provider of the client application, splits the logic segments of different computing tasks into different code blocks. The code blocks contain the code logic and dependent resources required by the computing tasks. There is interface signature information corresponding to each code block of the computing task. The specific code segment can be found through the interface signature information. The service provider packs, obfuscates and compresses the code block resources, and then publishes the code blocks to the OSS (Object Storage Service) by means of continuous integration or other deployment methods. The application programs in the client can obtain and download the code block resources required for computing from the OSS.

[0150] In addition, the service provider also provides a remote service Agent, which is the core functional module of the entire task system center, responsible for processing the computing task list and collecting and distributing the task taking model. When the application program on the client side starts, it can request the remote service Agent service to obtain the latest computing task list up to the start time. According to the task list, it is determined whether some code block resources already downloaded into the application program need to be downloaded or updated. The task list contains the latest timestamp, MD5 digest information of the entire task list, task list information (including the task signature information of each task, the MD5 digest information of the task code block and the download address of the task code block).

[0151] After the application program obtains the computing task list, it can determine the hardware computing performance of the current device. If the performance meets the performance index condition corresponding to the high-performance device (the specific performance index condition can be dynamically determined according to the specific business type and use scenario), the device will be added to the remote machine pool. The machine pool service is used to process the task collection and distribution function in the task taking model. The device added to the machine pool can use the polling mechanism to maintain the available state of the device in the machine pool, and the polling interval time of the device side can be gradually extended every period of time. When the polling interval time is extended to the length of the exit machine pool threshold, the device can initiate a request to exit the machine pool, so as to exit the machine pool and no longer accept the assistance in processing the remotely assigned computing tasks. In addition, in order to ensure that the number of devices in the entire machine pool is fixed and limited, the device information in the machine pool is updated regularly. The devices with too long waiting time in the machine pool are gradually deleted and new devices are added, so that the devices in the machine pool are relatively new.

[0152] In the above example, the application program on the client side mainly includes the functions of starting the application, sending the calculation request, task processing, expiring the update code block, etc. Through the core central processor module, the calculation task is completed on the basis of the module structure of the calculation code block in the JavaScript engine runtime. Among them, the central processor will also complete the whole interaction with the calculation task scheduling system. Through the system, the comprehensive management and scheduling functions among the calculation, task and device are completed.

[0153] The above example eliminates the influence of the traditional remote service center processing request task, maximizes the reduction of hardware and bandwidth cost on the business side by means of the computing power provided by the client-side device, and improves the execution efficiency of task calculation

[0154] Figure 3 is the flow chart of the task processing method of another embodiment of the present disclosure.

[0155] As Figure 3 shown, the task processing method is applied to a remote service center and includes the following steps.

[0156] S310, in response to a task list download request from a first client, a first task list is sent to the first client, wherein the first task list is used by the first client to determine whether to include a first task identifier in a first task request in preparation for sending the first task request to the remote service center, and the first client is used to intercept the first task request in the case of determining that the first task identifier is included in the first task list, and based on the code download address associated with the first task identifier in the first task list, a download request is sent to the remote service center;

[0157] S320, in response to the download request from the first client, the corresponding first code is obtained based on the code download address in the download request;

[0158] S330, the first code is sent to the first client, wherein the first code is used by the first client to execute the calculation task corresponding to the first task request to obtain the calculation task result corresponding to the first task request.

[0159] Exemplarily, when the first client is started for the first time, a task list download request is sent to the remote service center.

[0160] Exemplarily, the remote service center can interact with the storage, and the storage stores a plurality of calculation tasks respectively corresponding to the code blocks. Based on the code download address, the storage address in the storage can be determined, and then based on the storage address, the corresponding first code is obtained from the storage.

[0161] Exemplarily, the operation performed by the first client is the same as the aforementioned task processing method applied to the first client, which is not described in detail here.

[0162] According to the above-mentioned embodiments, in the case where the application initiates a task computing request, it is judged whether the task identity corresponding to the request is recorded in the computing task list. If yes, the computing request is intercepted, and the code is downloaded according to the code block download address of the task recorded in the computing task list, and the service engine is called to execute the code. The remote service localization can be realized in the client, and the computing task does not have to be processed by the remote service center, which can reduce the load of the remote service center, avoid network delay, and improve data security.

[0163] In an embodiment, the above-mentioned method can further include:

[0164] In response to a first task request from a first client, a second client is determined in a task machine pool, wherein the first task request is sent to the remote service center in the case where the computing performance of the first client does not meet a first computing performance condition;

[0165] The first task request is sent to the second client, wherein the second client is used to determine the corresponding first code in the second client based on the first task identity in the first task request, execute the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center;

[0166] In the case where the computing task result corresponding to the first task request from the second client is received, the computing task result corresponding to the first task request is returned to the first client.

[0167] It can be understood that the method performed by the first client and the second client here is the same as the aforementioned task processing method applied to the first client in the example, which is not described in detail here.

[0168] According to the above-mentioned embodiments, the client in the high-end device with better hardware performance assists the client in the low-end device to perform the computing task, so that even in the absence of remote service, the application in the low-end device can still realize the localized computing of the remote service, i.e., the computing task is performed by the application in the high-end device. Moreover, this can improve the efficiency of task computing and reduce the cost of task computing.

[0169] In an embodiment, the method further comprises: in response to receiving the first task summary information from the first client, comparing the first task summary information with second task summary information in a second task list in the remote service center; and in response to the first task summary information being different from the second task summary information, sending the second task list to the first client, wherein the second task list is used to update the first task list in the first client.

[0170] According to the above embodiment, by comparing the summary information in the two lists stored in the remote service center and the client, if the summary information is different, the list stored in the remote service center is used to update the list in the client, and the subsequent client can accurately download the latest code when performing the computing task.

[0171] In an embodiment, the method further comprises: in response to a task machine pool joining request from the first client, adding the first client to the task machine pool; wherein the task machine pool joining request is a request sent by the first client to the remote service center in response to receiving the first task list from the remote service center and determining that the computing performance of the first client meets a second computing performance condition.

[0172] According to the above embodiment, when the application in the high-end device with good hardware performance receives the task list, if the hardware computing resource is sufficient, the application can attempt to join the machine pool of the remote task center to assist the low-end device to process the computing task. Thus, the efficiency of the task computing is improved and the cost of the task computing is reduced.

[0173] In an embodiment, the method further comprises one of the following:

[0174] In response to receiving a polling signal from the first client within a preset time, maintaining the first client in the task machine pool;

[0175] In response to not receiving a polling signal from the first client within the preset time, deleting the first client from the task machine pool.

[0176] According to the above-mentioned embodiments, a high-performance device or client can use a polling mechanism to inform the remote service center that the device can be used to assist a low-performance device or client to perform a computing task. In addition, the polling interval is extended at a certain time interval, and when the polling interval exceeds a set length, the polling signal is no longer sent, so that the remote service center removes it from the task machine pool. In this way, the client that has been in the task machine pool for a long time can be removed to provide space for the client that has just joined the task machine pool.

[0177] Figure 4 is a structural block diagram of a task processing apparatus according to an embodiment of the present disclosure.

[0178] As shown in Figure 4 , the task processing apparatus is applied to a first client and includes:

[0179] An identifier determining module 410 is configured to determine whether a first task identifier in a first task request is included in a first task list when the first task request is ready to be sent to a remote service center.

[0180] A code downloading module 420 is configured to intercept the first task request when the first task identifier is included in the first task list, and download corresponding first code from the remote service center based on a code downloading address associated with the first task identifier in the first task list.

[0181] A task executing module 430 is configured to execute a computing task corresponding to the first task request based on the first code to obtain a computing task result corresponding to the first task request.

[0182] Figure 5 is a structural block diagram of a task processing apparatus according to another embodiment of the present disclosure.

[0183] As shown in Figure 4 and Figure 5 , the identifier determining module 510, the code downloading module 520, and the task executing module 530 in Figure 5 are respectively the same in structure and function as the identifier determining module 410, the code downloading module 420, and the task executing module 430 in Figure 4 , and will not be described here.

[0184] In an embodiment, the identifier determining module is specifically configured to:

[0185] determine whether the first task identifier in the first task request is included in the first task list when the computing performance of the first client meets a first computing performance condition.

[0186] In an embodiment, asFigure 5 The apparatus further includes, as shown above,

[0187] The first request sending module 540 is configured to send the first task request to the remote service center in a case where the computing performance of the first client does not satisfy the first computing performance condition, wherein the first task request is used to instruct the remote service center to determine a second client from a task machine pool and send the first task request to the second client, and the second client is used to determine the corresponding first code in the second client based on the first task identification in the first task request, execute the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center, and the remote service center is used to receive the computing task result corresponding to the first task request and return it to the first client.

[0188] The task result receiving module 550 is configured to receive the computing task result corresponding to the first task request from the remote service center.

[0189] In an embodiment, as shown above, Figure 5 The apparatus further includes, as shown above, a list updating module 560 configured to:

[0190] Send the first task abstract information in the first task list to the remote service center, wherein the first task abstract information is used to return the second task list to the first client by the remote service center in a case where it is not the same as the second task abstract information in the second task list in the remote service center;

[0191] Receive the second task list from the remote service center;

[0192] Update the first task list based on the second task list.

[0193] In an embodiment, as shown above, Figure 5 The apparatus further includes, as shown above, a list downloading module 570 configured to:

[0194] Send a task list downloading request to the remote service center in a case where the first client is started for the first time and the first task list is not included in the first client;

[0195] Receive the first task list from the remote service center;

[0196] Store the first task list in the first client.

[0197] In an embodiment, as shown above, Figure 5As shown, the apparatus further includes a first device joining module 580, configured to:

[0198] In a case where the first task list is received from the remote service center, it is determined whether the computing performance of the first client satisfies a second computing performance condition;

[0199] In a case where the computing performance of the first client satisfies the second computing performance condition, a task machine pool joining request is sent to the remote service center, wherein the task machine pool joining request is used to instruct the remote service center to add the first client to the task machine pool.

[0200] In an embodiment, as shown in Figure 5 As shown, the apparatus further includes a first polling module 590, configured to:

[0201] In a case where it is determined that the first client is added to the task machine pool, a polling signal is sent to the remote service center based on a polling interval time, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.

[0202] In an embodiment, as shown in Figure 5 As shown, the first polling module 590 is further configured to:

[0203] The polling interval time is updated based on a preset time update frequency, so that the updated polling interval time is longer than the polling interval time before the update;

[0204] In a case where the updated polling interval time is longer than a preset time threshold, the sending of the polling signal to the remote service center is stopped, wherein the remote service center is configured to delete the first client in the task machine pool in a case where the polling signal from the first client is not received within a preset time.

[0205] In an embodiment, as shown in Figure 5 As shown, the code downloading module 520 is further configured to:

[0206] In a case where it is determined that the first client is added to the task machine pool, codes corresponding to each task identifier are downloaded from the remote service center based on a code download address associated with each task identifier in the first task list;

[0207] The codes corresponding to each task identifier are stored in the first client.

[0208] In an embodiment, as shown in Figure 5 As shown, the task execution module 530 is further configured to:

[0209] In a case where a second task request from the remote service center is received, a second code corresponding to the second task request is determined in the first client based on a second task identifier in the second task request;

[0210] A computing task corresponding to the second task request is executed based on the second code to obtain a computing task result corresponding to the second task request;

[0211] The computing task result is returned to the remote service center.

[0212] In an embodiment, as shown in Figure 5 The apparatus further includes a hot start module 591 configured to:

[0213] In a case where the first client is started for the first time, it is determined whether a computing performance of the first client meets a third computing performance condition.

[0214] In a case where the computing performance of the first client meets the third computing performance condition, a service engine is started, wherein the service engine is configured to execute the computing task.

[0215] In an embodiment, as shown in Figure 5 The apparatus further includes a cold start module 592 configured to:

[0216] In a case where the computing performance of the first client does not meet the third computing performance condition, it is determined whether the first task request is prepared to be sent to the remote service center.

[0217] In a case where it is determined that the first task request is prepared to be sent to the remote service center, the service engine is started.

[0218] In an embodiment, as shown in Figure 5 The cold start module 592 is further configured to:

[0219] In a case where the computing task result provided by the service engine is obtained, the service engine is closed.

[0220] Figure 6 is a structural block diagram of a task processing apparatus according to another embodiment of the present disclosure.

[0221] As shown in Figure 6 The task processing apparatus is applied to a remote service center and includes:

[0222] The first list sending module 610 is configured to, in response to a task list download request from a first client, send a first task list to the first client, wherein the first task list is used by the first client to determine whether to include a first task identifier in a first task request in a case where the first client is ready to send the first task request to the remote service center, and the first client is configured to, in a case where it is determined that the first task identifier is included in the first task list, intercept the first task request, and send a download request to the remote service center based on a code download address associated with the first task identifier in the first task list.

[0223] The code obtaining module 620 is configured to, in response to the download request from the first client, obtain corresponding first code based on a code download address in the download request.

[0224] The code sending module 630 is configured to send the first code to the first client, wherein the first code is used by the first client to execute a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.

[0225] Figure 7 FIG. 7 is a structural block diagram of a task processing device according to another embodiment of the present disclosure.

[0226] As shown in Figure 6 and Figure 7 , the first list sending module 710, the code obtaining module 720, and the code sending module 730 in Figure 7 are respectively the same in structure and function as the first list sending module 710, the code obtaining module 720, and the code sending module 730 in Figure 6 , and will not be described here.

[0227] In an implementation form, as shown in Figure 7 , the device further includes:

[0228] The task request receiving module 740 is configured to, in response to a first task request from a first client, determine a second client in a task machine pool, wherein the first task request is sent to the remote service center in a case where the computing performance of the first client does not meet a first computing performance condition.

[0229] The second request sending module 750 is configured to send the first task request to the second client, wherein the second client is configured to determine corresponding first code in the second client based on the first task identifier in the first task request, and execute a computing task corresponding to the first task request based on the first code, and return a computing task result corresponding to the first task request to the remote service center.

[0230] The task result sending module 760 is configured to, in a case where the computing task result corresponding to the first task request from the second client is received, return the computing task result corresponding to the first task request to the first client.

[0231] In an embodiment, as shown in FIG. 7, the apparatus further includes: Figure 7

[0232] The abstract comparison module 770 is configured to, in a case where the first task abstract information from the first client is received, compare the first task abstract information with second task abstract information in a second task list in the remote service center.

[0233] The second list sending module 780 is configured to, in a case where the first task abstract information is different from the second task abstract information, send the second task list to the first client, where the second task list is used to update the first task list in the first client.

[0234] In an embodiment, as shown in FIG. 7, the apparatus further includes: Figure 7

[0235] The second device joining module 790 is configured to, in response to a task machine pool joining request from the first client, add the first client to the task machine pool.

[0236] The task machine pool joining request is a request sent by the first client to the remote service center in a case where the first task list from the remote service center is received, and the computing performance of the first client meets a second computing performance condition.

[0237] In an embodiment, as shown in FIG. 7, the apparatus further includes a second polling module configured to perform one of the following: Figure 7 In a case where a polling signal from the first client is received within a preset time, the first client is maintained in the task machine pool.

[0238] In a case where the polling signal from the first client is not received within the preset time, the first client is deleted from the task machine pool.

[0239] The specific functions and examples of the modules and sub-modules of the apparatus of the embodiments of the present disclosure are described above in the corresponding steps of the method embodiments, which will not be described here.

[0240]

[0241] ​​​In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0242] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product. Wherein, the electronic device can be a tasker, and the tasker can further include any power supply control device in the embodiments of the present disclosure.

[0243] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, taskers, blade taskers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0244] As shown in Figure 8 The electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0245] Various components in the electronic device 800 are connected to the I / O interface 805, including an input unit 806, such as a keyboard, a mouse, etc., an output unit 807, such as various types of displays, a speaker, etc., the storage unit 808, such as a magnetic disk, an optical disk, etc., and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0246] The computing unit 801 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs various methods and processes described above, such as a task processing method. For example, in some embodiments, a task processing method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded onto the RAM 803 and executed by the computing unit 801, one or more steps of a task processing method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform a task processing method by any other suitable means, such as by means of firmware.

[0247] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0248] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or tasker.

[0249] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include a lined- based system, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0250] To provide for interaction with a user, the systems and techniques described here 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 a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, 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, speech, or tactile input.

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

[0252] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a distributed system server, or a blockchain-integrated server.

[0253] It should be understood that the various forms of flow shown above can be re-ordered, steps added or removed, etc. For example, the steps recited in the present disclosure can be performed in parallel, in series, in a different order, etc., as long as the desired results of the technology disclosed in the present disclosure are achieved, which is not limited herein.

[0254] The above detailed description does not constitute a limitation of the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A task processing method applied to a first client, comprising: in a case where a first task request is to be sent to a remote service center and a computing performance of the first client meets a first computing performance condition, determining whether a first task identifier in the first task request is included in a first task list, wherein the first task list is information downloaded in advance by the first client from the remote service center, and the first task list includes a plurality of task identifiers and a code download address associated with each of the task identifiers; in a case where the first task identifier is included in the first task list, intercepting the first task request and downloading a corresponding first code from the remote service center based on the code download address associated with the first task identifier in the first task list; based on the first code, performing a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request. 2.The method of claim 1, further comprising: in a case where the first task request is to be sent to the remote service center and the computing performance of the first client does not meet the first computing performance condition, sending the first task request to the remote service center, wherein the first task request is used to instruct the remote service center to determine a second client from a task machine pool and send the first task request to the second client, and the second client is used to determine the corresponding first code in the second client based on the first task identifier in the first task request, perform the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center, and the remote service center is used to receive the computing task result corresponding to the first task request and return it to the first client; receiving the computing task result corresponding to the first task request from the remote service center. 3.The method of claim 1, further comprising: sending first task summary information in the first task list to the remote service center, wherein the first task summary information is used to return a second task list in the remote service center to the first client in a case where the first task summary information is not the same as second task summary information in the second task list in the remote service center; receiving the second task list from the remote service center; updating the first task list based on the second task list. 4.The method of claim 3, further comprising: in a case where the first client is started for the first time and the first task list is not included in the first client, sending a task list download request to the remote service center; receiving the first task list from the remote service center; storing the first task list in the first client. 5.The method of claim 4, further comprising: determining whether the computing performance of the first client satisfies a second computing performance condition, in a case that the first task list from the remote service center is received; sending a task machine pool joining request to the remote service center, in a case that the computing performance of the first client satisfies the second computing performance condition, wherein the task machine pool joining request is used to instruct the remote service center to add the first client to the task machine pool.

6. The method of claim 5, further comprising: sending a polling signal to the remote service center based on a polling interval time, in a case that the first client is determined to be added to the task machine pool, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.

7. The method of claim 6, further comprising: updating the polling interval time based on a preset time update frequency, so that the updated polling interval time is longer than the polling interval time before the update; stopping sending the polling signal to the remote service center, in a case that the updated polling interval time is longer than a preset time threshold, wherein the remote service center is used to delete the first client in the task machine pool in a case that the remote service center does not receive the polling signal from the first client within a preset time.

8. The method of claim 7, further comprising: downloading codes corresponding to each task identifier from the remote service center based on a code download address associated with each task identifier in the first task list, in a case that the first client is determined to be added to the task machine pool; storing the codes corresponding to each task identifier in the first client.

9. The method of claim 8, further comprising: determining a second code corresponding to a second task identifier in the first client based on the second task identifier in a second task request from the remote service center, in a case that the second task request from the remote service center is received; performing a computing task corresponding to the second task request based on the second code to obtain a computing task result corresponding to the second task request; returning the computing task result to the remote service center.

10. The method of any one of claims 1-9, further comprising: determining whether the computing performance of the first client satisfies a third computing performance condition, in a case that the first client is started for the first time; starting a service engine, in a case that the computing performance of the first client satisfies the third computing performance condition, wherein the service engine is used to perform the computing task.

11. The method of claim 10, further comprising: determining whether to prepare to send the first task request to the remote service center, in a case that the computing performance of the first client does not satisfy the third computing performance condition; starting the service engine, in a case that it is determined to prepare to send the first task request to the remote service center.

12. The method of claim 11, further comprising: In a case that the computing task result provided by the service engine is obtained, the service engine is closed.

13. A task processing method applied to a remote service center, comprising: in response to a task list download request from a first client, sending a first task list to the first client, wherein the first task list is information downloaded in advance by the first client from the remote service center, and includes a plurality of task identifiers and code download addresses associated with the respective task identifiers, and is used for the first client to determine whether to include a first task identifier in a first task request sent to the remote service center in a case that the computing performance of the first client meets a first computing performance condition, and the first client is used to intercept the first task request in a case that the first task identifier is determined to be included in the first task list, and send a download request to the remote service center based on the code download address associated with the first task identifier in the first task list; in response to the download request from the first client, obtaining corresponding first code based on the code download address in the download request; sending the first code to the first client, wherein the first code is used for the first client to execute a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.

14. The method of claim 13, further comprising: in response to a first task request from a first client, determining a second client in a task machine pool, wherein the first task request is sent to the remote service center in a case that the computing performance of the first client does not meet the first computing performance condition; sending the first task request to the second client, wherein the second client is used to determine corresponding first code in the second client based on the first task identifier in the first task request, and execute the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center; in a case that the computing task result corresponding to the first task request from the second client is received, returning the computing task result corresponding to the first task request to the first client.

15. The method of claim 13 or 14, further comprising: in a case that first task summary information from the first client is received, comparing the first task summary information with second task summary information in a second task list in the remote service center; in a case that the first task summary information is different from the second task summary information, sending the second task list to the first client, wherein the second task list is used to update the first task list in the first client.

16. The method of claim 15, further comprising: in response to a task machine pool joining request from the first client, adding the first client to the task machine pool. The task machine pool joining request is a request sent by the first client to the remote service center after receiving the first task list from the remote service center and determining that the computing performance of the first client meets a second computing performance condition.

17. The method of claim 16, further comprising one of: maintaining the first client in the task machine pool if a polling signal from the first client is received within a preset time; deleting the first client in the task machine pool if a polling signal from the first client is not received within the preset time.

18. A task processing apparatus applied to a first client, comprising: an identification determining module configured to determine whether a first task identification in a first task request is included in a first task list in a case where the first client is ready to send the first task request to a remote service center and the computing performance of the first client meets a first computing performance condition, wherein the first task list is information downloaded in advance by the first client from the remote service center, and the first task list includes a plurality of task identifications and a code download address associated with each of the task identifications; a code downloading module configured to intercept the first task request in a case where the first task identification is included in the first task list, and download corresponding first code from the remote service center based on the code download address associated with the first task identification in the first task list; a task executing module configured to execute a computing task corresponding to the first task request based on the first code to obtain a computing task result corresponding to the first task request.

19. The apparatus of claim 18, further comprising: a first request sending module configured to send the first task request to the remote service center in a case where the first client is ready to send the first task request to the remote service center and the computing performance of the first client does not meet the first computing performance condition, wherein the first task request is used to instruct the remote service center to determine a second client from a task machine pool and send the first task request to the second client, and the second client is used to determine the corresponding first code in the second client based on the first task identification in the first task request, execute the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center, and the remote service center is used to receive the computing task result corresponding to the first task request and return it to the first client; a task result receiving module configured to receive the computing task result corresponding to the first task request from the remote service center.

20. The apparatus of claim 18, further comprising a list updating module configured to: sending first task summary information in the first task list to the remote service center, wherein, The first task summary information is used for the remote service center to return a second task list to the first client in a case where the first task summary information is not identical to second task summary information in the second task list in the remote service center; receiving the second task list from the remote service center; updating the first task list based on the second task list.

21. The apparatus of claim 20, further comprising a list download module configured to: in a case where the first client is started for the first time and the first task list is not included in the first client, sending a task list download request to the remote service center; receiving the first task list from the remote service center; storing the first task list in the first client.

22. The apparatus of claim 21, further comprising a first device join module configured to: in a case where the first task list is received from the remote service center, determining whether a computing performance of the first client meets a second computing performance condition; in case the computing performance of the first client meets the second computing performance condition, sending a task machine pool join request to the remote service center, wherein the task machine pool join request is used to instruct the remote service center to add the first client to the task machine pool.

23. The apparatus of claim 22, further comprising a first polling module configured to: in the event that the first client is determined to be added to the task farm, sending a polling signal to the remote service center based on a polling interval time, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.

24. The apparatus of claim 23, wherein, the first polling module is further configured to: update the polling interval time based on a preset time update frequency, so that the updated polling interval time is longer than the polling interval time before the update; in a case where the updated polling interval time is longer than a preset time threshold, stop sending the polling signal to the remote service center, wherein the remote service center is used to delete the first client in the task machine pool in a case where the polling signal from the first client is not received within a preset time.

25. The apparatus of claim 24, wherein, the code download module is further configured to: in a case where it is determined that the first client is added to the task machine pool, download codes corresponding to each task identifier based on a code download address associated with each task identifier in the first task list from the remote service center; store the codes corresponding to each task identifier in the first client.

26. The apparatus of claim 25, wherein, the task execution module is further configured to: in a case where a second task request is received from the remote service center, determine a second code corresponding to the first client based on a second task identifier in the second task request; execute a computing task corresponding to the second task request based on the second code to obtain a computing task result corresponding to the second task request; return the computing task result to the remote service center.

27. The apparatus of any one of claims 18-26, further comprising a hot start module configured to: in a case where the first client is started for the first time, determine whether a computing performance of the first client meets a third computing performance condition; in case the computing performance of the first client meets the third computing performance condition, starting a service engine, wherein the service engine is used to execute the computing task.

28. The apparatus of claim 27, further comprising a cold start module configured to: determine whether to prepare to send the first task request to the remote service center in a case that the computing performance of the first client does not satisfy the third computing performance condition; start the service engine in a case that it is determined to prepare to send the first task request to the remote service center.

29. The apparatus of claim 28, wherein, the cold start module is further configured to: turn off the service engine in a case that the computing task result provided by the service engine is obtained.

30. A task processing apparatus applied to a remote service center, comprising: a first list sending module configured to send a first task list to a first client in response to a task list download request from the first client, wherein the first task list is information previously downloaded by the first client from the remote service center, and includes a plurality of task identifiers and a code download address associated with each of the task identifiers, and is used to determine whether to include a first task identifier in a first task request in a case that the first client prepares to send the first task request to the remote service center and the computing performance of the first client satisfies a first computing performance condition, and the first client is configured to intercept the first task request in a case that it is determined to include the first task identifier in the first task list, and send a download request to the remote service center based on the code download address associated with the first task identifier in the first task list; a code obtaining module configured to obtain a first code corresponding to the download request based on the code download address in the download request in response to the download request from the first client; a code sending module configured to send the first code to the first client, wherein the first code is used by the first client to execute a computing task corresponding to the first task request to obtain a computing task result corresponding to the first task request.

31. The apparatus of claim 30, further comprising: a task request receiving module configured to determine a second client in a task machine pool in response to a first task request from a first client, wherein the first task request is sent to the remote service center in a case that the computing performance of the first client does not satisfy the first computing performance condition; a second request sending module configured to send the first task request to the second client, wherein the second client is configured to determine a first code corresponding to the first task request in the second client based on the first task identifier in the first task request, and execute the computing task corresponding to the first task request based on the first code, and return the computing task result corresponding to the first task request to the remote service center; a task result sending module configured to return the computing task result corresponding to the first task request to the first client in a case that the computing task result corresponding to the first task request from the second client is received.

32. The apparatus of claim 30 or 31, further comprising: an abstract comparison module, configured to, in response to receiving first task abstract information from the first client, compare the first task abstract information with second task abstract information in a second task list in the remote service center; a second list sending module, configured to, in response to the first task abstract information being different from the second task abstract information, send the second task list to the first client, wherein the second task list is used to update the first task list in the first client.

33. The apparatus of claim 32, further comprising: a second device joining module, configured to, in response to a task machine pool joining request from the first client, add the first client to the task machine pool; wherein the task machine pool joining request is a request sent by the first client to the remote service center in response to receiving the first task list from the remote service center and determining that the computing performance of the first client meets a second computing performance condition.

34. The apparatus of claim 33, further comprising a second polling module, configured to perform one of: in response to receiving a polling signal from the first client within a preset time, maintaining the first client in the task machine pool; and in response to not receiving a polling signal from the first client within the preset time, deleting the first client from the task machine pool.

35. An electronic device, comprising: at least one central processing unit; and a memory in communication connection with the at least one central processing unit; wherein the memory stores instructions executable by the at least one central processing unit, and the instructions are executed by the at least one central processing unit to enable the at least one central processing unit to perform the method of any one of claims 1-17.

36. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-17.

37. A computer program product, comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any one of claims 1-17.

Citation Information

Patent Citations

  • Service quality monitoring method, server side, client and system

    CN104683473A

  • Computing task processing method and device, computer equipment and storage medium

    CN110704177A