Multi-specialty electric power material demand prediction method and system fusing time sequence feature learning and domain knowledge reasoning

By constructing a multi-specific power material demand forecasting method that integrates temporal feature learning and domain knowledge reasoning, the accuracy and adaptability issues of traditional forecasting methods are solved, achieving high-precision material demand forecasting and power material management that meets business constraints.

CN121660596BActive Publication Date: 2026-05-08STATE GRID LIAONING ELECTRIC POWER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID LIAONING ELECTRIC POWER CO LTD
Filing Date
2025-11-26
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Traditional power material demand forecasting methods have low forecasting accuracy and poor domain adaptability. They cannot handle the differences in demand characteristics among various types of materials, and the forecasting results are out of touch with actual business constraints.

Method used

A multi-specific power material demand forecasting method is constructed that integrates temporal feature learning and domain knowledge reasoning. Temporal features are extracted through the Transformer architecture, and the power material domain knowledge graph is encoded by graph neural network. Multi-hop reasoning and rule reasoning are used to generate material demand features. The method adaptively integrates temporal and domain knowledge features and establishes a multi-task learning framework for prediction.

Benefits of technology

It improves the accuracy and adaptability of power material demand forecasting, and the generated forecast results conform to actual business constraints, enabling dynamic adjustment and optimization of procurement plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660596B_ABST
    Figure CN121660596B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-special power material demand prediction methods and systems of fusion time sequence feature learning and domain knowledge reasoning, and it is related to electric power material management field.The method comprises: obtaining electric power project material historical data, constructs multidimensional feature dataset;Based on the construction of time sequence feature learning model of Transformer architecture, the long-term dependence relationship of material demand is captured through multi-head self-attention mechanism and time decay mechanism;Electric power material domain knowledge graph is constructed, and knowledge reasoning is carried out using graph neural network;Design adaptive feature fusion layer, gate fusion is carried out to time sequence feature and domain knowledge feature;Establish multi-task learning framework, simultaneously optimize demand quantity prediction, procurement batch planning and time window prediction three tasks;Through post-processing mechanism, it is ensured that the prediction result meets business constraints.The application realizes the accurate prediction of the demand of different types of electric power materials, and significantly improves the intelligent level of electric power enterprise material management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and power material management technology, specifically to a method and system for constructing a multi-specific power material demand prediction model that integrates temporal feature learning and domain knowledge reasoning. Background Technology

[0002] With the rapid development of my country's power industry and the continuous advancement of power grid construction, the scale and complexity of power projects are constantly increasing, posing unprecedented challenges to project material management. Power materials are diverse, encompassing thousands of items across 16 major categories, including infrastructure, technological upgrades, and operation and maintenance. The demand patterns for these various materials differ significantly, making demand forecasting extremely difficult.

[0003] Traditional methods for forecasting material demand mainly rely on human experience and simple statistical analysis, which have the following technical problems:

[0004] First, the forecasting methods are simplistic, mostly relying on basic statistical methods such as moving averages and exponential smoothing, which fail to capture complex demand change patterns. Statistics show that the forecasting accuracy of traditional methods is typically only 60-70%, which is insufficient for the needs of refined management. These methods are based on linear assumptions and cannot handle the nonlinear relationships, long-term dependencies, and multi-factor interactions in material demand.

[0005] Second, there is a lack of effective utilization of domain knowledge. The demand for power materials is influenced by various professional knowledge factors, including project type, technical standards, seasonal factors, and equipment parameters. Existing methods fail to fully integrate this domain knowledge for prediction. For example, the material demand patterns for 220kV substation projects differ significantly from those for 110kV projects, but traditional methods cannot effectively distinguish between them.

[0006] Third, the demand characteristics of different types of materials vary significantly, making it difficult for a uniform forecasting model to adapt to the diverse categories of materials. For example, the demand for infrastructure materials is project-driven, concentrated during the project construction phase; while the demand for operation and maintenance materials exhibits cyclical characteristics, closely related to equipment maintenance plans; and the demand for marketing materials is greatly affected by seasonality and policy factors. Existing methods are insufficient for differentiated processing of different material categories.

[0007] Fourth, the forecast results are out of sync with actual business constraints, making the generated demand plans difficult to apply directly and requiring extensive manual adjustments. Actual business operations involve various constraints such as inventory capacity limitations, budget constraints, supplier capacity limitations, and delivery cycle constraints. The forecasting model needs to consider these constraints to generate an executable procurement plan.

[0008] In recent years, deep learning technology has made significant progress in the field of time series forecasting. Recurrent neural networks such as LSTM and GRU can effectively capture long-term dependencies in time series data, and the Transformer architecture achieves parallel computing and global modeling through self-attention mechanisms. However, existing research mainly focuses on general forecasting models, lacking specialized research on power resource demand forecasting. How to combine advanced deep learning technology with knowledge in the power field to build intelligent forecasting models applicable to multiple types of power resources is a pressing technical challenge that needs to be addressed. Summary of the Invention

[0009] To address the shortcomings of existing technologies, this invention provides a multi-specific power material demand forecasting method and system that integrates temporal feature learning and domain knowledge reasoning, aiming to solve the technical problems of low forecasting accuracy, poor domain adaptability, and inability to handle multiple types of materials in traditional methods.

[0010] The objective of this invention can be achieved through the following technical solutions:

[0011] The first aspect of this invention provides a multi-specific power material demand forecasting method that integrates temporal feature learning and domain knowledge reasoning, comprising the following steps:

[0012] Step S1: Obtain historical data on power project materials and construct a multidimensional feature dataset containing 16 categories of specialized materials. The multidimensional feature dataset includes historical demand sequence features, project attribute features, time cycle features, and material association features. The 16 categories of specialized materials include: infrastructure materials, technical renovation and overhaul materials, marketing materials, information and communication materials, operation and maintenance materials, emergency repair materials, office supplies, production tools and equipment materials, safety protection materials, environmental protection materials, science and technology project materials, small-scale infrastructure materials, retail procurement materials, service materials, leasing materials, and spare parts materials. Specifically, it includes:

[0013] Step S1.1: Collect historical data from multiple business systems of the power company to build a complete data foundation. The data collection scope covers multiple data sources, including Enterprise Resource Planning (ERP), Materials Management System (MMS), Project Management System (PMS), and Workshop Management System (WMS). Specifically:

[0014] The collection of historical procurement data includes key fields such as material code, material name, specifications, quantity, procurement time, unit price, and supplier information. To ensure data completeness and representativeness, the historical data spans at least three years, covering the entire business cycle. For infrastructure-related materials, additional procurement records associated with specific projects need to be collected, including project number, project stage, and other information.

[0015] The collection of project execution data focuses on the project's basic attributes and execution progress information. Basic attributes include project number, project name, project type (transmission and transformation project, distribution network project, technical renovation project, etc.), construction scale (voltage level, line length, substation capacity, etc.), investment amount, and planned construction period. Execution progress information includes commencement date, completion time of each stage, actual completion time, and engineering change records.

[0016] Inventory data collection encompasses real-time inventory levels, historical inbound and outbound records, inventory turnover rates, and safety stock settings for various materials. By analyzing patterns in inventory data changes, the seasonality and cyclical nature of material demand can be identified.

