Model scheduling method and device, medium and equipment

By introducing an artificial intelligence model into model scheduling, taking into account the influencing factors of pending tasks, candidate models and computing resources, and dynamically adjusting the scheduling strategy, the problem of insufficient flexibility of model scheduling in the existing technology is solved, and higher flexibility and adaptability are achieved.

CN119862002APending Publication Date: 2025-04-22IFLYTEK CO LTD

Patent Information

Application Number
CN202411741978.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing technology is not flexible enough in model scheduling, and cannot fully consider factors such as dynamic changes such as computing resources, networks, and algorithm evolution, resulting in the scheduling method being too fixed and rigid, and cannot adapt to the current scenario to predict the optimal calling target.

Method used

By obtaining the scheduling influencing factors of pending tasks, candidate models and current computing resources, and inputting them into the trained artificial intelligence model, the AI ​​model is used to comprehensively consider multiple influencing factors to determine the scheduling target and dynamically adjust the scheduling strategy.

Benefits of technology

Automatic scheduling based on AI model is realized, which can take into account the multi-faceted influences of pending tasks, candidate models and computing resources, dynamically adjust the scheduling goals, and improve the flexibility and adaptability of model scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862002A_ABST
    Figure CN119862002A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model scheduling method and device, a medium and equipment, and relates to the technical field of artificial intelligence. The method comprises the steps that scheduling influence factors are obtained, and the influence factors comprise at least one of the following factors: a first influence factor about a to-be-processed task, a second influence factor about a candidate model and a third influence factor about current computing resources; inputting the scheduling influence factors into an artificial intelligence model, and processing the scheduling influence factors through the artificial intelligence model to determine a first prediction result; determining a target model from the candidate models according to the first prediction result; and scheduling the to-be-processed task to the target model so as to execute the to-be-processed task through the target model. According to the embodiment of the invention, the flexibility of model scheduling can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a model scheduling method, a model scheduling device, a computer-readable storage medium, and an electronic device. Background Art

[0002] With the rapid development of artificial intelligence (AI) technology, more and more devices or applications have integrated various AI capabilities, such as large language models (LLM). One way is to access large models (such as LLM) deployed on cloud servers through the network. Another way is to deploy models such as LLM locally on the device and then implement local calls.

[0003] In the scheduling scheme provided by the related technology, the model to be used can be determined according to the predetermined business needs. For example, if the business needs to prioritize computing cost, the local model is used; if the business needs are good computing effect and high recognition accuracy, the online model is used. In the scheduling scheme provided by the related technology, the computing tasks can also be divided according to the predetermined division method, with one part using the online model and the other part using the local model.

[0004] However, the model scheduling method provided by related technologies is generally executed using a predetermined plan, and the scheduling flexibility needs to be improved. Summary of the invention

[0005] The embodiments of the present application provide a model scheduling method, a model scheduling device, a computer-readable storage medium, and an electronic device, which can improve the flexibility of model scheduling.

[0006] In a first aspect, an embodiment of the present application provides a model scheduling method, the method comprising: obtaining scheduling influencing factors, wherein the above-mentioned influencing factors include at least one of the following: a first influencing factor regarding the task to be processed, a second influencing factor regarding the candidate model, and a third influencing factor regarding the current computing resources; inputting the above-mentioned scheduling influencing factors into an artificial intelligence model, so as to process the above-mentioned scheduling influencing factors through the above-mentioned artificial intelligence model to determine a first prediction result; determining a target model from the above-mentioned candidate models based on the above-mentioned first prediction result; and scheduling the above-mentioned task to be processed to the above-mentioned target model, so as to execute the above-mentioned task to be processed through the above-mentioned target model.

[0007] In a second aspect, an embodiment of the present application provides a scheduling model, the device comprising: an artificial intelligence model, used to receive scheduling influencing factors regarding a task to be processed, and process the above-mentioned scheduling influencing factors to determine a first prediction result, wherein the above-mentioned influencing factors include at least one of the following: a first influencing factor regarding the task to be processed, a second influencing factor regarding a candidate model, and a third influencing factor regarding current computing resources; wherein the above-mentioned first prediction result is used to determine a target model from the above-mentioned candidate models, and the above-mentioned target model is the candidate model to which the above-mentioned task to be processed is to be scheduled.

[0008] In a third aspect, an embodiment of the present application provides a model scheduling device, which includes: an acquisition module for acquiring scheduling influencing factors, wherein the above-mentioned influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources; a processing model for inputting the above-mentioned scheduling influencing factors into an artificial intelligence model, so as to process the above-mentioned scheduling influencing factors through the above-mentioned artificial intelligence model to determine a first prediction result; a determination module for determining a target model from the above-mentioned candidate models according to the above-mentioned first prediction result; and a scheduling module for scheduling the above-mentioned task to be processed to the above-mentioned target model, so as to execute the above-mentioned task to be processed through the above-mentioned target model.

[0009] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the model scheduling method provided in the first aspect.

[0010] In a fifth aspect, an embodiment of the present application provides a chip for implementing the model scheduling method provided in the first aspect or the second aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the model scheduling method provided in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the model scheduling method provided in the first aspect.

[0012] In a seventh aspect, an embodiment of the present application provides a computer program product, including computer program instructions, and the above-mentioned computer program instructions enable a computer to execute the model scheduling method provided in the above-mentioned first aspect.

[0013] In an eighth aspect, an embodiment of the present application provides a computer program, which, when executed on a computer, enables the computer to execute the model scheduling method provided in the first aspect above.

[0014] In summary, in the model scheduling scheme provided in the embodiment of the present application, the local computing device obtains the scheduling influencing factors, and the above-mentioned scheduling influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources. Further, the obtained scheduling influencing factors are input into the trained artificial intelligence model to process the scheduling influencing factors through the artificial intelligence model, so as to comprehensively consider multiple influencing factors and determine the prediction results about the scheduling target. Specifically, the target model is determined from multiple candidate models according to the above prediction results. The task to be processed is scheduled to the above-mentioned target model to execute the task to be processed through the target model. In the scheme provided in the embodiment of the present application, automatic scheduling is realized based on the AI ​​model. Specifically, when predicting the scheduling target, the AI ​​model can comprehensively consider the scheduling influencing factors related to the task to be processed, the scheduling influencing factors of the candidate model, and the scheduling influencing factors of the currently available computing resources. Therefore, the scheduling target predicted by the AI ​​model can take into account the influence of the above multiple aspects, so as to determine a reasonable scheduling target based on the current state of each influencing factor, and can adaptively adjust the scheduling target when each influencing factor changes. It can be seen that in the embodiment of the present application, the characteristic information of each scheduling impact is integrated and analyzed, and the optimal solution for executing the current task is adaptively given, rather than a fixed scheduling call mode, which is conducive to improving the flexibility of model scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 A schematic diagram of the system architecture of the application environment of the model scheduling solution provided in the embodiment of the present application;

[0017] Figure 2 A flowchart of a model scheduling method provided in an embodiment of the present application;

[0018] Figure 3 A schematic diagram of a reinforcement learning framework provided in an embodiment of the present application;

[0019] Figure 4 A schematic diagram of the relationship between the AI ​​(scheduling) model, target model, and effect evaluation model provided in the embodiment of the present application;

[0020] Figure 5 A flowchart of a model scheduling method provided in an embodiment of the present application;

[0021] Figure 6 A schematic block diagram of a model scheduling device provided in an embodiment of the present application;

[0022] Figure 7 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here can be implemented in a sequence other than those illustrated or described here. In the present application embodiment of the present invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, but can also determine B according to A and / or other information. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. In the description of the present application, unless otherwise specified, "multiple" refers to two or more than two.

