Method, device and equipment based on cache processing task and storage medium

By updating and matching the target value of cache information, we ensure that the current task can make full use of cache information, solving the problem that the server task processing speed is affected by cache information overwrite, and achieving more efficient task processing.

CN119759522AActive Publication Date: 2025-04-04HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when the server performs the current task, the cache information generated by the server may overwrite the cache information needed to be used in subsequent tasks, resulting in the task processing speed being affected.

Method used

By determining the matching result of the current task and the candidate cache information in the cache node, the target value of the candidate cache information is updated, the target candidate cache information is determined, and the task execution node is determined in the target node to ensure that the current task can make full use of the cache information.

Benefits of technology

By optimizing the utilization of cache information, avoiding cache information being overwritten, and improving the processing speed of the current task.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759522A_ABST
    Figure CN119759522A_ABST
Patent Text Reader

Abstract

The invention provides a method, device and equipment based on a cache processing task and a storage medium, and relates to the technical field of computers, in particular to the technical fields of task processing, cache management and the like. According to the specific implementation scheme, a target server responds to a received current task and determines a matching result of the current task and one or more pieces of candidate cache information in a cache node; updating target values of the one or more pieces of candidate cache information based on a matching result of the current task and the one or more pieces of candidate cache information; determining one or more pieces of target candidate cache information in the one or more pieces of candidate cache information based on the updated target values of the one or more pieces of candidate cache information; determining one or more task execution nodes in a plurality of target nodes corresponding to the current task based on the one or more pieces of target candidate cache information; and controlling one or more task execution nodes to execute the current task to obtain a processing result of the current task, and sending the processing result of the current task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to technical fields such as task processing and cache management. Background Art

[0002] In the prior art, the cache information generated by the server during the execution of the current task may overwrite the cache information in the cache that the current task needs to use later, resulting in the current task being unable to fully utilize the cache information in the cache, affecting the processing speed of the current task. Therefore, how to enable the current task to fully utilize the cache information in the cache to improve the processing speed of the current task has become a technical problem that needs to be solved. Summary of the invention

[0003] The present disclosure provides a method, an apparatus, a device and a storage medium for cache-based processing tasks.

[0004] According to one aspect of the present disclosure, a method for processing tasks based on a cache is provided, comprising:

[0005] In response to receiving the current task, the target server determines a matching result between the current task and one or more candidate cache information in the cache node;

[0006] Based on the matching result between the current task and the one or more candidate cache information, updating the target value of the one or more candidate cache information;

[0007] Determine one or more target candidate cache information from the one or more candidate cache information based on the updated target values ​​of the one or more candidate cache information;

[0008] Based on the one or more target candidate cache information, determining one or more task execution nodes from a plurality of target nodes corresponding to the current task;

[0009] Control the one or more task execution nodes to execute the current task, obtain the processing result of the current task, and send the processing result of the current task.

[0010] According to another aspect of the present disclosure, a method for processing tasks based on a cache is provided, comprising:

[0011] In response to receiving a current task sent by a client, determining a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers;

[0012] Determine a target server among the one or more candidate servers based on a number of matches between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers;

[0013] Sending the current task to the target server;

[0014] Receiving the processing result of the current task sent by the target server;

[0015] The processing result of the current task is sent to the client.

[0016] According to another aspect of the present disclosure, there is provided a device for processing tasks based on cache, comprising:

[0017] A task and cache information matching first module, configured for the target server to determine a matching result between the current task and one or more candidate cache information in the cache node in response to receiving the current task;

[0018] A target value updating module, configured to update a target value of the one or more candidate cache information based on a matching result between the current task and the one or more candidate cache information;

[0019] a target candidate cache information determination module, configured to determine one or more target candidate cache information from the one or more candidate cache information based on the updated target values ​​of the one or more candidate cache information;

[0020] A task execution node determination module, configured to determine one or more task execution nodes from among a plurality of target nodes corresponding to the current task based on the one or more target candidate cache information;

[0021] The execution module is used to control the one or more task execution nodes to execute the current task, obtain the processing result of the current task, and send the processing result of the current task.

[0022] According to another aspect of the present disclosure, there is provided a device for processing tasks based on cache, comprising:

[0023] A task and cache information matching second module is used to determine a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers in response to receiving the current task sent by the client;

[0024] a target server determination module, configured to determine a target server among the one or more candidate servers based on the number of matches between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers;

[0025] The communication module is used to send the current task to the target server; receive the processing result of the current task sent by the target server; and send the processing result of the current task to the client.

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

[0027] at least one processor; and

[0028] a memory communicatively connected to the at least one processor; wherein,

[0029] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.

[0030] 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 method according to the embodiments of the present disclosure.

[0031] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.

[0032] By adopting the method provided in this embodiment, before controlling the one or more task execution nodes to execute the current task and obtaining the processing result of the current task, the target value of the one or more candidate cache information is updated according to the matching result between the current task and the one or more candidate cache information in the cache node, and one or more target candidate cache information is determined in the one or more candidate cache information based on the updated target value of the one or more candidate cache information. In this way, the target value of the cache information needed by the current task in the cache node can be made higher than the target value of other cache information, and then when executing the current task, the cache information needed by the current task can be controlled not to be overwritten through the target value of the cache information, so as to achieve the purpose that the current task can make full use of the cache information in the cache, thereby improving the processing speed of the current task.

[0033] 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

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

[0035] Figure 1 is a flowchart of a method for processing tasks based on cache according to an embodiment of the present disclosure;

[0036] Figure 2 is a flowchart of a method for processing tasks based on cache according to another embodiment of the present disclosure;

[0037] Figure 3 is a flowchart of a method for processing tasks based on cache according to another embodiment of the present disclosure;

[0038] Figure 4 is a schematic block diagram of a device for cache processing tasks according to an embodiment of the present disclosure;

[0039] Figure 5 is a schematic block diagram of a device for processing tasks based on cache according to another embodiment of the present disclosure;

