Content traffic prediction method and system
Through the dual-layer gated network structure and a mixed expert network model trained in stages, the resource consumption and accuracy of program traffic prediction in the online video website CDN server is solved, and efficient and accurate traffic prediction effect is achieved.
Patent Information
- Application Number
- CN202510788241.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-08-08
AI Technical Summary
In the CDN server of online video websites, program traffic prediction has problems such as high resource consumption and low prediction accuracy, and it is impossible to effectively deal with the traffic changes of diversified programs.
A hybrid expert network model with a two-layer gated network structure is adopted. The expert network combination is selected through the top-level gated network, and the weight is allocated by the underlying gated network. The selected expert network dynamically loads the selected expert network for traffic prediction. Combined with phased training and temperature coefficient control model convergence, reducing resource consumption and improving prediction efficiency.
It realizes efficient and accurate traffic prediction under diversified programs, reduces analysis complexity and resource consumption, and improves prediction efficiency and accuracy.
Smart Images

Figure CN120455722A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multimedia data analysis, and in particular to a content flow prediction method and system. Background Art
[0002] CDN server resources are a significant expense for online video websites' cloud servers. To cope with traffic spikes caused by various unexpected events during live broadcasts, ensure smooth broadcasting, and avoid excessive resource reserves that could lead to high costs, traffic forecasts are often made based on relevant and historical data, allowing for resource reserves to be tailored accordingly.
[0003] Current methods for predicting program traffic primarily combine program information and relevant historical data to estimate program traffic based on experience. Alternatively, a network model is trained based on the attribute information of multiple programs. This network model can then learn the traffic patterns of various programs, allowing traffic to be predicted directly based on the program's attribute information.
[0004] However, program types, content, and broadcast scenarios are extremely diverse, so predictions based on experience cannot guarantee accuracy. Existing prediction methods using network models also consume a lot of resources, are inefficient, and cannot adapt well to various program scenarios, making the prediction results inaccurate. Summary of the Invention
[0005] Based on the above-mentioned deficiencies of the existing technology, the present application provides a content traffic prediction method and system to solve the problem that the existing technology consumes a lot of resources and cannot efficiently predict accurate traffic.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a content flow prediction method, comprising:
[0008] Obtain analytical data for target content;
[0009] Inputting the analysis data of the target content into a pre-trained prediction model;
[0010] The top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content, and outputs a selection result vector; wherein each of the expert network combinations includes multiple combinations of the expert networks in the prediction model;
[0011] The underlying gating network in the prediction model analyzes the current weights of the expert networks in the target expert network combination based on the analysis data of the target content and the splicing result of the selection result vector; wherein the target expert network combination is the currently selected expert network combination represented by the selection result vector;
[0012] The traffic information predicted by each of the expert networks in the target expert network combination based on the analysis data of the target content is fused according to the current weight of each expert network to obtain a current traffic prediction result of the target content.
[0013] Optionally, in the above-mentioned content traffic prediction method, the top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content and outputs a selection result vector, including:
[0014] The top-level gating network in the prediction model linearly transforms the feature vector of the analysis data of the target content;
[0015] Multiplying the linearly transformed feature vector of the analysis data of the target content by the top-level gating weight matrix and adding the top-level gating bias term to obtain a top-level hidden feature vector;
[0016] The top-level hidden feature vector is one-hot encoded to obtain the selection result vector.
[0017] Optionally, in the above content flow prediction method, the prediction model training method includes:
[0018] Obtain training sample dataset;
[0019] Initializing the parameters of the top-level gating network, the parameters of the bottom-level gating network, the parameters of each of the expert networks, and the temperature coefficient in the prediction model;
[0020] Iteratively training the underlying gating network and each of the expert networks in the prediction model using the training sample data set and the temperature coefficient attenuated according to a first attenuation rate until the number of training times in the first stage reaches a first number of iterations or the current task loss converges; wherein the first attenuation rate continuously decreases with an increase in the number of training times;
[0021] Using the training sample data set and the temperature coefficient that decays according to the second decay rate, each of the expert networks, the bottom gating network and the top gating network in the prediction model is jointly iteratively trained until the number of training times in the second stage reaches the second number of iterations or the current total loss converges; wherein the second decay rate continuously decreases with the increase in the number of training times, and the decrease is smaller than the first decay rate.
[0022] Optionally, in the above-mentioned content traffic prediction method, the iterative training of the parameters of the underlying gating network and each of the expert networks in the prediction model using the training sample dataset and the temperature coefficient attenuated according to the first attenuation rate includes:
[0023] Inputting the first phase of training sample data in the training sample data set into the prediction model, performing expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyzing and obtaining the current predicted flow corresponding to the training sample data based on the expert network combination selection result;
[0024] Calculating the current task loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data;
[0025] Updating the parameters of the underlying gating network and the parameters of each of the expert networks based on the current task loss;
[0026] The temperature coefficient is decayed according to the current first decay rate, and the process of inputting the first stage training sample data in the training sample data set into the prediction model is returned to execution until the number of training times of the first stage reaches the first number of iterations or the current task loss converges.
[0027] Optionally, in the above-mentioned content traffic prediction method, the joint iterative training of each of the expert network, the bottom gating network, and the top gating network in the prediction model using the training sample dataset and the temperature coefficient attenuated according to the second attenuation rate includes:
[0028] Inputting the training sample data of the second phase in the training sample data set into the prediction model, performing expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyzing and obtaining the current predicted flow corresponding to the training sample data based on the expert network combination selection result;
[0029] Calculating the current total loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data;
[0030] Jointly updating the parameters of each of the expert networks, the parameters of the bottom gating network, and the parameters of the top gating network based on the current total loss;
[0031] The temperature coefficient is decayed according to the current second decay rate, and the process of inputting the training sample data of the second stage in the training sample data set into the prediction model is returned to execution until the number of training times of the second stage reaches the second number of iterations or the current total loss converges.
[0032] Optionally, in the above-mentioned content traffic prediction method, fusing the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content according to the current weight of each expert network to obtain the current traffic prediction result of the target content includes:
[0033] Loading the target expert network combination;
[0034] Predicting the traffic information of the target content based on the analysis data of the target content by using each of the expert networks in the target expert network combination;
[0035] The flow information of the target content predicted by each of the expert networks is weighted using the current weight of each of the expert networks to obtain a current flow prediction result of the target content.
[0036] Optionally, in the above content flow prediction method, the loading of the target expert network combination includes:
[0037] Determining whether the target expert network combination is stored in a cache pool;
[0038] If the target expert network combination is stored in the cache pool, the identifier of the target expert network combination is moved to the end of the cache queue;
[0039] If it is determined that the target expert network combination is not stored in the cache pool, determining whether the cache pool is full;
[0040] If the cache pool is full, removing the expert network combination at the head of the cache queue from the cache pool, and removing its identifier from the cache queue;
[0041] The target expert network is loaded from the hard disk into the cache pool, and the identifier of the target expert network is added to the end of the cache queue.
[0042] Optionally, in the above content flow prediction method, the method further includes:
[0043] When the ratio of the access frequency to the size of any one of the expert network combinations in the hard disk and the system memory in the cache pool is greater than the current upgrade threshold corresponding to the storage layer, the expert network combination is promoted to a storage layer for storage; wherein the previous storage layer of the hard disk is the system content; the previous storage layer of the system memory is the video memory in the cache pool; the current upgrade threshold corresponding to one of the storage layers is determined according to the current remaining space of the storage layer;
[0044] When the non-access time of any one of the expert network combinations in the video memory and the system memory is greater than a preset time threshold, the expert network combination is lowered to a storage level for storage.
[0045] Optionally, in the above content flow prediction method, the method further includes:
[0046] Obtaining selection probability distribution information of each current expert network combination;
[0047] removing the target expert network combination from the obtained selection probability distribution information distribution;
[0048] Based on each of the selected expert network combinations within a preset time range, obtaining a transfer matrix from the target expert network combination to the remaining expert network combinations;
[0049] respectively weighting the probabilities of the expert network combinations in the probability distribution information and the transfer mean to obtain a comprehensive score for each expert network combination;
[0050] The expert network combinations ranked in the top N positions by comprehensive scores are selected and preloaded into the cache pool.
[0051] A second aspect of the present application provides a content flow prediction system, comprising:
[0052] A data acquisition unit, configured to acquire analysis data of target content;
[0053] An input unit, configured to input the analysis data of the target content into a pre-trained prediction model;
[0054] a combination selection unit, configured to perform expert network combination selection analysis based on the analysis data of the target content through the top-level gating network in the prediction model, and output a selection result vector; wherein each of the expert network combinations includes multiple combinations of the expert networks in the prediction model;
[0055] a weight analysis unit, configured to analyze the current weights of the respective expert networks in the target expert network combination based on the analysis data of the target content and the concatenation result of the selection result vector through the underlying gating network in the prediction model; wherein the target expert network combination is the currently selected expert network combination represented by the selection result vector;
[0056] The fusion prediction unit is used to fuse the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content according to the current weight of each expert network to obtain the current traffic prediction result of the target content.
[0057] Optionally, in the above-mentioned content flow prediction system, the combination selection unit includes:
[0058] a transformation unit, configured to perform a linear transformation on a feature vector of the analysis data of the target content through a top-level gating network in the prediction model;
[0059] a vector calculation unit, configured to multiply the feature vector of the analysis data of the target content after the linear transformation by the top-level gating weight matrix, and add the top-level gating bias term to obtain a top-level hidden feature vector;
[0060] An encoding unit is used to perform one-hot encoding on the top-level hidden feature vector to obtain the selection result vector.
[0061] Optionally, the above content flow prediction system further includes:
[0062] A sample acquisition unit, used to acquire a training sample data set;
[0063] an initialization unit, configured to initialize the parameters of the top-level gating network, the parameters of the bottom-level gating network, the parameters of each of the expert networks, and the temperature coefficient in the prediction model;
[0064] a first-stage training unit, configured to iteratively train the underlying gating network and each of the expert networks in the prediction model using the training sample data set and the temperature coefficient attenuated according to a first attenuation rate, until the number of first-stage training reaches a first number of iterations or the current task loss converges; wherein the first attenuation rate continuously decreases as the number of training times increases;
[0065] The second-stage training unit is used to perform joint iterative training on each of the expert networks, the bottom-level gating network, and the top-level gating network in the prediction model using the training sample data set and the temperature coefficient attenuated according to the second attenuation rate, until the number of training times in the second stage reaches the second number of iterations or the current total loss converges; wherein the second attenuation rate continuously decreases with the increase in the number of training times, and the decrease is smaller than the first attenuation rate.
[0066] Optionally, in the above content flow prediction system, the first-stage training unit includes:
[0067] a first input unit, configured to input the training sample data of the first stage in the training sample data set into the prediction model, perform expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and obtain the current predicted flow corresponding to the training sample data according to the expert network combination selection result;
[0068] A first loss calculation unit, configured to calculate a current task loss based on a current predicted flow and an actual predicted flow corresponding to the training sample data;
[0069] A first updating unit, configured to update the parameters of the underlying gating network and the parameters of each of the expert networks based on the current task loss;
[0070] A first attenuation unit is used to attenuate the temperature coefficient according to the current first attenuation rate and return it to the first input unit until the number of training times in the first stage reaches a first number of iterations or the current task loss converges.
[0071] Optionally, in the above content flow prediction system, the second-stage training unit includes:
[0072] a second input unit, configured to input the training sample data of the second stage in the training sample data set into the prediction model, perform expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and obtain a current predicted flow corresponding to the training sample data based on the expert network combination selection result;
[0073] A second loss calculation unit, configured to calculate a current total loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data;
[0074] A second updating unit, configured to jointly update the parameters of each of the expert networks, the parameters of the bottom gating network, and the parameters of the top gating network based on the current total loss;
[0075] A second attenuation unit is used to attenuate the temperature coefficient according to the current second attenuation rate and return it to the second input unit until the number of training times in the second stage reaches a second number of iterations or the current total loss converges.
[0076] Optionally, in the above-mentioned content flow prediction system, the fusion prediction unit includes:
[0077] A loading unit, configured to load the target expert network combination;
[0078] a prediction unit, configured to predict the flow information of the target content based on the analysis data of the target content by using each of the expert networks in the target expert network combination;
[0079] The weighting unit is used to weight the flow information of the target content predicted by each of the expert networks using the current weight of each of the expert networks to obtain a current flow prediction result of the target content.
[0080] Optionally, in the above content flow prediction system, the loading unit includes:
[0081] A first judging unit, configured to judge whether the target expert network combination is stored in a cache pool;
[0082] a moving unit, configured to move the identifier of the target expert network combination to the end of the cache queue when the target expert network combination is stored in the cache pool;
[0083] a second determining unit, configured to determine whether the cache pool is full when it is determined that the target expert network combination is not stored in the cache pool;
[0084] a combination removing unit, configured to remove the expert network combination at the head of the cache queue from the cache pool and remove its identifier from the cache queue when the cache pool is full;
[0085] The adding unit is used to load the target expert network from the hard disk into the cache pool, and add the identifier of the target expert network to the end of the cache queue.
[0086] Optionally, the above content flow prediction system further includes:
[0087] An upgrading unit, configured to upgrade the expert network combination to a higher storage level for storage when the ratio of the access frequency to the size of any one of the expert network combinations in the hard disk and the system memory in the cache pool is greater than a current upgrade threshold corresponding to the storage level at which the expert network combination is located; wherein the previous storage level of the hard disk is the system content; the previous storage level of the system memory is the video memory in the cache pool; and the current upgrade threshold corresponding to one of the storage levels is determined based on the current remaining space of the storage level.
[0088] The demotion unit is configured to degrade the expert network combination by one storage level for storage when the non-access time of any one of the expert network combinations in the video memory and the system memory is greater than a preset time threshold.
[0089] Optionally, the above content flow prediction system further includes:
[0090] a distribution information acquisition unit, configured to acquire selection probability distribution information of each of the current expert network combinations;
[0091] a probability removal unit, configured to remove the target expert network combination from the obtained selection probability distribution information distribution;
[0092] a matrix acquisition unit, configured to acquire a transfer matrix from the target expert network combination to the remaining expert network combinations based on each of the expert network combinations selected within a preset time range;
[0093] a scoring unit, configured to weight the probabilities of each of the expert network combinations in the probability distribution information and the transition mean, respectively, to obtain a comprehensive score for each of the expert network combinations;
[0094] The preloading unit is used to select the expert network combinations ranked in the top N positions in comprehensive score and preload them into the cache pool.
[0095] The present application provides a content traffic prediction method, which obtains the analysis data of the target content and inputs the analysis data of the target content into a pre-trained prediction model. The top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content and outputs a selection result vector. Among them, each expert network combination includes multiple combinations composed of each expert network in the prediction model, and then the bottom-level gating network in the prediction model analyzes the current weights of each expert network in the target expert network combination based on the analysis data of the target content and the splicing result of the selection result vector. Among them, the target expert network combination is the currently selected expert network combination represented by the selection result vector. Finally, the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content is fused according to the current weights of each expert network to obtain the current traffic prediction result of the target content. Therefore, by selecting a network combination that meets the situation for prediction according to different program situations, and by introducing a temperature coefficient to ensure the accuracy of each network in the model, the accuracy of the prediction result is effectively guaranteed. In addition, the expert network combination is first selected through the top-level gating network, and then weights are assigned only to the networks in the selected expert network combination through the bottom-level gating network. Finally, the selected expert network is dynamically loaded for prediction and the prediction results are fused. There is no need to load all the expert networks and analyze all the expert networks, which can effectively reduce the complexity of the analysis process, reduce resource consumption, and effectively improve prediction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0097] Figure 1 A flowchart of a content flow prediction method provided in an embodiment of the present application;
[0098] Figure 2 A flowchart of a prediction model training method provided in an embodiment of the present application;
[0099] Figure 3 A flowchart of a first-stage training method for a prediction model provided in an embodiment of the present application;
[0100] Figure 4 A flowchart of pseudo code of a prediction model training method provided in an embodiment of the present application;
[0101] Figure 5A flowchart of a second-stage training method for a prediction model provided in an embodiment of the present application;
[0102] Figure 6 A flowchart of a method for selecting an expert network from a top-level gated network provided in an embodiment of the present application;
[0103] Figure 7 A flow chart of a method for fusing traffic information provided in an embodiment of the present application;
[0104] Figure 8 A flowchart of a method for dynamically loading an expert network combination provided in an embodiment of the present application;
[0105] Figure 9 A flowchart of pseudo code for a method of dynamically loading an expert network combination provided in an embodiment of the present application;
[0106] Figure 10 A flowchart of an asynchronous preloading method provided in an embodiment of the present application;
[0107] Figure 11 A schematic diagram of the architecture of a content flow prediction system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0108] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0109] In this application, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0110] The present application embodiment provides a content flow prediction method, such as Figure 1 As shown, the following steps are included:
[0111] S101: Obtain analysis data of target content.
[0112] The target content is the multimedia content for which traffic prediction is required. The analysis data includes relevant historical data and information on various factors that influence program traffic. Optionally, the analysis data for the target content may include, but is not limited to, historical traffic, program metadata such as genre and duration, and external factors such as holidays and trending topics. Historical traffic can include one or more of the following: the target content's trailer, previous season videos of the same program, and programs of the same genre.
[0113] S102: Inputting the analysis data of the target content into a pre-trained prediction model.
[0114] To accommodate a wide variety of programs, the prediction model used in this embodiment is a hybrid expert network model. This model contains multiple expert networks. Based on different input information, a gating network selects the appropriate expert network for processing. This allows for adaptive network model processing based on various circumstances to ensure accurate results. Therefore, when prediction is required, feature processing is performed on the target content's analysis data to obtain a feature vector for the target content's analysis data. This feature vector is then input into the trained prediction model.
[0115] However, it should be noted that the current hybrid expert network model only has a single-layer gating network. Therefore, all expert networks are loaded during operation, and the gating network analyzes the weights corresponding to each expert network based on the input information. Based on the weights of each expert network, one or more expert networks with the highest weights are selected. The analysis results of each selected expert network are then fused based on the corresponding weights of each selected expert network. Because weight analysis must be performed on all experts, the complexity of the analysis increases linearly with the number of expert networks, resulting in a very complex analysis process that consumes a large amount of resources and time. Consequently, it suffers from insufficient expressiveness, low computational efficiency, and poor interpretability.
[0116] To this end, the embodiment of the present application improves the hybrid expert network model. Specifically, a two-layer gating network is set up in the hybrid expert model: a coarse-grained top-level gating network and a fine-grained bottom-level gating network. First, the coarse-grained top-level gating network selects the expert network combination that is suitable for the current input from each expert network combination, that is, the corresponding network combination is first selected based on the network combination. Then, the bottom-level gating network only assigns weights to the networks in the selected expert network combination, and dynamically loads the networks in the selected expert network combination to weight their analysis results. Therefore, the processing and dynamic loading of the two-layer gating network can reduce the complexity of the analysis, as well as reduce the resource usage and the time required.
[0117] Optionally, in order to adapt to the double-layer gated network in the embodiment of the present application, and to solve the contradiction that the existing hybrid expert network model has insufficient exploration or slow convergence, the accuracy of the prediction results is guaranteed. Therefore, in the embodiment of the present application, the prediction model is trained in stages, and each training stage controls the convergence speed by introducing different temperature parameter changes. By training in stages and introducing different temperature parameter changes in two stages to control the convergence speed, rapid convergence can be avoided in one stage, so that sufficient exploration can be carried out and the top-level gated network can be trained to make accurate selections. In the other stage, faster convergence can be achieved, thereby quickly obtaining a model that can accurately predict.
[0118] Optionally, in another embodiment of the present application, a method for training a prediction model is provided, such as Figure 2 As shown, the following steps are included:
[0119] S201: Obtain a training sample dataset.
[0120] The training sample data includes multiple sample data and the labels corresponding to each sample data, i.e., real traffic. Each sample data contains the analysis data of a sample.
[0121] S202 , initializing the parameters of the top-level gating network, the parameters of the bottom-level gating network, the parameters of each expert network, and the temperature coefficient in the prediction model.
[0122] Optionally, the temperature coefficient τ can be initialized to 1.0, and the final temperature needs to be set accordingly and the decay rate For example, the final temperature can be set to 0.1 to avoid negative numbers, and the decay rate can be set to 0.95. Accordingly, the first iteration number T1 and the second iteration number T2 need to be initialized.
[0123] S203. Using the training sample data set and the temperature coefficient that decays according to the first decay rate, iteratively train the underlying gating network and each expert network in the prediction model until the number of training times in the first stage reaches the first number of iterations or the current task loss converges.
[0124] Among them, the first decay rate decreases continuously with the increase of training times.
[0125] It should be noted that in this embodiment of the present application, the training process is divided into two phases: the first phase is to pre-train the expert network, and the second phase is the joint optimization training of all components. Therefore, in the first phase, the parameters of the top-level gating network are fixed, and the parameters of the bottom-level gating network and the parameters of each expert network are iteratively trained.
[0126] In order to control the parameter convergence speed during the first stage of training and focus on exploring different expert combinations, the temperature coefficient is continuously decayed through the first decay rate so that the temperature coefficient can be decayed at the required rate, thereby controlling the convergence rate of the model parameters through the temperature coefficient.
[0127] S204. Using the training sample data set and the temperature coefficient that decays according to the second decay rate, the expert networks, the bottom gating network and the top gating network in the prediction model are jointly iteratively trained until the number of training times in the second stage reaches the second number of iterations or the current total loss converges.
[0128] After the first stage of training is completed, the various networks of the entire model are jointly iteratively trained, and the second stage of training begins.
[0129] Among them, the second decay rate decreases continuously with the increase of the number of training times, and the second stage needs to focus on the high-return expert network combination, instead of exploring each expert network combination. Therefore, the second decay rate needs to decrease less than the first decay rate.
[0130] Optionally, in another embodiment of the present application, a specific implementation of step S203, that is, the first stage training method of the prediction model, is as follows: Figure 3 Shown, including:
[0131] S301. Input the first phase training sample data in the training sample data set into the prediction model, perform expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyze and obtain the current predicted flow corresponding to the training sample data based on the expert network combination selection result.
[0132] It should be noted that, in the embodiment of the present application, the pseudo code description of the entire training process of the prediction model can be specifically as follows: Figure 4 shown.
[0133] in, Represents the set of parameters of all expert networks and underlying gating networks. Represents the training parameters of the top-level gating network, including the weight matrix, bias term, sparsification module, and temperature coefficient. Represents hyperparameters Use the He initialization method. Hyperparameters Use the Xavier initialization method. The probability distribution vector of the expert combination output by the top gating network. Combine 0-1 vectors for the selected experts output by the top gating network. The traffic prediction value for the next moment output by the underlying gating network based on the specified expert combination is the current predicted traffic. is the gradient optimizer.
[0134] Specifically, in the first stage of training, the top-level gating network is fixed, the combination selection probability is randomly initialized, and only the expert networks and the bottom-level module networks are trained. The specific pseudo-code description of the training process is, for example, Figure 4 As shown in the contents of lines 6-15 in the , the expert combination is randomly selected by uniform distribution (i.e. Figure 4 9) forces the underlying gating network to learn a universal fusion strategy across combinations.
[0135] Therefore, during the first phase of training, a batch of training sample data is randomly sampled from the training sample dataset as the first phase training samples, and then input into the prediction model in sequence. The prediction model calculates the selection probability of each expert network combination based on the training sample data and the current temperature coefficient. Specifically, it can be expressed as:
[0136]
[0137] in, is the weight matrix of the top-level gating network; and is the eigenvector of the input sample data; τ is the current temperature coefficient. Therefore, the temperature coefficient can be used to control the smoothness of the probability distribution. Therefore, increasing the temperature coefficient can effectively consider various probabilities and increase exploratory power.
[0138] Based on this probability, we can then sample combinations using the Gumbel-Max technique, selecting expert network combinations and achieving differentiable hard selection. The underlying gating network then assigns weights to the selected expert network combinations and loads them for traffic prediction. Finally, the predicted traffic for the selected expert network combinations is weighted using the assigned weights to obtain the current predicted traffic corresponding to the training sample data.
[0139] S302: Calculate the current task loss based on the current predicted traffic and the actual predicted traffic corresponding to the training sample data.
[0140] Optionally, the current predicted flow can be calculated by cross entropy etc. and actual predicted traffic , get the current task loss, that is, calculate .
[0141] S303: Update the parameters of the underlying gating network and the parameters of each expert network based on the current task loss.
[0142] It should be noted that, since the top-level gating network needs to be fixed in the first stage, only the parameters of the bottom-level gating network and the parameters of each expert network are updated, i.e. Figure 4 The parameters of each expert network are determined according to the type of each expert network, while the parameters of the underlying gating network are its weight matrix and bias term.
[0143] Optionally, the Adam optimizer can be used for updating.
[0144] S304: Decay the temperature coefficient according to the current first decay rate.
[0145] Among them, the first decay rate decreases continuously with the increase of training times.
[0146] Specifically, considering that the temperature coefficient cannot be less than the final temperature, the attenuation of the temperature system in the first stage can be expressed as:
[0147]
[0148] in, is the final temperature; is the attenuation coefficient; t is the current iteration number; T1 is the first iteration number.
[0149] S305: Determine whether the current number of iterations in the first stage is greater than the first number of iterations.
[0150] If it is determined that the current number of iterations in the first stage is not greater than the first number of iterations, the process returns to step S301. If it is determined that the current number of iterations in the first stage is greater than the first number of iterations, the process proceeds to step S306 to enter the second stage of training.
[0151] S306: End the first stage training of the prediction model.
[0152] Accordingly, in another embodiment of the present application, a specific implementation of step S204, that is, the second stage training method of the prediction model, is as follows: Figure 5 Shown, including:
[0153] S501. Input the second-stage training sample data in the training sample data set into the prediction model, perform expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyze and obtain the current predicted flow corresponding to the training sample data based on the expert network combination selection result.
[0154] Similarly, a batch of training sample data is randomly sampled from the training sample data set as the training sample for the second stage. It should be noted that the process of predicting traffic through the prediction model is consistent with step S203, so the number of times is not repeated.
[0155] S502: Calculate the current total loss based on the current predicted traffic and the actual predicted traffic corresponding to the training sample data.
[0156] It should be noted that the top-level gating network is unfrozen at this time and its parameters need to be updated, so the combined entropy regularization term is introduced in the loss. Among them, p k is the selection probability of expert combination k, λ is the weight coefficient), is the L2 regularization coefficient, which prevents the coarse-grained gating from converging to a single combination too early. Therefore, the loss function during the entire training process is:
[0157]
[0158] in, is the mean square error loss (MSE) of the prediction task, is the combined distribution entropy regularization term.
[0159] S503: Jointly update the parameters of each expert network, the parameters of the bottom gating network, and the parameters of the top gating network based on the current total loss.
[0160] S504: Decay the temperature coefficient according to the current second attenuation rate.
[0161] Among them, the second decay rate decreases continuously with the increase of the number of training times, and the decrease is smaller than the first decay rate.
[0162] Specifically, the temperature update formula for the second stage is:
[0163]
[0164] S505: Determine whether the current number of iterations in the second stage is greater than the second number of iterations.
[0165] If the current number of iterations in the second phase is not greater than the second number of iterations, step S501 is executed. If the current number of iterations in the second phase is not greater than the second number of iterations, the current training is completed, so step S506 is executed and the next round of training can be performed.
[0166] S506: End this round of training.
[0167] S103: The top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content, and outputs a selection result vector.
[0168] Each expert network combination includes multiple combinations of expert networks in the prediction model. Each expert network can be configured as needed. For example, a TCN temporal convolutional network, an LSTM long short-term memory network, and a Transformer network can be configured. Alternatively, all combinations of expert networks can be included. For example, as shown in Table 1, with three expert networks configured, there are four expert networks in total. Of course, depending on the actual situation, only the expert network combinations that will be used can be included.
[0169] Table 1
[0170]
[0171] Optionally, in another embodiment of the present application, a specific implementation of step S103 is as follows: Figure 6 As shown, the following steps are included:
[0172] S601: The top-level gating network in the prediction model performs a linear transformation on the feature vector of the analysis data of the target content.
[0173] S602: Multiply the feature vector of the analysis data of the target content after the linear transformation by the top-level gating weight matrix, and add the top-level gating bias term to obtain the top-level hidden feature vector.
[0174] So specifically, the top-level hidden feature vector is calculated as follows:
[0175]
[0176] in, is the input feature vector, is the top-level gating weight matrix, is the gate bias term, is the output of the hidden unit of this layer, and k is the number of preset expert combinations.
[0177] S603: Perform one-hot encoding on the top-level hidden feature vector to obtain a selection result vector.
[0178] In order to better represent the selected expert network combination, the top-level hidden feature vector is one-hot encoded, so that only the value corresponding to the selected expert network combination in the selection result vector is 1, and the rest of the values are 0.
[0179] However, considering that multiple potential expert combinations need to be explored during training, the output of the top-level gating network is:
[0180]
[0181] Among them, the output The function of is to activate a selected expert combination: multiple potential expert combinations are explored during training, and only the selected expert combination is activated during inference. The experts in the remaining combinations are not involved in the next step of the calculation to improve inference speed. For example, the output during the training phase is (0.05, 0.8, 0.06, 0.09), while during the inference phase, the output of the specific prediction process is (0, 1, 0, 0).
[0182] S104: The underlying gating network in the prediction model analyzes the current weights of the respective expert networks in the target expert network combination based on the analysis data of the target content and the concatenation result of the selection result vector.
[0183] Among them, the target expert network combination is the selection result vector representing the currently selected expert network combination.
[0184] It should be noted that the underlying gating network needs to assign weights based on the input analysis data of the target content. In order to focus on analyzing only the selected target expert network combination, the selection result vector is spliced onto the feature vector of the target content analysis data input into the prediction model. The underlying gating network then analyzes the spliced vector to determine the current weights of each expert network in the target expert network combination.
[0185] Optionally, the selection result vector output by the top-level gating network can be It is concatenated with the feature vector x of the target content’s analysis data to generate a fine-grained feature vector:
[0186]
[0187] Therefore, the output of the top-level gating network can provide the bottom-level gating network with the contextual information of the expert network combination, so that the bottom-level gating network pays more attention to the characteristics of the selected expert network combination.
[0188] After feature concatenation, the output of this unit is calculated:
[0189]
[0190] Finally, the output of the underlying gating network is calculated:
[0191]
[0192] in, is the input feature vector; is the underlying gating weight matrix; n is the number of experts; is the bottom-level gating bias term. The bottom-level gating network uses the Softmax formula to output the final fusion prediction result of n expert networks. The sum of the weights of n expert networks is 1.
[0193] S105 , fusing the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content according to the current weight of each expert network to obtain the current traffic prediction result of the target content.
[0194] Optionally, in another embodiment of the present application, a specific implementation of step S105 is as follows: Figure 7 As shown, the following steps are included:
[0195] S701: Load the target expert network combination.
[0196] It should be noted that existing hybrid expert models require all experts to be loaded into memory during inference, which results in high memory usage and low computational efficiency. This makes it difficult to meet real-time requirements, especially in resource-constrained scenarios such as edge devices. Therefore, in the embodiments of this application, dynamic loading is implemented, and only the selected target expert network combination is loaded.
[0197] S702 : Predicting the flow information of the target content based on the analysis data of the target content through each expert network in the target expert network combination.
[0198] S703: The traffic information of the target content predicted by each expert network is weighted by using the current weight of each expert network to obtain a current traffic prediction result of the target content.
[0199] Therefore, in the embodiment of the present application, each expert network in the target expert network combination is first loaded, and each expert network in the target expert network combination is used to perform corresponding traffic prediction based on the analysis data of the target content, thereby outputting the corresponding prediction results. The predicted traffic information is then weighted with its corresponding current weight to obtain the current traffic prediction result of the target content. Therefore, the final output of the prediction model is:
[0200]
[0201] in, is the predicted output of the i-th expert network for input x. Constraints: Only when E i Belong to the selected combination, is the weight of the i-th expert in the selected e-th expert network combination, satisfying For example, at stable traffic moments, the final prediction value output by the expert network model of this application = 0.3 × LSTM network output + 0.7 × TCN network output, while at peak times, the final prediction value output by the expert network model = 0.5 × LSTM network output + 0.5 × Transformer network output. In the New Year's Eve Gala live broadcast, the hierarchical gating network may favor the TCN+LSTM expert network combination (predicting sudden traffic increases) at the beginning, the TCN+Transformer expert network combination (combining the influence of social topics) during the halftime performance, and the single LSTM expert network (predicting traffic attenuation trends) at the end.
[0202] Optionally, in another embodiment of the present application, a specific implementation of step S701 is as follows: Figure 8 As shown, the following steps are included:
[0203] S801: Determine whether the target expert network combination is stored in the cache pool.
[0204] It should be noted that in this embodiment of the present application, frequently used expert network combinations are stored in memory, and expert network combinations that may be selected are also pre-stored in memory. Therefore, it is necessary to first determine whether the target expert network combination is stored in the cache pool. If the target expert network combination is stored in the cache pool, that is, the cache hits the target expert network combination, then step S602 is executed. If it is determined that the target expert network combination is not stored in the cache pool, that is, the cache misses the cache pool, then step S603 is executed.
[0205] Optionally, in another embodiment of the present application, a storage method for each expert network combination is provided. The expert combination cache pool in the memory is maintained, and experts are loaded / released according to the strategy. The cache pool is composed of a bidirectional queue. Implementation: Insertion and deletion of cache can be implemented with O(1) time complexity. The cache pool can be divided into three levels according to read latency. The details are shown in Table 2 below:
[0206] Table 2
[0207]
[0208] Optionally, the expert network combination can be migrated between different levels of the cache based on frequency of use:
[0209] When the ratio of the access frequency to the size of any expert network combination in the hard disk and system memory in the cache pool exceeds the current upgrade threshold corresponding to the storage tier, the expert network combination is promoted to a higher storage tier for storage. When the non-access time of any expert network combination in the video memory and system memory exceeds the preset time threshold, the expert network combination is demoted to a lower storage tier for storage.
[0210] The previous storage tier for hard drives is system content. The previous storage tier for system memory is the video memory in the cache pool. The current upgrade threshold for a storage tier is determined by the current free space in the storage tier.
[0211] Therefore, the upgrade and migration process is as follows: when the combination of L2 / L3 meets the following conditions, the level is upgraded:
[0212]
[0213] in, Dynamically adjust according to the remaining space of the current level.
[0214] Downgrade migration: Downgrade the level when the L1 / L2 combination meets the following conditions:
[0215]
[0216] in, Set up separately for L1 and L2.
[0217] S802: Move the identifier of the target expert network combination to the end of the cache queue.
[0218] In this embodiment of the application, when the cache pool is full, the expert network combination that has not been accessed for the longest time will be prioritized. Each expert network combination will be placed in the cache queue when it is accessed. Therefore, when the target expert network combination is accessed again, its ranking position needs to be updated. That is, since it is the most recently accessed expert network combination, its identifier is moved to the end of the cache queue.
[0219] S803: Determine whether the buffer pool is full.
[0220] If the buffer pool is full, step S804 must be executed first, and then step S805. If the buffer pool is not full, step S805 is executed directly.
[0221] S804: Remove the expert network combination at the head of the cache queue from the cache pool, and remove its identifier from the cache queue.
[0222] S805 , loading the target expert network from the hard disk into the cache pool, and adding the identifier of the target expert network to the end of the cache queue.
[0223] More specifically, the pseudo code for dynamic loading provided in the embodiment of the present application is as follows: Figure 9 As shown. Among them, Figure 9 The meanings of the operators in are as follows:
[0224] : Delete the ID of the hit expert network combination from the current position of the queue, breaking the original order to facilitate adjusting its order.
[0225] : Insert the ID of the selected expert network combination to the end of the queue and mark it as recently used.
[0226] : Remove and return the head element of the queue, that is, remove the ID of the expert network combination that has not been used for the longest time.
[0227] : Use the elimination strategy to remove the expert combination ID from the hierarchical cache. The elimination strategy is as follows:
[0228]
[0229] in, The current amount of memory used; is the total amount of memory; The policy switching threshold is usually 0.8 by default.
[0230] Asynchronous threads load candidate expert combinations, managed by a separate thread pool (default 4 threads). Non-blocking I / O operations combined with np.mmap memory mapping technology preload the priority queue (sorted by probability prediction value). This operator parallelizes computation and I / O, hiding loading latency within the computation process and significantly improving system throughput.
[0231] : Use the weighted fusion algorithm of the real-time probability of the expert combination generated by the top-level gating network and the historical pattern to predict the expert combination to be loaded at the next moment and realize preloading.
[0232] Therefore, the dynamic loading of expert combinations based on ONNX Runtime is implemented. First initialize the environment, that is, initialize the ONNX Runtime environment ( ). Create an empty cache (cache) and an LRU queue (lru_queue). Load the expert combination metadata file (JSON format) and record the storage path and configuration of each combination. Calculate the expert network combination corresponding to the input data through the top-level gating network, and obtain the ID of the target expert network combination ( ), the process cache check begins.
[0233] When a miss occurs ( ), that is, if the target expert network combination is not cached, the model path is obtained from the metadata, the model file is loaded, and the ONNX model byte stream is read from the storage system. Session options are configured, such as the number of parallel threads. Then, a session object is created using ONNX Runtime. If the cache is full, the least recently used combination at the head of the queue is removed to release its session resources. The new session is then added to the cache and its GID is recorded at the end of the LRU queue.
[0234] When hit ( ), that is, when the target expert network combination is cached, the gid can be directly moved to the end of the queue and marked as recently used.
[0235] After the target expert network is loaded into the content, its parameter information can be loaded for prediction, and the predicted traffic can be weighted to obtain the final predicted traffic. Specifically, the input data x is converted to the Tensor format supported by ONNX Runtime, and the Execute inference and obtain output results .
[0236] And, as Figure 9 As shown, in order to quickly load the expert network combination, in another embodiment of the present application, asynchronous preloading is further performed, that is, asynchronous preloading of the possibly selected expert network combination.
[0237] Optionally, in another embodiment of the present application, an asynchronous preloading method is improved, such as Figure 10 As shown, the following steps are included:
[0238] S1001. Obtain selection probability distribution information of each current expert network combination.
[0239] It should be noted that when the top-level gating network selects the expert network combination, it will obtain the probability distribution of each expert network combination. . Where k is the total number of combinations.
[0240] S1002. Remove the target expert network combination from the obtained selection probability distribution information distribution.
[0241] Since the target expert network combination is the currently selected combination, it will be loaded and therefore does not need to be preloaded, so it is excluded.
[0242] Optionally, in the embodiment of the present application, a combination prediction is performed based on both the gating network probability and the historical selection sequence for preloading. However, one of the methods can also be used alone. So if the expert combination prediction to be loaded is performed based only on the gating network probability, the probabilities in the probability distribution information can be sorted in descending order, and then the top W combinations with the highest probabilities are selected as candidates. Specifically:
[0243]
[0244] S1003 : Based on each selected expert network combination within a preset time range, a transfer matrix from the target expert network combination to the remaining expert network combinations is obtained.
[0245] Specifically, the prediction of the expert combination of the next time step based on the transition probability of the historical selection expert combination sequence is mainly achieved by maintaining the expert combination transition probability matrix of the past time window. The transition probability matrix maintains the historical sequence through a sliding window and dynamically updates the transition frequency between album combinations. Specifically, the historical cache area is maintained, that is, the expert combination selection sequence of the last L time steps is recorded. .
[0246] The frequency of combinations following combination gid in the history is then counted to generate a transition probability matrix T∈R^(K×K), where T_(i,j) represents the probability of transitioning from combination i to j. This probability matrix is then used to select candidate combinations. Specifically, the corresponding row vector T[gid,:] in the transition matrix T is searched for based on the current gid, and the top W combinations are selected in descending order of transition probability.
[0247] S1004: Weight the probabilities of each expert network combination in the probability distribution information and the transition mean respectively to obtain a comprehensive score of each expert network combination.
[0248] In the embodiment of the present application, the above two methods are mixed for prediction, so the probabilities of the two methods are weighted to generate a comprehensive score:
[0249]
[0250] Among them, α∈[0,1] is the weight coefficient. In this section, the value of a is determined to be a=0.7 through hyperparameter grid search.
[0251] S1005: Select and preload expert network combinations ranked in the top N by comprehensive scores into a cache pool.
[0252] Therefore, the method provided in this application adjusts the weights of the expert network based on the dynamics of the number of viewers for different programs and broadcast periods, enabling the model to better adapt to different data sets and scenarios, thereby enhancing the model's generalization capabilities. Furthermore, the heterogeneous hybrid expert network (MoE) uses multiple expert networks to model different characteristics of traffic data, enabling it to more comprehensively capture the complex variations in TV program traffic, thereby improving prediction accuracy.
[0253] To verify the effectiveness of this application, an evaluation was conducted on a scenario where the number of online viewers every 5 minutes of five S-level live broadcasts on an online video website was predicted 24 hours in advance of each broadcast. As shown in Tables 3 and 4 below, the prediction accuracy index (mean absolute percentage error, MAPE) of the hierarchical gating MoE network of this application is improved by 13.8% relative to the existing single-layer MoE model. At the same time, the hierarchical gating unit can effectively reduce the computational load (MFLOPs) consumption by 32% compared to the single-layer gating unit, and the peak memory usage is reduced by up to 70% compared to the full expert MoE model.
[0254] Table 3
[0255]
[0256] Table 4
[0257]
[0258] The embodiment of the present application provides a content traffic prediction method, which obtains the analysis data of the target content and inputs the analysis data of the target content into a pre-trained prediction model. The top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content and outputs a selection result vector. Among them, each expert network combination includes multiple combinations composed of each expert network in the prediction model. Then, the bottom-level gating network in the prediction model analyzes the current weights of each expert network in the target expert network combination based on the analysis data of the target content and the splicing result of the selection result vector. Among them, the target expert network combination is the currently selected expert network combination represented by the selection result vector. Finally, the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content is fused according to the current weights of each expert network to obtain the current traffic prediction result of the target content. Therefore, by selecting a network combination that meets the situation for prediction according to different program situations, and by introducing a temperature coefficient to ensure the accuracy of each network in the model, the accuracy of the prediction result is effectively guaranteed. In addition, the expert network combination is first selected through the top-level gating network, and then weights are assigned only to the networks in the selected expert network combination through the bottom-level gating network. Finally, the selected expert network is dynamically loaded for prediction and the prediction results are fused. There is no need to load all the expert networks and analyze all the expert networks, which can effectively reduce the complexity of the analysis process, reduce resource consumption, and effectively improve prediction efficiency.
[0259] Another embodiment of the present application provides a content flow prediction system, such as Figure 11 Shown, including:
[0260] The data acquisition unit 1101 is configured to acquire analysis data of the target content.
[0261] The input unit 1102 is used to input the analysis data of the target content into the pre-trained prediction model.
[0262] The combination selection unit 1103 is configured to perform expert network combination selection analysis based on the analysis data of the target content through the top-level gating network in the prediction model, and output a selection result vector. Each expert network combination includes multiple combinations of each expert network in the prediction model.
[0263] The weight analysis unit 1104 is configured to analyze the current weights of each expert network in the target expert network combination, which is the currently selected expert network combination represented by the selection result vector, using the underlying gating network in the prediction model based on the analysis data of the target content and the concatenation of the selection result vector.
[0264] The fusion prediction unit 1105 is used to fuse the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content according to the current weight of each expert network to obtain the current traffic prediction result of the target content.
[0265] Optionally, in a content flow prediction system according to another embodiment of the present application, the combination selection unit includes:
[0266] The transformation unit is used to linearly transform the feature vector of the analysis data of the target content through the top-level gating network in the prediction model.
[0267] The vector calculation unit is used to multiply the feature vector of the analysis data of the target content after linear transformation by the top-level gating weight matrix, and add the top-level gating bias term to obtain the top-level hidden feature vector.
[0268] The encoding unit is used to perform one-hot encoding on the top-level hidden feature vector to obtain the selection result vector.
[0269] Optionally, in another embodiment of the content flow prediction system of the present application, the system further includes:
[0270] The sample acquisition unit is used to obtain a training sample data set.
[0271] The initialization unit is used to initialize the parameters of the top-level gating network, the parameters of the bottom-level gating network, the parameters of each expert network, and the temperature coefficient in the prediction model.
[0272] The first-stage training unit is used to iteratively train the underlying gating network and each expert network in the prediction model using the training sample dataset and a temperature coefficient that decays at a first decay rate until the first-stage training reaches the first number of iterations or the current task loss converges. The first decay rate decreases with increasing training times.
[0273] The second-stage training unit is configured to jointly iteratively train the expert networks, bottom-level gating networks, and top-level gating networks in the prediction model using the training sample dataset and a temperature coefficient attenuated at a second attenuation rate until the second-stage training reaches the second number of iterations or the current total loss converges. The second attenuation rate decreases with increasing training times, and the magnitude of the decrease is smaller than that of the first attenuation rate.
[0274] Optionally, in the content flow prediction system of another embodiment of the present application, the first-stage training unit includes:
[0275] The first input unit is used to input the training sample data of the first stage in the training sample data set into the prediction model, perform expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyze and obtain the current predicted flow corresponding to the training sample data based on the expert network combination selection result.
[0276] The first loss calculation unit is used to calculate the current task loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data.
[0277] The first updating unit is used to update the parameters of the underlying gating network and the parameters of each expert network based on the current task loss.
[0278] The first attenuation unit is used to attenuate the temperature coefficient according to the current first attenuation rate and return it to the first input unit until the number of training times in the first stage reaches the first number of iterations or the current task loss converges.
[0279] Optionally, in the content flow prediction system of another embodiment of the present application, the second-stage training unit includes:
[0280] The second input unit is used to input the second stage training sample data in the training sample data set into the prediction model, perform expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyze and obtain the current predicted flow corresponding to the training sample data based on the expert network combination selection result.
[0281] The second loss calculation unit is used to calculate the current total loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data.
[0282] The second updating unit is used to jointly update the parameters of each expert network, the parameters of the bottom gating network, and the parameters of the top gating network based on the current total loss.
[0283] The second attenuation unit is used to attenuate the temperature coefficient according to the current second attenuation rate and return it to the second input unit until the number of training times in the second stage reaches the second number of iterations or the current total loss converges.
[0284] Optionally, in a content flow prediction system of another embodiment of the present application, the fusion prediction unit includes:
[0285] The loading unit is used to load the target expert network combination.
[0286] The prediction unit is used to predict the traffic information of the target content based on the analysis data of the target content through each expert network in the target expert network combination.
[0287] The weighting unit is used to weight the traffic information of the target content predicted by each expert network using the current weight of each expert network to obtain the current traffic prediction result of the target content.
[0288] Optionally, in a content flow prediction system according to another embodiment of the present application, the loading unit includes:
[0289] The first judging unit is configured to judge whether the target expert network combination is stored in the cache pool.
[0290] The moving unit is used to move the identifier of the target expert network combination to the end of the cache queue when the target expert network combination is stored in the cache pool.
[0291] The second judging unit is configured to judge whether the cache pool is full when it is judged that the target expert network combination is not stored in the cache pool.
[0292] The combination removing unit is used to remove the expert network combination at the head of the cache queue from the cache pool and remove its identifier from the cache queue when the cache pool is full.
[0293] The adding unit is used to load the target expert network from the hard disk into the cache pool and add the identifier of the target expert network to the end of the cache queue.
[0294] Optionally, in another embodiment of the content flow prediction system of the present application, the system further includes:
[0295] The upgrade unit is configured to upgrade any expert network combination to a higher storage tier for storage when the ratio of its access frequency to its size on the hard disk or in the system memory in the cache pool exceeds the current upgrade threshold corresponding to the storage tier. The previous storage tier for the hard disk is the system content. The previous storage tier for the system memory is the video memory in the cache pool. The current upgrade threshold for a storage tier is determined based on the current free space in the storage tier.
[0296] The demotion unit is configured to degrade the expert network combination to a lower storage level for storage when the non-access time of any expert network combination in the video memory and the system memory is greater than a preset time threshold.
[0297] Optionally, in another embodiment of the content flow prediction system of the present application, the system further includes:
[0298] The distribution information acquisition unit is used to obtain the selection probability distribution information of each current expert network combination.
[0299] The probability removal unit is used to remove the target expert network combination from the obtained selection probability distribution information distribution.
[0300] The matrix acquisition unit is used to acquire the transfer matrix from the target expert network combination to the remaining expert network combinations based on the selected expert network combinations within a preset time range.
[0301] The scoring unit is used to weight the probabilities of each expert network combination in the probability distribution information and the transfer mean respectively to obtain a comprehensive score of each expert network combination.
[0302] The preloading unit is used to select the expert network combinations ranked in the top N by comprehensive scores and preload them into the cache pool.
[0303] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, and will not be repeated here.
[0304] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0305] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A content flow prediction method, characterized in that: include: Obtain analytical data for target content; Inputting the analysis data of the target content into a pre-trained prediction model; The top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content, and outputs a selection result vector; wherein each of the expert network combinations includes multiple combinations of the expert networks in the prediction model; The underlying gating network in the prediction model analyzes the current weights of the expert networks in the target expert network combination based on the analysis data of the target content and the splicing result of the selection result vector; wherein the target expert network combination is the currently selected expert network combination represented by the selection result vector; The traffic information predicted by each of the expert networks in the target expert network combination based on the analysis data of the target content is fused according to the current weight of each expert network to obtain a current traffic prediction result of the target content.
2. The method according to claim 1, characterized in that The top-level gating network in the prediction model performs expert network combination selection analysis based on the analysis data of the target content and outputs a selection result vector, including: The top-level gating network in the prediction model linearly transforms the feature vector of the analysis data of the target content; Multiplying the linearly transformed feature vector of the analysis data of the target content by the top-level gating weight matrix and adding the top-level gating bias term to obtain a top-level hidden feature vector; The top-level hidden feature vector is one-hot encoded to obtain the selection result vector.
3. The method according to claim 1, characterized in that The training method of the prediction model includes: Obtain training sample dataset; Initializing the parameters of the top-level gating network, the parameters of the bottom-level gating network, the parameters of each of the expert networks, and the temperature coefficient in the prediction model; Iteratively training the underlying gating network and each of the expert networks in the prediction model using the training sample data set and the temperature coefficient attenuated according to a first attenuation rate until the number of training times in the first stage reaches a first number of iterations or the current task loss converges; wherein the first attenuation rate continuously decreases with an increase in the number of training times; Using the training sample data set and the temperature coefficient that decays according to the second decay rate, each of the expert networks, the bottom gating network and the top gating network in the prediction model is jointly iteratively trained until the number of training times in the second stage reaches the second number of iterations or the current total loss converges; wherein the second decay rate continuously decreases with the increase in the number of training times, and the decrease is smaller than the first decay rate.
4. The method according to claim 3, characterized in that The iterative training of the parameters of the underlying gating network and each of the expert networks in the prediction model using the training sample data set and the temperature coefficient attenuated according to the first attenuation rate includes: Inputting the first phase of training sample data in the training sample data set into the prediction model, performing expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyzing and obtaining the current predicted flow corresponding to the training sample data based on the expert network combination selection result; Calculating the current task loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data; Updating the parameters of the underlying gating network and the parameters of each of the expert networks based on the current task loss; The temperature coefficient is decayed according to the current first decay rate, and the process of inputting the first stage training sample data in the training sample data set into the prediction model is returned to execution until the number of training times of the first stage reaches the first number of iterations or the current task loss converges.
5. The method according to claim 3, characterized in that The method of performing joint iterative training on each of the expert networks, the bottom gating network, and the top gating network in the prediction model using the training sample data set and the temperature coefficient attenuated according to the second attenuation rate includes: Inputting the training sample data of the second phase in the training sample data set into the prediction model, performing expert network combination selection probability analysis based on the training sample data and the current temperature coefficient, and analyzing and obtaining the current predicted flow corresponding to the training sample data based on the expert network combination selection result; Calculating the current total loss based on the current predicted flow and the actual predicted flow corresponding to the training sample data; Jointly updating the parameters of each of the expert networks, the parameters of the bottom gating network, and the parameters of the top gating network based on the current total loss; The temperature coefficient is decayed according to the current second decay rate, and the process of inputting the training sample data of the second stage in the training sample data set into the prediction model is returned to execution until the number of training times of the second stage reaches the second number of iterations or the current total loss converges.
6. The method according to claim 1, characterized in that The step of fusing the traffic information predicted by each of the expert networks in the target expert network combination based on the analysis data of the target content according to the current weight of each expert network to obtain the current traffic prediction result of the target content includes: Loading the target expert network combination; Predicting the traffic information of the target content based on the analysis data of the target content by using each of the expert networks in the target expert network combination; The flow information of the target content predicted by each of the expert networks is weighted using the current weight of each of the expert networks to obtain a current flow prediction result of the target content.
7. The method according to claim 6, characterized in that The loading of the target expert network combination includes: Determining whether the target expert network combination is stored in a cache pool; If the target expert network combination is stored in the cache pool, the identifier of the target expert network combination is moved to the end of the cache queue; If it is determined that the target expert network combination is not stored in the cache pool, determining whether the cache pool is full; If the cache pool is full, removing the expert network combination at the head of the cache queue from the cache pool, and removing its identifier from the cache queue; The target expert network is loaded from the hard disk into the cache pool, and the identifier of the target expert network is added to the end of the cache queue.
8. The method according to claim 7, characterized in that Also includes: When the ratio of the access frequency to the size of any one of the expert network combinations in the hard disk and the system memory in the cache pool is greater than the current upgrade threshold corresponding to the storage layer, the expert network combination is promoted to a storage layer for storage; wherein the previous storage layer of the hard disk is the system content; the previous storage layer of the system memory is the video memory in the cache pool; the current upgrade threshold corresponding to one of the storage layers is determined according to the current remaining space of the storage layer; When the non-access time of any one of the expert network combinations in the video memory and the system memory is greater than a preset time threshold, the expert network combination is lowered to a storage level for storage.
9. The method according to claim 7, characterized in that Also includes: Obtaining selection probability distribution information of each current expert network combination; removing the target expert network combination from the obtained selection probability distribution information distribution; Based on each of the selected expert network combinations within a preset time range, obtaining a transfer matrix from the target expert network combination to the remaining expert network combinations; respectively weighting the probabilities of the expert network combinations in the probability distribution information and the transfer mean to obtain a comprehensive score for each expert network combination; The expert network combinations ranked in the top N positions by comprehensive scores are selected and preloaded into the cache pool.
10. A content traffic prediction system, characterized in that: include: A data acquisition unit, configured to acquire analysis data of target content; An input unit, configured to input the analysis data of the target content into a pre-trained prediction model; a combination selection unit, configured to perform expert network combination selection analysis based on the analysis data of the target content through the top-level gating network in the prediction model, and output a selection result vector; wherein each of the expert network combinations includes multiple combinations of the expert networks in the prediction model; a weight analysis unit, configured to analyze the current weights of the respective expert networks in the target expert network combination based on the analysis data of the target content and the concatenation result of the selection result vector through the underlying gating network in the prediction model; wherein the target expert network combination is the currently selected expert network combination represented by the selection result vector; The fusion prediction unit is used to fuse the traffic information predicted by each expert network in the target expert network combination based on the analysis data of the target content according to the current weight of each expert network to obtain the current traffic prediction result of the target content.
Citation Information
Patent Citations
Attention neural network with conditional calculations
CN115516461A
MOE network-based model distillation method, question and answer method, equipment and medium
CN118820449A
Hybrid expert model with sparse weights
CN118871923A
Multi-modal disease prediction method and system based on gating network
CN119181488A
A multi-parameter environmental quality intelligent monitoring system and control method thereof
CN119756489A