[0025] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0026] The method of accessing the online model capabilities deployed on the cloud server through the network has the advantages of good effect and recognition accuracy, but the access process depends on the network status. When the network status is poor or there is no network, it may cause excessive delays or even call failures. In addition, for some data-sensitive computing tasks, calling the online model (the online model can also be referred to as the cloud model in this article) to perform the computing task poses the risk of information leakage. At the same time, calling the online cloud model also has the problem of high computing cost.

[0027] With the improvement of computing resources on the end devices, the model can be deployed locally on the device. Directly calling the local mode has the advantages of low latency and low cost, but the local storage and computing resources are limited, and it is impossible to deploy large model resources like the cloud, which may lead to poor computing results.

[0028] Therefore, in the calling scheme provided by the relevant technology, the model to be adopted can be determined according to the predetermined business needs. For example, if the business needs to prioritize computing cost, the local model is adopted; if the business needs are good computing effect and high recognition accuracy, the online model is adopted. However, no matter which method is used, there will be various limitations, and it is impossible to take into account the advantages of both online models and local models at the same time, that is, it is impossible to obtain better computing effect and low cost at the same time.

[0029] In order to take into account the advantages of both online models and local models, another scheduling scheme provided by the related technology can divide the computing tasks according to a predetermined division method, with one part using the online model and the other part using the local model. However, the method of scheduling using the established scheme does not fully consider the dynamically changing factors such as computing resources, networks, and algorithm evolution. For example, a certain capability may be the best choice at a certain point in time. As the model is updated, the device resource usage, network status, data sensitivity and other conditions change, it may not be the best choice at subsequent time points. It can be seen that the scheduling scheme provided by the related technology is relatively fixed and rigid, and it is impossible to predict the current optimal call target for the current scenario. Therefore, the adaptability and flexibility of the scheduling method provided by the related technology need to be improved.

[0030] In view of the above problems, in the model scheduling scheme provided by the embodiment of the present application, the electronic device obtains the scheduling influencing factors, and the above scheduling influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources. Further, the obtained scheduling influencing factors are input into the trained artificial intelligence model to process the scheduling influencing factors through the artificial intelligence model, so as to comprehensively consider multiple influencing factors and determine the prediction results about the scheduling target. Specifically, the target model is determined from multiple candidate models according to the above prediction results. The task to be processed is scheduled to the above target model to execute the task to be processed through the target model. In the scheme provided by the embodiment of the present application, automatic scheduling is realized based on the AI ​​model. Specifically, when predicting the scheduling target, the AI ​​model can comprehensively consider the scheduling influencing factors related to the task to be processed, the scheduling influencing factors of the candidate model, and the scheduling influencing factors of the currently available computing resources. Therefore, the scheduling target predicted by the AI ​​model can take into account the influence of the above multiple aspects, thereby determining a reasonable scheduling target based on the current state of each influencing factor, and can adaptively adjust the scheduling target when each influencing factor changes. It can be seen that in the embodiment of the present application, the characteristic information of each scheduling impact is integrated and analyzed and the optimal solution is adaptively given, rather than a fixed scheduling call mode, which is conducive to improving the flexibility of model scheduling.

[0031] Below through Figure 1 An exemplary system architecture of an embodiment of the present application is introduced.

[0032] For example, Figure 1 A schematic diagram of the system architecture of the application environment of the model scheduling solution provided in one embodiment of the present application. Figure 1 As shown, the system architecture of the implementation environment of the embodiment of the present application may include: a terminal 102 for inputting information, a local computing device (such as a server 104) for executing the task scheduling process, and a cloud server 106 for providing a cloud model. Exemplarily, the local model can also be deployed on a local computing device, such as the server 104. Another understanding is that the number of local computing devices is more than one, such as the algorithm for executing the task scheduling process and the AI ​​model for executing the scheduling task (also referred to as a scheduling model) can be deployed on the same local computing device or on different local computing devices. Similarly, the local model for executing the task to be processed can be deployed on the above-mentioned server 104 or on other local computing devices, and the embodiment of the present application does not limit this.

[0033] The connection 11' between the terminal 102 and the local computing device server 104, and between different local computing devices, can be a wired communication link or a local area network (LAN). The connection 11' between the terminal 102 and the cloud server 106 can be a wide area network (WAN).

[0034] In an exemplary embodiment, reference Figure 1 , the user inputs relevant information of the task to be processed, such as description information of the task, through the terminal 120, so as to trigger the server 104 to execute the scheduling process. Exemplarily, in step S10, the terminal 102 triggers the server 104 to execute the scheduling process. In step S11, the server 104 obtains the scheduling influencing factors; in step S11, the server 104 inputs the scheduling influencing factors into the artificial intelligence model to process the scheduling influencing factors through the artificial intelligence model to determine the first prediction result. It can be seen that in the solution provided in the embodiment of the present application, automatic scheduling is realized based on the AI ​​model. Specifically, when predicting the scheduling target, the AI ​​model can comprehensively consider the scheduling influencing factors related to the task to be processed, the scheduling influencing factors of the candidate model, and the scheduling influencing factors of the currently available computing resources. Therefore, the scheduling target predicted by the AI ​​model can take into account the influence of the above multiple aspects. In step S13, the server 104 sends the first preset result to the terminal 102 for the user to view.

[0035] In step S14, the server 104 determines a target model from multiple candidate models according to the first prediction result. Since the target model is determined in real time based on the current state of each influencing factor, it has higher rationality. In addition, the scheduling target can be adaptively adjusted when the influencing factors change, thereby improving the flexibility of model scheduling.

[0036] Exemplarily, the above-mentioned first prediction result is a confidence level. In an embodiment of the present application, a user can divide the confidence interval by customization. Different confidence intervals correspond to different levels, and the user can also determine the model call path corresponding to each level through sub-definition. If the confidence level of the model output is 0.81 and belongs to the 8th level out of 10 levels, then the pending tasks can be scheduled to the model according to the model scheduling path corresponding to the 8th level. Thereby enhancing the user's personalized management of the scheduling process. In other embodiments, the confidence interval and the model call path corresponding to different levels can also be determined according to the default settings to provide user-friendly automated scheduling.

[0037] Exemplarily, the cloud server 106 can specifically provide cloud services such as LLM, and can also provide basic cloud computing services such as cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms. Server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. Terminal 102 is used for information input and information display, etc. Exemplarily, terminal 102 is a computer, a smart phone, a tablet, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a wearable smart device, a medical device, etc. Terminal 102 is often configured with a display device, and the display device can also be a display, a display screen, a touch screen, etc., and the touch screen can also be a touch screen, a touch panel, etc., but is not limited to this.

[0038] It should be noted that Figure 1 The system architecture of the implementation environment of the embodiment of the present application is exemplified, but the system architecture of the implementation environment of the embodiment of the present application is not limited to Figure 1 shown.

[0039] The model scheduling method of the embodiment of the present application is described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0040] Figure 2 The following is a flow chart of a model scheduling method P200 provided in an embodiment of the present application. The execution subject of the method P200 may be a local computing device, such as Figure 1 Server 104 is shown.

[0041] In step S210, the scheduling influencing factors are obtained, wherein the influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources.

[0042] In the embodiment of the present application, the above-mentioned scheduling influencing factors refer to reference factors for scheduling the current task to different candidate models. When the same scheduling influencing factor takes different values, the same task may be scheduled to different candidate models. For example, for the current CPU usage rate of the scheduling influencing factor, if the CPU usage rate exceeds the high threshold, task A may be scheduled to the cloud server to process task A through the LLM provided by the cloud server; if the CPU usage rate is lower than the low threshold, task A may be scheduled to the local server to process task A through the LLM provided by the local server.

[0043] In an embodiment of the present application, the above-mentioned influencing factors can be any one or a combination of any two of the first influencing factors regarding the task to be processed, the second influencing factors regarding the candidate model, and the third influencing factors regarding the current computing resources, so that the influence of multiple aspects such as the task to be processed, the candidate model, and the currently available computing resources can be comprehensively considered, which is conducive to determining a more reasonable scheduling target.