[0040] Figure 6 is a block diagram of an electronic device for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION

[0041] 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.

[0042] Figure 1 It is a schematic flow chart of a method for processing tasks based on cache provided in an embodiment of the present disclosure, comprising:

[0043] S110 , in response to receiving the current task, the target server determines a matching result between the current task and one or more candidate cache information in the cache node.

[0044] S120: Update target values ​​of the one or more candidate cache information based on a matching result between the current task and the one or more candidate cache information.

[0045] S130: Determine one or more target candidate cache information from the one or more candidate cache information based on the updated target values ​​of the one or more candidate cache information.

[0046] S140: Determine one or more task execution nodes from a plurality of target nodes corresponding to the current task based on the one or more target candidate cache information.

[0047] S150, controlling the one or more task execution nodes to execute the current task, obtaining a processing result of the current task, and sending the processing result of the current task.

[0048] The above-mentioned method based on cache processing tasks can be implemented by an electronic device. The electronic device can be a target server. For example, the target server can be a single server, or one or more servers in a server cluster. It should be understood that the above is only an exemplary description of the execution subject that can execute the method based on cache processing tasks provided by this embodiment. In actual processing, it may not be limited to the device types mentioned in the above examples. As long as the server can execute the method based on cache processing tasks provided by this embodiment, it is within the protection scope of this embodiment.

[0049] The current task may include: a topological structure diagram of multiple target nodes that execute the current task. The topological structure diagram may also be called a workflow or task flow. The node may be a module or function set in the target server.

[0050] The topological structure diagram of the multiple target nodes executing the current task includes: the multiple target nodes corresponding to the current task, and the connection between one or more interfaces of each target node in the multiple target nodes corresponding to the current task. The interface includes an input interface and an output interface, and the multiple target nodes include one or more leaf nodes, one or more child nodes, and the last node (i.e., the root node).

[0051] The one or more sub-nodes include a cache node, or the last node is a cache node.

[0052] Taking the i-th target node (i.e., the root node) among multiple target nodes as an example, when the i-th target node is not the last target node among the multiple target nodes, the connection between one or more interfaces of each target node among the multiple target nodes corresponding to the current task may include: connection between one or more output interfaces of the i-th target node and at least one input interface among all input interfaces of each other target node in at least one other target node among the multiple target nodes. The at least one other target node does not include one or more leaf nodes among the multiple target nodes.

[0053] In the case that the i-th target node is the last target node among the multiple target nodes, one or more output interfaces of the i-th target node have no connection.

[0054] It can be understood that the information output by one or more output interfaces of the i-th target node can be used as input information of at least one input interface of each other target node in at least one other target node connected to one or more output interfaces of the i-th target node.

[0055] The specific connection mode between one or more interfaces of each target node in the multiple target nodes corresponding to the current task may be configured by the user in the terminal. The user configures the connection between one or more interfaces of each target node in the multiple target nodes corresponding to the current task in the terminal, which is not limited in this application. The terminal may be an electronic device used by the user, and the electronic device may be one of the following: a laptop, a desktop computer, a mobile phone, a tablet computer, etc.

[0056] Exemplarily, the user configures the connection between one or more interfaces of each of the multiple target nodes corresponding to the current task in the terminal, which may be that the target user configures the connection between one or more interfaces of each of the multiple target nodes corresponding to the current task in a designated application in the terminal. The designated application may be ComfyUI (Comfy User Interface).

[0057] The target server may receive the current task in such a way that the target server receives the current task from the first server. The first server may also be referred to as a business center server, which may be a single server, or one or more servers in a server cluster.

[0058] By adopting the method provided in this embodiment, before controlling the one or more task execution nodes to execute the current task and obtaining the processing result of the current task, the target value of the one or more candidate cache information is updated according to the matching result between the current task and the one or more candidate cache information in the cache node, and one or more target candidate cache information is determined in the one or more candidate cache information based on the updated target value of the one or more candidate cache information. In this way, the target value of the cache information needed by the current task in the cache node can be made higher than the target value of other cache information, and then when executing the current task, the cache information needed by the current task can be controlled not to be overwritten through the target value of the cache information, so as to achieve the purpose that the current task can make full use of the cache information in the cache, thereby improving the processing speed of the current task.

[0059] In one embodiment, determining the matching result between the current task and one or more candidate cache information in the cache node includes: determining one or more target input interfaces from one or more candidate input interfaces of the cache node based on the current task; and determining the matching result between the current task and one or more candidate cache information in the cache node based on the one or more target input interfaces of the cache node.

[0060] The determining of one or more target input interfaces from one or more candidate input interfaces of the cache node based on the current task may include: determining a candidate input interface with a connection from one or more candidate input interfaces of the cache node based on connections between one or more interfaces of each target node in a plurality of target nodes corresponding to the current task; and using a candidate input interface with a connection from one or more candidate input interfaces of the cache node as one or more target input interfaces of the cache node.

[0061] The determining of the matching result between the current task and one or more candidate cache information in the cache node based on the one or more target input interfaces of the cache node may include: taking the result of whether the relevant identifiers of the one or more target input interfaces of the cache node and the relevant identifiers of one or more candidate cache information in the cache node are the same as the matching result between the current task and one or more candidate cache information in the cache node.

[0062] The method for determining the relevant identifiers of the one or more target input interfaces of the cache node may include: determining the relevant identifiers of the one or more target input interfaces of the cache node based on the identifiers of the input interfaces of one or more other target nodes to which the one or more target input interfaces of the cache node are connected.

[0063] Taking the kth target input interface among the one or more target input interfaces of the cache node as an example (k is a positive integer), determining the relevant identifiers of the one or more target input interfaces of the cache node based on the identifiers of the input interfaces of one or more other target nodes connected to the one or more target input interfaces of the cache node may include: using the identifier of the input interface of the kth other target node connected to the kth target input interface of the cache node and the identifier of the kth other target node as the relevant identifier of the kth target input interface of the cache node.