[0017] External environmental data collection includes seasonal information, holiday schedules, major event dates, relevant policy documents, market price indices, and raw material price trends. These external factors have a significant impact on demand for goods, especially seasonal factors, which have a significant impact on the demand for goods such as air conditioners and heating equipment.

[0018] Step S1.2: Data preprocessing is a crucial step in ensuring data quality. First, data cleaning is performed to identify and handle missing values, outliers, and duplicate records. For missing values, methods such as mean imputation, forward imputation, and interpolation are used depending on the data characteristics. Fields with a missing value rate exceeding 30% are removed. For outliers, box plots and the 3σ rule are used for detection. Outliers are defined as data points exceeding Q3 + 1.5IQR or falling below Q1 - 1.5IQR, where Q1 and Q3 are quartiles, and IQR is the interquartile range.

[0019] Data standardization includes unifying the material coding system, standardizing units of measurement, and unifying the time format. A material coding mapping table is established to unify the coding of different systems to the State Grid Corporation's material coding standard GB / T 2659. Units of measurement are uniformly adopted using the International System of Units (SI), such as kilograms (kg) for mass and meters (m) for length. The time format is unified to the ISO 8601 standard, accurate to the day.

[0020] Time alignment aligns data from different frequencies to a unified timeline. Procurement data is summarized daily, inventory data is captured as a snapshot at the end of the day, and project progress data is updated weekly. Time window aggregation aligns all data to a monthly time granularity, preserving sufficient time-series information while reducing data volume.

