Model construction method
By automatically designing temporal neural networks using self-distillation technology and robust differentiable network structure search, the problems of high resource consumption and poor stability in traditional methods are solved, and efficient event sequence prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-07-06
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, constructing temporal neural network structures requires a large amount of human and computational resources, and traditional network structure search methods have poor stability, making it difficult to achieve excellent results in time series prediction tasks.
A network structure search method is used to automatically design temporal neural networks. The robust differentiable network structure search method with self-distillation technology is used to improve search stability through self-distillation mechanism and auxiliary classifier. The activation function and connection mode are automatically selected to construct the target temporal neural network.
It reduces the resource consumption of manually designing neural network structures, improves the stability and prediction performance of network structure search, and ensures better results in event sequence prediction tasks.
Smart Images

Figure CN115238775B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a model building method. Background Technology
[0002] With the development and popularization of cloud computing and big data, more and more computing devices and services are hosted on cloud servers. The number of computing and service requests received by the cloud has increased significantly, which has also brought greater difficulties and challenges to the scheduling and maintenance of cloud servers. Based on this, existing technologies, considering the temporal regularity of server requests, can use temporal neural networks constructed using temporal modeling analysis methods to predict and analyze the requests that the cloud will receive in advance, thus providing early warnings. However, manually designing neural network structures requires a large amount of human and computing resources. Therefore, how to reduce the large amount of human and computing resources consumed in constructing neural network structures has become an urgent problem to be solved. Summary of the Invention
[0003] In view of the above, embodiments of this specification provide a model building method. One or more embodiments of this specification also relate to a model training method, a resource processing method, a model building apparatus, a model training apparatus, a resource processing apparatus, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.
[0004] According to a first aspect of the embodiments of this specification, a model construction method is provided, comprising:
[0005] Determine the initial prediction model and the corresponding training samples and sample labels, wherein the training samples are historical event sequences and the sample labels are the event types of the historical event sequences;
[0006] Identify at least two network structural units in the initial prediction model, and a first type of connection edge connecting each network structural unit to other network structural units;
[0007] Based on the training samples and the sample labels, determine the initial loss function for each network structural unit;
[0008] The target loss function of the initial prediction model is determined based on the initial loss function, and the weight information of the first type of connection edge is determined based on the target loss function;
[0009] The initial prediction model is adjusted based on the weight information to obtain the target prediction model.
[0010] According to a second aspect of the embodiments of this specification, a model building apparatus is provided, comprising:
[0011] The first determining module is configured to determine an initial prediction model and the training samples and sample labels corresponding to the initial prediction model, wherein the training samples are historical event sequences and the sample labels are the event types of the historical event sequences;
[0012] The second determining module is configured to determine at least two network structural units in the initial prediction model, and a first type of connection edge connecting each network structural unit to other network structural units.
[0013] The function determination module is configured to determine the initial loss function for each network structural unit based on the training samples and the sample labels;
[0014] The weight determination module is configured to determine the target loss function of the initial prediction model based on the initial loss function, and to determine the weight information of the first type of connection edge based on the target loss function;
[0015] The model adjustment module is configured to adjust the initial prediction model based on the weight information to obtain the target prediction model.
[0016] According to a third aspect of the embodiments of this specification, a model training method is provided, comprising:
[0017] The training samples and sample labels of the target prediction model are determined, wherein the target prediction model is the target prediction model determined by the model construction method described above.
[0018] Based on the training samples and the sample labels, the target prediction model is trained until the training stops, thus obtaining a completed target prediction model.
[0019] According to a fourth aspect of the embodiments of this specification, a model training apparatus is provided, comprising:
[0020] The determination module is configured to determine the training samples and sample labels of the target prediction model, wherein the target prediction model is the target prediction model determined by the model construction method described above.
[0021] The training module is configured to train the target prediction model based on the training samples and the sample labels until the training stops, thereby obtaining the trained target prediction model.
[0022] According to a fifth aspect of the embodiments of this specification, a resource processing method is provided, applied to a server, comprising:
[0023] Determine the event sequence of the server, wherein the event sequence is determined based on pending requests received by the server;
[0024] Select a local event sequence within a target time range from the event sequence, wherein the target time range is determined based on the current time;
[0025] The local time series is predicted using the trained target prediction model to obtain the prediction result, wherein the trained target prediction model is the target prediction model trained in the above model training method.
[0026] Determine the event processing resource parameters corresponding to the prediction result, and adjust the current event processing resources of the server based on the event processing resource parameters to obtain the event processing resources corresponding to the prediction result.
[0027] According to a sixth aspect of the embodiments of this specification, a resource processing apparatus is provided, applied to a server, comprising:
[0028] The determination module is configured to determine a sequence of events for the server, wherein the sequence of events is determined based on pending requests received by the server.
[0029] The selection module is configured to select a local event sequence within a target time range from the event sequence, wherein the target time range is determined based on the current time;
[0030] The prediction module is configured to use the trained target prediction model to predict the local time series and obtain the prediction result, wherein the trained target prediction model is the target prediction model trained in the above model training method.
[0031] The resource adjustment module is configured to determine the event processing resource parameters corresponding to the prediction result, and adjust the current event processing resources of the server based on the event processing resource parameters to obtain the event processing resources corresponding to the prediction result.
[0032] According to a seventh aspect of the embodiments of this specification, a computing device is provided, comprising:
[0033] Memory and processor;
[0034] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the model building method, the model training method, or the resource processing method.
[0035] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the model building method, the model training method, or the resource processing method.
[0036] According to a ninth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the model building method, the model training method, or the resource processing method.
[0037] The model construction method provided in this specification includes: determining an initial prediction model and corresponding training samples and sample labels, wherein the training samples are historical event sequences and the sample labels are event types of the historical event sequences; determining at least two network structural units in the initial prediction model, and a first type of connection edge connecting each network structural unit to other network structural units; determining an initial loss function for each network structural unit based on the training samples and the sample labels; determining a target loss function for the initial prediction model based on the initial loss function, and determining the weight information of the first type of connection edge based on the target loss function; and adjusting the initial prediction model based on the weight information to obtain a target prediction model.
[0038] Specifically, this method uses training samples and sample labels to determine an initial prediction model containing at least two network structural units and a first type of connection edge connecting each network structural unit, as well as the target loss function corresponding to the initial prediction model. Then, based on the target loss function, the weight information of the first type of connection edge is determined, and the initial prediction model is automatically adjusted based on the weight information to complete the construction of the target prediction model. This avoids the problem of consuming a lot of human and computing resources in the process of manually designing neural network structures, thereby achieving the goal of saving human and computing resources. Attached Figure Description
[0039] Figure 1 This is a schematic diagram illustrating the application of a model building method provided in one embodiment of this specification;
[0040] Figure 2 This is a schematic diagram of the structure of a cell unit in a model construction method provided in one embodiment of this specification;
[0041] Figure 3 This is a flowchart illustrating a model building method provided in one embodiment of this specification;
[0042] Figure 4This is a flowchart illustrating a model training method provided in one embodiment of this specification;
[0043] Figure 5 This is a flowchart illustrating a resource processing method provided in one embodiment of this specification;
[0044] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0045] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0046] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0047] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0048] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0049] Neural networks: mathematical models that mimic the connection patterns of biological neurons. The simplest multilayer neural network structure consists of linear transformations and nonlinear activation functions. Researchers have designed network structures such as convolutional neural networks and recurrent neural networks to address different data characteristics. Among these, recurrent neural networks are often used to process structured data with temporal dependencies, such as time series and event sequences.
[0050] Network architecture search: This method automates the design of neural network structures, reducing the human burden and computational resource consumption associated with manual network design. Neural network architecture search typically consists of two main parts: a search space, which defines the set of candidate network structures, and a search algorithm, which defines how to obtain the target network from the search space.
[0051] Server requests: The cloud server receives operation requests from users or intermediaries, including read requests, write requests, etc.
[0052] Event sequence prediction: An event sequence is a sequence of events arranged in chronological order. Event sequence prediction methods predict the type and timing of future events based on past events.
[0053] In recent years, due to the development and popularization of cloud computing and big data, more and more computing devices and services are hosted on cloud servers. The number of computing and service requests received by the cloud has increased significantly, which has also brought greater difficulties and challenges to the scheduling and maintenance of cloud servers. This cloud server, also known as a cloud server, can be a virtual machine, container, etc., running on a host server, or it can be a host server (server); to avoid redundancy, the cloud server will be simply referred to as a server below. These computing and service requests can be understood as data write requests, data read requests, data query requests, etc., and this specification does not impose specific limitations on them.
[0054] The aforementioned issues make cloud-based (i.e., cloud server) failures difficult to detect, and the costs associated with such failures can be extremely high. Server failures can lead to data loss, service outages, and other problems, resulting in significant financial losses. Therefore, the ability to analyze the causes of server failures, predict their occurrence, and provide early warnings is of great importance.
[0055] Furthermore, the aforementioned issues can also lead to server incidents. For example, any call to cloud computing or storage services will first send a server request to the cloud server, such as a read request, write request, computation request, etc. The cloud server will then take corresponding actions based on these requests to invoke the underlying logical operation functions. When it is necessary to utilize the resources of other servers (other cloud servers), the cloud server's intelligent scheduling system will distribute the request to a suitable server for processing. This intelligent scheduling system can be understood as the system within the server used to allocate or schedule pending requests to cloud servers for processing; specifically, it can be understood as a program, process, logical model, etc., running on the server, but this specification does not impose specific limitations on this. A suitable server can be understood as a cloud server that can effectively handle the pending request, i.e., a cloud server with superior performance. For example, in the case of a read request, a suitable server can be understood as the cloud server currently responsible for handling read requests that has been assigned a lower number of pending requests. It should be noted that the system runs various types of cloud servers, such as cloud servers that handle read requests, cloud servers that handle write requests, cloud servers that perform data searches, cloud servers that perform model training, and so on.
[0056] The type and frequency of server requests are inextricably linked to cloud security. For example, a large number of read and write data requests within a short period can severely burden a distributed storage system; conversely, a large number of resource-intensive computing requests may lead to resource pool shortages. Therefore, if we can predict the types and timing of future server requests, we can analyze in advance which cloud units may experience increased pressure, thus issuing early warnings to reduce the occurrence of incidents. This "unit" can be understood as the component within the cloud server that processes the request, including but not limited to disks, CPUs, cloud servers, and network transmission units.
[0057] Therefore, considering the temporal regularity of server requests and the fact that request data can form an event sequence over time, predicting server request events can essentially be categorized as an event sequence prediction task. Traditional event sequence prediction methods use time series modeling analysis to perform regression predictions by analyzing mathematical statistics. However, with the rise of machine learning and deep learning, recurrent neural networks are playing an increasingly important role in both time series and event sequence prediction.
[0058] One method for event sequence prediction using deep learning first transforms discrete event sequences into continuous feature variables through feature engineering. Then, the multidimensional feature variables are input into temporal neural networks such as RNNs and LSTMs to characterize the latent feature variables of the event sequence. Finally, the latent variables of the network are connected to additional classification or regression prediction layers to predict the occurrence of the next event.
[0059] This specification provides an event prediction method for event sequence prediction tasks. This method directly uses temporal neural networks such as RNNs, GRUs, and LSTMs as the neural network structure to encode the input multidimensional sequence to obtain hidden layer representations. These hidden layer representations are then weighted through aggregation operations such as attention mechanisms, and finally, a classification layer outputs the predicted representation. However, in the above-mentioned event prediction methods using temporal neural networks to complete event sequence prediction tasks, these neural networks are all manually designed, making it difficult to guarantee optimal solutions in terms of topological connections and activation functions. Furthermore, the above-mentioned event prediction method is a gradient-optimized network structure search method, which suffers from poor stability. As the search time increases, the proportion of skip connections increases, leading to a decrease in model representation ability.
[0060] Furthermore, many current event sequence prediction systems incorporate different temporal neural networks to characterize different types of data features, and numerous temporal neural network variants have emerged. Specifically, for these networks, different temporal neural network variants can be obtained by modifying the network structure through adjusting the position of gate structures or the type and position of activation functions, resulting in different performance effects. However, the aforementioned methods of modifying the network structure also require manual modification, and manually designing neural network structures is difficult to traverse all possible candidate network structures. Additionally, extensive test experiments are needed to verify the performance of the designed network, consuming significant human and computational resources.
[0061] It should also be noted that while some current methods automatically design neural network structures through network structure search, these methods are primarily used for designing convolutional neural networks in computer vision, with few applications for time or event sequence prediction tasks. Furthermore, current network structure search methods are generally gradient-optimized, which suffers from poor stability; as the number of search rounds increases, the performance of the resulting network structure deteriorates, making it unsafe for deployment in real-world industrial environments.
[0062] To address the aforementioned problems, this specification provides a model building method. One or more embodiments of this specification also relate to a model training method, a resource processing method, a model building apparatus, a model training apparatus, a resource processing apparatus, a computing device, a computer-readable storage medium, and a computer program, which will be described in detail in the following embodiments.
[0063] Figure 1 This diagram illustrates an application of a model building method according to an embodiment of this specification. In practical applications, to reduce the human resource consumption of manually designing temporal neural networks and to achieve better performance in server request event sequence prediction tasks, this specification provides a model building method. This method automatically searches for temporal neural network structures using a network structure search method. The search target is the neural network structure unit, hereinafter referred to as a cell unit. Specifically, in the search phase, the model building method provided in this specification constructs a supernet containing all candidate activation functions and connection methods. The entire neural network is formed by stacking the searched cell units. This network consists of a combination of several standard cell units and a dimensionality-reduced cell unit. The cell units are interconnected by edges, and an activation function can be connected between two cell units. The entire network can be understood as a trained and complex temporal neural network. The standard cell unit is a cell unit that does not contain a downsampling operation, while the dimensionality-reduced cell unit is a cell unit that contains a downsampling operation. Through the dimensionality-reduced cell unit, more global features can be extracted while reducing feature dimensionality and computational cost. Furthermore, the position of the reduced-dimensionality cell unit in the temporal neural network can be set according to the needs of the actual application, and this specification does not impose specific restrictions on it. It should be noted that the search process can be understood as selecting neural network structural units and the connection edges between neural network structural units that meet specific conditions from the supernet (i.e., the temporal neural network mentioned above); by adjusting the type of activation function, the position of the activation function, the number of neural network structural units, and the position of the neural network structural units in the supernet in this way, a desired temporal neural network variant can be obtained.
[0064] See details Figure 1 As can be seen, the model construction method provided in this specification will input sample data and sample labels into a supernet during the network structure search process. Each cell unit in the supernet can be understood as a network layer. Then, target cell units that meet specific conditions and the edges between target cell units are selected from the cell units (where each edge between cell units can correspond to an activation function). Then, based on the target cell units and the corresponding edges, the required target temporal neural network variant is constructed.
[0065] The supernet also includes an auxiliary classifier. During the network structure search process, for each intermediate network layer in the supernet, supervision from real data labels is obtained through the auxiliary classifier. A robust differentiable network structure search method is implemented through this auxiliary classifier. The background for adopting this robust differentiable network structure search method is that some gradient-based network structure search methods have poor stability. Specifically, in this case, although some existing network structure search methods can transform the discrete search space into a continuous space through continuous operations such as weighting, making the network parameter ω (such as all linear weight parameters in a temporal neural network) and the structural parameter α (see below) differentiable, and then perform bi-objective optimization on the network parameter and structural parameter, the supernet is trained using the following formula (1).
[0066]
[0067]
[0068] In Formula 1 above, min refers to the minimum number. This is the loss function, where `train` refers to the training set and `val` refers to the test set during training. The `argmin` function... ω It means when The value of ω when it reaches its minimum. st is an abbreviation for subject to (such that), referring to the constraint condition.
[0069] However, under this objective, the loss function is non-differentiable with respect to the structural parameter α, and ω is calculated each time. * (α) All of these require training the current network to its optimal state on the training set, which is time-consuming. To address this issue, some network architecture search methods use two approximation methods for calculation. The first approximation estimation method directly uses the current network parameters ω as ω. * The second approximation method, which approximates (α), uses gradient optimization to approximate the better network parameters as the network parameters after one step of gradient descent. in, Let be the differential operator. After approximate estimation, the loss function is differentiable with respect to both the network parameter ω and the structural parameter α. Next, an alternating training mode of training the structural parameters one step and then training the network parameters one step is adopted to train the supernet.
[0070] However, the aforementioned method of directly using gradient-based optimization to search for differentiable network structures can lead to instability in the search process. As the number of search rounds increases, the performance of the resulting network may actually decrease. The fundamental reason for this is the uneven gradient distribution between layers in the supernet. Parametric operations such as skip connections can provide additional pathways for gradient propagation, thus, as the search progresses, the network tends to select meaningless skip connections.
[0071] Therefore, the model building method provided in this specification proposes a robust differentiable network structure search method. Specifically, this robust differentiable network structure search method employs a novel self-distillation technique, see [link to documentation]. Figure 1 , Figure 1 This can be understood as a structural diagram of a robust network structure search algorithm based on self-distillation. This algorithm can supervise each cell unit of the network through the output of adjacent layers; that is, in the self-distillation mechanism, the output of adjacent layers is used as supervision information to supervise each cell unit of the network. At the same time, each intermediate layer obtains supervision from real data labels through an auxiliary classifier. This novel self-distillation technique can effectively alleviate gradient distribution differences and training imbalances, and can significantly improve the stability and robustness of differentiable architecture search. The specific steps of this robust network structure search algorithm using the self-distillation mechanism (hereinafter referred to as the algorithm) are shown in steps 1 to 6 below.
[0072] Step 1: Determine the training samples and sample labels.
[0073] Specifically, the search process first requires determining the training samples and their labels. Subsequently, based on these training samples and labels, the target cell units and their corresponding edges can be searched from the supernet. Therefore, the robust network structure search algorithm based on a self-distillation mechanism provided in this specification can determine N sets of input data. in These are the corresponding one-hot real tags with a total of M categories, representing the type of server request event. These M categories can be understood as M types of events. k This can be understood as a training sample, which can be an event sequence containing multiple server request events ordered by time.
[0074] It should be noted that the algorithm provided in this specification enables the output latent variable h of the i-th layer supernet to be... i , where i∈{1,2,...,L}, and L is the number of layers in the supernet.
[0075] Step 2: Determine the initial loss function of the supernet based on the training samples and sample labels.
[0076] It should be noted that the algorithm provided in this manual can assign an auxiliary classifier to each layer in the supernet, as expressed by the following formula (2):
[0077]
[0078] in When the input is x k The output distribution of the time network, W i It is θ i The weight parameters, Wi, are network weights that are trained using algorithms such as BP (backpropagation) based on sample label data. This pooling(h) i ) for this h i Pooling is performed. Furthermore, the auxiliary classifier will be removed during subsequent inference stages.
[0079] Based on this, the algorithm provided in this specification can, based on the auxiliary classifier, calculate and determine the total initial loss function using the cross-entropy loss function for the difference between the output and the data label of any layer, through the following formula (3):
[0080]
[0081] Step 3: Determine two loss functions for the differences in gradient distribution between different network layers in the supernet.
[0082] Specifically, to reduce the differences in gradient distribution between different network layers, each network layer is supervised by its adjacent layers. This learning mechanism includes two objective loss functions. and These represent the probability distribution and feature map of the imitation of adjacent layers, respectively.
[0083] Target loss function This represents the difference in probability distribution between adjacent layers, which can be calculated using the KL divergence difference, i.e., the following formula (4):
[0084]
[0085]
[0086] in yes The probability distribution is given by τ, where τ is the distillation temperature.
[0087] Target loss function This can be understood as a feature map loss function. In practical applications, this... Using shallow latent variable feature maps directly to guide the latent variable feature maps of deeper adjacent layers can lead to a dimensionality mismatch problem, i.e., the feature maps... and F i+1 Satisfying relation C i ≤C i+1 H i ≥H i+1 The dimensions of adjacent feature maps are not exactly equal. Therefore, the algorithm provided in this specification, in order to unify the dimensions of adjacent feature maps, first uses average pooling to merge the feature maps F... i The height (width) is reduced to the same as the (i+1)th layer, and then the feature map is transformed into a weighted feature map using the following formula (5):
[0088]
[0089] Compressing the original feature map into a two-dimensional matrix Then, the difference between adjacent layers will be calculated using the following formula (6):
[0090]
[0091] Step 4: Based on the initial loss function and the two loss functions, determine the total loss function of the supernet.
[0092] The overall loss function is a weighted sum of the three sub-loss functions: In the above weighted summation formula, α and β are hyperparameters that adjust the importance and can be set according to the actual application scenario.
[0093] Step 5: Train the supernet based on the total loss function to obtain the final target temporal neural network.
[0094] Specifically, the supernet is trained based on the overall loss function. After the supernet is trained to convergence, it is determined that the network structure search of the supernet has been completed, that is, the target cell unit and the corresponding edge have been selected from the supernet. The final target network can be obtained through the discretization process.
[0095] It should be noted that during the search process, the algorithm provided in this manual can determine the weight value of the edges between each cell unit through backpropagation, and select the target cell unit and its connecting edge that contributes the most to the output result from the supernet based on this weight value. That is, only the weight value is retained for each edge. The largest candidate operation; each node in each cell unit retains only two edges connected to it.
[0096] Regarding the statement that "each node in each cell unit retains only two edges connected to it," it should be noted that each cell unit contains multiple nodes, and each node is connected to other nodes by one or more edges. See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a cell unit in a model construction method provided in one embodiment of this specification; based on Figure 2 As can be seen, an example diagram of a cell unit structure obtained from a search is as follows: Figure 2 As shown, this cell unit follows the characteristics of a temporal neural network, and the output h of a cell unit... t , and the input x at the current time -t and the latent state h of the cell at the previous moment t-1 It is relevant. It should be noted that commonly used temporal networks such as RNN, GRU, and LSTM can all be abstracted into this form.
[0097] See Figure 2 The input of a cell unit is the output of the two cells preceding it. Each cell unit structure can be abstracted as containing N nodes {x}. (0) x (1) , ..., x (N-1) In a directed acyclic graph, the node is... Figure 2 In the context of "node 0, node 1... node 8", each node x (i) This represents an intermediate feature map in the network, which can be understood as a matrix.
[0098] An activation function (including but not limited to ReLU, tanh, sigmoid, identity, etc.) can be connected between two nodes. The purpose of network structure search is to select the most suitable operation (i.e., activation function) from several candidate activation functions. The space formed by these candidate activation functions is called the search space, denoted by the symbol... In other words, during the network structure search process, it is also necessary to select nodes and their corresponding edges within each cell unit. Furthermore, the selection of nodes and their corresponding edges is also based on the weight of each edge. That is, it is necessary to select the nodes and edges that contribute the most to the output of the cell unit. The weight of each edge is determined through backpropagation based on the output of the entire cell unit.
[0099] In determining the output of a cell unit, to ensure that the network output (the output of the entire cell unit) is differentiable with respect to structural parameters, this algorithm transforms the discrete search space into a continuous space. Specifically, in a supernet, the output of a cell unit consists of nodes x... (i) Connect to node x (j) The edges (i < j) are given by a dense weight vector. The weighted summation incorporates all candidate operations, meaning that the operation between two nodes can be represented by the following formula (7):
[0100]
[0101] In formula (7), O represents the operation, x represents the node, and i and j are the indices of different nodes. The above formula indicates that the operation between two nodes is the sum of the softmax of all operations between them.
[0102] Each intermediate node is connected to all its predecessor nodes: The outputs of all intermediate nodes are spliced together to form the output of the entire cell unit.
[0103] Based on the above, it can be seen that the target of this algorithm's network structure search is the activation function and connection method selected from the network.
[0104] Step 6: Train the final target temporal neural network using training samples and training labels to obtain a temporal neural network model capable of event prediction.
[0105] Based on this, the model construction method provided in one embodiment of this specification, in order to reduce the resource consumption of manually designing temporal neural networks and to obtain better performance in server request event sequence prediction tasks, proposes to use neural network structure search to automatically design temporal neural networks to predict information such as the type and time point of the next server request. At the same time, in order to address the poor stability of existing network structure search methods, a robust differentiable network structure search method is proposed to improve the stability of the network structure search process and ensure that a stable network structure is always obtained during the search process.
[0106] This enables the automatic design of temporal neural networks for event sequence prediction tasks using network structure search methods, avoiding the overhead of manually designing neural networks, while using a self-distillation algorithm to stabilize the network search process.
[0107] Furthermore, considering current methods for using temporal networks to predict event sequences, the temporal neural networks used are manually designed, making it difficult to guarantee excellent structure. Improving the network structure requires manual adjustments, which is both labor-intensive and makes it difficult to ensure that as many cases as possible are traversed.
[0108] The model building method provided in this manual uses a network structure search approach to automatically design temporal neural networks, achieving superior results in event sequence prediction tasks without requiring manual adjustment of the neural network structure. Furthermore, it achieves a stable search process, overcoming the shortcomings of traditional gradient-based network structure search methods where the number of skip connections increases over time, leading to decreased network performance.
[0109] Figure 3 A flowchart of a model building method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0110] Step 302: Determine the initial prediction model and the corresponding training samples and sample labels.
[0111] The training samples are historical event sequences, and the sample labels are the event types of the historical event sequences. A historical event sequence can be understood as a sequence of multiple historical events ordered chronologically, and each historical event can be understood as an event corresponding to a server request received by the server in the past. The event type is a set of event types corresponding to each historical event in the historical event sequence, and these event types include, but are not limited to, read type, write type, etc. It should be noted that... Figure 3 The training samples and sample labels can be the training samples and sample labels from the robust network structure search algorithm based on self-distillation described above. This initial prediction model can be understood as a neural network that requires network structure search, such as the supernet in the above embodiment.
[0112] Specifically, in practical applications, this model construction method can be understood as the robust network structure search algorithm employing a self-distillation mechanism, as described above. Therefore, the model construction process can be understood as a process of searching the model structure of the supernet. Based on this, the initial prediction model, training samples, and sample labels for this initial prediction model need to be determined first.
[0113] Step 304: Determine at least two network structural units in the initial prediction model, and the first type of connection edges connecting each network structural unit to other network structural units.
[0114] Here, the network structural unit can be understood as a network layer in the initial prediction model; for example, in the case of a supernet, the network structural unit can be understood as a neural network structural unit within that supernet, i.e., a cell unit. The first type of connection edge can be understood as the edge connecting each network structural unit to other network structural units in the initial prediction model. It should be noted that activation functions can connect network structural units, including but not limited to ReLU, tanh, sigmoid, and identity activation functions.
[0115] Specifically, after determining the training samples and sample labels, this model building method can determine at least two network structural units in the initial prediction model, as well as the edges between each network structural unit and other network units except itself.
[0116] Step 306: Based on the training samples and the sample labels, determine the initial loss function for each network structural unit.
[0117] Specifically, determining the initial loss function for each network structural unit based on the training samples and the sample labels includes:
[0118] The training samples are processed using the at least two network structural units to obtain the prediction results output by each network structural unit;
[0119] Based on the prediction results and the sample labels, the initial loss function for each network structural unit is determined.
[0120] The prediction result can be understood as representing the requests that the server will receive next and the corresponding types of information.
[0121] Specifically, the training sample is input into the initial prediction model, and the training sample is processed by at least two network structural units in the initial prediction model to obtain the event prediction result. For example, the historical event sequence is input into the supernet, and each cell unit in the supernet is used to predict the event sequence based on the historical event sequence to obtain the event prediction result.
[0122] Subsequently, based on the prediction result and the sample label, the initial loss function of each network structural unit is determined, so that the target prediction model can be constructed based on the initial loss function, saving labor costs and computing resources.
[0123] Furthermore, in the embodiments provided in this specification, determining the initial loss function for each network structural unit based on the prediction result and the sample label includes:
[0124] Based on the prediction results output by each network structural unit and the sample labels, a first loss function for each network structural unit is determined.
[0125] Determine the neighboring network structural units corresponding to each network structural unit, and determine the second loss function of each network structural unit based on the prediction results of each network structural unit and the prediction results of the neighboring network structural units;
[0126] Based on the first node in each network structural unit and the second node of the adjacent network structural unit, determine the third loss function of each network structural unit;
[0127] The first loss function, the second loss function, and / or the third loss function are determined as the initial loss function.
[0128] Specifically, the model construction method provided in this specification takes into account the instability problem in the search process of differentiable network structure search methods based on gradient optimization. Therefore, multiple loss functions can be determined for each network structure unit to avoid instability problems in the search process.
[0129] The first loss function can be understood as a loss function that characterizes the difference between the output of any network layer and the data label, such as the cross-entropy loss function, as shown in the above formula (3).
[0130] The second loss function can be understood as a loss function that characterizes the difference between the logistic distributions (i.e., probabilities) between adjacent network layers, such as the above formula (4).
[0131] The third loss function can be understood as a loss function that determines the differences between adjacent network layers through feature maps, for example, the above formula (6).
[0132] Here, the node can be understood as a node within the aforementioned cell unit, and the node can be understood as a feature map. Correspondingly, the first node can be understood as a latent variable feature map within any cell unit; the second node can be understood as a latent variable feature map within adjacent cell units of any cell unit.
[0133] Specifically, the model building method provided in this manual can first determine the first loss function of each network structural unit based on the prediction results output by each network structural unit and the sample labels.
[0134] Secondly, the second loss function of each network structural unit is determined by using the neighboring network structural units corresponding to each network structural unit and by using the prediction results of each network structural unit and the prediction results of the neighboring network structural units.
[0135] Finally, the third loss function of each network structural unit can be determined based on the first node in each network structural unit and the second node of the adjacent network structural units.
[0136] After determining the first loss function, second loss function, and third loss function for each network structural unit, any one or more of the three loss functions can be used as the initial loss function for each network structural unit.
[0137] In the embodiments provided in this specification, determining the second loss function of each network structural unit based on the prediction result of each network structural unit and the prediction results of the adjacent network structural units includes:
[0138] Based on the prediction results of each network structural unit and preset calculation parameters, the probability distribution of the prediction results is determined;
[0139] Based on the probability distribution of the prediction results of each network structural unit and the probability distribution of the prediction results of the adjacent network structural units, a second loss function is determined for each network structural unit.
[0140] The preset calculation parameter can be understood as the distillation temperature.
[0141] Specifically, the model construction method provided in this specification can determine the prediction result of each network structural unit, and based on the prediction result and preset calculation parameters, determine the probability distribution of the prediction result. For example, the probability distribution can be the one in formula (4) above. The probability distribution can be calculated based on the formula (4) above. Sure.
[0142] Then, based on the probability distribution of the prediction results of each network structural unit and the probability distribution of the prediction results of adjacent network structural units, a second loss function for each network structural unit can be determined. For example, this second loss function can be the one in formula (4) above.
[0143] For example, the model building method provided in this specification can calculate the probability distribution of the output result after determining the output result of each cell unit, based on the output result and the distillation temperature. Then, using the KL divergence difference, the probability distribution of each cell unit, and the probability distribution of each cell unit's neighboring cell units, a loss function is constructed for each cell unit. This loss function is used to characterize the difference between the logistic distributions (i.e., probability distributions) between adjacent layers, thereby further avoiding instability issues during the search process.
[0144] In one embodiment provided in this specification, determining the third loss function of each network structural unit based on the first node in each network structural unit and the second node of the adjacent network structural unit includes:
[0145] Determine the node structure of the first node in each network structural unit, and adjust the second node of the adjacent network structural unit based on the node structure to obtain the third node;
[0146] The first node is weighted to obtain an updated first node, and the third node is weighted to obtain an updated third node;
[0147] Based on the updated first node and the updated third node, a third loss function is determined for each network structural unit.
[0148] Here, the node structure can be understood as the length, width, and height of the feature map. That is, the dimensions and height of the matrix. The third node can be understood as a node obtained by adjusting the dimensions of the second node based on the height of the first node through an average pooling operation.
[0149] The update of the first node can be understood as the weighted feature map obtained by weighting the latent variable feature map. The update of the third node can be understood as the weighted feature map obtained by weighting the latent variable feature map.
[0150] Following the example above, the model building algorithm provided in this manual, in order to unify the dimension of the feature maps of two adjacent layers, firstly uses average pooling to reduce the height (width) of the feature map of each cell unit to the same height as the feature map of the adjacent cell unit, and then performs weighted processing on the feature map to transform it into a weighted feature map. The specific weighted processing can be implemented by the above formula (5). After compressing the original feature map into a two-dimensional matrix, a loss function is constructed based on the compressed matrix, i.e., the above formula (6), so as to further avoid the problem of instability in the search process through the third loss function.
[0151] Step 308: Determine the target loss function of the initial prediction model based on the initial loss function, and determine the weight information of the first type of connection edge based on the target loss function.
[0152] Specifically, the model building method provided in this specification determines the target loss function of the initial prediction model based on the initial loss function, and determines the weight information of the first type of connection edge in the initial prediction model based on the target loss function and the prediction results of the initial prediction model.
[0153] In one embodiment provided in this specification, determining the target loss function of the initial prediction model based on the initial loss function includes:
[0154] Based on the first loss function, the second loss function, and the third loss function, the target loss function of the initial prediction model is determined.
[0155] Specifically, by weighted summing of the first, second, and third loss functions, the target loss function of the initial prediction model can be obtained. This multi-loss-function approach avoids instability during the search process. For example, the weighted sum of the three sub-loss functions can be used as follows: The final loss function can then be obtained, where α and β are hyperparameters that adjust the importance.
[0156] Based on this, after determining the target loss function of the initial prediction model, the prediction result can be backpropagated based on the target loss function to determine the weight information of the first type of connection edge in the initial prediction model.
[0157] Step 310: Adjust the initial prediction model based on the weight information to obtain the target prediction model.
[0158] Specifically, adjusting the initial prediction model based on the weight information to obtain the target prediction model includes:
[0159] Based on the weight information, a target first-type connection edge is selected from the first-type connection edges, and the network structure unit connected by the target first-type connection edge is determined as the target network structure unit;
[0160] A target prediction model is constructed based on the first type of connection edges of the target and the target network structure unit.
[0161] Following the previous example, after determining the weight information, the edge with the largest weight information can be identified as the edge that contributes the most to the prediction result, and the cell unit corresponding to the edge that contributes the most can be identified. Then, the cell unit corresponding to the edge that contributes the most can be selected from the supernet to construct the final temporal neural network model, thereby avoiding the problem of consuming a lot of human and computing resources in the process of manually designing the neural network structure.
[0162] Furthermore, in the embodiments provided in this specification, the step of constructing a target prediction model based on the target first type of connection edge and the target network structure unit includes:
[0163] Identify at least two nodes in the target network structure unit, and a second type of connection edge connecting each node to other nodes;
[0164] Based on the initial loss function of the target network structural unit, the weight information of the second type of connection edge is determined;
[0165] Based on the weight information of the second type of connection edge, the target network structure unit is adjusted to obtain the adjusted target network structure unit.
[0166] A target prediction model is constructed based on the first type of connection edges of the target and the adjusted target network structure unit.
[0167] Continuing with the previous example, the network structure search process also requires selecting nodes and their corresponding edges within each cell unit. The selection of nodes and edges is also based on the weight of each edge. Finally, the target node is constructed based on the selected edges and their corresponding nodes.
[0168] Furthermore, adjusting the target network structure unit based on the weight information of the second type of connection edges to obtain the adjusted target network structure unit includes:
[0169] Based on the weight information of the second type of connection edge, select the target second type of connection edge from the second type of connection edges;
[0170] The node connected by the second type of connection edge of the target is determined as the target node;
[0171] The target network structure unit is adjusted based on the target second type of connection edge and the target node to obtain the adjusted target network structure unit.
[0172] Continuing with the previous example, the selection of nodes and their corresponding edges is also based on the weight of each edge. That is, it is necessary to select the edge that contributes the most to the output of the cell unit, that is, the edge with the largest weight, and select this edge and its corresponding node to form the target node. Subsequently, a target prediction model can be built based on this target node, thereby avoiding the problem of consuming a lot of human and computing resources in the process of manually designing neural network structures.
[0173] In the embodiments provided in this specification, after constructing the target prediction model, it is necessary to train the model based on samples and labels to obtain a time-series neural network model capable of predicting event sequences. Specifically, after adjusting the initial prediction model based on the weight information to obtain the target prediction model, the process further includes:
[0174] The target prediction model is trained based on the training samples and the sample labels to obtain the trained target prediction model.
[0175] Following the previous example, after constructing the temporal neural network model, it can be trained based on the training samples and labels until the model reaches the training stopping condition, thus obtaining a temporal neural network model capable of accurately predicting event sequences. This training stopping condition can be set according to the actual application scenario; this manual does not specify a particular stopping condition. For example, it could be that the loss function of the temporal neural network model converges, or that the model has undergone a preset number of training iterations (e.g., 500 times). Furthermore, it should be noted that any method capable of training a temporal neural network model can be used for training the constructed model; this manual does not specify a particular method. What should be noted is that the training process for the constructed temporal neural network model can refer to the above... Figure 1 This manual does not impose specific limitations on the corresponding content.
[0176] The model building method provided in this specification determines the target loss function of an initial prediction network that includes at least two network structural units and first-type connection edges connecting each network structural unit by using training samples and sample labels. Then, based on the target loss function, the weight information of the first-type connection edges is determined, and the initial prediction network is automatically adjusted based on the weight information to complete the construction of the target prediction model. This avoids the problem of consuming a lot of human and computing resources in the process of manually designing neural network structures, thereby achieving the goal of saving human and computing resources.
[0177] Figure 4 A flowchart of a model training method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0178] Step 402: Determine the training samples and sample labels for the target prediction model.
[0179] The target prediction model is a target prediction model determined based on the above model.
[0180] Step 404: Based on the training samples and the sample labels, train the target prediction model until the training stops, and obtain the target prediction model that has been trained.
[0181] For an explanation of this step, please refer to the corresponding description in the above model construction method. This manual does not provide specific limitations on it.
[0182] For example, after constructing a time-series neural network model, the model can be trained based on the training samples and training labels until the time-series neural network model reaches the training stopping condition, thus obtaining a time-series neural network model that can accurately predict event sequences.
[0183] The model training method provided in this manual trains the target prediction model using training samples and sample labels to obtain a trained target prediction model. This model can then be used to process event sequences and obtain prediction results, accurately adjusting current event processing resources. This avoids a significant increase in the number of computations and service requests, which would otherwise pose difficulties and challenges to server scheduling and maintenance, and reduce the occurrence of server accidents.
[0184] Figure 5 A flowchart of a resource processing method according to an embodiment of this specification is shown. The resource processing method is applied to a server and specifically includes the following steps.
[0185] Step 502: Determine the event sequence of the server.
[0186] The event sequence is determined based on the pending requests received by the server.
[0187] Step 504: Select a local event sequence within the target time range from the event sequence.
[0188] The target time range is determined based on the current time.
[0189] Step 506: Use the trained target prediction model to predict the local time series and obtain the prediction result, wherein the trained target prediction model is the target prediction model trained in the above model training method.
[0190] Step 508: Determine the event processing resource parameters corresponding to the prediction result, and adjust the current event processing resources of the server based on the event processing resource parameters to obtain the event processing resources corresponding to the prediction result.
[0191] The target time range can be understood as a preset time interval preceding the current time. For example, one minute before the current time, one hour before the current time, etc. The local event sequence refers to the events corresponding to server requests received within the target time range. Event processing resources can be understood as the resources used by the server to process received server requests, including but not limited to storage resources, computing resources, various types of cloud servers, etc. Event processing resource parameters can be understood as parameters characterizing the quantity, type, and other information of event processing resources.
[0192] In practical applications, to avoid server failures and accidents, a trained target prediction model can be used to predict the types and timing of future server requests. This allows for early analysis of which cloud units may experience increased pressure, enabling early warnings and reducing the occurrence of incidents.
[0193] Specifically, the server first determines the event sequence stored in the server itself, selects a local event sequence within the target time range from the event sequence, then uses the trained target prediction model to predict the local time series and obtain the prediction result. Finally, it determines the event processing resource parameters corresponding to the prediction result, and adjusts the server's current event processing resources based on the event processing resource parameters to obtain the event processing resources corresponding to the prediction result.
[0194] For example, the server determines an event sequence based on its stored historical server requests, selects an event corresponding to a server request received an hour ago from this sequence, and inputs this event into a trained temporal neural network model for event sequence prediction, obtaining a prediction result. This prediction result determines the type and timing of requests the server will receive next. Based on this, the server calculates the resources required to process the corresponding server request and adjusts its storage resources, computing resources, number of cloud servers, and cloud service type accordingly to obtain stable processing resources to handle subsequent server requests, thereby reducing the occurrence of incidents.
[0195] The resource processing method provided in this specification uses a target prediction model to process the event sequence, obtain prediction results, and adjust the server's current event processing resources based on the event processing resource parameters corresponding to the prediction results. This allows the server to process subsequent requests based on the adjusted event processing resources, avoiding the difficulties and challenges brought to server scheduling and maintenance by a significant increase in the number of computation and service requests, and reducing the occurrence of server accidents.
[0196] Corresponding to the above method embodiments, this specification also provides embodiments of a model building apparatus, which includes:
[0197] The first determining module is configured to determine an initial prediction model and the training samples and sample labels corresponding to the initial prediction model, wherein the training samples are historical event sequences and the sample labels are the event types of the historical event sequences;
[0198] The second determining module is configured to determine at least two network structural units in the initial prediction model, and a first type of connection edge connecting each network structural unit to other network structural units.
[0199] The function determination module is configured to determine the initial loss function for each network structural unit based on the training samples and the sample labels;
[0200] The weight determination module is configured to determine the target loss function of the initial prediction model based on the initial loss function, and to determine the weight information of the first type of connection edge based on the target loss function;
[0201] The model adjustment module is configured to adjust the initial prediction model based on the weight information to obtain the target prediction model.
[0202] Optionally, the model building apparatus further includes a model training module, configured as follows:
[0203] The target prediction model is trained based on the training samples and the sample labels to obtain the trained target prediction model.
[0204] Optionally, the model adjustment module is further configured to:
[0205] Based on the weight information, a target first-type connection edge is selected from the first-type connection edges, and the network structure unit connected by the target first-type connection edge is determined as the target network structure unit;
[0206] A target prediction model is constructed based on the first type of connection edges of the target and the target network structure unit.
[0207] Optionally, the model adjustment module is further configured to:
[0208] Identify at least two nodes in the target network structure unit, and a second type of connection edge connecting each node to other nodes;
[0209] Based on the initial loss function of the target network structural unit, the weight information of the second type of connection edge is determined;
[0210] Based on the weight information of the second type of connection edge, the target network structure unit is adjusted to obtain the adjusted target network structure unit.
[0211] A target prediction model is constructed based on the first type of connection edges of the target and the adjusted target network structure unit.
[0212] Optionally, the model adjustment module is further configured to:
[0213] Based on the weight information of the second type of connection edge, select the target second type of connection edge from the second type of connection edges;
[0214] The node connected by the second type of connection edge of the target is determined as the target node;
[0215] The target network structure unit is adjusted based on the target second type of connection edge and the target node to obtain the adjusted target network structure unit.
[0216] Optionally, the function determination module is further configured to:
[0217] The training samples are processed using the at least two network structural units to obtain the prediction results output by each network structural unit;
[0218] Based on the prediction results and the sample labels, the initial loss function for each network structural unit is determined.
[0219] Optionally, the function determination module is further configured to:
[0220] Based on the prediction results output by each network structural unit and the sample labels, a first loss function for each network structural unit is determined.
[0221] Determine the neighboring network structural units corresponding to each network structural unit, and determine the second loss function of each network structural unit based on the prediction results of each network structural unit and the prediction results of the neighboring network structural units;
[0222] Based on the first node in each network structural unit and the second node of the adjacent network structural unit, determine the third loss function of each network structural unit;
[0223] The first loss function, the second loss function, and / or the third loss function are determined as the initial loss function.
[0224] Optionally, the weight determination module is further configured to:
[0225] Based on the first loss function, the second loss function, and the third loss function, the target loss function of the initial prediction model is determined.
[0226] Optionally, the function determination module is further configured to:
[0227] Based on the prediction results of each network structural unit and preset calculation parameters, the probability distribution of the prediction results is determined;
[0228] Based on the probability distribution of the prediction results of each network structural unit and the probability distribution of the prediction results of the adjacent network structural units, a second loss function is determined for each network structural unit.
[0229] Optionally, the function determination module is further configured to:
[0230] Determine the node structure of the first node in each network structural unit, and adjust the second node of the adjacent network structural unit based on the node structure to obtain the third node;
[0231] The first node is weighted to obtain an updated first node, and the third node is weighted to obtain an updated third node;
[0232] Based on the updated first node and the updated third node, a third loss function is determined for each network structural unit.
[0233] The model building apparatus provided in one embodiment of this specification determines the target loss function corresponding to an initial prediction network that includes at least two network structural units and first-type connection edges connecting each network structural unit by using training samples and sample labels. Then, it determines the weight information of the first-type connection edges based on the target loss function and automatically adjusts the initial prediction network based on the weight information, thereby completing the construction of the target prediction model. This avoids the problem of consuming a lot of human and computing resources in the process of manually designing neural network structures, thus achieving the goal of saving human and computing resources.
[0234] The above is an illustrative scheme of a model building apparatus according to this embodiment. It should be noted that the technical solution of this model building apparatus and the technical solution of the model building method described above belong to the same concept. For details not described in detail in the technical solution of the model building apparatus, please refer to the description of the technical solution of the model building method described above.
[0235] Corresponding to the above method embodiments, this specification also provides embodiments of a model training apparatus, which includes:
[0236] The determination module is configured to determine the training samples and sample labels of the target prediction model, wherein the target prediction model is the target prediction model determined by the model construction method described above.
[0237] The training module is configured to train the target prediction model based on the training samples and the sample labels until the training stops, thereby obtaining the trained target prediction model.
[0238] The model building apparatus provided in one embodiment of this specification trains the target prediction model using training samples and sample labels to obtain a trained target prediction model. This allows for subsequent processing of event sequences using the prediction results obtained from the target prediction model, enabling accurate adjustment of current event processing resources. This avoids a significant increase in the number of computations and service requests, which would otherwise pose difficulties and challenges to server scheduling and maintenance, and reduce the occurrence of server accidents.
[0239] The above is an illustrative scheme of a model training device according to this embodiment. It should be noted that the technical solution of this model training device and the technical solution of the model training method described above belong to the same concept. For details not described in detail in the technical solution of the model training device, please refer to the description of the technical solution of the model training method described above.
[0240] Corresponding to the above method embodiments, this specification also provides a resource processing apparatus applied to a server, comprising:
[0241] The determination module is configured to determine a sequence of events for the server, wherein the sequence of events is determined based on pending requests received by the server.
[0242] The selection module is configured to select a local event sequence within a target time range from the event sequence, wherein the target time range is determined based on the current time;
[0243] The prediction module is configured to use the trained target prediction model to predict the local time series and obtain the prediction result, wherein the trained target prediction model is the target prediction model trained in the above model training method.
[0244] The resource adjustment module is configured to determine the event processing resource parameters corresponding to the prediction result, and adjust the current event processing resources of the server based on the event processing resource parameters to obtain the event processing resources corresponding to the prediction result.
[0245] The resource processing apparatus provided in one embodiment of this specification uses a target prediction model to process an event sequence, obtains a prediction result, and adjusts the current event processing resources of the server based on the event processing resource parameters corresponding to the prediction result, thereby obtaining the event processing resources corresponding to the prediction result. This enables the server to process subsequent requests based on the adjusted event processing resources, avoiding the difficulties and challenges brought to server scheduling and maintenance by a significant increase in the number of computations and service requests, and reducing the occurrence of server accidents.
[0246] The above is an illustrative scheme of a resource processing apparatus according to this embodiment. It should be noted that the technical solution of this resource processing apparatus and the technical solution of the resource processing method described above belong to the same concept. For details not described in detail in the technical solution of the resource processing apparatus, please refer to the description of the technical solution of the resource processing method described above.
[0247] Figure 6 A structural block diagram of a computing device 600 according to one embodiment of this specification is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.
[0248] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0249] In one embodiment of this specification, the above-described components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0250] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 600 can also be a mobile or stationary server.
[0251] The processor 620 is configured to execute the following computer-executable instructions, which, when executed by the processor 620, implement the steps of the above-described model building method, model training method, or resource processing method.
[0252] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the above-described model building method, model training method, or resource processing method. For details not described in detail in the technical solution of the computing device, please refer to the descriptions of the technical solutions of the above-described model building method, model training method, or resource processing method.
[0253] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described model building method, model training method, or resource processing method.
[0254] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the above-described model building method, model training method, or resource processing method. Details not described in detail in the technical solution of the storage medium can be found in the descriptions of the technical solutions of the above-described model building method, model training method, or resource processing method.
[0255] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described model building method, model training method, or resource processing method.
[0256] The above is an illustrative scheme of a computer program according to this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the technical solutions of the above-described model building method, model training method, or resource processing method. For details not described in detail in the technical solution of the computer program, please refer to the descriptions of the technical solutions of the above-described model building method, model training method, or resource processing method.
[0257] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0258] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0259] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0260] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0261] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A model construction method, comprising: An initial prediction model, training samples, and sample labels are determined. The training samples are historical event sequences, and the sample labels are event types of the historical event sequences. The historical event sequences are sequences composed of multiple historical events ordered chronologically. The historical events are events corresponding to requests received by the server in the past. The event types include read and write types. Identify at least two network structural units in the initial prediction model, and a first type of connection edge connecting each network structural unit to other network structural units; Based on the training samples and the sample labels, determine the initial loss function for each network structural unit; The target loss function of the initial prediction model is determined based on the initial loss function, and the weight information of the first type of connection edge is determined based on the target loss function. The initial loss function includes a first loss function, a second loss function, and a third loss function. The first loss function is a loss function that characterizes the difference between the output result of any network structural unit and the sample label. The second loss function is a loss function that characterizes the difference in probability distribution between adjacent network structural units. The third loss function is a loss function that determines the difference between adjacent network structural units through feature maps. The initial prediction model is adjusted based on the weight information to obtain the target prediction model; the target prediction model is used to predict the types of future server requests and the time when they occur, thereby analyzing the pressure on cloud units and issuing early warnings.
2. The model construction method according to claim 1, after adjusting the initial prediction model based on the weight information to obtain the target prediction model, further includes: The target prediction model is trained based on the training samples and the sample labels to obtain the trained target prediction model.
3. The model construction method according to claim 1, wherein adjusting the initial prediction model based on the weight information to obtain the target prediction model includes: Based on the weight information, a target first-type connection edge is selected from the first-type connection edges, and the network structure unit connected by the target first-type connection edge is determined as the target network structure unit; A target prediction model is constructed based on the first type of connection edges of the target and the target network structure unit.
4. The model construction method according to claim 3, wherein constructing a target prediction model based on the first type of connection edge of the target and the target network structural unit includes: Identify at least two nodes in the target network structure unit, and a second type of connection edge connecting each node to other nodes; Based on the initial loss function of the target network structural unit, the weight information of the second type of connection edge is determined; Based on the weight information of the second type of connection edge, the target network structure unit is adjusted to obtain the adjusted target network structure unit. A target prediction model is constructed based on the first type of connection edges of the target and the adjusted target network structure unit.
5. The model construction method according to claim 4, wherein adjusting the target network structure unit based on the weight information of the second type of connection edge to obtain the adjusted target network structure unit includes: Based on the weight information of the second type of connection edge, select the target second type of connection edge from the second type of connection edges; The node connected by the second type of connection edge of the target is determined as the target node; The target network structure unit is adjusted based on the target second type of connection edge and the target node to obtain the adjusted target network structure unit.
6. The model construction method according to claim 1, wherein determining the initial loss function for each network structural unit based on the training samples and the sample labels comprises: The training samples are processed using the at least two network structural units to obtain the prediction results output by each network structural unit; Based on the prediction results and the sample labels, the initial loss function for each network structural unit is determined.
7. The model construction method according to claim 1, wherein the determination of the second loss function includes: Based on the prediction results of each network structural unit and preset calculation parameters, the probability distribution of the prediction results is determined; Based on the probability distribution of the prediction results of each network structural unit and the probability distribution of the prediction results of the adjacent network structural units corresponding to each network structural unit, a second loss function for each network structural unit is determined.
8. The model construction method according to claim 1, wherein the method for determining the third loss function includes: Determine the node structure of the first node in each network structural unit, and adjust the second nodes of the adjacent network structural units corresponding to each network structural unit based on the node structure to obtain the third node; The first node is weighted to obtain an updated first node, and the third node is weighted to obtain an updated third node; Based on the updated first node and the updated third node, a third loss function is determined for each network structural unit.
9. A model training method, comprising: The training samples and sample labels of the target prediction model are determined, wherein the target prediction model is a target prediction model determined based on the model construction method of any one of claims 1 to 8 above; Based on the training samples and the sample labels, the target prediction model is trained until the training stops, thus obtaining a completed target prediction model.
10. A resource processing method, applied to a server, comprising: Determine a sequence of events for the server, wherein the sequence of events is determined based on pending requests received by the server; Select a local event sequence within a target time range from the event sequence, wherein the target time range is determined based on the current time; The local event sequence is predicted using the trained target prediction model to obtain the prediction result, wherein the trained target prediction model is the trained target prediction model in claim 9 above. Determine the event processing resource parameters corresponding to the prediction result, and adjust the current event processing resources of the server based on the event processing resource parameters to obtain the event processing resources corresponding to the prediction result.
11. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the model building method of any one of claims 1 to 8, the model training method of claim 9, or the resource processing method of claim 10.
12. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the model building method of any one of claims 1 to 8, the model training method of claim 9, or the resource processing method of claim 10.