A method for intelligent search of power data based on resource map

Through intelligent search methods based on resource maps, power data is integrated and processed, and entity identification and relationship extraction is used by NLP and BERT, the problem of low power data retrieval efficiency is solved and efficient data retrieval and analysis is achieved.

CN119336831BActive Publication Date: 2025-03-07STATE GRID INFO TELECOM GREAT POWER SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411869507.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-07
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

In modern power systems, massive heterogeneous power data comes from different sources, resulting in serious data silos, making it difficult to directly use for analysis and decision-making, and advanced information processing and analysis technologies are required to achieve effective data retrieval.

Method used

Using an intelligent search method based on resource maps, the power data obtained by SCADA system, ERP and sensors are integrated, entity recognition and relationship extraction are performed through Stanford NLP and BERT, knowledge graphs are stored using graph databases, and converted into Cypher query language through natural language query, and query execution is accelerated by combining index and cache policies.

Benefits of technology

It effectively improves the query efficiency on large-scale power multi-source data sets, realizes the search and application of intelligent power data, improves the accuracy and adaptability of data retrieval, and improves system performance and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336831B_ABST
    Figure CN119336831B_ABST
Patent Text Reader

Abstract

The present invention relates to an intelligent search method for power data based on resource graph, comprising the following steps: S1: integrating power data from different systems, cleaning the data, and unifying the data format; S2: using Stanford NLP and BERT to identify entities, and using a relationship extraction algorithm to establish relationship mapping between entities; S3: using a graph database to store knowledge graphs, mapping entities to nodes, mapping relationships to edges, and establishing multiple types of indexes; S4: converting natural language queries into graph database query languages ​​such as Cypher, and using the index of the graph database to cooperate with a cache strategy to accelerate query execution; S5: based on the established multiple types of indexes, using a query pattern prediction model to predict query patterns and dynamically adjust indexes; S6: adjusting result sorting based on user history and context information, and performing semantic reasoning to expand query results according to the semantic concepts and hierarchical structures of the knowledge graph. The present invention effectively improves the query efficiency on large-scale power multi-source data sets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data retrieval, and in particular to a method for intelligent search of power data based on resource maps. Background Art

[0002] In modern power systems, the volume and variety of data are growing exponentially with the gradual adoption of smart grid and Internet of Things technologies. This data originates from diverse sources, such as dispatch control and data acquisition (SCADA), enterprise resource planning (ERP), smart sensors, and smart meters. These systems generate massive amounts of heterogeneous data, which not only varies in form (structured, semi-structured, and unstructured), but also suffers from severe data silos due to its fragmented sources, making it difficult to directly use for analysis and decision-making.

[0003] Processing this data requires advanced information processing and analysis technologies to effectively retrieve the required information from numerous information sources, identify key patterns, and gain practical insights. To achieve this goal, the application of intelligent search technology becomes particularly important. Summary of the Invention

[0004] In order to solve the above problems, the purpose of the present invention is to provide an intelligent search method for power data based on resource maps, which realizes the search and application of intelligent power data and effectively improves the query efficiency on large-scale power multi-source data sets.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A method for intelligent search of power data based on resource maps, comprising the following steps:

[0007] S1: Integrate power data from different systems, including SCADA system, ERP, and sensors, clean the data, and unify the data format;

[0008] S2: Use Stanford NLP and BERT for entity recognition, and use the relation extraction algorithm to establish the relationship mapping between entities;

[0009] S3: Uses a graph database to store knowledge graphs, maps entities to nodes, maps relationships to edges, and establishes multiple types of indexes, including node, relationship, and attribute indexes, to speed up data retrieval.

[0010] S4: Convert natural language queries into graph database query languages ​​such as Cypher, and use graph database indexes and caching strategies to accelerate query execution.

[0011] S5: Based on the established multi-type indexes, including node, relationship, and attribute indexes, a query pattern prediction model is used to predict query patterns and dynamically adjust indexes to improve response performance.