[0021] Step S1.3: Construct a multidimensional feature dataset, organizing the preprocessed data into a three-dimensional tensor. ,in Number of material categories , For time step ( (i.e., monthly data from the past 3 years) This represents the total number of feature dimensions.

[0022] Historical demand sequence features (20 dimensions): Extracting past Monthly material demand sequence As a fundamental feature; calculate the 3-month moving average. and 6-month moving average Smoothing short-term fluctuations; calculating the statistical characteristics of material demand: standard deviation. maximum value minimum value , median coefficient of variation ; Calculate the rate of change in demand: month-on-month growth rate Year-on-year growth rate Constructing a demand trend indicator: linear fitting slope ,in It is a time series.

[0023] Project attribute characteristics (15 dimensions): Project type One-hot coding is used, including seven main categories: infrastructure, technological upgrading, major repair, marketing, information and communication, operation and maintenance, and emergency repair, coded as a 7-dimensional vector; project scale level Based on investment amount (I): Extra-large (I ≥ 500 million yuan) is coded as 4; large (100 million ≤ I < 500 million yuan) is coded as 3; medium (10 million ≤ I < 100 million yuan) is coded as 2; small (I < 10 million yuan) is coded as 1. Project stage Codes: Preliminary preparation stage (0,0,1), construction stage (0,1,0), final acceptance stage (1,0,0); Project budget Perform logarithmic transformation Eliminate differences in magnitude; project geographical location Encoded as a province-specific one-hot vector, 31-dimensional; Project duration Project progress on a monthly basis .

[0024] Time periodicity features (10 dimensions): Months are encoded using sine-cosine cyclic encoding. , ,in Months are numbered, preserving the cyclical nature of months; December and January are adjacent in the feature space. Quarter codes... Using one-hot vectors, 4-dimensional; year As a continuous variable, it reflects long-term trends; holiday markers Spring Festival (1,0,0,0), National Day (0,1,0,0), May Day (0,0,1,0), Other (0,0,0,1); Weekday indicator : 1 for weekdays, 0 for weekends; Special period markers The value for peak summer demand (June-September) is 1, the value for peak winter demand (December-February of the following year) is 2, and the value for all other months is 0.

[0025] Material correlation characteristics (10 dimensions): Extracting the demand sequence of other materials that are strongly correlated with the target material, and using the Pearson correlation coefficient. Filtering correlation coefficients For the materials, retain a maximum of 5 average demand values ​​for related materials; strength of upstream and downstream relationships. Determined through supply chain network analysis, defined as ,in For supplies supplies Directed edge weights; substitution relationship strength Based on functional similarity calculation ,in Functional feature vector; Material category similarity Shortest path distance based on material classification tree calculate, Supplier concentration ,in For the first The supply share of each supplier This refers to the number of suppliers.

[0026] After feature construction, a multidimensional feature dataset is obtained. , where 16 is the number of material categories, 36 is the time step, and 55 is the total number of feature dimensions (20+15+10+10).

[0027] Step S2: Construct a temporal feature learning model based on the Transformer architecture. Take the features in the multidimensional feature dataset as input, and extract the temporal feature vector of resource demand through the temporal feature learning model. Give full play to the advantages of the self-attention mechanism in capturing long-term dependencies. The temporal feature learning model includes an input embedding layer, a multi-head self-attention layer with a time decay mechanism, a feedforward network layer, and residual connections and layer normalization mechanisms.

[0028] The multidimensional feature dataset constructed in step S1 Complete data containing 16 material categories. The Transformer model learns temporal features for each material category separately. For the... Each category of supplies ( Extract time-series data for this category from the complete dataset: Where: the first dimension index Select the material category; the second dimension ":" retains all 36 time steps; the third dimension ":" retains all 55 features. Extracted... As input to the Transformer, T=36 is the number of time steps and D=55 is the feature dimension.

[0029] The input embedding layer is responsible for mapping the original input features to a high-dimensional semantic space. Given a sequence of input features for a single material category. ,in For the first Each time step 3D feature vectors; mapping the input to a linear transformation Dimensional space:

[0030]

[0031] in To embed the weight matrix, This is the bias vector. The embedding weights are randomly initialized and follow a uniform Xavier distribution.

[0032] Position encoding is used to inject positional information into the sequence. It employs a combination of sine and cosine functions for encoding.

[0033]

[0034]

[0035] in For location index, Dimension index. Location encoding matrix. Adding it to the embedding vector yields the final input: .

[0036] The multi-head self-attention layer is a core component of the Transformer, capable of attending to different representational subspaces of a sequence in parallel. There are 1 attention head, and each head has 1 dimension. .

[0037] For the Layer encoder, input is For the first One attention point ( First, the query Q, key K, and value V matrices are generated through three learnable linear transformations:

[0038] , ,

[0039] in, For learnable weight matrix; query matrix The key matrix represents "what information I want". The value matrix represents "what information I have". It indicates "specific information content".

[0040] Calculate the attention score matrix ,in Indicates position Position The original attention score. To prevent the gradient from vanishing due to an excessively large dot product, scaling is applied:

[0041]

[0042] The attention weight matrix is ​​obtained by normalization using the softmax function. , of which Line number The elements of the column are:

[0043]

[0044] Indicates position Position The normalized attention weights satisfy .

[0045] Calculate the weighted output:

[0046]

[0047] Concatenate the outputs of h attention heads and perform a linear transformation:

[0048]

[0049] in To output the weight matrix, This is the final output of the multi-head attention layer.

[0050] The time decay mechanism described is an innovative design of this invention, integrated within the multi-head self-attention layer. Traditional attention mechanisms assign equal importance to all time steps, but in resource demand forecasting, recent data typically contains more relevant information. This invention, after calculating the standard attention weights in the multi-head self-attention layer, introduces a time decay factor to correct these attention weights:

[0051]

[0052] in The time decay coefficient, Attention weight matrix The Middle Line number Column elements, For time step and The distance between them. Attenuation factor. The exponential decrease in the time interval makes the model focus more on recent data.

[0053] Renormalize the corrected weights:

[0054]

[0055] Time decay coefficient Adjustments should be made adaptively based on the type of materials; for materials with rapidly changing demand (such as emergency repair materials), a larger attenuation coefficient should be set. For supplies with stable demand (such as office supplies), set a smaller attenuation coefficient. The attenuation coefficient is selected based on the autocorrelation function (ACF) of the historical demand series.

[0056] The feedforward network layer, following the multi-head self-attention layer, performs a nonlinear transformation independently at each location. The feedforward network comprises two linear transformations and one ReLU activation:

[0057]

[0058] in , , The hidden layer dimension of a feedforward network is typically set to... . and The bias vector. ReLU activation function. Introducing nonlinearity enables the model to learn complex combinations of features.

[0059] The residual connections and layer normalization ensure stable training of deep networks. Residual connections and layer normalization are added after each sublayer (multi-head attention or feedforward network):

[0060]

[0061] in This represents the output of the sublayer. LayerNorm normalizes the feature dimensions of each sample:

[0062]

[0063] in The mean, For variance, and For learnable scaling and translation parameters, To prevent small constants from being divided by zero.

[0064] A stacked encoder with L=6 layers is used, each layer containing a multi-head self-attention sublayer and a feedforward network sublayer. The layer output is:

[0065]

[0066] After six layers of encoder abstraction, the final output is a temporal feature vector:

[0067]

[0068] To facilitate subsequent fusion, the temporal features are globally pooled to obtain a fixed-dimensional feature representation:

[0069]

[0070] in For the first Layer encoder at time step The output of .

[0071] Step S3: Construct a knowledge graph for the power materials domain, formally represent professional knowledge, encode the knowledge graph using a graph neural network, realize knowledge reasoning through a message passing mechanism, and generate domain knowledge feature vectors; the specific process is as follows:

[0072] Step S3.1: Construct a knowledge graph for the power materials sector.

[0073] First, define the ontology model. Entity set. It includes five core entities:

[0074] Material Category Entity E_material: Includes 16 categories of special materials, each of which is further subdivided into several subcategories, totaling 1236 material entities.

[0075] Project type entity E_project: includes power transmission and transformation projects, distribution network projects, technical renovation projects, major repair projects, marketing projects, etc., totaling 42 project type entities.

[0076] Technical standard entity E_standard: includes national standard GB, industry standard DL, enterprise standard Q / GDW, etc., totaling 328 standard entities.

[0077] Supplier entity E_supplier: Includes companies in the qualified supplier list, totaling 1523 supplier entities.

[0078] Warehouse entity E_warehouse: includes material warehouses at all levels, totaling 156 warehouse entities.

[0079] Each entity has a rich set of attributes. Taking a material category entity as an example, the attributes include: material code, material name, specifications, technical parameters (rated voltage, rated capacity, insulation class, etc.), quality grade, unit of measurement, reference price, shelf life, storage conditions, etc.

[0080] Relationship set Define the semantic relationships between entities, including:

[0081] "Need" Relationship (Need): Project Type → Material Category, indicating that a certain type of project requires a certain material, and the edge weight is the demand intensity;

[0082] "Supply" relationship (supply): Supplier → Material category, indicating that the supplier can supply a certain material, and the edge weight is the supply capacity score;

[0083] "Storage" relationship (storage): warehouse → material category, indicating that the warehouse stores a certain material, and the edge weight is the inventory quantity;

[0084] "Substitution" relationship (substitution): Material category → Material category, representing the substitutability between two materials, with the edge weight being the degree of substitution;

[0085] "Association" relationship (association): Material category → Material category, indicating that two materials are frequently used together, and the edge weight is the association strength;

[0086] "Compliant" relationship (compliant): Material category → Technical standard, indicating that the material conforms to a certain technical standard.

[0087] Knowledge graphs are represented in the form of triples: ,in For the head entity, For the relationship, The tail entity. After construction, the knowledge graph contains 3285 entities and 15628 relation triples.

[0088] The knowledge graph construction process combines automatic extraction and expert annotation. Automatic extraction draws entities and relationships from historical project documents, technical specifications, and procurement records. A Named Entity Recognition (NER) model, based on a BiLSTM-CRF architecture and trained on an annotated dataset, is used to identify entities such as material names and supplier names. A Relation Extraction (RE) model, based on dependency parsing, extracts subject-verb-object structures to identify relationships between entities. The expert annotation process involves inviting experts in the field of power material management to verify and supplement the automatic extraction results, ensuring the accuracy and completeness of the knowledge. The expert team consists of 5 senior engineers with an average of 15 years of experience.

[0089] Step S3.2: Encode the knowledge graph using graph neural network encoding to convert the knowledge graph into a low-dimensional dense vector representation.

[0090] A three-layer graph attention network (GAT) is used to encode the knowledge graph.

[0091] Initialize node characteristics ,in For different types of entities, the initial features are constructed by concatenating the embedding vector of the material code, the numerical features of the technical parameters, and the one-hot encoding of the classification features. For other types of entities, a similar method is used to construct the initial features.

[0092] No. The node update formula for layer GAT is:

[0093]

[0094] in For nodes The set of neighboring nodes, For the first The learnable weight matrix of the layer, As the activation function, use .

[0095] Attention coefficient compute nodes For neighboring nodes Importance:

[0096]

[0097]

[0098] in, For attention vector parameters, This represents vector concatenation. Embed vectors for edge types. Edge-type embedding maps different relation types to dense vectors, enabling the model to distinguish between different types of relations.

[0099] The dimensions of the three-layer GAT are set as follows: After three layers of propagation, the representation of each node incorporates information from its third-order neighbors. The final node representation is as follows: .

[0100] Step S3.3: The rule reasoning layer converts the business rules of the power industry into executable logical constraints and generates weight adjustments for material demand based on the current query status.

[0101] Rule base construction: rule base It contains M=156 business rules summarized by experts. Each rule... Represented in IF-THEN form:

[0102] rule :IF condition THEN Conclusion

[0103] in A conditional clause, consisting of one or more conditions connected by logical operators; This is the concluding clause, specifying the weight adjustment operation.

[0104] The variables in the rule conditions come from the feature data in step S1 and the knowledge graph in step S3.1, including:

[0105] - Project attributes: (Project Type) (Project Scale) (Project phase);

[0106] - Time characteristics: seasons, months, holidays;

[0107] - Material relationships: substitution relationships, related relationships, supply status;

[0108] Example of a rule:

[0109] Rule 1: IF ='Infrastructure' AND ='Construction and Building' THEN Increase Cable Demand Weight =1.5;

[0110] Meaning: During the construction phase of infrastructure projects, the demand for cables increases by 50%.

[0111] Rule 2: IF Season = 'Summer' THEN Increase the weight of air conditioning demand. ;

[0112] Meaning: Demand for air conditioning increases by 80% in summer.

[0113] Rule 3: IF ='Extra Large' AND ='Power Transmission and Transformation Projects' THEN Increase Transformer Demand Weight ;

[0114] Meaning: For mega-scale power transmission and transformation projects, the demand for transformers will double.

[0115] Rule 4: IF Material A and Material B are substitutes AND Material A is out of stock THEN Material B is recommended.

[0116] Meaning: When commodity A is out of stock, the demand for its substitute B increases by 20%.

[0117] The rule base contains 156 rules, covering different project types (42 rules), seasonal factors (24 rules), project stages (35 rules), material associations (30 rules), and emergency situations (25 rules).

[0118] Rule enforcement mechanism:

[0119] Given the current query status S (including project information, time information, inventory status, etc.):

[0120] (1) Rule matching: Traversing the rule base Evaluate each rule conditions Does the current state S satisfy the condition?

[0121] Add rules that meet the conditions to the trigger set. .

[0122] (2) Conflict resolution: If multiple rules result in different weight adjustments for the same material category, the maximum value strategy shall be adopted.

[0123] Choose the adjustment value with the highest weight.

[0124] (3) Generate weight vector: Initialize ,in This represents the number of material categories.

[0125] For each triggered rule Extracting conclusions Material Category Index and weight ,renew:

[0126]

[0127] Output weight adjustment vector ,in Indicates the first The demand weight adjustment coefficient for the category of materials. This weight vector will be used to adjust the path score in step S3.5 multi-hop inference and will affect the final domain knowledge feature vector in step S4 feature fusion.

[0128] Step S3.4: Association rule learning automatically discovers implicit knowledge patterns from historical data and mines frequent co-occurrence patterns and association rules among materials.

[0129] Define transaction set Each transaction This is a list of materials to be procured for a project. = {material1, material2, ...}; Itemset express Different supplies.

[0130] Itemset Support is defined as including The proportion of transactions in the total number of transactions:

[0131]

[0132] Set minimum support threshold It appears in less than 5% of projects. Frequent itemsets are generated using the Apriori algorithm.

[0133] Association rules are represented as X→Y, where X and Y are itemsets and The confidence level of the rule is:

[0134]

[0135] Set minimum confidence threshold Strong association rules. For example, the rule discovered is: "220kV substation project" → {"main transformer", "high voltage circuit breaker", "power cable"}, with a confidence level of 0.92, indicating that 92% of 220kV substation projects require these three materials.

[0136] Step S3.5: Multi-hop reasoning enables complex queries based on knowledge graphs. Given a query entity... (For example, for a certain material), collect relevant knowledge through graph traversal.

[0137] 1st hop: Get direct neighbors ;

[0138] Second hop: Obtain second-order neighbors ;

[0139] Jump k: The maximum number of jumps is set to Inference depth and computational complexity.

[0140] The reasoning path is represented as the sequence path = ( , , , , , ..., , The path score is calculated as the product of the attention weights for each hop.

[0141]

[0142] in, For nodes in GAT For nodes Attention weights.

[0143] Choose the path with the highest score. A path, fusing the feature representations of nodes along the path:

[0144]

[0145] in, For path length, For nodes The feature vectors are then normalized to obtain the final domain knowledge feature vectors. .

[0146] Step S4: Design an adaptive fusion mechanism to integrate the temporal feature vectors. With the domain knowledge feature vector Adaptive fusion is performed to dynamically balance the contributions of temporal features and domain knowledge features, generating a comprehensive feature representation. The specific process is as follows:

[0147] S4.1: Gating mechanism calculates fusion weights.

[0148] Time series feature vectors Domain knowledge feature vector splicing:

[0149]

[0150] in, Indicates the features after splicing; This indicates feature splicing.

[0151] Calculate the fusion weights using a gating network:

[0152]

[0153] in, For the gated weight vector, Let σ be the bias scalar, and σ be the Sigmoid activation function. Gating value Weights representing time-series features , The weights of domain knowledge features.

[0154] S4.2: Feature alignment eliminates the distribution differences of features across different modalities.

[0155] Calculate the mean and standard deviation of the time-series feature vector and the domain knowledge feature vector respectively:

[0156]

[0157]

[0158]

[0159]

[0160] Standardization characteristics:

[0161]

[0162]

[0163] in, To prevent small constants from being divided by zero.

[0164] S4.3: Cross-modal attention enhances the interaction between features.

[0165] Calculate the attention of temporal features to domain knowledge features:

[0166]

[0167] in For feature dimension, This indicates the degree of attention that temporal features pay to knowledge features.

[0168] Attention of computational domain knowledge features to temporal features:

[0169]

[0170] We obtain interactive enhancement features:

[0171]

[0172]

[0173] S4.4: Adaptive fusion to generate comprehensive feature representation:

[0174]

[0175] in, The weights calculated for the gating mechanism satisfy... .

[0176] S4.5: Feature enhancement further refines and fuses features through nonlinear transformations.

[0177]

[0178] in, To enhance the weight matrix, This is the bias vector. The final comprehensive feature representation is obtained. .

[0179] Step S5: Establish a multi-task learning framework. Based on the comprehensive feature representation, train three sub-tasks simultaneously—demand prediction branch, procurement batch optimization branch, and time window prediction branch—by sharing the encoder layer and task-specific layer. Employ a dynamic weight adjustment strategy to balance the loss functions of each task.

[0180] The shared encoder layer includes the aforementioned Transformer encoder and feature fusion layer. All tasks share these underlying representations to learn general features. .

[0181] The demand forecasting branch employs a multilayer perceptron (MLP) architecture to predict material demand for the next 1-3 months. The network structure includes three fully connected layers:

[0182]

[0183] in, , , ;

[0184]

[0185] in, , , ;

[0186]

[0187] in, , , ,here This represents the number of material categories.

[0188] A Dropout layer was added between each layer to prevent overfitting, with a dropout rate of p=0.2.

[0189] The loss function uses mean squared error (MSE):

[0190]

[0191] in, Let be the predicted demand for the i-th type of material. This represents the actual demand.

[0192] The procurement batch optimization branch models procurement decisions as a Markov decision process (MDP) and employs the Actor-Critic reinforcement learning framework.

[0193] The state space S is defined as follows:

[0194]

[0195] in This refers to the current inventory levels of various materials. Forecasting future demand, For available funds, This represents the supplier capacity for various materials. (State vector) .

[0196] Action space A is defined as:

[0197]

[0198] in For the number of purchase batches, For the first The procurement quantity of various materials in each batch. For simplification, the continuous action space is discretized into... One candidate action.

[0199] The reward function R considers three costs in combination:

[0200]

[0201] in,

[0202] Inventory costs ,in For the first Unit inventory cost of this type of material;

[0203] Out-of-stock costs ,in For the first Penalties for units experiencing stockouts of this type of material;

[0204] Procurement costs ,in Purchase price per unit For fixed costs;

[0205] Weighting coefficients are set to =0.3, =0.5, =0.2, which reflects that stockout costs have the greatest impact on business.

[0206] Actor Network Output the probability distribution of each action taken in a given state s. The network structure is as follows:

[0207]

[0208] in ,here, .

[0209] Critic Network Estimated state The value function. The network structure is:

[0210]

[0211] in , ,here, .

[0212] Advantage function Measure in state Take action below Advantages compared to the average level:

[0213]

[0214] in As a discount factor, To perform the action The next state after that.

[0215] The loss function of the Actor network is the policy gradient:

[0216]

[0217] The loss function of the Critic network is the temporal difference error:

[0218]

[0219] The time window prediction branch forecasts the distribution of material demand over time. An LSTM network is used to capture the temporal evolution patterns. The number of hidden units in the LSTM is... The STM gating mechanism is as follows:

[0220] Input Gate:

[0221] Forgotten Gate:

[0222] Output gate:

[0223] Candidate memories:

[0224] Memory unit update:

[0225] Hidden status update:

[0226] in Represents element-wise product. , vector.

[0227] LSTM unfolded by time step =3 steps (corresponding to the next 3 months), each step outputs the probability distribution of the time window:

[0228]

[0229] in , To categorize by time, monthly requirements are divided into... The ranges are: very low (0-20%), low (20-40%), medium (40-60%), high (60-80%), and very high (80-100%).

[0230] The loss function is cross-entropy:

[0231]

[0232] in For the one-hot encoding of the true distribution at time step t, This represents the probability distribution predicted by the model.

[0233] The dynamic weight adjustment strategy adaptively balances the loss functions of each task. The total loss function is:

[0234]

[0235] Initial weights This ensures that the initial contributions of each task are equal.

[0236] During training, the weights are adjusted based on the loss variance of each task on the validation set:

[0237]

[0238] in For the task The loss variance , To adjust the learning rate, set it to... Tasks with high variance indicate high uncertainty, so their weight should be reduced; tasks with low variance indicate stable learning, so their weight should be increased.

[0239] Normalized weights ensure :

[0240]

[0241] Step S6: Establish a rule-based post-processing mechanism to perform business constraint verification, time-series smoothing, anomaly detection and correction, and seasonal adjustments on the forecast results, generating the final material demand forecast plan to ensure that the forecast results conform to actual business constraints. Specifically, this includes:

[0242] Business constraint verification includes four aspects of constraints:

[0243] Inventory capacity constraint test: Does the predicted purchase quantity exceed the warehouse storage capacity?

[0244]

[0245] in Forecast the procurement volume of various materials. This represents the upper limit of warehouse capacity for various materials, with a safety margin of 0.9, reserving 10% space to cope with unexpected needs. If the predicted quantity exceeds the capacity limit, it will be reduced proportionally.

[0246]

[0247] Budget constraint check: Is the total procurement amount within the budget?

[0248]

[0249] in For the first The unit price of this type of material, For purchase volume, This is the budgeted amount. If the budget is exceeded, resources will be reduced according to priority: all resources will be ranked by importance, retaining the demand for high-priority resources and reducing the demand for low-priority resources.

[0250] Supply capacity constraints test whether the forecast exceeds the supplier's capacity:

[0251]

[0252] in For the first The total production capacity of suppliers for this type of material. If the capacity is exceeded, purchase in batches or find alternative suppliers.

[0253] Delivery cycle constraints ensure that procurement timelines match demand timelines:

[0254]

[0255] in For the first The planned procurement time for this type of material The delivery cycle promised by the supplier. This refers to the actual required timeframe. If this cannot be met, procurement should be initiated in advance or the demand plan adjusted.

[0256] Time-series smoothing eliminates abnormal fluctuations in the forecast. An exponentially weighted moving average (EWMA) is used.

[0257]

[0258] in For time step The original predicted value, The smoothed value. This is a smoothing factor. The smoothing factor is adjusted according to the characteristics of material demand.

[0259] Goods with stable demand (standard deviation) mean ): Increase the smoothing effect;

[0260] Goods with moderate demand fluctuations ): Balance smoothness and response;

[0261] Goods with highly volatile demand ( ): Stay sensitive to change.

[0262] Kalman filtering is used for optimal state estimation. The state equation is:

[0263]

[0264] The observation equation is:

[0265]

[0266] in State vector , These are the observed values ​​(i.e., the predicted values). State transition matrix , Observation matrix , For process noise, To observe noise.

[0267] Kalman filter recursion:

[0268] Prediction Step:

[0269] Update steps:

[0270] in For Kalman gain, Let be the state covariance matrix. The filtered demand estimate is: The first component.

[0271] Anomaly detection and correction: Identifying and handling outliers in predictions. The Isolation Forest algorithm is used for anomaly detection.

[0272] The algorithm constructs an isolation tree by randomly selecting features and split points. Outliers are usually far from other points, making them easier to isolate in the tree, and their path length is shorter.

[0273] Anomaly score calculation:

[0274]

[0275] in For the sample Average path length across all isolated trees Normalization factor for path length , For harmonic numbers .

[0276] Abnormal scores , A value close to 1 indicates an anomaly, and a value close to 0 indicates normal operation. Set an anomaly threshold. ,when It is judged as abnormal at that time.

[0277] For the detected outliers, further analysis of the causes of the anomalies is needed:

[0278] like (3σ principle), where This is the historical average. If the value is less than the historical standard deviation, it is considered a statistical outlier and is corrected using linear interpolation. .

[0279] If the anomaly corresponds to a real change in demand (such as the launch of a major project), the anomaly value is retained but an early warning flag is added to remind users to pay attention.

[0280] Seasonal adjustments refine the forecasts based on historical seasonal patterns. A time-series decomposition method is employed.

[0281]

[0282] in As a trend component, It is a seasonal ingredient. It is a random component.

[0283] The STL decomposition algorithm (Seasonal and Trend decomposition using Loess) is used for decomposition:

[0284] Trend Extraction: Extracting trends using Loess smoothing ;

[0285] Detrend: ;

[0286] Seasonal extraction: Group the detrended series by seasonal cycle and calculate the seasonality factor for each month;

[0287] Residual calculation:

[0288] Extract stable seasonal patterns and calculate the average seasonality factor for each month from multi-year data. :

[0289]

[0290] in For months, The number of years.

[0291] Adjust forecast values:

[0292]

[0293] in , which is the annual average seasonality factor. This adjustment ensures that the forecast results conform to historical seasonal patterns.

[0294] At this point, all post-processing steps are completed, generating the final material demand forecast plan, including: demand forecasts for various materials, recommended procurement batches and times, demand time window distribution, early warning information, and confidence intervals.

[0295] A second aspect of this invention provides a multi-specific power material demand forecasting system that integrates temporal feature learning and domain knowledge reasoning, comprising:

[0296] The data acquisition module is used to obtain historical data of power project materials from the business system of power companies and perform data preprocessing to build a multidimensional feature dataset containing 16 types of special materials.

[0297] The temporal feature learning module is used to input the feature vectors in the multidimensional feature dataset into the temporal feature learning model to extract the temporal feature vectors of resource requirements. The temporal feature learning model is built based on the Transformer architecture and includes an input embedding layer, a multi-head self-attention layer with a time decay mechanism, a feedforward network layer, and residual connections and layer normalization mechanisms.

[0298] The domain knowledge reasoning module includes a knowledge graph construction submodule, a graph neural network encoding submodule, a rule reasoning submodule, an association rule learning submodule, and a multi-hop reasoning submodule;

[0299] The knowledge graph construction submodule is used to construct a knowledge graph in the field of power materials, define entity sets and relation sets, and form a set of triples.

[0300] The graph neural network encoding submodule uses a graph attention network to encode the knowledge graph and aggregates neighbor node information through a message passing mechanism to generate node embedding vectors.

[0301] The rule reasoning submodule is used to convert the business rules of the power industry into logical constraints, perform rule matching and triggering based on the current state, and generate a weight adjustment vector for material demand.

[0302] The association rule learning submodule is used to automatically mine frequent co-occurrence patterns and association rules among materials from historical data, and uses the Apriori algorithm to discover implicit knowledge, supplement the rule base and enhance the knowledge graph.

[0303] The multi-hop reasoning submodule is used to perform k-hop graph traversal based on the constructed knowledge graph. Given a query entity, it collects relevant neighbor knowledge, and integrates path information through path score calculation and Top-K path selection.

[0304] The above sub-modules work together to ultimately generate domain knowledge feature vectors;

[0305] The feature fusion module, used to fuse temporal features and domain knowledge features, includes a gating mechanism submodule, a feature alignment submodule, a cross-modal attention submodule, and a feature enhancement submodule. The gating mechanism submodule calculates the fusion weights. The feature alignment submodule eliminates the distribution differences between temporal feature vectors and domain knowledge feature vectors. The cross-modal attention submodule enhances the interaction between temporal features and domain knowledge features, generating interactively enhanced features. The feature enhancement submodule generates a comprehensive feature representation based on the fusion weights.

[0306] The multi-task forecasting module includes demand forecasting branches, procurement batch optimization branches, and time window forecasting branches, which achieve joint optimization of multiple tasks through a shared encoder and task-specific layers.

[0307] The post-processing optimization module includes a constraint verification submodule, a time-series smoothing submodule, an anomaly detection submodule, and a seasonal adjustment submodule, which are used to generate the final material demand forecast plan that meets business requirements.

[0308] The visualization module is used to display forecast results, trend analysis charts, early warning information, and automatically generate reports.

[0309] A third aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-specific power material demand forecasting method that integrates time-series feature learning and domain knowledge reasoning.

[0310] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-specific power material demand forecasting method that integrates temporal feature learning and domain knowledge reasoning.

[0311] The beneficial effects of this invention are as follows: By deeply integrating time-series features and domain knowledge, the prediction accuracy is significantly improved; differentiated strategies are designed for 16 types of special materials to meet the prediction needs of different materials; considering actual business constraints, the generated prediction plan can be directly applied, reducing the workload of manual adjustments; and the entire process from data input to prediction result output is automated, greatly improving work efficiency. Attached Figure Description

[0312] Figure 1 This is a schematic diagram of the overall process of the method of the present invention;

[0313] Figure 2 This is a schematic diagram of the architecture of a Transformer-based temporal feature learning model.

[0314] Figure 3 This is a schematic diagram of the structure of a domain knowledge graph;

[0315] Figure 4 This is a schematic diagram of the structure of a multi-task learning framework;

[0316] Figure 5 This is a schematic diagram of the feature fusion mechanism;

[0317] Figure 6 A schematic diagram illustrating the classification system for 16 categories of special-purpose materials;

[0318] Figure 7 This is a schematic diagram of the functional modules of the prediction system. Detailed Implementation

[0319] To make the objectives, technical solutions, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0320] This embodiment underwent a six-month practical application test at a provincial power grid company to verify the effectiveness of the method of the present invention.

[0321] 1. Data Preparation

[0322] First, historical data for five years, from January 2019 to December 2023, was collected from the company's ERP system, materials management system, and project management system. The dataset includes:

[0323] Material procurement records: a total of 1.2 million records, covering procurement details of 16 categories of special materials;

[0324] Project execution data: Complete execution records for a total of 8,526 projects;

[0325] Inventory data: Daily inventory snapshots from 156 warehouses, totaling 280,000 records;

[0326] External environmental data: seasonal information, holiday schedules, policy documents, etc.

[0327] Next, in the data preprocessing stage, fields with a missing value rate exceeding 30% were removed, totaling 12 fields. Mean imputation was used to handle 15% of missing values, and forward imputation was used to handle the remaining 10%. Outliers were detected using box plots, and 2.3% of the outlier data were marked and processed.

[0328] A unified material coding system was established, mapping the original three sets of codes (company internal codes, supplier codes, and State Grid codes) to the State Grid standard codes, creating a coding mapping table containing 1,236 types of materials.

[0329] Finally, a multidimensional feature dataset is constructed with a monthly time granularity and a 36-month time window. The resulting feature tensor is then obtained. , where 16 is the number of material categories, 60 is the total time step (5 years), and 55 is the total number of feature dimensions.

[0330] Data set split: Data from 2019 to 2022 was used as the training set (48 months, accounting for 80%), data from January to June 2023 was used as the validation set (6 months, accounting for 10%), and data from July to December 2023 was used as the test set (6 months, accounting for 10%).

[0331] 2. Model Training

[0332] A phased training strategy is adopted:

[0333] Phase 1: Pre-training Phase (100 rounds)

[0334] The base model is trained using the training set;

[0335] Optimizer: AdamW, learning rate lr=1e-4, weight decay wd=0.01;

[0336] Batch size = 32;

[0337] Learning rate scheduling: cosine annealing, T_max=100;

[0338] Gradient clipping: clip_norm=1.0.

[0339] Phase 2: Specific Fine-tuning Phase (50 rounds × 16 categories)

[0340] Make minor adjustments for each type of material;

[0341] Freeze shared encoder parameters and update only the task-specific layer;

[0342] The learning rate is reduced to lr=5e-5.

[0343] Phase 3: Multi-task joint optimization phase (30 rounds)

[0344] Simultaneously train three prediction tasks;

[0345] Dynamically adjust task weights;

[0346] Early stop mechanism: Stop when the verification loss does not decrease for 10 consecutive rounds.

[0347] Model parameter configuration:

[0348] Transformer encoder: L=6 layers, h=8 attention heads , =2048;

[0349] Time decay coefficient: λ=0.15 for infrastructure, λ=0.08 for operation and maintenance, and λ=0.20 for emergency response;

[0350] GAT Graph Neural Network: 3 layers, dimensions 128→256→512;

[0351] Initial weights for multi-task learning: .

[0352] 3. Prediction Results

[0353] The prediction performance on the test set is as follows:

[0354] 1) Demand forecasting branch:

[0355] Mean absolute percentage error (MAPE) = 8.2%, root mean square error (RMSE) = 156.3 tons, prediction accuracy (error <15%) = 91.8%;

[0356] Prediction accuracy rates for various types of materials:

[0357] Infrastructure: 91.8% (MAPE=8.2%)

[0358] Technical upgrades and major repairs: 89.7% (MAPE=10.3%);

[0359] Maintenance and repair: 93.5% (MAPE=6.5%)

[0360] Marketing category: 92.2% (MAPE=7.8%);

[0361] Information and Communication Engineering: 88.3% (MAPE=11.7%)

[0362] Emergency repair category: 87.1% (MAPE=12.9%);

[0363] Office supplies: 94.2% (MAPE=5.8%)

[0364] Spare parts: average 90.5% (MAPE=9.5%).

[0365] 2) Procurement batch optimization branch:

[0366] Average inventory costs decreased by 23%, the stockout rate dropped from 8.5% to 2.1%, and capital tied up decreased by 18%.

[0367] 3) Time window prediction branch:

[0368] The accuracy rate for time distribution forecasting was 85.6%, and the accuracy rate for peak demand forecasting was 88.3%.

[0369] The method of the present invention was compared with the benchmark method in a comparative experiment, and the comparison results are shown in Table 1.