[0064] Optionally, determining the relevant identifiers of the one or more target input interfaces of the cache node based on the identifiers of the input interfaces of one or more other target nodes connected to the one or more target input interfaces of the cache node may include: calculating the identifiers of the input interfaces of other target nodes connected to the kth target input interface of the cache node and the identifier of the kth other target node based on a specified calculation method to obtain a first value; and using the first value as the relevant identifier of the kth target input interface of the cache node. The specified calculation method may be a hash value calculation.

[0065] In this way, based on one or more target input interfaces of the cache node (i.e., the input interface of the target cache node that the current task needs to use), the matching result between the current task and one or more candidate cache information in the cache node is determined. In this way, the cache information that the current task needs to use can be determined more accurately and efficiently.

[0066] In one embodiment, the determining of the matching result between the current task and one or more candidate cache information in the cache node based on the one or more target input interfaces of the cache node includes one of the following: when an identifier of the jth candidate cache information in the one or more candidate cache information in the cache node is the same as one of the related identifiers of the one or more target input interfaces of the cache node, determining that the current task matches the jth candidate cache information, where j is a positive integer; when an identifier of the jth candidate cache information in the one or more candidate cache information in the cache node is different from the related identifiers of the one or more target input interfaces of the cache node, determining that the current task does not match the jth candidate cache information.

[0067] A method for determining whether an identifier of the jth candidate cache information among one or more candidate cache information in the cache node is the same as one of the related identifiers of the one or more target input interfaces of the cache node, comprising: determining whether there are one or more unprocessed target input interfaces among the one or more target input interfaces of the cache node; if there are one or more unprocessed target input interfaces among the one or more target input interfaces of the cache node, determining a current unprocessed target input interface among the one or more unprocessed target input interfaces; determining whether an identifier of the jth candidate cache information in the cache node is the same as the related identifier of the current unprocessed target input interface; determining whether ... When the identifier of the j-th candidate cache information in the one or more candidate cache information in the cache node is the same as the related identifier of the currently unprocessed target input interface, determine that the identifier of the j-th candidate cache information in the one or more candidate cache information in the cache node is the same as one of the related identifiers of the one or more target input interfaces of the cache node; when the identifier of the j-th candidate cache information in the cache node is not the same as the related identifier of the currently unprocessed target input interface, return to execute the above steps; when there is no unprocessed target input interface in the one or more target input interfaces of the cache node, determine that the identifier of the j-th candidate cache information in the one or more candidate cache information in the cache node is different from the related identifiers of the one or more target input interfaces of the cache node.

[0068] It can be understood that the method of determining whether the identifier of each candidate cache information in one or more candidate cache information in the cache node is the same as the method of determining whether the identifier of each candidate cache information in one or more candidate cache information in the cache node is the same as the above-mentioned method of determining whether the identifier of the j-th candidate cache information in one or more candidate cache information in the cache node is the same as the relevant identifier of the one or more target input interfaces of the cache node, and will not be repeated here.

[0069] In this way, by judging whether the identifier of each candidate cache information in one or more candidate cache information in the cache node is the same as one of the relevant identifiers of the one or more target input interfaces of the cache node, in order to determine whether the current task matches each candidate cache information, the cache information needed to be used by the previous task can be determined more accurately and efficiently.

[0070] In one embodiment, updating the target value of the one or more candidate cache information based on the matching result between the current task and the one or more candidate cache information includes: determining the update parameters of the jth candidate cache information based on the matching result between the current task and the jth candidate cache information and the matching result between the historical task and the jth candidate cache information, wherein the update parameters include at least one of the following: the number of matches and the number of unmatched intervals; updating the target value of the jth candidate cache information based on the update parameters of the jth candidate cache information and the attribute information of the jth candidate cache information.

[0071] The updating parameters of the jth candidate cache information are determined based on the matching results of the current task and the jth candidate cache information and the matching results of the historical tasks and the jth candidate cache information, including at least one of the following: determining the number of matches of the jth candidate cache information based on the matching results of the current task and the jth candidate cache information and the matching results of the historical tasks and the jth candidate cache information; determining the number of unmatched intervals of the jth candidate cache information based on the matching results of the current task and the jth candidate cache information and the matching results of the historical tasks and the jth candidate cache information.

[0072] The determining the number of matches of the jth candidate cache information based on the matching result of the current task and the jth candidate cache information and the matching result of the historical task and the jth candidate cache information includes one of the following: when the matching result of the current task and the jth candidate cache information is a match, adding 1 to the number of matches in the matching results of one or more historical tasks and the jth candidate cache information to obtain the number of matches of the jth candidate cache information; when the matching result of the current task and the jth candidate cache information is a mismatch, using the number of matches in the matching results of one or more historical tasks and the jth candidate cache information as the number of matches of the jth candidate cache information.

[0073] The determining the number of unmatched intervals of the jth candidate cache information based on the matching result between the current task and the jth candidate cache information and the matching result between the historical task and the jth candidate cache information comprises one of the following: when the matching result between the current task and the jth candidate cache information is a match, specifying the number of unmatched intervals as the number of unmatched intervals of the jth candidate cache information; when the matching result between the current task and the jth candidate cache information is a mismatch, and there is a historical task matching the jth candidate cache information in one or more historical tasks, adding 1 to the number of unmatched intervals after the last historical task matching the jth candidate cache information in one or more historical tasks, to obtain the number of unmatched intervals of the jth candidate cache information; when the matching result between the current task and the jth candidate cache information is a mismatch, and there is no historical task matching the jth candidate cache information in one or more historical tasks, adding 1 to the number of unmatched intervals of the jth candidate cache information between one or more historical tasks. The specified number of unmatched intervals may be set according to actual conditions. For example, the specified number of unmatched intervals may be 0.

[0074] The attribute information of the jth candidate cache information may include at least one of the following: the generation duration of the jth candidate cache information, the size of the jth candidate cache information, the generation time of the jth candidate cache information, and the like.