[0012] S6: Adjust the result ranking based on user history and context information, and perform semantic reasoning to expand the query results based on the semantic concepts and hierarchical structure of the knowledge graph.

[0013] Further, S1 is as follows:

[0014] Integrate power data from SCADA systems, ERP, and sensors, and determine the type and scope of data to be integrated based on business needs;

[0015] Develop REST APIs for each data source to ensure data can be automatically retrieved through HTTP requests, use JDBC / ODBC connectors to obtain structured data from ERP systems, and use MQTT protocol to connect to sensor data streams;

[0016] Configure Apache NiFi's Processor to extract data from different data sources and automate data extraction and initial transformation through data flows;

[0017] Set data cleaning rules and use the Apache Spark DataFrame API to batch clean and correct data;

[0018] Standardize data according to unified standard definitions, ensure that all data fields use consistent naming and encoding formats, and rename fields and convert types according to industry standards and corporate specifications.

[0019] Furthermore, S2 is specifically:

[0020] Use Stanford NLP to perform basic named entity recognition on the text, identify entities through part-of-speech tagging and syntactic analysis, and use BERT to fine-tune entity recognition;

[0021] Using Stanford NLP, part-of-speech tagging helps identify noun phrases and potential entities. For sentences S=w 1 , w 2 ,…,w i …,w n , the part-of-speech tagging result is T=t 1 ,t 2 ,…,t i…,t n :in w i represents the i-th word in sentence S, t i is the corresponding part-of-speech tagging result;

[0022] POS(w i )=t i ;

[0023] in, POS Indicates part-of-speech tagging processing;

[0024] Use Stanford NLP's dependency parser to generate a dependency tree to reveal the structural relationship between words;

[0025] Use Stanford NLP's NER module to identify common entities and output preliminary entity labels;

[0026] Combining BERT and CRF models, combining part-of-speech and syntactic features to enhance accuracy, and using relation extraction algorithms to establish relationship mappings between entities.

[0027] Furthermore, we combine the BERT and CRF models, and incorporate part-of-speech and syntactic features to enhance accuracy. Specifically:

[0028] Format each input sequence for BERT processing, adding [CLS] and [SEP] tags;

[0029] The processed sequence is input into BERT to obtain the deep context representation of each token. BERT uses the self-attention mechanism to build context dependencies:

[0030]

[0031] Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. d k is the dimension of the bond matrix;

[0032] Add a CRF layer to the output of the last layer of BERT to consider the dependencies between tokens;

[0033] The CRF layer gives the input sequence X and the label sequence Y, and the score function of the sequence labeling is:

[0034] ;

[0035] Where X is the input sequence; Y is the label sequence; n is the length of the input sequence, and the subscript i is used to traverse the input sequence; is the transfer weight matrix; is the characteristic function;

[0036] The probability of label sequence Y given input sequence X:

[0037] ;

[0038] Where exp is an exponential function, Y is a specific sequence in the set of all possible label sequences, is any specific sequence except Y in the set of all possible tag sequences.

[0039] Furthermore, S3 is specifically:

[0040] Define the topological structure of entities and relationships, map each entity to a node, use device ID and status as node attributes, map each relationship to an edge, and use start time and strength as edge attributes;

[0041] Use the import tool supported by the graph database to import the cleaned entities, nodes, and relationships in batches;

[0042] Create node indexes for key attributes of entities and relationship indexes for relationship types and key attributes, including relationship types and time attributes, to accelerate relationship queries and filtering. Also, create attribute indexes for attributes with usage rates above a threshold in queries, including geographic location and timestamps, to optimize indexes.

[0043] Furthermore, S4 is specifically:

[0044] Use NLP technology to parse natural language queries entered by users and extract key entities, relationships, and conditions;

[0045] Build a vocabulary and semantic mapping from natural language intent to Cypher queries, using knowledge graphs to enhance semantic understanding and ensure correspondence with user query intent; use a rule-based engine to dynamically convert NLQs into Cypher queries;

[0046] Use pre-established node indexes to speed up entity queries, and use relationship indexes and attribute indexes to improve connection and path query efficiency;

