Power multi-source data slicing processing method and system based on reinforcement learning

By employing a reinforcement learning-based method for processing multi-source power data slicing, which combines feature extraction, clustering algorithms, and knowledge graph rules, the problems of poor homogeneity within slices and inaccurate boundaries in traditional methods are solved. This enables intelligent data management and efficient storage, improving the accuracy and scalability of data analysis.

CN120724192BActive Publication Date: 2025-11-25STATE GRID JIANGXI ELECTRIC POWER CO LTD ECONOMIC & TECH RES INST +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511153944.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-25
Estimated Expiration
2045-08-18

AI Technical Summary

Technical Problem

Traditional power multi-source data slicing methods cannot take into account the dynamic structure of data, behavioral correlations, and flexible segmentation of abnormal events, resulting in poor homogeneity within slices and inaccurate boundaries between slices, which affects the accuracy and timeliness of data analysis and business decision-making.

Method used

By employing a reinforcement learning-based approach, through feature extraction, clustering algorithms, and knowledge graph business rules, intelligent slicing decision-making and distributed storage management of multi-source power data are achieved, ensuring the intelligence of the slicing results and compliance with domain constraints.

Benefits of technology

It enhances the comprehensive representation and management efficiency of data, provides a solid data foundation and excellent scalability, and supports diverse computational analysis and intelligent applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120724192B_ABST
    Figure CN120724192B_ABST
Patent Text Reader

Abstract

The application relates to a power multi-source data slice processing method and system based on reinforcement learning, which comprises the following steps: S1: acquiring power multi-source data and carrying out pretreatment to obtain a structured original data stream; S2: acquiring a multi-dimensional feature vector through feature extraction; S3: adopting a clustering algorithm to identify a behavior mode to obtain a clustering label, and calculating the distance from a sample to a respective clustering center; when the distance is significantly higher than the mean value of the cluster plus a threshold beta times the standard deviation, the sample is additionally marked as abnormal; S4: carrying out intelligent slice decision based on reinforcement learning to obtain a slice strategy, data and a label; S5: according to the obtained slice strategy, data and label, carrying out knowledge graph business rule verification to ensure compliance with domain constraints; and S6: the verified strategy is sent to distributed slice storage and management, and data is stored and indexed according to the strategy. The application effectively improves the structured management level and high-value utilization capacity of power data assets.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data management, and in particular to a power multi-source data slicing processing method and system based on reinforcement learning. BACKGROUND

[0002] With the rapid development of smart grid, energy internet and digital operation system, the power system has generated and accumulated massive multi-source heterogeneous data. These data cover telemetry, metering, protection, state monitoring, Internet of Things, automation operation and other fields, and have the characteristics of large volume, high dimension, real-time and fast dynamic change. Efficient and accurate slicing and management of these multi-source data is the premise for realizing intelligent scheduling, anomaly detection, fault tracing and intelligent decision-making and other applications.

[0003] However, the power multi-source data often presents strong non-stationarity and behavior heterogeneity, and there are complex patterns such as periodic changes, sudden abnormalities and distribution drift. The traditional slicing (slicing) method based on fixed window or simple rules cannot consider the dynamic structure, behavior correlation and flexible segmentation of abnormal events of the data, resulting in poor homogeneity within the slice and inaccurate boundaries between the slices, which affects the accuracy and timeliness of subsequent data analysis and business decision-making. SUMMARY

[0004] In order to solve the above problems, the purpose of the present application is to provide a power multi-source data slicing processing method and system based on reinforcement learning, which effectively improves the structured governance level and high value utilization ability of power data assets.

[0005] To achieve the above purpose, the present application adopts the following technical scheme:

[0006] A power multi-source data slicing processing method based on reinforcement learning, characterized in that it comprises the following steps:

[0007] S1: Obtain power multi-source data and preprocess to obtain structured original data stream;

[0008] S2: Based on the structured original data stream, obtain a multi-dimensional feature vector through feature extraction;

[0009] S3: According to the multi-dimensional feature vector, use a clustering algorithm to identify behavior patterns to obtain clustering labels, and calculate the distance from the sample to the respective clustering center. When the distance is higher than the mean value of the cluster plus threshold β times the standard deviation, it is additionally marked as abnormal;

[0010] S4: Based on reinforcement learning, make intelligent slicing decision according to the multi-dimensional feature vector, clustering label and abnormal point mark, and obtain slicing strategy, data and label;

[0011] S5: According to the acquired slice strategy, data and label, the knowledge graph business rule is checked to ensure compliance with the domain constraints.

[0012] S6: The strategy passed by the check is sent to the distributed slice storage and management, and the data is stored and indexed according to the strategy.

[0013] Further, the power multi-source data is acquired and preprocessed to obtain a structured original data stream, which is specifically as follows:

[0014] The power multi-source data includes metering, SCADA data, operation and maintenance and external data, the metering and SCADA data adopt a unified interface and are periodically batch-pulled or real-time pushed; the operation and maintenance and external data are collected in a streaming manner to realize asynchronous high-availability data flow;

[0015] And a cleaning and mapping rule is set for each type of data to map the original field to a unified data specification template.