[0044] The following describes an embodiment of a method for obtaining various scheduling influencing factors.

[0045] In an exemplary embodiment, the first influencing factor includes the category to which the task to be processed belongs. As an implementation of step S210, the following steps are performed:

[0046] In step S210 - 1 , description information about the task to be processed is obtained.

[0047] The above description information may be information input by the user in response to the requirements of the task to be processed, and the model (local model or cloud online model) that executes the task can execute the corresponding task according to the above description information. Exemplarily, in the case of adopting LLM, the above description information may be a prompt. For example, for the summary generation task, the above description information may be "Please generate a short summary for this long article".

[0048] In step S210 - 2 , the above description information is input into a classification model to determine the category to which the task to be processed belongs through the output of the classification model.

[0049] Exemplarily, the above-mentioned classification model can be a multi-classification model, and its type can be a traditional machine learning model, such as a logistic regression model, a decision tree, a support vector machine, etc.; it can also be a deep learning model, such as a recurrent neural network model, etc. Specifically, the input information of the above-mentioned classification model is the descriptive information about the task to be processed, and the output is the classification label of the task to be processed, that is, the category to which the task to be processed belongs. For example, the above-mentioned classification labels may include: natural language processing, content generation, large-scale model training, information recommendation, real-time speech recognition, real-time image processing, etc. It can be understood that the classification labels of the classification model can be increased or decreased according to actual needs, and the embodiments of the present application do not limit this.

[0050] Among the above classification labels: tasks corresponding to natural language processing, content generation, large-scale model training, information recommendation, etc. generally require high computing resources and are suitable for cloud-based models; among the above classification labels: tasks that require immediate feedback, such as real-time speech recognition and real-time image processing, are suitable for local models. It can be seen that the category to which the task to be processed belongs can be used to further determine whether it is suitable for cloud-based online model processing or local model processing, that is, the above classification information can be used as a reference factor or influencing factor in the scheduling process.

[0051] It is understandable that the above-mentioned first influencing factor is not limited to the above-mentioned content, and may also be other measurement indicators related to the task to be processed, and the embodiment of the present application does not limit this.

[0052] In an exemplary embodiment, the second influencing factor includes the latest effect score corresponding to the candidate model. As an implementation of step S210, the following steps are performed:

[0053] In step S210 - 1 ′, model input information about the target task is obtained.

[0054] The target task is any task that has been performed by the target candidate model, and the target candidate model is any candidate model.

[0055] In step S210 - 2 ′, a second prediction result output by the target candidate model after processing the model input information is obtained.

[0056] If the target candidate model is cloud model A, and the target task is the most recent task performed by cloud model A, specifically, summary generation task a for article X, then the model input information is the article X and the corresponding prompt word prompt, and the second prediction result is the summary information x generated after cloud model A performs summary generation task a.

[0057] In step S210-3', the model input information of the target task and the second prediction result are input into the effect evaluation model, wherein the output of the effect evaluation model is the current task effect score corresponding to the target candidate model.

[0058] In the embodiment of the present application, the model for performing the task is evaluated through the effect evaluation model.

[0059] For example, the effect evaluation model uses a transformer structure, specifically using the "[cls]" marker position as a sentence vector. The transformer structure is used to connect the fully connected layer, and the last layer of the effect evaluation model uses a sigmoid activation function. The output value of the model ranges from 0 to 1, indicating that the output information of the model is the score for executing the current task. The closer the output value is to 1, the higher the quality of the result.

[0060] Specifically, the input information of the effect evaluation model is the input information and output information of the model that performs the task, and the output information of the effect evaluation model is the score of performing the current task. current , score the historical effect corresponding to the target candidate model last Update to obtain the latest effect score corresponding to the target candidate model. The specific expression is as shown in formula (1).

[0061] score=α*score last +(1-α)*score currebt (1)

[0062] Among them, α is the historical effect score corresponding to the model last , and 1-α is the weight of the latest effect score corresponding to the model.

[0063] Suppose, after article X and summary information x are input into the effect evaluation model, the output of the effect evaluation model is the score of cloud model A performing task a. current_a , and the historical performance score corresponding to the cloud model A is expressed as score last_A , then the latest effect score corresponding to the cloud model A is A =α*score last_A +(1-α)*score current_a .

[0064] It can be seen that the latest effect score corresponding to each candidate model is accumulated according to the effect scores corresponding to the tasks it has executed, which can reflect the task processing capability of the current candidate model. Therefore, the latest effect score corresponding to the candidate model can be used as an influencing factor in the scheduling process.

[0065] Exemplarily, the second influencing factor includes the computational cost corresponding to each candidate model. If the candidate models include: an online model and a local model, the computational cost required for the online model is generally higher, and the computational cost required for the offline model is lower. The computational cost required for task execution is one of the user's concerns, so in the embodiment of the present application, the computational cost corresponding to each candidate model is used as an influencing factor in the scheduling process.

[0066] It is understandable that the second influencing factor is not limited to the above content, but may also be other measurement indicators related to the candidate model, which is not limited in the embodiments of the present application.

[0067] In an exemplary embodiment, the third influencing factor includes at least one of the following computing resources of the device where the local model is located:

[0068] The number of CPU cores; CPU frequency; CPU usage; available memory resources; whether the target processing unit resources are included; and,

[0069] In the presence of the target processing unit resources, at least one of the computing power of the target processing unit, the available video memory resources of the target processing resources, the frequency of the target processing unit, and the utilization rate of the target processing unit; wherein the target processing unit includes: a graph processing unit (GPU) and / or a neural network processing unit (NPU).

[0070] It is understandable that the third influencing factor is not limited to the above content, but may also be other indicators related to the current computing resources. The embodiment of the present application does not limit this.

[0071] In this embodiment, the current computing resources of the local model can directly affect the local execution of tasks, so in the embodiment of the present application, the local current computing resources can be used as an influencing factor in the scheduling process.

[0072] In step S220, the scheduling influencing factors are input into the artificial intelligence model so as to process the scheduling influencing factors through the artificial intelligence model to determine a first prediction result.

[0073] The above-mentioned artificial intelligence model can be a traditional machine learning model or a deep learning model (such as LLM), which is not limited in the embodiments of the present application.

[0074] Specifically, the input information of the above-mentioned artificial intelligence model is the scheduling influencing factors corresponding to the task to be processed. The model processes the scheduling influencing factors to comprehensively consider the scheduling influencing factors related to the task to be processed, the scheduling influencing factors of the candidate model, and the scheduling influencing factors of the currently available computing resources, so that the scheduling target predicted by the model can take into account the influence of the above multiple aspects, and then determine a reasonable scheduling target based on the current state of each influencing factor, and can adaptively adjust the scheduling target when each influencing factor changes. It can be seen that in the embodiment of the present application, each scheduling influence feature information is fused and analyzed and the most reasonable choice for executing the current task is adaptively given.

[0075] The following introduces an embodiment of the training method of the above-mentioned AI model (scheduling model). For example, the embodiment of the present application can use deep reinforcement learning to determine the parameters of the above-mentioned AI model. Specifically, it can be implemented based on the following steps.

[0076] In step S31, determining the state of the environment includes the scheduling influencing factors, and determining the reward of the environment includes the performance indicators and / or training efficiency information of the artificial intelligence model.

[0077] In this embodiment, the state space is defined as the above scheduling influencing factors. Please refer to Table 1 for details.

[0078] Table 1

[0079]

[0080]

[0081] In addition to the scheduling influencing factors shown in Table 1, the state space can also include performance indicators and training progress of the AI ​​model.

[0082] The action space contains all actions. In this embodiment, the action is the decision-making strategy of the AI ​​model, specifically which candidate model to use to perform the task, including using the cloud model to perform the task (action 0) and using the local model to perform the task (action 1).