[0047] Cache repeated query results and put high-frequency queries and frequently accessed node attributes into memory cache to reduce disk I / O.

[0048] Furthermore, the query pattern prediction model is built based on the GRU model, as follows:

[0049] Convert query logs into time series data, such as the number of queries per hour or day, and group specific query types to form multidimensional time series data.

[0050] Generate time features to capture periodic patterns, calculate moving averages, and differencing series to stabilize the series;

[0051] The GRU model architecture includes an input layer, a GRU layer, and an output layer. The input layer accepts formatted time series input; the GRU layer includes several layers of stacked GRU units to ensure that sequence features are fully extracted; and the output layer uses a linear activation function to predict future query patterns.

[0052] The GRU unit is as follows:

[0053] ;

[0054] Among them, z t is the update gate, r t It is the reset gate. is the candidate activation, h t is the state of the GRU unit, is the activation function, 、 、 is the weight, 、 、 is the bias, t represents the current moment; is the formatted time series input at time t;

[0055] Deploy the trained model to the online system for real-time prediction of query patterns. Input the time series into the model to predict the query pattern:

[0056]

[0057] in, X t is the input time series data; The query mode for the output prediction;

[0058] Use prediction results to dynamically adjust the database's index and cache strategies, pre-create indexes for high-frequency prediction queries, and optimize response performance.

[0059] Furthermore, the prediction results are used to dynamically adjust the database index and cache strategies, as follows:

[0060] According to the prediction results pattern ,Analyze upcoming query load and pattern changes, identify upcoming query load increases, especially specific query types that are growing rapidly;

[0061] Match appropriate index types to different query requirements;

[0062] Analyze the forecast output, identify fields involved in high-frequency queries, and set them as indexes. It also detects load changes and creates necessary indexes for new fields. If the forecast load decreases, it automatically freezes or deletes unnecessary indexes.

[0063] Monitor the query speedup and maintenance overhead of each index and determine index benefits by establishing a dynamic evaluation mechanism:

[0064] ;

[0065] in, is the query time when no index is used, is the query time after using the index;

[0066] ;

[0067] in, Indicates the total amount of system resources; is the number of all queries;

[0068] Weighing Query Speedup and Maintenance Overhead

[0069] ;

[0070] Among them, λ is the weight coefficient, It is a comprehensive indicator.

[0071] Furthermore, S6 is specifically:

[0072] Collect user historical query, browsing behavior, and click behavior data, and extract features of user historical preferences, including query types, topics, and entities;

[0073] Capture contextual information about the current query;

[0074] Use the Learning to Rank model to build a ranking model, which optimizes the ranking of query results by combining user characteristics and contextual information;

[0075] Use historical query and user feedback data to train the sorting model and optimize sorting performance indicators;

[0076] Merge the semantically expanded results with the basic query results, apply the ranking model, and output the final result set based on the adjusted priority.

[0077] Furthermore, the Learning to Rank model is used to build a ranking model, as follows:

[0078] From user feedback, such as click data, create document pairs:

[0079] Given a query q, if document d1 is clicked but d2 is not, then d1 is considered better than d2; form a training sample pair (d1, d2);

[0080] Extract the feature vector of each document d, including text, metadata, ranking position, and query relevance;

[0081] Generate feature vector X d ; Construct feature difference vectors for document pairs:

[0082] The feature difference vector is ; Among them, X d1 and X d2 represents any two eigenvectors;

[0083] RankNet uses a feedforward neural network with a hidden layer. The input layer accepts the feature difference vector ΔX, the middle layer is a hidden layer with adjustable parameters, and the output layer uses a Sigmoid activation function.

[0084] For each feature difference pair input, the neural network outputs a continuous value o representing the ranking score of d1 relative to d2;

[0085] Through the Sigmoid function calculate:

[0086] ;

[0087] Among them, o is the output value of the RankNet neural network; is the probability that d1 is better than d2;

[0088] RankNet uses the cross entropy loss function L To measure the ranking error of the model:

[0089] ;

[0090] Where label is 1 if d1 is better than d2, and 0 if it is the opposite; N is the number of samples.

[0091] The present invention has the following beneficial effects:

[0092] 1. The present invention realizes the search and application of intelligent power data, effectively improving the query efficiency on large-scale power multi-source data sets;

[0093] 2. This invention can effectively integrate and process power data from different systems, providing a high-quality data foundation for subsequent analysis and application. It also combines multi-level information from BERT, CRF, and dependency parsing to improve the accuracy and adaptability of power entity recognition and relationship extraction.

[0094] 3. By integrating NLP parsing, template mapping and rule engine systems, and effectively using indexing and caching strategies, the present invention can convert natural language into efficient Cypher queries and accelerate their execution. Combined with the predictive capabilities of machine learning, the system can predict upcoming query patterns and dynamically adjust the database's indexing strategy, thereby accelerating the execution of complex queries. This not only improves system performance, but also increases its flexibility and adaptability, making resource management more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION

[0096] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0097] refer to Figure 1 In this embodiment, a method for intelligent search of power data based on resource maps is provided, comprising the following steps:

[0098] S1: Integrate power data from different systems, including SCADA system, ERP, and sensors, clean the data, and unify the data format;

[0099] S2: Use Stanford NLP and BERT for entity recognition, and use the relation extraction algorithm to establish the relationship mapping between entities;

[0100] S3: Uses a graph database to store knowledge graphs, maps entities to nodes, maps relationships to edges, and establishes multiple types of indexes, including node, relationship, and attribute indexes, to speed up data retrieval.

[0101] S4: Convert natural language queries into graph database query languages ​​such as Cypher, and use graph database indexes and caching strategies to accelerate query execution.

[0102] S5: Based on the established multi-type indexes, including node, relationship, and attribute indexes, it accelerates complex queries (such as specific paths and shortest paths). It uses query pattern prediction models to predict query patterns and dynamically adjust indexes to improve response performance.

[0103] S6: Adjust the result ranking based on user history and context information, and perform semantic reasoning to expand the query results based on the semantic concepts and hierarchical structure of the knowledge graph.

[0104] In this embodiment, S1 is specifically as follows:

[0105] Integrate power data from SCADA systems, ERP, and sensors, and determine the type of data (such as real-time power load, equipment status, and financial data) and scope (such as time span and geographic area) to be integrated based on business needs;

[0106] Develop REST APIs for each data source to ensure data can be automatically retrieved through HTTP requests, use JDBC / ODBC connectors to obtain structured data from ERP systems, and use MQTT protocol to connect to sensor data streams;

[0107] Configure Apache NiFi's Processors (such as GetHTTP, GetFile, and ExecuteSQL) to extract data from various data sources and automate data extraction and initial transformation through data flows;

[0108] Set data cleaning rules (including missing value and duplicate value detection) and use Apache Spark DataFrame API to batch clean and correct data;

[0109] Standardize data according to unified standard definitions (such as unit conversion and date format), ensure that all data fields use consistent naming and encoding formats, and rename fields and convert types according to industry standards and corporate specifications.

[0110] In this embodiment, S2 is specifically:

[0111] Use Stanford NLP to perform basic named entity recognition on the text, identify entities through part-of-speech tagging and syntactic analysis, and use BERT to fine-tune entity recognition;

[0112] Using Stanford NLP, part-of-speech tagging helps identify noun phrases and potential entities. For sentences S=w 1 , w 2 ,…,w i …,w n , the part-of-speech tagging result is T=t 1 ,t 2 ,…,t i …,t n :in w i represents the i-th word in sentence S,t i is the corresponding part-of-speech tagging result;

[0113] POS(w i )=t i ;

[0114] in, POS Indicates part-of-speech tagging processing;

[0115] Use Stanford NLP's dependency parser to generate a dependency tree to reveal the structural relationship between words;

[0116] Use Stanford NLP's NER module to identify common entities and output preliminary entity labels;