[0075] The generation time of the jth candidate cache information may be: the time from the calculation time of the leaf node corresponding to the jth input interface of the cache node corresponding to the jth candidate cache information to the time when the jth input interface of the cache node receives the jth candidate cache information.

[0076] The generation time of the j-th candidate cache information may be: the time when the j-th input interface receives the j-th candidate cache information.

[0077] The size of the j-th candidate cache information may be: the bit length of the j-th candidate cache information.

[0078] Based on the update parameters of the jth candidate cache information and the attribute information of the jth candidate cache information, updating the target value of the jth candidate cache information may be: calculating the update parameters of the jth candidate cache information and the attribute information of the jth candidate cache information based on a specified calculation formula to obtain a second value of the jth candidate cache information; and updating the target value of the jth candidate cache information based on the second value of the jth candidate cache information. The specified calculation formula may be set according to actual conditions and is not limited in this application.

[0079] Exemplarily, the greater the number of matches of the j-th candidate cache information, the larger the second value; the greater the number of unmatched intervals of the j-th candidate cache information, the smaller the second value; the greater the generation time of the j-th candidate cache information, the larger the second value; the greater the size of the j-th candidate cache information, the larger the second value; the later the generation time of the j-th candidate cache information, the larger the second value.

[0080] It can be understood that the method of determining the update parameters of each candidate cache information based on the matching results of the current task and each candidate cache information and the matching results of the historical task and each candidate cache information is the same as the method of determining the update parameters of the j-th candidate cache information based on the matching results of the current task and the j-th candidate cache information and the matching results of the historical task and the j-th candidate cache information, and will not be repeated here. The method of updating the target value of each candidate cache information based on the update parameters of each candidate cache information and the attribute information of each candidate cache information is the same as the method of updating the target value of the j-th candidate cache information based on the update parameters of the j-th candidate cache information and the attribute information of the j-th candidate cache information, and will not be repeated here.

[0081] In this way, by updating the target value of each candidate cache information through the number of matches, the number of unmatched intervals, and the attribute information, the value of the cache information needed by the current task can be made higher. Then, when executing the current task, the target value of the cache information can be used to control the cache information needed by the current task from being overwritten, so that the current task can make full use of the cache information in the cache, thereby improving the processing speed of the current task.

[0082] In one embodiment, the determining one or more target candidate cache information from the one or more candidate cache information based on the target value of the one or more candidate cache information after update includes: when the remaining cache space of the cache node is less than or equal to a specified value, based on the target value of the one or more candidate cache information after update, determining the candidate cache information with the lowest target value from the one or more candidate cache information, and deleting the candidate cache information with the lowest target value from the cache space; when the remaining cache space of the cache node is greater than the specified value, using the one or more candidate cache information remaining in the cache space as the one or more target candidate cache information.

[0083] The method for determining the specified value may be: the specified value corresponding to each of the one or more first input interfaces of the target candidate cache information that does not match the one or more target input interfaces in the cache node. The specified value corresponding to each first input interface can be set according to actual conditions, and this application does not limit it. For example, the specified value corresponding to any first input interface may be the size of the output information of the child node connected to any first input interface.

[0084] The method of using one or more candidate cache information remaining in the cache space as the one or more target candidate cache information when the remaining cache space of the cache node is greater than a specified value comprises: determining whether the remaining cache space of the cache node is greater than a specified value; and using one or more candidate cache information remaining in the cache space as the one or more target candidate cache information when the remaining cache space of the cache node is greater than a specified value.

[0085] When the remaining cache space of the cache node is not greater than the specified value, determine the candidate cache information with the lowest target value among the one or more candidate cache information, and delete the candidate cache information with the lowest target value in the cache space; continue to judge whether the remaining cache space of the cache node is greater than the specified value; when the remaining cache space of the cache node is greater than the specified value, use the one or more candidate cache information remaining in the cache space as the one or more target candidate cache information; when the remaining cache space of the cache node is not greater than the specified value, return to execute the above steps until it is determined that the remaining cache space of the cache node is greater than the specified value.

[0086] In this way, one or more judgments are made on whether the remaining cache space of the cache node is greater than the specified value, and after each judgment, only the candidate cache information with the lowest target value is deleted. In this way, it is possible to avoid deleting too many cache information and causing unnecessary waste of cache resources.

[0087] In one embodiment, determining one or more task execution nodes in the multiple target nodes corresponding to the current task based on the one or more target candidate cache information includes one of the following: when one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and the cache node is not the last node among the multiple target nodes, one or more upstream nodes corresponding to the one or more first input interfaces among the multiple target nodes, one or more downstream nodes of the cache node, and the cache node are used as the one or more task execution nodes; when one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and the cache node is the last node among the multiple target nodes, one or more upstream nodes corresponding to the one or more first input interfaces among the multiple target nodes, and the cache node are used as the one or more task execution nodes; when one or more target input interfaces in the cache node all have matching target candidate cache information, and the cache node is not the last node among the multiple target nodes, one or more downstream nodes of the cache node among the multiple target nodes, and the cache node are used as the one or more task execution nodes.

[0088] The method for determining one or more upstream nodes among the multiple target nodes corresponding to the one or more first input interfaces may be: using one or more upstream child nodes, and / or upstream leaf nodes corresponding to the one or more first input interfaces in the topological structure diagram of the multiple target nodes as one or more upstream nodes among the multiple target nodes corresponding to the one or more first input interfaces.

[0089] Taking the nth first input interface among the one or more first input interfaces as an example (n is a positive integer), in the case that the nth first input interface in the topological structure diagram of the multiple target nodes is connected to a child node, the one or more upstream nodes corresponding to the nth first input interface include the one or more upstream child nodes corresponding to the nth first input interface and the upstream leaf node corresponding to the nth first input interface. In the case that the nth first input is connected to a leaf node in the topological structure diagram of the multiple target nodes, the one or more upstream nodes corresponding to the nth first input interface include the upstream leaf node corresponding to the nth first input interface.