[0370] Table 1

[0371]

[0372] Table 1 shows that the accuracy is improved by 23.3 percentage points compared to the traditional ARIMA method; by 15.5 percentage points compared to the pure LSTM method; by 9.7 percentage points compared to the pure Transformer method; by 3.4 percentage points when knowledge graphs are introduced; and by another 3.4 percentage points when the multi-task learning framework is used.

[0373] The contribution of each module of the present invention was verified by ablation experiments, and the results are shown in Table 2.

[0374] Table 2

[0375]

[0376] In summary, this invention has been successfully applied to power material demand forecasting, achieving high-precision, interpretable, and business-friendly intelligent forecasting, providing strong support for the digital transformation of power enterprises.

[0377] Finally, it should be noted that the above embodiments are intended to illustrate the technical solutions of the present invention and do not constitute any limitation on the present invention. Those skilled in the art should fully understand that modifications to the technical solutions described in the foregoing embodiments or equivalent substitutions for any part or all of the technical features are entirely feasible. Such modifications or substitutions, as long as they do not depart from the scope of protection defined by the claims of the present invention, should be considered reasonable extensions of the present invention.

Claims

1. A multi-specific power material demand forecasting method integrating temporal feature learning and domain knowledge reasoning, characterized in that... Includes the following steps: Step S1: Obtain historical data of power project materials and construct a multidimensional feature dataset containing 16 types of special materials. The multidimensional feature dataset includes historical demand sequence features, project attribute features, time cycle features, and material association features. Step S2: Construct a temporal feature learning model based on the Transformer architecture, taking the feature vectors in the multidimensional feature dataset as input, and extracting the temporal feature vectors of resource requirements through the input embedding layer, the multi-head self-attention layer with time decay mechanism, the feedforward network layer, and the residual connection and layer normalization mechanism of the temporal feature learning model. Step S3: Construct a knowledge graph for the power materials domain, defining the entity set including material entities, project types, technical standards, suppliers, and warehouses, and their relationships; use a graph neural network to encode the knowledge graph, and aggregate neighbor node information through a message passing mechanism; based on the encoded graph representation, realize knowledge reasoning through rule reasoning and multi-hop reasoning of the knowledge graph, and generate domain knowledge feature vectors; Step S4: Design an adaptive feature fusion layer, calculate the fusion weights through a gating mechanism, and adaptively fuse the temporal feature vector with the domain knowledge feature vector to generate a comprehensive feature representation; Step S5: Establish a multi-task learning framework. Based on the comprehensive feature representation, train three sub-tasks simultaneously—demand prediction branch, procurement batch optimization branch, and time window prediction branch—by sharing the encoder layer and task-specific layer. A dynamic weight adjustment strategy is used to balance the loss functions of each task. Specifically, this includes: The shared encoder layer includes an underlying Transformer encoder and a feature fusion layer. All tasks share the underlying representation and learn a general feature representation. ; The demand forecasting branch adopts a three-layer fully connected network, and the network structure is as follows: ,in The number of material categories; the loss function is the mean squared error. ,in Let be the predicted demand for the i-th type of material. This represents the actual demand. The procurement batch optimization branch adopts the Actor-Critic reinforcement learning framework; defining the state space. ,in This refers to the current inventory levels of various materials. Forecasting future demand, For available funds, Define the supplier capacity for various materials; define the action space. ,in For the number of purchase batches, For the first Purchase quantities of various materials in batches; design reward function. ,in For inventory costs, To cover stockout costs, For procurement costs, , , These are the weighting coefficients; the Actor network output strategy. Critic network estimates state value Advantage function ,in Discount factor; Actor loss Critic loss ; The time window prediction branch uses an LSTM network with 128 hidden units; input gate Forgotten Gate Output gate ; Candidate Memory ; memory unit Hidden state The output sequence length is the prediction time window length. The loss function is cross-entropy. ,in For the true distribution, To predict the distribution, Number of categories based on time; A dynamic weight adjustment strategy is used to adaptively balance the loss functions of each task branch, resulting in a total loss function. Initial weights Adjusting weights based on task uncertainty ,in For learning rate, For the task Loss variance on the validation set; normalized weights ; Step S6: Establish a rule-based post-processing module to perform business constraint verification, time-series smoothing, anomaly detection and correction, and seasonal adjustment on the forecast results, and generate the final material demand forecast plan.