[0117] Combining BERT and CRF models, combining part-of-speech and syntactic features to enhance accuracy, and using relation extraction algorithms to establish relationship mappings between entities.

[0118] In this embodiment, the BERT and CRF models are combined with part-of-speech and syntactic features to enhance accuracy, specifically:

[0119] Format each input sequence for BERT processing, adding [CLS] and [SEP] tags;

[0120] The processed sequence is input into BERT to obtain the deep context representation of each token. BERT uses the self-attention mechanism to build context dependencies:

[0121]

[0122] Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. d k is the dimension of the bond matrix;

[0123] Add a CRF layer to the output of the last layer of BERT to consider the dependencies between tokens;

[0124] The CRF layer gives the input sequence X and the label sequence Y, and the score function of the sequence labeling is:

[0125] ;

[0126] Where X is the input sequence; Y is the label sequence; n is the length of the input sequence, and the subscript i is used to traverse the input sequence; is the transfer weight matrix; is the characteristic function;

[0127] The probability of label sequence Y given input sequence X:

[0128] ;

[0129] Where exp is an exponential function, Y is a specific sequence in the set of all possible label sequences, is any specific sequence except Y in the set of all possible tag sequences.

[0130] In this embodiment, S3 is specifically:

[0131] Define the topological structure of entities and relationships, map each entity (such as generators and transformers) to a node, use the device ID and status as node attributes, map each relationship (such as location dependency and supply chain relationship) to an edge, and use the start time and intensity as edge attributes;

[0132] Use graph database-supported import tools to import cleaned entities, nodes, and relationships in batches; use graph database-specific tools or APIs, such as Neo4j's CSV importer;

[0133] Create node indexes for key attributes of entities (such as name, device ID, and type), and create relationship indexes for relationship types and key attributes, including relationship type and time attributes, to accelerate relationship queries and filtering; and create attribute indexes for attributes with usage rates above the threshold in queries, including geographic location and timestamp, to optimize indexes.

[0134] In this embodiment, S4 is specifically:

[0135] Use NLP technology to parse natural language queries entered by users and extract key entities, relationships, and conditions;

[0136] For example, map "find all sensors associated with device X" to the corresponding Cypher expression;

[0137] Build a vocabulary and semantic mapping from natural language intent to Cypher queries, using knowledge graphs to enhance semantic understanding and ensure correspondence with user query intent; use a rule-based engine to dynamically convert NLQs into Cypher queries;

[0138] Rule example: If the user requests device status, generate the corresponding MATCH query and attribute filter;

[0139] Use pre-established node indexes to speed up entity queries, and use relationship indexes and attribute indexes to improve connection and path query efficiency;

[0140] Cache repeated query results and put high-frequency queries and frequently accessed node attributes into memory cache to reduce disk I / O.

[0141] In this embodiment, the query pattern prediction model is constructed based on the GRU model, as follows:

[0142] Convert query logs into time series data, such as the number of queries per hour or day, and group specific query types to form multidimensional time series data.

[0143] Generate time features (such as day, week, month) to capture periodic patterns, calculate moving averages, and difference series to stabilize the series;

[0144] The GRU model architecture includes an input layer, a GRU layer, and an output layer. The input layer accepts formatted time series input; the GRU layer includes several layers of stacked GRU units to ensure that sequence features are fully extracted; and the output layer uses a linear activation function to predict future query patterns.

[0145] The GRU unit is as follows:

[0146] ;

[0147] Among them, z t is the update gate, r t It is the reset gate. is the candidate activation, h t is the state of the GRU unit, is the activation function, 、 、 is the weight, 、 、 is the bias, t represents the current moment; is the formatted time series input at time t;

[0148] Deploy the trained model to the online system for real-time prediction of query patterns. Input the time series into the model to predict the query pattern:

[0149]

[0150] in, X t is the input time series data; The query mode for the output prediction;

[0151] Use prediction results to dynamically adjust the database's index and cache strategies, pre-create indexes for high-frequency prediction queries, and optimize response performance.