[0090] The method of determining one or more downstream nodes of the cache node includes: using one or more downstream sub-nodes and / or the last node of the cache node among the multiple target nodes as the one or more downstream nodes of the cache node.

[0091] In one example, the method further includes: when one or more target input interfaces in the cache node have matching target candidate cache information and the cache node is the last node among the multiple target nodes, using the cache node as a task execution node.

[0092] In this way, through the matching results of one or more target input interfaces in the cache node and the target candidate cache information, one or more task execution nodes can be accurately determined from the multiple target nodes corresponding to the current task. In this way, only the nodes without cache can be executed during the execution of the current task, which improves the execution speed of the current task.

[0093] The controlling of the one or more task execution nodes to execute the current task and obtaining the processing result of the current task includes: determining whether there is an unexecuted task execution node among the one or more task execution nodes; if there is one or more unexecuted task execution nodes among the one or more task execution nodes, determining the current task execution node based on the execution order of the one or more unexecuted task execution nodes; controlling the current task execution node to execute the current task; determining whether there is an unexecuted task execution node among the one or more task execution nodes, and if there is no unexecuted task execution node among the one or more task execution nodes, using the information output by one or more output interfaces of the current node as the processing result of the current task.

[0094] The execution order of the one or more unexecuted task execution nodes may be determined according to the order of the topological structure diagram of the multiple target nodes executing the current task. For example, the order may be executed from the leaf node in the topological structure diagram of the multiple target nodes to the root node (i.e., the last node).

[0095] When the current node is a cache node and one or more target input interfaces in the cache node have matching target candidate cache information, controlling the current task execution node to execute the current task includes: controlling one or more output interfaces of the cache node to output the matching target candidate cache information.

[0096] In the case that the current node is a cache node and one or more target input interfaces in the cache node do not have matching target candidate cache information, controlling the current task execution node to execute the current task includes: controlling one or more target output interfaces corresponding to one or more target input interfaces of the cache node to output input information of the one or more target input interfaces.

[0097] In the case where the current node is a cache node, and one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and one or more second input interfaces among the one or more target input interfaces in the cache node do have matching target candidate cache information, controlling the current task execution node to execute the current task includes: controlling one or more first output interfaces corresponding to the one or more first input interfaces of the cache node to output input information of the one or more first input interfaces, and controlling one or more second output interfaces corresponding to the one or more second input interfaces of the cache node to output the target candidate cache information matching the one or more second input interfaces.

[0098] In the case that the current node is not a cache node, the control of the current task execution node to execute the current task includes: controlling the current node to calculate the input information of one or more input interfaces of the current node to obtain the calculation results of one or more current nodes, and controlling one or more output interfaces of the current node to output the calculation results of the one or more current nodes.

[0099] In one example, after updating the target value of the one or more candidate cache information based on the matching result between the current task and the one or more candidate cache information, it also includes: determining one or more task execution nodes among the multiple target nodes corresponding to the current task based on the one or more candidate cache information; judging whether there are unexecuted task execution nodes in the execution of the one or more task execution nodes, and if there are one or more executed task execution nodes in the one or more task execution nodes, determining one or more target candidate cache information in the one or more candidate cache information based on the updated target value of the one or more candidate cache information; controlling the current task execution node to execute the current task, judging whether there are unexecuted task execution nodes in the execution of the one or more task execution nodes, and if there are not one or more unexecuted task execution nodes in the one or more task execution nodes, using the information output by one or more output interfaces of the current node as the processing result of the current task.

[0100] Among them, the method of determining one or more task execution nodes among the multiple target nodes corresponding to the current task based on the one or more candidate cache information is the same as the method of determining one or more task execution nodes among the multiple target nodes corresponding to the current task based on the one or more target candidate cache information, and will not be repeated here. The control of the current task execution node to execute the current task is the same as the above-mentioned implementation method, and will not be repeated here.

[0101] The method of determining one or more target candidate cache information in the one or more candidate cache information based on the target value of the one or more candidate cache information after the update includes: judging whether the remaining cache space of the cache node is less than or equal to a preset value; in the case where the remaining cache space of the cache node is less than or equal to the preset value, determining the candidate cache information with the lowest target value in the one or more candidate cache information based on the target value of the one or more candidate cache information after the update, and deleting the candidate cache information with the lowest target value in the cache space, wherein the preset value is related to the cache space required by the current node; in the case where the remaining cache space of the cache node is greater than the preset value, using the one or more candidate cache information remaining in the cache space as the one or more target candidate cache information. The preset value may be the cache space value required by the current node, wherein the cache space value required by the current node may be set according to actual conditions, which is not limited in the present application.

[0102] Combination Figure 2 The above-mentioned implementation modes are exemplarily described, including:

[0103] S201, the target server receives the current task.

[0104] S202: Update target values ​​of the one or more candidate cache information based on a matching result between the current task and the one or more candidate cache information.

[0105] S203, determining whether there is any unexecuted task execution node in the execution of the one or more task execution nodes, and executing S204 if there is any unexecuted task execution node; and executing S207 if there is no unexecuted task execution node.

[0106] S204, determine whether the remaining cache space of the cache node is less than or equal to a preset value. If the remaining cache space of the cache node is less than or equal to the preset value, execute S205; if the remaining cache space of the cache node is not less than or equal to the preset value, execute S206.

[0107] S205, based on the updated target values ​​of the one or more candidate cache information, determine the candidate cache information with the lowest target value among the one or more candidate cache information, and delete the candidate cache information with the lowest target value in the cache space; and return to execute S204.

[0108] S206, controlling the current task execution node to execute the current task. Specifically, it includes one of the following:

[0109] S2061, when the current node is a cache node and one or more target input interfaces in the cache node have matching target candidate cache information, control the current task execution node to execute the current task, including: controlling one or more output interfaces of the cache node to output the matching target candidate cache information.

[0110] S2062, when the current node is a cache node and one or more target input interfaces in the cache node do not have matching target candidate cache information, controlling the current task execution node to execute the current task includes: controlling one or more target output interfaces corresponding to one or more target input interfaces of the cache node to output input information of the one or more target input interfaces.

