CN-121660596-B - Multi-special power material demand prediction method and system integrating time sequence feature learning and domain knowledge reasoning
Abstract
The invention discloses a multi-special power material demand prediction method and system integrating time sequence feature learning and domain knowledge reasoning, and relates to the field of power material management. The method comprises the steps of obtaining historical data of electric power projects and materials, constructing a multi-dimensional characteristic data set, constructing a time sequence characteristic learning model based on a Transformer framework, capturing long-term dependence of material demands through a multi-head self-attention mechanism and a time attenuation mechanism, constructing a knowledge graph of the electric power material field, carrying out knowledge reasoning by adopting a graph neural network, designing a self-adaptive characteristic fusion layer, carrying out gating fusion on the time sequence characteristics and the field knowledge characteristics, constructing a multi-task learning framework, optimizing three tasks of demand prediction, purchasing batch planning and time window prediction, and ensuring that a prediction result accords with service constraint through a post-processing mechanism. The method and the system realize accurate prediction of the requirements of different types of electric power materials, and remarkably improve the intelligent level of the material management of electric power enterprises.
Inventors
- WANG CHAO
- LIU LIYANG
- GUO ZIYAO
- DONG SIQING
- ZHU NAN
Assignees
- 国网辽宁省电力有限公司物资分公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251126
Claims (9)
- 1. The multi-special electric power material demand prediction method integrating time sequence feature learning and domain knowledge reasoning is characterized by comprising the following steps: Step S1, acquiring historical data of electric power project materials, and constructing a multi-dimensional characteristic data set containing 16 special materials, wherein the multi-dimensional characteristic data set comprises historical demand sequence characteristics, project attribute characteristics, time period characteristics and material association characteristics; S2, constructing a time sequence feature learning model based on a transducer architecture, taking feature vectors in the multi-dimensional feature data set as input, and extracting time sequence feature vectors of material demands through an input embedding layer, a multi-head self-attention layer, a feedforward network layer and a residual error connection and layer normalization mechanism of the time sequence feature learning model; step S3, constructing a knowledge graph of the electric power material field, defining a physical set including material entities, item types, technical standards, suppliers and warehouses and relations thereof, adopting a graph neural network to encode the knowledge graph, and aggregating neighbor node information through a message transmission mechanism; S4, designing an adaptive feature fusion layer, calculating fusion weight through a gating mechanism, and carrying out adaptive fusion on the time sequence feature vector and the domain knowledge feature vector to generate a comprehensive feature representation; Step S5, establishing a multi-task learning framework, and based on the comprehensive characteristic representation, simultaneously training three subtasks of a demand prediction branch, a purchase batch optimization branch and a time window prediction branch by sharing an encoder layer and a task specific layer, and balancing each task loss function by adopting a dynamic weight adjustment strategy, wherein the method specifically comprises the following steps: the shared encoder layer comprises a Transformer encoder and a feature fusion layer at the bottom layer, all tasks share the bottom layer representation, and the universal feature representation is learned ; The demand quantity prediction branch adopts a three-layer full-connection network, and the network structure is that Wherein The loss function is mean square error Wherein For the predicted demand of the i-th material, Is the real demand; The purchasing batch optimization branch adopts an Actor-Critic reinforcement learning framework to define a state space Wherein For the current stock level of various types of materials, In order to predict the future demand of the vehicle, In order to be able to use the funds, Defining action space for the capacity of various material suppliers Wherein For the number of times of purchase of the batch, Is the first Purchasing quantity of various materials in batch, designing rewarding function Wherein For the purpose of inventory costs, In order to be out of stock for the cost, In order to be able to purchase the cost, , , Is a weight coefficient, and an Actor network output strategy Critic network estimates state value Dominance function Wherein Is a discount factor, actor loss Critic loss ; The time window prediction branch adopts LSTM network, the hidden unit number is 128, and the input gate Forgetting door Output door Candidate memory Memory unit Hidden state The output sequence length is the length of the predicted time window The loss function is cross entropy Wherein In order to be truly distributed, In order to predict the distribution of the light, Is the time classification number; self-adaptively balancing loss functions of all task branches by adopting dynamic weight adjustment strategy, and total loss functions Initial weight Adjusting weights according to task uncertainty Wherein In order for the rate of learning to be high, For the task Variance of loss over validation set, normalized weights ; And S6, establishing a post-processing module based on rules, and carrying out business constraint inspection, time sequence smoothing, anomaly detection and correction and seasonal adjustment on the prediction result to generate a final material demand prediction plan.
- 2. The method according to claim 1, wherein in step S1, the data in the multi-dimensional feature dataset is a three-dimensional tensor Wherein Is the number of the material categories , For the time step size of the time step, The specific construction process comprises the following steps of: Historical demand sequence feature extraction of past Material demand sequence for individual time steps Calculate 3 month moving average And 6 month moving average Calculating standard deviation of material demand Maximum value Minimum value Calculating the ring ratio increase rate And a rate of increase of the same ratio ; Item attribute feature using one-hot coding to represent item type The method comprises the steps of building, technical improvement, overhaul, marketing, information communication, operation maintenance and emergency repair, encoding into 7-dimensional vectors, and classifying the scale of the project according to the investment limit Four grades of super-large, medium and small, and the stage of coding item The project budget limit is determined for three stages of early preparation, construction, ending and acceptance Performing logarithmic transformation, encoding the geographical location of the item as a regional feature ; The time period characteristic is that the month M is represented by sine-cosine cyclic coding, , Wherein Numbering months, quarters by single-hot coding Extracting year Identifying holidays as trend characteristics Weekday/weekend For a special period of time ; Extracting the demand sequence of related materials Wherein Calculating the strength of the upstream-downstream relationship between the materials Quantifying the intensity of the substitution relation between materials Calculating the similarity of the category of the materials based on the technical parameters and the use scene Calculating the supplier concentration 。
- 3. The method according to claim 2, wherein in step S2, the construction of the time series feature learning model specifically includes: From a multi-dimensional feature dataset Extracting time sequence data of single material category as time sequence feature learning model input, for the first Category of individual materials, extract ; The input embedding layer first characterizes the input by linear transformation Mapping to High-dimensional space is maintained to obtain embedded vectors Wherein In order to embed the weight matrix, Is a bias vector, then adds a position code , , Wherein For the position index to be used, Index dimension, final input vector is ; The multi-head self-attention layer is arranged A plurality of parallel attention heads, each head having a dimension of For the first The number of attention points of the user is that, Computing a query matrix Key matrix Value matrix Wherein In order for the weight matrix to be learnable, Is the first Input vector of layer encoder, calculating attention weight Calculating a weighted output Splicing the outputs of all the heads Wherein The weight matrix is output; The time-decay attention mechanism introduces a time-decay factor Correction of attention weight Wherein For attention weighting matrix Middle (f) Line 1 The elements of the column are arranged such that, Is a time step And A distance therebetween; for the corrected weight renormalization of ; The feedforward network layer comprises two layers of fully connected networks Wherein , , , And Is a bias vector, and the activation function adopts ; In the residual connection and layer normalization mechanism, residual connection and layer normalization are added after each multi-head attention layer or feedforward network layer Wherein Representing the output of a multi-head attention or feed forward network, stacking Layer encoder, each layer comprising a multi-headed self-attention sub-layer and a feed forward network sub-layer, ultimately outputting timing feature vectors 。
- 4. The method according to claim 3, wherein in the step S3, the construction and reasoning of the domain knowledge graph specifically includes: S3.1, constructing a knowledge graph of the electric power material field; defining a set of entities = { Material category, item type, technical standard, vendor, warehouse }, each entity has an attribute set Defining a set of relationships = { Need, provision, store, replace, associate, conform }, form triplet set Wherein In order to be a head entity, In order to be a relationship to each other, Is a tail entity; step 3.2, coding the knowledge graph by adopting a three-layer graph attention network GAT; First, the Layer node The representation of (c) is updated as Wherein Is a node Is used to determine the neighbor set of a neighbor, In order for the weight matrix to be learnable, Is an activation function; In order for the attention coefficient to be a factor of attention, Wherein In order for the attention vector to be of interest, The operation of the splice is indicated and, Embedding for edge type; Step 3.3, the rule reasoning layer converts business rules of the power industry into logic constraints to generate weight adjustment of material demands; Constructing a rule base containing a plurality of business rules Each rule is expressed as IF-THEN form: Rules of IF condition THEN conclusion Given the current state Traversing rule base to find out meeting condition Execute the corresponding conclusion Rule reasoning results are expressed as weight adjustment vectors Wherein Initializing for the number of material categories Updating the weight increment of the corresponding material for each triggered rule; Step 3.4, association rule learning automatically discovers implicit knowledge patterns from historical data, adopts an association rule mining algorithm Apriori, and sets a minimum support threshold value And a minimum confidence threshold Excavating a frequent co-occurrence mode and an association rule among materials; S3.5, carrying out multi-hop reasoning based on the knowledge graph; Given query entity By means of Collecting related knowledge by jump graph traversal, obtaining direct neighbor by 1 st jump Obtaining second-order neighbors in the 2 nd hop At most The jump is performed in the first place, Inferring path scores Wherein Is the first Attention weight of jump, selecting path with highest score Obtaining domain knowledge feature vector by integrating path information and path information 。
- 5. The method according to claim 4, wherein in step S4, the adaptive feature fusion process is: calculating a fusion gating value by adopting a gating mechanism Wherein In order to gate the weight matrix, For the offset scalar quantity, The function is activated for Sigmoid, Representing characteristic stitching; Normalizing a timing feature vector and a domain knowledge feature vector , Wherein , Respectively mean value and standard deviation of time sequence feature vectors; mean values of domain knowledge feature vectors respectively Standard deviation; calculating attention of time sequence features to domain knowledge features Calculating the attention of domain knowledge features to time-lapse features Obtaining interaction enhancement features , ; Adaptive fusion to generate a composite feature representation Wherein The weights calculated for the gating mechanism are, , ; Feature enhancement by nonlinear transformation to obtain enhanced integrated feature representation Wherein In order to enhance the weight matrix, Is biased.
- 6. The method according to claim 5, wherein in step S6, the post-processing optimization specifically comprises: the business constraint check comprises: inventory capacity constraint: Wherein In order to predict the amount of purchase, The warehouse capacity is 0.9 as a safety coefficient; budget constraints: Wherein Is the first The unit price of the material-like articles, Is the first The purchase quantity of the material of the class, Is a budget amount; Supply capability constraints: Wherein Is the first The supplier capacity of the class materials; lead time constraints: Wherein Is the first The planned purchasing time of the class material, Is the first Lead time promised by suppliers of class materials, Is the actual demand time; the time sequence smoothing process adopts an exponentially weighted moving average EWMA, and the smoothed sequence Wherein Is a time step Is used to determine the original predicted value of (1), In order to smooth the coefficient of the coefficient, Performing optimal state estimation by Kalman filtering, and performing state equation Observation equation Wherein In the form of a state transition matrix, In order to observe the matrix, In order for the process to be noisy, Is observation noise; the abnormality detection and correction adopts an Isolation Forest algorithm to detect abnormal values and abnormal scores Wherein For the sample Is used for the control of the average path length of the (c), Setting abnormal threshold value for normalizing factor of path length When (when) If the detected abnormal value is determined to be abnormal Then linear interpolation correction is adopted Wherein As a mean value of the history, Is the historical standard deviation; the seasonal adjustment is decomposed by a time series Wherein As a component of the trend the composition, As a seasonal component of the composition, Extracting stable seasonal pattern as random component Wherein For the month of the year, the time of day, For the number of years, Is the first Average seasonal factor of month, adjusted predictive value Wherein Is a yearly average seasonal factor.
- 7. A multi-special power material demand prediction system integrating time sequence feature learning and domain knowledge reasoning is characterized by comprising: the data acquisition module is used for acquiring power project material historical data from a business system of a power enterprise and carrying out data preprocessing to construct a multidimensional characteristic data set containing 16 types of special materials; The time sequence feature learning module is used for inputting feature vectors in the multi-dimensional feature data set into a time sequence feature learning model and extracting time sequence feature vectors required by materials, wherein the time sequence feature learning model is constructed based on a Transformer architecture and comprises an input embedding layer, a multi-head self-attention layer integrating a time attenuation mechanism, a feedforward network layer and a residual error connection and layer normalization mechanism; The domain knowledge reasoning module is used for generating domain knowledge feature vectors and comprises a knowledge map construction sub-module, a graph neural network coding sub-module, a rule reasoning sub-module, an association rule learning sub-module and a multi-hop reasoning sub-module; the feature fusion module is used for fusing time sequence features and domain knowledge features and comprises a gating machine sub-module, a feature alignment sub-module, a cross-modal attention sub-module and a feature enhancer module; the multi-task prediction module comprises a demand prediction branch, a purchase batch optimization branch and a time window prediction branch, and realizes multi-task joint optimization through a shared encoder and a task specific layer; the post-processing optimization module comprises a constraint inspection sub-module, a time sequence smoothing sub-module, an abnormality detection sub-module and a seasonal adjustment sub-module, and is used for generating a final material demand prediction plan meeting the service requirements; and the visual display module is used for displaying the prediction result, the trend analysis chart, the early warning information and automatically generating a report.
- 8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-project power supply demand prediction method of fusion timing feature learning and domain knowledge reasoning of any one of claims 1-6.
- 9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the multi-project power supply demand prediction method of fusion timing feature learning and domain knowledge reasoning as claimed in any one of claims 1 to 6.
Description
Multi-special power material demand prediction method and system integrating time sequence feature learning and domain knowledge reasoning Technical Field The invention relates to the technical field of artificial intelligence and electric power material management, in particular to a method and a system for constructing a multi-special electric power material demand prediction model by integrating time sequence feature learning and domain knowledge reasoning. Background With the rapid development of the electric power industry and the continuous promotion of power grid construction in China, the scale and complexity of electric power projects are continuously improved, and project material management faces unprecedented challenges. The electric power supplies are various, including 16 large types of thousands of supplies such as capital construction, technical improvement, operation and maintenance, and the like, the demand pattern difference of various supplies is obvious, and great difficulty is brought to demand prediction. The traditional material demand prediction method mainly relies on manual experience and simple statistical analysis, and has the following technical problems: first, the prediction method is single, and many basic statistical methods such as moving average and exponential smoothing are adopted, so that a complex demand change mode cannot be captured. According to statistics, the prediction accuracy of the traditional method is generally 60-70%, and the requirement of fine management is difficult to meet. These methods are based on linear assumptions, and cannot deal with nonlinear relationships, long-term dependencies, and multi-factor interactions in material demand. Second, there is a lack of effective utilization of domain knowledge. The power material demand is influenced by project types, technical standards, seasonal factors, equipment parameters and other aspects of expertise, and the existing method can not fully integrate the knowledge in the fields to predict. For example, there is a significant difference in the material demand patterns of 220kV substation project and 110kV project, but the conventional method cannot effectively distinguish. Thirdly, the demand characteristics of different types of materials are obviously different, and a unified prediction model is difficult to adapt to diversified material categories. For example, infrastructure material requirements exhibit project driven features focused on project construction periods, while operational and maintenance material requirements exhibit periodic features that are closely related to equipment maintenance plans, with marketing material requirements being greatly affected by seasonal and political factors. The existing method is difficult to conduct differentiation processing for different material categories. Fourth, the prediction results are disjointed from the actual business constraints, resulting in the difficulty of direct application of the generated demand plans, requiring a large amount of manual adjustment. In the actual business, various constraint conditions such as stock capacity limitation, budget constraint, supplier capacity limitation, lead time constraint and the like exist, and the prediction model needs to consider the constraint to generate an executable purchasing plan. In recent years, the deep learning technology has made important progress in the field of time sequence prediction, and cyclic neural networks such as LSTM, GRU and the like can effectively capture long-term dependence of time sequence data, and a transducer architecture realizes parallel computation and global modeling through a self-attention mechanism. However, the existing research is mainly focused on a general prediction model, and a special research for electric power material demand prediction is lacking. How to combine advanced deep learning technology with knowledge in the electric power field to construct an intelligent prediction model suitable for multiple types of electric power materials is a technical problem to be solved currently. Disclosure of Invention Aiming at the defects of the prior art, the invention provides a multi-special electric power material demand prediction method and system integrating time sequence feature learning and domain knowledge reasoning, and aims to solve the technical problems that the traditional method is low in prediction precision, poor in domain adaptability, incapable of processing multi-type materials and the like. The aim of the invention can be achieved by the following technical scheme: the invention provides a multi-special power material demand prediction method integrating time sequence feature learning and domain knowledge reasoning, which comprises the following steps: The method comprises the steps of S1, obtaining historical data of electric power project materials, constructing a multidimensional characteristic dataset containing 16 special materials, where