2. The method according to claim 1, characterized in that, In step S1, the data in the multidimensional feature dataset is a three-dimensional tensor. ,in Number of material categories , For time step, The total number of feature dimensions; the specific construction process includes: Historical demand sequence features: extracting past A time step sequence of material demand Calculate the 3-month moving average and 6-month moving average Calculate the standard deviation of material demand. Maximum value Minimum value Calculate the month-on-month growth rate and year-on-year growth rate ; Project attribute characteristics: Project type is represented using one-hot encoding. This includes infrastructure construction, technological upgrading, major repairs, marketing, information and communication, operation and maintenance, and emergency repairs, coded as a 7-dimensional vector; project scale levels are classified according to investment amount. It is divided into four levels: extra-large, large, medium, and small; the stage of the coding project. The project is divided into three stages: preliminary preparation, construction, and final acceptance; the project budget is as follows. Perform logarithmic transformation; encode the project's geographic location as regional characteristics. ; Time periodicity characteristics: Month M is represented using sine-cosine cyclic encoding. , ,in The month is used as the number; quarters are represented using unique hot codes. Extracting the year As a trend feature; identifying holidays Weekdays / Weekends and special periods ; Material correlation characteristics: Extract the demand sequence of related materials ,in Quantity of relevant materials; calculate the strength of upstream and downstream relationships between materials. Quantify the strength of the substitutability relationship between materials ; Calculate the similarity of material categories based on technical parameters and usage scenarios ; Calculate supplier concentration .

