Calculation power resource scheduling method based on artificial intelligence
By constructing a data mapping model to analyze the dynamic correlation between task semantics and computing power requirements, and identifying and optimizing computing power resource scheduling, the problem of resource scheduling imbalance in existing technologies is solved, thereby improving the resource utilization and task execution efficiency of artificial intelligence computing platforms.
Patent Information
- Application Number
- CN202511137991.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-14
AI Technical Summary
Existing computing resource scheduling methods cannot respond in a timely manner to the dynamic fluctuations in computing demand caused by changes in task semantics, resulting in resource scheduling imbalance, with some nodes being redundant while others are overloaded, which reduces the overall operating efficiency and resource utilization of artificial intelligence computing resources.
By collecting task semantic similarity data and real-time computing power consumption data, an initial data mapping model is constructed. The dynamic correlation between semantic features and computing power requirements is analyzed, nodes of sudden changes in computing power requirements are identified, and prediction results of sudden changes in computing power requirements and dynamic prediction results are generated. Dynamic scheduling strategies are optimized, resource allocation is adjusted in real time, and local resource redundancy is eliminated.
It enables dynamic adaptation and forward-looking deployment of computing resources, effectively balances the load of each node, and improves the resource utilization and task execution efficiency of the artificial intelligence computing platform.
Smart Images