[0152] In this embodiment, the prediction results are used to dynamically adjust the database index and cache strategy, as follows:

[0153] According to the prediction results pattern ,Analyze upcoming query load and pattern changes, identify upcoming query load increases, especially specific query types that are growing rapidly; such as queries targeting only nodes or relationships;

[0154] Use the appropriate index type for different query requirements. Specifically, node indexing optimizes node lookups, such as using B-Trees for range queries. Relationship indexing improves relationship location efficiency, using hash indexes to accelerate relationship mapping. Attribute indexing considers using full-text indexing for text searches.

[0155] Analyze the forecast output, identify fields involved in high-frequency queries, and set them as indexes. It also detects load changes and creates necessary indexes for new fields. If the forecast load decreases, it automatically freezes or deletes unnecessary indexes.

[0156] Monitor the query speedup and maintenance overhead of each index and determine index benefits by establishing a dynamic evaluation mechanism:

[0157] ;

[0158] in, is the query time when no index is used, is the query time after using the index;

[0159] ;

[0160] in, Indicates the total amount of system resources; is the number of all queries;

[0161] Weigh the Query Speedup and Maintenance Overhead:

[0162] ;

[0163] Among them, λ is the weight coefficient, It is a comprehensive indicator.

[0164] In this embodiment, S6 is specifically:

[0165] Collect user historical query, browsing behavior, and click behavior data, and extract features of user historical preferences, including query types, topics, and entities;

[0166] Capture the context of the current query; such as query time, location, and device type, and dynamically update the user feature vector to adjust the model based on the current context;

[0167] Use the Learning to Rank model to build a ranking model, which optimizes the ranking of query results by combining user characteristics and contextual information;

[0168] Use historical query and user feedback data (such as click-through rate and dwell time) to train the ranking model and optimize ranking performance indicators (NDCG, MAP, etc.);

[0169] Merge the semantically expanded results with the basic query results, apply the ranking model, and output the final result set based on the adjusted priority.

[0170] In this embodiment, the Learning to Rank model is used to build a ranking model, as follows:

[0171] From user feedback, such as click data, create document pairs:

[0172] Given a query q, if document d1 is clicked but d2 is not, then d1 is considered better than d2; form a training sample pair (d1, d2);

[0173] Extract the feature vector of each document d, including text, metadata, ranking position, and query relevance;

[0174] Generate feature vector X d ; Construct feature difference vectors for document pairs:

[0175] The feature difference vector is ;

[0176] Among them, X d1 and X d2 represents any two eigenvectors;

[0177] RankNet uses a feedforward neural network with a hidden layer, and the input layer accepts the feature difference vector , the middle layer is a hidden layer with adjustable parameters, and the output layer uses the Sigmoid activation function;

[0178] For each feature difference pair input, the neural network outputs a continuous value o representing the ranking score of d1 relative to d2;

[0179] Through the Sigmoid function calculate:

[0180] ;

[0181] Among them, o is the output value of the RankNet neural network; is the probability that d1 is better than d2;

[0182] RankNet uses the cross entropy loss function L To measure the ranking error of the model:

[0183] ;

[0184] Where label is 1 if d1 is better than d2, and 0 if it is the opposite; N is the number of samples.

[0185] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0186] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0189] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other manner. Any person skilled in the art may utilize the above-disclosed technical content to modify or modify the present invention into equivalent embodiments. However, any simple modifications, equivalent variations, and modifications to the above embodiments that do not depart from the technical content of the present invention and are based on the technical essence of the present invention remain within the scope of protection of the present invention.

Claims

