Power multi-source data slice processing method and system based on reinforcement learning
By slicing multi-source power data based on a reinforcement learning method, the problems of poor homogeneity within slices and inaccurate boundaries in traditional methods are solved, intelligent slicing and efficient storage of data are achieved, and the accuracy and timeliness of data analysis and business decision-making are improved.
Patent Information
- Application Number
- CN202511153944.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-08-18
AI Technical Summary
Traditional power multi-source data slicing methods cannot take into account the dynamic structure of data, behavioral associations, and flexible segmentation of abnormal events, resulting in poor homogeneity within slices and inaccurate boundaries between slices, affecting the accuracy and timeliness of data analysis and business decisions.
A reinforcement learning-based method is used to implement intelligent slicing decision-making and distributed storage management of multi-source power data through feature extraction, clustering algorithm and knowledge graph business rules, ensuring the intelligence of the slicing results and compliance with the actual constraints of the power business field.
It improves the structured governance level and high-value utilization capabilities of power data, realizes efficient sharded storage and rapid retrieval of data, and provides a solid data foundation and excellent scalability.
Smart Images

Figure CN120724192A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data management, and in particular to a method and system for processing power multi-source data slices based on reinforcement learning. Background Art
[0002] With the rapid development of smart grids, energy internet, and digital operations and maintenance systems, power systems are generating and accumulating massive amounts of heterogeneous, multi-source data. This data spans multiple areas, including telemetry, metering, protection, condition monitoring, the Internet of Things, and automated operations and maintenance. It exhibits significant characteristics, including large volume, high dimensionality, strong real-time performance, and rapid dynamic changes. Efficiently and accurately slicing and managing this multi-source data is a prerequisite for implementing applications such as intelligent scheduling, anomaly detection, fault tracing, and smart decision-making.
[0003] However, multi-source power data often exhibits strong non-stationarity and behavioral heterogeneity, with numerous complex patterns such as cyclical changes, sudden anomalies, and distribution drift. Traditional slicing methods based on fixed windows or simple rules fail to account for the data's dynamic structure, behavioral correlations, and flexible segmentation of abnormal events. This results in poor homogeneity within slices and imprecise boundaries between slices, hindering the accuracy and timeliness of subsequent data analysis and business decisions. Summary of the Invention
[0004] In order to solve the above problems, the purpose of the present invention is to provide a method and system for slicing multi-source power data based on reinforcement learning, so as to effectively improve the structured governance level and high-value utilization capability of power data assets.
[0005] To achieve the above object, the present invention adopts the following technical solutions: A method for processing power multi-source data slices based on reinforcement learning, characterized by comprising the following steps: S1: Acquire multi-source power data and preprocess it to obtain structured raw data streams; S2: Based on the structured raw data stream, obtain the multi-dimensional feature vector through feature extraction; S3: Based on the multidimensional feature vector, a clustering algorithm is used to identify the behavior pattern and obtain the cluster label. The distance between the sample and the center of each cluster is calculated. When the distance is higher than the mean of the cluster plus a threshold of β times the standard deviation, it is additionally marked as an anomaly. S4: Based on the multi-dimensional feature vectors, cluster labels, and outlier markers, intelligent slicing decisions are made based on reinforcement learning to obtain slicing strategies, data, and labels. S5: Based on the acquired slicing strategy, data, and labels, verify the knowledge graph business rules to ensure compliance with domain constraints; S6: The verified policies are sent to distributed slice storage and management, and data shard storage and index construction are performed according to the policies.
[0006] Furthermore, we acquire multi-source power data and pre-process it to obtain a structured raw data stream, as follows: The multi-source power data includes meter, SCADA data, operation and maintenance, and external data. The meter and SCADA data use a unified interface to periodically pull in batches or push in real time. The operation and maintenance and external data are collected in a streaming manner to achieve asynchronous and highly available data inflow. And set cleaning and mapping rules for each type of data, mapping the original fields to a unified data specification template; During the data inflow phase, multiple primary keys are used to deduplicate data, ensuring that the same type of data on each device is unique at every moment. For data with inconsistent frequencies, a time alignment mechanism is introduced. The collected data is standardized and normalized to obtain a structured raw data stream.
[0007] Furthermore, based on the structured raw data stream, multi-dimensional feature vectors are obtained through feature extraction, as follows: Based on business scenarios or data granularity, data is segmented and processed into fixed-length time windows. Within each window, all data from the same user, device, or business is considered an analysis unit: Set the time window T, then the ath sample is S a : S a ={x t ∣t∈[t a ,t a+T )}; Among them, x t represents the data collected at time t; t a Indicates the starting time of the ath time window; Through feature extraction, multi-dimensional feature vectors are obtained, including statistical features, time series features, spatial features, and business features; The statistical characteristics include mean, standard deviation, maximum / minimum value and variation; The time series features include the time series data [x1, x2, ..., x j ,...,x N ], 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, and the dominant frequency component f is extracted by FFT. main And the autocorrelation coefficient r1: ; Among them, μ x is the mean of the time series feature; The spatial characteristics include geographical proximity, average load and maximum load index within the same area; The service characteristics include the peak number N peak , abnormal event count N alarm And volatility W: ; ; Among them, σ x is the standard deviation of the time series characteristics; θ peak is the preset peak threshold; Construct a multidimensional feature vector: F i =[μ x ,σ x ,f main ,r1,N peak ,N alarm ,W].
[0008] Furthermore, the clustering algorithm adopts an improved clustering algorithm based on the comprehensive framework, as follows: First, use the Gap statistic to automatically determine the optimal number of clusters K:
[0009] Where Gap(k) represents the Gap statistic; is the expected function; W k is the sum of the intra-class distances of the kth class: ; Among them, C r is the sample set contained in the rth cluster; n r is the number of samples in the rth cluster; d(x i, x j ) is the sample point x i with x j The Euclidean distance between Select k corresponding to the maximum Gap value as the optimal number of clusters; Randomly select the first centroid c1, and for each point x, calculate the distance D(x) to the nearest centroid; by probability Select the next centroid, and repeat until K centroids are selected; Since the power data has strong time series correlation, the time series adjustment term is introduced. For two sequences A=[a1,...,a n ] and B=[b1,...,b n ], the DTW distance of the two sequences is: ; in, is the optimal regularized path; To pass the optimal regular path , the element in sequence B that corresponds to the i-th element in sequence A under the alignment path; a i is the i-th element in sequence A; a n 、b n are the nth elements in sequence A and sequence B respectively; in is the optimal regularized path; Then, the final clustering objective function is: ; Among them, α is the trade-off parameter, and Represent the time series parts of samples and cluster centers respectively; C k represents the sample index set contained in the kth cluster; μ k is the structural feature center of the kth cluster; d w (x i ,μ k ) represents the sample point x i With μ k The Euclidean distance of For each sample x i , output cluster label label i ∈{1,2,...,K} and cluster confidence ,in, and are the distances from the sample to the nearest and second nearest centers, respectively.
[0010] Furthermore, the distance between the sample and the center of each cluster is calculated. When the distance is higher than the mean of the cluster plus a threshold of β times the standard deviation, it is additionally marked as an anomaly, as follows: For each cluster, the distance values of all samples in the cluster to the cluster center are counted, and the average distance μ of the cluster is calculated based on this d and standard deviation σ d ; The average distance μ of this cluster d + β times the standard deviation, that is, μ+βσ d is the upper threshold, where β is an adjustable parameter that controls the sensitivity of anomaly detection; Test each sample one by one: if the distance from a sample to the center of the cluster is greater than the average distance of the cluster + β times the standard deviation, it is considered an extremely abnormal point relative to the class and marked as an abnormal point .
[0011] Furthermore, intelligent slicing decisions are made based on reinforcement learning to obtain slicing strategies, data, and labels, as follows: At each decision step t, the state s of the reinforcement learning RL agent t The combination is as follows: Multidimensional feature vector Xt of the current sample, current cluster label , Current exception mark , the number of frames since the previous slice boundary l t ;Right now: s t =[Xt, , , l t ]; Action space a t =0, the current data point is included in the current slice without segmentation; t =1, the current point is used as the new starting point for slicing and the segments are cut; Let the slice set sequence be S={S1,S2,...,S j′ ,...,S M}; M is the total number of slices; record P j′ For the j′th slice S j′ The intra-cluster label, then, the intra-chip consistency reward is :
[0012] in, is the indicator function; Slice S j′ The cluster label of the i′th data point in ; When the previous slicing action , and the slice boundary is an outlier, then the outlier boundary reward is obtained : ; Among them, λ1 is the abnormal point boundary reward coefficient; If slice | S j′ ∣ <L min or |S j′ ∣>L max Will be punished : ; Among them, λ2 is the penalty coefficient for being too short; λ3 is the penalty coefficient for being too long; L min 、L max To preset the shortest and longest thresholds for slices; If slice j′ is the same as the previous slice If the main cluster labels are different, then the inter-slice difference reward is obtained : ; Among them, λ4 is the difference reward coefficient between slices; Combining the above rewards and penalties, we get the total reward R t :
[0013] Among them, w1, w2, w3 and w4 are adjustable weights; The DQN optimization algorithm is used to obtain the optimal slicing strategy.
[0014] Furthermore, the DQN optimization algorithm is used to obtain the optimal slicing strategy, as follows: Initialize the agent network parameters θ, for each time step t: Construct the current state s t ;use Strategy sampling action a t ; Perform actions and observe rewards R t and the next state s t+1 ; Storage(s t ,a t, R t ,s t+1 ) to the experience pool; use experience replay to train DQN and minimize the loss: ; Where (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 executing the action; The parameters of the network represented by the target Q The calculated Q value is input as the next state s′ and the next possible action a′; γ is the discount factor; Q(s,a;θ) represents the Q value calculated by the parameters θ of the target Q network, with the input as the current state s and the action a taken; Update policy network parameters; After training is completed, the optimal slicing strategy is obtained, and the optimal slicing strategy is used to slice the entire data and output labels.
[0015] Furthermore, based on the acquired slicing strategy, data, and labels, the knowledge graph business rules are verified to ensure compliance with domain constraints, as follows: For each slice to be verified, analyze the boundary samples, internal samples, and associated attributes of the slice to be verified, and align them with the knowledge graph node attributes / relationship labels; The main structured labels of the slice include main cluster category, boundary anomaly type, device distribution, and time span, which are matched with the business labels of the knowledge graph entities; Traverse each slice S j′ , and schedule the relevant rules in the knowledge graph for verification in turn; for slices that do not comply with the knowledge graph rules, feedback the specific violation points, and finally form a structured compliant slice output.
[0016] Furthermore, the verified policies are sent to the distributed slice storage and management, and data shard storage and index construction are performed according to the policies, as follows: Based on the verified slicing strategy, the system splits the original data along 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 results, and generation strategy ID; A distributed storage architecture is adopted, using HDFS to store and persist large amounts of raw and structured slice content. A distributed database is used to store slice metadata, indexes, and tags, enabling high-concurrency read and write and flexible retrieval. Slices and metadata are decoupled for storage, improving storage efficiency and retrieval flexibility through physical segmentation of big data content and hierarchical management of business attributes. Slice indexing mechanism includes primary index and tag index. Finally, a logical slice data warehouse table is established to hierarchically manage the slice master table, metadata table, label table, and retrieval table.
[0017] A reinforcement learning-based power multi-source data slicing processing system 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 of the reinforcement learning-based power multi-source data slicing processing method described above.
[0018] The present invention has the following beneficial effects: 1. This invention integrates multi-source data from electricity meters, monitoring, operations and maintenance, and external sources. Through standardization, deduplication, and normalization, it ensures the structure and consistency of the original data. Combined with clustering and anomaly detection, it realizes pattern recognition of user / device / service behavior and automatic discovery of slice boundaries, effectively extracting multi-dimensional key features such as time series and space, and greatly improving the comprehensive expression ability of data. 2. This invention introduces reinforcement learning technology, which can use multi-dimensional features and statistical labels to achieve continuous adaptive optimization of slicing strategies. It also cooperates with knowledge graph business rule verification to ensure that the slicing results are not only data-driven and intelligent, but also strictly comply with the actual constraints of the power business field. 3. This invention distributes and manages proven slicing strategies and data, and builds a comprehensive indexing system to achieve efficient slicing access and fast retrieval of data. The structured slicing data warehouse design not only improves the management efficiency of large-scale data, but also provides a solid data foundation and excellent scalability for subsequent diversified computing analysis and intelligent applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0020] The following is combined with Figure 1 The present invention is further described in detail with specific examples: A method for processing power multi-source data slices based on reinforcement learning includes the following steps: S1: Acquire multi-source power data (metering, monitoring, operation and maintenance, and external sources) and preprocess it to obtain a structured raw data stream; S2: Based on the structured raw data stream, obtain the multi-dimensional feature vector through feature extraction; S3: Based on the multidimensional feature vector, a clustering algorithm is used to identify the behavior pattern and obtain the cluster label. The distance between the sample and each cluster center is calculated. When the distance is significantly higher than the cluster mean plus a threshold of β times the standard deviation, it is additionally marked as an anomaly. S4: Based on the multi-dimensional feature vectors, cluster labels, and outlier markers, intelligent slicing decisions are made based on reinforcement learning to obtain slicing strategies, data, and labels. S5: Based on the acquired slicing strategy, data, and labels, verify the knowledge graph business rules to ensure compliance with domain constraints; S6: The verified policies are sent to distributed slice storage and management, and data shard storage and index construction are performed according to the policies.
[0021] In this embodiment, multi-source power data is acquired and preprocessed to obtain a structured raw data stream, as follows: The multi-source power data includes metering, SCADA data, operation and maintenance, and external data. The metering and SCADA data use a unified interface (such as MODBUS, IEC 61850 and other industry standard protocols or RESTful API) to periodically pull batches or push in real time. The operation and maintenance and external data are collected through streaming (such as message queues and file monitoring) to achieve asynchronous and highly available data inflow. Set cleaning and mapping rules for each type of data, mapping the original fields to a unified data specification template (such as a unified five-tuple structure of "timestamp", "device ID", "data type", "value", and "source"); During the data inflow phase, multiple primary keys (such as timestamp + device ID + data type) are used to deduplicate data, ensuring that the same type of data for each device is unique at every moment. For data with inconsistent frequencies, a time alignment mechanism (such as nearest neighbor interpolation, linear interpolation, or time window aggregation) is introduced to synchronize data of different frequencies and improve the accuracy of multi-source fusion. The collected data is standardized and normalized to obtain a structured raw data stream.
[0022] Meter data (such as voltage, current, and basic values) are Z-score standardized to eliminate systematic deviations between different collection points and devices; Operation and maintenance and event data, such as alarm level or category fields, use one-hot encoding or value mapping to ensure that they are structured and suitable for machine learning scenarios.
[0023] For the same physical quantity or related quantity across sources, Min-Max normalization is used to unify them to the interval [0,1]: Special cases (such as load balancing, abnormal fluctuations) can be used Normalization makes features more discriminative.
[0024] In this embodiment, based on the structured original data stream, a multi-dimensional feature vector is obtained through feature extraction, as follows: Based on business scenarios or data granularity, data is segmented and processed into fixed-length time windows (such as 5 minutes, 30 minutes, or 1 hour). Within each window, all data from the same user, device, or business is considered as one analysis unit: Set the time window T, then the a-th sample is S a : Sa={xt|t∈[ta,ta+T)}; Among them, x t represents the data collected at time t; t a Indicates the starting time of the ath time window; Through feature extraction, multi-dimensional feature vectors are obtained, including statistical features, time series features, spatial features, and business features; The statistical characteristics include mean, standard deviation, maximum / minimum value and variation; The time series features include the time series data [x1, x2, ..., x j ,...,x N ], where x j is the jth element in the time series data, N is the total number of time series data; linear regression is fitted to obtain the trend slope a, and FFT is used to extract the dominant frequency component f main And the autocorrelation coefficient r1: ; Among them, μ x is the mean of the time series feature; The spatial characteristics include geographical proximity (such as distance d to substations / main nodes) node ), average load and maximum load index in the same area; The service characteristics include the peak number N peak , abnormal event count N alarm And volatility W: ; ; Among them, σ x is the standard deviation of the time series characteristics; θ peak is the preset peak threshold; Construct a multidimensional feature vector: F i =[μ x ,σ x ,f main ,r1,N peak ,N alarm ,W].
[0025] In this embodiment, the clustering algorithm adopts an improved clustering algorithm based on a comprehensive framework, which is as follows: First, use the Gap statistic to automatically determine the optimal number of clusters K:
[0026] Where Gap(k) represents the Gap statistic; is the expected function; W k is the sum of the intra-class distances of the kth class: ; Among them, C r is the sample set contained in the rth cluster (category); n r is the number of samples in the rth cluster; d(x i, x j ) is the sample point x i with x j The Euclidean distance between Select k corresponding to the maximum Gap value as the optimal number of clusters; Randomly select the first centroid c1, and for each point x, calculate the distance D(x) to the nearest centroid; by probability Select the next centroid, and repeat until K centroids are selected; Since the power data has strong time series correlation, the time series adjustment term is introduced. For two sequences A=[a1,...,a n] and B=[b1,...,b n ], the DTW distance of the two sequences is: ; in, is the optimal regularized path; To pass the optimal regular path , the element in sequence B that corresponds to the i-th element in sequence A under the alignment path; is the i-th element in sequence A; a n 、b n are the nth elements in sequence A and sequence B respectively; Then, the final clustering objective function is: ; Among them, α is the trade-off parameter, and Represent the time series parts of samples and cluster centers respectively; C k represents the sample index set contained in the kth cluster; μ k is the structural feature center of the kth cluster; d w (x i ,μ k ) represents the sample point x i With μ k The Euclidean distance of For each sample x i , output cluster label label i ∈{1,2,...,K} and cluster confidence ,in, and are the distances from the sample to the nearest and second nearest centers, respectively.
[0027] In this embodiment, the distance between the sample and the center of each cluster is calculated. When the distance is significantly higher than the mean of the cluster plus a threshold of β times the standard deviation, it is additionally marked as an anomaly, as follows: For each cluster, the distance values of all samples in the cluster to the cluster center are counted, and the average distance μ of the cluster is calculated based on this. d and standard deviation σ d ; The average distance μ of this cluster d + β times the standard deviation, that is, μ+βσ d is the upper threshold, 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 range, and samples exceeding this threshold are likely to be anomalies. Check each sample one by one: if the distance from a sample to the center of the cluster is greater than the average distance of the cluster + β times the standard deviation, it is considered an extremely abnormal point relative to the class and marked as an abnormal point .
[0028] In this embodiment, intelligent slicing decisions are made based on reinforcement learning to obtain slicing strategies, data, and labels. The details are as follows (the goal of reinforcement learning (RL) is to automatically determine the boundaries of data slices, make the behaviors within each slice as similar as possible, capture more anomalies at the boundaries, and ensure that the total number of slices is not too small, so that the final slicing is more suitable for downstream services): At each decision step t, the state s of the reinforcement learning RL agent t The combination is as follows: Multidimensional feature vector Xt of the current sample, current cluster label , Current exception mark , the number of frames since the previous slice boundary l t ;Right now: s t =[Xt, , , l t ]; Action space a t =0, the current data point is included in the current slice without segmentation; t =1, the current point is used as the new starting point for slicing and the segments are cut; Let the slice set sequence be S={S1,S2,...,S j′ ,...,S M}, M is the total number of slices; record P j′ For the j′th slice S j′ The main cluster label (mode), then the intra-chip consistency reward is :
[0029] in, is the indicator function; Slice S j′ The cluster label of the i′th data point in ; When the previous slicing action , and the slice boundary ( or t) is an outlier, then the outlier boundary reward is obtained. : ; Among them, λ1 is the abnormal point boundary reward coefficient; If slice | S j′ ∣ <L min or |S j′ ∣>L max , will be punished : ; Among them, λ2 is the penalty coefficient for being too short; λ3 is the penalty coefficient for being too long; L min , L max To preset the shortest and longest thresholds for slices; If slice j′ is the same as the previous slice If the main cluster labels are different, then the inter-slice difference reward is obtained : ; Among them, λ4 is the difference reward coefficient between slices; Combining the above rewards and penalties, we get the total reward (aggregate) R t :
[0030] Among them, w1, w2, w3 and w4 are adjustable weights; The DQN optimization algorithm is used to obtain the optimal slicing strategy.
[0031] In this embodiment, the DQN optimization algorithm is used to obtain the optimal slicing strategy, as follows: Initialize the agent network parameters θ, for each time step t: Construct the current state s t ; Sample action a using the ϵ-greedy strategy t (sharding / non-sharding); Perform actions and observe rewards R t and the next state s t+1 ; Storage(s t ,a t, R t ,s t+1 ) to the experience pool; use experience replay to train DQN and minimize the loss: ; Where (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 executing the action; The parameters of the network represented by the target Q The calculated Q value is input as the next state s′ and the next possible action a′; γ is the discount factor; Q(s,a;θ) represents the Q value calculated by the parameters θ of the target Q network, with the input as the current state s and the action a taken; Update policy network parameters; After training is completed, the optimal slicing strategy is obtained, and the optimal slicing strategy is used to slice the entire data and output labels.
[0032] In this embodiment, based on the acquired slicing strategy, data, and labels, the knowledge graph business rules are verified to ensure compliance with domain constraints, as follows: The knowledge graph is as follows: Entity nodes include equipment, sites, lines, operation and maintenance personnel, and business objects; the attributes of each entity type include equipment type, status, location, level, and timestamp; Relationships include region, connection relationship, upstream and downstream logic, and alarm association; Rule nodes / edges: expressed in ontological constraints, inference rules, and business process specifications. For example, all sampling points in a substation must belong to the same voltage level; the same slice cannot contain both type 1 and type 2 devices; and the two ends of a slice cannot be outliers in different areas at the same time. For each slice to be verified, analyze its boundary samples, internal samples, and associated attributes, and align them with the knowledge graph node attributes / relationship labels; The main structured labels of the slice include main cluster category, boundary anomaly type, device distribution, and time span, which are matched with the business labels of the knowledge graph entities; Traverse each slice S j′ , and then perform the following checks on the relevant rules in the scheduling knowledge graph: attribute consistency check: such as whether the "voltage level" field of all points is consistent; category co-occurrence constraint: whether it contains equipment / event combinations prohibited by the domain; boundary legality constraint: whether the slice boundary is divided at the breakpoints allowed by the business (such as faults, operation and maintenance scheduling moments); link / causal reasoning constraint: such as whether the logical chain of slice data is complete, without any gaps or jumps without business logic support; use graph databases and rule engines (such as Neo4j, RDF+SPARQL, OWL reasoning, Drools, etc.) to implement rule judgment and automatic reasoning; For slices that do not comply with the knowledge graph rules, the specific violation points (such as "mixed voltage levels" and "non-business-slicable moments at the boundary") are fed back, ultimately forming a structured compliant slice output (legitimacy mark of each slice, violation type, and corresponding rules).
[0033] Example 1: The knowledge graph validation rule for the power slice Sj′ includes the requirement that devices in the same slice must belong to the same substation. The system automatically traverses each point in Sj′ and, if it finds that some points belong to different substation entities, deems the slice noncompliant and outputs the corresponding substation numbers. It also recommends splitting the slice into two standard slices, each belonging to a different substation.
[0034] Example 2: If the slice boundary falls exactly on the time point of the scheduling operation record and meets the definition of "divisible moment" in the knowledge graph, the compliance is passed; otherwise, it is fed back that the slice boundary needs to be aligned forward / backward.
[0035] In this embodiment, the verified policies are sent to the distributed slice storage and management, and data shard storage and index construction are performed according to the policies, as follows: Based on the verified slicing strategy, the system splits the original data along the slice boundaries and generates structured slice objects with business tags. Each slice object contains: slice data content (such as time series set, original sampling block, etc.) and slice metadata. The slice metadata includes start and end time / index, main cluster label, outlier distribution, business entity mapping, verification results, and generation strategy ID; A distributed storage architecture is adopted, using HDFS to store and persist large amounts of raw and structured slice content. Distributed databases / NoSQL, such as HBase, Cassandra, ClickHouse, Elasticsearch, and MongoDB, are used to store slice metadata, indexes, and tags, enabling high-concurrency read and write and flexible retrieval. Slices and metadata are decoupled for storage, improving storage efficiency and retrieval flexibility through physical partitioning of big data content and hierarchical management of business attributes. A slice indexing mechanism includes a primary index and a tag index. Primary index: Establish multi-level indexes based on time, space (geography / device), business dimensions (clustering / device category / anomaly type), etc.
[0036] Tag indexing: supports efficient filtering and retrieval of target slices by tags (such as primary clusters, exception types, and business event codes); Finally, a logical slice data warehouse table is established to hierarchically manage the slice master table, metadata table, label table, and retrieval table.
[0037] 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. When the processor executes the computer program, it specifically performs the steps of the power multi-source data slicing processing method based on reinforcement learning as described above. 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.
[0038] 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.
[0039] 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.
[0040] 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.
[0041] 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 processing multi-source power data slices based on reinforcement learning, characterized in that: The following steps are involved: S1: Acquire multi-source power data and preprocess it to obtain structured raw data streams; S2: Based on the structured raw data stream, obtain the multi-dimensional feature vector through feature extraction; S3: Based on the multidimensional feature vector, a clustering algorithm is used to identify the behavior pattern and obtain the cluster label. The distance between the sample and the center of each cluster is calculated. When the distance is higher than the mean of the cluster plus a threshold of β times the standard deviation, it is additionally marked as an anomaly. S4: Based on the multi-dimensional feature vectors, cluster labels, and outlier markers, intelligent slicing decisions are made based on reinforcement learning to obtain slicing strategies, data, and labels. S5: Based on the acquired slicing strategy, data, and labels, verify the knowledge graph business rules to ensure compliance with domain constraints; S6: The verified policies are sent to distributed slice storage and management, and data shard storage and index construction are performed according to the policies.
2. The power multi-source data slicing processing method based on reinforcement learning according to claim 1 is characterized in that: The multi-source power data is obtained and pre-processed to obtain a structured raw data stream, as follows: The multi-source power data includes meter, SCADA data, operation and maintenance, and external data. The meter and SCADA data use a unified interface to periodically pull in batches or push in real time. The operation and maintenance and external data are collected in a streaming manner to achieve asynchronous and highly available data inflow. And set cleaning and mapping rules for each type of data, mapping the original fields to a unified data specification template; During the data inflow phase, multiple primary keys are used to deduplicate data, ensuring that the same type of data on each device is unique at every moment. For data with inconsistent frequencies, a time alignment mechanism is introduced. The collected data is standardized and normalized to obtain a structured raw data stream.
3. The method for processing multi-source power data slices based on reinforcement learning according to claim 1, characterized in that: The multi-dimensional feature vector is obtained by feature extraction based on the structured original data stream, as follows: Based on business scenarios or data granularity, data is segmented and processed into fixed-length time windows. Within each window, all data from the same user, device, or business is considered an analysis unit: Set the time window T, then the ath sample is S a : S a ={x t ∣t∈[t a ,t a+T )}; Among them, x t represents the data collected at time t; t a Indicates the starting time of the ath time window; Through feature extraction, multi-dimensional feature vectors are obtained, including statistical features, time series features, spatial features, and business features; The statistical characteristics include mean, standard deviation, maximum / minimum value and variation; The time series features include the time series data [x1, x2, ..., x j ,...,x N ], 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, and the dominant frequency component f is extracted by FFT. main And the autocorrelation coefficient r1: ; Among them, μ x is the mean of the time series feature; The spatial characteristics include geographical proximity, average load and maximum load index within the same area; The service characteristics include the peak number N peak , abnormal event count N alarm And volatility W: ; ; Among them, σ x is the standard deviation of the time series characteristics; θ peak is the preset peak threshold; Construct a multidimensional feature vector: F i =[μ x ,σ x ,f main ,r1,N peak ,N alarm ,W]。 4. The method for processing multi-source power data slices based on reinforcement learning according to claim 3 is characterized in that: The clustering algorithm adopts an improved clustering algorithm based on a comprehensive framework, which is as follows: First, use the Gap statistic to automatically determine the optimal number of clusters K: ; Where Gap(k) represents the Gap statistic; is the expected function; W k is the sum of the intra-class distances of the kth class: ; Among them, C r is the sample set contained in the rth cluster; n r is the number of samples in the rth cluster; d(x i, x j ) is the sample point x i with x j The Euclidean distance between Select k corresponding to the maximum Gap value as the optimal number of clusters; Randomly select the first centroid c1, and for each point x, calculate the distance D(x) to the nearest centroid; by probability Select the next centroid, and repeat until K centroids are selected; Since the power data has strong time series correlation, the time series adjustment term is introduced. For two sequences A=[a1,...,a n ] and B=[b1,...,b n ], the DTW distance of the two sequences is: ; in, is the optimal regularized path; To pass the optimal regular path , the element in sequence B that corresponds to the i-th element in sequence A under the alignment path; a i is the i-th element in sequence A; a n 、b n are the nth elements in sequence A and sequence B respectively; in is the optimal regularized path; Then, the final clustering objective function is: ; Among them, α is the trade-off parameter, and Represent the time series parts of samples and cluster centers respectively; C k represents the sample index set contained in the kth cluster; μ k is the structural feature center of the kth cluster; d w (x i ,μ k ) represents the sample point x i With μ k The Euclidean distance of For each sample x i , output cluster label label i ∈{1,2,...,K} and cluster confidence ,in, and are the distances from the sample to the nearest and second nearest centers, respectively.
5. The method for processing multi-source power data slices based on reinforcement learning according to claim 4 is characterized in that: The distance between the sample and the center of each cluster is calculated. When the distance is higher than the mean of the cluster plus a threshold of β times the standard deviation, it is additionally marked as an anomaly, as follows: For each cluster, the distance values of all samples in the cluster to the cluster center are counted, and the average distance μ of the cluster is calculated based on this d and standard deviation σ d ; The average distance μ of this cluster d + β times the standard deviation, that is, μ+βσ d is the upper threshold, where β is an adjustable parameter that controls the sensitivity of anomaly detection; Test each sample one by one: if the distance from a sample to the center of the cluster is greater than the average distance of the cluster + β times the standard deviation, it is considered an extremely abnormal point relative to the class and marked as an abnormal point .
6. The method for processing multi-source power data slices based on reinforcement learning according to claim 1, characterized in that: The intelligent slicing decision-making based on reinforcement learning and the acquisition of slicing strategies, data and labels are as follows: At each decision step t, the state s of the reinforcement learning RL agent t The combination is as follows: Multidimensional feature vector Xt of the current sample, current cluster label , Current exception mark , the number of frames since the previous slice boundary l t ;Right now: S t =[Xt, , , l t ]; Action space a t =0, the current data point is included in the current slice without segmentation; t =1, the current point is used as the new starting point for slicing and the segments are cut; Let the slice set sequence be S={S1,S2,...,S j′ ,...,S M }; M is the total number of slices; record P j′ For the j′th slice S j′ The intra-cluster label, then, the intra-chip consistency reward is : ; in, is the indicator function; Slice S j′ The cluster label of the i′th data point in ; When the previous slicing action , and the slice boundary is an outlier, then the outlier boundary reward is obtained : ; Among them, λ1 is the abnormal point boundary reward coefficient; If slice | S j′ ∣ <L min or |S j′ ∣>L max Will be punished : ; Among them, λ2 is the penalty coefficient for being too short; λ3 is the penalty coefficient for being too long; L min 、L max To preset the shortest and longest thresholds for slices; If slice j′ is the same as the previous slice If the main cluster labels are different, then the inter-slice difference reward is obtained : ; Among them, λ4 is the difference reward coefficient between slices; Combining the above rewards and penalties, we get the total reward R t : ; Among them, w1, w2, w3 and w4 are adjustable weights; The DQN optimization algorithm is used to obtain the optimal slicing strategy.
7. The method for processing power multi-source data slices based on reinforcement learning according to claim 6, characterized in that: The DQN optimization algorithm is used to obtain the optimal slicing strategy, as follows: Initialize the agent network parameters θ, for each time step t: Construct the current state s t ;use Strategy sampling action a t ; Perform actions and observe rewards R t and the next state s t+1 ; Storage(s t ,a t, R t ,s t+1 ) to the experience pool; use experience replay to train DQN and minimize the loss: ; Where (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 executing the action; The parameters of the network represented by the target Q The calculated Q value is input as the next state s′ and the next possible action a′; γ is the discount factor; Q(s,a;θ) represents the Q value calculated by the parameters θ of the target Q network, with the input as the current state s and the action a taken; Update policy network parameters; After training is completed, the optimal slicing strategy is obtained, and the optimal slicing strategy is used to slice the entire data and output labels.
8. The method for processing multi-source power data slices based on reinforcement learning according to claim 1, characterized in that: The obtained slicing strategy, data, and labels are verified through knowledge graph business rules to ensure compliance with domain constraints, as follows: For each slice to be verified, analyze the boundary samples, internal samples, and associated attributes of the slice to be verified, and align them with the knowledge graph node attributes / relationship labels; The main structured labels of the slice include main cluster category, boundary anomaly type, device distribution, and time span, which are matched with the business labels of the knowledge graph entities; Traverse each slice S j′ , and schedule the relevant rules in the knowledge graph for verification in turn; for slices that do not comply with the knowledge graph rules, feedback the specific violation points, and finally form a structured compliant slice output.
9. The method for processing power multi-source data slices based on reinforcement learning according to claim 1, characterized in that: The verified policies are sent to the distributed slice storage and management, and data shard storage and index construction are performed according to the policies, as follows: Based on the verified slicing strategy, the system splits the original data along 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 results, and generation strategy ID; Adopting a distributed storage architecture, HDFS is used to store and persist large amounts of raw and structured slice content; A distributed database is used to store slice metadata, indexes, and tags, achieving high-concurrency read / write and flexible retrieval. Slices and metadata are decoupled for storage, improving storage efficiency and retrieval flexibility through physical segmentation of big data content and hierarchical management of business attributes. Slice indexing mechanism includes primary index and tag index. Finally, a logical slice data warehouse table is established to hierarchically manage the slice master table, metadata table, label table, and retrieval table.
10. A power multi-source data slicing processing system based on reinforcement learning, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory. When the processor executes the computer program, the method specifically performs the steps in the method for processing multi-source power data slicing based on reinforcement learning as described in any one of claims 1 to 9.
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
Power system transaction simulation method based on multi-agent proxy
CN119962389A
Multi-layer distributed micro-grid control system and method based on edge cloud collaborative lightweight reinforcement learning
CN120073869A
Polymer discovery via reinforcement learning with expert-defined logical actions
US20240330694A1
Cited By
ID automatic generation and deviation verification method and system
CN121435920A
ID automatic generation and deviation checking method and system
CN121435920B