[0016] In the data inflow stage, multi-primary keys are used for primary key deduplication to ensure the uniqueness of the same type of data of each device at each moment; for data with inconsistent frequencies, a time alignment mechanism is introduced.

[0017] And the collected data is standardized and normalized to obtain a structured original data stream.

[0018] Further, based on the structured original data stream, a multi-dimensional feature vector is obtained through feature extraction, which is specifically as follows:

[0019] According to the business scenario or data granularity, the data is segmented and processed in a fixed-length time window; in each window, all data of the same user / device / business is regarded as an analysis unit:

[0020] Set the time window T, and the a-th sample is S a :

[0021] S a ={x t ∣t∈[t a ,t a+T )};

[0022] Where x t represents the data collected at time t; t a represents the start time of the a-th time window.

[0023] Through feature extraction, a multi-dimensional feature vector is obtained, including statistical features, time series features, spatial features and business features.

[0024] The statistical features include mean, standard deviation, maximum / minimum value and amplitude.

[0025] The time series feature includes time series data [x1, x2,..., x j ,...,x N ] in the window, where x j is the jth element in the time series data, and N is the total number of time series data; the trend slope a is obtained by fitting linear regression; the d dominant frequency component f main and the autocorrelation coefficient r1 are extracted by FFT:

[0026] ;

[0027] Where μ x is the mean of the time series feature;

[0028] The spatial feature includes geographical proximity, average load in the same area, and maximum load index;

[0029] The business feature includes the number of peaks N peak , the number of abnormal events N alarm , and the volatility W:

[0030] ;

[0031] ;

[0032] Where σ x is the standard deviation of the time series feature; θ peak is the preset peak threshold;

[0033] A multi-dimensional feature vector is constructed:

[0034] F i =[μ x ,σ x ,f main ,r1,N peak ,N alarm ,W]。

[0035] Further, the clustering algorithm uses an improved clustering algorithm based on a comprehensive framework, as follows:

[0036] First, use the Gap statistic to automatically determine the optimal number of clusters K:

[0037]

[0038] Where Gap(k) represents the Gap statistic; is the expected function; W k is the total sum of intra-class distances of the kth class:

[0039] ;

[0040] Among them, C r Let n be the set of samples contained in the r-th cluster; r d(x) represents the number of samples in the r-th cluster. i, x j ) represents the sample point x i With x j The Euclidean distance between them;

[0041] Choose the k corresponding to the largest gap value as the optimal number of clusters;

[0042] Randomly select the first centroid c1. For each point x, calculate the distance D(x) to the nearest centroid; then, according to probability... Select the next centroid, and repeat until K centroids are selected;