Figure CN120973541A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource scheduling technology, and more specifically, to a method for scheduling computing resources based on artificial intelligence. Background Technology
[0002] As the application fields of artificial intelligence continue to expand and the complexity of artificial intelligence models increases, model training and inference tasks often need to run simultaneously on computing resource nodes with multiple tasks running in parallel.
[0003] Existing computing resource scheduling methods typically allocate resources based on static resource demand indicators or simple load predictions, ignoring the nonlinear fluctuations in computing demand caused by dynamic changes in the semantic feature similarity between tasks. They cannot respond in a timely manner to the dynamic fluctuations in computing demand caused by changes in task semantics, which can easily lead to redundancy of some computing resource nodes while other nodes are overloaded, resulting in an overall imbalance in resource scheduling and thus reducing the overall operating efficiency and resource utilization of artificial intelligence computing resources. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide an artificial intelligence-based computing resource scheduling method to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for scheduling computing resources based on artificial intelligence includes the following steps:
[0007] S1: Collect semantic similarity data and real-time computing power consumption data of tasks during the training and inference of multi-task artificial intelligence models, and construct an initial data mapping model;
[0008] S2: Based on the initial data mapping model, analyze the dynamic correlation characteristics between semantic feature data and real-time computing power demand data, and generate nonlinear fluctuation characteristics of computing power demand driven by task semantics.
[0009] S3: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, identify the nodes of sudden changes in computing power demand that cause local resource redundancy and global resource imbalance, and generate computing power demand change prediction results.
[0010] S4: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, predict the changing trend of computing power demand and generate dynamic prediction results of computing power demand.
[0011] S5: Combine the results of sudden changes in computing power demand with the results of dynamic prediction of computing power demand to optimize the dynamic scheduling strategy and generate an optimized solution for computing power resource scheduling strategy.
[0012] S6: Based on the optimization scheme of computing power resource scheduling strategy, the computing power resource allocation for training and inference of multi-task artificial intelligence models is adjusted in real time to eliminate local resource redundancy.
[0013] In a preferred embodiment, S1 specifically refers to:
[0014] Collect raw data on task semantic similarity and real-time computing power consumption generated during the training and inference processes of multi-task artificial intelligence models;
[0015] The original data of task semantic similarity and the original data of real-time computing power consumption are preprocessed to obtain standardized data of task semantic similarity and standardized data of real-time computing power consumption.
[0016] Based on task semantic similarity standardized data and real-time computing power consumption standardized data, the correlation between task semantic features and real-time computing power consumption features is calculated.
[0017] An initial data mapping model is constructed based on standardized data of task semantic similarity and the correlation between task semantic features and real-time computing power consumption features.
[0018] In a preferred embodiment, S2 specifically refers to:
[0019] Based on the initial data mapping model, task semantic features are extracted from the task semantic similarity standardized data to obtain task semantic feature data;
[0020] By utilizing task semantic feature data and standardized real-time computing power consumption data, the dynamic correlation between task semantic features and real-time computing power requirements within multiple consecutive time windows is calculated.
[0021] Based on dynamic correlation characteristics, the nonlinear relationship between task semantic changes and real-time computing power demand changes in multi-task artificial intelligence models during training and inference processes is identified, thereby obtaining the nonlinear fluctuation characteristics of computing power demand driven by task semantics.
[0022] In a preferred embodiment, S3 specifically refers to:
[0023] Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, the real-time computing power consumption fluctuation amplitude of multi-task artificial intelligence models during the training and inference processes is determined.
[0024] When the fluctuation of real-time computing power consumption exceeds the preset threshold for identifying nodes of sudden change in computing power demand within a continuous time window, the corresponding time window node is identified as a node of sudden change in computing power demand.
[0025] Record the time of occurrence of nodes with sudden changes in computing power demand and the corresponding changes in task semantics, and generate prediction results for sudden changes in computing power demand.
[0026] In a preferred embodiment, S4 specifically refers to:
[0027] Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, the real-time computing power consumption value of the multi-task artificial intelligence model in each time window during the training and inference processes is determined.
[0028] Calculate the changes in real-time computing power consumption values within multiple consecutive time windows, and generate a sequence of real-time computing power consumption change trends based on these changes;
[0029] Based on the real-time computing power consumption change trend sequence, calculate the change trend of real-time computing power consumption value within multiple consecutive time windows in the future.
[0030] Based on the changing trends of real-time computing power consumption over multiple consecutive time windows, dynamic prediction results of computing power demand are generated.
[0031] In a preferred embodiment, S5 specifically refers to:
[0032] Obtain the prediction results of computing power demand mutations, extract the time of computing power demand mutation nodes and the corresponding task semantic changes, and determine the degree of impact of computing power demand mutations caused by task semantic changes on the overall computing power resource allocation.
[0033] Obtain dynamic prediction results of computing power demand, extract the changing trend of real-time computing power consumption values within multiple consecutive time windows in the future, and determine the allocation of computing power resources in each time window.
[0034] Based on the impact of sudden changes in computing power demand caused by changes in task semantics on the overall allocation of computing power resources, and the amount of computing power resources allocated in each time window, the dynamic scheduling strategy is optimized to generate an optimized computing power resource scheduling strategy.
[0035] In a preferred embodiment, S6 specifically refers to:
[0036] Based on the optimization scheme of computing resource scheduling strategy, the real-time computing resource allocation result for each task in each time window is determined.
[0037] Based on the real-time computing power resource allocation results, tasks are assigned in real time to AI computing power resource nodes that match the task's computing power requirements;
[0038] Based on the actual real-time computing power consumption of each task on the AI computing power resource node within each time window, determine the difference between the actual real-time computing power consumption of each task and the real-time computing power resource allocation result within each time window;
[0039] Based on the differences, the allocation of computing resources for each task on the AI computing resource nodes is adjusted in real time to eliminate local resource redundancy.
[0040] The technical effects and advantages of the artificial intelligence-based computing resource scheduling method of the present invention are as follows:
[0041] 1. By collecting semantic similarity data and real-time computing power consumption data of tasks and constructing an initial data mapping model, a quantitative mapping relationship between task semantics and computing power requirements can be established. Analyzing the dynamic correlation between semantic feature data and real-time computing power requirement data using the initial data mapping model reveals the complex coupling relationship between changes in task semantics and nonlinear fluctuations in computing power requirements, avoiding the lag of traditional static scheduling strategies. Identifying nodes with sudden changes in computing power requirements provides timely warnings of critical moments that may lead to local resource overload or overall scheduling bottlenecks, providing a basis for targeted optimization of scheduling strategies. Predicting future trends in computing power requirements enables proactive and dynamic resource scheduling. Combining the prediction results of sudden changes in computing power requirements with the prediction results of dynamic computing power requirements enables online optimization of scheduling strategies, effectively balancing the load of each node and reducing resource idleness and conflicts.
[0042] 2. Real-time distribution and execution of computing resource scheduling strategy optimization schemes to complete the allocation and real-time adjustment of computing resources, eliminate local resource redundancy, maintain the balanced utilization of global resources, and significantly improve the overall resource utilization and task execution efficiency of the artificial intelligence computing platform. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of a computing resource scheduling method based on artificial intelligence according to the present invention. Detailed Implementation
[0044] 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. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0045] Example
[0046] Figure 1 This invention presents a method for scheduling computing resources based on artificial intelligence, which includes the following steps:
[0047] S1: Collect semantic similarity data and real-time computing power consumption data of tasks during the training and inference of multi-task artificial intelligence models, and construct an initial data mapping model;
[0048] S2: Based on the initial data mapping model, analyze the dynamic correlation characteristics between semantic feature data and real-time computing power demand data, and generate nonlinear fluctuation characteristics of computing power demand driven by task semantics.
[0049] S3: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, identify the nodes of sudden changes in computing power demand that cause local resource redundancy and global resource imbalance, and generate computing power demand change prediction results.
[0050] S4: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, predict the changing trend of computing power demand and generate dynamic prediction results of computing power demand.
[0051] S5: Combine the results of sudden changes in computing power demand with the results of dynamic prediction of computing power demand to optimize the dynamic scheduling strategy and generate an optimized solution for computing power resource scheduling strategy.
[0052] S6: Based on the optimization scheme of computing power resource scheduling strategy, the computing power resource allocation for training and inference of multi-task artificial intelligence models is adjusted in real time to eliminate local resource redundancy.
[0053] S1: Collect semantic similarity data and real-time computing power consumption data of tasks during the training and inference of multi-task artificial intelligence models, and construct an initial data mapping model, including:
[0054] Collect raw data on task semantic similarity and real-time computing power consumption generated during the training and inference processes of multi-task artificial intelligence models;
[0055] Specifically, in the training and inference process of artificial intelligence models, multiple different types of tasks are usually executed simultaneously, such as image recognition tasks, natural language processing tasks, and speech recognition tasks. Each task exhibits specific data characteristics during execution, such as vector representations, semantic feature vectors, or feature space representations of the task input data, reflecting the semantic features of the task itself. Simultaneously, tasks consume varying degrees of real-time computing power during execution, manifested as the actual utilization of computing resources on different AI computing resource nodes, including CPU resource usage, GPU resource usage, memory usage, and bandwidth usage. For example, for image recognition tasks, the image feature vectors after each training batch of data input represent the original semantic similarity data of the task under a specific training batch; simultaneously, the real-time GPU computing power utilization rate on AI computing resource nodes (such as specific types of GPU servers) during the processing of each image feature vector represents the original data of real-time computing power consumption. The above raw data can be obtained through a task monitoring program during actual collection. For example, the monitoring program can periodically record the semantic feature values and resource consumption index values of the input data during task execution at fixed time intervals (such as once per second) to form raw data of task semantic similarity with timestamps and raw data of real-time computing power consumption.
[0056] The original data of task semantic similarity and the original data of real-time computing power consumption are preprocessed to obtain standardized data of task semantic similarity and standardized data of real-time computing power consumption.
[0057] Specifically, since data from different tasks typically have different scales or dimensional differences during actual data acquisition, it is necessary to perform unified data preprocessing on the raw data of task semantic similarity and the raw data of real-time computing power consumption to ensure data validity and comparability. Preprocessing methods include data cleaning and data standardization. Data cleaning involves removing outliers, missing values, or invalid data that may occur during the acquisition process. Outlier removal can employ a fixed threshold method; for example, outlier data points exceeding the normal fluctuation range of task semantic feature values or not conforming to conventional computing resource usage values are removed. Missing values can be handled using adjacent value interpolation or mean-based filling; for example, if the GPU resource usage value at a certain time point is missing, it can be filled by averaging the resource usage values of the preceding and following time points. Data standardization can be achieved through numerical normalization. For example, standardizing the raw task semantic similarity data involves subtracting the minimum value from the original data value and then dividing by the difference between the maximum and minimum values, mapping all data to a range of 0 to 1. The same method can be used to standardize the raw real-time computing power consumption data. For instance, the computing power consumption values can be normalized using the maximum and minimum values from historical monitoring data of resource nodes to remove the impact of differences in computing power between different resource nodes on data analysis. This preprocessing step yields standardized task semantic similarity data and standardized real-time computing power consumption data, forming a unified-scale task semantic feature dataset and a unified real-time computing power consumption feature dataset, respectively.
[0058] Based on task semantic similarity standardized data and real-time computing power consumption standardized data, the correlation between task semantic features and real-time computing power consumption features is calculated.
[0059] Specifically, standardized data on task semantic similarity and standardized data on real-time computing power consumption are used as inputs. A correlation calculation method is employed to determine the degree of correlation between task semantic features and real-time computing power consumption features. For example, for a given task, standardized numerical sequences of task semantic feature data and corresponding standardized numerical sequences of real-time computing power consumption feature data are extracted within multiple consecutive time windows, denoted as the P-series and Q-series, respectively, with each sequence having the same length. The Pearson correlation coefficient is used for calculation: first, the mean of the P-series and Q-series are calculated separately; then, the covariance between the P-series and Q-series and their respective standard deviations are calculated; finally, the covariance is divided by the product of the standard deviations to obtain the correlation coefficient between the task semantic features and the real-time computing power consumption features. By calculating the correlation coefficient for each task separately, the tightness of the changes in real-time computing power consumption under different semantic feature conditions can be quantified, and this can then be used to construct the initial data mapping model.
[0060] An initial data mapping model is constructed based on standardized data of task semantic similarity and the correlation between task semantic features and real-time computing power consumption features.
[0061] Specifically, after clarifying the correlation between task semantic features and real-time computing power consumption features, standardized task semantic similarity data is used as the input variable of the model, and standardized real-time computing power consumption data is used as the output variable of the model to establish an initial mapping relationship model between the data. For example, using the linear regression method, with the numerical values of task semantic features as independent variables and the numerical values of real-time computing power consumption features as dependent variables, the parameter coefficients of the regression model are calculated, thereby establishing an initial data mapping model.
[0062] S2: Based on the initial data mapping model, analyze the dynamic correlation characteristics between semantic feature data and real-time computing power demand data, and generate nonlinear fluctuation characteristics of computing power demand driven by task semantics, including:
[0063] Based on the initial data mapping model, task semantic features are extracted from the task semantic similarity standardized data to obtain task semantic feature data;
[0064] Specifically, task semantic feature data is defined as the set of numerical values extracted from task semantic similarity standardized data that effectively represent the semantic features of each AI computing task. For example, if an AI computing platform simultaneously runs image recognition and natural language processing tasks, the task semantic similarity standardized data for the image recognition task contains data from multiple feature dimensions, such as image color distribution features, image texture features, and edge contour features. Therefore, standardized values can be extracted for each feature dimension to form a task semantic feature data set. For natural language processing tasks, the task semantic similarity standardized data includes multiple feature dimensions, such as word vector distribution features, syntactic structure features, or semantic context features. Similarly, standardized values are extracted from each feature dimension to form a task semantic feature data set. One extraction method is the vector space selection method, where standardized values are extracted from the task semantic similarity standardized data based on specific dimensional feature coordinates to form feature vector data, thus constituting the task semantic feature data. For example, when the standardized data for an image recognition task is color histogram data after numerical normalization, the extraction method is to extract the feature values of each normalized color channel in the color histogram data in sequence to form task semantic feature data containing specific values; when the task is a speech recognition task, features such as the center frequency of the spectrum and bandwidth are extracted from the task semantic similarity standardized data corresponding to the speech data to form task semantic feature data.
[0065] By utilizing task semantic feature data and standardized real-time computing power consumption data, the dynamic correlation between task semantic features and real-time computing power requirements within multiple consecutive time windows is calculated.
[0066] Specifically, based on the time-series characteristics of the task execution process, the task semantic feature data and the standardized real-time computing power consumption data are matched within the same consecutive multiple time windows. For example, each second is considered a time window, and the task semantic feature data and the corresponding standardized real-time computing power consumption data are recorded within several consecutive time windows (e.g., 10 or 20 seconds). This forms a numerical correspondence between the task semantic features and the real-time computing power requirements within multiple consecutive time windows. Within each consecutive time window, the dynamic changing trends of the task semantic feature data and the standardized real-time computing power consumption data are analyzed and calculated. For example, for image recognition tasks, the changing trend of image color feature data is calculated within multiple consecutive time windows, and the changing trend of the corresponding standardized real-time computing power consumption data (e.g., GPU computing power occupancy percentage) is calculated to obtain the correspondence between trends. By employing numerical trend correlation calculation methods, such as using temporal cross-correlation analysis, calculations are performed for each consecutive time window to determine the consistency of the changing trends between the task semantic feature data and the standardized real-time computing power consumption data, thereby obtaining dynamic correlation features. For example, by calculating the cross-correlation function between changes in task semantic features and changes in real-time computing power consumption features over multiple consecutive time windows, dynamic correlation coefficients can be determined, thereby forming quantifiable dynamic correlation feature data. These dynamic correlation features can reflect the impact or correlation between changes in task semantic features and changes in real-time computing power requirements.
[0067] Based on dynamic correlation characteristics, the nonlinear relationship between task semantic changes and real-time computing power demand changes in multi-task artificial intelligence models during training and inference processes is identified, and the nonlinear fluctuation characteristics of computing power demand driven by task semantics are obtained.
[0068] Specifically, by analyzing dynamically correlated feature data, nonlinear relationship identification methods, such as multidimensional nonlinear function fitting or nonlinear curve fitting analysis, are employed to calculate the degree of nonlinear relationship between changes in task semantic features and changes in real-time computing power requirements. For example, in image recognition or speech recognition tasks, based on dynamically correlated feature data, specific nonlinear relationships are determined by fitting nonlinear functions (e.g., quadratic functions, polynomial functions, or radial basis functions). For instance, after a specific magnitude change in task semantic features, real-time computing power requirements may change at a nonlinear rate or with a nonlinear trend. By calculating nonlinear function relationship parameters (e.g., function fitting parameters, function coefficients, nonlinear metric values, etc.), the nonlinear fluctuation characteristics of computing power requirements driven by task semantics are determined. These nonlinear fluctuation characteristics of computing power requirements driven by task semantics are specifically manifested as a set of nonlinear correspondence values between task semantic features and real-time computing power requirements, reflecting the nonlinear law of computing power demand fluctuations driven by changes in task semantics through numerical methods.
[0069] S3: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, identify nodes that cause sudden changes in computing power demand leading to local resource redundancy and global resource imbalance, and generate computing power demand change prediction results, including:
[0070] Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, the real-time computing power consumption fluctuation amplitude of multi-task artificial intelligence models during the training and inference processes is determined.
[0071] Specifically, the fluctuation range of real-time computing power consumption is expressed as the absolute or relative difference between the standardized values of real-time computing power consumption between adjacent time windows. For example, taking image recognition tasks as an example, the percentage of GPU computing power utilization is measured in each time window within a consecutive 10-second period. If the percentage of computing power utilization is 60% in the first second and 75% in the second second, then the fluctuation range of real-time computing power consumption from the first second to the second second is 15%; if the percentage of computing power utilization is 75% in the second second and 72% in the third second, then the fluctuation range of real-time computing power consumption from the second second to the third second is 3%. By using the above method, the difference or change range between adjacent windows is calculated sequentially for the real-time computing power consumption values within multiple consecutive time windows, forming a dataset of real-time computing power consumption fluctuation ranges, reflecting the fluctuation of real-time computing power resource consumption during the training and inference of multi-task artificial intelligence models.
[0072] When the fluctuation of real-time computing power consumption exceeds the preset threshold for identifying nodes of sudden change in computing power demand within a continuous time window, the corresponding time window node is identified as a node of sudden change in computing power demand.
[0073] Specifically, the threshold for identifying sudden changes in computing power demand is a standard value used to determine whether fluctuations in real-time computing power consumption belong to a sudden change state. For example, based on statistical analysis of historical operating data of a multi-task artificial intelligence model, a suitable percentile of historical fluctuation data or a combination of the mean and standard deviation of historical fluctuation data can be selected as the threshold for identifying sudden changes in computing power demand, such as the 95th percentile of historical fluctuation data; for example, the mean of historical fluctuation data plus two standard deviations can be used as the threshold for identifying sudden changes in computing power demand. If the analysis and calculation show that the average of historical computing power fluctuation data is 10% and the standard deviation is 5%, then the threshold can be set to 10% + 2 × 5% = 20% as the criterion for judging whether fluctuations in real-time computing power consumption belong to a sudden change state. When the real-time computing power consumption fluctuation amplitude within a certain continuous time window is detected to be greater than the pre-set threshold for identifying sudden changes in computing power demand, the corresponding time window is determined as a sudden change node in computing power demand. For example, if the real-time computing power consumption fluctuation of a task is 25% between the 5th and 6th seconds, and the preset threshold for identifying a sudden change in computing power demand is 20%, then the node at the 6th second is a sudden change in computing power demand. If the fluctuation between the 6th and 7th seconds is 8%, which is less than the threshold of 20% for identifying a sudden change in computing power demand, then the node at the 7th second is not a sudden change node.
[0074] Record the time of occurrence of nodes with sudden changes in computing power demand and the corresponding changes in task semantics, and generate prediction results of sudden changes in computing power demand.
[0075] Specifically, when a time window node is identified as a node of sudden change in computing power demand, the specific time corresponding to the node is recorded. For example, it can be recorded as a specific timestamp or the number of seconds relative to the start time. If the sudden change occurs at the 6th second, then the time node data at the 6th second is recorded. Simultaneously, the semantic changes of the task corresponding to the node of sudden change in computing power demand are also recorded. For example, changes in the semantic feature values of the task input data at the node, such as drastic changes in color distribution feature values, large changes in the syntactic feature values of text data, and significant changes in the spectral center frequency features of speech data. By simultaneously recording the time node and the semantic changes of the task, a complete dataset including the sudden change time and the semantic changes of the task can be formed, defined as the computing power demand sudden change prediction result.
[0076] S4: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, predict the changing trend of computing power demand and generate dynamic prediction results of computing power demand, including:
[0077] Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, the real-time computing power consumption value of the multi-task artificial intelligence model in each time window during the training and inference processes is determined.
[0078] Specifically, within each independent time window, such as one second, the actual computing power consumption of the AI task on computing resource nodes (e.g., graphics processing unit nodes) is recorded. The measured data includes CPU utilization, graphics processing unit utilization, memory usage, and bandwidth usage. For example, during the training process of an image recognition task, the computing power consumption in the first second is: CPU utilization 30%, graphics processing unit utilization 65%, and memory usage 4GB; in the second second, it is: CPU utilization 32%, graphics processing unit utilization 70%, and memory usage 4.2GB. During the inference process of a natural language processing task, the computing power consumption in the first second is: CPU utilization 25%, graphics processing unit utilization 50%, and memory usage 2GB; in the second second, it is: CPU utilization 28%, graphics processing unit utilization 52%, and memory usage 2.1GB. Obtaining real-time computing power consumption values for each time window reflects the real-time computing resource consumption of different types of tasks at each time node.
[0079] Calculate the changes in real-time computing power consumption values within multiple consecutive time windows, and generate a sequence of real-time computing power consumption change trends based on these changes;
[0080] Specifically, for each task, multiple consecutive real-time computing power consumption values are arranged in chronological order. For example, the real-time computing power consumption values for 10 consecutive time windows from second 1 to second 10 are arranged sequentially. The difference in computing power consumption values between adjacent time windows is calculated to reflect the change in real-time computing power consumption. For example, taking image recognition tasks as an example, if the graphics processor utilization rate is 65% in second 1 and 70% in second 2, then the change in real-time computing power consumption between second 1 and second 2 is +5%. The above method is used to continuously calculate the changes in real-time computing power consumption for 9 consecutive adjacent windows from second 1 to second 10. By arranging and combining these changes in chronological order, a complete sequence of real-time computing power consumption trends can be obtained, reflecting the fluctuation of real-time computing power resource utilization on the time axis, and demonstrating the changing patterns and trends of real-time computing power consumption within multiple consecutive time windows.
[0081] Based on the real-time computing power consumption change trend sequence, calculate the change trend of real-time computing power consumption value within multiple consecutive time windows in the future.
[0082] Specifically, by analyzing the real-time computing power consumption trend sequence, time series prediction methods are employed, such as the sliding window averaging method in time series prediction, to calculate the real-time computing power consumption trend over multiple consecutive time windows. For example, for image recognition tasks, by using the real-time computing power consumption trend sequence of the first 10 seconds, the trend of real-time computing power consumption from the 11th to the 20th second is calculated and predicted. If the trend sequence shows that computing power consumption gradually increases at a rate of 3% per second over multiple consecutive windows, then the trend of computing power consumption from the 11th to the 20th second is predicted to continue to increase at a similar rate. For natural language processing tasks, if the real-time computing power consumption trend sequence shows an alternating fluctuation with gradually decreasing amplitude, then the trend of real-time computing power consumption over multiple consecutive time windows is predicted to continue to show a decreasing amplitude fluctuation trend.
[0083] Based on the changing trends of real-time computing power consumption values over multiple consecutive time windows, dynamic prediction results of computing power demand are generated.
[0084] Specifically, for example, if the predicted trend of graphics processing unit (GPU) computing power consumption from the 11th to the 20th second is a 3% increase per second, then based on the actual computing power consumption at the 10th second (assuming a GPU utilization of 75% at the 10th second), the predicted value for the 11th second would be 78%, for the 12th second 81%, and so on, up to a predicted value of 105% for the 20th second. For a natural language processing task, if the actual computing power consumption at the 10th second is 55%, and it is predicted to decrease by 2% per second in the future, then the predicted value for the 11th second would be 53%, for the 12th second 51%, and so on, up to a predicted value of 35% for the 20th second. This reflects the predicted demand for real-time computing power from AI tasks over multiple consecutive time windows and is defined as the dynamic forecast result of computing power demand. The dynamic forecast result of computing power demand can be used to formulate and optimize real-time resource allocation strategies, ensuring more accurate and reasonable allocation of computing resources and avoiding waste or insufficiency of computing resources.
[0085] S5: Combining the prediction results of sudden changes in computing power demand with the prediction results of dynamic computing power demand, optimize the dynamic scheduling strategy and generate an optimized computing power resource scheduling strategy, including:
[0086] Obtain the prediction results of computing power demand mutations, extract the time of computing power demand mutation nodes and the corresponding task semantic changes, and determine the degree of impact of computing power demand mutations caused by task semantic changes on the overall computing power resource allocation.
[0087] Specifically, the prediction results of computational demand mutations include the time of occurrence of mutation nodes and the corresponding task semantic changes. Taking actual artificial intelligence computing tasks as an example, such as running image recognition and natural language processing tasks simultaneously on an artificial intelligence computing platform, the task semantic changes and corresponding real-time computational consumption data for each time window are recorded to mark the nodes where computational demand changes, i.e., computational demand mutation nodes. For image recognition tasks, for example, if the graphics processor resource utilization rate suddenly increases from 60% to 85% at the 15th second, the node is marked as a computational demand mutation node; the corresponding task semantic changes of computational demand mutation nodes include sudden and significant changes in the color distribution or texture features of the input image, such as the image changing from a single tone to a multi-colored complex background. For natural language processing tasks, if the CPU resource utilization rate suddenly increases from 30% to 50% within the 22nd second, the node is recorded as a computational demand mutation node, and the corresponding task semantic changes are manifested as drastic changes in semantic vector distribution or syntactic structure, such as from processing simple sentences to processing complex long sentences or sentence types with more complex grammatical structures. The above-mentioned sudden changes in computing power demand and the corresponding changes in task semantics are recorded and stored in the form of data tables or databases.
[0088] For data tables or databases recording the times of sudden changes in computing power demand and the corresponding semantic changes in tasks, the extraction method involves scanning and retrieving data row by row, sequentially extracting the timestamp data of each sudden change in computing power demand and the feature data of task semantic changes (e.g., color distribution data, texture feature vectors, semantic feature vectors, and syntactic structure feature values). For example, for recording sudden changes in computing power demand for image recognition tasks, the specific timestamp of the 15-second node in the record table is 15 seconds after the task starts. The semantic change data for the task is that the color histogram of the time window changes drastically, and the feature values fluctuate by more than 50% compared to the previous window. For natural language processing tasks, in the record of the sudden change node at the 22nd second, the extracted semantic change data shows that the complexity value of the syntactic structure increases by 30% compared to the previous window.
[0089] By comparing the changes in real-time computing power consumption within multiple time windows before and after a sudden change in computing power demand, the actual impact of such a change on the overall computing power resource allocation of the AI computing platform can be determined. For example, taking the image recognition task experiencing a sudden change at the 15-second mark as an example, the average change in real-time computing power consumption within several time windows (e.g., 5 to 10 seconds) before and after the change is calculated. Assuming the average GPU utilization rate is 58% in the 5 windows before the 15-second mark, and rises to 80% in the 5 windows after the change, the average change in computing power resource consumption caused by the semantic change in the task is 22%, reflecting the impact of the semantic change on the overall computing power resource allocation. Similarly, for a natural language processing task, if the average CPU utilization rate is 35% in the 5 seconds before the 22-second change and becomes 48% in the 5 seconds after the change, the increase in computing power resource demand due to the semantic change can be calculated to be 13%. The above methods can accurately determine the impact of sudden changes in computing power demand caused by semantic changes in each task on the overall computing power resource allocation.
[0090] Obtain dynamic prediction results of computing power demand, extract the changing trend of real-time computing power consumption values within multiple consecutive time windows in the future, and determine the allocation of computing power resources in each time window.
[0091] Specifically, taking image recognition as an example in artificial intelligence computing tasks, let's assume the dynamic prediction of computing power demand is as follows: from the 11th second to the 20th second, the graphics processor resource utilization rate will increase by 3% per second, with a predicted value of 78% at the 11th second, 81% at the 12th second, and so on, reaching 105% at the 20th second. For natural language processing tasks, let's assume the dynamic prediction of computing power demand is as follows: from the 11th second to the 20th second, the CPU utilization rate will decrease by 2% per second, with a predicted value of 53% at the 11th second, 51% at the 12th second, and so on, reaching 35% at the 20th second. The prediction results of real-time computing power consumption trends over multiple consecutive time windows are extracted using the above method.
[0092] Taking image recognition task prediction results as an example, if the maximum resource capacity of the graphics processing unit (GPU) of a computing node is 100%, when the predicted computing power demand within a future time window reaches or exceeds the maximum capacity (e.g., the predicted value reaches 105% at the 20th second), computing power resources should be allocated in advance for that time window. This involves increasing the number of computing nodes or adjusting the resource allocation for other tasks. An additional GPU node should be added before the predicted value reaches the critical value to ensure the resource allocation capacity meets the computing power demand; that is, the number allocated is increased to an extra node. For natural language processing tasks, if the prediction results show that the computing power demand continues to decrease over multiple future time windows, the allocation can be reduced. For example, if the CPU resource allocation is originally 60%, and the usage decreases to 35% at the 20th second, the allocated resources can be gradually reduced to 40%, with the remaining resources used for other tasks. This ensures that the number of computing power resources allocated within multiple consecutive future time windows is accurately determined based on dynamic prediction results, meeting the needs of changing task computing power demand trends.
[0093] Based on the impact of sudden changes in computing power demand caused by changes in task semantics on the overall allocation of computing power resources, and the amount of computing power resources allocated in each time window, the dynamic scheduling strategy is optimized and an optimized computing power resource scheduling strategy scheme is generated.
[0094] Specifically, the impact of sudden changes in computing power demand caused by semantic shifts in the task on the overall allocation of computing resources, and the amount of computing resources allocated within multiple consecutive time windows in the future, are used as input variables for dynamic scheduling strategy optimization analysis. For example, linear programming or integer programming algorithms can be used to optimize computing resource allocation and generate optimized scheduling strategy schemes. For instance, for image recognition tasks, if a sudden change at the 15th second causes a 22% increase in computing power demand, and the future time window prediction shows a continued increase, then a strategy of increasing resource nodes or reducing resource allocation for other low-priority tasks is implemented. For natural language processing tasks, if a sudden change causes a 13% increase in computing power demand, and future predictions show a gradual decrease, then a strategy of temporarily increasing the number of computing nodes at the 22nd second is implemented, followed by a gradual reduction in the number of allocated nodes. Through this method, an optimized computing resource scheduling strategy scheme that meets actual needs is generated, and the optimized resource allocation adjustment scheme and adjustment amount are recorded.
[0095] S6: Based on a computing resource scheduling strategy optimization scheme, the allocation of computing resources for multi-task artificial intelligence model training and inference is adjusted in real time to eliminate local resource redundancy, including:
[0096] Based on the optimization scheme of computing resource scheduling strategy, the real-time computing resource allocation result for each task in each time window is determined.
[0097] Specifically, the computing resource scheduling strategy optimization scheme consists of computing resource allocation strategy data for multiple different types of tasks in an artificial intelligence computing platform within a series of consecutive time windows in the future. These tasks include image recognition, natural language processing, and speech recognition. The data format of the computing resource scheduling strategy optimization scheme is stored in a structured data table. The data table contains the real-time computing resource allocation quantity corresponding to each task within multiple consecutive time windows, such as CPU utilization, GPU utilization, memory usage, and bandwidth usage.
[0098] Taking the simultaneous operation of image recognition and natural language processing tasks on an AI computing platform as an example, each task has recorded resource allocation values within each time window. For instance, the computing resources allocated to the image recognition task within the consecutive time window from second 21 to second 30 are as follows: 80% GPU resource allocation at second 21, 83% at second 22, 86% at second 23, and increasing sequentially to 107% at second 30. Similarly, the computing resources allocated to the natural language processing task within the same time window are as follows: 50% CPU resource allocation at second 21, 48% at second 22, 46% at second 23, decreasing sequentially to 32% at second 30. This ensures the accuracy and traceability of the computing resource allocation results for each task within each time window.
[0099] The computing resource scheduling and management program of the artificial intelligence computing platform analyzes the optimization scheme of computing resource scheduling strategy. The computing resource allocation value corresponding to each task within each continuous time window is parsed into execution instructions. The execution instructions are transmitted to the resource management and control unit of the artificial intelligence computing resource node, such as the graphics processor resource management unit, central processing unit resource management unit, or memory management unit. The control unit dynamically adjusts and allocates computing resources in real time according to the execution instructions, ensuring that the task can accurately obtain the corresponding real-time computing resource allocation result within each time window according to the optimization scheme.
[0100] Based on the real-time computing power resource allocation results, tasks are assigned in real time to AI computing power resource nodes that match the task's computing power requirements;
[0101] Specifically, let's take image recognition and natural language processing tasks in an artificial intelligence computing platform as examples. Assume the AI computing platform includes several different types of AI computing resource nodes, such as GPU node A and GPU node B for graphics processing units, and CPU node A and CPU node B for central processing units. These different types of nodes have different maximum resource capacities and computing characteristics, suitable for handling different types of tasks or different real-time resource allocation requirements.
[0102] The allocation method first involves performing node adaptability analysis based on the resource quantity and task type corresponding to the real-time computing power allocation results. For example, if the real-time computing power allocation result for an image recognition task at the 23rd second is a GPU resource utilization rate of 86%, the node matching method involves analyzing the real-time remaining resources of GPU node A and GPU node B. If GPU node A has a real-time remaining capacity of 90% and GPU node B has a real-time remaining capacity of 80%, then through real-time matching analysis, it is determined that the image recognition task at the 23rd second should be allocated to GPU node A to meet the resource requirements. Similarly, if the real-time computing power allocation result for a natural language processing task at the 23rd second is a CPU resource utilization rate of 46%, the node matching method involves analyzing the real-time resource status of CPU node A and CPU node B. If CPU node A has a real-time remaining capacity of 50% and CPU node B has a real-time remaining capacity of 30%, then the natural language processing task at the 23rd second should be allocated to CPU node A for execution.
[0103] The real-time resource allocation control method involves issuing computing resource allocation instructions through the resource scheduling and management control unit of the artificial intelligence computing platform. Based on the determined node allocation results, the resource scheduling and management control unit sends task resource allocation instructions to the nodes in real time. For example, it sends an execution instruction to GPU node A for an image recognition task with a resource utilization rate of 86% at the 23rd second, and an execution instruction to CPU node A for a natural language processing task with a resource utilization rate of 46% at the 23rd second, ensuring real-time dynamic execution of resource allocation results and accurately matching the real-time computing power requirements of each task.
[0104] Based on the actual real-time computing power consumption of each task on the AI computing power resource node within each time window, determine the difference between the actual real-time computing power consumption of each task and the real-time computing power resource allocation result within each time window;
[0105] Specifically, the actual real-time computing power consumption of each task on the computing resource nodes within each time window is monitored and recorded in real time. Taking the actual execution status of the image recognition task on GPU node A at the 23rd second as an example, the monitoring method is that the real-time resource monitoring program records the resource usage of GPU node A every second. For example, the actual GPU resource utilization rate of the image recognition task at the 23rd second is 83%. The actual CPU utilization rate of the natural language processing task on CPU node A at the 23rd second is 50%. The actual real-time computing power consumption of each task is recorded through the above real-time monitoring method and stored in the platform resource monitoring database in the form of a data table.
[0106] The method for judging the difference between real-time computing power consumption and real-time computing power resource allocation results is as follows: compare the actual real-time computing power consumption of each task within each time window with the real-time computing power resource allocation results. For example, if the real-time computing power resource allocation result for the image recognition task at the 23rd second is 86%, and the actual real-time computing power consumption is 83%, then the difference between the actual consumption and the allocation result is 3%; if the real-time allocation for the natural language processing task at the 23rd second is 46%, and the actual utilization rate is 50%, the difference is -4%.
[0107] Based on the differences, the allocation of computing resources for each task on the AI computing resource nodes is adjusted in real time to eliminate local resource redundancy.
[0108] Specifically, based on the difference between the actual real-time computing power consumption and the real-time computing power resource allocation results, real-time dynamic adjustments are made to task resource allocation to eliminate local resource redundancy. For example, if the actual utilization rate of an image recognition task is less than 3% of the resource allocation result at the 23rd second, the amount of computing power resources allocated to the image recognition task in the next second or subsequent time windows is reduced; for example, the allocation utilization rate is reduced from 89% to 86% at the 24th second. If the actual utilization rate of a natural language processing task exceeds the resource allocation result by 4% at the 23rd second, the allocation amount is increased in the next second; for example, the allocation utilization rate is increased from 44% to 48% at the 24th second. This real-time adjustment method ensures accurate and sufficient task resource allocation, avoiding local resource redundancy or insufficient resources.
[0109] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0110] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0111] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0112] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0113] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0114] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0115] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0116] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0117] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0118] In conclusion, the above description is only a preferred embodiment of the present invention and is 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.
Claims
1. A method for scheduling computing resources based on artificial intelligence, characterized in that, Includes the following steps: S1: Collect semantic similarity data and real-time computing power consumption data of tasks during the training and inference of multi-task artificial intelligence models, and construct an initial data mapping model; S2: Based on the initial data mapping model, analyze the dynamic correlation characteristics between semantic feature data and real-time computing power demand data, and generate nonlinear fluctuation characteristics of computing power demand driven by task semantics. S3: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, identify the nodes of sudden changes in computing power demand that cause local resource redundancy and global resource imbalance, and generate computing power demand change prediction results. S4: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, predict the changing trend of computing power demand and generate dynamic prediction results of computing power demand. S5: Combine the results of sudden changes in computing power demand with the results of dynamic prediction of computing power demand to optimize the dynamic scheduling strategy and generate an optimized solution for computing power resource scheduling strategy. S6: Based on the optimization scheme of computing power resource scheduling strategy, the computing power resource allocation for training and inference of multi-task artificial intelligence models is adjusted in real time to eliminate local resource redundancy.
2. The method for scheduling computing resources based on artificial intelligence according to claim 1, characterized in that, S1, specifically: Collect raw data on task semantic similarity and real-time computing power consumption generated during the training and inference processes of multi-task artificial intelligence models; The original data of task semantic similarity and the original data of real-time computing power consumption are preprocessed to obtain standardized data of task semantic similarity and standardized data of real-time computing power consumption. Based on task semantic similarity standardized data and real-time computing power consumption standardized data, the correlation between task semantic features and real-time computing power consumption features is calculated. An initial data mapping model is constructed based on standardized data of task semantic similarity and the correlation between task semantic features and real-time computing power consumption features.
3. The method for scheduling computing resources based on artificial intelligence according to claim 2, characterized in that, S2, specifically: Based on the initial data mapping model, task semantic features are extracted from the task semantic similarity standardized data to obtain task semantic feature data; By utilizing task semantic feature data and standardized real-time computing power consumption data, the dynamic correlation between task semantic features and real-time computing power requirements within multiple consecutive time windows is calculated. Based on dynamic correlation characteristics, the nonlinear relationship between task semantic changes and real-time computing power demand changes in multi-task artificial intelligence models during training and inference processes is identified, thereby obtaining the nonlinear fluctuation characteristics of computing power demand driven by task semantics.
4. The method for scheduling computing resources based on artificial intelligence according to claim 3, characterized in that, S3, specifically: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, the real-time computing power consumption fluctuation amplitude of multi-task artificial intelligence models during the training and inference processes is determined. When the fluctuation of real-time computing power consumption exceeds the preset threshold for identifying nodes of sudden change in computing power demand within a continuous time window, the corresponding time window node is identified as a node of sudden change in computing power demand. Record the time of occurrence of nodes with sudden changes in computing power demand and the corresponding changes in task semantics, and generate prediction results for sudden changes in computing power demand.
5. The artificial intelligence-based computing resource scheduling method according to claim 4, characterized in that, S4, specifically: Based on the nonlinear fluctuation characteristics of computing power demand driven by task semantics, the real-time computing power consumption value of the multi-task artificial intelligence model in each time window during the training and inference processes is determined. Calculate the changes in real-time computing power consumption values within multiple consecutive time windows, and generate a sequence of real-time computing power consumption change trends based on these changes; Based on the real-time computing power consumption change trend sequence, calculate the change trend of real-time computing power consumption value within multiple consecutive time windows in the future. Based on the changing trends of real-time computing power consumption over multiple consecutive time windows, dynamic prediction results of computing power demand are generated.
6. The method for scheduling computing resources based on artificial intelligence according to claim 5, characterized in that, S5, specifically: Obtain the prediction results of computing power demand mutations, extract the time of computing power demand mutation nodes and the corresponding task semantic changes, and determine the degree of impact of computing power demand mutations caused by task semantic changes on the overall computing power resource allocation. Obtain dynamic prediction results of computing power demand, extract the changing trend of real-time computing power consumption values within multiple consecutive time windows in the future, and determine the allocation of computing power resources in each time window. Based on the impact of sudden changes in computing power demand caused by changes in task semantics on the overall allocation of computing power resources, and the amount of computing power resources allocated in each time window, the dynamic scheduling strategy is optimized to generate an optimized computing power resource scheduling strategy.
7. The method for scheduling computing resources based on artificial intelligence according to claim 6, characterized in that, S6, specifically: Based on the optimization scheme of computing resource scheduling strategy, the real-time computing resource allocation result for each task in each time window is determined. Based on the real-time computing power resource allocation results, tasks are assigned in real time to AI computing power resource nodes that match the task's computing power requirements; Based on the actual real-time computing power consumption of each task on the AI computing power resource node within each time window, determine the difference between the actual real-time computing power consumption of each task and the real-time computing power resource allocation result within each time window; Based on the differences, the allocation of computing resources for each task on the AI computing resource nodes is adjusted in real time to eliminate local resource redundancy.
Citation Information
Patent Citations
Intelligent computing power recommendation method under heterogeneous computing power integration system
CN118312329A
Computing power resource scheduling method and system and storage medium
CN119739535A
Computing power management method of intelligent computing center and model training method and device
CN119847745A
Self-adaptive load balancing method and system based on server state analysis
CN120029762A
Computing resource dynamic allocation method oriented to frequency fluctuation
CN120123100A
Cited By
All-optical computing power network resource dynamic scheduling method based on multi-agent collaboration
CN122248297A
A multi-agent cooperation-based all-optical computing power network resource dynamic scheduling method
CN122248297B