Graph data sample generation method and device, equipment and storage medium
By obtaining sample generation targets, generating topological structure and timing data and assembling them into graph models, the problem of difficulty in generating graph data samples in the existing technology is solved, and the intelligent generation and management of graph data samples is realized, which is convenient for deep learning algorithm training and reduces Manual intervention.
Patent Information
- Application Number
- CN202411549110.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-01-10
AI Technical Summary
The existing technology cannot effectively generate graph data samples, especially insufficient topology and timing data labels, which leads to difficulty in sample management in the operation and analysis of power system. As the scale of graph deep learning algorithms grows, sample demand increases. The existing The random generation method cannot be satisfied.
By obtaining samples, generation targets, including sample type, feature and quantity targets, generating topological structure and timing data, and assembling them into the graph model, generating graph data samples, using user-defined topological features or matching system topological time periods, select Statistical algorithms or intelligent feedback algorithms generate timing data and adjust the generation targets to meet sample requirements.
Intelligent generation and management of graph data samples is realized, which facilitates deep learning algorithm training based on graph models, reduces manual intervention, and improves the quality and efficiency of sample data.
Smart Images

Figure CN119295859A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and storage medium for generating graph data samples. Background Art
[0002] As the application of artificial intelligence technology in the field of power system operation analysis gradually deepens, massive samples are needed to ensure the effectiveness of deep learning algorithms. However, the current training model mainly relies on a large number of randomly generated samples such as Monte Carlo, and there is no general generation method, especially for topological and time series data. The labels are insufficient and graph data samples cannot be generated well. With the introduction of large-scale graph deep learning algorithms, the required sample size has greatly increased. The inability to manage the generated samples will also lead to greater pressure on manual routines. Summary of the invention
[0003] The present invention provides a method, device, equipment and storage medium for generating graph data samples to solve the technical problem that the prior art cannot generate graph data samples.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a method for generating a graph data sample, comprising:
[0005] Obtaining a sample generation target for a sample to be generated; wherein the sample generation target includes: a sample type target, a sample feature target, and a sample quantity target;
[0006] Obtaining a user's topology generation definition, and generating a topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: a user-defined topology feature or a time period for matching the system topology;
[0007] Generate time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target;
[0008] The generated time series data is assembled according to the topological structure and the time series data, the topological structure is used as a graph model basis, the corresponding time series data is stored in the nodes and edges in the graph model basis, and the corresponding graph data samples are generated.
[0009] As a preferred solution, generating a topological structure corresponding to the sample to be generated according to the sample type target and the topology generation definition includes:
[0010] When the topology generation is defined as a user-defined topology feature, a corresponding topology structure is generated according to the topology feature, and the topology structure is used as the basic topology structure of the sample to be generated; when the topology generation is defined as a time period for matching the system topology, the system topology of the corresponding time period is matched according to the time period, and the matched system topology structure is used as the basic topology structure of the sample to be generated;
[0011] Determine whether the sample type target of the sample to be generated is a fault sample. If the sample type target of the sample to be generated is not a fault sample, use the basic topology structure as the topology structure corresponding to the sample to be generated. If the sample type target of the sample to be generated is a fault sample, set the switch position of each preset element in the basic topology structure, and then generate the topology structure corresponding to the sample to be generated.
[0012] As a preferred solution, generating time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target includes:
[0013] Select different time series data generation algorithms according to sample type targets; wherein the time series data generation algorithms include: statistical algorithms and intelligent feedback algorithms;
[0014] When the target time series data generation algorithm is a statistical algorithm, the time series data corresponding to the sample to be generated is generated directly according to the sample feature target and the number of samples; when the target time series data generation algorithm is an intelligent feedback algorithm, a preset historical data set is obtained, and the time series data corresponding to the sample to be generated is generated according to the data feature range or the key parameters of the sample probability distribution function in the historical data set.
[0015] As a preferred solution, before assembling the generated time series data according to the topological structure and the time series data, it also includes:
[0016] When the target time series data generation algorithm is an intelligent feedback algorithm, corresponding samples are generated according to the topological structure and the time series data, and it is determined whether the generated samples meet the sample generation target. When the generated samples meet the sample generation target, the generated time series data are directly assembled according to the topological structure and the time series data. When the generated samples do not meet the sample generation target, the sample generation target is adjusted, and based on the adjusted sample generation target, the topological structure and time series data corresponding to the target to be generated are regenerated.
[0017] Based on the above embodiment, another embodiment of the present invention provides a graph data sample generation device, including: a sample generation target acquisition module, a topology structure generation module, a time series data generation module and a graph data sample generation module;
[0018] The sample generation target acquisition module is used to acquire the sample generation target of the sample to be generated; wherein the sample generation target includes: a sample type target, a sample feature target and a sample quantity target;
[0019] The topology generation module is used to obtain the topology generation definition of the user, and generate the topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: user-defined topology features or a time period for matching the system topology;
[0020] The time series data generation module is used to generate time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target;
[0021] The graph data sample generation module is used to assemble the generated time series data according to the topological structure and the time series data, use the topological structure as the graph model basis, store the corresponding time series data in the nodes and edges in the graph model basis, and generate corresponding graph data samples.
[0022] As a preferred solution, generating a topological structure corresponding to the sample to be generated according to the sample type target and the topology generation definition includes:
[0023] When the topology generation is defined as a user-defined topology feature, a corresponding topology structure is generated according to the topology feature, and the topology structure is used as the basic topology structure of the sample to be generated; when the topology generation is defined as a time period for matching the system topology, the system topology of the corresponding time period is matched according to the time period, and the matched system topology structure is used as the basic topology structure of the sample to be generated;
[0024] Determine whether the sample type target of the sample to be generated is a fault sample. If the sample type target of the sample to be generated is not a fault sample, use the basic topology structure as the topology structure corresponding to the sample to be generated. If the sample type target of the sample to be generated is a fault sample, set the switch position of each preset element in the basic topology structure, and then generate the topology structure corresponding to the sample to be generated.
[0025] As a preferred solution, generating time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target includes:
[0026] Select different time series data generation algorithms according to sample type targets; wherein the time series data generation algorithms include: statistical algorithms and intelligent feedback algorithms;
[0027] When the target time series data generation algorithm is a statistical algorithm, the time series data corresponding to the sample to be generated is generated directly according to the sample feature target and the number of samples; when the target time series data generation algorithm is an intelligent feedback algorithm, a preset historical data set is obtained, and the time series data corresponding to the sample to be generated is generated according to the data feature range or the key parameters of the sample probability distribution function in the historical data set.
[0028] As a preferred solution, before assembling the generated time series data according to the topological structure and the time series data, it also includes:
[0029] When the target time series data generation algorithm is an intelligent feedback algorithm, corresponding samples are generated according to the topological structure and the time series data, and it is determined whether the generated samples meet the sample generation target. When the generated samples meet the sample generation target, the generated time series data are directly assembled according to the topological structure and the time series data. When the generated samples do not meet the sample generation target, the sample generation target is adjusted, and based on the adjusted sample generation target, the topological structure and time series data corresponding to the target to be generated are regenerated.
[0030] Based on the above embodiments, another embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the method for generating graph data samples described in the above embodiments of the invention is implemented.
[0031] Based on the above embodiments, another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the graph data sample generation method described in the above invention embodiment.
[0032] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0033] The present invention provides a graph data sample generation method, which obtains a sample generation target of a sample to be generated; wherein the sample generation target includes: a sample type target, a sample feature target and a sample quantity target; obtains a user's topology generation definition, and generates a topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: a user-defined topology feature or a time period for matching a system topology; generates time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target; assembles the generated time series data according to the topology structure and the time series data, uses the topology structure as a graph model basis, stores the corresponding time series data in the nodes and edges in the graph model basis, and generates corresponding graph data samples.
[0034] The present invention can generate corresponding topological structures and time series data according to the sample generation target of the sample to be generated, and then assemble the generated time series data, use the topological structure as the basis of the graph model, store the corresponding time series data in the nodes and edges in the graph model basis, and generate corresponding graph data samples. By organizing the generated samples with a graph structure, corresponding graph data samples can be generated, which is convenient for training deep learning algorithms based on graph models and for managing sample data. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flowchart of a method for generating a graph data sample provided by an embodiment of the present invention;
[0036] Figure 2 It is a sample diagram of a 2-node power system sample diagram;
[0037] Figure 3 It is a structural schematic diagram of a graph data sample generating device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0040] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0041] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0042] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0043] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0044] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0045] Embodiment 1
[0046] Please refer to Figure 1, is a flow chart of a method for generating a graph data sample provided by an embodiment of the present invention, comprising the following specific steps:
[0047] S1. Obtain a sample generation target for a sample to be generated; wherein the sample generation target includes: a sample type target, a sample feature target, and a sample quantity target;
[0048] Specifically, in order to solve the challenge of dynamically adjusting the target of artificially generating massive samples, the present invention proposes an intelligent generation architecture of power system graph data samples for large-scale deep learning algorithm training, thereby realizing the generation of graph data samples and intelligent generation and analysis of samples. The purpose of sample generation is to generate a specific number of samples that meet the requirements for a specific computing task, and the samples need to be organized using a graph structure to facilitate the subsequent training of deep learning algorithms based on graph models.
[0049] Please refer to Figure 2 , is a schematic diagram of the intelligent generation architecture of the power system diagram data sample of the present invention, the architecture includes a task decomposition module, a topology sample generation module, a time series data generation module, a sample analysis module and a graph model organization module; wherein the task decomposition module is used to define the sample generation target; the topology sample generation module generates topology samples according to the target; the time series data generation module calls the tool to generate time series samples based on the topology; the sample analysis module analyzes whether the number and characteristics of the samples meet the generation target, and returns to the task decomposition module if the target needs to be modified, otherwise assembles the required graph data; the graph model organization module assembles the required graph data samples. Specifically including:
[0050] 1. Task decomposition module This module defines the sample generation target and decomposes the generation task according to the target. It is mainly divided into the following parts:
[0051] (1) Sample type target:
[0052] Sample types include but are not limited to topology, base state power flow, anticipated faults, and short circuit current analysis.
[0053] (2) Sample characteristic target:
[0054] Sample features include but are not limited to: load fluctuation range, new energy fluctuation range, generator power fluctuation range, fault type, fault location, and fault duration. In addition to the fault type and fault location, the range of sample features can be calculated through "fixed range uniform sampling", such as load fluctuations between [-20MW, 20MW], default uniform distribution, or custom probability distribution. The default fault type is three-phase disconnection, and for short-circuit current analysis, you can choose: single-phase, two-phase, and three-phase grounding. The default fault location is the middle of the line. For short-circuit current analysis, you can choose the percentage of bus short circuit and distance from the first section of the line.
[0055] (3) Sample quantity target:
[0056] Set the quantity of each type and each feature separately. The quantity of a feature can be directly set by setting the value (corresponding to the uniform sampling fluctuation range in the feature target) or by sampling according to the probability distribution function in the feature target.
[0057] S2. Obtain the user's topology generation definition, and generate a topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: user-defined topology features or a time period for matching the system topology;
[0058] Preferably, generating a topological structure corresponding to the sample to be generated according to the sample type target and the topology generation definition includes: when the topology generation definition is a user-defined topological feature, generating a corresponding topological structure according to the topological feature, and using the topological structure as a basic topological structure of the sample to be generated; when the topology generation definition is a time period for matching the system topology, matching the system topology of the corresponding time period according to the time period, and using the matched system topological structure as the basic topological structure of the sample to be generated; judging whether the sample type target of the sample to be generated is a fault sample, if the sample type target of the sample to be generated is not a fault sample, using the basic topological structure as the topological structure corresponding to the sample to be generated, if the sample type target of the sample to be generated is a fault sample, configuring the switch position of each preset element in the basic topological structure, and then generating a topological structure corresponding to the sample to be generated.
[0059] 2. Topology sample generation module:
[0060] (1) Basic topology reading:
[0061] For the power system to be studied, it is necessary to read the existing system topology from the graph data. Usually, in the real-time analysis of the EMS system, the data comes from the CIM / E file and the DT file. This patent assumes that the topology has been stored in the graph database. The user only needs to select the basic topology according to time (such as the current topology, the topology for the next 24 hours) or user-defined characteristics (typical operation mode in summer).
[0062] (2) Fault topology generation:
[0063] According to the fault location in the task decomposition module and based on the basic topology, the component disconnection position is set to generate the system topology to be simulated, forming a basic graph model with no features but only topology.
[0064] The basic topology selection is completely defined by the user. The user can select the system topology at a certain time or a customized other feature as the basic topology. The topology + time series data form a complete sample. If the goal of sample generation includes fault sample generation, the basic topology can be used to generate the fault topology. The system topology is the topological structure of the graph data model, expressing the connection relationship between nodes and edges.
[0065] S3. Generate time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target;
[0066] Preferably, generating time series data corresponding to the samples to be generated according to the sample feature target and the sample quantity target includes: selecting different time series data generation algorithms according to the sample type target; wherein the time series data generation algorithm includes: a statistical algorithm and an intelligent feedback algorithm; when the target time series data generation algorithm is a statistical algorithm, directly generating the time series data corresponding to the samples to be generated according to the sample feature target and the sample quantity; when the target time series data generation algorithm is an intelligent feedback algorithm, obtaining a preset historical data set, and generating the time series data corresponding to the samples to be generated according to the data feature range or the key parameters of the sample probability distribution function in the historical data set.
[0067] Preferably, before assembling the generated time series data according to the topological structure and the time series data, it also includes: when the target time series data generation algorithm is an intelligent feedback algorithm, generating corresponding samples according to the topological structure and the time series data, and judging whether the generated samples meet the sample generation target; when the generated samples meet the sample generation target, assembling the generated time series data directly according to the topological structure and the time series data; when the generated samples do not meet the sample generation target, adjusting the sample generation target, and regenerating the topological structure and time series data corresponding to the target to be generated according to the adjusted sample generation target.
[0068] 3. Time series data generation module:
[0069] (1) Tool call:
[0070] Depending on the required sample type (base state power flow, anticipated fault, short circuit calculation), different software (modules) on the computing platform are called accordingly. Mainstream electromechanical transient simulation software can complete all the above functions, but it is necessary to call the corresponding API module. This process also supports the integration of different software calls.
[0071] (2) Algorithm selection:
[0072] It is divided into two types: "statistical algorithm" and "intelligent feedback algorithm". The statistical algorithm directly generates sample feature targets and quantity targets in the task decomposition module. This method no longer intelligently adjusts the targets based on the results of the analysis feedback module, that is, the sample generation target strictly abides by the statistical target definition.
[0073] The "Intelligent Feedback Algorithm" will use a data-driven algorithm to analyze historical data and make recommendations on generating goals based on the results of the next step of the analysis feedback module:
[0074] (a) The user provides a historical data set as the basis for generation (including load, new energy, generator power and voltage, topological relationship and other base state flow boundary conditions);
[0075] (b) For the “uniform distribution within a fixed range” method, the range of each feature of the historical data set is counted; for the “probability distribution function” method, the key parameters of the sample probability distribution function are calculated based on the historical data. Taking the normal distribution as an example, the mean and variance are calculated:
[0076]
[0077] Where S2 is the sample variance, n is the number of samples, X: is the variable, For sample
[0078] For example, to generate 10,000 data, the data must meet certain rules before it can be generated. The statistical algorithm directly generates according to the sample feature target and quantity target in the task decomposition module. The intelligent feedback algorithm will use a data-driven algorithm to analyze historical data and make recommendations on the generation target based on the results of the next step of analyzing the feedback module.
[0079] (3) Resource Allocation
[0080] This platform supports parallel computing. The number of tasks is evenly distributed based on whether the simulation software supports multi-machine / multi-core parallel computing. The number and target of the tasks to be executed in the above two steps are recorded in the config file and distributed to different tools / machines. The tools and machines are used to generate samples. For example, the commercial simulation software BPA is a tool and is deployed on a single machine. Calling this software can generate simulation timing data. Pay special attention to the base state flow, which is the basis for the anticipated fault and short circuit calculations. Since the initialization time for the latter three calculations is generally longer (compared with the flow calculation, the fault configuration needs to be generated and initialized), if the base state flow cannot converge, it cannot be initialized, and the fault configuration time is wasted. It is recommended to generate the base state flow first and then call other tools when generating the latter three types of data.
[0081] 4. Sample analysis module: The analysis feedback module adopts a rolling update mode. Users can customize the feedback interval Nf, such as feeding back the current sample statistical analysis information every 1,000 samples. The specific statistical analysis information is related to the various goals generated by the sample. The example is as follows:
[0082] (1) Sample type:
[0083] According to the sample type, including but not limited to base state power flow, expected fault, short circuit calculation, transient stability, etc., the number of samples Ns currently generated successfully is counted. Note that "successful generation" means the convergence of base state power flow, expected fault, short circuit calculation, and transient stability initialization. And the number of unsuccessful samples Nn is counted. Nf = Ns + Nn.
[0084] (2) Sample characteristics:
[0085] For the successfully generated samples, the features are counted:
[0086] (a) Basic indicators: For characteristics such as load fluctuation range, new energy fluctuation range, generator power fluctuation range, fault duration, etc., the maximum, minimum, and average values are counted, and the error between them and the target value is calculated; for fault type and fault location, the number of types or fault locations is counted;
[0087] (b) Probability distribution index: If a feature is defined based on probability distribution, the “successfully generated” samples are re-counted to see if they obey the target distribution. The KS test can be used to test the generated samples and the target probability distribution. If the test result shows that the distribution of the generated samples is inconsistent with the target distribution, the user is prompted. If the “intelligent feedback algorithm” is used, the generated target is automatically modified. For example, if the target mean is μ and the current sample mean is Then modify the new target value to α is a user-defined adjustment coefficient, which must be between 0 and 1. This patent proposes an automatic adjustment scheme for α. The initial value of α defaults to 1. The target is automatically adjusted according to each feedback interval Nf. k =α*Ns / Nf, its physical meaning is that if the generation success rate Ns / Nf is low, it means that the original target μ is difficult to achieve, and the new target is difficult to achieve due to the introduction of α k , it is closer to the distribution of the current successful samples. To ensure that the final sample distribution does not deviate too much from the target, α can be set k Lower limit, such as 0.5.
[0088] Since some characteristic ranges may make it difficult for the power flow calculation to converge, that is, it is impossible to generate successful samples, in order to avoid an infinite loop in the generation process, the upper limit Nu of the samples to be generated can be set, Nu ≥ Nf. If the number of attempts reaches Nu, the user is prompted that the range setting may be unreasonable and a manual evaluation is required.
[0089] S4. Assemble the generated time series data according to the topological structure and the time series data, use the topological structure as the basis of the graph model, store the corresponding time series data in the nodes and edges of the graph model basis, and generate corresponding graph data samples.
[0090] 5. Graph model organization module: The graph model requires topology + timing data, that is, the output of the topology sample module and the timing module.
[0091] For graph learning algorithms, the input is a graph data model, where nodes are electrical nodes and edges are lines, that is, the organizational relationship is determined by the topology. The graph model basis generated by the topology sample generation module is called, and the corresponding time series samples are stored on the nodes and edges to realize the graph model organization. Among them, voltage, voltage phase angle, node injection power (generation or load), and node fault are node attributes, and current, current phase angle, line active power, line reactive power, line fault and specific fault location are edge attributes. Note that the time series data must be time-aligned in the entire graph. In a specific embodiment, please refer to Figure 2 , which is a sample diagram of a 2-node power system. The current is one point per second starting from 00:00 on October 7, 2024, with a total of 3600 samples. All data should be taken within the same time length and sampled for 1 second. Since the data is generated through the simulation tool, the sample frequency and timestamp are consistent, so you only need to pay attention to the capture time.
[0092] It can be seen that the present invention provides a method for generating graph data samples and proposes an intelligent generation platform for power system samples for graph deep learning algorithm training, which is mainly divided into 5 modules. The architecture can automatically decompose the sample generation task, analyze and feedback the generated data, automatically adjust the data generation target, and provide statistical information for engineering personnel to evaluate the data, avoiding a large amount of repetitive and tedious manual setting work and saving manpower time.
[0093] Embodiment 2
[0094] Please refer to Figure 3 , is a schematic diagram of the structure of a graph data sample generating device provided by an embodiment of the present invention, the device comprising: a sample generation target acquisition module, a topology structure generating module, a time series data generating module and a graph data sample generating module;
[0095] The sample generation target acquisition module is used to acquire the sample generation target of the sample to be generated; wherein the sample generation target includes: a sample type target, a sample feature target and a sample quantity target;
[0096] The topology generation module is used to obtain the topology generation definition of the user, and generate the topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: user-defined topology features or a time period for matching the system topology;
[0097] The time series data generation module is used to generate time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target;
[0098] The graph data sample generation module is used to assemble the generated time series data according to the topological structure and the time series data, use the topological structure as the graph model basis, store the corresponding time series data in the nodes and edges in the graph model basis, and generate corresponding graph data samples.
[0099] Preferably, generating a topological structure corresponding to the sample to be generated according to the sample type target and the topology generation definition includes: when the topology generation definition is a user-defined topological feature, generating a corresponding topological structure according to the topological feature, and using the topological structure as a basic topological structure of the sample to be generated; when the topology generation definition is a time period for matching the system topology, matching the system topology of the corresponding time period according to the time period, and using the matched system topological structure as the basic topological structure of the sample to be generated; judging whether the sample type target of the sample to be generated is a fault sample, if the sample type target of the sample to be generated is not a fault sample, using the basic topological structure as the topological structure corresponding to the sample to be generated, if the sample type target of the sample to be generated is a fault sample, configuring the switch position of each preset element in the basic topological structure, and then generating a topological structure corresponding to the sample to be generated.
[0100] Preferably, generating time series data corresponding to the samples to be generated according to the sample feature target and the sample quantity target includes: selecting different time series data generation algorithms according to the sample type target; wherein the time series data generation algorithm includes: a statistical algorithm and an intelligent feedback algorithm; when the target time series data generation algorithm is a statistical algorithm, directly generating the time series data corresponding to the samples to be generated according to the sample feature target and the sample quantity; when the target time series data generation algorithm is an intelligent feedback algorithm, obtaining a preset historical data set, and generating the time series data corresponding to the samples to be generated according to the data feature range or the key parameters of the sample probability distribution function in the historical data set.
[0101] Preferably, before assembling the generated time series data according to the topological structure and the time series data, it also includes: when the target time series data generation algorithm is an intelligent feedback algorithm, generating corresponding samples according to the topological structure and the time series data, and judging whether the generated samples meet the sample generation target; when the generated samples meet the sample generation target, assembling the generated time series data directly according to the topological structure and the time series data; when the generated samples do not meet the sample generation target, adjusting the sample generation target, and regenerating the topological structure and time series data corresponding to the target to be generated according to the adjusted sample generation target.
[0102] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0103] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0104] Embodiment 3
[0105] Accordingly, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the method for generating graph data samples described in the above-mentioned embodiment of the invention when executing the computer program.
[0106] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The device may include, but is not limited to, a processor and a memory.
[0107] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device, and various interfaces and lines are used to connect various parts of the entire device.
[0108] Embodiment 4
[0109] Accordingly, an embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the graph data sample generation method described in the above-mentioned embodiment of the invention.
[0110] The memory can be used to store the computer program, and the processor realizes various functions of the device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0111] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of each method embodiment described above can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0112] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for generating graph data samples, characterized in that: include: Obtaining a sample generation target for a sample to be generated; wherein the sample generation target includes: a sample type target, a sample feature target, and a sample quantity target; Obtaining a user's topology generation definition, and generating a topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: a user-defined topology feature or a time period for matching the system topology; Generate time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target; The generated time series data is assembled according to the topological structure and the time series data, the topological structure is used as a graph model basis, the corresponding time series data is stored in the nodes and edges in the graph model basis, and the corresponding graph data samples are generated.
2. The method for generating graph data samples according to claim 1, wherein: The generating a topological structure corresponding to the sample to be generated according to the sample type target and the topology generation definition includes: When the topology generation is defined as a user-defined topology feature, a corresponding topology structure is generated according to the topology feature, and the topology structure is used as the basic topology structure of the sample to be generated; when the topology generation is defined as a time period for matching the system topology, the system topology of the corresponding time period is matched according to the time period, and the matched system topology structure is used as the basic topology structure of the sample to be generated; Determine whether the sample type target of the sample to be generated is a fault sample. If the sample type target of the sample to be generated is not a fault sample, use the basic topology structure as the topology structure corresponding to the sample to be generated. If the sample type target of the sample to be generated is a fault sample, set the switch position of each preset element in the basic topology structure, and then generate the topology structure corresponding to the sample to be generated.
3. The method for generating graph data samples according to claim 1, wherein: The step of generating time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target includes: Select different time series data generation algorithms according to sample type targets; wherein the time series data generation algorithms include: statistical algorithms and intelligent feedback algorithms; When the target time series data generation algorithm is a statistical algorithm, the time series data corresponding to the sample to be generated is generated directly according to the sample feature target and the number of samples; when the target time series data generation algorithm is an intelligent feedback algorithm, a preset historical data set is obtained, and the time series data corresponding to the sample to be generated is generated according to the data feature range or the key parameters of the sample probability distribution function in the historical data set.
4. The method for generating graph data samples according to claim 3, wherein: Before assembling the generated time series data according to the topological structure and the time series data, the method further includes: When the target time series data generation algorithm is an intelligent feedback algorithm, corresponding samples are generated according to the topological structure and the time series data, and it is determined whether the generated samples meet the sample generation target. When the generated samples meet the sample generation target, the generated time series data are directly assembled according to the topological structure and the time series data. When the generated samples do not meet the sample generation target, the sample generation target is adjusted, and based on the adjusted sample generation target, the topological structure and time series data corresponding to the target to be generated are regenerated.
5. A graph data sample generating device, characterized in that: include: Sample generation target acquisition module, topology structure generation module, time series data generation module and graph data sample generation module; The sample generation target acquisition module is used to acquire the sample generation target of the sample to be generated; wherein the sample generation target includes: sample type target, sample feature target and sample quantity target; The topology structure generation module is used to obtain the user's topology generation definition, and generate a topology structure corresponding to the sample to be generated according to the sample type target and the topology generation definition; wherein the topology generation definition includes: user-defined topology features or a time period for matching the system topology; The time series data generation module is used to generate time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target; The graph data sample generation module is used to assemble the generated time series data according to the topological structure and the time series data, use the topological structure as the basis of the graph model, store the corresponding time series data in the nodes and edges of the graph model basis, and generate corresponding graph data samples.
6. The graph data sample generating device according to claim 5, characterized in that: The generating a topological structure corresponding to the sample to be generated according to the sample type target and the topology generation definition includes: When the topology generation is defined as a user-defined topology feature, a corresponding topology structure is generated according to the topology feature, and the topology structure is used as the basic topology structure of the sample to be generated; when the topology generation is defined as a time period for matching the system topology, the system topology of the corresponding time period is matched according to the time period, and the matched system topology structure is used as the basic topology structure of the sample to be generated; Determine whether the sample type target of the sample to be generated is a fault sample. If the sample type target of the sample to be generated is not a fault sample, use the basic topology structure as the topology structure corresponding to the sample to be generated. If the sample type target of the sample to be generated is a fault sample, set the switch position of each preset element in the basic topology structure, and then generate the topology structure corresponding to the sample to be generated.
7. The graph data sample generating device according to claim 5, characterized in that: The step of generating time series data corresponding to the sample to be generated according to the sample feature target and the sample quantity target includes: Select different time series data generation algorithms according to sample type targets; wherein the time series data generation algorithms include: statistical algorithms and intelligent feedback algorithms; When the target time series data generation algorithm is a statistical algorithm, the time series data corresponding to the sample to be generated is generated directly according to the sample feature target and the number of samples; when the target time series data generation algorithm is an intelligent feedback algorithm, a preset historical data set is obtained, and the time series data corresponding to the sample to be generated is generated according to the data feature range or the key parameters of the sample probability distribution function in the historical data set.
8. The graph data sample generating device according to claim 7, characterized in that: Before assembling the generated time series data according to the topological structure and the time series data, the method further includes: When the target time series data generation algorithm is an intelligent feedback algorithm, corresponding samples are generated according to the topological structure and the time series data, and it is determined whether the generated samples meet the sample generation target. When the generated samples meet the sample generation target, the generated time series data are directly assembled according to the topological structure and the time series data. When the generated samples do not meet the sample generation target, the sample generation target is adjusted, and based on the adjusted sample generation target, the topological structure and time series data corresponding to the target to be generated are regenerated.
9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating graph data samples as described in any one of claims 1 to 4 is implemented.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the method for generating graph data samples as described in any one of claims 1 to 4.