State prediction method and device, computer equipment, storage medium and computer program product
By encoding the multivariate time series in time and position, and using a pre-trained state prediction model, combining the graph structure generation module and the spatial graph convolution module, the problem of low prediction accuracy of the multivariate time series algorithm is solved, and the prediction results are improved accuracy.
Patent Information
- Application Number
- CN202410853445.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-11-08
AI Technical Summary
Existing multivariate time series algorithms cannot effectively utilize the mutual influence relationship between multivariate variables, resulting in low prediction accuracy.
A state prediction method is adopted to obtain multiple associated time series of target prediction items in the historical time period, perform time encoding and position encoding, and use a pre-trained state prediction model, combining the graph structure generation module and the spatial graph convolution module. Capture the relationships and temporal and spatial characteristics between associated time series and make predictions.
The accuracy of the state prediction of the target prediction term in the prediction time period is improved, and the relationship between multiple variables can be better captured and the accuracy of the prediction results can be enhanced.
Smart Images

Figure CN118916627A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a state prediction method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Usually, it is necessary to use the state of the target prediction item in the historical time period to predict the unknown state of the target prediction item in the future time period. In general, multiple related items of the target prediction item can be determined, and the unknown state of the target prediction item in the future time period can be predicted based on the multivariate time series of the target prediction item and the multiple related items in the historical time period. In this process, a multivariate time series algorithm is used.
[0003] The current multivariate time series algorithms cannot make good use of the mutual influence relationship between multivariate variables for prediction, and there is a problem of low prediction accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a state prediction method, device, computer equipment, storage medium and computer program product that can improve prediction accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a state prediction method. The method comprises:
[0006] Get multiple associated time series of target forecast items within the historical time period;
[0007] Performing time coding and position coding on each of the multiple time steps of each of the associated time series to obtain a coded time series corresponding to each of the associated time series;
[0008] The state prediction result of the target prediction item within the prediction time period is obtained by utilizing the pre-trained state prediction model based on the multiple encoding time series.
[0009] In one of the embodiments, the state prediction result of the target prediction item within the prediction time period is obtained based on multiple encoding time series using a pre-trained state prediction model, including: inputting multiple encoding time series into the state prediction model; the state prediction model includes a feature extraction module, a graph structure generation module and a prediction module; the feature extraction module obtains the time information feature of each encoding time series, the graph structure generation module determines and outputs the adjacency matrix corresponding to the multiple encoding time series according to the multiple encoding time series, and the prediction module determines and outputs the state prediction result of the target prediction item within the prediction time period according to the adjacency matrix output by the graph structure generation module and the time information feature output by the feature extraction module.
[0010] In one of the embodiments, the graph structure generation module determines and outputs the adjacency matrix corresponding to the multiple coding time sequences based on the multiple coding time sequences, including: obtaining the correlation between any current coding time sequence among the multiple coding time sequences and the remaining coding time sequences except the current coding time sequence; and determining the adjacency matrix corresponding to the multiple coding time sequences based on the multiple coding time sequences and the correlation.
[0011] In one of the embodiments, the adjacency matrix corresponding to the multiple coding time sequences is determined based on the multiple coding time sequences and the correlation, including: taking the multiple coding time sequences as corresponding multiple nodes; determining the correlation weights between the current coding time sequence and the remaining coding time sequences in the multiple coding time sequences based on the correlation; determining the connecting lines between the multiple nodes based on the correlation weights, and taking the connecting lines as corresponding weighted edges; and determining the adjacency matrix corresponding to the multiple coding time sequences based on the multiple nodes and the weighted edges.
[0012] In one of the embodiments, the connection lines between the multiple nodes are determined based on the relevant weights, and the connection lines are used as corresponding weighted edges, including: if the relevant weight is greater than a weight threshold, the connection line between the two nodes corresponding to the relevant weight is determined, and the connection line is used as the corresponding weighted edge; if the relevant weight is less than or equal to the weight threshold, it is determined that the weighted edge does not exist between the two nodes corresponding to the relevant weight.
[0013] In one embodiment, the prediction module includes a spatial graph convolution module; the prediction module in the state prediction model determines and outputs the state prediction result of the target prediction item within the prediction time period according to the adjacency matrix output by the graph structure generation module and the time information features output by the feature extraction module, including: the spatial convolution module determines and outputs the spatial information features of multiple encoded time series according to the adjacency matrix and multiple encoded time series; and obtains the state prediction result according to the spatial information features and the time information features.
[0014] In one of the embodiments, obtaining the state prediction result based on the spatial information feature and the temporal information feature includes: fusing multiple encoded time series, the spatial information feature and the temporal information feature to obtain fused features corresponding to the multiple encoded time series; and obtaining the state prediction result based on the fused features.
[0015] In a second aspect, the present application provides a state prediction device. The device comprises:
[0016] An acquisition module is used to obtain multiple associated time series of target prediction items within a historical time period;
[0017] An encoding module, used for performing time encoding and position encoding on each of the multiple time steps of each of the associated time series to obtain an encoded time series corresponding to each of the associated time series;
[0018] The prediction module is used to obtain the state prediction result of the target prediction item within the prediction time period based on the multiple encoded time series using the pre-trained state prediction model.
[0019] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0020] Get multiple associated time series of target forecast items within the historical time period;
[0021] Performing time coding and position coding on each of the multiple time steps of each of the associated time series to obtain a coded time series corresponding to each of the associated time series;
[0022] The state prediction result of the target prediction item within the prediction time period is obtained by utilizing the pre-trained state prediction model based on the multiple encoding time series.
[0023] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0024] Get multiple associated time series of target forecast items within the historical time period;
[0025] Performing time coding and position coding on each of the multiple time steps of each of the associated time series to obtain a coded time series corresponding to each of the associated time series;
[0026] The state prediction result of the target prediction item within the prediction time period is obtained by utilizing the pre-trained state prediction model based on the multiple encoding time series.
[0027] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0028] Get multiple associated time series of target forecast items within the historical time period;
[0029] Performing time coding and position coding on each of the multiple time steps of each of the associated time series to obtain a coded time series corresponding to each of the associated time series;
[0030] The state prediction result of the target prediction item within the prediction time period is obtained by utilizing the pre-trained state prediction model based on the multiple encoding time series.
[0031] In the above-mentioned state prediction method, apparatus, computer equipment, storage medium and computer program product, first, multiple associated time series of the target prediction item in the historical time period can be obtained; next, each time step in the multiple time steps of each associated time series can be time-coded and position-coded to obtain the coded time series corresponding to each associated time series; finally, a pre-trained state prediction model can be used to obtain the state prediction result of the target prediction item in the prediction time period based on multiple coded time series. In the method provided by the embodiment of the present application, a pre-trained state prediction model can be introduced, and a graph structure generation module is introduced in the state model, which can well capture the relationship between each associated time series, and can combine the dual characteristics of time and space for prediction, thereby improving the prediction accuracy of the state of the target prediction item in the prediction time period. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] FIG1 is a schematic diagram of a flow chart of a state prediction method provided in an embodiment of the present application;
[0034] FIG2 is a schematic diagram of a process of generating an adjacency matrix by a graph structure generation module according to an embodiment of the present application;
[0035] FIG3 is a schematic diagram of a process of generating an adjacency matrix based on correlation provided in an embodiment of the present application;
[0036] FIG4 is a structural block diagram of a state prediction device provided in an embodiment of the present application;
[0037] FIG5 is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] In an exemplary embodiment, as shown in FIG1 , a state prediction method is provided. This embodiment is illustrated by applying the method to a server. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0040] Step 102, obtaining multiple associated time series of target prediction items within a historical time period.
[0041] Among them, the target prediction item can be any object to be predicted, for example, the return air temperature of the air conditioner. The embodiment of the present application is described below by taking the target prediction item as the return air temperature of the air conditioner as an example. In this step, first, the associated item of the target prediction item can be determined. The associated item can be an object associated with the target prediction item. Taking the target prediction item as the return air temperature of the air conditioner as an example, the associated item of the return air temperature of the air conditioner can include but is not limited to the outdoor temperature, indoor temperature, IT load and the set value of the refrigeration equipment control. The multiple associated time series may include the historical time series of the target prediction item in the historical time period and other associated time series of the associated item in the historical time period. The historical time period may be a pre-set data collection time end in the past, for example, a week, a month or a year in the past time. The data of the target prediction item and the multiple associated items in the historical time period can be collected according to the pre-set collection cycle to obtain the target prediction data and associated data corresponding to the target prediction item, and the target prediction data and the associated data can be divided into multiple time steps according to the collection cycle. The associated time series includes multiple time steps, each of which corresponds to a data point.
[0042] Step 104 , time coding and position coding are performed on each of the multiple time steps of each associated time series to obtain a coded time series corresponding to each associated time series.
[0043] Each of the multiple associated time series includes multiple time steps, and each of the multiple time steps corresponds to a data point. In this step, each of the multiple time steps of each associated time series can be time-coded and position-coded, wherein the position coding, which can also be called position embedding, is to assign a unique vector to each time step in the time series, thereby retaining the order information of the time step. The position coding can refer to formula (1); the time coding, which can also be called global timestamp embedding, is used to assign a vector to the global time information of each time step in the time series. These timestamps can include hours, minutes, etc., and these embeddings are learnable. The time coding can refer to formula (2); further, the position embedding, the global timestamp embedding and the scalars of each associated time series can be combined to obtain the coded time series corresponding to each associated time series. Each time step in the coded time series has a position tag and a time tag.
[0044] (1)
[0045] in, is the position of the element in the time series; is the length of the time series; d is the feature dimension; Embed the positions of the time steps of the associated time series.
[0046]
[0047] in, is the daily attribute of the time step of the associated time series; is the weekly attribute of the time step of the associated time series; is the temporal embedding of the time steps of the associated time series.
[0048] Step 106, using the pre-trained state prediction model, based on multiple coded time series, obtain the state prediction result of the target prediction item within the prediction time period.
[0049] Among them, the state prediction model may include a feature extraction module, a graph structure generation module and a prediction module. The feature extraction module can perform feature extraction on each coding time series to obtain the time information features of each coding time series, and the time information features can be used to represent the time information of each time step in multiple time steps in each coding time series. The graph structure generation module can determine the correlation between the multiple coding time series. The calculation method of the correlation can use the Pearson correlation coefficient and the Spearman correlation coefficient, etc. The embodiment of the present application does not limit the calculation method of the correlation. The correlation between the multiple coding time series can also be called a correlation coefficient, which can be expressed in the form of a correlation coefficient matrix. Furthermore, a graph structure of the multiple coding time series can be constructed based on the multiple coding time series and the correlation between each of the multiple coding time series. In the graph structure, each node represents a coding time series variable, and the edge represents the correlation between each coding time series. If the correlation is greater than the correlation threshold, there is a connecting line between the two coding time series corresponding to the correlation, and the connecting line can be used as the edge of the graph structure; if the correlation is less than or equal to the correlation threshold, there is no connecting line between the two coding time series corresponding to the correlation. Next, the prediction module can determine and output the state prediction result of the target prediction item in the prediction time period based on the adjacency matrix output by the graph structure generation module and the time information feature output by the feature extraction module. The state prediction result may include the target time series of the target prediction item in the prediction time period, and the target time series includes multiple target time steps, and each target time step corresponds to a prediction value of the target prediction item. The state prediction result may include multiple target time series, each of which may correspond to one of the multiple associated time series. Furthermore, the final predicted target time series of the target prediction item may be determined based on the degree of association between the associated items corresponding to each associated time series and the target prediction item.
[0050] In the method of this embodiment, first, multiple associated time series of the target prediction item in the historical time period can be obtained; next, each time step in the multiple time steps of each associated time series can be time-coded and position-coded to obtain the coded time series corresponding to each associated time series; finally, a pre-trained state prediction model can be used to obtain the state prediction result of the target prediction item in the prediction time period based on multiple coded time series. In the method provided by the embodiment of the present application, a pre-trained state prediction model can be introduced, and a graph structure generation module is introduced in the state model, which can well capture the relationship between each associated time series, and can combine the dual characteristics of time and space for prediction, thereby improving the prediction accuracy of the state of the target prediction item in the prediction time period.
[0051] In an exemplary embodiment, step 106 may include:
[0052] Multiple coded time series are input into a state prediction model; the state prediction model includes a feature extraction module, a graph structure generation module and a prediction module; the feature extraction module obtains the time information features of each coded time series, the graph structure generation module determines and outputs the adjacency matrix corresponding to the multiple coded time series based on the multiple coded time series, and the prediction module determines and outputs the state prediction result of the target prediction item within the prediction time period based on the adjacency matrix output by the graph structure generation module and the time information features output by the feature extraction module.
[0053] Among them, in the embodiment of the present application, the state prediction module can be used to obtain the state prediction result of the target prediction item within the prediction time period based on multiple coding time series. The state prediction model includes a feature extraction module, a graph structure generation module and a prediction module. The feature extraction module can perform feature extraction on each coding time series to obtain the time information feature of each coding time series, and the time information feature can be used to represent the time information of each time step in multiple time steps in each coding time series. The graph structure generation module can determine the correlation between the multiple coding time series. The calculation method of the correlation can use the Pearson correlation coefficient and the Spearman correlation coefficient, etc. The embodiment of the present application does not limit the calculation method of the correlation. The correlation between the multiple coding time series can also be called a correlation coefficient, which can be expressed in the form of a correlation coefficient matrix. Furthermore, a graph structure of the multiple coding time series can be constructed based on the multiple coding time series and the correlation between each of the multiple coding time series. In the graph structure, each node represents a coding time series variable, and the edge represents the correlation between each coding time series. If the correlation is greater than the correlation threshold, there is a connecting line between the two coding time series corresponding to the correlation, and the connecting line can be used as the edge of the graph structure; if the correlation is less than or equal to the correlation threshold, there is no connecting line between the two coding time series corresponding to the correlation. Next, the prediction module can determine and output the state prediction result of the target prediction item in the prediction time period based on the adjacency matrix output by the graph structure generation module and the time information feature output by the feature extraction module. The state prediction result may include the target time series of the target prediction item in the prediction time period, and the target time series includes multiple target time steps, and each target time step corresponds to a prediction value of the target prediction item. The state prediction result may include multiple target time series, each of which may correspond to one of the multiple associated time series. Furthermore, the final predicted target time series of the target prediction item may be determined based on the degree of association between the associated items corresponding to each associated time series and the target prediction item.
[0054] In the method of this embodiment, a pre-trained state prediction model can be introduced. A graph structure generation module is introduced into the state model, which can well capture the relationship between various related time series, and can combine the dual characteristics of time and space for prediction, thereby improving the prediction accuracy of the state of the target prediction item in the prediction time period.
[0055] In an exemplary embodiment, as shown in FIG2 , the graph structure generation module generates an adjacency matrix, which may include steps 202 to 204. Among them:
[0056] Step 202: Obtain the correlation between any current coding time sequence among multiple coding time sequences and the remaining coding time sequences except the current coding time sequence.
[0057] Among them, the graph structure generation module can obtain the time series embedding corresponding to each of the multiple encoding time sequences. Next, the self-attention mechanism can be used to obtain the potential correlation between different encoding time sequences based on the time series embedding, that is, the correlation. The current encoding time sequence can be any one of the multiple encoding time sequences, and the remaining encoding time sequences can be other encoding time sequences in the multiple encoding time sequences except the current encoding time sequence.
[0058] Step 204: Determine the adjacency matrix corresponding to the multiple coding time sequences according to the multiple coding time sequences and the correlations.
[0059] The adjacency matrix represents a matrix of adjacent relationships between nodes. The adjacency matrix includes a node set and an edge combination. A one-dimensional array can be used to store all node data in the graph structure; a two-dimensional array can be used to store the relationship data (edges or arcs) between nodes. Each of the multiple coded time sequences can be used as a node of the adjacency matrix of the graph structure, and the correlation between the multiple coded time sequences can be used as the edge of the adjacency matrix of the graph structure. The generation of the adjacency matrix can refer to formula (3).
[0060]
[0061] in, , Q represents query; , K represents a bond; W Q and W K are learnable parameters, d is the hidden dimension size of Q and K; the output matrix A will be row-normalized to produce the final adjacency matrix with weighted edges in the range [0,1].
[0062] In another exemplary embodiment, generating an adjacency matrix by the graph structure generating module may further include:
[0063] The graph structure generation module may include a graph learning layer that can adaptively learn a graph adjacency matrix to capture hidden relationships between multiple encoded time series data. In multiple encoded time series predictions, changes in node conditions may lead to changes in another node condition, such as air conditioning return air temperature. Therefore, the learned relationship should be unidirectional, and the graph learning layer is specifically designed to extract unidirectional relationships, as shown in formulas (4) to (8):
[0064]
[0065]
[0066]
[0067]
[0068]
[0069] Among them, E1 and E2 represent randomly initialized node embeddings, which are learnable during training; , is a model parameter; a is a hyperparameter used to control the saturation rate of the activation function; and arg-top-k() returns the largest K values of the top index vector. The asymmetry of the graph adjacency matrix is implemented by formula (4). The subtraction term and the ReLU activation function can be used to regularize the adjacency matrix, so if Avu is positive, its diagonal logarithm Auv will be zero. Formulas (7) and (8) can be used to perform sparse processing on the adjacency matrix A. For each encoded time series, the first k nearest nodes can be selected as its neighbor nodes according to the correlation. If the correlation is greater than the correlation threshold, there is a connecting line between the two encoded time series corresponding to the correlation, and the connecting line can be used as the edge of the graph structure; if the correlation is less than or equal to the correlation threshold, there is no connecting line between the two encoded time series corresponding to the correlation.
[0070] In an exemplary embodiment, as shown in FIG3 , step 204 may include steps 302 to 308.
[0071] Step 302: multiple coded time sequences are used as corresponding multiple nodes.
[0072] Step 304: Determine the correlation weight between the current coding time sequence and the remaining coding time sequences in the multiple coding time sequences according to the correlation.
[0073] Step 306: Determine the connection lines between the multiple nodes according to the relevant weights, and use the connection lines as corresponding weighted edges.
[0074] Step 308: Determine adjacency matrices corresponding to the multiple coded time series according to the multiple nodes and weighted edges.
[0075] Among them, the adjacency matrix represents a matrix of adjacent relationships between nodes. The adjacency matrix includes a node set and an edge combination. A one-dimensional array can be used to store all node data in the graph structure; a two-dimensional array can be used to store the relationship data (edges or arcs) between nodes. Each of the multiple coded time sequences can be used as a node of the adjacency matrix of the graph structure, and the correlation between the multiple coded time sequences can be used as the edge of the adjacency matrix of the graph structure. The correlation weight between the multiple coded time sequences can be determined based on the correlation, and the correlation weight can be used to represent the weighted edge between the corresponding two coded time sequences. In this process, a weight threshold can be pre-set, and the weight threshold can be the minimum value of the correlation weight corresponding to the weighted edge between the two coded time sequences. If the correlation weight is greater than the weight threshold, the connection line between the two nodes corresponding to the correlation weight is determined, and the connection line is used as the corresponding weighted edge; if the correlation weight is less than or equal to the weight threshold, it is determined that there is no weighted edge between the two nodes corresponding to the correlation weight.
[0076] The method of this embodiment can well capture the relationship between various related time series, and combine the relationship between related time series to predict the state of the target prediction item in the prediction time period, thereby improving the prediction accuracy of the state of the target prediction item in the prediction time period.
[0077] In an exemplary embodiment, obtaining the state prediction result by the prediction module may include:
[0078] The spatial convolution module determines and outputs the spatial information features of multiple coded time sequences according to the adjacency matrix and the multiple coded time sequences; and obtains the state prediction result according to the spatial information features and the time information features.
[0079] Among them, the prediction module includes a spatial graph convolution module. The spatial graph convolution module can be used to fuse the node information of each coded time series with the node information of its corresponding neighboring nodes to obtain the spatial dependency between the multiple coded time series, that is, the spatial information feature. The spatial graph convolution module can include two hybrid jump propagation layers, which respectively process the inflow information and outflow information of each node in the adjacency matrix, and then, the output information of the two hybrid jump propagation layers can be added to obtain the spatial information feature, and the action steps of each hybrid jump propagation layer in the two hybrid jump propagation layers include two steps of information propagation and information selection.
[0080] Furthermore, multiple coded time series, spatial information features and time information features can be fused to obtain fused features corresponding to multiple coded time series; finally, the state prediction result can be obtained based on the fused features.
[0081] In the method of this embodiment, the dual characteristics of time and space can be combined for prediction, thereby improving the prediction accuracy of the state of the target prediction item in the prediction time period.
[0082] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0083] Based on the same inventive concept, the embodiment of the present application also provides a state prediction device for implementing the state prediction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more state prediction device embodiments provided below can refer to the limitations of the state prediction method above, and will not be repeated here.
[0084] In one embodiment, as shown in FIG4 , a state prediction device is provided, including: an acquisition module 402, an encoding module 404 and a prediction module 406, wherein:
[0085] An acquisition module 402 is used to acquire multiple associated time series of target prediction items within a historical time period;
[0086] The encoding module 404 is used to perform time encoding and position encoding on each of the multiple time steps of each of the associated time series to obtain an encoded time series corresponding to each of the associated time series;
[0087] The prediction module 406 is used to obtain the state prediction result of the target prediction item within the prediction time period based on the multiple encoding time series using the pre-trained state prediction model.
[0088] In one embodiment, the prediction module 406 is also used to: input multiple encoded time series into the state prediction model; the state prediction model includes a feature extraction module, a graph structure generation module and a prediction module; the feature extraction module obtains the time information characteristics of each encoded time series, the graph structure generation module determines and outputs the adjacency matrix corresponding to the multiple encoded time series according to the multiple encoded time series, and the prediction module determines and outputs the state prediction result of the target prediction item within the prediction time period according to the adjacency matrix output by the graph structure generation module and the time information characteristics output by the feature extraction module.
[0089] In one embodiment, the prediction module 406 is further used to: obtain the correlation between any current coding time sequence among the multiple coding time sequences and the remaining coding time sequences except the current coding time sequence; and determine the adjacency matrix corresponding to the multiple coding time sequences based on the multiple coding time sequences and the correlation.
[0090] In one embodiment, the prediction module 406 is further used to: take the multiple coding time sequences as corresponding multiple nodes; determine the correlation weights between the current coding time sequence and the remaining coding time sequences in the multiple coding time sequences according to the correlation; determine the connecting lines between the multiple nodes according to the correlation weights, and take the connecting lines as corresponding weighted edges; determine the adjacency matrix corresponding to the multiple coding time sequences according to the multiple nodes and the weighted edges.
[0091] In one embodiment, the prediction module 406 is also used to: if the relevant weight is greater than the weight threshold, determine the connection line between the two nodes corresponding to the relevant weight, and use the connection line as the corresponding weighted edge; if the relevant weight is less than or equal to the weight threshold, determine that there is no weighted edge between the two nodes corresponding to the relevant weight.
[0092] In one embodiment, the prediction module includes a spatial graph convolution module; the prediction module 406 is also used to: determine and output the spatial information features of multiple encoded time sequences by the spatial convolution module according to the adjacency matrix and multiple encoded time sequences; and obtain the state prediction result according to the spatial information features and the time information features.
[0093] In one embodiment, the prediction module 406 is further used to: fuse the multiple encoded time series, the spatial information features and the time information features to obtain fused features corresponding to the multiple encoded time series; and obtain the state prediction result according to the fused features.
[0094] Each module in the above-mentioned state prediction device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0095] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5 . The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store state prediction related data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a state prediction method is implemented.
[0096] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0097] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0098] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0099] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0100] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0101] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0102] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0103] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A state prediction method, characterized in that: The method comprises: Get multiple associated time series of target forecast items within the historical time period; Performing time coding and position coding on each of the multiple time steps of each of the associated time series to obtain a coded time series corresponding to each of the associated time series; The state prediction result of the target prediction item within the prediction time period is obtained by utilizing the pre-trained state prediction model based on the multiple encoding time series.
2. The method according to claim 1, characterized in that The using of the pre-trained state prediction model to obtain the state prediction result of the target prediction item within the prediction time period based on the plurality of encoding time series includes: Inputting a plurality of the encoded time series into the state prediction model; the state prediction model comprises a feature extraction module, a graph structure generation module and a prediction module; The feature extraction module obtains the time information features of each of the encoded time series, the graph structure generation module determines and outputs the adjacency matrix corresponding to the multiple encoded time series based on the multiple encoded time series, and the prediction module determines and outputs the state prediction result of the target prediction item within the prediction time period based on the adjacency matrix output by the graph structure generation module and the time information features output by the feature extraction module.
3. The method according to claim 2, characterized in that The step of determining and outputting adjacency matrices corresponding to the plurality of encoding time sequences by the graph structure generation module according to the plurality of encoding time sequences includes: Obtaining the correlation between any current encoding time sequence among the plurality of encoding time sequences and the remaining encoding time sequences except the current encoding time sequence; The adjacency matrix corresponding to the plurality of encoding time sequences is determined according to the plurality of encoding time sequences and the correlation.
4. The method according to claim 3, characterized in that The step of determining the adjacency matrix corresponding to the plurality of encoding time sequences according to the plurality of encoding time sequences and the correlations comprises: Taking a plurality of the encoded time series as corresponding plurality of nodes; Determining, according to the correlation, a correlation weight between the current encoding time sequence and the remaining encoding time sequences in the plurality of encoding time sequences; Determine connection lines between the plurality of nodes according to the relevant weights, and use the connection lines as corresponding weighted edges; The adjacency matrices corresponding to the plurality of encoded time series are determined according to the plurality of nodes and the weighted edges.
5. The method according to claim 4, characterized in that Determining connection lines between the plurality of nodes according to the relevant weights, and using the connection lines as corresponding weighted edges, includes: If the relevant weight is greater than the weight threshold, determining the connection line between the two nodes corresponding to the relevant weight, and using the connection line as the corresponding weighted edge; If the relevant weight is less than or equal to the weight threshold, it is determined that the weighted edge does not exist between the two nodes corresponding to the relevant weight.
6. The method according to claim 2, characterized in that The prediction module includes a spatial graph convolution module; The prediction module in the state prediction model determines and outputs the state prediction result of the target prediction item within the prediction time period according to the adjacency matrix output by the graph structure generation module and the time information feature output by the feature extraction module, including: The spatial convolution module determines and outputs spatial information features of a plurality of the coded time sequences according to the adjacency matrix and the plurality of the coded time sequences; The state prediction result is obtained according to the spatial information feature and the temporal information feature.
7. The method according to claim 6, characterized in that The acquiring the state prediction result according to the spatial information feature and the temporal information feature includes: Fusing the plurality of coded time series, the spatial information features and the temporal information features to obtain fused features corresponding to the plurality of coded time series; The state prediction result is obtained according to the fusion feature.
8. A state prediction device, characterized in that: The device comprises: An acquisition module is used to obtain multiple associated time series of target prediction items within a historical time period; An encoding module, used for performing time encoding and position encoding on each of the multiple time steps of each of the associated time series to obtain an encoded time series corresponding to each of the associated time series; The prediction module is used to obtain the state prediction result of the target prediction item within the prediction time period based on the multiple encoded time series using the pre-trained state prediction model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Long-time sequence prediction method based on parallel neural network model LDform
CN115310674A
Time sequence prediction method, electronic equipment and storage medium
CN115617867A
Multivariate time series prediction method based on graph neural network and Transform
CN117113054A
Processing Multi-Horizon Forecasts For Time Series Data
US20230018125A1
Identifying root cause anomalies in time series
US20240118965A1