[0111] S2063, when the current node is a cache node, and one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and one or more second input interfaces among the one or more target input interfaces in the cache node do have matching target candidate cache information, controlling the current task execution node to execute the current task includes: controlling one or more first output interfaces corresponding to the one or more first input interfaces of the cache node to output the input information of the one or more first input interfaces, and one or more second output interfaces corresponding to the one or more second input interfaces of the cache node to output the target candidate cache information matching the one or more second input interfaces.

[0112] S2064, when the current node is not a cache node, the control of the current task execution node to execute the current task includes: controlling the current node to calculate the input information of one or more input interfaces of the current node to obtain the calculation results of one or more current nodes, and controlling one or more output interfaces of the current node to output the calculation results of the one or more current nodes.

[0113] S207: Using the information output by one or more output interfaces of the current node as the processing result of the current task

[0114] In an example, the method further includes: using the input information of the one or more first input interfaces as one or more first candidate cache information, and storing the one or more first candidate cache information in the cache node.

[0115] In an example, the method further includes: sending the related identifiers of the one or more first input interfaces to the first server, wherein the related identifiers of the interfaces are the same as those described in the above implementation manner and are not described in detail here.

[0116] In an example, sending the processing result of the current task may be sending the processing result of the current task to the first server.

[0117] In one example, while sending the processing result of the current task to the first server, the method further includes: sending the task execution completion status to the first server, wherein the task execution completion status is used to indicate that the target server is in an idle state.

[0118] Figure 3 It is a schematic flow chart of a method for processing tasks based on cache provided in an embodiment of the present disclosure, comprising:

[0119] S310 , in response to receiving a current task sent by a client, determining a matching result between the current task and one or more cache information in a candidate cache node in each of one or more candidate servers.

[0120] S320: Determine a target server from among the one or more candidate servers based on the number of matches between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers.

[0121] S330: Send the current task to the target server.

[0122] S340: Receive the processing result of the current task sent by the target server.

[0123] S350: Send the processing result of the current task to the client.

[0124] The above-mentioned method based on cache processing tasks can be implemented by an electronic device. The electronic device can be a first server. Exemplarily, the first server can be a single server, or one or more servers in a server cluster. It should be understood that the above is only an exemplary description of the execution subject that can execute the method based on cache processing tasks provided by this embodiment. In actual processing, it may not be limited to the device types mentioned in the above examples. As long as the server can execute the method based on cache processing tasks provided by this embodiment, it is within the protection scope of this embodiment.

[0125] The terminal may be an electronic device used by the user, and the electronic device may be one of the following: a laptop computer, a desktop computer, a mobile phone, a tablet computer, etc.

[0126] In one example, the method for obtaining the current task further includes: receiving the current task sent by a second server. The second server may also be referred to as a middle station server.

[0127] In addition, the method also includes sending the processing result of the current task to the second server.

[0128] The processing of the second server includes: in response to receiving the current task sent by the client, sending the current task to the first server; receiving the processing result of the current task sent by the first server; and sending the processing result of the current task to the client.

[0129] In one embodiment, the method further includes: after sending the current task to the target server, setting the state of the target server to a task execution state, wherein the task execution state is used to indicate that the target server is in a non-idle state.

[0130] Determining the target server from the one or more candidate servers based on the number of matches between the current task and one or more cache information in the candidate cache nodes in each of the one or more candidate servers may include: selecting the candidate server with the largest number of matches between the current task and one or more cache information in the candidate cache nodes in each of the one or more candidate servers as the target server. The state of each of the one or more candidate servers is an idle state.

[0131] By adopting the above implementation, the candidate server with the largest number of matches between the current task and one or more cache information in the candidate cache nodes in each of the one or more candidate servers is used as the target server. In this way, the target service with the most cache information required by the current task can be determined, thereby improving the efficiency of the current task execution.

[0132] In one embodiment, determining the matching result between the current task and one or more cache information in the candidate cache nodes in each of the one or more candidate servers includes: based on the current task, determining one or more target input interfaces among the one or more candidate input interfaces of the cache node in each of the candidate servers; based on the one or more target input interfaces in each candidate server, determining the matching result between the current task and one or more cache information in the candidate cache nodes in each of the one or more candidate servers.

[0133] The manner of determining one or more target input interfaces from one or more candidate input interfaces of the cache node in each candidate server based on the current task is the same as the above-mentioned processing manner of determining one or more target input interfaces from one or more candidate input interfaces of the cache node based on the current task, and will not be repeated here.

[0134] The method of determining the matching results of the current task and one or more cache information in the candidate cache nodes in each of the one or more candidate servers based on the one or more target input interfaces in each candidate server is the same as the above-mentioned method of determining the matching results of the current task and one or more candidate cache information in the cache node based on the one or more target input interfaces in the cache node, and will not be repeated here.

[0135] In one embodiment, the determining of the matching result between the current task and one or more cache information in the candidate cache node in each of the one or more candidate servers based on the one or more target input interfaces in each candidate server includes one of the following: when the identifier of the jth cache information in the candidate cache node in the zth candidate server is the same as one of the related identifiers of the one or more target input interfaces of the cache node in the zth candidate server, determining that the current task matches the jth cache information in the candidate cache node in the zth candidate server, wherein j and z are positive integers, the zth candidate server is one of the one or more candidate servers, and the jth cache information is one of the one or more cache information; when the identifier of the jth cache information in the candidate cache node in the zth candidate server is different from one of the related identifiers of the one or more target input interfaces of the cache node in the zth candidate server, determining that the current task does not match the jth cache information in the candidate cache node in the zth candidate server.

[0136] Among them, the method for judging whether the identifier of the j-th cache information in the candidate cache node in the z-th candidate server is the same as the method for judging whether the identifier of the j-th candidate cache information in the one or more candidate cache information in the cache node is the same as one of the related identifiers of the one or more target input interfaces of the cache node, and will not be repeated here.

