Task processing method and device, electronic equipment and storage medium
By judging the task list in the client and downloading code to execute calculation tasks, the problem of remote server processing capabilities affecting the inefficiency of client tasks is solved, and localized processing and data security are improved.
Patent Information
- Application Number
- CN202411018542.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-26
AI Technical Summary
In the technical environment with strong computing power of remote servers, the processing of the computing task of the client is affected by the network data transmission capability and the processing capability of the remote server, resulting in low efficiency of computing tasks and insufficient data security.
In the client, determine whether the task list contains a task identity, and intercept the task request based on the identity, download the corresponding code, so as to perform calculation tasks on the client and avoid handing over task processing to the remote server.
The localization of remote services is realized, which reduces the load of remote service centers, avoids network delays, and improves data security.
Smart Images

Figure CN119011566A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of task processing and cloud computing. The present disclosure specifically relates to a task processing method, device, electronic device and storage medium. Background Art
[0002] In some technologies, since the computing power of the 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 the HTTP protocol. Therefore, the data transmission capacity of the network and the processing power of the remote server will have a certain impact on these computing tasks. Summary of the invention
[0003] The present disclosure provides a task processing method, device, electronic device and storage medium.
[0004] According to one aspect of the present disclosure, a task processing method is provided, which is applied to a first client and includes:
[0005] In the case of preparing to send a first task request to a remote service center, determining whether the first task list includes the first task identifier in the first task request;
[0006] In a case where the first task list includes the first task identifier, intercepting the first task request, and downloading the 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;
[0007] 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.
[0008] According to another aspect of the present disclosure, there is provided a task processing method, which is applied to a remote service center, comprising:
[0009] 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 for the first client to determine whether to include a first task identifier in the first task request when preparing to send the first task request to the remote service center, and the first client is used to intercept the first task request when determining that the first task list includes the first task identifier, 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, acquiring the corresponding first code based on the code download address in the download request;
[0011] Sending the first code to the first client, wherein the first code is used by the first client to execute the computing task corresponding to the first task request to obtain the computing task result corresponding to the first task request
[0012] According to another aspect of the present disclosure, there is provided a task processing device, applied to a first client, comprising:
[0013] an identification judgment module, used for determining whether the first task list includes the first task identification in the first task request when preparing to send the first task request to the remote service center;
[0014] a code download module, configured to intercept the first task request when the first task identifier is included in the first task list, and download the 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;
[0015] A task execution module is used to execute 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.
[0016] According to another aspect of the present disclosure, there is provided a task processing device, which is applied to a remote service center, comprising:
[0017] A first list sending module is used to send a first task list to the first client in response to a task list download request from the first client, wherein the first task list is used for the first client to determine whether to include a first task identifier in the first task request when preparing to send the first task request to the remote service center, and the first client is used to intercept the first task request when determining that the first task list includes the first task identifier, 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;
[0018] A code acquisition module, configured to respond to the download request from the first client and acquire the corresponding first code based on the code download address in the download request;
[0019] A code sending module is used to send the first code to the first client, wherein the first code is used by the first client to execute the computing task corresponding to the first task request to obtain the computing task result corresponding to the first task request.
[0020] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0021] at least one central processing unit; and
[0022] A memory in communication with the at least one central processing unit; wherein,
[0023] The memory stores instructions that can be executed by the at least one central processing unit, and the instructions are executed by the at least one central processing unit so that the at least one central processing unit can execute any task processing method 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 execute any task processing method in the embodiments of the present disclosure.
[0025] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any task processing method according to the embodiments of the present disclosure when executed by a processor.
[0026] According to the technology disclosed in the present invention, when preparing to send a first task request to a remote service center, determine whether the first task list includes the first task identifier in the first task request; when the first task identifier is included in the first task list, intercept the first task request, and based on the code download address associated with the first task identifier in the first task list, download the corresponding first code from the remote service center; based on the first code, execute the computing task corresponding to the first task request to obtain the computing task result corresponding to the first task request. In this way, remote service localization can be achieved in the client, and the remote service center does not need to process the computing task, which can reduce the load of the remote service center, avoid network delays, and improve data security.
[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0029] Figure 1 is a flowchart of a task processing method according to an embodiment of the present disclosure;
[0030] Figure 2 is a flowchart of a task processing system according to 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 startup device according to an embodiment of the present disclosure;
[0033] Figure 5 is a structural block diagram of an application startup device according to another embodiment of the present disclosure;
[0034] Figure 6 is a structural block diagram of an application startup device according to another embodiment of the present disclosure;
[0035] Figure 7 is a structural block diagram of an application startup 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] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0038] In order to facilitate understanding of the task processing method provided by the embodiment of the present disclosure, the related technologies of the embodiment of the present disclosure are explained below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiment of the present disclosure as optional solutions, and they all belong to the protection scope of the embodiment of the present disclosure.
[0039] Figure 1 : is a flowchart of a task processing method of an embodiment of the present disclosure. The method can be applied to an electronic device. The electronic device is, for example, a terminal, a tasker or other processing device, wherein the terminal can be a user equipment (UE) such as 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 implement the task processing method of an embodiment of the present disclosure by calling a computer-readable instruction stored in a memory by a central processing unit.
[0040] like Figure 1 As shown, the method can be applied to a first client, comprising the following steps:
[0041] S110, when preparing to send a first task request to a remote service center, determining whether the first task list includes a first task identifier in the first task request;
[0042] S120, when the first task list includes the first task identifier, intercepting the first task request, and downloading the 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;
[0043] S130, executing 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.
[0044] It can be understood that the first client runs in an electronic device, and the first client can be any application or browser, etc.
[0045] Exemplarily, the first task request may be a task request triggered or output by a user and received by the first client in a user interface. For example, the first task request may be packaged into an HTTP interface request.
[0046] Exemplarily, the first task request may include a task identifier to be executed, such as a service interface API (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 multiple task identifiers, total summary information generated based on the codes corresponding to each task identifier, and the code download address corresponding to each task identifier. Alternatively, the first task list also includes summary information corresponding to each code. For example, these summary information can be MD5 (Message-Digest Algorithm, summary 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, but retaining the request in the first client.
[0049] It is understandable that the computing tasks corresponding to these task identifiers can be executed locally in the client, and do not need to be executed in the remote service center. The remote service center sends the code corresponding to each computing task to the corresponding client.
[0050] Exemplarily, the first task list may also include one or more preload identifiers associated with the task identifiers. When the first client obtains the first task list, it pre-downloads the corresponding code based on the code download address associated with the task identifier associated with the preload identifier in the first task list, and stores it in the first client.
[0051] It can be understood that if the code corresponding to the first task identifier exists in the first client, and the update time of the code exceeds the preset time from the current time, the above S120 is executed to compare the downloaded first code with the third code corresponding to the first task identifier in the first client. If they are not the same, the above step S130 is executed with the downloaded first code, and the third code corresponding to the first task identifier in the first client is replaced.
[0052] Exemplarily, if the first client has a third code corresponding to the first task identifier, and the update time of the code is within a preset time from the current time, it is not necessary to download the corresponding code, and the third code is used as the first code, and the above step S130 is executed.
[0053] Exemplarily, the first client may embed a service engine for executing codes.
[0054] Exemplarily, in the above step S130, the first client calls the service engine, and 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 may start the service engine in advance, or start the service engine when it needs to be called or when preparing to send the first task request, and shut down the service engine after executing the computing task and returning the computing task result to the first client.
[0056] Exemplarily, the startup mode of the service engine is determined according to the computing performance of the first client. The startup mode may be the above 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 needs to call the service engine or when preparing to send the first task request, and shuts down 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 may start the service engine in advance.
[0057] Exemplarily, the service engine runs the first code and processes relevant data involved in the first task request, thereby executing the computing task corresponding to the first task request and obtaining the computing task result corresponding to the first task request.
[0058] It can be understood that the relevant data is context data involved in executing the computing task corresponding to the first task request.
[0059] Exemplarily, the functions of the service engine are integrated in the client, and the client directly executes the first code and processes the relevant data involved in the first task request, thereby implementing the execution of the computing task corresponding to the first task request.
[0060] In one example, when the application is preparing 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 matching the http interface request in the task list, the http interface request is intercepted. Then, when the service engine is started, the code snippet corresponding to the computing service API interface corresponding to the http interface request is downloaded from the remote service center.
[0061] When the code snippet is downloaded, the code snippet is compared with the summary information of the corresponding API interface in the task list. When it is determined that the two are matched, the code snippet is executed in the service engine.
[0062] The above code snippets can also be downloaded in advance. For example, the corresponding code snippets are downloaded according to the code download addresses associated with each API interface with a preload mark in the task list. Thus, the possibility of interception of code snippet downloads and the increase in the total time consumption of task processing can be reduced.
[0063] In some examples, the code can be resident in the memory corresponding to the first client or temporarily run in the content corresponding to the first client. If the code is resident in the memory, no initialization is required except for the first run. Moreover, the resources of the computing service will not be recycled after the computing service is called, which is suitable for high-frequency and high-priority computing job types. For temporary types, the code of the computing service must be initialized each time the computing service is executed, and the business needs to recycle the resources of the computing service after the execution is completed.
[0064] For example, when the service engine is in a state of being always started, that is, in a hot start state, the type of the code running can be either a resident type or a temporary type. For another example, when the service engine does not need to be shut down when it needs to be started, that is, in a cold start state, the type of the code running can be a temporary type.
[0065] According to the above implementation, a service engine is embedded in the client. When an 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 so, 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. Remote service localization can be achieved in the client, and the remote service center does not need to process the computing tasks, which can reduce the load of the remote service center, avoid network delays, and improve data security.
[0066] In one implementation, determining whether the first task list includes the first task identifier in the first task request includes:
[0067] When the computing performance of the first client satisfies the first computing performance condition, it is determined whether the first task list includes the first task identifier in the first task request.
[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 value or multiple performance parameters, and the first computing performance condition can be a value range or a value range of multiple performance parameters.
[0069] It can be understood that when the computing performance of the first client is good, the above steps S110 to S130 are performed.
[0070] According to the above implementation, the computing task corresponding to the first task request is executed only when the computing performance of the first client meets the preset performance requirements, thereby ensuring the completion efficiency and quality of the computing task.
[0071] In one embodiment, the above method may also include: when the computing performance of the first client does not meet the first computing performance condition, sending a first task request to a 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, and based on the first code, execute the computing task corresponding to the first task request, and return the computing task result corresponding to the first task request to the remote service center, 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; receive 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 is understandable that the relevant data to be calculated may be carried when the first task request is sent. For example, the relevant data may be packaged in the first task request, so that when the remote service center forwards it to the second client, the second client may use the first code to perform 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 computing task results corresponding to the first task request returned by each second client, and can select one result from them to return to the first client. For example, the computing task result first returned to the remote service center is returned to the first client.
[0075] Exemplarily, one or more second clients are determined in 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 client joins the task machine pool, the greater the probability that it is selected as the second client.
[0076] For 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 a task request from the remote service center, it does not need to download the code, but can directly use the local code to run and execute the corresponding computing task. Of course, these codes also need to be updated regularly.
[0077] In some examples, if the first code does not exist locally on the second client, the code may be downloaded from a remote service center, and then the computing task corresponding to the first task request is executed based on the first code.
[0078] In some examples, if the first code exists in the second client, but the time between the last update time of the first code and the current time exceeds the set time, the first code is downloaded from the remote service center, and then the computing task corresponding to the first task request is executed based on the first code. The first code stored in the second client is updated with the downloaded first code to update the update time of the first code.
[0079] In low-end models, due to the limitations of hardware support and operating efficiency, there may still be problems such as application freezes and poor operating efficiency when performing computing 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 for performing computing tasks. Since the device where the application is located is a low-performance device, it is difficult to perform computing tasks well due to this limitation. Therefore, this example can solve this problem.
[0080] In actual applications, when the application program in a low-end device with poor hardware performance can only perform computing tasks to a limited extent, the data or parameters (context content) required for the computing task can be packaged into an object, such as the above-mentioned task request. Then, the object is sent to the remote service center. After receiving the task request object sent by the low-end device, the remote service center will publish the object to the 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 processing of the high-end device in the machine pool times out, resulting in the high-end device in the machine pool being unable to assist the low-end device in performing the computing task, the remote service center notifies the low-end device that the assistance task of the remote service center is unavailable, so that the low-end device performs the computing task in the local service engine.
[0081] When an application is started in a high-end device with good hardware performance, if the hardware computing resources are sufficient, it will try to join the machine pool of the remote task center to assist the low-end device in processing computing tasks. The high-end device can use the polling mechanism to notify the task center that the device can currently be used to assist the low-end device in performing computing tasks. In addition, as the polling time increases, the assistance weight of the device is gradually reduced, and high-end devices that joined the machine pool earlier are given priority to assist low-end devices in processing computing tasks. When the task center obtains computing resources from the machine pool, in order to prevent unexpected interruptions to the high-end device that receives the assistance task, it can send assistance task requests, that is, context content, to multiple high-end devices at the same time, and then the remote service center selects the result returned by the high-end device that completes the calculation the fastest and returns it to the low-end device. In this way, a task collection model is realized in which low-end machines publish tasks and high-end devices assist in processing tasks.
[0082] Among them, the high-end devices in the task collection model are used to assist in processing computing tasks received from the remote service center. These computing tasks are not limited to computing requests sent from low-end devices, but can also include any other types of computing tasks. Because the high-end devices in the task collection model are only responsible for receiving computing tasks from the remote service center and do not care about the source of the computing tasks. After the high-end device completes the computing task, it returns the calculation result to the remote service center, and the remote service center then transmits the calculation result to the source of the request to process the computing task. Therefore, the source can be a low-end device or other device. This model can make full use of the computing resources of each client, thereby improving computing efficiency and reducing computing costs.
[0083] This example can form a task collection model, where the client in the high-end device with better hardware performance assists the client in the low-end device to perform computing tasks. Therefore, even in the absence of remote services, the application in the low-end device can still implement localized computing of remote services, that is, use the application in the high-end device to perform computing tasks. Moreover, this can improve the efficiency of task computing and reduce the cost of task computing.
[0084] In some embodiments, the above method also includes: sending first task summary information in the first task list to a remote service center, wherein the first task summary information is used to return the second task list to the first client when the first task summary information is different from the second task summary information in the 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 the task identifier (interface signature information or interface name) of each computing task (service interface API), the total MD5 digest information generated by combining the codes of each service interface after sorting, each MD5 digest information generated by the code of each service interface, and the code download address of each service interface. In addition, some service interfaces also carry preload identifiers.
[0086] For example, the first client can update the first task list according to this example regularly, or when the first client is started, or when preparing to send the first task request to the remote service center, update the first task list according to this example.
[0087] It can be understood that the first task summary information may be MD5 summary information generated by the remote service center based on the code corresponding to each task identifier in the first task list and the sorting position of each task identifier in the list.
[0088] It can be understood that the second task summary information may be MD5 summary information generated by the remote service center based on the code corresponding to each task identifier in the second task list and the sorting position of each task identifier in the list.
[0089] It is understandable that the second task list stored by the remote service center may be updated according to actual needs, for example, the task identifiers included therein may be added or deleted, or the code download address corresponding to a certain task identifier may be changed. Alternatively, the codes corresponding to each task identifier may be updated, and the versions of the codes corresponding to each task identifier may be recorded in the task list, and the version information may be used to indicate whether the code has been updated.
[0090] In some examples, when the second task list is updated, the remote service center directly sends the updated second task list to each client, and each client updates the first task list based on the received second task list.
[0091] In some examples, for a task identifier carrying a preload identifier in the updated first task list, check 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 they are not the same, it is necessary to download the code from the remote service center and update the local code. If they are the same, no processing is required.
[0092] Exemplarily, when the application is not started for the first time, the total MD5 summary information of the first task list is spliced into the specified interface parameters, and the interface parameters are sent to the remote service center. If the remote service center determines that the total MD5 summary content information in the parameter is the same as the total MD5 summary content information in the second task list in the remote service center, the remote service center returns a message notifying the application in the client that there is no need to change the task list, 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 summary content information in the parameter is different from the total MD5 summary content information in the second task list in the remote service center, it means that the service interface or related information of the interface in the list has been updated, and the second task list is returned to the client. The application in the client updates the first task list when receiving the second task list.
[0093] According to the above implementation, the summary information of the two lists stored by the remote service center on the client and the remote service center is compared. If they are different, the list stored in the remote service center is used to update the list in the client. The client can then accurately download the latest code when performing computing tasks.
[0094] In some embodiments, the above method may further include: when 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 actual applications, the remote service center is used to return a list of service APIs to each client, i.e., the above-mentioned task list. When the application is first used, the client obtains a list of all service APIs from the remote service center in the form of an access request. The list includes the total MD5 summary information generated by sorting all service APIs by ASCII as of the time of download, the interface name of the service API, the corresponding interface code download address and the MD5 summary information generated according to the interface code of the service API, and an indicator of whether the interface code needs to be preloaded.
[0096] According to the above implementation, the client needs to download a task list from the remote service center when it is started for the first time. In this way, when the client needs to execute 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 execute the computing task.
[0097] In one embodiment, the above method may also include: upon receiving a first task list from a remote service center, determining whether the computing performance of the first client meets a second computing performance condition; if the computing performance of the first client meets 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 is understandable that the first computing performance condition may be the same as or different from the second computing performance condition. These computing performance conditions may include parameters such as the hardware operating speed range of the device where the client is located.
[0099] In some examples, when the first client is started, it can also be determined whether the computing performance of the first client meets the second computing performance condition; if the computing performance of the first client meets the second computing performance condition, a task machine pool joining request is sent to the remote service center.
[0100] It can be understood that the identifier 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 implementation, when an application 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 the low-end device in processing the computing task. Thereby, the efficiency of task computing is improved and the cost of task computing is reduced.
[0102] High-end devices can use a polling mechanism to notify the task center that the device can currently be used to assist low-end devices in performing computing tasks. In addition, as the polling duration increases, the assistance weight of the device is gradually reduced, and high-end devices that joined the machine pool earlier are given priority to assist low-end devices in processing computing tasks. When the task center obtains computing resources from the machine pool, in order to prevent unexpected interruptions to high-end devices that receive assistance tasks, requests for assistance tasks, that is, context content, can be sent to multiple high-end devices at the same time, and then the remote service center selects the result returned by the high-end device that completes the calculation the fastest and returns it to the low-end device. In this way, a task collection model is implemented in which low-end machines publish tasks and high-end devices assist in processing tasks.
[0103] In one embodiment, the above method may further include: when it is determined that the first client is added to the task machine pool, based on the polling interval, sending a polling signal to the remote service center, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.
[0104] It can be understood that when the remote service center has added the first client to the task machine pool, it can notify the first client. When the first client receives the notification, it determines that the first client has been added to the task machine pool.
[0105] Exemplarily, the first client sends a polling signal to the remote service center at intervals. The intervals may be fixed or variable. That is, the polling interval may be a fixed or variable time.
[0106] For example, the last used polling interval is different from the currently used polling interval. Or, the currently used polling interval is longer than the last used polling interval.
[0107] In this way, the remote service center can gradually reduce the assistance weight of the device as the polling time increases, and give priority to using high-end devices that joined the machine pool earlier to assist low-end devices in processing computing tasks.
[0108] According to the above implementation, a device or client with relatively high performance can use a polling mechanism to notify the remote service center. Currently, the device can be used to assist a device or client with relatively low performance to perform computing tasks.
[0109] In one embodiment, the above method may also include: updating the polling interval based on a preset time update frequency so that the updated polling interval is longer than the polling interval before the update; when the updated polling interval is longer than the preset time threshold, stopping sending the polling signal to the remote service center, wherein the remote service center is used to delete the first client from the task machine pool if the polling signal from the first client is not received within a preset time.
[0110] It can be understood that the polling interval is periodically extended at certain time intervals.
[0111] It is understandable that the first client can determine the time to send the polling signal this time according to the polling interval and the time when the polling signal was sent last time, and then send the polling signal to the remote service center based on the time when the polling signal was sent this time.
[0112] It can be understood that if the polling interval 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] At the same time, the remote service center also monitors the reception time of the polling signal. If the polling signal from the first client is not received within the preset time, the first client is deleted from the task machine pool.
[0114] It can be understood that deleting the identifier of the first client in the task machine pool means deleting the first client in the task machine pool.
[0115] It can be understood that a task machine pool is a collection of client identifiers.
[0116] According to the above implementation, the polling interval is extended at a certain time interval, and when the polling interval exceeds the set length, the polling signal is no longer sent, so that the remote service center deletes it from the task machine pool. In this way, the client that joined the task machine pool earlier can be deleted to provide space for the client that joins the task machine pool the latest.
[0117] In one embodiment, the above method may also include: when determining that the first client is added to the task machine pool, downloading the code corresponding to each task identifier from the remote service center based on the code download address associated with each task identifier in the first task list; and storing the code corresponding to each task identifier in the first client.
[0118] In this 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 a task request from the remote service center, it does not need to download the code, but can directly use the local code to run and execute the corresponding computing task, thereby improving the efficiency of task computing.
[0119] In one embodiment, the above method may also include: upon receiving a second task request from a remote service center, determining a corresponding second code in the first client based on a second task identifier in the second task request; based on the second code, executing a computing task corresponding to the second task request to obtain a 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 when the first client joins the task machine pool, it can assist other clients in performing computing tasks.
[0121] It can be understood that the second task request can be understood as a request for assistance in the computing task. The content included in the second task request can be similar to the first task request, and the details can be referred to the introduction of the first task request, which will not be described in detail here.
[0122] It can be understood that the second task request carries relevant data required to execute 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 after joining the task machine pool, when the first client receives the second task request, it does not need to spend time downloading the code, but can directly use the locally downloaded code to execute the computing task corresponding to the second task request, thereby improving the efficiency of task processing.
[0124] According to the above implementation, when the first client joins the task machine pool, it can receive the second task request forwarded from the remote service center, so as to assist the remote service center in executing the computing task and realize the localization of remote services.
[0125] In one embodiment, the above method also includes: when the first client is started for the first time, determining whether the computing performance of the first client meets the third computing performance condition; when the computing performance of the first client meets the third computing performance condition, starting the service engine, wherein the service engine is used to execute the above computing task.
[0126] For example, for the first client, there are multiple types, such as Android, IOS, and Windows, etc. For different types of clients, different types of service engines can be selected. For example, JavaScriptCore is used as the service engine in the IOS client. Quickjs is used as the service engine in the Android and Windows clients. The browser uses the quickjs container packaged by webAssembly technology as the service engine, or uses the built-in service worker as the service engine.
[0127] Exemplarily, two or more service engines may be used in the same client, so that multiple computing tasks can be executed simultaneously.
[0128] It can be understood that the computing performance of the first client can be determined according to the hardware support level and operating efficiency of the electronic device where it is located, and the third computing performance condition can be a hardware support level range and an operating efficiency range, or a range value determined based on these two ranges.
[0129] It is understandable that when an application is started, the computing performance of the application, such as low-end performance and high-end performance, is determined according to the hardware support and operating efficiency of the electronic device where it is located. For applications running on high-performance electronic devices, the service engine is started first within the first time after the startup is completed to support the execution of computing services in the first time. In this way, when faced with the execution requirements of computing services, logical calculations can be performed immediately without waiting for the service engine to start. This is called hot start.
[0130] According to the above implementation, when the client is started for the first time, if the performance of the client meets the requirements, the service engine is started directly. Subsequently, when a request is made to execute a computing task, the service engine can be called to execute the computing task without starting the service engine, thereby improving the efficiency of task calculation.
[0131] In one embodiment, the above method may also include: when the computing performance of the first client does not meet the third computing performance condition, determining whether to prepare to send a first task request to the remote service center; when it is determined that the first task request is to be sent to the remote service center, starting the service engine.
[0132] It is understandable that after starting the service engine, 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 may or may not shut down the service engine.
[0133] It is understandable that for applications running on low-end performance electronic devices, due to the limitations of hardware equipment and operating efficiency, forcibly starting the service engine during the period after the application is started and before the main business logic is executed may cause various applications in the device to freeze, freeze, or perform poorly, seriously affecting the user experience.
[0134] According to the above implementation, the service engine can be started when the computing task request is received. After the service engine is started, the logical processing operation of the computing task is executed. In this way, the operating efficiency of the device where the client is located can be improved.
[0135] In one implementation, the method further includes: when obtaining the computing task result provided by the service engine, shutting down the service engine.
[0136] It can be understood that, following the previous example, after the logical processing operation of the computing task is completed, the service engine is shut down again, and the above operation is repeated again until the next computing task request is received. This is called a cold start.
[0137] According to the above implementation, compared with hot start, cold start will increase the overall latency of task calculation, but on low-end models, localization of remote services can still be achieved without affecting user experience.
[0138] In practical applications, any of the above implementations can deploy the remote HTTP service to the user's local application, which is suitable for fields or scenarios that require fast data processing and high response speed, and is also widely applicable to various scenarios that require remote servers to process requests, such as mobile applications, Web applications, etc. Taking mobile applications 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, reducing the interaction with the remote server, thereby improving the response speed of task calculations and user experience. At the same time, since the relevant data involved in executing computing tasks 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 It is a structural block diagram of a task processing system according to an embodiment of the present disclosure.
[0140] like Figure 2 As shown, the task processing system may include a computing task management center and multiple user terminal devices, that is, multiple clients. The computing task computing management center includes a machine pool, a remote service center and a storage OSS system.
[0141] 1. User device, i.e. client (application):
[0142] Provide corresponding types of service engines for different types of clients. The service engine provides basic IO, computing and network processing capabilities, as well as the ability to dynamically execute code.
[0143] The service engine is built into the client application, and a module is provided in the client application with unified, standardized and normalized computing request sending and interception capabilities.
[0144] When the application is started, the application evaluates the computing power of the hardware device where the current client is located. If the computing power of the device meets the preset conditions, the device is judged to be a high-end device, and a request is sent to the task computing management center to add the device to the machine pool of the remote service center. In order for the machine pool to obtain the online status 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 from other devices at any time.
[0145] When the application receives a calculation request sent by the user, it will perform different calculation processing actions according to the device type information that has been determined when the application is started.
[0146] For applications running on high-end devices, they directly process computing requests and return the calculation results to the user after the calculation is completed, thus completing the execution of the computing task.
[0147] For applications running on low-end devices, the computing request is context-wrapped and then sent to the remote service agent in the remote task computing management center. The remote service agent uses the screening strategy in the task collection model from the machine pool to select several user devices, and then sends the computing request and context content to these devices. In order to ensure the integrity and accuracy of the calculation, a redundant strategy is adopted to send the computing request and context content to multiple devices. In addition, the remote service agent returns the first returned calculation result to the upstream low-end device that requested assistance in processing, and the subsequent returned calculation results will be discarded. After receiving the calculation result, the low-end device will pass the calculation result to the user, thereby completing the execution of the computing task.
[0148] 2. Mission Computing Management Center:
[0149] The software service provider, that is, the service provider of the client application, splits the logical segments of different computing tasks into different code blocks. The code block contains the code logic and dependent resources required for the computing task. Each code block of each computing task has corresponding interface signature information. The specific code segment can be found through these interface signature information. After the service provider packages, obfuscates, and compresses the code block resources, it publishes these code blocks to OSS (Object Storage Service) with the help of continuous integration or other deployment methods. The applications in these clients can obtain and download the code block resources required for calculation from OSS.
[0150] In addition, the service provider also provides a remote service agent. As the core functional module of the entire task system center, the remote service agent is responsible for processing the computing task list and collecting and distributing the task collection model. When the application on the client side starts, it can request the remote service agent service to obtain the latest computing task list (manifest) as of the startup. According to the task list, it is determined whether it is necessary to download or update certain code block resources that have been downloaded to the application. The task list contains the latest timestamp, the MD5 summary information of the entire task list, and the task list information (including the task signature information of each task, the md5 summary information of the task code block, and the download address of the task code block).
[0151] After the application obtains the computing task list, it can determine the hardware computing performance of the current device. If the performance indicator conditions corresponding to the high-performance device are met (the specific performance indicator conditions can be dynamically determined according to the specific business type and usage scenario), it will be added to the remote machine pool. The machine pool service is used to handle the task collection and distribution functions in the task collection model. Devices added to the machine pool can use the polling mechanism to maintain the available status of the device in the machine pool, and the polling interval on the device side can be gradually extended after a period of time. When the polling interval is extended to the duration of the exit threshold of the machine pool, the device can initiate a request to exit the machine pool, thereby exiting the machine pool and no longer accepting assistance in processing 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. Gradually delete devices that have been waiting for too long in the machine pool, and add new devices, so as to ensure that the devices in the machine pool are relatively new.
[0152] In the above example, the client-side application mainly includes functions such as starting the application, sending computing requests, task processing, and updating expired code blocks. Through the core central processing unit module, the computing task is executed on the basic module structure of the computing code block when the JavaScript engine is running. Among them, the central processing unit will also complete the overall interaction with the computing task scheduling system through requests. The system completes the comprehensive management and scheduling functions among computing, tasks, and devices.
[0153] The above example eliminates the impact of traditional remote service centralized processing request tasks, and uses the computing power provided by the client-side devices to minimize the hardware and bandwidth costs on the business side, thereby improving the execution efficiency of task computing.
[0154] Figure 3 is a flowchart of a task processing method according to another embodiment of the present disclosure.
[0155] like Figure 3 As shown, the task processing method is applied to a remote service center and includes:
[0156] S310, 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 to include a first task identifier in the first task request when preparing to send the first task request to the remote service center, and the first client is used to intercept the first task request when determining that the first task list includes the first task identifier, 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;
[0157] S320, in response to the download request from the first client, acquiring a corresponding first code based on a code download address in the download request;
[0158] S330: Send the first code to the first client, wherein the first code is used by the first client to execute the computing task corresponding to the first task request to obtain the computing 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 may interact with a memory, in which a plurality of code blocks corresponding to the computing tasks are stored. Based on the code download address, a storage address in the memory may be determined, and then based on the storage address, the corresponding first code may be obtained from the memory.
[0161] Exemplarily, the operation performed on the first client is the same as the aforementioned task processing method applied to the first client, and is not described in detail here.
[0162] According to the above implementation, when an application initiates a task computing request, it is determined whether the task identifier corresponding to the request is recorded in the computing task list. If so, 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. Remote service localization can be achieved in the client, and the remote service center does not need to process the computing task, which can reduce the load of the remote service center, avoid network delays, and improve data security.
[0163] In one embodiment, the above method may further include:
[0164] In response to a first task request from a first client, determining a second client in the task machine pool, wherein the first task request is sent to the remote service center when the computing performance of the first client does not meet a first computing performance condition;
[0165] sending the first task request 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 identifier in the first task request, and based on the first code, execute the computing task corresponding to the first task request, and return the computing task result corresponding to the first task request to the remote service center;
[0166] Upon receiving the computing task result corresponding to the first task request from the second client, the computing task result corresponding to the first task request is returned to the first client.
[0167] It can be understood that the method executed by the first client and the second client here is the same as the task processing method applied to the first client in the above example, and will not be described in detail here.
[0168] According to the above implementation, the client in the high-end device with better hardware performance assists the client in the low-end device to perform computing tasks, so that even in the absence of remote services, the application in the low-end device can still implement localized computing of remote services, that is, using the application in the high-end device to perform computing tasks. Moreover, this can improve the efficiency of task computing and reduce the cost of task computing.
[0169] In one embodiment, the above method may also include: upon receiving 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; when 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.
[0170] According to the above implementation, the summary information of the two lists stored by the remote service center on the client and the remote service center is compared. If they are different, the list stored in the remote service center is used to update the list in the client. The client can then accurately download the latest code when performing computing tasks.
[0171] In one embodiment, the above method may also include: 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 after receiving the first task list from the remote service center and determining that the computing performance of the first client meets the second computing performance condition.
[0172] According to the above implementation, when an application in a high-end device with good hardware performance 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 the low-end device in processing the computing task. Thus, the efficiency of task computing is improved and the cost of task computing is reduced.
[0173] In one embodiment, the above method may further include one of the following:
[0174] When a polling signal is received from the first client within a preset time, maintaining the first client in the task machine pool;
[0175] If no polling signal is received from the first client within the preset time, the first client is deleted from the task machine pool.
[0176] According to the above implementation, a device or client with relatively high performance can use a polling mechanism to notify the remote service center that the device can currently be used to assist a device or client with relatively low performance in performing computing tasks. In addition, the polling interval is extended at a certain time interval. When the polling interval exceeds the set length, the polling signal is no longer sent, so that the remote service center can delete it from the task machine pool. In this way, the client that joined the task machine pool earlier can be deleted to provide space for the client that has recently joined the task machine pool.
[0177] Figure 4 It is a structural block diagram of a task processing device according to an embodiment of the present disclosure.
[0178] like Figure 4 As shown, the task processing device, applied to the first client, includes:
[0179] The identification judgment module 410 is used to determine whether the first task list includes the first task identification in the first task request when preparing to send the first task request to the remote service center;
[0180] a code download module 420, configured to intercept the first task request when the first task identifier is included in the first task list, and download the 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;
[0181] The task execution module 430 is used to execute 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.
[0182] Figure 5 It is a structural block diagram of a task processing device according to another embodiment of the present disclosure.
[0183] like Figure 4 and Figure 5 As shown, Figure 5 The identification judgment module 510, the code download module 520 and the task execution module 530 in Figure 4 The identification determination module 410, the code download module 420 and the task execution module 430 have the same structure and function, which will not be described in detail here.
[0184] In one implementation, the identification determination module is specifically used to:
[0185] When the computing performance of the first client satisfies the first computing performance condition, it is determined whether the first task list includes the first task identifier in the first task request.
[0186] In one embodiment, Figure 5 As shown, the above device also includes:
[0187] A first request sending module 540 is used to send the first task request to the remote service center when 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 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, and based on the first code, execute the computing task corresponding to the first task request, 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 used to receive the computing task result corresponding to the first task request from the remote service center.
[0189] In one embodiment, Figure 5 As shown, the above device also includes a list updating module 560, which is used to:
[0190] Sending first task summary information in the first task list to the remote service center, wherein the first task summary information is used for, when the first task summary information is different from second task summary information in a second task list in the remote service center, the remote service center returns the second task list to the first client;
[0191] receiving the second task list from the remote service center;
[0192] Based on the second task list, the first task list is updated.
[0193] In one embodiment, Figure 5 As shown, the above device also includes a list downloading module 570, which is used to:
[0194] When 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;
[0195] receiving the first task list from the remote service center;
[0196] The first task list is stored in the first client.
[0197] In one embodiment, Figure 5As shown, the above apparatus further includes a first device adding module 580, which is used to:
[0198] Upon receiving the first task list from the remote service center, determining whether the computing performance of the first client satisfies a second computing performance condition;
[0199] When 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 one embodiment, Figure 5 As shown, the above device also includes a first polling module 590, which is used to:
[0201] When 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, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.
[0202] In one embodiment, Figure 5 As shown, the first polling module 590 is further used for:
[0203] Based on a preset time update frequency, the polling interval is updated so that the polling interval after the update is longer than the polling interval before the update;
[0204] When the updated polling interval is longer than a preset time threshold, stop sending the polling signal to the remote service center, wherein the remote service center is configured to delete the first client from the task machine pool if the polling signal from the first client is not received within a preset time.
[0205] In one embodiment, Figure 5 As shown, the code download module 520 is also used for:
[0206] When it is determined that the first client is added to the task machine pool, based on the code download address associated with each task identifier in the first task list, download the code corresponding to each task identifier from the remote service center;
[0207] The code corresponding to each of the task identifiers is stored in the first client.
[0208] In one embodiment, Figure 5 As shown, the task execution module 530 is also used for:
[0209] In case of receiving a second task request from the remote service center, determining a corresponding second code in the first client based on a second task identifier in the second task request;
[0210] Based on the second code, executing the computing task corresponding to the second task request to obtain the computing task result corresponding to the second task request;
[0211] The computing task result is returned to the remote service center.
[0212] In one embodiment, Figure 5 As shown, the above device also includes a hot start module 591, which is used to:
[0213] When the first client is started for the first time, determining whether the computing performance of the first client meets a third computing performance condition;
[0214] When the computing performance of the first client satisfies the third computing performance condition, a service engine is started, wherein the service engine is used to execute the computing task.
[0215] In one embodiment, Figure 5 As shown, the above device also includes a cold start module 592, which is used to:
[0216] In a case where the computing performance of the first client does not satisfy the third computing performance condition, determining whether to prepare to send the first task request to the remote service center;
[0217] When it is determined that the first task request is to be sent to the remote service center, the service engine is started.
[0218] In one embodiment, Figure 5 As shown, the cold start module 592 is also used for:
[0219] When the computing task result provided by the service engine is obtained, the service engine is closed.
[0220] Figure 6 It is a structural block diagram of a task processing device according to another embodiment of the present disclosure.
[0221] like Figure 6 As shown, the task processing device is applied to a remote service center and includes:
[0222] A first list sending module 610 is 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 used by the first client to determine whether to include a first task identifier in the first task request when preparing to send the first task request to the remote service center, and the first client is configured to intercept the first task request when determining that the first task list includes the first task identifier, 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] A code acquisition module 620, configured to respond to the download request from the first client and acquire the corresponding first code based on the code download address in the download request;
[0224] The code sending module 630 is used to send the first code to the first client, wherein the first code is used by the first client to execute the computing task corresponding to the first task request to obtain the computing task result corresponding to the first task request.
[0225] Figure 7 It is a structural block diagram of a task processing device according to another embodiment of the present disclosure.
[0226] like Figure 6 and Figure 7 As shown, Figure 7 The first list sending module 710, the code acquisition module 720 and the code sending module 730 are respectively connected to Figure 6 The structures and functions of the first list sending module 710, the code obtaining module 720 and the code sending module 730 are the same and will not be described in detail here.
[0227] In one embodiment, Figure 7 As shown, the device also includes:
[0228] The task request receiving module 740 is used to determine a second client in the 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 when the computing performance of the first client does not meet the first computing performance condition;
[0229] A second request sending module 750 is used to send the first task request 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 identifier in the first task request, and based on the first code, execute the computing task corresponding to the first task request, and return the computing task result corresponding to the first task request to the remote service center;
[0230] The task result sending module 760 is used to return the computing task result corresponding to the first task request to the first client upon receiving the computing task result corresponding to the first task request from the second client.
[0231] In one embodiment, Figure 7 As shown, the device also includes:
[0232] A summary comparison module 770, configured to compare the first task summary information with the second task summary information in the second task list in the remote service center when receiving the first task summary information from the first client;
[0233] The second list sending module 780 is used to send the second task list to the first client when the first task summary information is different from the second task summary information, wherein the second task list is used to update the first task list in the first client.
[0234] In one embodiment, Figure 7 As shown, the device also includes:
[0235] A second device adding module 790, configured to add the first client to the task machine pool in response to a task machine pool joining request from the first client;
[0236] 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 the second computing performance condition.
[0237] In one embodiment, Figure 7 As shown, the device also includes a second polling module, which is used for one of the following:
[0238] When a polling signal is received from the first client within a preset time, maintaining the first client in the task machine pool;
[0239] If no polling signal is received from the first client within the preset time, the first client is deleted from the task machine pool.
[0240] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0241] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0242] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product. The electronic device may be a tasker, and the tasker may also include any power supply control device in the embodiment of the present disclosure.
[0243] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, taskers, blade taskers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0244] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to 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. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0245] Multiple 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, speakers, etc.; a storage unit 808, such as a 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 may be a variety of general and / or special 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 dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a task processing method. For example, in some embodiments, a task processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps in a task processing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform a task processing method in any other appropriate manner (e.g., by means of firmware).
[0247] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0248] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or tasker.
[0249] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0250] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0251] The systems and techniques described herein can be implemented in a computing system that includes a backend component (e.g., as a data tasker), or a computing system that includes a middleware component (e.g., an application tasker), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by digital data communication (e.g., a communication network) of any form or medium. Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0252] The computer system may include a client and a tasker. The client and the tasker are generally remote from each other and usually interact through a communication network. The relationship between the client and the tasker is generated by computer programs running on corresponding computers and having a client-tasker relationship with each other. The tasker may be a cloud tasker, a distributed system tasker, or a tasker combined with a blockchain.
[0253] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0254] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the 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 the case of preparing to send a first task request to a remote service center, determining whether the first task list includes the first task identifier in the first task request; In a case where the first task list includes the first task identifier, intercepting the first task request, and downloading the 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, the computing task corresponding to the first task request is executed to obtain the computing task result corresponding to the first task request.
2. The method according to claim 1, wherein: The determining whether the first task list includes the first task identifier in the first task request includes: When the computing performance of the first client satisfies the first computing performance condition, it is determined whether the first task list includes the first task identifier in the first task request.
3. The method according to claim 2, further comprising: In the case where the computing performance of the first client does not meet the first computing performance condition, the first task request is sent 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, and based on the first code, execute the computing task corresponding to the first task request, 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; Receive a computing task result corresponding to the first task request from the remote service center.
4. The method according to any one of claims 1 to 3, 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 for, when the first task summary information is different from second task summary information in a second task list in the remote service center, the remote service center returns the second task list to the first client; receiving the second task list from the remote service center; Based on the second task list, the first task list is updated.
5. The method according to claim 4, further comprising: When 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; The first task list is stored in the first client.
6. The method according to claim 5, further comprising: Upon receiving the first task list from the remote service center, determining whether the computing performance of the first client satisfies a second computing performance condition; When 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.
7. The method according to claim 6, further comprising: When 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, wherein the polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.
8. The method according to claim 7, further comprising: Based on a preset time update frequency, the polling interval is updated so that the polling interval after the update is longer than the polling interval before the update; When the updated polling interval is longer than a preset time threshold, stop sending the polling signal to the remote service center, wherein the remote service center is configured to delete the first client from the task machine pool if the polling signal from the first client is not received within a preset time.
9. The method according to claim 8, further comprising: When it is determined that the first client is added to the task machine pool, based on the code download address associated with each task identifier in the first task list, download the code corresponding to each task identifier from the remote service center; The code corresponding to each of the task identifiers is stored in the first client.
10. The method according to claim 9, further comprising: In case of receiving a second task request from the remote service center, determining a corresponding second code in the first client based on a second task identifier in the second task request; Based on the second code, executing the computing task corresponding to the second task request to obtain the computing task result corresponding to the second task request; The computing task result is returned to the remote service center.
11. The method according to any one of claims 1 to 10, further comprising: When the first client is started for the first time, determining whether the computing performance of the first client meets a third computing performance condition; When the computing performance of the first client satisfies the third computing performance condition, a service engine is started, wherein the service engine is used to execute the computing task.
12. The method according to claim 11, further comprising: In a case where the computing performance of the first client does not satisfy the third computing performance condition, determining whether to prepare to send the first task request to the remote service center; When it is determined that the first task request is to be sent to the remote service center, the service engine is started.
13. The method according to claim 12, further comprising: When the computing task result provided by the service engine is obtained, the service engine is closed.
14. A task processing method, applied to a remote service center, comprising: 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 for the first client to determine whether to include a first task identifier in the first task request when preparing to send the first task request to the remote service center, and the first client is used to intercept the first task request when determining that the first task list includes the first task identifier, 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; In response to the download request from the first client, acquiring the corresponding first code based on the code download address in the download request; The first code is sent to the first client, wherein the first code is used by the first client to execute the computing task corresponding to the first task request to obtain the computing task result corresponding to the first task request.
15. The method according to claim 14, further comprising: In response to a first task request from a first client, determining a second client in the task machine pool, wherein the first task request is sent to the remote service center when the computing performance of the first client does not meet a first computing performance condition; sending the first task request 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 identifier in the first task request, and based on the first code, execute the computing task corresponding to the first task request, and return the computing task result corresponding to the first task request to the remote service center; Upon receiving the computing task result corresponding to the first task request from the second client, the computing task result corresponding to the first task request is returned to the first client.
16. The method according to claim 14 or 15, further comprising: Upon receiving the first task summary information from the first client, comparing the first task summary information with the second task summary information in the second task list in the remote service center; When the first task summary information is different from the second task summary information, the second task list is sent to the first client, wherein the second task list is used to update the first task list in the first client.
17. The method according to claim 16, 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 the second computing performance condition.
18. The method according to claim 17, further comprising one of the following: When a polling signal is received from the first client within a preset time, maintaining the first client in the task machine pool; If no polling signal is received from the first client within the preset time, the first client is deleted from the task machine pool.
19. A task processing device, applied to a first client, comprising: an identification judgment module, used for determining whether the first task list includes the first task identification in the first task request when preparing to send the first task request to the remote service center; a code download module, configured to intercept the first task request when the first task identifier is included in the first task list, and download the 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; A task execution module is used to execute 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.
20. The device according to claim 19, wherein The identification judgment module is specifically used for: When the computing performance of the first client satisfies the first computing performance condition, it is determined whether the first task list includes the first task identifier in the first task request.
21. The apparatus according to claim 20, further comprising: A first request sending module is used to send the first task request to the remote service center when 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 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, and based on the first code, execute the computing task corresponding to the first task request, 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; The task result receiving module is used to receive the computing task result corresponding to the first task request from the remote service center.
22. The apparatus according to any one of claims 19 to 21, further comprising a list updating module, configured to: Sending the first task summary information in the first task list to the remote service center, wherein: The first task summary information is used for, when the first task summary information is different from the second task summary information in the second task list in the remote service center, the remote service center returns the second task list to the first client; receiving the second task list from the remote service center; Based on the second task list, the first task list is updated.
23. The apparatus according to claim 22, further comprising a manifest download module, configured to: When 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; The first task list is stored in the first client.
24. The method according to claim 23, further comprising a first device joining module, configured to: Upon receiving the first task list from the remote service center, determining whether the computing performance of the first client satisfies a second computing performance condition; When 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.
25. The apparatus according to claim 24, further comprising a first polling module, configured to: When 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 the polling interval, wherein: The polling signal is used to instruct the remote service center to maintain the first client in the task machine pool.
26. The device according to claim 25, wherein The first polling module is also used for: Based on a preset time update frequency, the polling interval is updated so that the polling interval after the update is longer than the polling interval before the update; When the updated polling interval is longer than a preset time threshold, stop sending the polling signal to the remote service center, wherein the remote service center is configured to delete the first client from the task machine pool if the polling signal from the first client is not received within a preset time.
27. The device according to claim 26, wherein: The code download module is also used for: When it is determined that the first client is added to the task machine pool, based on the code download address associated with each task identifier in the first task list, download the code corresponding to each task identifier from the remote service center; The code corresponding to each of the task identifiers is stored in the first client.
28. The device according to claim 27, wherein The task execution module is also used for: In case of receiving a second task request from the remote service center, determining a corresponding second code in the first client based on a second task identifier in the second task request; Based on the second code, executing the computing task corresponding to the second task request to obtain the computing task result corresponding to the second task request; The computing task result is returned to the remote service center.
29. The device according to any one of claims 19 to 28, further comprising a hot start module, for: When the first client is started for the first time, determining whether the computing performance of the first client meets a third computing performance condition; When the computing performance of the first client satisfies the third computing performance condition, the service engine is started, wherein: The service engine is used to execute the computing task.
30. The apparatus according to claim 29, further comprising a cold start module, configured to: In a case where the computing performance of the first client does not satisfy the third computing performance condition, determining whether to prepare to send the first task request to the remote service center; When it is determined that the first task request is to be sent to the remote service center, the service engine is started.
31. The device according to claim 30, wherein The cold start module is also used for: When the computing task result provided by the service engine is obtained, the service engine is closed.
32. A task processing device, 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 used by the first client to determine whether to include a first task identifier in the first task request when preparing to send the first task request to the remote service center, and the first client is used to intercept the first task request when determining that the first task list includes the first task identifier, 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; A code acquisition module, configured to respond to the download request from the first client and acquire the corresponding first code based on the code download address in the download request; A code sending module is used to send the first code to the first client, wherein the first code is used by the first client to execute the computing task corresponding to the first task request to obtain the computing task result corresponding to the first task request.
33. The apparatus of claim 32, further comprising: a task request receiving module, configured to determine a second client in the 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 when the computing performance of the first client does not meet a 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 the 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; The task result sending module is used to return the computing task result corresponding to the first task request to the first client upon receiving the computing task result corresponding to the first task request from the second client.
34. The apparatus according to claim 32 or 33, further comprising: a summary comparison module, configured to compare the first task summary information with the second task summary information in the second task list in the remote service center when receiving the first task summary information from the first client; The second list sending module is used to send the second task list to the first client when the first task summary information is different from the second task summary information, wherein the second task list is used to update the first task list in the first client.
35. The apparatus of claim 34, further comprising: A second device adding module, configured to add the first client to the task machine pool in response to a task machine pool joining request from the first client; 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 the second computing performance condition.
36. The apparatus of claim 35, further comprising a second polling module configured to: When a polling signal is received from the first client within a preset time, maintaining the first client in the task machine pool; If no polling signal is received from the first client within the preset time, the first client is deleted from the task machine pool.
37. An electronic device comprising: at least one central processing unit; as well as A memory in communication with the at least one central processing unit; wherein, 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 the method according to any one of claims 1 to 18.
38. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-18.
39. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 18.
Citation Information
Patent Citations
Service quality monitoring method, server side, client and system
CN104683473A
Task execution method, device and system
CN107508787A
Computing task processing method and device, computer equipment and storage medium
CN110704177A
System, method and device for processing tasks
CN113791876A
RPA task execution method and device, electronic equipment and storage medium
CN117056022A