[0083] In this embodiment, the reward is embodied as the performance index and / or training efficiency information of the AI ​​model, such as response speed, quality of results after executing the task, computing cost, etc.

[0084] In step S32, the decision module of the agent is determined as the main network, the learning module of the agent is determined as the main network and the target network, and the storage module of the agent is determined.

[0085] Among them, the main network is the above-mentioned AI model to be trained, and the above-mentioned target network can have the same structure as the AI ​​model.

[0086] Exemplarily, the main network and AI model can be a convolutional neural network, a transformer network, etc., which is not limited in the present application embodiment, and the main body of the model can be set according to actual needs. The output layer size of the model is the same as the dimension of the action space. For example, if the action space includes using a local model to perform tasks and using a cloud model to perform tasks, the output layer dimension is also 2. Exemplarily set the following parameters:

[0087] The learning rate is: 10^(-4);

[0088] Discount Factor (γ): 0.9;

[0089] Replay Buffer Size: 1000

[0090] Batch Size: 32

[0091] Target Network Update Frequency: For example, update every 4 time steps;

[0092] Initial Exploration Rate: ∈ = 1.0;

[0093] Minimum Exploration Rate: ∈ min =0.01;

[0094] Exploration Decay Rate: ∈ decay =0.995.

[0095] In step S33, at the tth time step, the following steps are performed.

[0096] Step S331: The agent's decision module selects the tth action.

[0097] For example, action a is selected by the ∈-greedy strategy t . As shown in formula (2).

[0098]

[0099] In formula (2), if the random generation number is less than the exploration rate ∈, an action is randomly selected from the action space (either the cloud model or the local model). This step is to ensure that the model can explore different strategies in the early stages of training to avoid falling into the local optimal solution. For example, if ∈ = 0.1, there is a 10% probability of randomly selecting an action.

[0100] If the randomly generated number is greater than or equal to the exploration rate ∈, the current main network is used to select the action with the highest Q value. Specifically, the current state s t Input into the main network, execute all actions in the action space respectively, and obtain two Q values ​​corresponding to the two actions in this embodiment. Then select the action with the highest Q value. For example, if the Q values ​​corresponding to action 0 and action 1 in the action space are [0.8, 0.2] respectively, then select the cloud model (action 0) corresponding to the Q value of 0.8.

[0101] In this embodiment, the initial exploration rate ∈ is set to 1.0, which means that in the early stage of training, the model will perform more random exploration to discover potential rewards in the environment. As the training progresses, ∈ is gradually reduced to reduce exploration and increase the use of known best strategies. Formula (3) is used as an example.

[0102] ∈=max(∈ decay ,∈ min ) (3)

[0103] At each time step, when the random number is greater than the exploration rate, the main network is based on the current state s t Output the Q value of each action and select the action a with the highest Q value t .

[0104] Step S332: The agent's execution module executes the tth action a selected above in the above environment. t , to determine the t+1th state s t+1 and the tth reward r t .

[0105] Step S333: The storage module of the agent receives the t+1th state s t+1 and the tth reward r t , and the tth state s t , tth action a t , the t+1th state s t+1 and the tth reward r t ,(s t ,a t ,r t ,s t+1 ) is stored in the experience replay buffer.

[0106] When the amount of experience in the experience replay buffer reaches a certain threshold (such as batch_size or greater), samples are randomly drawn from the buffer for learning. Specifically, step S34 is performed: the experience replay buffer is sampled by the learning module of the agent to obtain the N groups of training samples, where N is an integer greater than 1.

[0107] For example, a batch of samples (mini-batch) is randomly selected from the experience playback buffer. The jth group of training samples (s j ,a j ,r j ,s j+1 ) includes: the jth state s j , the jth action a j , the jth reward r j and the j+1th state s j+1 Specifically, the jth state includes the scheduling influencing factors after executing the j-1th action, the jth action is scheduling to one of the candidate models in the jth state, the jth reward is the information generated after executing the jth action for evaluating the jth action, the j+1th state includes the scheduling influencing factors after executing the jth action, and j is an integer greater than 1 and not greater than N.

[0108] In step S35, a loss function is determined based on the acquired samples to optimize the model parameters.

[0109] Step S351: The j+1th state s in the jth group of training samples j+1 Enter the target network to obtain the j+1th state s j+1 The reinforcement values ​​corresponding to the next P candidate actions respectively, where the p-th candidate action is scheduled to the p-th candidate model, P is an integer greater than 1, and p is a positive integer not greater than P.

[0110] For example, the value of P is 2. When the value of P is 1, action 0 is executed to schedule the pending task to the cloud model; when the value of P is 2, action 1 is executed to schedule the pending task to the local model. The calculation method of the above reinforcement value is as shown in formula (4).

[0111] Q target (s j+1 ,a′) (4)

[0112] Wherein, a′ represents executing the pth candidate action.

[0113] Step S352: According to the j+1th state s j+1 The reinforcement value and the jth reward r j , determine the jth target value y j .

[0114] Exemplarily, according to the j+1th state s j+1 The maximum value of the reinforcement values ​​corresponding to the next P candidate actions and the jth reward r j , determine the jth target value y j . Refer to formula (5).

[0115]

[0116] Here, γ represents the discount factor.

[0117] Step S353: Input the j-th action and the j-th state in the j-th group of training samples into the main network to obtain the j-th prediction value Q(s j ,a j ).

[0118] Step S354: Based on the j-th predicted value Q(s j ,a j ) and the j-th target value y j Determine the first loss function L 1 The details are as shown in formula (6).

[0119]

[0120] Step S355: Using the first loss function L 1 Optimize the parameters of the main network to obtain the trained artificial intelligence model.

[0121] Among them, the weight of the main network will be adjusted according to the first loss function L in each training iteration. 1 Update to minimize Q(s j ,a j ) and y j The weights of the target network can be updated to the weights of the main network every fixed time step (e.g. every 4 time steps) to maintain a certain lag, thus providing a relatively stable benchmark.

[0122] In an exemplary embodiment, for the main network optimized by the first loss function, a cross-validation method can be used to evaluate the model. Specifically, the data is divided into multiple subsets, and training and testing are performed on different subsets. The evaluation index on each subset is calculated, and the mean value and variance are statistically calculated to evaluate the stability and generalization ability of the model.

[0123] When the model evaluation result does not meet the preset requirements, samples can be collected from the experience replay buffer again, and the loss function can be determined based on the newly collected samples to further optimize the model parameters until the model evaluation result meets the preset requirements.

[0124] When the model evaluation results meet the preset requirements, since the main network is continuously updated during the training process, it has learned the optimal reinforcement value estimation and can output the optimal action according to the input state. In this embodiment, the main network after parameter optimization, that is, the trained AI model, can output the first prediction result according to the input call influencing factor characteristics, where the first prediction result can be used to determine the most reasonable scheduling target at present.

[0125] Continue to refer Figure 2 In step S230, a target model is determined from the candidate models according to the first prediction result.

[0126] Exemplarily, the first prediction result output by the artificial intelligence model is a confidence level. In this embodiment, if it corresponds to M levels, M is an integer greater than 1.

[0127] The confidence is evenly divided into M value intervals, and each value interval corresponds to a level. For example, if M is 5, the relationship between the level and the confidence interval can be as follows:

[0128] Level 1: confidence level < 0.2;

[0129] Level 2: 0.2≤Confidence<0.4;

[0130] Level 3: 0.4 ≤ confidence level < 0.6;

[0131] Level 4: 0.6≤Confidence<0.8;

[0132] Level 5: 0.8 ≤ confidence ≤ 1.0.

[0133] It is understandable that the number of confidence intervals and the division method can be set according to actual needs, and the above is only an example. For example, different users can correspond to different configuration files, and the local computing device can determine the division method of the confidence interval according to the configuration file.