3. The method according to claim 2, characterized in that, In step S2, the construction of the temporal feature learning model specifically includes: From multidimensional feature datasets Extract time-series data for a single material category as input to the time-series feature learning model; for the first... Extract by material category ; The input embedding layer first transforms the input features through a linear transformation. Mapped to In a high-dimensional space, we obtain the embedding vector. ,in To embed the weight matrix, For the bias vector; then add position encoding. , , ,in For location index, The dimension index is used; the final input vector is... ; The multi-head self-attention layer setting There are 3 parallel attention heads, each with a dimension of 1. For the first One point of attention, Calculate the query matrix Key matrix and value matrix ,in For learnable weight matrix, For the first Input vector of the layer encoder; calculate attention weights ; Calculate the weighted output ; splice the output of all heads ,in To output the weight matrix; The time decay attention mechanism introduces a time decay factor. Adjust attention weights ,in Attention weight matrix The Middle Line number Column elements, For time step and The distance between them; renormalize the corrected weights. ; The feedforward network layer comprises two fully connected network layers. ,in , , , and The bias vector is used; the activation function is adopted. ; In the residual connection and layer normalization mechanism, residual connections and layer normalization are added after each multi-head attention layer or feedforward network layer. ,in Represents the output of a multi-head attention or feedforward network; stacking The layer encoder consists of a multi-head self-attention sublayer and a feedforward network sublayer in each layer, which ultimately outputs a temporal feature vector. .

