Task reasoning method, computer equipment and storage medium
By building a P2P distributed model inference network, client nodes share computing and data resources, the problem of server computing resource bottleneck is solved and the system scalability and user experience is improved.
Patent Information
- Application Number
- CN202510515816.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, high-performance servers have a bottleneck in the case of a large number of concurrent requests, and it is difficult to effectively utilize the client's computing and data resources, resulting in excessive pressure on the server.
By building a distributed model inference network in P2P form, client nodes share computing and data resources, and implement task inference services and reduce server pressure.
It effectively reduces the resource usage of the server, improves the scalability of the system and user inference service experience, and optimizes resource utilization.
Smart Images

Figure CN120508359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a task reasoning method, a computer device, and a storage medium. Background Art
[0002] With the development of computer technology and network technology, applications represented by generative AI (Artificial Intelligence) have been widely used on the Internet in the past two years, and the demand for AI computing power and data is increasing.
[0003] Due to the complexity of the model and the requirements for memory and computing power, most current models are mainly run on high-performance servers equipped with dedicated processing chips such as GPU (Graphics Processing Unit) and TPU (Tensor Processing Unit). When there are a large number of concurrent user requests, computing resources can easily become a bottleneck for the service. Summary of the Invention
[0004] The present application provides a task reasoning method, computer device, and storage medium that can reduce server pressure. The technical solution is as follows:
[0005] In one aspect, a method for task reasoning is provided, the method being applied to a first client node, the method comprising:
[0006] Sending a query request to the server, wherein the query request includes an inference task identifier and an identifier of the public data;
[0007] Receiving information of a candidate service node returned by the server, wherein the candidate service node is a client node that has previously completed inference service registration with the server, and the candidate service node stores at least one of the public data and a model file corresponding to the inference task identifier, and the public data is data used when performing inference using the model file;
[0008] Sending an inference request to a second client node among the candidate service nodes, wherein the second client node stores the model file, and the inference request includes an identifier of the model file and indication information of the public data;
[0009] Receive the inference result returned by the second client node.
[0010] In an optional manner, before sending the inference request to the second client node among the candidate service nodes, the method further includes:
[0011] Among the candidate service nodes, if there is a client node that stores the model file and the public data, then the second client node is selected from the client nodes that store the model file and the public data; if there is no client node that stores the model file and the public data, or the inference result is not obtained from the client node that stores the model file and the public data, then the second client node is selected from the client nodes that store the model file and do not store the public data.
[0012] In an optional manner, when the second client node stores the public data, the indication information of the public data is an identifier of the public data;
[0013] In the case that the second client node does not store the public data, the indication information of the public data includes an identifier of the public data and information of at least one client node in the candidate service node that stores the public data; or
[0014] In the case that the second client node does not store the public data, the indication information of the public data includes the public data; before sending the inference request to the second client node among the candidate service nodes, the method further includes: sending an acquisition request to a third client node among the candidate service nodes that stores the public data, wherein the acquisition request is used to request to obtain the public data; and receiving the public data sent by the third client node.
[0015] In this way, when there is no public data on the second client node, the inference service can still be provided.
[0016] In an optional manner, the information of the candidate service node includes network connection information of the candidate service node;
[0017] The sending an inference request to a second client node among the candidate service nodes includes:
[0018] The inference request is sent to the second client node based on the network connection information of the second client node.
[0019] In an optional manner, the inference request further includes proprietary data of the first client node.
[0020] In this way, during inference, the proprietary data of the client node can be combined to provide inference services.
[0021] In an optional manner, the method further includes:
[0022] A registration request is sent to the server, wherein the registration request includes model resource information of the model-related resources stored by the first client node, and the model resource information includes at least one of an identifier of a model file and an identifier of public data.
[0023] On the other hand, the present application provides a task reasoning method, which is applied to a server and further includes:
[0024] Receiving a query request sent by a first client node, wherein the query request includes an inference task identifier and an identifier of public data;
[0025] Determining information of a candidate service node based on the inference task identifier and the identifier of the public data, wherein the candidate service node is a client node that has previously completed inference service registration on the server, and the candidate service node stores at least one of the public data and a model file corresponding to the inference task identifier, and the public data is data used when performing inference using the model file;
[0026] Send the candidate service node information to the first client node.
[0027] In an optional manner, the method further includes:
[0028] receiving a registration request sent by a second client node, wherein the second client node belongs to the candidate service node, the registration request including model resource information of a model-related resource stored by the second client node, the model resource information including at least one of an identifier of the model file and an identifier of the public data;
[0029] The model resource information is stored in correspondence with the identifier of the second client node.
[0030] In an optional manner, the registration request further includes computing resource information of the second client node;
[0031] The method further comprises:
[0032] storing the computing resource information in correspondence with the identifier of the second client node;
[0033] The determining, based on the inference task identifier and the public data identifier, information of the candidate service node includes:
[0034] Based on the inference task identifier, the public data identifier, and the computing resource information and model resource information stored in the server, the information of the candidate service node is determined, wherein the computing resources of the candidate service node meet the inference requirements corresponding to the query request.
[0035] In another aspect, the present application provides a method for task reasoning, the method being applied to a second client node, the second client node storing a model file, the method comprising:
[0036] Receiving an inference request sent by a first client node, wherein the inference request includes an identifier of the model file and indication information of public data, where the public data is data used when performing inference using the model file;
[0037] Using the model file indicated by the identifier of the model file, performing reasoning processing on the public data to obtain a reasoning result;
[0038] The inference result is sent to the first client node.
[0039] In an optional manner, the indication information of the public data includes an identifier of the public data, or the public data; or,
[0040] The public data indication information includes information of only at least one client node storing the public data; the method further includes: acquiring the public data from the at least one client node based on the information of the at least one client node.
[0041] In an optional manner, the inference request further includes proprietary data of the first client node;
[0042] The model file indicated by the identifier of the model file is used to perform reasoning processing on the public data to obtain a reasoning result, including:
[0043] The model file indicated by the identifier of the model file is used to perform inference processing on the public data and the proprietary data to obtain an inference result.
[0044] In an optional manner, the method further includes:
[0045] A registration request is sent to the server, wherein the registration request includes model resource information of the model-related resources stored by the second client node, and the model resource information includes an identifier of the model file.
[0046] On the other hand, the present application provides a task reasoning device, which includes one or more modules, and the one or more modules are used to implement the method described in the first aspect or any optional manner of the first aspect, or to implement the method described in the second aspect or any optional manner of the second aspect, or to implement the method described in the third aspect or any optional manner of the third aspect.
[0047] On the other hand, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method described in the first aspect or any optional manner of the first aspect, or to implement the method described in the second aspect or any optional manner of the second aspect, or to implement the method described in the third aspect or any optional manner of the third aspect.
[0048] Optionally, the computer device is a client node or a server.
[0049] On the other hand, the present application provides a computer-readable storage medium, which stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method described in the first aspect or any optional manner of the first aspect, or to implement the method described in the second aspect or any optional manner of the second aspect, or to implement the method described in the third aspect or any optional manner of the third aspect.
[0050] On the other hand, the present application provides a computer program product, which stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method described in the first aspect or any optional manner of the first aspect, or to implement the method described in the second aspect or any optional manner of the second aspect, or to implement the method described in the third aspect or any optional manner of the third aspect.
[0051] On the other hand, the present application provides a communication system for task reasoning, which includes a first client node, a second client node and a server, the first client node is used to implement the method described in the first aspect or any optional method of the first aspect, the server is used to implement the method described in the second aspect or any optional method of the second aspect, and the second client node is used to implement the method described in the third aspect or any optional method of the third aspect.
[0052] The beneficial effects of the technical solution provided by the embodiments of the present application are:
[0053] A large number of client nodes are organized into a shared service network in a P2P (peer-to-peer) format to support distributed model reasoning. This allows a client node to leverage the computing resources and corresponding data resources of other client nodes when performing tasks, achieving shared network reasoning services and reducing server pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0055] Figure 1 This is a schematic diagram of the system architecture provided by the embodiment of the present application;
[0056] Figure 2 This is a flowchart of the registration method provided in the embodiment of the present application;
[0057] Figure 3 This is a schematic diagram of the registration framework provided in the embodiment of the present application;
[0058] Figure 4 This is a flowchart of a method for task reasoning provided by an embodiment of the present application;
[0059] Figure 5 is a schematic diagram of a candidate service node provided in an embodiment of the present application;
[0060] Figure 6 This is a schematic diagram of the reasoning framework provided by the embodiment of the present application;
[0061] Figure 7 This is a schematic diagram of the structure of a task reasoning device provided in an embodiment of the present application;
[0062] Figure 8 This is another structural diagram of the task reasoning device provided in an embodiment of the present application;
[0063] Figure 9 This is another structural diagram of the task reasoning device provided in an embodiment of the present application;
[0064] Figure 10 This is a schematic diagram of the structure of the client node provided in an embodiment of the present application;
[0065] Figure 11 It is a structural diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0067] The following describes the noun concepts involved in the embodiments of this application.
[0068] 1. P2P network, also known as peer-to-peer network technology, relies on the computing, storage, bandwidth and other resources of each node in the P2P network to achieve collaboration compared to the traditional client and server model, reducing dependence on the server.
[0069] 2. A seed node is a resource service provider in a P2P network. It is responsible for storing the original files of information or resources and sharing them with other nodes. These other nodes can download the required information or resources from the seed node. After completing or partially completing the file download, the requesting node can also become a new seed node to provide services to other requesting nodes.
[0070] 3. AI inference is the process in the AI field where a trained machine learning model processes input data and generates new data results. AI inference relies on the AI model, input data, and the computing power of the device it runs on.
[0071] 4. Model Parallelism
[0072] Model parallelism is a method for splitting a large neural network model into multiple sub-models and distributing these sub-models across different computing nodes for parallel inference. For example, the first few layers of a model can be deployed on edge devices, while deeper layers can be deployed on cloud servers. Each sub-model in parallel runs on an independent device, collaborating to complete the task by exchanging information and sharing parameters. This significantly improves computing resource utilization and accelerates model training.
[0073] The advantage of this technology is that it is suitable for larger models with complex structures, especially some generative models, and can allow some nodes with limited computing resources to jointly implement parallel reasoning.
[0074] 5. Data Parallelism
[0075] Data parallelism is a common approach to parallel reasoning. It divides a dataset into multiple batches or subsets, assigning each batch or subset to a different compute node. Each compute node then runs a complete copy of the model and a different batch or subset of data, performing independent reasoning and then merging the results. This approach is simple to implement and easily scalable, making it applicable to most model reasoning tasks and large-scale data reasoning.
[0076] 6. Tensor Parallelism
[0077] Tensor parallelism is a parallel approach that divides a model's tensors by dimension and assigns them to different compute nodes. Specifically, large tensors are split into rows or columns, with each compute node processing the split tensor fragments. These fragments are then communicated and combined to form a single compute node. This technique is often used in multi-GPU scenarios within a single device. Its advantage is that it is suitable for scenarios with large tensors and can evenly distribute and reduce node memory usage.
[0078] 7. Pipeline Parallelism
[0079] The scenario for pipeline parallelism is that there are obvious stages in the reasoning process. The model is divided into multiple stages in series according to the module sequence, and then each stage is assigned to a different computing node. The calculations and handovers are carried out in sequence to form a pipeline, which can reduce the resource dependence of a single node.
[0080] The above-mentioned model parallelism, data parallelism, tensor parallelism and pipeline parallelism are currently common methods of parallel reasoning. They are currently mainly aimed at server reasoning scenarios and rely on high-performance and low-latency data communication exchange between GPUs.
[0081] Due to the complexity of the models and their requirements for memory and computing power, most current models run primarily on high-performance servers equipped with specialized processing chips such as GPUs and TPUs. This can easily become a computing bottleneck when faced with a large number of concurrent user requests. Meanwhile, user devices such as laptops, phones, tablets, boxes, and IoT (Internet of Things) devices have seen significant increases in computing power in recent years. These devices are often equipped with specialized AI inference chips with a certain level of performance, enabling local client-side inference of small models and gradually becoming a vital resource complement to server inference.
[0082] Based on this, the embodiment of the present application provides a method for task reasoning, which enables the sharing of data resources and computing resources between client nodes in the Internet, effectively reduces the resource usage of the server, improves the scalability of the system, and optimizes the user reasoning service experience and global resource utilization.
[0083] Moreover, the solution of this application can also allow higher-performance client nodes to help other client nodes complete AI model inference tasks, thereby developing new services that realize resource conversion of user computing and storage resources.
[0084] The client node is a node that has a client deployed on it. The client is an application that corresponds to the server deployed on the server. The client node can be a user's terminal device, etc.
[0085] Next, the application scenarios of the embodiments of the present application are described.
[0086] The embodiments of the present application can be applied to any task that uses distributed reasoning for computing. When a first client node executes a task, the server returns information about a client node that can execute the task. The first client node then directly connects to the client node to request execution of the task and receives the reasoning results returned by the client node.
[0087] The task in the embodiment of the present application can be an audio synthesis task, which can also be called an AI singing synthesis service, etc. For example, in a singing client, the user wants to use his own timbre to make an AI singing of a certain song. The user needs to record the dry audio, then select the target song for synthesis, and initiate a request to perform the synthesis task. The client will send a synthesis request to the server, which includes the dry audio and the identifier of the target song. Among them, the dry audio is proprietary data, and proprietary data is relevant data unique to the client node that requests reasoning when performing reasoning, and the target song is public data.
[0088] The tasks in the embodiments of the present application can also be animation synthesis tasks. For example, in an image processing client, if a user wants to create a dynamic image using their own profile picture, the user needs to take a photo in advance, then select the scene of the dynamic image, and initiate a request to execute the animation synthesis task. The photo is proprietary data, while the scene information of the dynamic image is public data.
[0089] In embodiments of the present application, the task may also be a noise reduction task. For example, in an audio processing client, a user may wish to perform noise reduction on a particular song. The user selects the song and the noise reduction request, and initiates a noise reduction task request. The song is proprietary data, while the noise reduction request is public data.
[0090] The above are examples of application scenarios. The embodiments of this application do not limit the application scenarios. Any task that can be applied to reasoning can adopt the solutions in the embodiments of this application.
[0091] Next, the system architecture of the embodiment of the present application is described.
[0092] Figure 1 Provides a structural diagram of the system architecture. Figure 1 As shown, the system architecture includes server and client nodes. Figure 1 1 to 3 are shown. The client nodes are connected to the server via a network. The client nodes include, but are not limited to, mobile phones, tablets, laptops, boxes, or IoT devices. A client is installed on the client nodes.
[0093] The system architecture may include a server that can provide registration and query functions. The registration function refers to registering a client node as a seed node, and the query function refers to querying seed nodes for the client node. The system architecture may also include two servers, one server providing the registration function and the other server providing the query function. The server providing the query function obtains seed node information from the server providing the registration service. In the embodiments of this application, the system architecture includes a single server as an example for description.
[0094] The registration process is as follows, see Figure 2 Steps S101 to S104 in Figure 2 In the description, the client node is taken as the first client node as an example, and the first client node is any node registered in the server.
[0095] Step S101: A first client node sends a registration request to a server, wherein the registration request includes model resource information of model-related resources stored by the first client node, and the model resource information includes at least one of an identifier of a model file and an identifier of public data.
[0096] In this embodiment, the number of users in the network is huge, and the resources and capabilities of different client nodes are also different. After the client in the first client node is started, if it agrees to provide reasoning services to other client nodes, it sends a registration request to the server to register itself as a serviceable seed node on the server. The registration request includes model resource information of model-related resources stored by the first client node. The model resource information includes at least one of the identifier of the model file and the identifier of the public data. The identifier of the model file is the identifier assigned to the model after training is completed and uniquely corresponds to the model file. The identifier of the public data is the identifier assigned when the public data is first generated and uniquely corresponds to the public data. Optionally, when the client in the first client node is started for the first time, if it agrees to provide reasoning services to other client nodes, it sends a registration request to the server.
[0097] The model file represents a model file that can be loaded and inferred on the first client node or server. It is an AI model file and can be the model file of the complete model for the task or the model file of a sub-model split based on the parallel inference mentioned above. Public data refers to the public data resources required for model inference. It can be the full amount of raw business data required for inference, or a fragment of raw business data, or a complete tensor data file generated by pre-processing other models, or a fragment of tensor data file. The public data is full, raw, or tensor data files, and its production and storage depend on the needs of specific model inference. For example, if the task is audio synthesis and the model is an AI model for synthesizing audio, the public data can be the guide audio, which is the raw business data. For the same song, each user can use this guide audio to better understand the pitch and rhythm. Alternatively, the public data can be slices of the guide audio with a certain length (e.g., 30 seconds), which are fragments of the raw business data. Alternatively, the public data can be tensor representations generated by extracting features from the guide audio, that is, processed data from the raw business data.
[0098] Step S102: The server receives a registration request.
[0099] Step S103: The server stores the model resource information of the first client node in correspondence with the identifier of the first client node.
[0100] Optionally, the server further stores the network connection information and model resource information of the first client node in correspondence with the identifier of the first client node.
[0101] The network connection information includes but is not limited to IP (internet protocol) address, port and supported protocols.
[0102] In an alternative approach, such as Figure 3 As shown, two databases are set up on the server, one database is an index library for public data, which stores the correspondence between the identifiers of public data and the identifiers of client nodes. In the index library, the identifier of public data is stored as a primary key, and the identifier of the client node storing the public data is recorded. The other database is an index library for model files, which stores the correspondence between the identifier of model files and the identifier of client nodes. In the database, the identifier of model files is stored as a primary key, and the identifier of the client node storing the model files is recorded.
[0103] After receiving the registration request, if the public data index does not include the identifier of the public data sent by the first client node, the server adds a correspondence between the identifier of the public data and the identifier of the first client node to the index. If the public data index does include the identifier of the public data sent by the first client node, the server adds the identifier of the first client node to the list of client node identifiers corresponding to the public data identifier. If the model file index does not include the identifier of the model file sent by the first client node, the server adds a correspondence between the identifier of the model file and the identifier of the first client node to the index. If the model file index does include the identifier of the model file sent by the first client node, the server adds the identifier of the first client node to the list of client node identifiers corresponding to the model file identifier.
[0104] Here, two databases are used as an example for explanation. In another optional method, the identifier of the public data and the identifier of the model file are stored in the same database.
[0105] In an optional manner, the first client node may also send computing resource information to the server after the client is started, where the computing resource information includes relevant information of a CPU (central processing unit), a GPU, a TPU or an inference framework.
[0106] After receiving the computing resource information, the server stores the computing resource information in correspondence with the identifier of the first client node.
[0107] Optionally, the computing resource information may also be stored as detailed information of the first client node, where the detailed information includes but is not limited to the computing resource information and network connection information of the first client node.
[0108] In an optional manner, resources on the first client node may be updated, such as when a new model file appears, new public data appears, public data is deleted, or a model file is deleted. In this case, the first client node sends an update request to the server, indicating the change information of the resources on the first client node. After receiving the update request, the server uses the change information to update the resource information corresponding to the identifier of the first client node.
[0109] In an optional manner, after the network connection information of the first client node changes, the first client node sends an update request to the server to update the network connection information.
[0110] Step S104: The server sends a registration result to the first client node.
[0111] When the registration is successful, the registration result indicates that the registration is successful; when the registration fails, the registration result indicates that the registration fails.
[0112] The first client node sends a registration request, and the server stores the correspondence between the identifiers of each model file and the identifier of the first client node, and also stores the correspondence between the identifier of the public data and the identifier of the first client node.
[0113] Here, the first client node registers on the server as an example for explanation. The registration method of other client nodes is the same and will not be repeated here. In this way, the server stores the client node list corresponding to the identifier of each model file and the identifier of the client node corresponding to each public data.
[0114] Next, we describe the reasoning process, which is as follows: Figure 4 Steps S201 to S210 in Figure 4 In the example, the first client node requests to perform inference.
[0115] Step S201: A first client node sends a query request to a server, wherein the query request includes an inference task identifier and an identifier of public data.
[0116] In this embodiment, the first client node is any client node that needs to perform reasoning. When the first client node needs to request reasoning, it sends a query request to the server, where the query request includes a reasoning task identifier and a public data identifier.
[0117] In an optional manner, the reasoning task identifier includes the identifiers of one or more model files used when executing the reasoning task. For example, before executing the reasoning task, the first client node splits the reasoning task into multiple subtasks based on a preset parallel reasoning rule, and each subtask corresponds to a model file. Here, the reasoning task identifier may include the identifiers of the model files corresponding to the multiple subtasks, or may include the identifier of the model file corresponding to one of the multiple subtasks. In other words, the first client node may request the storage nodes of multiple model files at one time, or may request the storage nodes of one model file at a time. Here, the multiple subtasks may all be executed by the server or other client nodes, or some of the multiple subtasks may be executed by the server or other client nodes, and the other part of the subtasks may be executed by itself.
[0118] Alternatively, the inference task identifier is the identifier of the inference task. For example, if the inference task is an audio synthesis task, the inference task identifier is the audio synthesis identifier. In this way, when the inference task corresponds to multiple model files, a single request is required to obtain client nodes that execute multiple model files, saving transmission resources.
[0119] Step S202: The server receives a query request sent by the first client node, wherein the query request includes an inference task identifier and an identifier of public data.
[0120] In step S203, the server determines the information of the candidate service node based on the inference task identifier and the public data identifier, wherein the candidate service node is a client node that stores the model file corresponding to the public data inference task identifier and registers for inference service on the server. The public data is the data used when performing inference using the model file.
[0121] In this embodiment, if the inference task identifier is the identifier of the inference task, the server determines the identifier of the model file corresponding to the identifier of the inference task in the correspondence between the identifier of the inference task and the identifier of the model file. The model file is the model file used to perform the inference task, and there are one or more model files. For example, the inference task is an audio synthesis task, and there are four models for performing the inference task, namely, a song feature processing model, a voice feature and song fusion model, a decoder model, and a dry sound and accompaniment synthesis model. For another example, the inference task is a noise reduction task, and there is one model for performing the inference task. For another example, the inference task is an audio synthesis task, and there is one model for performing the inference task. The user's dry sound audio and the target song are input into the model, and the output of the model is the synthesized audio.
[0122] If the inference task identifier includes the identifier of the model file, the server can directly obtain the identifier of the model file.
[0123] The server then obtains the identifier of the client node that stores the model file corresponding to the inference task identifier in the client node list corresponding to the model file identifier to obtain set A, and obtains the identifier of the client node that stores the public data in the query request in the client node list corresponding to the public data to obtain set B. The intersection of set A and set B is taken to obtain the client node that stores both the model file and the public data.
[0124] In some cases, client nodes may only store model files or only store public data. The candidate service nodes may also include client nodes that only store model files and client nodes that only store public data. For example, the server removes client nodes that store both model files and public data from Set A to obtain client nodes that only store model files, thereby obtaining Set C. Furthermore, the server removes client nodes that store both model files and public data from Set B to obtain client nodes that only store public data, thereby obtaining Set D. The resulting intersection is then combined with Sets C and D to obtain candidate service nodes. This intersection is the result of intersecting Sets A and B.
[0125] The server determines information about each client node among the candidate service nodes. This information may include network connection information and the client node's node type, or alternatively, the client node's identifier and the client node's node type, where the node type indicates whether the node can provide both model files and public data. For example, the node type of client node 1 is 00, indicating that both model files and public data are stored. The node type of client node 2 is 01, indicating that model files are stored but public data is not. The node type of client node 3 is 10, indicating that model files are not stored but public data is stored.
[0126] In an optional manner, after determining the candidate service nodes, the server may also use computing resource information to exclude client nodes with insufficient computing power.
[0127] Optionally, the server may periodically communicate with each client node to determine the computing power of each client node.
[0128] In an optional manner, if the resources of the server performing the inference are insufficient, step S203 is executed. If the resources of the server performing the inference are sufficient, the server may be given priority for inference. For example, after receiving the query request, the server determines that the resources of the server performing the inference are sufficient, and may send the network connection information of the server performing the inference to the first client node. The first client node sends an inference request to the server performing the inference, and the inference request includes the identifier of the model file and the identifier of the public data. After receiving the inference request, the server performing the inference sends the inference result to the first client node. For another example, when executing a task, the first client node first sends a query request to the server, and the task execution request includes the identifier of the public data, the identifier of the model file, and proprietary data. After receiving the query request, the server determines that the resources of the server performing the task inference are insufficient, and then determines the information of the candidate service node.
[0129] The process of determining whether the resources of the server performing reasoning are sufficient is: determining the utilization and memory occupancy of the computing resources performing reasoning in the server. When the utilization of the computing resources exceeds the utilization threshold and / or the memory occupancy exceeds the memory threshold, it is determined that the server resources are insufficient; otherwise, it is determined that the server resources are sufficient.
[0130] In the following text, for the convenience of description, the client nodes that store both model files and public data are called the first type of nodes, the client nodes that only store model files are called the second type of nodes, and the client nodes that only store public data are called the third type of nodes. Figure 5 ,exist Figure 5In the example, client node 1 and client node 2 belong to the first type of nodes, client node N belongs to the second type of nodes, and client node M belongs to the third type of nodes.
[0131] In addition, if the server does not obtain a client node with an identifier corresponding to the model file in the client node list corresponding to the model file, a failure message is sent to the first client node, along with an error identifier indicating no matching node. Furthermore, if the server does not obtain a client node with an identifier corresponding to the public data in the client node list corresponding to the public data, a failure message is sent to the first client node, along with an error identifier indicating no matching node.
[0132] Alternatively, if the server does not obtain a client node corresponding to the model file identifier in the client node list corresponding to the model file, the server uses the model file identifier to determine the model file, runs the model file, and performs inference processing on the public data and the proprietary data to obtain an inference result. The server then sends the inference result to the first client node.
[0133] In an optional manner, after the first client node sends a query request to the server, a prompt message indicating that the query is being processed is displayed to the user.
[0134] Step S204: The server sends information of candidate service nodes to the first client node.
[0135] In an optional manner, when there are multiple model files indicated by the reasoning task identifier, in the candidate service node, the server determines the identifier of the model file stored by each client node, and the model file belongs to the model file indicated by the reasoning task identifier, and the server sends the identifier of the model file stored by each client node to the first client node.
[0136] Step S205: The first client node receives the candidate service node information sent by the server.
[0137] Step S206: The first client node sends an inference request to a second client node among the candidate service nodes, wherein the second client node stores a model file, and the inference request includes an identifier of the model file and indication information of public data.
[0138] In this embodiment, the first client node selects a second client node from candidate service nodes. The second client node stores at least a model file. The first client node uses the network connection information of the second client node to send an inference request to the second client node. The inference request includes an identifier of the model file and information indicating public data. Alternatively, the first client node uses the identifier of the second client node to obtain the network connection information of the second client node from a server and sends the inference request to the second client node.
[0139] If there is a first-category node among the candidate service nodes, then a second client node is randomly selected from the first-category nodes. If there is no first-category node, or the inference result cannot be obtained from the first-category node, then a second client node is randomly selected from the second-category nodes.
[0140] Here, failure to obtain inference results from the first-category node includes, but is not limited to, the following situations: 1. The first client node is unable to establish a connection with all client nodes in the first category; 2. The first client node fails to receive an inference result for a long period of time after sending the inference request mentioned below; 3. The first client node receives a message indicating an inference error. For example, the first client node sends an inference request to the first client node in the first category. If the first client node does not return an inference result, the first client node sends the inference request to the second client node in the first category. If the second client node does not return an inference result, the first client node continues to send the inference request to the next client node until an inference result is received, or the inference request has been sent to all client nodes in the first category.
[0141] In an optional manner, when the second client node stores public data, the indication information of the public data includes an identifier of the public data.
[0142] In an optional manner, when the second client node does not store public data, the indication information of the public data includes an identifier of the public data and network connection information of at least one client node in the third type of nodes.
[0143] In another optional embodiment, if the second client node does not store public data, before the first client node sends an inference request to the second client node, the first client node sends a request to a third client node in the third category of nodes, where the request includes an identifier for the public data. The third client node receives the request, parses it to obtain the identifier for the public data, and sends the public data to the first client node. The first client node receives the public data. In this case, the public data indication information in the inference request includes the public data.
[0144] Here, if the first client node fails to obtain the public data from the third client node, the first client node requests other nodes in the third type of node to obtain the public data. If no public data is obtained, it is determined that the reasoning task execution has failed.
[0145] In an optional manner, if the inference task corresponds to multiple model files, when selecting the second client node, the second client node is preferentially selected from the client nodes including the multiple model files.
[0146] It should be noted that if the first client node and the second client node are not in the same local area network, the first client node communicates with the second client node through technologies such as hole punching, and the embodiment of the present application does not limit the specific communication method.
[0147] Step S207: The second client node receives the inference request sent by the first client node.
[0148] In this embodiment, the second client node receives the inference request sent by the first client node, and parses the inference request to obtain the identifier of the model file and the indication information of the public data.
[0149] In the case that the indication information of the public data only includes the identifier of the public data, the second client node obtains the model file indicated by the identifier of the model file from the stored model files, and obtains the public data indicated by the identifier of the public data from the stored public data.
[0150] When the public data indication information includes an identifier for the public data and network connection information for at least one client node from the third category of nodes, the second client node retrieves the model file from the stored model file and sends a request to one of the at least one client node. The request includes the identifier for the public data. After receiving the request, the client node sends the public data to the second client node. The second client node receives the public data. If the second client node fails to obtain the public data from the at least one client node, it returns an indication of an inference error to the first client node. In this case, the public data is transmitted between the second client node and the client node storing the public data without passing through the first client node, thus conserving transmission resources.
[0151] In a case where the indication information of the public data includes the public data, the second client node obtains the model file indicated by the identifier of the model file from the stored model files.
[0152] Step S208: The second client node uses the model file indicated by the identifier of the model file to perform inference processing on the public data to obtain an inference result.
[0153] In this embodiment, the second client node runs the model file and performs inference processing on the public data to obtain an inference result. For example, the second client node preprocesses the public data and inputs the preprocessed public data into the running model file to obtain an inference result.
[0154] It should be noted that if the current reasoning does not rely on the specific information of the first client node (such as proprietary data), and the second client node has performed the same reasoning calculation in the past and has historical results, the cached results can also be returned directly.
[0155] Step S209: The second client node sends the inference result to the first client node.
[0156] In step S210 , the first client node receives the inference result sent by the second client node.
[0157] exist Figure 4 In the illustrated process, when performing task inference, unique information specific to the first client node may exist. This unique information can be called proprietary data. The inference request also includes the proprietary data of the first client node. Proprietary data serves as input data for the model. The proprietary data varies in different scenarios. For example, in an audio synthesis scenario, the proprietary data is the dry audio data, while in a noise reduction scenario, the proprietary data is the audio data to be denoised.
[0158] When performing task reasoning, the second client node uses the proprietary data and the public data as inputs of the model file to obtain the reasoning result.
[0159] For ease of understanding, a flowchart is also provided in the embodiments of this application, see Figure 6 .
[0160] In addition, in an embodiment of the present application, after the second client node sends the inference result to the first client node, it can send an indicator of successful task execution to the server. The server determines the number of points corresponding to the inference task indicator and issues the points corresponding to the number of points to the second client node. In this way, the second client node can obtain the points corresponding to the number of points. The second client node can then use the points to redeem content such as client usage rights.
[0161] If the third client node provides public data, it can send a public data provision message to the server. The server determines the number of points corresponding to the public data and issues that number of points to the third client node. In this way, the third client node can obtain the corresponding number of points. The third client node can then redeem the points for client usage rights and other content.
[0162] It should be noted that when an inference task corresponds to multiple model files, if the multiple model files can run in parallel (for example, if the input of the next model file has no dependency on the inference result of the previous model file, then the multiple model files can run in parallel), then the first client node can request multiple other client nodes to perform task inference in parallel. The first client node aggregates the multiple inference results to obtain the final inference result. If the multiple model files cannot run in parallel (for example, if the input of the next model file is the inference result of the previous model file, then the multiple model files cannot run in parallel), then the first client node sequentially requests multiple other client nodes to perform task inference.
[0163] In the embodiments of the present application, a large number of client nodes are combined in a P2P format to form a shared service network that supports reasoning. Client nodes can leverage the computing and data resources of other client nodes to implement shared network reasoning services. On the one hand, this reduces the high computing power costs of relying solely on servers, thereby achieving better scalability. On the other hand, the P2P network based on data and computing reduces unnecessary data transmission, which also improves reasoning speed and provides basic support for the sharing of computing power between client nodes.
[0164] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.
[0165] Based on the same technical concept, the embodiment of the present application also provides a task reasoning device, which is applied to a first client node, such as Figure 7 As shown, the apparatus includes a sending module 710 and a receiving module 720, wherein:
[0166] The sending module 710 is used to send a query request to the server, wherein the query request includes an inference task identifier and a public data identifier;
[0167] The receiving module 720 is configured to receive information about a candidate service node returned by the server, wherein the candidate service node is a client node that has previously completed inference service registration with the server, and the candidate service node stores at least one of the public data and a model file corresponding to the inference task identifier, wherein the public data is data used when performing inference using the model file;
[0168] The sending module 710 is further configured to send an inference request to a second client node among the candidate service nodes, wherein the second client node stores the model file, and the inference request includes an identifier of the model file and indication information of the public data;
[0169] The receiving module 720 is further configured to receive the inference result returned by the second client node.
[0170] In an optional manner, the device further includes a determining module configured to:
[0171] Before sending an inference request to a second client node among the candidate service nodes, if there is a client node among the candidate service nodes that stores the model file and the public data, then the second client node is selected from the client nodes that store the model file and the public data; if there is no client node that stores the model file and the public data, or the inference result is not obtained from the client node that stores the model file and the public data, then the second client node is selected from the client nodes that store the model file and do not store the public data.
[0172] In an optional manner, when the second client node stores the public data, the indication information of the public data is an identifier of the public data;
[0173] In the case that the second client node does not store the public data, the indication information of the public data includes an identifier of the public data and information of at least one client node in the candidate service node that stores the public data; or
[0174] In the case that the second client node does not store the public data, the indication information of the public data includes the public data; the sending module 710 is also used to send an acquisition request to a third client node in the candidate service node that stores the public data before sending an inference request to the second client node in the candidate service node, wherein the acquisition request is used to request to obtain the public data; the receiving module 720 is also used to receive the public data sent by the third client node.
[0175] In an optional manner, the information of the candidate service node includes network connection information of the candidate service node;
[0176] The sending module 710 is further configured to send the inference request to the second client node based on the network connection information of the second client node.
[0177] In an optional manner, the inference request further includes proprietary data of the first client node.
[0178] In an optional manner, the sending module 710 is also used to send a registration request to the server, wherein the registration request includes model resource information of the model-related resources stored by the first client node, and the model resource information includes at least one of an identifier of a model file and an identifier of public data.
[0179] Based on the same technical concept, the embodiment of the present application also provides a task reasoning device, which is applied to a server, such as Figure 8 As shown, the apparatus includes a receiving module 810, a determining module 820, and a sending module 830, wherein:
[0180] The receiving module 810 is configured to receive a query request sent by a first client node, wherein the query request includes an inference task identifier and a public data identifier;
[0181] The determining module 820 is configured to determine information of a candidate service node based on the inference task identifier and the public data identifier, wherein the candidate service node is a client node that has previously completed inference service registration on the server, and the candidate service node stores at least one of the public data and a model file corresponding to the inference task identifier, and the public data is data used when performing inference using the model file;
[0182] The sending module 830 is configured to send the information of the candidate service node to the first client node.
[0183] In an optional manner, the receiving module 810 is further configured to receive a registration request sent by a second client node, wherein the second client node belongs to the candidate service node, and the registration request includes model resource information of a model-related resource stored by the second client node, wherein the model resource information includes at least one of an identifier of the model file and an identifier of the public data;
[0184] The model resource information is stored in correspondence with the identifier of the second client node.
[0185] In an optional manner, the registration request further includes computing resource information of the second client node;
[0186] The receiving module 810 is further configured to store the computing resource information in correspondence with the identifier of the second client node;
[0187] The determination module 820 is used to determine the information of the candidate service node based on the reasoning task identifier, the public data identifier, and the computing resource information and model resource information stored in the server, wherein the computing resources of the candidate service node meet the reasoning requirements corresponding to the query request.
[0188] Based on the same technical concept, the embodiment of the present application also provides a task reasoning device, which is applied to the second client node, such as Figure 9 As shown, the apparatus includes a receiving module 910, an inference module 920, and a sending module 930, wherein:
[0189] The receiving module 910 is configured to receive an inference request sent by a first client node, wherein the inference request includes an identifier of the model file and indication information of public data, where the public data is data used when performing inference using the model file;
[0190] The reasoning module 920 is used to use the model file indicated by the identifier of the model file to perform reasoning processing on the public data to obtain a reasoning result;
[0191] The sending module 930 is used to send the inference result to the first client node.
[0192] In an optional manner, the indication information of the public data includes an identifier of the public data, or the public data; or,
[0193] The indication information of the public data includes information of only at least one client node storing the public data; the sending module 930 is further configured to obtain the public data from the at least one client node based on the information of the at least one client node.
[0194] In an optional manner, the inference request further includes proprietary data of the first client node;
[0195] The reasoning module 920 is configured to use the model file indicated by the identifier of the model file to perform reasoning processing on the public data and the proprietary data to obtain a reasoning result.
[0196] In an optional manner, the sending module 930 is configured to send a registration request to the server, wherein the registration request includes model resource information of the model-related resources stored by the second client node, and the model resource information includes an identifier of the model file.
[0197] It should be noted that the task reasoning apparatus provided in the above embodiments uses the division of the aforementioned functional modules as an example only. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the task reasoning apparatus provided in the above embodiments and the task reasoning method embodiments are based on the same concept. The specific implementation process is detailed in the method embodiments and will not be repeated here.
[0198] In the embodiments of the present application, both the client node and the server can be understood as computer devices.
[0199] Figure 10 The following is a block diagram of a client node 600 according to an exemplary embodiment of the present application. The client node 600 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The client node 600 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other similar terminology.
[0200] Typically, the client node 600 includes a processor 601 and a memory 602 .
[0201] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0202] The memory 602 may include one or more computer-readable storage media, which may be non-transitory, and may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
[0203] In some embodiments, client node 600 may also optionally include a peripheral device interface 603 and at least one peripheral device. Processor 601, memory 602, and peripheral device interface 603 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 603 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608, and a power supply 609.
[0204] The peripheral device interface 603 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0205] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 604 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0206] Display screen 605 is used to display a user interface (UI). This UI can include graphics, text, icons, videos, or any combination thereof. When display screen 605 is a touchscreen display, it can also capture touch signals on or above the surface of display screen 605. These touch signals can be input as control signals to processor 601 for processing. Display screen 605 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 605, located on the front panel of client node 600. In other embodiments, there can be at least two display screens 605, located on different surfaces of client node 600 or in a foldable design. In still other embodiments, display screen 605 can be a flexible display screen, located on a curved or foldable surface of client node 600. Display screen 605 can also be configured as a non-rectangular, irregular shape, also known as a special-shaped screen. Display screen 605 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0207] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0208] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 601 for processing, or input into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the client node 600. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0209] The positioning component 608 is used to locate the current geographic location of the client node 600 to implement navigation or LBS (Location Based Service). The positioning component 608 can be a positioning component based on the GPS (Global Positioning System), Beidou system or Galileo system.
[0210] Power supply 609 is used to power various components in client node 600. Power supply 609 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 609 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also support fast charging technology.
[0211] In some embodiments, the client node 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
[0212] The accelerometer 611 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the client node 600. For example, the accelerometer 611 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 611. The accelerometer 611 can also be used to collect game or user motion data.
[0213] The gyroscope sensor 612 can detect the body direction and rotation angle of the client node 600. The gyroscope sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D movements on the client node 600. Based on the data collected by the gyroscope sensor 612, the processor 601 can implement the following functions: motion sensing (such as changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0214] The pressure sensor 613 can be installed on the side frame of the client node 600 and / or the lower layer of the display screen 605. When the pressure sensor 613 is installed on the side frame of the client node 600, it can detect the user's grip signal of the client node 600, and the processor 601 can perform left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 613. When the pressure sensor 613 is installed on the lower layer of the display screen 605, the processor 601 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 605. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0215] The fingerprint sensor 614 is used to collect the user's fingerprint. The processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is recognized as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, such as unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the client node 600. When the client node 600 is provided with a physical button or manufacturer logo, the fingerprint sensor 614 can be integrated with the physical button or manufacturer logo.
[0216] Optical sensor 615 is used to detect ambient light intensity. In one embodiment, processor 601 can control the display brightness of display screen 605 based on the ambient light intensity detected by optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of display screen 605 is increased; when the ambient light intensity is low, the display brightness of display screen 605 is decreased. In another embodiment, processor 601 can also dynamically adjust the shooting parameters of camera assembly 606 based on the ambient light intensity detected by optical sensor 615.
[0217] Proximity sensor 616, also known as a distance sensor, is typically located on the front panel of client node 600. Proximity sensor 616 is used to detect the distance between the user and the front of client node 600. In one embodiment, when proximity sensor 616 detects that the distance between the user and the front of client node 600 is gradually decreasing, processor 601 controls display screen 605 to switch from a screen-on state to a screen-off state. When proximity sensor 616 detects that the distance between the user and the front of client node 600 is gradually increasing, processor 601 controls display screen 605 to switch from a screen-off state to a screen-on state.
[0218] Those skilled in the art will understand that Figure 10 The structure shown in the figure does not constitute a limitation to the client node 600, and the client node 600 may include more or fewer components than shown in the figure, or combine some components, or adopt a different component arrangement.
[0219] Figure 11 1 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1000 may vary significantly due to different configurations or performance, and may include one or more processors (central processing units, CPUs) 1001 and one or more memories 1002. The memories 1002 store at least one instruction, which is loaded and executed by the processor 1001 to implement the methods provided in the above-mentioned various method embodiments. Of course, the computer device may also have components such as a wired or wireless network interface, a keyboard, and input / output interfaces for input and output. The computer device may also include other components for implementing device functions, which will not be described in detail here.
[0220] In an exemplary embodiment, a computer-readable storage medium is further provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal to complete the method of task reasoning in the above embodiment. The computer-readable storage medium can be non-transitory. For example, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, and an optical data storage device.
[0221] It should be noted that the information involved in this application (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals (including but not limited to signals transmitted between user terminals and other devices, etc.) are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the reasoning-related information involved in this application is obtained with full authorization.
[0222] In this application, the terms "first" and "second" are used to distinguish between identical or similar items with substantially the same function. It should be understood that there is no logical or temporal dependency between "first" and "second," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," etc. to describe various elements, these elements should not be limited by these terms. These terms are simply used to distinguish one element from another.
[0223] The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more.
[0224] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" describes an association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exists simultaneously, and B exists alone.
[0225] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0226] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A task reasoning method, characterized in that: The method is applied to a first client node, and the method includes: Sending a query request to the server, wherein the query request includes an inference task identifier and an identifier of the public data; Receiving information of a candidate service node returned by the server, wherein the candidate service node is a client node that has previously completed inference service registration with the server, and the candidate service node stores at least one of the public data and a model file corresponding to the inference task identifier, and the public data is data used when performing inference using the model file; Sending an inference request to a second client node among the candidate service nodes, wherein the second client node stores the model file, and the inference request includes an identifier of the model file and indication information of the public data; Receive the inference result returned by the second client node.
2. The method according to claim 1, characterized in that Before sending the inference request to the second client node among the candidate service nodes, the method further includes: Among the candidate service nodes, if there is a client node that stores the model file and the public data, then the second client node is selected from the client nodes that store the model file and the public data; if there is no client node that stores the model file and the public data, or the inference result is not obtained from the client node that stores the model file and the public data, then the second client node is selected from the client nodes that store the model file and do not store the public data.
3. The method according to claim 1, characterized in that In the case where the second client node stores the public data, the indication information of the public data is an identifier of the public data; In the case that the second client node does not store the public data, the indication information of the public data includes an identifier of the public data and information of at least one client node in the candidate service node that stores the public data; or In the case that the second client node does not store the public data, the indication information of the public data includes the public data; before sending the inference request to the second client node among the candidate service nodes, the method further includes: sending an acquisition request to a third client node among the candidate service nodes that stores the public data, wherein the acquisition request is used to request to obtain the public data; and receiving the public data sent by the third client node.
4. The method according to any one of claims 1 to 3, characterized in that The information of the candidate service node includes network connection information of the candidate service node; The sending an inference request to a second client node among the candidate service nodes includes: The inference request is sent to the second client node based on the network connection information of the second client node.
5. The method according to any one of claims 1 to 3, characterized in that The inference request also includes data specific to the first client node.
6. The method according to any one of claims 1 to 3, characterized in that The method further comprises: A registration request is sent to the server, wherein the registration request includes model resource information of the model-related resources stored by the first client node, and the model resource information includes at least one of an identifier of a model file and an identifier of public data.
7. A method for task reasoning, characterized in that: The method is applied to a server and includes: Receiving a query request sent by a first client node, wherein the query request includes an inference task identifier and an identifier of public data; Determining information of a candidate service node based on the inference task identifier and the identifier of the public data, wherein the candidate service node is a client node that has previously completed inference service registration on the server, and the candidate service node stores at least one of the public data and a model file corresponding to the inference task identifier, and the public data is data used when performing inference using the model file; Send the candidate service node information to the first client node.
8. The method according to claim 7, characterized in that The method further comprises: receiving a registration request sent by a second client node, wherein the second client node belongs to the candidate service node, the registration request including model resource information of a model-related resource stored by the second client node, the model resource information including at least one of an identifier of the model file and an identifier of the public data; The model resource information is stored in correspondence with the identifier of the second client node.
9. The method according to claim 8, characterized in that The registration request also includes computing resource information of the second client node; The method further comprises: storing the computing resource information in correspondence with the identifier of the second client node; The determining, based on the inference task identifier and the public data identifier, information of the candidate service node includes: Based on the inference task identifier, the public data identifier, and the computing resource information and model resource information stored in the server, the information of the candidate service node is determined, wherein the computing resources of the candidate service node meet the inference requirements corresponding to the query request.
10. A method for task reasoning, characterized in that: The method is applied to a second client node, where the second client node stores a model file, and includes: Receiving an inference request sent by a first client node, wherein the inference request includes an identifier of the model file and indication information of public data, where the public data is data used when performing inference using the model file; Using the model file indicated by the identifier of the model file, performing reasoning processing on the public data to obtain a reasoning result; The inference result is sent to the first client node.
11. The method according to claim 10, characterized in that The indication information of the public data includes an identifier of the public data, or the public data; or, The public data indication information includes information of only at least one client node storing the public data; the method further includes: acquiring the public data from the at least one client node based on the information of the at least one client node.
12. The method according to claim 10 or 11, characterized in that The inference request also includes proprietary data of the first client node; The model file indicated by the identifier of the model file is used to perform reasoning processing on the public data to obtain a reasoning result, including: The model file indicated by the identifier of the model file is used to perform inference processing on the public data and the proprietary data to obtain an inference result.
13. The method according to claim 10 or 11, characterized in that The method further comprises: A registration request is sent to the server, wherein the registration request includes model resource information of the model-related resources stored by the second client node, and the model resource information includes an identifier of the model file.
14. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operation performed by the task reasoning method according to any one of claims 1 to 6, or any one of claims 7 to 9, or any one of claims 10 to 13.
15. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the task reasoning method according to any one of claims 1 to 6, or any one of claims 7 to 9, or any one of claims 10 to 13.
16. A computer program product, characterized in that The computer program product stores at least one instruction, which is loaded and executed by a processor to implement the operations performed by the task reasoning method according to any one of claims 1 to 6, or any one of claims 7 to 9, or any one of claims 10 to 13.