[0134] At the same time, each level can correspond to different calling paths, which can be local models and cloud models of different scales. For example:

[0135] Level 1: The confidence is very low, and the local model is used first, that is, the calling path is the path of the local model.

[0136] Level 2: The confidence is low. You can consider using a local model or a lightweight cloud model. That is, the calling path is the path of the local model or the path of the lightweight cloud model.

[0137] Level 3: The confidence level is medium. You can consider using a medium-sized cloud model. That is, the calling path is the path of a medium-sized cloud model.

[0138] Level 4: The confidence level is high, and the cloud model is used first. That is, the calling path is the path of the cloud model with a higher level.

[0139] Level 5: The confidence level is very high, and the cloud model is used first. That is, the calling path is the path of the cloud model with a high level of confidence.

[0140] It is understandable that the call paths corresponding to different levels can be set according to actual needs, and the above is only an example. For example, different users can correspond to different configuration files, and the local computing device can determine the call paths corresponding to different levels according to the configuration files.

[0141] Furthermore, the specific implementation of step S230 may be as follows.

[0142] Step S230-1, determining configuration information corresponding to the user identification.

[0143] Step S230-2: Divide the confidence intervals according to the above configuration information to obtain M confidence intervals.

[0144] Step S230-3, determining the target confidence interval of the first prediction result;

[0145] Step S230-4, determining the target level corresponding to the above target confidence interval, wherein different levels correspond to different model calling paths, and the above target level corresponds to the calling path of the target model.

[0146] As mentioned above, in order to provide greater flexibility and allow users to customize the way of dividing the confidence interval and the calling paths of different levels, the local computing device can first obtain the configuration information corresponding to the user identifier, and if it exists, divide the confidence interval according to the obtained configuration information, and determine the confidence interval where the first preset result is located, and then determine the level corresponding to the current confidence. If the configuration file corresponding to the user identifier is not obtained, the default confidence interval division method can be used to determine the interval to which the confidence in the current prediction information belongs, thereby determining the level corresponding to the current confidence.

[0147] Continue to refer Figure 2 In step S240, the task to be processed is scheduled to the target model so as to execute the task to be processed through the target model.

[0148] Through the above-mentioned embodiments, it is realized that the pending tasks are automatically scheduled to the target model based on the AI ​​model. Specifically, when predicting the scheduling target, the AI ​​model can comprehensively consider the scheduling influencing factors related to the pending tasks, the scheduling influencing factors of the candidate models, and the scheduling influencing factors of the currently available computing resources. Therefore, the scheduling target predicted by the AI ​​model can take into account the influence of the above multiple aspects, so as to determine a reasonable scheduling target based on the current state of each influencing factor, and can adaptively adjust the scheduling target when each influencing factor changes. It can be seen that in the embodiment of the present application, the information of each scheduling influence feature is fused and analyzed, and the optimal solution for executing the current task is adaptively given, rather than a fixed scheduling call mode, which is conducive to improving the flexibility of model scheduling. At the same time, in the embodiment of the present application, the interval of the AI ​​model output confidence and the model call path corresponding to different confidence intervals can be flexibly adjusted according to the user's configuration information, thereby further improving the flexibility of model scheduling.

[0149] In an exemplary embodiment, after executing the task to be processed through the target model, the effect evaluation model can also be used to evaluate the quality of the task execution result from the aspects of accuracy, relevance, etc. The following steps are exemplary performed.

[0150] In step S41, after the target model executes the task to be processed, a third expected result output by the target model after processing the task to be processed is obtained. And, in step S42, model input information about the task to be processed is obtained.

[0151] Exemplarily, if the target model determined after scheduling is the cloud model B, the above-mentioned task to be processed is the most recent task executed by the cloud model B, specifically the summary generation task b of the article Y, then the above-mentioned cloud model B input information is the above-mentioned article Y and the corresponding prompt word prompt, and the above-mentioned third prediction result is the summary information y generated after the cloud model B executes the summary generation task b.

[0152] In step S43, the model input information of the task to be processed and the third expected result are input into the effect evaluation model, wherein the output of the effect evaluation model is the current task effect score corresponding to the target model.

[0153] In the embodiment of the present application, the model for executing the task is evaluated by the effect evaluation model. Specifically, the input information of the effect evaluation model can be the input information and output information of the model for executing the task, and the output information of the effect evaluation model is the score of executing the current task. current ,The above scores can comprehensively measure the relevance and accuracy of the model generated results and the input information for executing the task.

[0154] Furthermore, in step S44, the historical effect score corresponding to the target model is updated according to the current task effect score to obtain the latest effect score corresponding to the target model.

[0155] Specifically, calculate the first weight β and the current task effect score score current The product of α and α is used to obtain the first value; the second weight α is calculated and the historical effect score corresponding to the target model is calculated. last The product of is obtained to obtain a second value; the sum of the first value and the second value is calculated to obtain the latest effect score corresponding to the target model. The specific expression is as shown in formula (7).

[0156] score=α*score last +β*score current (7)

[0157] Among them, the value of the first weight β can be 1-α modulo, which is not limited in the embodiment of the present application.

[0158] Suppose, after article Y and summary information y are input into the effect evaluation model, the output of the effect evaluation model is the score of cloud model B executing task b. current_b , and the historical effect score corresponding to the cloud model B is expressed as score last_B , then the latest effect score corresponding to the cloud model B is B =α*score last_B +β*score current_b .

[0159] refer to Figure 4 It can be seen that the input information of the effect evaluation model 30 is the input information and output information of the target model 20 (the input information 210 and the predicted result 220 about task X), and the output of the effect evaluation model 30 is the effect score of the target model 20 executing the current task X. The effect score of the target model 20 executing the current task X can be used to compare the historical effect score corresponding to the model, thereby obtaining the latest effect score corresponding to the model 20. The latest effect score corresponding to the candidate model can be input into the AI ​​model 10 as a scheduling influencing factor 110, so that the AI ​​model 10 obtains the first preset result 120 for the above-mentioned calling influencing factor 110, wherein the first preset result 120 is used to determine the scheduling target. It can be seen that in the embodiment of the present application, the effect of the target model is evaluated by the effect evaluation model, and the evaluation result is used as the input information of the AI ​​model to determine the scheduling target, thereby providing the above-mentioned feedback mechanism, which can be conducive to the iterative improvement of the prediction accuracy of the above-mentioned AI model.

[0160] Next, an embodiment of the training method of the above-mentioned effect evaluation model is introduced.

[0161] In step S51, P groups of training samples are determined, the i-th group of samples includes the i-th anchor point, the i-th positive sample and the i-th negative sample, wherein the i-th anchor point is the i-th model input information about the i-th task, and the i-th positive sample and the i-th negative sample are the positive processing result and negative processing result output information about the i-th task, respectively.

[0162] For example, for each candidate model, a certain number (such as 5000) of training samples can be determined. For example, for the local model C, 5000 triples of training models are determined, where the i-th group of samples can be represented as [query i ,good_answer i ,bad_answer i ]. The i-th anchor query i If the local model is used to process the i-th task, the information of the local model C needs to be input; the i-th positive sample good_answer i represents the positive processing result of the i-th task; the i-th negative sample bad_answer i represents the negative processing result of the i-th task. For example, if the i-th task is task D to generate a summary for article Z, then the i-th anchor query i is the prompt word and article Z about task D, the i-th positive sample good_answer i is the higher quality summary z of article Z, the i-th negative sample bad_answer i is a lower quality summary z'.

[0163] Exemplarily, the above triplet training samples may be generated by a model or may be pre-defined by a human expert or annotator.

[0164] In step S52, the i-th anchor query i 、The i-th positive sample good_answer i and the i-th negative sample bad_answer i Input the effect evaluation model to be trained respectively to determine the i-th anchor query i The corresponding i-th anchor point embedding feature The i-th positive sample good_answer i The corresponding i-th positive sample embedding feature And the i-th negative sample bad_answer i The corresponding i-th negative sample embedding feature