4. The method according to claim 3, characterized in that, In step S3, the construction and reasoning of the domain knowledge graph specifically includes: Step S3.1: Construct a knowledge graph for the power materials sector; Define entity set = {Material Category, Project Type, Technical Standard, Supplier, Warehouse}, where each entity has a set of attributes. Define relation sets = {need, supply, storage, substitution, association, conformity}, forming a set of triples. ,in For the head entity, For the relationship, It is a tail entity; Step 3.2: Encode the knowledge graph using a three-layer graph attention network (GAT); No. Layer nodes The representation is updated to ,in For nodes The neighborhood group, For learnable weight matrix, For activation functions; Attention coefficient ,in For attention vectors, This indicates a splicing operation. Embedded for edge type; Step 3.3: The rule reasoning layer converts the business rules of the power industry into logical constraints and generates weight adjustments for material demand; Build a rule base containing several business rules. Each rule is represented in the form of IF-THEN: rule :IF condition THEN Conclusion Given the current state Traverse the rule base to find rules that meet the conditions. Execute the corresponding conclusions for all rules. The result of rule-based reasoning is represented as a weight adjustment vector. ,in Number of material categories; initialization For each triggered rule, update the weight increment of the corresponding material; Step 3.4: Association Rule Learning. This step automatically discovers hidden knowledge patterns from historical data using the Apriori association rule mining algorithm, with a minimum support threshold set. and minimum confidence threshold Discover frequent co-occurrence patterns and association rules among resources; Step S3.5: Perform multi-hop reasoning based on the knowledge graph; Given query entity ,pass Skip graph traversal to collect relevant knowledge; first hop to obtain direct neighbors. ; Second hop to obtain second-order neighbors ;most Jump, Reasoning path score ,in For the first Attention weights for jumps; choosing the path with the highest score The path information is fused to obtain the domain knowledge feature vector. .

5. The method according to claim 4, characterized in that, In step S4, the adaptive feature fusion process is as follows: Calculate the fusion gate value using a gating mechanism ,in For the gated weight matrix, For bias scalars, It is the Sigmoid activation function. Indicates feature splicing; Standardize the time-series feature vector and the domain knowledge feature vector. , ,in , These are the mean and standard deviation of the time-series feature vectors, respectively. These are the mean values ​​of the domain knowledge feature vectors. Standard deviation; Attention of temporal features to domain knowledge features Attention to temporal features by knowledge features in the computing domain ; obtain interactive enhancement features , ; Adaptive fusion to generate comprehensive feature representation ,in The weights calculated for the gating mechanism, , ; Feature enhancement is performed through nonlinear transformation to obtain the enhanced comprehensive feature representation. ,in To enhance the weight matrix, For bias.

6. The method according to claim 5, characterized in that, In step S6, post-processing optimization specifically includes: The business constraint verification includes: Inventory capacity constraints: ,in To predict the purchase volume, The warehouse capacity is represented by 0.9, and the safety factor is 0.

9. Budget constraints: ,in For the first The unit price of this type of material, For the first The procurement volume of this type of material, For the budget amount; Supply capacity constraints: ,in For the first Supplier capacity of such materials; Delivery cycle constraints: ,in For the first The planned procurement time for this type of material For the first The delivery cycle promised by the supplier for this type of material. For actual required time; The time-series smoothing process employs an exponentially weighted moving average (EWMA), resulting in a smoothed sequence. ,in For time step The original predicted value, For smoothing coefficients, Kalman filtering is used for optimal state estimation, and the state equation is... Observation equation ,in Here is the state transition matrix. For the observation matrix, For process noise, To observe noise; The anomaly detection and correction process uses the Isolation Forest algorithm to detect outliers and assign anomaly scores. ,in For the sample Average path length, A normalization factor for path length; setting an outlier threshold. ,when If an abnormal value is detected, it is considered abnormal; for detected abnormal values, if Then linear interpolation correction is used. ,in This is the historical average. The historical standard deviation; The seasonal adjustment is achieved through time series decomposition. ,in As a trend component, It is a seasonal ingredient. Random components; stable seasonal patterns extracted. ,in For months, For years, For the first Monthly average seasonality factor; adjusted forecast value ,in This represents the annual average seasonality factor.

7. A multi-specific power material demand forecasting system integrating temporal feature learning and domain knowledge reasoning, characterized in that, include: The data acquisition module is used to obtain historical data of power project materials from the business system of power companies and perform data preprocessing to build a multidimensional feature dataset containing 16 types of special materials. The temporal feature learning module is used to input the feature vectors in the multidimensional feature dataset into the temporal feature learning model to extract the temporal feature vectors of resource requirements. The temporal feature learning model is built based on the Transformer architecture and includes an input embedding layer, a multi-head self-attention layer with a time decay mechanism, a feedforward network layer, and residual connections and layer normalization mechanisms. The domain knowledge reasoning module is used to generate domain knowledge feature vectors, including a knowledge graph construction submodule, a graph neural network encoding submodule, a rule reasoning submodule, an association rule learning submodule, and a multi-hop reasoning submodule; The feature fusion module is used to fuse temporal features and domain knowledge features, including a gating mechanism submodule, a feature alignment submodule, a cross-modal attention submodule, and a feature enhancement submodule; The multi-task forecasting module includes demand forecasting branches, procurement batch optimization branches, and time window forecasting branches, which achieve joint optimization of multiple tasks through a shared encoder and task-specific layers. The post-processing optimization module includes a constraint verification submodule, a time-series smoothing submodule, an anomaly detection submodule, and a seasonal adjustment submodule, which are used to generate the final material demand forecast plan that meets business requirements. The visualization module is used to display forecast results, trend analysis charts, early warning information, and automatically generate reports.

8. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the multi-specific power material demand forecasting method that integrates temporal feature learning and domain knowledge reasoning as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-specific power material demand forecasting method that integrates temporal feature learning and domain knowledge reasoning as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Electric power material demand prediction method and system based on deep learning

    CN118966728A

  • Intelligent supervision management method and platform based on multi-terminal interaction and data fusion

    CN120013133A