Task reasoning method, device and equipment
By using the load balancing strategy and the dispatch center to quickly allocate work nodes in the preset scheduling platform, and using large language models to process model inference tasks, the problem of inference task allocation in a multi-worker node environment is solved, and efficient task inference and result output are achieved.
Patent Information
- Application Number
- CN202410836466.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-17
AI Technical Summary
In the case of multiple working nodes, how to quickly allocate corresponding working nodes to model inference tasks to ensure the timeliness of inference tasks is an issue that has yet to be solved.
By adopting a load balancing strategy in the preset scheduling platform, the inference tasks are obtained from the domain name server, and the target scheduling group is selected based on the preset strategy. The target working node is selected from the idle working nodes through the dispatching center, and the preloaded large language is used. The model handles inference tasks.
It realizes the rapid and effective allocation of inference tasks to corresponding scheduling groups and work nodes, ensuring the timeliness and efficiency of inference tasks. It also solves the problem of private and non-standard interfaces provided by large language models by uniformly encapsulating protocol output results. .
Smart Images

Figure CN118656191A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of model reasoning, and in particular to a task reasoning method, device and equipment. Background Art
[0002] A cloud server can contain one or more GPUs (Graphics Processing Units). One GPU corresponds to one video memory, that is, one worker node. The video memory used to deploy a single large language model is large, so generally one worker node can only deploy one model. In addition, when a single worker node runs a single model, the total time it takes to infer two tasks at the same time is usually greater than the total time it takes to execute the two tasks in series. Therefore, in general, a worker node only performs inference on one work task at a time. However, in the case of multiple worker nodes, when a model inference task is received, how to quickly assign the corresponding worker node to the model inference task is a problem that needs to be solved. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a task reasoning method, device, equipment and storage medium, which can quickly allocate reasoning tasks to corresponding scheduling groups by adopting a load balancing strategy, and quickly allocate corresponding working nodes to reasoning tasks through the scheduling center in the scheduling group, so as to complete the reasoning of reasoning tasks, thereby ensuring the timeliness of reasoning tasks. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a task reasoning method, which is applied to a preset scheduling platform, wherein the preset scheduling platform includes a domain name server and at least one scheduling group; each of the scheduling groups includes a scheduling center and a plurality of working nodes; a large language model is pre-loaded in the working node; wherein the method includes:
[0005] Acquire the inference task sent by the service side through the domain name server, select a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy, and send the inference task to the target scheduling group;
[0006] Selecting a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the reasoning task by a target scheduling center in the target scheduling group;
[0007] The inference task assigned by the target scheduling center is obtained through the target working node, and the inference task is inferred based on the large language model to obtain an inference result.
[0008] Optionally, the reasoning task includes a model identifier; the model identifier includes a model name and / or a model identification number;
[0009] Correspondingly, the selecting of a target working node from a plurality of working nodes in an idle state in the target scheduling group by the target scheduling center in the target scheduling group based on the reasoning task includes:
[0010] The target scheduling center selects a target working node from a number of working nodes in the target scheduling group that are in an idle state based on the model identifier; wherein the target working node is pre-loaded with a large language model corresponding to the model identifier.
[0011] Optionally, selecting a target working node from a plurality of working nodes in the target scheduling group that are in an idle state by the target scheduling center based on the model identifier includes:
[0012] If there are multiple model identifiers, the target scheduling center selects a corresponding target working node from a plurality of working nodes in an idle state in the target scheduling group based on each model identifier;
[0013] Accordingly, obtaining the reasoning task assigned by the target scheduling center through the target working node, and reasoning the reasoning task based on the large language model to obtain a reasoning result, includes:
[0014] The inference tasks assigned by the target scheduling center are respectively obtained through each of the target working nodes, and the inference tasks are inferred based on the sub-inference results of the previous working node through the large language model in each of the target working nodes according to the node inference order, and the final inference result is obtained after the last working node completes the inference of the inference task;
[0015] Among them, for the first working node in the node reasoning sequence, the sub-inference result of the previous working node is empty.
[0016] Optionally, before selecting the target working node from a plurality of working nodes in the target scheduling group that are in an idle state based on the reasoning task by the target scheduling center in the target scheduling group, the method further includes:
[0017] The target scheduling center obtains the respective operating states reported by a plurality of working nodes in the target scheduling group based on a preset heartbeat rate, and stores the operating states corresponding to the working nodes.
[0018] Optionally, acquiring the reasoning task assigned by the target scheduling center through the target working node, and reasoning the reasoning task based on the large language model to obtain a reasoning result, includes:
[0019] Obtaining the reasoning task assigned by the target scheduling center through the target working node, switching its own running state from an idle state to a busy state, and reasoning the reasoning task based on a large language model;
[0020] If the reasoning of the reasoning task is normal, the reasoning result is obtained through the target working node, and the reasoning result is sent to the target scheduling center, and the operating state of the node is switched from the busy state to the idle state;
[0021] If the reasoning task is abnormal, the target working node switches its own operating state from busy state to alarm state, and sends the reasoning task to the target scheduling center so that the target scheduling center reselects a new working node for the reasoning task.
[0022] Optionally, after the target working node switches its own running state from a busy state to an alarm state, the method further includes:
[0023] Perform reasoning based on a built-in test task using the large language model in the target working node;
[0024] If the test task reasoning is normal, the target working node switches its own running state from the warning state to the idle state;
[0025] If the test task reasoning is abnormal, an alarm message is sent to the platform management side through the target working node, so that the platform management side can take the target working node offline, restart the offline target working node, and put it back online.
[0026] Optionally, after the reasoning task is reasoned based on the large language model to obtain a reasoning result, the method further includes:
[0027] The target scheduling center encapsulates the inference result based on a preset unified encapsulation protocol, and outputs the encapsulated result to the business side.
[0028] Optionally, the preset scheduling platform further includes a cloud provider abstraction layer, the cloud provider abstraction layer is connected to multiple cloud providers and is connected to the scheduling center in the scheduling group through a unified interface;
[0029] Correspondingly, the selecting a target scheduling group corresponding to the reasoning task from the at least one scheduling group based on a preset load balancing strategy includes:
[0030] If the scheduling groups are grouped according to the cloud provider, selecting a target scheduling group corresponding to the cloud provider information included in the inference task from the at least one scheduling group;
[0031] If the scheduling groups are grouped according to regions, selecting a target scheduling group corresponding to the region information included in the reasoning task from the at least one scheduling group;
[0032] If the scheduling groups are grouped according to customers, a target scheduling group corresponding to the customer information included in the reasoning task is selected from the at least one scheduling group.
[0033] In a second aspect, the present application provides a task reasoning device, which is applied to a preset scheduling platform, wherein the preset scheduling platform includes a domain name server and at least one scheduling group; each of the scheduling groups includes a scheduling center and a plurality of working nodes; the working nodes are pre-loaded with a large language model; wherein the device includes:
[0034] A scheduling group selection module, used to obtain the inference task sent by the service side through the domain name server, select a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy, and send the inference task to the target scheduling group;
[0035] A node selection module, used for selecting a target working node from a plurality of working nodes in an idle state in the target scheduling group through a target scheduling center in the target scheduling group based on the reasoning task;
[0036] The task reasoning module is used to obtain the reasoning task assigned by the target scheduling center through the target working node, and to reason the reasoning task based on the large language model to obtain a reasoning result.
[0037] In a third aspect, the present application provides an electronic device, including:
[0038] Memory, used to store computer programs;
[0039] A processor is used to execute the computer program to implement the aforementioned task reasoning method.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned task reasoning method when executed by a processor.
[0041] The task reasoning method of the present application is applied to a preset scheduling platform, wherein the preset scheduling platform includes a domain name server and at least one scheduling group; each of the scheduling groups includes a scheduling center and several working nodes; the working node is pre-loaded with a large language model; wherein the method includes: obtaining the reasoning task sent by the business side through the domain name server, and selecting a target scheduling group corresponding to the reasoning task from the at least one scheduling group based on a preset load balancing strategy, and sending the reasoning task to the target scheduling group; selecting a target working node from several working nodes in the target scheduling group that are in an idle state based on the reasoning task through the target scheduling center in the target scheduling group; obtaining the reasoning task assigned by the target scheduling center through the target working node, and reasoning the reasoning task based on the large language model to obtain the reasoning result. It can be seen that the present application quickly assigns the reasoning task to the corresponding scheduling group through the preset load balancing strategy, and quickly finds the idle working node corresponding to the reasoning task from the scheduling group through the scheduling center in the scheduling group, so as to reason the reasoning task based on the large language model in the idle working node, thereby ensuring the timeliness of the reasoning task and the efficiency of task reasoning. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A flowchart of a task reasoning method disclosed in this application;
[0044] Figure 2 This is a scheduling platform architecture diagram disclosed in this application;
[0045] Figure 3 This is a schematic diagram of the structure of a task reasoning device disclosed in this application;
[0046] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] At present, when there are multiple working nodes, how to quickly assign corresponding working nodes to model reasoning tasks when receiving model reasoning tasks is a problem that needs to be solved. To this end, the present application provides a task reasoning method, which quickly assigns reasoning tasks to corresponding scheduling groups through load balancing strategies, and quickly assigns corresponding idle working nodes to reasoning tasks in the scheduling group through the scheduling center, thereby ensuring the timeliness of reasoning tasks.
[0049] See also Figure 1 As shown, an embodiment of the present invention discloses a task reasoning method, which is applied to a preset scheduling platform, wherein the preset scheduling platform includes a domain name server and at least one scheduling group; each of the scheduling groups includes a scheduling center and a plurality of working nodes; a large language model is pre-loaded in the working node; wherein the method includes:
[0050] Step S11, obtaining the inference task sent by the business side through the domain name server, and selecting a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy, and sending the inference task to the target scheduling group.
[0051] In this embodiment, the preset scheduling platform obtains the inference task sent by the business side through the local domain name server (DNS, Domain Name System), and selects the target scheduling group corresponding to the inference task from at least one scheduling group of the preset scheduling platform based on the preset load balancing strategy through the domain name server, and then sends the inference task to the target scheduling group. It should be noted that each scheduling group in the preset scheduling platform has an equal probability of being selected.
[0052] As for the preset load balancing strategy, since the scheduling group may be grouped in different ways, different load balancing strategies can be adopted; for example, the scheduling group can be grouped according to cloud providers, regions, customers, etc. Correspondingly, for the selection of the target scheduling group, the inference task will include scheduling information for determining the target scheduling group, for example, the scheduling information can be cloud provider information, region information, customer information, etc. As for cloud providers, multiple cloud providers can be connected through the cloud provider abstraction layer in the preset scheduling platform, and the cloud provider abstraction layer is also connected to the scheduling center in each scheduling group through a unified interface. In this way, by adopting the cloud provider abstraction layer and the unified interface provided by the cloud provider abstraction layer in the preset scheduling platform, not only multiple cloud providers are supported, but also the differences between multiple cloud providers can be shielded.
[0053] According to one of the embodiments, if the scheduling groups are grouped according to the cloud providers connected to the cloud provider abstraction layer, that is, one provider corresponds to one scheduling group, a target scheduling group corresponding to the cloud provider information included in the inference task is selected from at least one scheduling group through a domain name server, and the inference task is sent to the target scheduling group. For example, scheduling group 1 corresponds to provider A, scheduling group 2 corresponds to provider B, and scheduling group 3 corresponds to provider C; if the cloud provider information included in the inference task is provider A, and provider A corresponds to scheduling group 1, scheduling group 1 is determined as the target scheduling group, and the inference task is sent to scheduling group 1.
[0054] According to another embodiment, if the dispatching groups are grouped according to regions, the target dispatching group corresponding to the regional information contained in the reasoning task is selected from at least one dispatching group through the domain name server, and the reasoning task is sent to the target dispatching group. Specifically, the target dispatching group corresponding to the regional information contained in the reasoning task is selected from at least one dispatching group through the domain name server based on the principle of regional proximity. For example, dispatching group 1 corresponds to Beijing, dispatching group 2 corresponds to Shanghai, and dispatching group 3 corresponds to Shenzhen; if the regional information contained in the reasoning task is Shanghai, then based on the principle of regional proximity, dispatching group 2 corresponding to Shanghai is directly determined as the target dispatching group; if the regional information contained in the reasoning task is Tianjin, then based on the principle of regional proximity, dispatching group 1 corresponding to Beijing, which is closest to Tianjin, is determined as the target dispatching group.
[0055] According to another embodiment, if the dispatching groups are grouped according to customers, a target dispatching group corresponding to the customer information included in the reasoning task is selected from at least one dispatching group through a domain name server, and the reasoning task is sent to the target dispatching group. For example, dispatching group 1 corresponds to customer A, dispatching group 2 corresponds to customer B, and dispatching group 3 corresponds to customer C; if the customer information included in the reasoning task is customer C, dispatching group 3 corresponding to customer C is determined as the target dispatching group, and the reasoning task is sent to dispatching group 3.
[0056] It should be noted that the scheduling group grouping methods are not limited to the above three methods, and the above three grouping methods can be used in any combination; for example, the scheduling group can also be grouped according to customers and regions at the same time, or the scheduling group can be grouped according to cloud providers and regions at the same time, without additional limitations here.
[0057] Step S12: selecting a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the reasoning task through the target scheduling center in the target scheduling group.
[0058] In this embodiment, the target scheduling center in the target scheduling group determines several working nodes in the idle state from all working nodes in the target scheduling group, selects corresponding target working nodes from the several working nodes in the idle state based on the reasoning task, and then assigns the reasoning task to the target working node. The running state includes the idle state, the busy state, the alarm state, etc.
[0059] Specifically, the target scheduling center selects a corresponding target working node from several idle working nodes in the target scheduling group based on the model identifier contained in the reasoning task; wherein the target working node is pre-loaded with a large language model corresponding to the model identifier, and the model identifier can be a model name, a model identification number or other information that can uniquely characterize the model. The large language model (LLM) mentioned in the embodiment of the present invention is mainly a deep learning model trained based on massive text data, which can not only generate natural language text, but also deeply understand the meaning of the text and handle various natural language tasks, such as text summary extraction tasks, question-answering tasks, translation tasks, etc.
[0060] The embodiments of the present invention further take into account that a large language model may take a long time to execute a task for the first time. Therefore, before actually executing the reasoning task sent by the business side through the large language model, a built-in test task can be executed based on the test instruction through the large language model, and after the test task is successfully executed, wait for the reasoning task sent by the business side to be executed.
[0061] It should be noted that for the running status corresponding to each working node in any scheduling group, each working node in the scheduling group will send its own running status to the scheduling center in the scheduling group based on the preset heartbeat rate; wherein, the preset heartbeat rate can be set based on the actual needs of the user, for example, it can be set to send the running status once per second. Accordingly, the running status of each working node in the scheduling group based on the preset heartbeat rate is obtained through the scheduling center in the scheduling group, and the running status corresponding to each working node is stored, so that when receiving the reasoning task on the business side, the corresponding target working node can be selected in time from the several working nodes in the scheduling group whose running status is idle.
[0062] Step S13: acquiring the reasoning task assigned by the target scheduling center through the target working node, and reasoning the reasoning task based on the large language model to obtain a reasoning result.
[0063] In this embodiment, the inference task assigned by the target dispatching center is obtained through the target working node, and the inference task is inferred using the large language model to obtain the corresponding inference result after the inference is completed. Taking the large language model as a model equipped with the Chinese-English translation function as an example, if the inference task is to translate "How can I get to the gas station" into Chinese, the inference task is inferred by the large language model equipped with the Chinese-English translation function, and the inference result obtained is "How do I get to the gas station". Of course, the large language model can also be a model equipped with an intelligent question-and-answer function, a model equipped with a text summary extraction function, a model equipped with a speech-to-text function, etc., which is not limited here.
[0064] It should also be noted that the large language model pre-loaded on the working node can be a model equipped with a single function or a model equipped with multiple functions at the same time; for example, the large language model can be a model equipped with both speech-to-text function and Chinese-English translation function.
[0065] However, considering that the interface provided by the large language model is private and non-standard, if the inference result is directly output to the business side through the interface provided by the large language model, it may be difficult to identify because the format of the inference result is not universal or standard. Therefore, in the present invention, the inference result is first sent to the target scheduling center through the target working node, and the inference result is further encapsulated into a unified format by the target scheduling center based on a preset unified encapsulation protocol before being output to the business side.
[0066] Specifically, the target scheduling center obtains the inference results sent by the target working node based on the private API (Application Programming Interface), and then encapsulates the inference results based on the preset unified encapsulation protocol to obtain the encapsulated results in a unified encapsulation format, and outputs the encapsulated results to the corresponding business side through the unified output interface. For example, when the unified output interface adopts the OpenAI interface, the preset unified encapsulation protocol can adopt the protocol of the OpenAI interface.
[0067] The specific reasoning process for the inference task is as follows: the target work node obtains the inference task assigned by the target scheduling center, switches its own running state from idle state to busy state, and performs inference on the inference task based on the pre-loaded large language model. If the inference task is normal, the inference result is obtained through the target work node, and the inference result is sent to the target scheduling center, and the running state is switched from busy state to idle state. If the inference task is abnormal, such as inference timeout, inference error, etc., the target work node switches its own running state from busy state to alarm state, and sends the inference task to the target scheduling center, so that the target scheduling center can re-select a new work node for the inference task, so as to use the new work node to perform inference on the inference task and ensure the timeliness of the inference task.
[0068] Furthermore, after the target work node switches its own running state from the busy state to the alarm state, the built-in test task is inferred through the large language model in the target work node, so as to conduct an abnormal review of the target work node. If the test task reasoning is normal, the target work node switches its own running state from the alarm state to the idle state so that the target scheduling center can continue to assign tasks to the target work node. If the test task reasoning is abnormal, the target work node sends an alarm message to the platform management side so that the platform management side can offline the target work node with abnormal reasoning, and restart and put the offline target work node back online.
[0069] Considering that the reasoning task can be a task based on multiple subtasks, and the large language model can be a model with a single function or a model with multiple functions. Therefore, for the reasoning task based on multiple subtasks, the reasoning task can be performed by multiple large language models together or by a single large language model. Whether to use multiple large language models together or a single large language model can be determined based on the model identifier contained in the reasoning task.
[0070] According to one of the embodiments, if the number of model identifiers included in the reasoning task is one, then the representation of the reasoning task may include only one task or multiple subtasks at the same time, but it is only necessary to select a target work node pre-loaded with a large language model corresponding to the model identifier from several idle work nodes in the target scheduling group through the target scheduling center, and assign the reasoning task to the target work node. Then, the target work node is used to reason the reasoning task based on the pre-loaded large language model corresponding to the model identifier to obtain the reasoning result. It should be noted that if the reasoning task only includes one task, the large language model corresponding to the model identifier can be a model with a single function or a model with multiple functions; if the reasoning task includes multiple subtasks at the same time, the large language model corresponding to the model identifier needs to be a model with multiple functions.
[0071] According to another embodiment, if the number of model identifiers included in the reasoning task is multiple, it indicates that the reasoning task contains multiple subtasks at the same time, and the target scheduling center needs to select the corresponding target working nodes from several idle working nodes in the target scheduling group based on each model identifier, and the target working node is pre-loaded with a large language model corresponding to the model identifier, and then the reasoning tasks are respectively assigned to each target working node. After each target working node obtains the reasoning task, it can perform parallel reasoning on the reasoning task through each target working node and then merge the parallel reasoning results to obtain the final reasoning result, or it can perform serial reasoning on the reasoning task through each target working node to obtain the final reasoning result.
[0072] For parallel reasoning, the specific method is to reason on the reasoning tasks separately through each target working node to obtain their own parallel reasoning results, and then merge the parallel reasoning results to obtain the final reasoning result. However, for parallel reasoning, it is required that there is no correlation between the multiple subtasks contained in the reasoning task; for example, one subtask is text summary extraction, and the other subtask is intelligent question answering.
[0073] Among them, for serial reasoning, specifically according to the node reasoning order, the reasoning task is inferred based on the sub-reasoning result of the previous working node through the large language model in each target working node, and the final reasoning result is obtained after the reasoning of the reasoning task is completed at the last working node; wherein, for the first working node in the node reasoning order, the sub-reasoning result of the previous working node is empty. That is, the reasoning task is inferred through the first working node in the node reasoning order to obtain the first sub-reasoning result, and then the reasoning task is inferred based on the previous sub-reasoning result through the second working node in the node reasoning order to obtain the second sub-reasoning result, and so on, until the last working node in the node reasoning order completes the reasoning of the reasoning task and obtains the final reasoning result. It should be noted that at this time, the large language model corresponding to the model identifier can be a model with a single function or a model with multiple functions. However, for serial reasoning, the multiple subtasks contained in the reasoning task are not required to have an association relationship.
[0074] Regarding the determination of the node reasoning order, if there is a correlation between the multiple subtasks included in the reasoning task, the node reasoning order can be determined based on the correlation between the multiple subtasks included in the reasoning task; for example, if one subtask is Chinese-English translation and the other subtask is speech-to-text, then speech-to-text needs to be performed first and then Chinese-English translation. If there is no correlation between the multiple subtasks included in the reasoning task, the node reasoning order can be determined based on the model category, the preset reasoning order can be directly determined as the node reasoning order, or the node reasoning order can be determined randomly, and no specific restrictions are made here.
[0075] It can be seen that the present application quickly distributes the reasoning task to the corresponding scheduling group through the load balancing strategy, and quickly finds the idle working node corresponding to the reasoning task from the scheduling group, so as to reason the reasoning task based on the large language model in the idle working node, thereby ensuring the timeliness of the reasoning task and the efficiency of the task reasoning; and, the present application encapsulates the reasoning result based on the unified encapsulation protocol, and outputs the encapsulated result to the business side after encapsulation, which solves the problem that the interface provided by the large language model pre-loaded in each working node is private and non-standard, and outputs the reasoning result through a unified encapsulation format, which has strong versatility and high portability.
[0076] See also Figure 2 As shown, an embodiment of the present invention discloses a task reasoning method, which is applied to a preset scheduling platform, including:
[0077] The preset scheduling platform includes a domain name server, a cloud provider abstraction layer and at least one scheduling group; each scheduling group includes a scheduling center and several worker nodes; each worker node is pre-loaded with a large language model, and the large language model in the worker node is a model that completes the reasoning of built-in test tasks based on test instructions; in addition, the cloud provider abstraction layer is connected to multiple cloud providers and connected to each scheduling center through a unified interface.
[0078] Taking the example of grouping scheduling groups according to multiple cloud providers connected to the cloud provider abstraction layer, the inference tasks sent by the business side are obtained through the domain name server, and based on the load balancing strategy, a target scheduling group corresponding to the cloud provider information contained in the inference task is determined from at least one scheduling group, and then the inference task is sent to the target scheduling group.
[0079] A target scheduling center in the target scheduling group determines several idle working nodes from all working nodes in the scheduling group, selects a target working node pre-loaded with a large language model corresponding to a model identifier included in the reasoning task from the idle working nodes, and then assigns the reasoning task to the target working node.
[0080] The target work node receives the inference task assigned by the target scheduling center, and uses the local large language model corresponding to the model identifier to infer the inference task, obtains the inference result after the inference is completed, and then sends the inference result to the target scheduling center through a private API.
[0081] The target scheduling center receives the inference results sent by the target working node, and encapsulates the inference results using a unified encapsulation protocol to obtain encapsulated results, and then outputs the encapsulated results to the business side through a unified output interface.
[0082] It can be seen that the present application quickly distributes the reasoning task to the corresponding scheduling group through the load balancing strategy, and quickly finds the idle working node corresponding to the reasoning task from the scheduling group, so as to reason the reasoning task based on the large language model in the idle working node, thereby ensuring the timeliness of the reasoning task and the efficiency of the task reasoning; and, the present application encapsulates the reasoning result based on the unified encapsulation protocol, and outputs the encapsulated result to the business side after encapsulation, which solves the problem that the interface provided by the large language model pre-loaded in each working node is private and non-standard, and outputs the reasoning result through a unified encapsulation format, which has strong versatility and high portability.
[0083] See also Figure 3As shown, an embodiment of the present invention discloses a task reasoning device, which is applied to a preset scheduling platform, wherein the preset scheduling platform includes a domain name server and at least one scheduling group; each of the scheduling groups includes a scheduling center and a plurality of working nodes; a large language model is pre-loaded in the working node; wherein the device includes:
[0084] A scheduling group selection module 11, configured to obtain the inference task sent by the service side through the domain name server, select a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy, and send the inference task to the target scheduling group;
[0085] A node selection module 12, configured to select a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the reasoning task through a target scheduling center in the target scheduling group;
[0086] The task reasoning module 13 is used to obtain the reasoning task assigned by the target scheduling center through the target working node, and to reason the reasoning task based on the large language model to obtain a reasoning result.
[0087] It can be seen that the present application quickly distributes the reasoning tasks to the corresponding scheduling groups through the load balancing strategy, and quickly finds the idle working nodes corresponding to the reasoning tasks from the scheduling groups, so as to reason about the reasoning tasks based on the large language model in the idle working nodes, thereby ensuring the timeliness of the reasoning tasks and the efficiency of task reasoning.
[0088] In some specific embodiments, the reasoning task includes a model identifier; the model identifier includes a model name and / or a model identification number;
[0089] Accordingly, the node selection module 12 includes:
[0090] The first node selection unit is used to select a target working node from a number of working nodes in the target scheduling group that are in an idle state based on the model identifier through the target scheduling center; wherein the target working node is pre-loaded with a large language model corresponding to the model identifier.
[0091] In some specific embodiments, the node selection module 12 includes:
[0092] A second node selection unit, configured to select a corresponding target working node from a plurality of working nodes in an idle state in the target scheduling group through the target scheduling center based on each of the model identifiers if the number of the model identifiers is multiple;
[0093] Accordingly, the task reasoning module 13 includes:
[0094] An inference result acquisition unit, used to respectively acquire the inference tasks assigned by the target scheduling center through each of the target working nodes, and infer the inference tasks based on the sub-inference results of the previous working node through the large language model in each of the target working nodes according to the node inference order, and obtain the final inference result after the last working node completes the inference of the inference task;
[0095] Among them, for the first working node in the node reasoning sequence, the sub-inference result of the previous working node is empty.
[0096] In some specific embodiments, the task reasoning device further includes:
[0097] The running status storage unit is used to obtain the respective running status reported by several working nodes in the target scheduling group based on the preset heartbeat rate through the target scheduling center, and store the running status corresponding to each working node.
[0098] In some specific embodiments, the task reasoning module 13 includes:
[0099] An inference task inference unit, configured to obtain the inference task assigned by the target scheduling center through the target working node, switch its own running state from an idle state to a busy state, and infer the inference task based on a large language model;
[0100] An inference result sending unit, configured to obtain an inference result through the target working node if the inference task is inferred normally, send the inference result to the target scheduling center, and switch its own operating state from a busy state to an idle state;
[0101] The reasoning task sending unit is used to switch its own operating state from a busy state to an alarm state through the target working node if the reasoning task is abnormal, and send the reasoning task to the target scheduling center so that the target scheduling center can re-select a new working node for the reasoning task.
[0102] In some specific embodiments, the task reasoning device further includes:
[0103] A test task reasoning unit, used for performing reasoning based on a built-in test task through a large language model in the target working node;
[0104] A running state switching unit, configured to switch its own running state from an alarm state to an idle state through the target working node if the test task reasoning is normal;
[0105] The alarm information sending unit is used to send the alarm information to the platform management side through the target working node if the test task reasoning is abnormal, so that the platform management side can take the target working node offline, restart the offline target working node and put it back online.
[0106] In some specific embodiments, the task reasoning device further includes:
[0107] The inference result encapsulation unit is used to encapsulate the inference result based on a preset unified encapsulation protocol through the target scheduling center, and output the encapsulated result to the business side.
[0108] In some specific embodiments, the preset scheduling platform further includes a cloud provider abstraction layer, the cloud provider abstraction layer is connected to multiple cloud providers and is connected to the scheduling center in the scheduling group through a unified interface;
[0109] Correspondingly, the scheduling group selection module 11 includes:
[0110] a first scheduling group selection unit, configured to select a target scheduling group corresponding to the cloud provider information included in the inference task from the at least one scheduling group if the scheduling groups are grouped according to the cloud provider;
[0111] a second scheduling group selection unit, configured to select a target scheduling group corresponding to the regional information included in the reasoning task from the at least one scheduling group if the scheduling groups are grouped according to regions;
[0112] The third scheduling group selection unit is configured to select a target scheduling group corresponding to the customer information included in the reasoning task from the at least one scheduling group if the scheduling groups are grouped according to customers.
[0113] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0114] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the task reasoning method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0115] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0116] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0117] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the task reasoning method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0118] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the task reasoning method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.
[0119] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0120] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0121] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0122] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0123] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A task reasoning method, characterized in that: The method is applied to a preset scheduling platform, wherein the preset scheduling platform includes a domain name server and at least one scheduling group; each scheduling group includes a scheduling center and several working nodes; the working nodes are pre-loaded with a large language model; wherein the method includes: Obtaining the inference task sent by the business side through the domain name server, selecting a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy, and sending the inference task to the target scheduling group; Selecting a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the reasoning task by a target scheduling center in the target scheduling group; The inference task assigned by the target scheduling center is obtained through the target working node, and the inference task is inferred based on the large language model to obtain an inference result.
2. The task reasoning method according to claim 1, characterized in that: The reasoning task includes a model identifier; the model identifier includes a model name and / or a model identification number; Accordingly, the target scheduling center in the target scheduling group selects a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the inference task, including: The target scheduling center selects a target working node from a plurality of idle working nodes in the target scheduling group based on the model identifier; wherein the target working node is pre-loaded with a large language model corresponding to the model identifier.
3. The task reasoning method according to claim 2, characterized in that: The selecting, by the target scheduling center based on the model identifier, a target working node from a plurality of working nodes in the target scheduling group that are in an idle state comprises: If there are multiple model identifiers, the target scheduling center selects a corresponding target working node from a plurality of working nodes in an idle state in the target scheduling group based on each model identifier; Accordingly, obtaining the reasoning task assigned by the target scheduling center through the target working node, and reasoning the reasoning task based on the large language model to obtain a reasoning result, includes: The inference task assigned by the target scheduling center is obtained by each target work node, and the inference task is inferred based on the sub-inference result of the previous work node through the large language model in each target work node in accordance with the node inference order, and the final inference result is obtained after the last work node completes the inference of the inference task; Among them, for the first working node in the node reasoning sequence, the sub-inference result of the previous working node is empty.
4. The task reasoning method according to claim 1, characterized in that: Before selecting a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the inference task by the target scheduling center in the target scheduling group, the method further includes: The target scheduling center obtains the respective operating states reported by several working nodes in the target scheduling group based on a preset heartbeat rate, and stores the operating states corresponding to the respective working nodes.
5. The task reasoning method according to claim 1, characterized in that: The acquiring, through the target working node, the inference task assigned by the target scheduling center, and reasoning the inference task based on the large language model to obtain an inference result, includes: Obtaining the inference task assigned by the target scheduling center through the target working node, switching its own operating state from an idle state to a busy state, and performing inference on the inference task based on a large language model; If the reasoning task is normal, the target working node obtains the reasoning result, sends the reasoning result to the target scheduling center, and switches its own running state from busy state to idle state; If the reasoning task is abnormal, the target working node switches its own operating state from busy state to alarm state, and sends the reasoning task to the target scheduling center so that the target scheduling center can re-select a new working node for the reasoning task.
6. The task reasoning method according to claim 5, characterized in that: After the target working node switches its own running state from a busy state to an alarm state, the method further includes: Perform reasoning based on built-in test tasks using the large language model in the target working node; If the test task reasoning is normal, the target working node switches its own running state from the alarm state to the idle state; If the test task reasoning is abnormal, an alarm message is sent to the platform management side through the target working node so that the platform management side can take the target working node offline, restart the offline target working node, and put it back online.
7. The task reasoning method according to claim 1, characterized in that: After the reasoning task is reasoned based on the large language model to obtain a reasoning result, the method further includes: The target scheduling center encapsulates the inference result based on a preset unified encapsulation protocol, and outputs the encapsulated result to the business side.
8. The task reasoning method according to any one of claims 1 to 7, characterized in that: The preset scheduling platform also includes a cloud provider abstraction layer, which is connected to multiple cloud providers and connected to the scheduling center in the scheduling group through a unified interface; Accordingly, selecting a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy includes: If the scheduling groups are grouped according to the cloud provider, selecting a target scheduling group corresponding to the cloud provider information included in the inference task from the at least one scheduling group; If the scheduling groups are grouped according to regions, selecting a target scheduling group corresponding to the region information included in the inference task from the at least one scheduling group; If the scheduling groups are grouped according to customers, a target scheduling group corresponding to the customer information included in the reasoning task is selected from the at least one scheduling group.
9. A task reasoning device, characterized in that: Applied to a preset scheduling platform, the preset scheduling platform includes a domain name server and at least one scheduling group; each scheduling group includes a scheduling center and several working nodes; the working nodes are pre-loaded with a large language model; wherein the device includes: a scheduling group selection module, configured to obtain the inference task sent by the service side through the domain name server, select a target scheduling group corresponding to the inference task from the at least one scheduling group based on a preset load balancing strategy, and send the inference task to the target scheduling group; A node selection module, configured to select a target working node from a plurality of working nodes in an idle state in the target scheduling group based on the inference task through a target scheduling center in the target scheduling group; The task reasoning module is used to obtain the reasoning task assigned by the target scheduling center through the target working node, and to reason on the reasoning task based on the large language model to obtain a reasoning result.
10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the task reasoning method according to any one of claims 1 to 8.
Citation Information
Cited By
Inference system, inference method, inference device, storage medium, and program product
CN119129755A
Reasoning system, reasoning method, reasoning device, storage medium and program product
CN119129755B
Load balancing method and device for reasoning service, storage medium, equipment and product
CN121334158A
Task processing method based on cloud management platform, and cloud management platform
WO2026144932A1