[0165] If the model structure of the effect evaluation model includes transformers, fully connected layers, and sigmoid activation functions, the three elements in the i-th group of samples are processed respectively through the transformers and fully connected layers of the model to obtain the corresponding three embedding features.

[0166] In step S53, according to the i-th anchor point embedding feature The i-th positive sample embedding feature And the i-th negative sample embedding feature Determine the second loss function L i2 . Please refer to formula (8) for details.

[0167] In step S54, the model parameters are optimized according to the second loss function to obtain a trained effect evaluation model.

[0168]

[0169] Among them, d(,) is a function that measures distance, such as Euclidean distance or cosine similarity, and σ represents the boundary value, which is a hyperparameter used to control the gap between positive and negative samples. It can ensure that the distance between the positive sample and the anchor point is less than the sum of the distance between the negative sample and the anchor point and σ.

[0170] In an exemplary embodiment, Figure 5 The flowchart of a model scheduling method P300 provided in the embodiment of the present application is shown in FIG. 1 . The method P300 is executed on the basis of P200 . The execution subject of the method P300 may be a local computing device, such as Figure 1 Server 104 is shown.

[0171] If the candidate models in this embodiment include: an online model and a local model, the following steps are performed before executing method P200.

[0172] In step S310, current network characteristic information is obtained. In step S320, it is determined whether the current network characteristic information meets a first preset condition.

[0173] Among them, the above-mentioned network characteristic information may include: signal strength, signal type, such as 4G, 5G or WIFI, hotspot, etc.

[0174] If the above network characteristic information meets the first preset condition, it means that the local computing device can access the network, and you can further choose to schedule it to the online model or the local model. Specifically, you can execute the steps corresponding to method P200, or execute the related steps of step S330; on the contrary, if the above network characteristics do not meet the first preset condition, it means that the local computing device cannot access the network. In this case, the cloud online model cannot be called. In order to ensure the smooth execution of the task, execute step S340 to schedule the task to be processed to the local model so that the task to be processed can be executed through the local model.

[0175] In step S330, it is determined whether the task to be processed satisfies a second preset condition.

[0176] Among them, the above-mentioned second preset condition is related to whether the task contains sensitive information, or whether it is a sensitive type of task. Exemplarily, the user's input information for the task to be processed can be detected through rules or related AI models to determine whether the task to be processed contains sensitive information or whether it is a sensitive type of task. Specifically, if the second preset condition is met, it means that the task to be processed is a sensitive type of task or contains sensitive information, then execute step S340: schedule it to the local model for processing, so as to execute the task to be processed through the local model to ensure security. If the above-mentioned second preset condition is not met, execute the scheduling plan corresponding to step P200.

[0177] It is understandable that, when it is determined that there is no problem with the network, the steps related to step S330 can be directly executed during the execution of method P300. Of course, when it is determined that the task to be processed is not of a sensitive type or does not contain sensitive information, the steps related to step S330 may not be executed. This embodiment of the present application does not limit this.

[0178] The embodiment of the present application provides an adaptive end-cloud model scheduling solution, which comprehensively considers the influencing factors of multiple aspects of characteristic information such as network status, device computing resources, AI computing time, data sensitivity, security configuration, large model effect, computing cost, etc., and constructs a set of automatic classification of task requests, resource evaluation, and effect evaluation algorithms. This technology can automatically identify and classify user task requests, and perform real-time evaluation of the computing resources of the current device, so that simple tasks, data-sensitive tasks or tasks without a network connection can be automatically scheduled to the end-side model, and local computing resources are insufficient or complex task scenarios can be scheduled to the cloud model, realizing user-friendly intelligent scheduling and improving user experience. It can be seen that in the embodiment of the present application, the characteristic information of each scheduling influence is integrated and analyzed, and the optimal solution is adaptively given, rather than a fixed scheduling call mode, which is conducive to improving the flexibility of model scheduling.

[0179] Combination of the above Figures 1 to 5, describes the method embodiment and model embodiment of the present application, and the following is combined with Figure 6 An embodiment of the model scheduling device of the present application is described.

[0180] Figure 6 A schematic block diagram of a model scheduling device 600 provided in an embodiment of the present application.

[0181] refer to Figure 6 The model scheduling device 600 provided in the embodiment of the present application includes: an acquisition module 610, a processing module 620, a determination module 630 and a scheduling module 640.

[0182] Among them, the above-mentioned acquisition module 610 is used to obtain scheduling influencing factors, wherein the above-mentioned influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources; the above-mentioned processing module 620 is used to input the above-mentioned scheduling influencing factors into the artificial intelligence model, so as to process the above-mentioned scheduling influencing factors through the above-mentioned artificial intelligence model to determine the first prediction result; the above-mentioned determination module 630 is used to determine the target model from the above-mentioned candidate models according to the above-mentioned first prediction result; and the above-mentioned scheduling module 640 is used to schedule the above-mentioned task to be processed to the above-mentioned target model, so as to execute the above-mentioned task to be processed through the above-mentioned target model.

[0183] In an exemplary embodiment, based on the above solution, the above device further includes a training module;

[0184] The training module is used to: before the processing module 620 inputs the scheduling influencing factors into the artificial intelligence model, train the artificial intelligence model in the following manner: determine the artificial intelligence network as the main network, and determine the target network based on the main network; determine N groups of training samples, the jth group of training samples includes: the jth state, the jth action, the jth reward and the j+1th state, wherein the jth state includes the scheduling influencing factors after executing the j-1th action, the jth action is the scheduling to one of the candidate models under the jth state, the jth reward is the information generated after executing the jth action for evaluating the jth action, the j+1th state includes the scheduling influencing factors after executing the j-1th action, and N is greater than 1 An integer, j is an integer greater than 1 and not greater than N; the j+1th state in the j-th group of training samples is input into the target network to obtain the reinforcement values ​​corresponding to the P candidate actions in the j+1th state, wherein the p-th candidate action is dispatched to the p-th candidate model, P is an integer greater than 1, and p is a positive integer not greater than P; according to the reinforcement value in the j+1th state and the j-th reward, the j-th target value is determined; the j-th action and the j-th state in the j-th group of training samples are input into the main network to obtain the j-th prediction value; the first loss function is determined according to the j-th prediction value and the j-th target value; and the parameters of the main network are optimized by the first loss function to obtain the trained artificial intelligence model.

[0185] In an exemplary embodiment, based on the above scheme, the above training module is specifically used to: determine that the decision module of the agent is the above main network, determine that the learning module of the above agent is the above main network and the above target network, and determine the storage module of the above agent; determine that the state of the environment includes the above scheduling influencing factors, and determine that the reward of the above environment includes the performance indicators and / or training efficiency information of the above artificial intelligence model; at the tth time step, select the tth action through the decision module of the above agent; execute the above tth action in the above environment to determine the t+1th state and the tth reward; receive the above t+1th state and the tth reward through the storage module of the above agent, and store the above tth state, the above tth action, the above t+1th state and the tth reward in the experience replay buffer; and sample the above experience replay buffer through the learning module of the above agent to obtain the above N groups of training samples.

[0186] In an exemplary embodiment, based on the above scheme, the above-mentioned first influencing factor includes the category to which the above-mentioned task to be processed belongs; the above-mentioned acquisition module 610 is specifically used to: obtain descriptive information about the above-mentioned task to be processed; and, input the above-mentioned descriptive information into the classification model to determine the category to which the above-mentioned task to be processed belongs through the output of the above-mentioned classification model.