[0137] By adopting the above implementation, the result of matching the current task with one or more cache information in the candidate cache node in each of the one or more candidate servers can be determined more efficiently and accurately.

[0138] In an example, it also includes: receiving related identifiers of the one or more first interface input interfaces sent by the target server.

[0139] In one example, the method further includes: receiving a task execution completion status sent by the target server, wherein the task execution completion status is used to indicate that the target server is in an idle state.

[0140] Figure 4 FIG. 1 is a schematic block diagram of a device based on cache processing tasks provided by an embodiment of the present disclosure. Figure 4 As shown, including:

[0141] The first task and cache information matching module 401 is used for the target server to determine the matching result between the current task and one or more candidate cache information in the cache node in response to receiving the current task;

[0142] A target value updating module 402, configured to update a target value of the one or more candidate cache information based on a matching result between the current task and the one or more candidate cache information;

[0143] A target candidate cache information determination module 403 is used to determine one or more target candidate cache information from the one or more candidate cache information based on the updated target value of the one or more candidate cache information;

[0144] A task execution node determination module 404 is used to determine one or more task execution nodes from a plurality of target nodes corresponding to the current task based on the one or more target candidate cache information;

[0145] The execution module 405 is used to control the one or more task execution nodes to execute the current task, obtain the processing result of the current task, and send the processing result of the current task.

[0146] The task and cache information matching first module is used to determine one or more target input interfaces from one or more candidate input interfaces of the cache node based on the current task; and determine the matching result between the current task and one or more candidate cache information in the cache node based on the one or more target input interfaces of the cache node.

[0147] The task and cache information matching first module is used to perform one of the following: when the identifier of the jth candidate cache information among the one or more candidate cache information in the cache node is the same as one of the related identifiers of the one or more target input interfaces of the cache node, determine that the current task matches the jth candidate cache information, where j is a positive integer; when the identifier of the jth candidate cache information among the one or more candidate cache information in the cache node is different from the related identifiers of the one or more target input interfaces of the cache node, determine that the current task does not match the jth candidate cache information.

[0148] The target value updating module is used to determine the update parameters of the jth candidate cache information based on the matching results between the current task and the jth candidate cache information and the matching results between the historical task and the jth candidate cache information, wherein the update parameters include at least one of the following: the number of matches and the number of unmatched intervals; based on the update parameters of the jth candidate cache information and the attribute information of the jth candidate cache information, update the target value of the jth candidate cache information.

[0149] The target candidate cache information determination module is used to determine the candidate cache information with the lowest target value among the one or more candidate cache information based on the updated target value of the one or more candidate cache information when the remaining cache space of the cache node is less than or equal to the specified value, and delete the candidate cache information with the lowest target value in the cache space when the remaining cache space of the cache node is greater than the specified value; and use the one or more candidate cache information remaining in the cache space as the one or more target candidate cache information.

[0150] The task execution node determination module is used to perform one of the following: when one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and the cache node is not the last node among the multiple target nodes, one or more upstream nodes corresponding to the one or more first input interfaces among the multiple target nodes, one or more downstream nodes of the cache node, and the cache node are used as the one or more task execution nodes; when one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and the cache node is the last node among the multiple target nodes, one or more upstream nodes corresponding to the one or more first input interfaces among the multiple target nodes, and the cache node are used as the one or more task execution nodes; when one or more target input interfaces in the cache node all have matching target candidate cache information, and the cache node is not the last node among the multiple target nodes, one or more downstream nodes of the cache node among the multiple target nodes, and the cache node are used as the one or more task execution nodes.

[0151] Figure 5 FIG. 1 is a schematic block diagram of a device based on cache processing tasks provided by an embodiment of the present disclosure. Figure 5 As shown, including:

[0152] The task and cache information matching second module 501 is used to determine the matching result between the current task and one or more cache information in the candidate cache node in each candidate server of the one or more candidate servers in response to receiving the current task sent by the client;

[0153] a target server determination module 502, configured to determine a target server from among the one or more candidate servers based on the number of matches between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers;

[0154] The communication module 503 is used to send the current task to the target server; receive the processing result of the current task sent by the target server; and send the processing result of the current task to the client.

[0155] The task and cache information matching second module is used to determine one or more target input interfaces from one or more candidate input interfaces of the cache node in each candidate server based on the current task; and determine the matching result between the current task and one or more cache information in the candidate cache node in each of the one or more candidate servers based on the one or more target input interfaces in each candidate server.

[0156] The task and cache information matching second module is used to perform one of the following: when the identifier of the jth cache information in the candidate cache node in the zth candidate server is the same as one of the related identifiers of one or more target input interfaces of the cache node in the zth candidate server, determine that the current task matches the jth cache information in the candidate cache node in the zth candidate server, wherein j and z are positive integers, the zth candidate server is one of the one or more candidate servers, and the jth cache information is one of the one or more cache information; when the identifier of the jth cache information in the candidate cache node in the zth candidate server is different from one of the related identifiers of one or more target input interfaces of the cache node in the zth candidate server, determine that the current task does not match the jth cache information in the candidate cache node in the zth candidate server.

[0157] 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.

[0158] 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.

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

[0160] Figure 6 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital 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.

[0161] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0162] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0163] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 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 601 performs the various methods and processes described above. For example, in some embodiments, the above method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, at least one step of the method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).

[0164] 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.

[0165] The program code for implementing the method of the present disclosure may be written in any combination of at least one programming language. These program codes may 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 may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0166] 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 at least one line, 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.

[0167] 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).

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

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

[0170] 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.

[0171] 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 method for processing tasks based on cache, comprising: In response to receiving the current task, the target server determines a matching result between the current task and one or more candidate cache information in the cache node; Based on the matching result between the current task and the one or more candidate cache information, updating the target value of the one or more candidate cache information; Determine one or more target candidate cache information from the one or more candidate cache information based on the updated target values ​​of the one or more candidate cache information; Based on the one or more target candidate cache information, determining one or more task execution nodes from a plurality of target nodes corresponding to the current task; Control the one or more task execution nodes to execute the current task, obtain the processing result of the current task, and send the processing result of the current task.