1. A method for intelligent search of power data based on resource maps, characterized in that: The following steps are involved: S1: Integrate power data from different systems, including SCADA system, ERP, and sensors, clean the data, and unify the data format; S2: Use Stanford NLP and BERT for entity recognition, and use the relation extraction algorithm to establish the relationship mapping between entities; S3: Use graph database to store knowledge graph, map entities to nodes, map relationships to edges, and establish multiple types of indexes, including node, relationship, and attribute indexes to improve data retrieval speed; S4: Convert natural language queries into Cypher graph database query language, and use graph database indexes and cache strategies to accelerate query execution; S5: Based on the established multi-type indexes, including node, relationship, and attribute indexes, the query pattern prediction model is used to predict the query pattern and dynamically adjust the index to improve the response performance; S6: Adjust the result ranking based on user history and context information, and perform semantic reasoning to expand the query results based on the semantic concepts and hierarchical structure of the knowledge graph; The S2 is specifically: Use Stanford NLP to perform basic named entity recognition on the text, identify entities through part-of-speech tagging and syntactic analysis, and use BERT to fine-tune entity recognition; Using Stanford NLP, part-of-speech tagging helps identify noun phrases and potential entities. For sentences S=w 1 ,w 2 ,…, w i …,w n , the part-of-speech tagging result is T=t 1 ,t 2 ,…,t i …,t n :in w i represents the i-th word in sentence S, t i is the corresponding part-of-speech tagging result; POS(w i )=t i ; in, POS Indicates part-of-speech tagging processing; Use Stanford NLP's dependency parser to generate a dependency tree to reveal the structural relationship between words; Use Stanford NLP's NER module to identify common entities and output preliminary entity labels; Combining BERT and CRF models, combining part-of-speech and syntactic features to enhance accuracy, and using relation extraction algorithms to establish relationship mappings between entities; The combination of BERT and CRF models, combined with part-of-speech and syntactic features, enhances accuracy, specifically: Format each input sequence for BERT processing, adding [CLS] and [SEP] tags; The processed sequence is input into BERT to obtain the deep context representation of each token. BERT uses the self-attention mechanism to build context dependencies: ; Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. d k is the dimension of the bond matrix; Add a CRF layer to the output of the last layer of BERT to consider the dependencies between tokens; CRF layer Given an input sequence X and a label sequence Y, the score function of the sequence labeling is: ; Where X is the input sequence; Y is the label sequence; n is the length of the input sequence, and the subscript i is used to traverse the input sequence; is the transfer weight matrix; is the characteristic function; The probability of label sequence Y given input sequence X: ; Among them, exp is an exponential function, Y is a specific sequence in the set of all possible label sequences, is any specific sequence except Y in the set of all possible tag sequences; The query pattern prediction model is built based on the GRU model, as follows: Convert query logs into time series data, group specific query types, and form multi-dimensional time series; Generate time features to capture periodic patterns, calculate moving averages, and difference series to stabilize the series; The GRU model architecture includes an input layer, a GRU layer and an output layer, wherein the input layer accepts formatted time series input; the GRU layer includes several layers of stacked GRU units to ensure that sequence features are fully extracted; and the output layer uses a linear activation function to predict future query patterns; The GRU unit is specifically as follows: ; Among them, z t is the update gate, r t It is the reset gate. is a candidate activation, h t is the state of the GRU unit, is the activation function, , , is the weight, , , is the bias, t represents the current moment; is the formatted time series input at time t; Deploy the trained model to the online system for real-time prediction of query patterns, input the time series into the model, and predict the query pattern: ; in, X t is the input time series data; The query mode for the output prediction; Use the prediction results to dynamically adjust the database index and cache strategy, pre-create indexes for high-frequency prediction queries, and optimize response performance; The prediction results are used to dynamically adjust the index and cache strategy of the database, as follows: According to the prediction results , analyze upcoming query load and pattern changes, identify upcoming increases in query load, especially specific query types that are growing rapidly; Use appropriate index types for different query requirements; Analyze the forecast output, identify the fields involved in high-frequency queries, and set them as indexes; detect load changes, create necessary indexes for new fields, and automatically freeze or delete unnecessary indexes if the forecast load decreases; Monitor the query speedup effect and maintenance overhead of each index, and determine the index benefits by establishing a dynamic evaluation mechanism: ; in, is the query time when no index is used, is the query time after using the index; ; in, Indicates the total amount of system resources; is the number of all queries; Weighing Query Speedup and Maintenance Overhead ; Among them, λ is the weight coefficient, It is a comprehensive indicator.