[0187] In an exemplary embodiment, based on the above scheme, the above-mentioned second influencing factor includes the latest effect score corresponding to the above-mentioned candidate model; the above-mentioned acquisition module 610 is specifically used to: obtain model input information about the target task, the above-mentioned target task is any task performed by the target candidate model, and the above-mentioned target candidate model is any candidate model; obtain the second prediction result output by the above-mentioned target candidate model after processing the above-mentioned model input information; input the model input information of the above-mentioned target task and the above-mentioned second prediction result into the effect evaluation model, wherein the output of the above-mentioned effect evaluation model is the current task effect score corresponding to the above-mentioned target candidate model; and, according to the current task effect score corresponding to the above-mentioned target candidate model, update the historical effect score corresponding to the above-mentioned target candidate model to obtain the latest effect score corresponding to the above-mentioned target candidate model.

[0188] In an exemplary embodiment, based on the above scheme, the second influencing factor includes the computational cost corresponding to the candidate model, wherein the candidate model includes: an online model and a local model.

[0189] In an exemplary embodiment, based on the above solution, the third influencing factor includes at least one of the following computing resources of the device where the local model is located:

[0190] The number of CPU cores of the central processing unit; the main frequency of the CPU; the utilization rate of the CPU; the amount of available memory resources; whether the target processing unit resources are included; and, in the case where the above-mentioned target processing unit resources exist, at least one of the computing power of the above-mentioned target processing unit, the available video memory resources of the above-mentioned target processing resources, the frequency of the above-mentioned target processing unit and the utilization rate of the above-mentioned target processing unit; wherein the above-mentioned target processing unit includes: a graphics processing unit GPU and / or a neural network processing unit NPU.

[0191] In an exemplary embodiment, based on the above solution, the first preset result is a confidence level;

[0192] The above-mentioned determination module 630 is specifically used to: determine the configuration information corresponding to the user identifier; divide the confidence interval according to the above-mentioned configuration information to obtain M confidence intervals, where M is an integer greater than 1; determine the target confidence interval in which the above-mentioned first prediction result is located in the above-mentioned M confidence intervals; determine the target level corresponding to the above-mentioned target confidence interval, wherein different levels correspond to different model calling paths, and the above-mentioned target level corresponds to the calling path of the target model.

[0193] In an exemplary embodiment, based on the above solution, the above device further includes an evaluation module;

[0194] The above-mentioned evaluation module is used for: obtaining the model output information about the above-mentioned task to be processed after executing the above-mentioned task to be processed through the above-mentioned target model; obtaining the third expected result output by the above-mentioned target model after processing the above-mentioned model input information; inputting the model input information of the above-mentioned task to be processed and the above-mentioned third expected result into the effect evaluation model, wherein the output of the above-mentioned effect evaluation model is the current task effect score corresponding to the above-mentioned target model; and, according to the above-mentioned current task effect score, updating the historical effect score corresponding to the above-mentioned target model to obtain the latest effect score corresponding to the above-mentioned target model.

[0195] In an exemplary embodiment, based on the above scheme, the above evaluation module is specifically used to: calculate the product of the first weight and the current task effect score to obtain a first value; calculate the product of the second weight and the historical effect score corresponding to the above target model to obtain a second value; calculate the sum of the first value and the second value to obtain the latest effect score corresponding to the above target model.

[0196] In an exemplary embodiment, based on the above solution, the above device further includes a training module;

[0197] The training module is used to: determine P groups of training samples, the i-th group of samples includes the i-th anchor point, the i-th positive sample and the i-th negative sample, wherein the i-th anchor point is the i-th model input information about the i-th task, and the i-th positive sample and the i-th negative sample are respectively the positive processing result and the negative processing result output information about the i-th task; input the i-th anchor point, the i-th positive sample and the i-th negative sample into the effect evaluation model to be trained respectively to determine the i-th anchor point embedding feature corresponding to the i-th anchor point, the i-th positive sample embedding feature corresponding to the i-th positive sample, and the i-th negative sample embedding feature corresponding to the i-th negative sample; determine the second loss function according to the i-th anchor point embedding feature, the i-th positive sample embedding feature and the i-th negative sample embedding feature; and optimize the model parameters according to the second loss function to obtain the trained effect evaluation model.

[0198] In an exemplary embodiment, based on the above scheme, the candidate models include: an online model and a local model; the acquisition module 610 is also used to: before obtaining the scheduling influencing factors, obtain the current network feature information, and / or determine whether the above-mentioned task to be processed meets the second preset condition; if at least one of the following is met: the above-mentioned network feature information meets the first preset condition and the above-mentioned task to be processed meets the second preset condition, then execute the step of obtaining the scheduling influencing factors; or, if at least one of the following is met: the above-mentioned network feature information does not meet the above-mentioned first preset condition and the above-mentioned task to be processed does not meet the above-mentioned second preset condition, then schedule the above-mentioned task to be processed to the above-mentioned local model.

[0199] It should be understood that if Figure 6 The embodiment of the model scheduling device shown in the figure may correspond to the embodiment of the model scheduling method described above, and similar descriptions may refer to the method embodiment. To avoid repetition, it will not be described here. Specifically, by Figure 6 The information interaction between the modules in the model scheduling device shown in FIG. 1 can execute the above-mentioned embodiment of the model scheduling method, by Figure 6 The information interaction between the various modules in the model scheduling device shown can execute the embodiments of the above-mentioned model scheduling method, and the method embodiments corresponding to the aforementioned and other operations and / or functions of the various modules in the device are not repeated here for the sake of brevity.

[0200] The operation and maintenance related devices of the software agent of the embodiment of the present application are described above from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or a combination of hardware and software modules in the decoding processor to execute. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0201] An embodiment of the present application also provides an electronic device.

[0202] Figure 7 Schematic block diagram of an electronic device 700 provided in an embodiment of the present application. As mentioned above, the operation and maintenance related devices of the software agent can be deployed in Figure 7 The electronic device shown can therefore be used to execute the above-mentioned model scheduling method.

[0203] like Figure 7 As shown, the electronic device 700 may include:

[0204] The memory 710 and the processor 720, the memory 710 is used to store the computer program 730 and transmit the program code 730 to the processor 720. In other words, the processor 720 can call and run the computer program 730 from the memory 710 to implement the method in the embodiment of the present application.

[0205] For example, the processor 720 may be used to execute the steps in the above-mentioned model scheduling method according to the instructions in the computer program 730, or to execute the steps in the above-mentioned model scheduling method.

[0206] In some embodiments of the present application, the processor 720 may include but is not limited to:

[0207] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0208] In some embodiments of the present application, the memory 710 includes but is not limited to:

[0209] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0210] In some embodiments of the present application, the computer program 730 may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the model scheduling method provided by the present application, or to complete the steps in the above-mentioned model scheduling method. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 730 in the electronic device.

[0211] like Figure 7 As shown, the electronic device 700 may further include:

[0212] The transceiver 740 may be connected to the processor 720 or the memory 710 .

[0213] The processor 720 may control the transceiver 740 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 740 may include a transmitter and a receiver. The transceiver 740 may further include an antenna, and the number of antennas may be one or more.

[0214] It should be understood that the various components in the electronic device 700 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0215] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0216] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of the above method embodiment.

[0217] In other words, when software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instruction is loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction can be transmitted from a website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (for example, a solid-state drive (Solid State Disk, SSD)), etc.

[0218] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can 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.

[0219] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0220] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0221] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A model scheduling method, characterized in that: The method comprises: Acquire scheduling influencing factors, wherein the influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources; Inputting the scheduling influencing factors into an artificial intelligence model to process the scheduling influencing factors through the artificial intelligence model to determine a first prediction result; Determining a target model from the candidate models according to the first prediction result; The to-be-processed tasks are scheduled to the target model so as to execute the to-be-processed tasks through the target model.

