A multi-task cooperative processing method and system of an artificial intelligence model
By combining business-level and processing-level clustering optimization with matrix processing of difference factors, the problem of incompatibility between efficiency and feedback in multi-task grouping is solved, achieving efficient multi-task collaborative processing and improving the system throughput and resource utilization of the model.
Patent Information
- Application Number
- CN202611562742.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-10
- Publication Date
- 2026-11-06
AI Technical Summary
In existing technologies, multi-task grouping relies on single-dimensional features, which makes it impossible to effectively balance the visibility of business feedback and the efficiency of model processing, and makes it difficult to simultaneously meet the needs of different dimensions.
By acquiring task categories and text features, clustering optimization is performed at the business level and processing level. Combined with matrix processing of difference factors, advanced optimization parameters are configured to achieve collaborative grouping and processing of multiple tasks.
While ensuring model processing efficiency, it improves the clarity and visibility of business feedback information, reduces logical branches and computational overhead, and increases system throughput and resource utilization.
Smart Images

Figure CN123049178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a multi-task collaborative processing method and system for artificial intelligence models. Background Technology
[0002] With the rapid development of artificial intelligence technology, AI models such as large language models are widely used in various scenarios that require parallel processing of a large number of user requests, such as the intelligent consultation service in hospital triage systems. In practical applications, it is usually necessary to receive and process consultation requests from a large number of users simultaneously. Different requests contain different types of symptoms, and the length of the input text descriptions also varies significantly.
[0003] In existing technologies, when grouping multiple tasks, a single dimension of features is typically considered. One common approach is grouping by task category, grouping tasks with similar business types together for unified model processing. Another approach is grouping by task text length, grouping tasks with similar lengths together to reduce padding overhead caused by inconsistent input lengths. However, these two grouping methods rely on different dimensions and pursue different grouping goals. When grouping according to different dimensions, the results are often inconsistent, but existing technologies lack effective means to coordinate these different grouping results. Consequently, the final grouping scheme usually only considers one dimension, making it difficult to simultaneously address the needs of different dimensions. Summary of the Invention
[0004] This invention provides a method and system for multi-task collaborative processing of artificial intelligence models. This invention solves the technical problem in existing technologies where the reliance on a single-dimensional feature for multi-task grouping leads to an inability to effectively balance the visibility of business feedback and model processing efficiency.
[0005] In view of the above problems, the present invention provides a multi-task collaborative processing method for artificial intelligence models, comprising: Obtain multiple task category features and multiple task text features of multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple business-optimal clustered task clusters; Based on the text features of multiple tasks, hierarchical clustering optimization of artificial intelligence model processing is performed to obtain multiple clusters of tasks with optimal processing. The matrix processing difference factor is used to obtain multiple optimal clustering task clusters for business and multiple optimal clustering task clusters for processing. Based on the matrix processing difference factor and the total number of tasks, advanced optimization parameters are configured, and multiple optimal clustering task clusters are further adjusted and optimized to obtain multiple optimal clustering task clusters. Then, multiple tasks are collaboratively grouped for processing.
[0006] This invention also provides a multi-task collaborative processing system for artificial intelligence models, comprising: The business-level clustering module is used to obtain multiple task category features and multiple task text features of multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple optimal business clusters of tasks. The hierarchical clustering module is used to optimize the hierarchical clustering of artificial intelligence models based on the text features of multiple tasks, and to obtain multiple clusters of tasks with optimal processing. The difference factor calculation module is used to process the difference factor of the matrix obtained from multiple business optimal clustering task clusters and multiple processing optimal clustering task clusters. The advanced optimization and collaborative grouping module is used to configure advanced optimization parameters based on the matrix processing difference factor and the total number of tasks, and to continue to adjust and optimize multiple optimal clustering task clusters to obtain multiple optimal clustering task clusters for collaborative grouping processing of multiple tasks.
[0007] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention optimizes task clustering by business-level clustering, grouping tasks with highly correlated business types into the same cluster. This allows for the use of unified business scenario labels and system prompts within the same processing cluster, ensuring high consistency in task outputs within the business semantic space. This effectively reduces the overhead of logical branches and context switching when handling tasks with mixed types. Simultaneously, by optimizing processing-level clustering, tasks with similar text lengths are grouped together, significantly reducing padding overhead during parallel model processing and improving computational efficiency. By calculating the matrix processing difference factor between the two clustering results, the degree of divergence between them is quantified, providing an objective data foundation for subsequent fusion optimization. In the advanced optimization stage, processing weights, business weights, and optimization parameters are adaptively configured based on the total number of tasks and the matrix processing difference factor, ensuring that the magnitude and direction of each clustering adjustment match the actual degree of difference. Finally, through iteration, a clustering scheme maximizing synergy is obtained. Compared with existing technologies, this invention can achieve an optimal balance between processing efficiency and business compatibility. Under the same hardware resource conditions, it can handle more user tasks and effectively improve the system throughput, computing resource utilization and task scheduling efficiency of artificial intelligence models in multi-task concurrent scenarios.
[0008] In summary, this invention solves the technical problem in the prior art where the reliance on a single-dimensional feature for multi-task grouping leads to an inability to effectively balance the visibility of business feedback and the efficiency of model processing. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of the processing hierarchy clustering optimization process in a multi-task collaborative processing method for an artificial intelligence model provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the advanced optimization and collaborative grouping process in a multi-task collaborative processing method for an artificial intelligence model provided in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of a multi-task collaborative processing system for an artificial intelligence model provided in an embodiment of the present invention.
[0011] The components represented by each number in the attached diagram are explained below: The module includes a business-level clustering module 11, a processing-level clustering module 12, a difference factor calculation module 13, and an advanced optimization and collaborative grouping module 14. Detailed Implementation
[0012] This invention provides a multi-task collaborative processing method and system for artificial intelligence models, which specifically addresses the technical problem in the prior art where the reliance on a single-dimensional feature for multi-task grouping leads to an inability to effectively balance the visibility of business feedback and the efficiency of model processing.
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0014] Example 1: This invention provides a multi-task collaborative processing method for artificial intelligence models, the method comprising: S100: Obtain multiple task category features and multiple task text features of multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple optimal business clusters of tasks.
[0015] In existing AI multi-task collaborative processing methods, grouping multiple tasks typically focuses only on features at the model processing level, such as the length of the task text, computational complexity, or the dimensionality of the input data. While this single-dimensional grouping strategy can improve the computational efficiency of the model to some extent, it ignores the business semantic relationships between tasks, resulting in a processing cluster potentially containing user consultation tasks with vastly different symptom types.
[0016] The artificial intelligence model in this embodiment is preferably an intelligent medical question-and-answer model for a hospital or clinic's information desk. Users can upload questions via their terminals and receive feedback from the model at the information desk, or they can receive synchronous feedback on their terminals. Under conventional batch processing mechanisms, although the model can perform independent parallel computation on each task sequence and avoid mixing the inputs and outputs of different users at the semantic level, the significant differences in symptom types within the same batch ultimately result in a lack of clear classification and effective summarization of the output results for different symptom types at the business feedback presentation level. Users find it difficult to quickly locate the content truly related to their own symptoms from a large amount of independent and disordered feedback information, affecting the orderliness and visualization of the information desk model's output. For example, users cannot quickly see all the output feedback for a type of question. This leads to a lack of a unified parsing and post-processing benchmark at the output end, poor consistency of the output results of each task at the business semantic level, and increases the complexity of logical branches and ineffective computational overhead in result filtering, classification display, and subsequent link processing.
[0017] Furthermore, existing technologies lack a mechanism that can adaptively adjust grouping strategies based on actual business needs. Faced with dynamically changing user inquiry task flows across different time periods, it's impossible to maintain clarity of business feedback while ensuring model processing efficiency. The core contradiction between prioritizing processing efficiency and prioritizing clarity of business feedback remains unresolved in current technologies. Therefore, how to rationally group multiple tasks to maximize the clarity and visibility of business feedback while ensuring model processing efficiency has become a pressing technical problem that needs to be solved.
[0018] Step S100 in the method provided in this embodiment of the invention includes: Retrieve multiple tasks to be processed, where each task includes a task category and task text; Extract the task categories and text lengths of multiple tasks as features for multiple task categories and multiple task texts, respectively. Based on the characteristics of multiple task categories, business-level clustering optimization is performed to obtain multiple optimal clusters of task groups.
[0019] In this embodiment of the invention, multiple tasks to be processed are acquired. These multiple tasks include task categories and task text. Specifically, these tasks refer to various health consultation requests submitted by users through a mobile application in a hospital triage system. Task categories are symptom type tags described by the user, such as headache, stomachache, dizziness, cough, fever, rash, etc. Task text is a specific problem description entered by the user in natural language, such as "I felt a throbbing pain on both sides of my head after waking up this morning" or "My stomach has been aching slightly since lunch." Symptom type tags are obtained based on the user's initial selection in the mobile application, or automatically identified and extracted from the task text using natural language understanding technology.
[0020] Furthermore, the server extracts task categories and text lengths from multiple tasks as task category features and task text features, respectively. Specifically, for task category features, the symptom type label corresponding to the user is directly used as the task category feature, and it is converted into a numerical vector form through one-hot encoding for subsequent clustering calculations. For task text features, the total number of character tokens contained in the user-input task text is counted, and the length of the counted character tokens is used as the task text feature for that task. For example, when the user-input task text is "I felt a throbbing pain on both sides of my head after waking up this morning," the token sequence length corresponding to this task text is eighteen tokens, and eighteen is used as the task text feature value for that task. When another user-input task text is "My stomach has been aching slightly since lunch," the token sequence length corresponding to this task text is thirteen tokens, and thirteen is used as the task text feature value for that task.
[0021] Furthermore, the server performs business-level clustering optimization based on the characteristics of multiple task categories, resulting in multiple optimal business clusters. The goal of this optimization process is to group user consultation requests whose task categories have a high degree of medical semantic relevance into the same cluster. For example, headaches and dizziness often co-occur in clinical practice, belonging to a highly correlated task category, and the server will group them into the same business cluster. Conversely, headaches and stomach aches involve significantly different organ systems and treatment pathways, belonging to a low-correlation task category, and the server will group them into different business clusters. This approach allows tasks with highly correlated business types to be grouped into the same processing cluster, thereby imposing unified business scenario labels and system prompt prefix constraints on that cluster within the same batch. This ensures that the output results of each task remain highly consistent within the business semantic space, facilitating unified parsing, filtering, and post-processing aggregation logic at the output end, and effectively reducing the system logic branch overhead caused by frequent switching of task types within a batch.
[0022] Specifically, based on the characteristics of multiple task categories, business-level clustering optimization is performed to obtain multiple optimal clustered task clusters, including: Multiple tasks are randomly clustered to obtain multiple first business cluster task clusters, wherein the number of tasks in each first business cluster task cluster is less than or equal to the rated number. The multiple task category features within each first business cluster are combined in pairs and input into the category compatibility analysis intelligent body. Multiple first category compatibility parameter sets are output. The category compatibility analysis intelligent body is trained using multiple sets of sample task category feature sets and multiple standard category compatibility parameters. Calculate the mean of multiple first-category compatibility parameter sets to obtain the first comprehensive category compatibility parameter; Continue random clustering optimization iterations until convergence, and output multiple business-optimal clustering task clusters with the largest comprehensive category compatibility parameters.
[0023] In this embodiment of the invention, firstly, multiple tasks are randomly clustered to obtain multiple first business cluster task clusters, wherein the number of tasks in each first business cluster task cluster is less than or equal to a predetermined number. The setting of this predetermined number needs to comprehensively consider multiple factors such as the number of parameters of the currently deployed large language model, quantization accuracy, maximum context length for a single inference, the total video memory capacity of the graphics processor, and historical peak concurrency in actual application scenarios. In this embodiment of the invention, the predetermined number can be pre-calculated and determined based on the above factors during the system initialization phase, or it can be manually set by the system administrator based on actual operating conditions. Its core constraint is to ensure that the total video memory occupied by all tasks within a single processing cluster during the model's forward inference process does not exceed the available video memory capacity of the current graphics processor, and to take the largest possible value within this constraint to improve parallel processing efficiency. If the number of tasks in a certain cluster exceeds the predetermined number during random clustering, the excess tasks in that cluster are randomly allocated to other clusters that have not yet reached the predetermined number, until all clusters meet the quantity constraint.
[0024] The rated quantity is determined as follows: First, the memory usage of the model weights is calculated, which is the number of model parameters multiplied by the number of bytes occupied by each parameter at the corresponding quantization precision. Then, the memory usage of a single key-value cache on a single token is calculated, which is two times the number of model layers multiplied by the hidden layer dimension and then multiplied by the number of bytes occupied by each value at the corresponding quantization precision. Next, the memory usage of a single task's key-value cache at the maximum context length is calculated, which is the memory usage of a single token's key-value cache multiplied by the maximum context length. Based on this, the total memory usage of all tasks within a single processing cluster is equal to the model weight memory plus the product of the single task's key-value cache memory and the number of tasks within the cluster, plus the runtime framework overhead.
[0025] Furthermore, the multiple task category features within each first business cluster are combined in pairs. Specifically, for each combination, the server inputs it into a category compatibility analysis agent for processing, and the agent outputs the category compatibility parameters corresponding to that combination. The category compatibility analysis agent is trained using multiple sets of sample task category features and multiple standard category compatibility parameters. If a cluster contains m symptom type tasks, a total of m×(m-1)÷2 feature pairs will be generated, resulting in the same number of category compatibility parameters, which constitute the category compatibility parameter set for that cluster.
[0026] For example, if the three symptom types of headache, dizziness and stomachache are located in the same cluster, m=3, then the number of feature pairs is 3×(3-1)÷2=3 groups. The server will combine the three feature pairs of headache and dizziness, headache and stomachache, and dizziness and stomachache respectively, and after inputting them into the agent, it will obtain three category compatibility parameters.
[0027] The category compatibility analysis agent is a machine learning model built on a deep neural network. It receives features from any two symptom types and outputs a compatibility parameter between 0 and 1, quantitatively representing the degree of correlation between the two symptoms during collaborative business processing. The training standard values for this agent are obtained based on the co-occurrence frequency statistics of symptoms in historical hospital consultation records. The statistical granularity is accurate to a single patient's single consultation record, ensuring the reliability and objectivity of the statistical results. In terms of model structure, the category compatibility analysis agent adopts a multi-layer fully connected feedforward neural network architecture. If the total number of predefined symptom types in the hospital's triage system is N, then the one-hot encoding vector dimension for each symptom type is N. The network has three hidden layers: the first layer has half the number of neurons as the input dimension, the second layer has half the number of neurons as the first layer, and the third layer has half the number of neurons as the second layer. Each hidden layer uses the ReLU activation function. The output layer is a single neuron using the Sigmoid activation function to compress the output value to between 0 and 1.
[0028] It should be noted that when two symptom types are input simultaneously, the indexes of positions with a value of 1 in the one-hot encoding vectors corresponding to the two symptom types are first compared, i.e., the category codes. The category feature with the smaller code value is used as the first half of the joint feature vector, and the category feature with the larger code value is used as the second half of the joint feature vector. These are then concatenated horizontally to form a 2N-dimensional joint feature vector. This fixed sorting rule ensures that any combination of two symptom types has a uniquely determined input order, avoiding inconsistencies in compatibility parameter outputs caused by different input orders.
[0029] Regarding training data, symptom combinations appearing simultaneously in the same patient's historical consultation records were extracted from the hospital information system as candidate samples. For any two symptom types, the total number of consultation records containing the first symptom type was counted, and the total number of consultation records containing both the first and second symptom types was also counted. The proportion of the second symptom type appearing when the first symptom type appeared was calculated, i.e., the total number of consultation records containing both symptom types was divided by the total number of consultation records containing the first symptom type. Simultaneously, the total number of consultation records containing the second symptom type was counted, and the proportion of the first symptom type appearing when the second symptom type appeared was calculated, i.e., the total number of consultation records containing both symptom types was divided by the total number of consultation records containing the second symptom type. The arithmetic mean of these two proportions was then calculated as the category compatibility parameter for the two symptom types. This symmetry processing ensures that the compatibility parameter between the two symptom types does not change due to different input orders, matching the inherent symmetric relationship between the two symptom types.
[0030] During training sample construction, for each pair of labeled samples, they are concatenated into a joint feature vector according to the aforementioned fixed sorting rule. That is, the input order of labeled samples is uniformly arranged so that the class with the smaller code comes first, followed by the class with the larger code, ensuring that the input order rule is completely consistent between the training and inference phases. The server divides all labeled samples into training and validation sets in an 8:2 ratio.
[0031] During training, the server employs a mini-batch gradient descent algorithm, randomly selecting 64 samples per batch. The mean squared error between the predicted and standard values is used as the loss function, and the Adam optimizer updates the network weights with an initial learning rate of 0.001. After each training batch, the mean absolute error is calculated on the validation set. If the error no longer decreases after 10 consecutive batches, the learning rate is reduced to one-tenth of its current value. Training terminates when the mean absolute error on the validation set fails to improve after 20 consecutive batches, and the current network parameters are saved to obtain the trained category compatibility analysis agent. In application, the one-hot encoded vectors of the two symptom types are concatenated and input into the agent. The compatibility parameter values are obtained through forward propagation, providing a quantitative evaluation basis for business-level clustering optimization.
[0032] Further, the server calculates the mean of multiple sets of first-category compatibility parameters to obtain the first comprehensive category compatibility parameter. Specifically, it first calculates the arithmetic mean of all category compatibility parameters within each first business clustering task cluster, which is used as the first-category compatibility parameter for that cluster. Taking a cluster containing 5 symptom types as an example, this cluster has 5 × (5-1) ÷ 2 = 10 feature pairs. The server sums these 10 category compatibility parameters and divides by 10 to obtain the first-category compatibility parameter for that cluster. Then, the server sums the first-category compatibility parameters of all clusters again and divides by the total number of clusters to obtain the first comprehensive category compatibility parameter. This first comprehensive category compatibility parameter represents the overall compatibility level of the current clustering scheme at the business level; a higher value indicates a more reasonable clustering scheme.
[0033] Furthermore, the random clustering optimization iteration continues until convergence, outputting multiple business-optimal clustering task clusters with the largest comprehensive category compatibility parameter. Specifically, a random optimization search strategy with a probability acceptance mechanism combined with a restart strategy is used for multiple iterations. In each iteration, the server performs a random perturbation based on the current clustering scheme. The perturbation method includes randomly swapping one symptom type task in each of two clusters, or randomly moving a task in one cluster to another. After the perturbation, the new first comprehensive category compatibility parameter is recalculated according to the above method. If the new parameter value is greater than the currently recorded optimal value, the perturbation scheme is accepted and updated as the current optimal scheme. If the new parameter value is not greater than the currently recorded optimal value, the perturbation scheme is accepted with the acceptance probability corresponding to the current annealing temperature to avoid getting trapped in a local optimum. The annealing temperature reduction strategy is as follows: the initial acceptance probability corresponding to the initial temperature is set to 20%. Every 50 iterations, the current temperature is multiplied by a cooling coefficient of 0.5, that is, the acceptance probability is halved accordingly, so that the acceptance probability is gradually reduced to 10%, 5%, 2.5%, and so on, simulating the temperature decay during the annealing process. The server continues to iterate and optimize until the optimal comprehensive category compatibility parameter remains unchanged after 300 consecutive iterations. At this point, the optimization is considered to have converged, and the clustering task clusters with the largest comprehensive category compatibility parameter are output as the business-optimal clustering task clusters.
[0034] Regarding the restart strategy, when the current optimal comprehensive category compatibility parameter does not improve after 100 consecutive iterations, a restart operation is triggered: the server resets the current clustering scheme to the optimal clustering scheme with the largest comprehensive category compatibility parameter in the history, and resets the annealing temperature to the initial temperature T0 (i.e., the acceptance probability is restored to the initial value of 20%). Then, it continues to execute the above random perturbation and probability acceptance iteration process from this reset state in order to jump out of the possible local optimum region and re-explore the solution space.
[0035] The above method enables the hospital triage system to find the optimal business grouping scheme from a large number of user consultation tasks in a short period of time. It groups user questions with high-correlation symptoms such as headache and dizziness into the same cluster, while distributing questions with low-correlation symptoms such as headache and stomachache into different clusters. This provides a reasonable business grouping basis for the subsequent batch processing of the large language model, the unified configuration of system prompt words, and the execution of output parsing logic.
[0036] This invention introduces a category compatibility analysis agent to transform the compatibility relationships between business categories, which were originally difficult to quantify, into computable numerical parameters. This provides a clear mathematical optimization objective for business-level clustering optimization: maximizing the comprehensive category compatibility parameter serves as an objective criterion for evaluating grouping quality. This method no longer relies on subjective grouping based on human experience. Instead, it uses a random initialization combined with an iterative convergence optimization strategy to efficiently search for the optimal clustering scheme with the largest comprehensive category compatibility parameter in a large-scale task space. Compared to exhaustively searching all possible clustering combinations, computational efficiency is significantly improved.
[0037] Meanwhile, this method decouples the extraction processes of task category features and task text features, allowing business-level clustering optimization to be performed independently from subsequent text feature-based processing-level clustering optimization. This ensures that the two processes do not interfere with each other, providing the necessary data prerequisites for calculating the difference factor between the two clustering results. The resulting optimal business clustering task clusters ensure that tasks within the same cluster are highly relevant in terms of business semantics, effectively reducing the logical switching overhead caused by significant business differences in the AI model during processing. This, in turn, improves the overall collaborative efficiency of multi-task concurrent processing from a business perspective.
[0038] S200: Based on the text features of multiple tasks, perform hierarchical clustering optimization of artificial intelligence model processing to obtain multiple optimal clustering task clusters.
[0039] In existing multi-task collaborative processing methods, when grouping multiple tasks, the focus is usually only on semantic relationships at the business level, such as task categories, ignoring the task text length, a key factor affecting the actual computational efficiency of the model. When an AI model uses batch processing to perform parallel inference on multiple tasks within the same group, because the model requires that the dimensionality of the input sequences in the same batch be consistent, the server has to uniformly pad all task texts in the batch to the same length as the longest text. This means that when a short text task with a length of only 100 characters is grouped with a long text task with a length of 500 characters in the same batch, the short text needs to be padded with an additional 400 blank placeholders. These padding operations neither add any effective information nor consume a large amount of the model's attentional computational resources, resulting in serious computational waste. As the difference in text length within the same batch increases, the proportion of invalid padding increases linearly, while the effective computational proportion of the model decreases accordingly.
[0040] Furthermore, existing technologies lack methods for quantifying and optimizing the dispersion of text length. The selection of clustering schemes relies on random trials or simple rules, making it difficult to guarantee a globally optimal processing grouping scheme in large-scale task flows. Therefore, how to reasonably group multiple tasks based on task text length to minimize the length difference within clusters and achieve the highest computational efficiency at the model processing level has become an urgent technical problem to be solved.
[0041] Step S200 in the method provided in this embodiment of the invention, as follows: Figure 1 As shown, it includes: Multiple tasks are randomly clustered to obtain multiple first processing cluster task clusters, wherein the number of tasks in each first processing cluster task cluster is less than or equal to the rated number; Text feature discrete analysis is performed on multiple first-process clustering task clusters to obtain the first comprehensive text discrete parameters; Continue random clustering optimization iterations until convergence, and output multiple optimal clustering task clusters with the minimum comprehensive text discrete parameters.
[0042] In this embodiment of the invention, the task text features of multiple tasks to be processed are first obtained. Specifically, these task text features refer to the task text length values of each task that have been extracted and saved in the previous steps, i.e., the token sequence length corresponding to each task text. These task text features are then used as input data for hierarchical clustering.
[0043] Furthermore, multiple tasks are randomly clustered to obtain multiple first processing cluster task clusters. The number of tasks in each first processing cluster task cluster is less than or equal to a predetermined number. This predetermined number is consistent with the predetermined number used in the previous business layer clustering, and its setting method is the same as described above. It is based on factors such as model weight memory, single token key-value cache memory, total single-task key-value cache memory under the maximum context length, runtime framework overhead, and available GPU memory capacity. The total memory is determined by the calculation method of total memory equal to the product of model weight memory, single-task key-value cache memory, and the number of tasks in the cluster, plus runtime framework overhead. In addition, in this embodiment, collaborative processing is performed after the number of tasks to be processed reaches a certain number, and the number of tasks in each cluster task cluster obtained by classification is greater than 1, avoiding empty clusters or single-task clusters. If the number of tasks in a certain cluster exceeds the predetermined number when the server randomly clusters, the excess tasks in that cluster are randomly assigned to other clusters that have not yet reached the predetermined number, until all clusters meet the quantity constraint.
[0044] Furthermore, text feature discretization analysis is performed on multiple clusters of the first processing clustering tasks to obtain a first comprehensive text discretization parameter. This first comprehensive text discretization parameter is used to measure the degree of difference in text length between tasks within each cluster. The larger the value of the discretization parameter, the greater the difference in text length between tasks within the cluster; the smaller the value of the discretization parameter, the closer the text length between tasks within the cluster.
[0045] Finally, the random clustering optimization iteration continues until convergence, outputting multiple optimal clustering task clusters with the minimum comprehensive text discrete parameter. Specifically, multiple iterations of optimization are performed following the above-described random clustering and text feature discrete analysis process. During each iteration, the server randomly adjusts the clustering scheme, either by selecting and swapping tasks from two different clusters or by randomly moving tasks from one cluster to another. Throughout the iteration, the server continuously records the minimum first comprehensive text discrete parameter and its corresponding clustering scheme. When the minimum value of the first comprehensive text discrete parameter has not decreased after 200 consecutive iterations, the server determines that the optimization process has converged. At this point, the iteration stops, and the clustering scheme with the minimum comprehensive text discrete parameter is output. The multiple clustering task clusters corresponding to this scheme are the multiple optimal clustering task clusters.
[0046] Through the above-mentioned hierarchical clustering optimization, user consultation tasks with similar text lengths can be grouped into the same clustering task group, effectively avoiding the filling waste problem caused by the large difference in text length within the same batch when the subsequent artificial intelligence model is processing.
[0047] Specifically, text feature discretization analysis is performed on multiple first-processing clustering task clusters to obtain the first comprehensive text discretization parameters, including: Calculate the discrete parameters of multiple task text features within each first processing cluster to obtain multiple first text discrete parameters; The mean of multiple first text discrete parameters is calculated to obtain the first comprehensive text discrete parameter.
[0048] In this embodiment of the invention, discrete parameters of multiple task text features within each first processing cluster are first calculated to obtain multiple first text discrete parameters. Specifically, the standard deviation is used to measure the degree of deviation of the length of each task text within the cluster from the average length of the cluster.
[0049] For example, consider a first processing cluster containing four tasks. The text lengths of these four tasks are 110, 108, 112, and 109 tokens, respectively. First, calculate the average text length of all tasks within the cluster: (110 + 108 + 112 + 109) / 4 = 109.75. Then, calculate the squared difference between the text length of each task and the average: 0.0625, 3.0625, 5.0625, and 0.5625, respectively. The server sums these squared values and divides them by the number of tasks (4), obtaining the variance: (0.0625 + 3.0625 + 5.0625 + 0.5625) / 4 = 2.1875. Taking the square root gives the standard deviation, approximately 1.48. This standard deviation is the first text discrete parameter of the cluster.
[0050] It should be noted that the above values are for illustrative purposes only and do not constitute a limitation on the present invention.
[0051] Furthermore, the mean of multiple first text discrete parameters is calculated to obtain the first comprehensive text discrete parameter. The arithmetic mean of the first text discrete parameters for all first processing clustering task clusters is calculated again to obtain the first comprehensive text discrete parameter under this round of clustering scheme. This parameter is used to measure the average level of text length dispersion across all clusters in the current processing level clustering scheme; a smaller value indicates a more reasonable overall clustering scheme.
[0052] For example, let's illustrate this with a real-world application scenario of a hospital triage system. Assume there are currently 8 user consultation tasks with text lengths of 110, 108, 112, 109, 200, 195, 205, and 190 characters respectively. The server randomly clusters the text to obtain Scheme 1: Cluster A contains 110, 108, 112, and 109 characters, and Cluster B contains 200, 195, 205, and 190 characters. The standard deviation of Cluster A is approximately 1.48, and the standard deviation of Cluster B is approximately 5.59. The first comprehensive text dispersion parameter is (1.48 + 5.59) / 2 = 3.54. After iteration, the server obtains Scheme 2: Cluster C contains 110, 112, 200, and 195 characters with a standard deviation of approximately 43.29; Cluster D contains 108, 109, 205, and 190 characters with a standard deviation of approximately 44.82. The comprehensive dispersion parameter is 44.06. Scheme 2 is significantly inferior to Scheme 1. Continuing the iteration, we obtained Scheme 3: Cluster E contains 110, 108, 190, and 195, with a standard deviation of approximately 41.79; Cluster F contains 112, 109, 200, and 205, with a standard deviation of approximately 46.05. The overall discrete parameter is 43.92, which is also inferior to Scheme 1. Therefore, the server ultimately outputs Scheme 1 as the optimal cluster for processing tasks, with short text tasks clustered in one cluster and long text tasks clustered in another.
[0053] It should be noted that the above values are for illustrative purposes only and do not constitute a limitation on the present invention.
[0054] This invention uses task text length as the sole feature for hierarchical clustering and minimizes the overall text discrete parameter as the optimization objective, ensuring that the text lengths of tasks within the same cluster are as close as possible. The standard deviation is used to precisely quantify the dispersion of text length within each cluster, and the mean of all cluster discrete parameters is used as the evaluation criterion for the overall clustering scheme, thus providing a clear mathematical optimization objective for hierarchical clustering optimization. Through a random initial clustering combined with an iterative convergence optimization strategy, the server can efficiently search for the optimal clustering scheme with the minimum overall text discrete parameter within limited computing resources. The resulting optimal clustering task clusters group short text tasks into one cluster and long text tasks into another, with the maximum and minimum length differences within each cluster controlled to a very small range. When the AI model processes each cluster in batches, the number of blank placeholders to be filled within the same batch is significantly reduced, the effective computational ratio of the model is significantly increased, and more user consultation tasks can be processed under the same hardware resource conditions, thus achieving a substantial improvement in multi-task parallel computing efficiency in the model processing dimension.
[0055] S300: Matrix processing difference factor for obtaining multiple business optimal clustering task clusters and multiple processing optimal clustering task clusters.
[0056] In existing technologies, business-level clustering optimization and processing-level clustering optimization are usually performed independently. Business clustering focuses on the semantic relevance of task categories, while processing clustering focuses on the uniformity of task text length. Because the optimization objectives of the two types of clustering are completely different, the optimal clustering results often differ significantly. For example, business clustering might mix long-text tasks with short-text tasks in the same cluster to maximize business relevance, while processing clustering tends to group tasks of similar length together. Existing technologies lack an effective quantitative method to measure the degree of difference between these two clustering results. This makes it impossible for the server to determine whether the two clustering results have become consistent, and it also fails to provide a reasonable parameter configuration basis for subsequent advanced adjustments and optimizations. Blindly adjusting the processing clustering results may destroy the original processing efficiency advantage, or the adjustment may be insufficient to improve business compatibility. Therefore, how to quantify the degree of difference between business-level clustering results and processing-level clustering results, so as to provide quantifiable input parameters for advanced optimization, has become a pressing technical problem to be solved.
[0057] Step S300 in the method provided in this embodiment of the invention includes: Extract the text features of the largest task in multiple business clusters within multiple optimal clusters of business tasks, and extract the text features of the largest task in multiple processing clusters within multiple optimal clusters of processing tasks. The difference between the mean of the maximum text features of multiple business tasks and the mean of the maximum text features of multiple processing tasks is calculated and used as the difference factor in the matrix processing.
[0058] In this embodiment of the invention, when the artificial intelligence model actually processes multiple tasks, the token sequences of each task within the same processing cluster need to be stacked in the batch dimension to form a two-dimensional matrix. Since the sequence dimension of the matrix must be uniform, each sequence needs to be padded to the length of the longest sequence in the batch. The total number of elements in the matrix is equal to the number of tasks in the batch multiplied by the length of the longest sequence, where the number of invalid elements corresponding to the padding part = number of tasks × (length of the longest sequence - length of each sequence itself). Therefore, one of the core objectives of processing hierarchical clustering is to reduce the padding ratio by minimizing the difference in sequence length within each cluster, thereby reducing invalid computation. When there is a difference between the clustering results of business hierarchical clustering and the clustering results of processing hierarchical clustering, the matrix areas generated by the two on the same batch of tasks will also be different. The matrix processing difference factor is an indicator used to quantify the degree of this difference.
[0059] In this embodiment of the invention, the maximum task text features of multiple business tasks within multiple optimal business clusters are first extracted. Specifically, for each optimal business cluster obtained after business-level clustering optimization, the task with the longest task text length is identified from all tasks within that cluster, and the task text feature, i.e., the text length value, is extracted as the maximum task text feature of that cluster. Following this method, all optimal business clusters are traversed to obtain multiple maximum task text features of the same number as the number of business clusters.
[0060] Simultaneously, multiple text features of the longest-running task within each optimal cluster are extracted. Specifically, for each optimal cluster obtained after hierarchical clustering optimization, the task with the longest text length is identified from all tasks within that cluster, and its text length value is extracted as the longest-running task text feature for that cluster. Following this method, the server iterates through all optimal clusters to obtain multiple longest-running task text features, matching the number of clusters.
[0061] Furthermore, the difference between the mean of the maximum task text features of multiple business units and the mean of the maximum task text features of multiple processing units is calculated and used as the matrix processing difference factor. Specifically, the mean of the maximum task text features of all business units is obtained by summing all the maximum task text features of all business units and dividing by the total number of business clusters; the mean of the maximum task text features of all processing units is obtained by summing all the maximum task text features of all processing units and dividing by the total number of processing clusters; then the absolute value of the difference between the two means is calculated, and then divided by the larger of the two means. The result is normalized to between 0 and 1 and used as the matrix processing difference factor.
[0062] The difference factor in this matrix quantifies the overall deviation between the business-level clustering results and the processing-level clustering results in terms of the maximum task text length. Since the number of columns in the batch matrix is determined by the length of the longest sequence in that batch, and the total number of elements in the matrix equals the number of tasks multiplied by the maximum value, the mean difference in the maximum values of each cluster directly reflects the deviation between the two clustering schemes in terms of the actual matrix size calculated by the model. The closer the difference factor is to 0, the more consistent the two clustering results are in terms of length distribution; the closer the difference factor is to 1, the greater the divergence in length distribution between the two clustering results.
[0063] It should be noted that this difference factor is a macro-level measure of deviation. Its design purpose is not to precisely compare the specific attribution of each task in the two clustering schemes, but rather to serve as a single-value input reference for weight allocation and optimization parameter configuration in subsequent advanced optimization. Although this indicator does not contain fine-grained clustering difference information at the task level, this is precisely its design intent: to obtain a directional indicator reflecting the degree of deviation between the two clustering results in the overall length distribution with extremely low computational overhead, thereby providing a macro-level decision-making basis for advanced optimization. Experiments show that this macro-level deviation indicator is sufficient to guide subsequent optimization algorithms in effectively balancing business compatibility and processing efficiency.
[0064] For example, let's illustrate this with a real-world application scenario of a hospital patient guidance system. Assume the server obtains two optimal task clusters through business-level clustering optimization. Cluster B1 contains four tasks with text lengths of 110, 108, 190, and 195 respectively, so the maximum task text feature of this cluster is 195. Cluster B2 contains four tasks with text lengths of 112, 109, 200, and 205 respectively, so the maximum task text feature of this cluster is 205. The mean of the maximum task text feature is (195 + 205) / 2 = 200. Meanwhile, the server obtained two optimal clustering task clusters through hierarchical clustering optimization. Cluster P1 contains four tasks with text lengths of 110, 108, 112, and 109 respectively, so the maximum processed task text feature of this cluster is 112. Cluster P2 contains four tasks with text lengths of 200, 195, 205, and 190 respectively, so the maximum processed task text feature of this cluster is 205. The mean of the maximum processed task text feature is (112+205) / 2=158.5. The server calculates the difference between the two means, i.e., |200-158.5| / max(200, 158.5)=41.5 / 200=0.2075, which is the matrix processing difference factor.
[0065] The physical meaning of the aforementioned matrix processing difference factor lies in the fact that business-level clustering groups tasks based on symptom type correlation, with the maximum task text length for each cluster fluctuating between 112 and 205; while processing-level clustering groups tasks based on text length similarity, with the maximum task text length for each cluster ranging between 195 and 205. The difference between the two means is 41.5, a difference of 20.75%, indicating a significant discrepancy in length distribution between the business and processing clustering results. Further adjustments and optimizations are needed to achieve a balance.
[0066] It should be noted that the above values are for illustrative purposes only and do not constitute a limitation on the present invention.
[0067] This invention transforms the previously difficult-to-compare business clustering results and processing clustering results into comparable values on the same quantitative scale by extracting the maximum task text features within each cluster from two clustering results and calculating the mean difference magnitude. This method only needs to extract the maximum value of each cluster instead of all data, resulting in low computational cost and independence from complex statistical analysis, enabling rapid acquisition of the difference factor. The resulting matrix processing difference factor, in the form of normalized values, intuitively reflects the degree of divergence between the two clustering results in text length distribution. This difference factor serves as a key input parameter for subsequent advanced optimization steps, directly used to configure processing weights, business weights, and adjust optimization coefficients. This allows for adaptive determination of the adjustment magnitude and optimization direction based on the actual degree of difference during advanced optimization. A large difference factor indicates severe divergence between the two clustering results, suggesting a significant deviation between the text length distribution of the optimal clustering task cluster and the business clustering objective. Subsequent advanced optimization should use small step sizes for fine-tuning to avoid excessively undermining the already achieved processing efficiency advantage. Conversely, a small difference factor indicates that the two clustering results are relatively consistent in length distribution, allowing subsequent advanced optimization to explore room for improvement in business compatibility with relatively large step sizes while maintaining processing efficiency. By using this matrix as a bridge to handle difference factors, business-level clustering and processing-level clustering can be effectively connected and coordinated throughout the entire process.
[0068] S400: Configure advanced optimization parameters based on the matrix processing difference factor and the total number of tasks, and continue to adjust and optimize multiple optimal clustering task clusters to obtain multiple optimal clustering task clusters, and perform collaborative grouping processing of multiple tasks.
[0069] In existing technologies, after business-level clustering optimization and processing-level clustering optimization are completed independently, how to effectively integrate the results of these two optimizations to form the final grouping scheme remains an unsolved technical challenge. One direct approach is to randomly adjust the clusters based on the optimal clustering task clusters to attempt to improve business compatibility. However, this approach lacks a clear optimization direction and a reasonable adjustment range, potentially leading to two serious consequences. If the adjustment range is too large, the processing efficiency advantage originally gained through text length clustering may be severely undermined, causing the text length differences within the same batch to increase again, resulting in a sharp rise in padding costs. If the adjustment range is too small, the improvement in business compatibility is negligible, and the results of business-level clustering cannot substantially affect the final grouping.
[0070] Meanwhile, the total number of tasks in different batches and the degree of difference between the two clustering results vary, and existing technologies lack a method to adaptively determine the adjustment range and optimization direction based on the current situation. The core trade-off between prioritizing processing efficiency and prioritizing business compatibility has not been effectively resolved in existing technologies. Therefore, how to adaptively configure the weight parameters and adjustment range parameters in the fusion optimization based on the total number of tasks and the degree of difference between the two clustering results, so as to balance processing efficiency and business compatibility, has become a pressing technical problem that needs to be solved.
[0071] Step S400 in the method provided in this embodiment of the invention, as follows: Figure 2 As shown, it includes: Get the total number of tasks to be processed; Obtain the maximum total number of tasks and the maximum matrix processing difference factor in the historical multi-task concurrent processing. Combine the matrix processing difference factor and the total number of tasks to configure the processing weight and business weight. Based on the matrix processing difference factor, configure optimization parameters to update and adjust multiple clustering task clusters that are optimally processed; The optimal clustering task clusters are adjusted using optimization parameters to obtain the first adjusted clustering task cluster. The first adjusted comprehensive category compatibility parameter and the first adjusted comprehensive text discrete parameter are then obtained. By employing processing weights and business weights, the normalized first adjustment comprehensive text discrete parameters and the first adjustment comprehensive category compatibility parameters are weighted and calculated to obtain the first adjustment synergy value; Continue to adjust and optimize the clustering task clusters until convergence, obtain the multiple optimal clustering task clusters with the largest adjustment collaboration value, and perform collaborative grouping processing of multiple tasks.
[0072] In this embodiment of the invention, the total number of tasks to be processed is first obtained. This total number of tasks refers to the number of all pending user inquiry tasks in the current batch.
[0073] Furthermore, the maximum total number of tasks and the maximum matrix processing difference factor during historical multi-task concurrent processing are obtained. Specifically, during operation, the final clustering scheme obtained after each multi-task concurrent processing convergence and the following data are continuously recorded: the total number of tasks in this processing, the matrix processing difference factor corresponding to this processing, the comprehensive category compatibility parameter corresponding to this processing, and the comprehensive text discrete parameter corresponding to this processing. The above data is recorded in the system database or local persistent storage. Each record corresponds to a complete execution cycle of one multi-task concurrent processing task, and the recording time is the time when the convergence of this processing is completed.
[0074] The statistical historical time window is set to the past thirty natural days. The maximum value of the total number of tasks, the maximum value of the matrix processing difference factor, the maximum value of the comprehensive category compatibility parameter, and the maximum value of the comprehensive text discrete parameter are retrieved from all historical records within this time window.
[0075] It should be noted that during the initial deployment and when the history is empty, the following initial default values are used for each historical maximum: the maximum total number of tasks is set to 1.5 times the total number of tasks in the current batch and rounded up; the maximum matrix processing difference factor is set to 1.0; the historical maximum value of the comprehensive category compatibility parameter is set to the upper limit of the output range of the category compatibility analysis agent, which is 1.0; and the historical maximum value of the comprehensive text discrete parameter is set to the upper limit of the standard deviation estimated based on the text features of the tasks in the current batch, i.e., the difference between the maximum and minimum character lengths in the current batch. As the running records accumulate, the above initial default values will be gradually replaced by the maximum values in the actual historical records. Subsequently, the processing weights and business weights are configured in conjunction with the matrix processing difference factor and the total number of tasks in the current batch.
[0076] Furthermore, optimization parameters are updated and adjusted for multiple optimal clustering task clusters based on the matrix processing difference factor configuration. Specifically, this optimization parameter refers to the number of tasks exchanged between different clustering task clusters during each iteration. The core idea is that the larger the matrix processing difference factor, the smaller the optimization parameter value, meaning fewer tasks are exchanged during each adjustment, avoiding significant disruption to the existing processing efficiency advantage.
[0077] Furthermore, optimization parameters are used to adjust multiple optimal clustering task clusters to obtain a first adjusted clustering task cluster. Specifically, the adjustment method involves selecting a number of tasks from different optimal clustering task clusters and exchanging them, according to the quantity determined by the optimization parameters, to form a new clustering scheme. Subsequent processing yields the first adjusted comprehensive category compatibility parameter and the first adjusted comprehensive text discrete parameter.
[0078] The first adjustment of the comprehensive category compatibility parameter is obtained according to the calculation method of the comprehensive category compatibility parameter in the aforementioned business-level clustering. That is, the task category features within each cluster after adjustment are combined pairwise and input into the category compatibility analysis agent, and the mean of the mean of the category compatibility parameters of all clusters is calculated. The first adjustment of the comprehensive text discrete parameter is obtained according to the calculation method of the comprehensive text discrete parameter in the aforementioned processing-level clustering. That is, the standard deviation of the task text length within each cluster after adjustment is calculated, and then the mean of the standard deviations of all clusters is taken.
[0079] Furthermore, by employing processing weights and business weights, the normalized first adjusted comprehensive text discrete parameter and the first adjusted comprehensive category compatible parameter are weighted and calculated to obtain the first adjusted collaborative value. Specifically, the first adjusted comprehensive category compatible parameter and the first adjusted comprehensive text discrete parameter are first normalized. The normalization method is to divide the current value by the maximum value of the parameter in the historical record, mapping each parameter to the interval between 0 and 1, making the two parameters comparable. Then, the first adjusted collaborative value is calculated by subtracting the normalized first adjusted comprehensive category compatible parameter from the processing weight and the normalized first adjusted comprehensive text discrete parameter.
[0080] Among them, the larger the first adjustment comprehensive category compatibility parameter, the better the business compatibility, so a positive value is taken to contribute to the collaboration value; the smaller the first adjustment comprehensive text discrete parameter, the higher the processing efficiency, so a negative value is taken to contribute to the collaboration value, so that the larger the collaboration value, the better the comprehensive performance of the clustering scheme in both business and processing dimensions.
[0081] Finally, the clustering task continues to be adjusted and optimized until convergence. Specifically, each iteration starts from the current clustering scheme, randomly perturbs it, and generates a candidate clustering scheme. The adjusted co-operational value of the candidate clustering scheme is calculated and compared with the adjusted co-operational value of the current clustering scheme: if the co-operational value of the candidate scheme is greater than that of the current scheme, the candidate scheme is accepted and updated as the current clustering scheme. Simultaneously, if the co-operational value of the candidate scheme is also greater than the maximum adjusted co-operational value in the historical records, the historical best clustering scheme is updated synchronously. If the co-operational value of the candidate scheme is not greater than that of the current scheme, the poorer scheme is accepted according to the probability corresponding to the current annealing temperature and updated as the current clustering scheme; otherwise, the candidate scheme is discarded, and the current clustering scheme remains unchanged. The next iteration always starts from the updated current clustering scheme and performs a new random perturbation.
[0082] Similarly, this adjustment and optimization process employs a stochastic optimization search strategy with a probabilistic acceptance mechanism. The initial acceptance probability corresponding to the initial temperature is set to 20%. Every 50 iterations, the current temperature is multiplied by a cooling coefficient of 0.5, gradually reducing the acceptance probability to 10%, 5%, 2.5%, and so on. When the maximum adjustment synergy value in the historical record has not increased after two hundred consecutive iterations, the optimization process is considered to have converged. Iteration is stopped, and the clustering scheme with the maximum adjustment synergy value in the historical record is obtained as multiple optimal clustering task clusters. Multiple tasks are then collaboratively grouped according to this clustering scheme, that is, tasks within the same cluster are assigned to the same batch for parallel processing by the artificial intelligence model.
[0083] During this process, a restart strategy is also adopted. When the maximum adjustment synergy value in the historical record has not improved after 100 consecutive iterations, a restart operation is triggered, the current clustering scheme is reset to the optimal clustering scheme with the maximum adjustment synergy value in the historical record, and the annealing temperature is reset to the initial temperature. Then, the above iterative process is continued from the reset scheme until the convergence condition is reached.
[0084] This includes obtaining the maximum total number of tasks and the maximum matrix processing difference factor during historical multi-task concurrent processing; combining the matrix processing difference factor and the total number of tasks; and configuring processing weights and business weights, including: Calculate the ratio of the total number of tasks to the maximum total number of tasks, and use it as the first processing weight; The ratio of the matrix processing difference factor to the maximum matrix processing difference factor is calculated and used as the second processing weight. Based on the first processing weight and the second processing weight, the processing weight is calculated by merging them, and the business weight is obtained.
[0085] In this embodiment of the invention, the ratio of the total number of tasks to the maximum total number of tasks is used as the first processing weight. The ratio may be greater than 1. In this case, the calculation result is truncated. That is, when the ratio is less than 1, the smaller the value, the less the current task volume is relative to the historical peak, allowing for more capacity for business-level optimization and adjustment. When the ratio is greater than or equal to 1, it is truncated to 1, indicating that the current batch has reached or exceeded the historical maximum scale, and in this case, the priority is biased towards processing efficiency.
[0086] Simultaneously, the ratio of the matrix processing difference factor to the maximum matrix processing difference factor is calculated and used as the second processing weight. When this ratio is greater than 1, it is truncated to 1; when the historical maximum matrix processing difference factor is 0, the second processing weight is directly determined to be 0, without performing a division operation, thus avoiding division by zero errors. The second processing weight after the above processing reflects the level of difference between the current two clustering results relative to the historical maximum difference level. The larger the value, the more severe the current difference, and the more priority should be given to processing efficiency; when the historical maximum difference factor is 0, the second processing weight is 0, indicating that there is no difference in all batches in the historical record, and there is no need to prioritize processing efficiency.
[0087] Furthermore, a processing weight is calculated by fusing the first processing weight and the second processing weight. Specifically, the arithmetic mean of the first and second processing weights is calculated as the processing weight. This processing weight ranges from zero to one; a larger value indicates a greater tendency to prioritize processing efficiency in subsequent fusion optimization. Simultaneously, the business weight is calculated as 1 - processing weight. A larger business weight indicates a greater tendency to prioritize business compatibility in subsequent fusion optimization.
[0088] The physical meaning of the above weight configuration is that when the number of tasks in the current batch is small and the difference between the two clustering results is relatively small, it is both feasible and necessary to appropriately tilt the business weight, focusing more on the correlation between symptom types to improve the user's experience of obtaining comprehensive medical information at once. Conversely, if the number of tasks in the current batch is close to the historical maximum and the difference factor is also close to the historical maximum, the processing weight will approach 1 and the business weight will approach 0. In this case, priority is given to ensuring processing efficiency, and tasks with similar text lengths are grouped into the same batch to reduce filler overhead.
[0089] For example, assuming the current batch of tasks has a total of 8, and the maximum total number of tasks in the past 30 days is 32, then the first processing weight is 8 / 32 = 0.25. The current matrix processing difference factor is 0.2075, and the historical maximum matrix processing difference factor is 0.5, then the second processing weight is 0.2075 / 0.5 = 0.415. Calculate the arithmetic mean of the first and second processing weights as the processing weight, i.e., (0.25 + 0.415) / 2 = 0.3325, and the business weight is 1 - 0.3325 = 0.6675.
[0090] It should be noted that the above values are for illustrative purposes only and do not constitute a limitation on the present invention.
[0091] Among them, based on the matrix processing difference factor, optimization parameters are configured to update and adjust multiple optimal clustering task clusters, including: Obtain the nominal adjustment parameters for clustering adjustments, wherein the nominal adjustment parameters include the number of tasks to be selected for swap adjustments in different clustering task clusters; Based on the matrix processing of difference factors, configure the negative correlation adjustment and optimization coefficients; By adjusting the optimization coefficients, the rated adjustment parameters are calculated to obtain the optimized parameters for updating and adjusting multiple optimal clustering task clusters.
[0092] In this embodiment of the invention, firstly, the rated adjustment parameters for clustering adjustments are obtained. Specifically, the rated adjustment parameters include the number of tasks selected for exchange and adjustment in different clustering task clusters. This number is a baseline value preset according to the default configuration. This baseline value can be dynamically determined based on the total number of tasks to ensure that the magnitude of each adjustment is moderate. From the perspective of optimization theory, in the iterative search process of combinatorial optimization problems, the adjustment step size needs to match the problem scale. If the step size is too large, the solution will oscillate around the optimal solution and be difficult to converge; if the step size is too small, the convergence speed will be too slow, resulting in a waste of computational resources. Based on extensive practical experience in setting the neighborhood size in neighborhood search algorithms, controlling the number of tasks exchanged in each adjustment to between 5% and 25% of the average size of each cluster can achieve a good balance between the sufficiency of solution exploration and the convergence speed.
[0093] Therefore, in this embodiment of the invention, the rated adjustment parameter is set as the quotient of the total number of tasks divided by the total number of clusters multiplied by 0.1 and then rounded up, i.e., rated adjustment parameter = ceil(total number of tasks / total number of clusters × 0.1), where ceil represents the rounding up operation, that is, returning the smallest integer greater than or equal to the value in parentheses. This rounding up design ensures that in scenarios where the average size of each cluster is small, at least one task is swapped in each iteration, allowing the search to continue. When the rated adjustment parameter is greater than the number of tasks in any cluster among all the currently optimal clustering task clusters, the rated adjustment parameter is truncated to the minimum value of the number of tasks in all current clusters, i.e., rated adjustment parameter = min(ceil(total number of tasks / total number of clusters × 0.1), minimum value of the number of tasks in all currently optimal clustering task clusters). This truncation process ensures that the optimization parameters subsequently calculated based on the rated adjustment parameter are feasible in actual adjustment operations, that is, there will be no situation where more tasks than the actual number of tasks need to be taken from a certain cluster.
[0094] Furthermore, multiple historical matrix processing difference factors recorded in each multi-task concurrent processing session within a historical time period are obtained, and the arithmetic mean of these historical matrix processing difference factors is calculated. Then, the ratio of the average of the historical matrix processing difference factors to the current matrix processing difference factor is calculated, and this ratio is used as the adjustment and optimization coefficient. The physical meaning of this adjustment and optimization coefficient is that the larger the current matrix processing difference factor, the greater the difference in processing efficiency between clustering by business type and clustering by text length. In this case, a smaller adjustment and optimization coefficient is needed to reduce the optimization step size, avoiding excessive deviation from the multiple optimal clustering task clusters that have already achieved optimal processing efficiency in subsequent iterations. Conversely, the smaller the current matrix processing difference factor, the closer the two clustering results are. In this case, a larger adjustment and optimization coefficient can fully explore the room for improvement in business compatibility while maintaining a certain level of processing efficiency.
[0095] Furthermore, the rated adjustment parameters are adjusted using adjustment optimization coefficients to obtain optimized parameters for updating and adjusting multiple optimal clustering task clusters. Specifically, the calculation method is: Optimized parameter = ceil (Rated adjustment parameter × Adjustment optimization coefficient). It's important to note that the optimization parameter, representing the actual number of tasks swapped, must be an integer. If rounding is used instead of rounding up, and the rated adjustment parameter is 1 and the optimization coefficient is less than 0.5, the optimization parameter will become 0, causing no swaps to be performed in this iteration, and the optimization process to stall. This ineffective iteration will occur frequently, especially when the difference factor is large and fine-tuning is required. Rounding up ensures that at least one task is swapped in each iteration, keeping the optimization process moving forward.
[0096] This invention employs the ratio of the average difference factor of historical matrix processing to the difference factor of the current matrix processing as an adjustment and optimization coefficient, achieving adaptive configuration of the adjustment step size, i.e., the optimization parameters. When the difference factor of the current matrix processing is larger, the adjustment and optimization coefficient is smaller, and the optimization parameters are correspondingly reduced, allowing for fine-tuning with a smaller step size to avoid excessive deviation from multiple optimal clustering task clusters that have already achieved optimal processing efficiency. Conversely, when the difference factor of the current matrix processing is smaller, the adjustment and optimization coefficient is larger, and the optimization parameters are correspondingly increased, allowing for a larger step size to fully explore the potential for improvement in business compatibility while maintaining a certain level of processing efficiency. This mechanism ensures that the magnitude of each adjustment matches the actual degree of difference between the two clustering results, preventing excessively large adjustments that sacrifice processing efficiency and excessively small adjustments that become merely formalities. This achieves a dynamic balance between processing efficiency and business compatibility during advanced optimization.
[0097] In summary, the embodiments of the present invention have at least the following technical effects: This invention optimizes task clustering by business-level clustering, grouping tasks with highly correlated business types into the same cluster. Within the same processing cluster, unified business scenario labels and system prompts ensure high consistency in task outputs within the business semantic space, effectively reducing logical branching and context switching overhead when handling tasks with mixed types. Simultaneously, by optimizing processing-level clustering, tasks with similar text lengths are grouped together, significantly reducing padding overhead during parallel model processing and improving computational efficiency. The matrix processing difference factor between the two clustering results quantifies the degree of divergence, providing an objective data foundation for subsequent fusion optimization. In the advanced optimization stage, processing weights, business weights, and optimization parameters are adaptively configured based on the total number of tasks and the matrix processing difference factor, ensuring that the magnitude and direction of each clustering adjustment matches the actual degree of difference. Ultimately, an iterative process yields a clustering scheme that maximizes synergy. Compared to existing technologies, this invention achieves a comprehensive optimal balance between processing efficiency and business compatibility, handling more user tasks under the same hardware resources, and effectively improving the system throughput, computational resource utilization, and task scheduling efficiency of AI models in multi-task concurrent scenarios.
[0098] In summary, this invention solves the technical problem in the prior art where the reliance on a single-dimensional feature for multi-task grouping leads to an inability to effectively balance the visibility of business feedback and the efficiency of model processing.
[0099] Example 2, as Figure 3 As shown, based on the same inventive concept as the multi-task collaborative processing method for an artificial intelligence model provided in Embodiment 1, this embodiment of the invention also provides a multi-task collaborative processing system for an artificial intelligence model, including: The business-level clustering module 11 is used to obtain multiple task category features and multiple task text features of multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple optimal business clusters of tasks. The hierarchical clustering module 12 is used to optimize the hierarchical clustering of artificial intelligence models based on the text features of multiple tasks, so as to obtain multiple clusters of tasks with optimal processing. The difference factor calculation module 13 is used to process the difference factor of the matrix obtained from multiple business optimal clustering task clusters and multiple processing optimal clustering task clusters. The advanced optimization and collaborative grouping module 14 is used to configure advanced optimization parameters based on the matrix processing difference factor and the total number of tasks of multiple tasks, and to continue to adjust and optimize multiple optimal clustering task clusters to obtain multiple optimal clustering task clusters for collaborative grouping processing of multiple tasks.
[0100] In one embodiment, the business-level clustering module 11 is specifically used for: Retrieve multiple tasks to be processed, where each task includes a task category and task text; Extract the task categories and text lengths of multiple tasks as features for multiple task categories and multiple task texts, respectively. Based on the characteristics of multiple task categories, business-level clustering optimization is performed to obtain multiple optimal clusters of task groups.
[0101] Based on the characteristics of multiple task categories, business-level clustering optimization is performed to obtain multiple optimal clusters of task groups, including: Multiple tasks are randomly clustered to obtain multiple first business cluster task clusters, wherein the number of tasks in each first business cluster task cluster is less than or equal to the rated number. The multiple task category features within each first business cluster are combined in pairs and input into the category compatibility analysis intelligent body. Multiple first category compatibility parameter sets are output. The category compatibility analysis intelligent body is trained using multiple sets of sample task category feature sets and multiple standard category compatibility parameters. Calculate the mean of multiple first-category compatibility parameter sets to obtain the first comprehensive category compatibility parameter; Continue random clustering optimization iterations until convergence, and output multiple business-optimal clustering task clusters with the largest comprehensive category compatibility parameters.
[0102] In one embodiment, the hierarchical clustering module 12 is specifically used for: Multiple tasks are randomly clustered to obtain multiple first processing cluster task clusters, wherein the number of tasks in each first processing cluster task cluster is less than or equal to the rated number; Text feature discrete analysis is performed on multiple first-process clustering task clusters to obtain the first comprehensive text discrete parameters; Continue random clustering optimization iterations until convergence, and output multiple optimal clustering task clusters with the minimum comprehensive text discrete parameters.
[0103] Text feature discretization analysis was performed on multiple clusters of the first processing clustering task to obtain the first comprehensive text discretization parameters, including: Calculate the discrete parameters of multiple task text features within each first processing cluster to obtain multiple first text discrete parameters; The mean of multiple first text discrete parameters is calculated to obtain the first comprehensive text discrete parameter.
[0104] In one embodiment, the difference factor calculation module 13 is specifically used for: Extract the text features of the largest task in multiple business clusters within multiple optimal clusters of business tasks, and extract the text features of the largest task in multiple processing clusters within multiple optimal clusters of processing tasks. The difference between the mean of the maximum text features of multiple business tasks and the mean of the maximum text features of multiple processing tasks is calculated and used as the difference factor in the matrix processing.
[0105] In one embodiment, the advanced optimization and collaborative grouping module 14 is specifically used for: Get the total number of tasks to be processed; Obtain the maximum total number of tasks and the maximum matrix processing difference factor in the historical multi-task concurrent processing. Combine the matrix processing difference factor and the total number of tasks to configure the processing weight and business weight. Based on the matrix processing difference factor, configure optimization parameters to update and adjust multiple clustering task clusters that are optimally processed; The optimal clustering task clusters are adjusted using optimization parameters to obtain the first adjusted clustering task cluster. The first adjusted comprehensive category compatibility parameter and the first adjusted comprehensive text discrete parameter are then obtained. By employing processing weights and business weights, the normalized first adjustment comprehensive text discrete parameters and the first adjustment comprehensive category compatibility parameters are weighted and calculated to obtain the first adjustment synergy value; Continue to adjust and optimize the clustering task clusters until convergence, obtain the multiple optimal clustering task clusters with the largest adjustment collaboration value, and perform collaborative grouping processing of multiple tasks.
[0106] Obtain the maximum total number of tasks and the maximum matrix processing difference factor during historical multi-task concurrent processing. Combine the matrix processing difference factor and the total number of tasks to configure processing weights and business weights, including: Calculate the ratio of the total number of tasks to the maximum total number of tasks, and use it as the first processing weight; The ratio of the matrix processing difference factor to the maximum matrix processing difference factor is calculated and used as the second processing weight. Based on the first processing weight and the second processing weight, the processing weight is calculated by merging them, and the business weight is obtained.
[0107] Based on the matrix processing difference factor, optimize parameters are configured to update and adjust multiple clustering task clusters that achieve optimal processing, including: Obtain the nominal adjustment parameters for clustering adjustments, wherein the nominal adjustment parameters include the number of tasks to be selected for swap adjustments in different clustering task clusters; Based on the matrix processing of difference factors, configure the negative correlation adjustment and optimization coefficients; By adjusting the optimization coefficients, the rated adjustment parameters are calculated to obtain the optimized parameters for updating and adjusting multiple optimal clustering task clusters.
[0108] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0109] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0110] This specification and accompanying drawings are merely illustrative examples of the invention and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its scope. Therefore, if such modifications and modifications fall within the scope of the invention and its equivalents, the invention is intended to include these modifications and modifications.
Claims
1. A multi-task collaborative processing method for an artificial intelligence model, characterized in that, The methods include: Obtain multiple task category features and multiple task text features of multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple business-optimal clustered task clusters; Based on the text features of multiple tasks, hierarchical clustering optimization of artificial intelligence model processing is performed to obtain multiple clusters of tasks with optimal processing. The matrix processing difference factor is used to obtain multiple optimal clustering task clusters for business and multiple optimal clustering task clusters for processing. Based on the matrix processing difference factor and the total number of tasks, advanced optimization parameters are configured, and multiple optimal clustering task clusters are further adjusted and optimized to obtain multiple optimal clustering task clusters. Then, multiple tasks are collaboratively grouped for processing.
2. The multi-task collaborative processing method for artificial intelligence models according to claim 1, characterized in that, Obtain multiple task category features and multiple task text features from multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple business-optimal clustered task clusters, including: Retrieve multiple tasks to be processed, where each task includes a task category and task text; Extract the task categories and text lengths of multiple tasks as features for multiple task categories and multiple task texts, respectively. Based on the characteristics of multiple task categories, business-level clustering optimization is performed to obtain multiple optimal clusters of task groups.
3. The multi-task collaborative processing method for artificial intelligence models according to claim 2, characterized in that, Based on the characteristics of multiple task categories, business-level clustering optimization is performed to obtain multiple optimal clusters of task groups, including: Multiple tasks are randomly clustered to obtain multiple first business cluster task clusters, wherein the number of tasks in each first business cluster task cluster is less than or equal to the rated number. The multiple task category features within each first business cluster are combined in pairs and input into the category compatibility analysis intelligent body. Multiple first category compatibility parameter sets are output. The category compatibility analysis intelligent body is trained using multiple sets of sample task category feature sets and multiple standard category compatibility parameters. Calculate the mean of multiple first-category compatibility parameter sets to obtain the first comprehensive category compatibility parameter; Continue random clustering optimization iterations until convergence, and output multiple business-optimal clustering task clusters with the largest comprehensive category compatibility parameters.
4. The multi-task collaborative processing method for artificial intelligence models according to claim 1, characterized in that, Based on the text features of multiple tasks, hierarchical clustering optimization of the artificial intelligence model was performed to obtain several optimal clustering task clusters, including: Multiple tasks are randomly clustered to obtain multiple first processing cluster task clusters, wherein the number of tasks in each first processing cluster task cluster is less than or equal to the rated number; Text feature discrete analysis is performed on multiple first-process clustering task clusters to obtain the first comprehensive text discrete parameters; Continue random clustering optimization iterations until convergence, and output multiple optimal clustering task clusters with the minimum comprehensive text discrete parameters.
5. The multi-task collaborative processing method for artificial intelligence models according to claim 4, characterized in that, Text feature discretization analysis was performed on multiple clusters of the first processing clustering task to obtain the first comprehensive text discretization parameters, including: Calculate the discrete parameters of multiple task text features within each first processing cluster to obtain multiple first text discrete parameters; The mean of multiple first text discrete parameters is calculated to obtain the first comprehensive text discrete parameter.
6. The multi-task collaborative processing method for artificial intelligence models according to claim 1, characterized in that, The matrix processing difference factors for obtaining multiple optimal clustering task clusters for business operations and multiple optimal clustering task clusters for processing include: Extract the text features of the largest task in multiple business clusters within multiple optimal clusters of business tasks, and extract the text features of the largest task in multiple processing clusters within multiple optimal clusters of processing tasks. The difference between the mean of the maximum text features of multiple business tasks and the mean of the maximum text features of multiple processing tasks is calculated and used as the difference factor in the matrix processing.
7. The multi-task collaborative processing method for artificial intelligence models according to claim 1, characterized in that, Based on the matrix processing difference factor and the total number of tasks, advanced optimization parameters are configured, and multiple optimal clustering task clusters are further adjusted and optimized to obtain multiple adjusted optimal clustering task clusters. Collaborative grouping processing of multiple tasks is then performed, including: Get the total number of tasks to be processed; Obtain the maximum total number of tasks and the maximum matrix processing difference factor in the historical multi-task concurrent processing. Combine the matrix processing difference factor and the total number of tasks to configure the processing weight and business weight. Based on the matrix processing difference factor, configure optimization parameters to update and adjust multiple clustering task clusters that are optimally processed; The optimal clustering task clusters are adjusted using optimization parameters to obtain the first adjusted clustering task cluster. The first adjusted comprehensive category compatibility parameter and the first adjusted comprehensive text discrete parameter are then obtained. By employing processing weights and business weights, the normalized first adjustment comprehensive text discrete parameters and the first adjustment comprehensive category compatibility parameters are weighted and calculated to obtain the first adjustment synergy value; Continue to adjust and optimize the clustering task clusters until convergence, obtain the multiple optimal clustering task clusters with the largest adjustment collaboration value, and perform collaborative grouping processing of multiple tasks.
8. The multi-task collaborative processing method for artificial intelligence models according to claim 7, characterized in that, Obtain the maximum total number of tasks and the maximum matrix processing difference factor during historical multi-task concurrent processing. Combine the matrix processing difference factor and the total number of tasks to configure processing weights and business weights, including: Calculate the ratio of the total number of tasks to the maximum total number of tasks, and use it as the first processing weight; The ratio of the matrix processing difference factor to the maximum matrix processing difference factor is calculated and used as the second processing weight. Based on the first processing weight and the second processing weight, the processing weight is calculated by merging them, and the business weight is obtained.
9. The multi-task collaborative processing method for artificial intelligence models according to claim 7, characterized in that, Based on the matrix processing difference factor, optimize parameters are configured to update and adjust multiple clustering task clusters that achieve optimal processing, including: Obtain the nominal adjustment parameters for clustering adjustments, wherein the nominal adjustment parameters include the number of tasks to be selected for swap adjustments in different clustering task clusters; Based on the matrix processing of difference factors, configure the negative correlation adjustment and optimization coefficients; By adjusting the optimization coefficients, the rated adjustment parameters are calculated to obtain the optimized parameters for updating and adjusting multiple optimal clustering task clusters.
10. A multi-task collaborative processing system for an artificial intelligence model, characterized in that, A multi-task collaborative processing method for executing the artificial intelligence model of any one of claims 1 to 9 includes: The business-level clustering module (11) is used to obtain multiple task category features and multiple task text features of multiple tasks to be processed, perform business-level clustering optimization, and obtain multiple optimal business clusters of tasks. The hierarchical clustering module (12) is used to perform hierarchical clustering optimization of artificial intelligence model processing based on the text features of multiple tasks, so as to obtain multiple clusters of tasks with optimal processing. The difference factor calculation module (13) is used to process the difference factor of the matrix obtained from multiple business optimal clustering task clusters and multiple processing optimal clustering task clusters; The advanced optimization and collaborative grouping module (14) is used to configure advanced optimization parameters according to the matrix processing difference factor and the total number of tasks of multiple tasks, and continue to adjust and optimize multiple processing optimal clustering task clusters to obtain multiple adjusted optimal clustering task clusters and perform collaborative grouping processing of multiple tasks.