2. According to claim 1, a method for intelligent search of power data based on resource map is characterized in that: The S1 is specifically as follows: Integrate power data from SCADA system, ERP, and sensors, and determine the type and scope of data to be integrated based on business needs; Develop REST API for each data source to ensure data is automatically acquired through HTTP requests, use JDBC / ODBC connectors to obtain structured data from ERP systems, and use MQTT protocol to connect sensor data streams; Configure Apache NiFi's Processor to extract data from different data sources and automate the extraction and initial transformation of data through data flows; Set data cleaning rules and use Apache Spark DataFrame API to clean and correct data in batches; Standardize data according to unified standard definitions to ensure that all data fields use consistent naming and encoding formats, and rename fields and convert types according to industry standards and corporate specifications.

3. The method for intelligent search of power data based on resource map according to claim 1, characterized in that: The S3 is specifically: Define the topological structure of entities and relationships, map each entity to a node, use device ID and status as node attributes, map each relationship to an edge, and use start time and strength as edge attributes; Use the import tool supported by the graph database to import the cleaned entities, nodes, and relationships in batches; Create node indexes for key attributes of entities, create relationship indexes for relationship types and key attributes, including relationship types and time attributes, to speed up relationship queries and filtering; and create attribute indexes for attributes with usage rates higher than the threshold in queries, including geographic location and timestamp, to optimize indexes.

4. The method for intelligent search of power data based on resource map according to claim 1, characterized in that: The S4 is specifically: Use NLP technology to parse natural language queries entered by users and extract key entities, relationships, and conditions; Build vocabulary and semantic mapping from natural language intent to Cypher query, use knowledge graph to enhance semantic understanding, and ensure correspondence with user query purpose; use rule-based engine to dynamically convert NLQ to Cypher query; Use pre-established node indexes to speed up entity queries, and use relationship indexes and attribute indexes to improve connection and path query efficiency; Duplicate query results are cached, and high-frequency queries and frequently accessed node attributes are placed in memory cache to reduce disk I / O.

5. The method for intelligent search of power data based on resource map according to claim 1, characterized in that: The S6 is specifically: Collect users' historical query, browsing behavior, and click behavior data, and extract features of users' historical preferences, including query types, topics, and entities; Capture contextual information of the current query; Use the Learning to Rank model to build a ranking model to optimize the ranking of query results by combining user characteristics and context information; Use historical query and user feedback data to train the sorting model and optimize the sorting performance indicators; Merge the semantically expanded results with the basic query results, apply the sorting model, and output the final result set based on the adjusted priority.

6. According to claim 5, a method for intelligent search of power data based on resource maps is characterized in that: The use of the Learning to Rank model to build a ranking model is as follows: From user feedback, including click data, create document pairs: Given a query q, if document d1 is clicked but d2 is not clicked, then d1 is considered better than d2; form a training sample pair (d1, d2); Extract the feature vector of each document d, including text, metadata, ranking position, and query relevance; Generate feature vector X d ; Construct feature difference vectors for document pairs: The feature difference vector is ; Among them, X d1 and X d2 represents any two eigenvectors; RankNet uses a feedforward neural network with a hidden layer. The input layer accepts the feature difference vector ΔX, the middle layer is a hidden layer with adjustable parameters, and the output layer uses the Sigmoid activation function. For each feature difference pair of the input, the neural network outputs a continuous value o representing the ranking score of d1 relative to d2; Through the Sigmoid function calculate: ; Among them, o is the output value of the neural network of RankNet; is the probability that d1 is better than d2; RankNet uses the cross entropy loss function L To measure the ranking error of the model: ; Among them, label 1 means d1 is better than d2, and 0 means the opposite; N is the number of samples.

Citation Information

Patent Citations

  • Power transmission and transformation project knowledge graph construction method based on multi-modal semantic features

    CN116541529A

  • Single-sample time sequence knowledge graph extrapolation calculation method based on historical trend

    CN117575023A