2. The method according to claim 1, characterized in that Before inputting the scheduling influencing factors into the artificial intelligence model, the method further includes training the artificial intelligence model in the following manner: Determine the artificial intelligence network as a main network, and determine a target network based on the main network; Determine N groups of training samples, the jth group of training samples includes: a jth state, a jth action, a jth reward and a j+1th state, wherein the jth state includes the scheduling influencing factors after executing the j-1th action, the jth action is scheduling to one of the candidate models under the jth state, the jth reward is information generated after executing the jth action for evaluating the jth action, the j+1th state includes the scheduling influencing factors after executing the jth action, N is an integer greater than 1, and j is an integer greater than 1 and not greater than N; Input the j+1th state in the jth group of training samples into the target network to obtain the reinforcement values ​​corresponding to P candidate actions in the j+1th state, wherein the pth candidate action is scheduled to the pth candidate model, P is an integer greater than 1, and p is a positive integer not greater than P; Determining a j-th target value according to the reinforcement value and the j-th reward in the j+1-th state; Inputting the jth action and the jth state in the jth group of training samples into the main network to obtain the jth prediction value; Determine a first loss function according to the j-th predicted value and the j-th target value; The parameters of the main network are optimized by the first loss function to obtain a trained artificial intelligence model.

3. The method according to claim 2, characterized in that The determining of N groups of training samples comprises: Determine the decision module of the agent as the main network, determine the learning module of the agent as the main network and the target network, and determine the storage module of the agent; Determining that the state of the environment includes the scheduling influencing factors, and determining that the reward of the environment includes the performance indicator and / or training efficiency information of the artificial intelligence model; At the tth time step, the tth action is selected by the decision module of the agent, where t is a positive integer; Execute the t-th action in the environment to determine the t+1-th state and the t-th reward; Receiving the t+1th state and the tth reward through the storage module of the agent, and storing the tth state, the tth action, the t+1th state and the tth reward in an experience replay buffer; The experience replay buffer is sampled through the learning module of the agent to obtain the N groups of training samples.

4. The method according to any one of claims 1 to 3, characterized in that The first influencing factor includes the category to which the task to be processed belongs; Get the first factors affecting the tasks to be processed, including: Obtaining description information about the task to be processed; The description information is input into a classification model, so as to determine the category to which the task to be processed belongs through the output of the classification model.

5. The method according to any one of claims 1 to 3, characterized in that: The second influencing factor includes the latest effect score corresponding to the candidate model; Get the second influencing factors about the candidate model, including: Acquire model input information about a target task, where the target task is any task that has been performed by a target candidate model, and the target candidate model is any candidate model; Obtaining a second prediction result output by the target candidate model after processing the model input information; Inputting the model input information of the target task and the second prediction result into an effect evaluation model, wherein the output of the effect evaluation model is the current task effect score corresponding to the target candidate model; According to the current task effect score corresponding to the target candidate model, the historical effect score corresponding to the target candidate model is updated to obtain the latest effect score corresponding to the target candidate model.

6. The method according to any one of claims 1 to 3, characterized in that: The second influencing factor includes a computational cost corresponding to the candidate model, wherein the candidate model includes: an online model and a local model.

7. The method according to claim 6, characterized in that The third influencing factor includes at least one of the following computing resources of the device where the local model is located: The number of CPU cores in the central processing unit; the CPU main frequency; the CPU utilization rate; the amount of available memory resources; whether the target processing unit resources are included; and, In the presence of the target processing unit resources, at least one of the computing power of the target processing unit, the available video memory resources of the target processing resources, the frequency of the target processing unit and the utilization rate of the target processing unit; wherein the target processing unit includes: a graphics processing unit GPU and / or a neural network processing unit NPU.

8. The method according to any one of claims 1 to 3, characterized in that The first preset result is a confidence level; Determining a target model from the candidate models according to the first prediction result includes: Determine configuration information corresponding to the user identifier; Dividing the confidence interval according to the configuration information to obtain M confidence intervals, where M is an integer greater than 1; Determine a target confidence interval of the first prediction result among the M confidence intervals; A target level corresponding to the target confidence interval is determined, wherein different levels correspond to different model calling paths, and the target level corresponds to the calling path of the target model.

9. The method according to any one of claims 1 to 3, characterized in that: After executing the task to be processed by the target model, the method further includes: Obtaining model output information about the task to be processed; Obtaining a third expected result output by the target model after processing the model input information; Inputting the model input information of the task to be processed and the third expected result into the effect evaluation model, wherein the output of the effect evaluation model is the current task effect score corresponding to the target model; According to the current task effect score, the historical effect score corresponding to the target model is updated to obtain the latest effect score corresponding to the target model.

10. The method according to claim 9, characterized in that The updating of the historical effect score corresponding to the target model according to the current task effect score to obtain the latest effect score corresponding to the target model includes: Calculate the product of the first weight and the current task effect score to obtain a first value; Calculate the product of the second weight and the historical effect score corresponding to the target model to obtain a second value; The sum of the first value and the second value is calculated to obtain the latest effect score corresponding to the target model.

11. The method according to claim 9, characterized in that The method further comprises: Determine P groups of training samples, the i-th group of samples includes an i-th anchor point, an i-th positive sample, and an i-th negative sample, wherein the i-th anchor point is the i-th model input information about the i-th task, and the i-th positive sample and the i-th negative sample are respectively the positive processing result and the negative processing result output information about the i-th task; Inputting the i-th anchor point, the i-th positive sample and the i-th negative sample into the effect evaluation model to be trained respectively to determine the i-th anchor point embedding feature corresponding to the i-th anchor point, the i-th positive sample embedding feature corresponding to the i-th positive sample, and the i-th negative sample embedding feature corresponding to the i-th negative sample; Determining a second loss function according to the i-th anchor point embedding feature, the i-th positive sample embedding feature, and the i-th negative sample embedding feature; The model parameters are optimized according to the second loss function to obtain a trained effect evaluation model.

12. The method according to any one of claims 1 to 3, characterized in that: The candidate models include: an online model and a local model; before obtaining the scheduling influencing factors, the method further includes: Acquiring current network feature information, and / or determining whether the task to be processed satisfies a second preset condition; If at least one of the following is satisfied: the network characteristic information satisfies the first preset condition and the task to be processed satisfies the second preset condition, then the step of obtaining the scheduling influencing factor is executed; or, If at least one of the following is met: the network feature information does not meet the first preset condition and the task to be processed does not meet the second preset condition, the task to be processed is scheduled to the local model.

13. A model scheduling device, characterized in that: The device comprises: An acquisition module, used for acquiring scheduling influencing factors, wherein the influencing factors include at least one of the following: a first influencing factor on the task to be processed, a second influencing factor on the candidate model, and a third influencing factor on the current computing resources; A processing model, used for inputting the scheduling influencing factors into an artificial intelligence model, so as to process the scheduling influencing factors through the artificial intelligence model to determine a first prediction result; A determination module, configured to determine a target model from the candidate models according to the first prediction result; The scheduling module is used to schedule the pending tasks to the target model so as to execute the pending tasks through the target model.

14. A computer-readable storage medium, characterized in that: For storing computer programs; The computer program enables a computer to execute the model scheduling method according to any one of claims 1 to 12.

15. An electronic device, wherein: including a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program to implement the model scheduling method described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Scheduling method and device, electronic equipment and readable storage medium

    CN110750342A

  • Model training task management method and device, terminal and storage medium

    CN113592209A

  • System and method for adapting varying constraints

    CN115427972A

  • Algorithm model intelligent calling method and system

    CN118227743A

  • Neural network search method and related apparatus

    US20210312261A1

Cited By

  • Service request processing method and device, storage medium and electronic equipment

    CN120455551A

  • Multi-model scheduling method and device based on error perception, equipment and storage medium

    CN121934985A

  • Error-aware multi-model scheduling method and device, equipment and storage medium

    CN121934985B

  • A neural network model loading implementation method and device and medium

    CN122547416A