[0043] Because power data exhibits strong time-series correlation, a time-series adjustment term is introduced for two sequences A=[a1,...,a...]. n ] and B=[b1,...,b n The DTW distance between the two sequences is:

[0044] ;

[0045] in, This is the optimal regularized path; To obtain the optimal regularization path The element in sequence B that corresponds to the i-th element of sequence A along the alignment path; a i Let a be the i-th element in sequence A; n b n These are the nth elements in sequence A and sequence B, respectively;

[0046] in This is the optimal regularized path;

[0047] Therefore, the final clustering objective function is:

[0048] ;

[0049] Where α is the trade-off parameter, and C represents the temporal portion of the samples and cluster centers, respectively; k μ represents the set of sample indices contained in the k-th cluster; k d is the structural feature center of the k-th cluster; w (x i ,μ k ) represents the sample point x i With μ k The Euclidean distance;

[0050] For each sample x i , output cluster label label i ∈{1,2,...,K} and cluster confidence , where and are the distances from the sample to the nearest and second nearest cluster centers, respectively.

[0051] Further, the distance of the sample to the respective cluster center is calculated, and when the distance is higher than the cluster mean plus a threshold β times the standard deviation, it is additionally marked as an outlier, as follows:

[0052] For each cluster, the distance values of all samples within the cluster to the cluster center are counted, and the cluster mean distance μ d and standard deviation σ d are calculated accordingly;

[0053] The cluster mean distance μ d + β times the standard deviation, i.e. μ+βσ d , is taken as the upper threshold, where β is a tunable parameter that controls the sensitivity of outlier detection;

[0054] Each sample is detected one by one: if the distance of a sample to the cluster center is greater than the cluster mean distance + β times the standard deviation, it is considered as a point of extreme anomaly relative to the class, and is marked as an outlier .

[0055] Further, intelligent slicing decisions are made based on reinforcement learning, obtaining slicing strategies, data, and labels, as follows:

[0056] The state s t of the reinforcement learning RL agent at each decision step t is combined as follows:

[0057] The multi-dimensional feature vector of the current sample Xt, the current cluster label , the current outlier mark , and the number of frames l t since the last slicing boundary; that is:

[0058] s t =[Xt, , , l t ];

[0059] The action space a t =0 means that the current data point is included in the current slice and is not divided; a t =1 means that the current point is taken as the new start of the slice, and the slice is divided;

[0060] Let the slice set sequence be S={S1,S2,...,S j′ ,...,S M};M is the total number of slices; record P j′ is the j'th slice S j′ inner main clustering label, then the intra-slice consistency reward is :

[0061]

[0062] wherein, is an indicator function; is the clustering label of the i'th data point within slice S j′ :

[0063] When the previous slice action is abnormal, the abnormal point boundary reward is obtained :

[0064] ;

[0065] wherein, λ1 is an abnormal point boundary reward coefficient;

[0066] If the slice |S j′ | < L min or |S j′ | > L max will be punished :

[0067] ;

[0068] wherein, λ2 is an over-short punishment coefficient; λ3 is an over-long punishment coefficient; L min , L max are preset slice minimum and maximum thresholds;

[0069] If the slice j' is different from the previous slice main clustering label, the slice difference reward is obtained :

[0070] ;

[0071] wherein, λ4 is a slice difference reward coefficient;

[0072] The total reward R t is obtained by combining the above rewards and punishments:

[0073]

[0074] wherein, w1, w2, w3 and w4 are adjustable weights;

[0075] The DQN optimization algorithm is adopted to obtain the optimal slice strategy.

[0076] Further, the DQN optimization algorithm is adopted to obtain an optimal slicing strategy, and the specific process is as follows:

[0077] Initialize the network parameters of the agent θ, and for each time step t:

[0078] Construct the current state s t ; use the policy to sample an action a t ;

[0079] Execute the action and observe the reward R t and the next state s t+1 ;

[0080] Store (s t ,a t, R t ,s t+1 ) into the experience pool; train the DQN using experience replay to minimize the loss:

[0081] ;

[0082] where (s,a,r,s') is an experience tuple, which respectively represents the current state s, the action a taken, the immediate reward r obtained, and the next state s' reached after executing the action; Q(s',a';θ') represents the Q value calculated by the parameter of the target Q network, with the input being the next state s' and the next possible action a'; γ is the discount factor; Q(s,a;θ) represents the Q value calculated by the parameter θ of the target Q network, with the input being the current state s and the action a taken;

[0083] Update the policy network parameters;

[0084] After training, the optimal slicing strategy is obtained, and the optimal slicing strategy is used to make slicing decisions on the whole data to output labels.

[0085] Further, according to the obtained slicing strategy, data and labels, knowledge graph business rule verification is performed to ensure compliance with domain constraints, and the specific process is as follows:

[0086] For each slice to be verified, parse the slice boundary sample, internal sample and associated attribute, and align them with the knowledge graph node attribute / relationship label;

[0087] The main structured labels of the slice include the main cluster category, boundary abnormal point type, device distribution and time span, which are matched with the business labels of the knowledge graph entity;

[0088] Traverse each slice S j′, the related rules in the knowledge graph are sequentially dispatched for checking;For the slice that does not conform to the knowledge graph rule, the specific violation point is fed back, and finally the structured compliance slice output is formed.

[0089] Further, the strategy that passes the checking is sent to the distributed slice storage and management, and data slicing storage and index construction are carried out according to the strategy, as follows:

[0090] According to the slice strategy that passes the checking, the system splits the original data according to the slice boundary to generate a structured slice object with a business label, and each slice object includes slice data content and slice meta information, and the slice meta information includes start and end time / index, main cluster label, abnormal point distribution, business entity mapping, checking result and generation strategy ID;

[0091] A distributed storage architecture is adopted, HDFS is used for storing and persisting large amount of original and structured slice content;A distributed database is used for storing slice metadata, index and label, so as to realize high-concurrency reading and writing and flexible retrieval;Slice and meta information decoupling storage improves storage efficiency and retrieval flexibility through big data content physical block and business attribute hierarchical management;The slice index mechanism includes main index and label index;

[0092] Finally, a logical slice data warehouse table is established, and the slice main table, meta information table, label table and retrieval table are managed in a hierarchical manner.

[0093] A power multi-source data slicing processing system based on reinforcement learning includes a processor, a memory and a computer program stored in the memory, and when the processor executes the computer program, the steps of the power multi-source data slicing processing method based on reinforcement learning are specifically executed.

[0094] The present application has the following beneficial effects:

[0095] 1、The present application fuses power meter, monitoring, operation and maintenance and external multi-source data, and through standardization, deduplication and normalization processing steps, the structural and consistency of the original data are guaranteed, and combined with clustering and anomaly detection, the mode recognition of user / equipment / business behavior and the automatic discovery of slice boundary are realized, the multi-dimensional key features such as time sequence and space are effectively extracted, and the comprehensive expression ability of data is greatly improved;

[0096] 2、The present application introduces reinforcement learning technology, which can use multi-dimensional features and statistical labels to realize continuous adaptive optimization of slice strategy, and cooperate with knowledge graph business rule checking to ensure that the slice result not only has data-driven intelligence, but also strictly follows the actual constraints in the power business field;

[0097] 3、The application distributes and manages the verified slice strategy and data, constructs a perfect index system, realizes efficient slice access and rapid retrieval of data, and structured slice data warehouse design, which not only improves the management efficiency of large amount of data, but also provides a solid data foundation and excellent scalability for subsequent diversified computing analysis and intelligent application. BRIEF DESCRIPTION OF DRAWINGS

[0098] Figure 1 The method flowchart of the application. DETAILED DESCRIPTION

[0099] The application will be further described in detail below in combination with the accompanying drawings and specific embodiments: Figure 1

[0100] A power multi-source data slicing processing method based on reinforcement learning, comprising the following steps:

[0101] S1: Obtain power multi-source data (meter, monitoring, operation and maintenance, external) and pre-process to obtain structured raw data stream;

[0102] S2: Based on the structured raw data stream, obtain a multi-dimensional feature vector through feature extraction;

[0103] S3: According to the multi-dimensional feature vector, use a clustering algorithm to identify behavior patterns to obtain clustering labels, and calculate the distance from the sample to the respective clustering center. When the distance is significantly higher than the cluster mean plus threshold β times the standard deviation, it is additionally marked as abnormal;

[0104] S4: Based on reinforcement learning, make intelligent slicing decisions according to the multi-dimensional feature vector, clustering labels, and abnormal point markers to obtain slicing strategies, data, and labels;

[0105] S5: According to the obtained slicing strategies, data, and labels, verify through the knowledge graph business rule to ensure compliance with the domain constraints;

[0106] S6: The verified strategy is sent to distributed slice storage and management, and data is stored and indexed according to the strategy.

[0107] In this embodiment, the power multi-source data is obtained and pre-processed to obtain a structured raw data stream, which is as follows:

[0108] The power multi-source data includes meter, SCADA data, operation and maintenance, and external data. The meter and SCADA data use a unified interface (such as MODBUS, IEC 61850 industry standard protocol or RESTful API) for periodic batch pulling or real-time pushing. The operation and maintenance and external data are collected through streaming (such as message queue, file monitoring) to realize asynchronous high-availability data streaming.​

[0109] And set cleaning and mapping rules for each type of data, map the original field to the unified data specification template (such as the unified "timestamp", "device ID", "data type", "value", "source" five tuple structure);

[0110] In the data inflow stage, use multiple primary keys (such as "timestamp + device ID + data type") for primary key deduplication to ensure that the same type of data from each device is unique at each time; For data with inconsistent frequencies, introduce a time alignment mechanism (such as nearest neighbor interpolation, linear interpolation, or time window aggregation) to synchronize data with different frequencies and improve the accuracy of multi-source fusion;

[0111] And standardize and normalize the collected data to get structured raw data stream.

[0112] Metering data (such as voltage, current, and basic numerical values) is standardized by Z-score to eliminate systematic bias between different collection points and devices;

[0113] Operational and event data, such as alarm levels or category fields, are encoded using One-hot or numerical mapping to ensure that the structured data is suitable for machine learning scenarios.

[0114] For cross-source same physical quantities or related quantities, use Min-Max normalization to unify them to the [0, 1] interval:

[0115] In special cases (such as load balancing and abnormal fluctuations), use Normalization to make features more distinguishable.

[0116] In this embodiment, based on the structured raw data stream, multi-dimensional feature vectors are obtained through feature extraction, as follows:

[0117] According to business scenarios or data granularity, data is segmented by fixed-length time windows (such as 5 minutes, 30 minutes, or 1 hour); within each window, all data from the same user / device / business is considered as an analysis unit:

[0118] Set the time window T, then the a-th sample is S a :

[0119] Sa={xt∣t∈[ta,ta+T)};

[0120] Where x t represents the data collected at time t; t a represents the start time of the a-th time window;

[0121] Through feature extraction, multidimensional feature vectors are obtained, including statistical features, temporal features, spatial features, and business features;

[0122] The statistical characteristics include mean, standard deviation, maximum / minimum value, and range;

[0123] The temporal features include the temporal data [x1, x2, ..., x] within the window. j ,...,x N ], where x j Let d be the j-th element in the time series data, and N be the total number of time series data. A linear regression is fitted to obtain the trend slope 'a', and FFT is used to extract the dominant frequency component 'f'. main And autocorrelation coefficient r1:

[0124] ;

[0125] Where, μ x The mean of the time series characteristics;

[0126] The spatial characteristics include geographical proximity (such as distance d from substations / major nodes). node ), average load and maximum load index within the same area;

[0127] The business characteristics include peak number N peak Exception event count N alarm And volatility W:

[0128] ;

[0129] ;

[0130] Where, σ x θ represents the standard deviation of the time series characteristics. peak The preset peak threshold;

[0131] Constructing multidimensional feature vectors:

[0132] F i =[μ x ,σ x ,f main ,r1,N peak N alarm ,W].

[0133] In this embodiment, the clustering algorithm adopted is an improved clustering algorithm based on a comprehensive framework, as follows:

[0134] First, the optimal number of clusters K is automatically determined using the Gap statistic:

[0135]

[0136] Where Gap(k) represents the Gap statistic; W is the expected function; k It is the sum of the intra-class distances of the k-th class:

[0137] ;

[0138] Among them, C r Let n be the set of samples contained in the r-th cluster (category); r d(x) represents the number of samples in the r-th cluster. i, x j ) represents the sample point x i With x j The Euclidean distance between them;