2. The method according to claim 1, wherein: The determining a matching result between the current task and one or more candidate cache information in the cache node includes: Based on the current task, determining one or more target input interfaces from one or more candidate input interfaces of the cache node; Based on the one or more target input interfaces of the cache node, a matching result between the current task and one or more candidate cache information in the cache node is determined.

3. The method according to claim 2, wherein: The determining, based on the one or more target input interfaces of the cache node, a matching result between the current task and one or more candidate cache information in the cache node includes one of the following: When an identifier of a j-th candidate cache information among one or more candidate cache information in the cache node is the same as one of the related identifiers of the one or more target input interfaces of the cache node, determining that the current task matches the j-th candidate cache information, where j is a positive integer; When an identifier of the jth candidate cache information among one or more candidate cache information in the cache node and related identifiers of the one or more target input interfaces of the cache node are different, it is determined that the current task does not match the jth candidate cache information.

4. The method according to claim 3, wherein: The updating of the target value of the one or more candidate cache information based on the matching result between the current task and the one or more candidate cache information includes: Determine an update parameter of the jth candidate cache information based on a matching result between the current task and the jth candidate cache information and a matching result between a historical task and the jth candidate cache information, wherein the update parameter includes at least one of the following: a matching number and a number of unmatched intervals; Based on the update parameter of the j-th candidate cache information and the attribute information of the j-th candidate cache information, the target value of the j-th candidate cache information is updated.

5. The method according to claim 4, wherein: The determining one or more target candidate cache information from the one or more candidate cache information based on the updated target value of the one or more candidate cache information includes: When the remaining cache space of the cache node is less than or equal to the specified value, based on the updated target values ​​of the one or more candidate cache information, determine the candidate cache information with the lowest target value among the one or more candidate cache information, and delete the candidate cache information with the lowest target value in the cache space; When the remaining cache space of the cache node is greater than a specified value, one or more candidate cache information remaining in the cache space is used as the one or more target candidate cache information.

6. The method according to claim 1, wherein: The determining, based on the one or more target candidate cache information, one or more task execution nodes from the multiple target nodes corresponding to the current task includes one of the following: When one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and the cache node is not the last node among the multiple target nodes, use one or more upstream nodes among the multiple target nodes corresponding to the one or more first input interfaces, one or more downstream nodes of the cache node, and the cache node as the one or more task execution nodes; When one or more first input interfaces among the one or more target input interfaces in the cache node do not have matching target candidate cache information, and the cache node is the last node among the multiple target nodes, use one or more upstream nodes among the multiple target nodes corresponding to the one or more first input interfaces and the cache node as the one or more task execution nodes; When one or more target input interfaces in the cache node have matching target candidate cache information and the cache node is not the last node among the multiple target nodes, one or more downstream nodes of the cache node among the multiple target nodes and the cache node are used as the one or more task execution nodes.

7. A method for processing tasks based on cache, comprising: In response to receiving the current task sent by the client, determining a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers; Determine a target server among the one or more candidate servers based on a number of matches between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers; Sending the current task to the target server; Receiving the processing result of the current task sent by the target server; Send the processing result of the current task to the client.

8. The method according to claim 7, wherein: The determining of a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers includes: Based on the current task, determining one or more target input interfaces from one or more candidate input interfaces of the cache node in each candidate server; Based on the one or more target input interfaces in each candidate server, a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers is determined.

9. The method according to claim 8, wherein: The determining, based on the one or more target input interfaces in each candidate server, a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers comprises one of the following: In a case where the identifier of the jth cache information in the candidate cache node in the zth candidate server is the same as one of the related identifiers of the one or more target input interfaces of the cache node in the zth candidate server, determining that the current task matches the jth cache information in the candidate cache node in the zth candidate server, wherein j and z are positive integers, the zth candidate server is one of the one or more candidate servers, and the jth cache information is one of the one or more cache information; When the identifier of the j-th cache information in the candidate cache node in the z-th candidate server is different from one of the relevant identifiers of one or more target input interfaces of the cache node in the z-th candidate server, it is determined that the current task does not match the j-th cache information in the candidate cache node in the z-th candidate server.

10. A device for processing tasks based on cache, comprising: A task and cache information matching first module, configured for the target server to determine a matching result between the current task and one or more candidate cache information in the cache node in response to receiving the current task; A target value updating module, configured to update a target value of the one or more candidate cache information based on a matching result between the current task and the one or more candidate cache information; a target candidate cache information determination module, configured to determine one or more target candidate cache information from the one or more candidate cache information based on the updated target values ​​of the one or more candidate cache information; A task execution node determination module, configured to determine one or more task execution nodes from among a plurality of target nodes corresponding to the current task based on the one or more target candidate cache information; The execution module is used to control the one or more task execution nodes to execute the current task, obtain the processing result of the current task, and send the processing result of the current task.

11. A device for processing tasks based on cache, comprising: A task and cache information matching second module is used to determine a matching result between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers in response to receiving the current task sent by the client; a target server determination module, configured to determine a target server among the one or more candidate servers based on the number of matches between the current task and one or more cache information in a candidate cache node in each of the one or more candidate servers; The communication module is used to send the current task to the target server; receive the processing result of the current task sent by the target server; and send the processing result of the current task to the client.

12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6 or claims 7-9.

13. 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-6 or claims 7-9.

14. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 6 or claims 7 to 9.

Citation Information

Patent Citations

  • Service quality assurance method for cloud computing server power consumption and resource competition cooperative control

    CN108574600A

  • Service request response method, apparatus, computer device, and storage medium

    CN109492019A

  • Blind detection method and device for narrowband physical downlink control channel, equipment and medium

    CN114430309A

  • Resource management method and device, equipment and storage medium

    CN115061947A

  • Local cache updating method and device, electronic equipment and storage medium

    CN116627996A