[0139] Choose the k corresponding to the largest gap value as the optimal number of clusters;

[0140] Randomly select the first centroid c1. For each point x, calculate the distance D(x) to the nearest centroid; then, according to probability... Select the next centroid, and repeat until K centroids are selected;

[0141] Because power data exhibits strong time-series correlation, a time-series adjustment term is introduced for two sequences A=[a1,...,a...]. n ] and B=[b1,...,b n The DTW distance between the two sequences is:

[0142] ;

[0143] in, This is the optimal regularized path; To obtain the optimal regularization path The element in sequence B that corresponds to the i-th element in sequence A under the alignment path; Let a be the i-th element in sequence A; n b n These are the nth elements in sequence A and sequence B, respectively;

[0144] Therefore, the final clustering objective function is:

[0145] ;

[0146] Where α is the trade-off parameter, and C represents the temporal portion of the samples and cluster centers, respectively; k μ represents the set of sample indices contained in the k-th cluster; k d is the structural feature center of the k-th cluster; w (xi ,μ k ) represents the Euclidean distance between sample point x i and μ k ;

[0147] For each sample x i , output the cluster label label i ∈{1,2,...,K} and the cluster confidence , where, and are the distances from the sample to the nearest and second nearest center, respectively.

[0148] In this embodiment, the distance of the sample to the respective cluster center is calculated, and when the distance is significantly higher than the cluster mean plus a threshold β times the standard deviation, it is additionally marked as an anomaly, as follows:

[0149] For each cluster, the distance values of all samples in the cluster to the cluster center are counted, and the average distance μ d and the standard deviation σ d of the cluster are calculated accordingly;

[0150] The upper threshold is the cluster mean distance μ d + β times the standard deviation, i.e. μ+βσ d , where β is an adjustable parameter that controls the sensitivity of anomaly detection; for example, when β=2, about 95% of the samples belong to the normal interval, and samples exceeding the threshold are likely to be outliers;

[0151] Each sample is detected one by one: if the distance of a sample to the cluster center is greater than the cluster mean distance + β times the standard deviation, it is considered as a point of extreme anomaly relative to the class, and is marked as an anomaly .

[0152] In this embodiment, intelligent slicing decisions are made based on reinforcement learning to obtain slicing strategies, data and labels, as follows (the goal of reinforcement learning (RL) is to automatically decide the boundaries of data slicing, so that the behavior within each slice is as similar as possible, the boundary captures as many outliers as possible, the total number of slices is not too fine, and the final slicing is more suitable for downstream business):

[0153] At each decision step t, the state s t of the reinforcement learning RL agent is composed as follows:

[0154] The multi-dimensional feature vector Xtof the current sample, the current cluster label , the current anomaly mark , the number of frames l t since the last slice boundary; that is:

[0155] s t =[Xt, , , l t ];

[0156] action space a t =0, the current data point is included in the current slice, and no segmentation is performed; a t =1, the current point is taken as a new start of a slice, and the slice is segmented;

[0157] Let the slice set sequence be S={S1, S2,..., S j′ ,...,S M}, and M be the total number of slices; let P j′ be the mode in the j′th slice S j′ , then the intra-slice consistency reward is :

[0158]

[0159] wherein, is an indicator function; is the cluster label of the i′th data point in the slice S j′ ;

[0160] When the previous slice action , and the slice boundary (t or t) is an outlier point, an outlier boundary reward is obtained:

[0161] ;

[0162] wherein λ1 is an outlier boundary reward coefficient;

[0163] If the slice |S j′ |<L min or |S j′ |>L max , it will be punished :

[0164] ;

[0165] wherein λ2 is an over-short punishment coefficient; λ3 is an over-long punishment coefficient; L min , L max are preset minimum and maximum slice thresholds;

[0166] If the slice j′ is different from the mode of the previous slice , a slice difference reward is obtained:

[0167] ;

[0168] wherein λ4 is an inter-slice difference reward coefficient;

[0169] The total reward (aggregation) R is obtained by synthesizing the above rewards and penalties t :

[0170]

[0171] wherein w1, w2, w3 and w4 are adjustable weights;

[0172] The DQN optimization algorithm is used to obtain the optimal slicing strategy.

[0173] In this embodiment, the DQN optimization algorithm is used to obtain the optimal slicing strategy, which is as follows:

[0174] Initialize the agent network parameter θ, and for each time step t:

[0175] Construct the current state s t ; sample the action a t (slicing / non-slicing) using the ϵ-greedy strategy;

[0176] Perform the action and observe the reward R t and the next state s t+1 ;

[0177] Store (s t , a t, R t , s t+1 ) into the experience pool; train the DQN using experience replay to minimize the loss:

[0178] ;

[0179] wherein (s, a, r, s') is an experience tuple, which is the current state s, the action a taken, the immediate reward r obtained, and the next state s' reached after the action is performed; Q(s',a';θ') represents the Q value calculated by the parameter of the target Q network, with the input being the next state s' and the next possible action a'; γ is a discount factor; Q(s,a;θ) represents the Q value calculated by the parameter θ of the target Q network, with the input being the current state s and the action a taken;

[0180] Update the policy network parameter;

[0181] After the training is completed, the optimal slicing strategy is obtained, and the optimal slicing strategy is used to make slicing decisions on the whole data to output labels.

[0182] In this embodiment, according to the acquired slice strategy, data and label, the knowledge graph business rule check is performed to ensure compliance with the domain constraints, as follows:

[0183] The knowledge graph is as follows:

[0184] The entity nodes include devices, sites, lines, operation and maintenance personnel, and business objects; the attributes of each entity type include device type, state, location, level, and timestamp;

[0185] The relationships include the belonging area, connection relationship, upstream and downstream logic, and alarm association;

[0186] The rule nodes / edges are expressed in the form of ontology constraints, inference rules, and business process specifications, such as: all sampling points in a substation must belong to the same voltage level; within the same slice, type 1 and type 2 devices are prohibited from being included simultaneously; and the two ends of the slice cannot be abnormal points of different areas at the same time.

[0187] For each slice to be checked, the boundary samples, internal samples, and associated attributes are parsed and aligned with the knowledge graph node attribute / relationship label.

[0188] The main structured labels of the slice include the main cluster category, boundary abnormal point type, device distribution, and time span, which are matched with the business labels of the knowledge graph entities.

[0189] Each slice S j′ is traversed, and the related rules in the knowledge graph are sequentially dispatched to perform the following checks: attribute consistency check: whether the "voltage level" field of all points is consistent; category co-occurrence constraint: whether it contains prohibited device / event combinations in the domain; boundary legality constraint: whether the slice boundary is divided at a business-allowed breakpoint (such as a fault or operation and maintenance scheduling time); link / causal reasoning constraint: whether the logical chain of the slice data is complete, without gaps or jumps without business logic support; the graph database and rule engine (such as Neo4j, RDF+SPARQL, OWL inference, Drools, etc.) are used to realize rule determination and automatic reasoning.

[0190] For slices that do not comply with the knowledge graph rules, the specific violation points (such as "mixed voltage levels exist" and "non-business-allowed boundary time") are fed back, and finally the structured compliant slice output (legality mark of each slice, violation type, and corresponding rule) is formed.

[0191] Example 1:

[0192] The power slice result Sj' and the knowledge graph verification rule include "the devices under the same slice must belong to the same transformer substation". The system automatically traverses each point in Sj', finds that some points belong to different transformer substation entities, that is, it is determined that the slice is not compliant, and outputs the corresponding transformer substation number; it is suggested that the slice be split into two standard slices belonging to different transformer substations.

[0193] Example two:

[0194] If the slice boundary exactly falls on the time point of the dispatch operation record, it meets the definition of the knowledge graph "splittable time", and the compliance passes, otherwise, it is fed back that the slice boundary needs to be aligned forward / backward.

[0195] In this embodiment, the verified strategy is sent to distributed slice storage and management, and data slicing storage and index construction are performed according to the strategy, as follows:

[0196] According to the verified slice strategy, the system splits the original data according to the slice boundary to generate a structured slice object with a business label, and each slice object includes: slice data content (such as time series set, original sampling block, etc.) and slice meta information, the slice meta information includes start and end time / index, main cluster label, abnormal point distribution, business entity mapping, verification result, and generation strategy ID;

[0197] A distributed storage architecture is adopted, and HDFS is used to store large amounts of original and structured slice content; a distributed database / NoSQL is used, such as HBase, Cassandra, ClickHouse, Elasticsearch, MongoDB, etc., to store slice metadata, index and label, realize high concurrency read and write and flexible retrieval; slice and meta information decoupling storage improves storage efficiency and retrieval flexibility through big data content physical block and business attribute hierarchical management; slice index mechanism, including main index and label index;

[0198] Main index: multi-level index is established according to time, space (geography / equipment), business dimension (cluster / equipment category / abnormal type), etc.

[0199] Label index: supports efficient filtering and retrieval of target slices through labels (such as main cluster, abnormal type, business event code);

[0200] Finally, a logical slice data warehouse table is established, and slice main table, meta information table, label table, and retrieval table are managed hierarchically.

[0201] The application discloses a power multi-source data slicing processing system based on reinforcement learning, which comprises a processor, a memory and a computer program stored in the memory.

[0202] Those skilled in the art will understand that embodiments of the application can be provided as methods, systems, or computer program products. Therefore, the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0203] The application is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as combinations of flows 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 apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate one or more functions specified in the flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowcharts and / or block diagrams.

[0204] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements one or more functions specified in the flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowcharts and / or block diagrams.

[0205] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide one or more functions specified in the flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowcharts and / or block diagrams.

[0206] The above merely describes preferred embodiments of the present application, but is not intended to limit the present application to other forms, and any person skilled in the art can make changes or modifications to the above disclosed technical contents into equivalent embodiments with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiments without departing from the technical solution content of the present application, and according to the technical essence of the present application, still belongs to the protection scope of the technical solution of the present application.

Claims

1. A method for processing multi-source power data slicing based on reinforcement learning, characterized in that, Includes the following steps: S1: Acquire multi-source power data and preprocess it to obtain a structured raw data stream; S2: Based on the structured raw data stream, multi-dimensional feature vectors are obtained through feature extraction; S3: Based on the multidimensional feature vector, a clustering algorithm is used to identify behavioral patterns and obtain cluster labels. The distance from each sample to its respective cluster center is calculated. When the distance is higher than the cluster mean plus a threshold of β times the standard deviation, it is additionally marked as an anomaly. S4: Based on multidimensional feature vectors, clustering labels, and outlier markers, intelligent slicing decisions are made using reinforcement learning to obtain slicing strategies, data, and labels; S5: Based on the acquired slicing strategy, data, and tags, verify compliance with domain constraints through knowledge graph business rules; S6: The validated strategy is sent to the distributed slice storage and management, and data is sliced ​​and stored and indexed according to the strategy; The intelligent slicing decision-making based on reinforcement learning, which obtains slicing strategies, data, and labels, is detailed as follows: At each decision step t, the state s of the reinforcement learning RL agent is... t The combinations are as follows: The multidimensional feature vector Xt of the current sample, the current cluster label Current anomaly marker Number of frames since the last slice boundary l t That is: s t =[Xt, , , l t ]; Action space a t When =0, the current data point is included in the current slice, and no further splitting is performed; a t When =1, the current point is used as the new starting point for the slice, and the segments are divided. Let the sequence of slice sets be S = {S1, S2, ..., S...} j′ ,...,S M }; M is the total number of slices; let P be... j′ For the j′-th slice S j′ If the internal clustering label is used, then the intra-cluster consistency reward is... : ;in, It is an indicator function; For slice S j′ The cluster label of the i′-th data point within the cluster; When the previous slicing action If the slice boundary is an outlier, then the outlier boundary reward is obtained. : ; Where λ1 is the boundary reward coefficient for outlier points; If slice |S j′ | <L min or |S j′ |>L max Will be punished : ; Where λ2 is the penalty coefficient for being too short; λ3 is the penalty coefficient for being too long; L min L max Set the minimum and maximum thresholds for the preset slices; If slice j′ is the same as the previous slice If the main cluster labels are different, a difference reward is given between slices. : ; Wherein, λ4 is the reward coefficient for differences between slices; Combining the above rewards and penalties, the total reward R is obtained. t : ; Among them, w1, w2, w3 and w4 are adjustable weights; The DQN optimization algorithm is used to obtain the optimal slicing strategy.

2. The power multi-source data slicing method based on reinforcement learning according to claim 1, characterized in that, The process of acquiring multi-source power data and preprocessing it to obtain a structured raw data stream is as follows: The multi-source power data includes meter data, SCADA data, operation and maintenance data, and external data. The meter data and SCADA data use a unified interface and are periodically batch retrieved or pushed in real time. The operation and maintenance data and external data are collected through streaming to achieve asynchronous and highly available data inflow. And set cleaning and mapping rules for each type of data to map the original fields to a unified data specification template; During the data inflow phase, multiple primary keys are used to deduplicate primary keys, ensuring the uniqueness of the same type of data on each device at any given time; for data with inconsistent frequencies, a time alignment mechanism is introduced. The collected data is then standardized and normalized to obtain a structured raw data stream.

3. The power multi-source data slicing method based on reinforcement learning according to claim 1, characterized in that, Based on the structured raw data stream, multi-dimensional feature vectors are obtained through feature extraction, as detailed below: Based on business scenarios or data granularity, data is segmented into fixed-length time windows for processing; within each window, all data from the same user / device / business is considered as one analytical unit. If we set a time window T, then the a-th sample is S. a :S a ={x t |t∈[t a ,t a+T )}; Where, x t This represents the data collected at time t; t a This represents the start time of the a-th time window; Through feature extraction, multidimensional feature vectors are obtained, including statistical features, temporal features, spatial features, and business features; The statistical characteristics include mean, standard deviation, maximum / minimum value, and range; The temporal features include the temporal data [x1, x2, ..., x] within the window. j ,...,x N ], where x j Let d be the j-th element in the time series data, and N be the total number of time series data. A linear regression is fitted to obtain the trend slope 'a', and the dominant frequency component 'f' is extracted using FFT. main And autocorrelation coefficient r1: ; Where, μ x The mean of the time series characteristics; The spatial characteristics include geographical proximity, average load within the same region, and maximum load index; The business characteristics include peak number N peak Exception event count N alarm And volatility W: ; ; where σ x θ represents the standard deviation of the time series characteristics. peak The preset peak threshold; Constructing multidimensional feature vectors: F i =[μ x ,σ x ,f main ,r1,N peak ,N alarm ,W]。 4. The power multi-source data slicing method based on reinforcement learning according to claim 3, characterized in that, The clustering algorithm used is an improved clustering algorithm based on a comprehensive framework, as follows: First, the optimal number of clusters K is automatically determined using the Gap statistic: ; Where Gap(k) represents the Gap statistic; W is the expected function; k It is the sum of the intra-class distances of the k-th class: ; Among them, C r Let n be the set of samples contained in the r-th cluster; r d(x) represents the number of samples in the r-th cluster. i, x j ) represents the sample point x i With x j The Euclidean distance between them; Choose the k corresponding to the largest gap value as the optimal number of clusters; Randomly select the first centroid c1. For each point x, calculate the distance D(x) to the nearest centroid; then, according to probability... Select the next centroid, and repeat until K centroids are selected; Because power data exhibits strong time-series correlation, a time-series adjustment term is introduced for two sequences A=[a1,...,a...]. n ] and B=[b1,...,b n The DTW distance between the two sequences is: ; in, This is the optimal regularized path; To obtain the optimal regularization path The element in sequence B that corresponds to the i-th element of sequence A along the alignment path; a i Let a be the i-th element in sequence A; n b n These are the nth elements in sequence A and sequence B, respectively; in This is the optimal regularized path; Therefore, the final clustering objective function is: ; Where α is the trade-off parameter, and C represents the temporal portion of the samples and cluster centers, respectively; k μ represents the set of sample indices contained in the k-th cluster; k d is the structural feature center of the k-th cluster; w (x i ,μ k ) represents the sample point x i With μ k The Euclidean distance; For each sample x i Output cluster labels i ∈{1,2,...,K} and cluster confidence ,in, and These are the distances from the sample to the nearest and second nearest centers, respectively.

5. The power multi-source data slicing method based on reinforcement learning according to claim 4, characterized in that, The distance from each sample to its respective cluster center is calculated. If the distance is higher than the cluster mean plus a threshold of β times the standard deviation, it is additionally marked as an anomaly, as follows: For each cluster, the distances from all samples within the cluster to the cluster center are counted, and the average distance μ of the cluster is calculated accordingly. d and standard deviation σ d ; The average distance μ of this cluster d + β times the standard deviation, i.e., μ + βσ d β is the upper limit threshold, where β is an adjustable parameter that controls the sensitivity of anomaly detection; Each sample is examined individually: if the distance of a sample to the center of its cluster is greater than the cluster mean distance plus β times the standard deviation, it is considered an extremely abnormal point relative to its class and is marked as an anomaly. .

6. The power multi-source data slicing method based on reinforcement learning according to claim 1, characterized in that, The DQN optimization algorithm is used to obtain the optimal slicing strategy, as detailed below: Initialize the agent network parameters θ for each time step t: Construct the current state s t ;use Strategy sampling action a t ; Perform the action and observe the reward (R) t and the next state s t+1 ; storage(s) t ,a t, R t ,s t+1 Add the data to the experience pool; train DQN using experience replay to minimize the loss: ; Where (s,a,r,s′) is an experience tuple, which consists of the current state s, the action a, the immediate reward r, and the next state s′ reached after the action is performed. The parameters of the target Q network are represented. The Q-value is calculated with the next state s′ and the next possible action a′ as inputs; γ is the discount factor; Q(s,a;θ) represents the Q-value calculated from the parameters θ of the target Q-network with the current state s and the action a as inputs; Update the policy network parameters; After training, the optimal slicing strategy is obtained, and the optimal slicing strategy is used to make slicing decisions and output labels for the entire data.

7. The power multi-source data slicing method based on reinforcement learning according to claim 1, characterized in that, The process involves verifying the acquired slicing strategy, data, and tags using knowledge graph business rules to ensure compliance with domain constraints, as detailed below: For each slice to be validated, parse the boundary samples, internal samples, and associated attributes of the slice to be validated, and align them with the attribute / relationship labels of the knowledge graph nodes; The main structured tags of the slices include the main cluster category, boundary outlier type, device distribution, and time span, which are matched with the business tags of knowledge graph entities. Iterate through each slice S j′ The relevant rules in the knowledge graph are sequentially scheduled for verification; for slices that do not conform to the rules of the knowledge graph, the specific violation points are fed back, and finally a structured compliant slice is output.

8. The power multi-source data slicing method based on reinforcement learning according to claim 1, characterized in that, The validated strategy is sent to the distributed slice storage and management system, where data is sharded and stored and indexed according to the strategy, as follows: Based on the verified slicing strategy, the system splits the original data according to the slice boundaries and generates structured slice objects with business tags. Each slice object contains: slice data content and slice metadata. The slice metadata includes start and end time / index, main cluster label, outlier distribution, business entity mapping, verification result, and generation strategy ID. It adopts a distributed storage architecture and uses HDFS to persistently store large volumes of original and structured slice content; A distributed database is used to store slice metadata, indexes, and tags, enabling high-concurrency read and write operations and flexible retrieval. Slice and metadata storage are decoupled through physical block partitioning of big data content and hierarchical management of business attributes, improving storage efficiency and retrieval flexibility. The slice indexing mechanism includes a main index and a tag index. Finally, a logical slice data warehouse table is established to hierarchically manage the slice master table, metadata table, tag table, and retrieval table.

9. A power multi-source data slicing processing system based on reinforcement learning, characterized in that, It includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically performs the steps in the reinforcement learning-based power multi-source data slicing processing method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Power business data auxiliary knowledge graph construction method based on reinforcement learning

    CN118245607A

  • Power grid vector slice parallel blocking method based on clustering algorithm

    CN118760521A