Sample generation method and device of electric leakage classification model, equipment, medium and product
By obtaining peak data of electricity consumption parameters and performing blind signal separation processing, more accurate training samples are generated, which solves the problem of low accuracy in the existing technology of samples written by staff experience, and improves the accuracy of leakage classification model.
Patent Information
- Application Number
- CN202510253079.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-13
AI Technical Summary
Samples of existing leakage classification models are compiled by staff based on their own experience, resulting in low accuracy of the model.
By obtaining the leakage characteristics corresponding to each leakage type of multiple power consumption parameters, multiple peak data corresponding to each power consumption parameter, blind signal separation processing is performed, leakage results corresponding to peak data are determined, and training samples are generated based on the leakage results and preprocessing parameter values.
The accuracy of the sample is improved to make it more in line with the actual situation, thereby effectively improving the accuracy of the leakage classification model.
Smart Images

Figure CN120145150A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular, to a method, device, equipment, medium and product for generating samples of a leakage classification model. Background Art
[0002] In industry and daily life, electricity has become an indispensable part. To improve electrical safety, electricity consumption data can be collected in real time and then input into a leakage classification model to determine whether there is a leakage, and when there is a leakage, the leakage type can also be determined. The leakage types include equipment leakage, biological electric shock, overvoltage leakage, etc. Then, corresponding measures can be taken according to the leakage type.
[0003] In the prior art, it is necessary to use samples to train a neural network model to obtain a leakage classification model. For the generation of samples, usually, based on the experience of the staff themselves, the values of current, voltage and frequency when there is leakage and no leakage are determined, and then the samples are formed.
[0004] In summary, the samples of the existing leakage classification model are written by the staff according to their own experience, which will lead to a low accuracy of the leakage classification model. Summary of the Invention
[0005] The method, device, equipment, medium and product for generating samples of a leakage classification model provided by the embodiments of the present application are used to solve the problem that the accuracy of the leakage classification model is low because the samples of the leakage classification model in the prior art are written by the staff according to their own experience.
[0006] In a first aspect, an embodiment of the present application provides a method for generating samples of a leakage classification model, including:
[0007] Obtain the leakage characteristics corresponding to each leakage type for a variety of electricity consumption parameters, and multiple peak data corresponding to each of the electricity consumption parameters; the variety of electricity consumption parameters include user current, user voltage, transformer frequency, distributed power source current and distributed power source voltage; each of the peak data corresponding to the electricity consumption parameters includes the preprocessing parameter values of the electricity consumption parameters at multiple target times, and the multiple target times include peak times;
[0008] For each of the peak data of each of the electricity consumption parameters, perform blind source separation processing according to the peak data and the leakage characteristics corresponding to each leakage type of the electricity consumption parameter to determine the leakage result corresponding to the peak data, and the leakage result is no leakage or a leakage type;
[0009] For each of the peak data of each of the electricity consumption parameters, generate a training sample according to the leakage result corresponding to the peak data and the preprocessing parameter values of each of the electricity consumption parameters at the peak time of the peak data.
[0010] In a possible implementation, before obtaining the leakage characteristics corresponding to each leakage type for various electrical usage parameters and the multiple peak data corresponding to each electrical usage parameter, the method further includes:
[0011] Performing acquisition time alignment processing on the original parameter values of each obtained electrical usage parameter to obtain the reference parameter values of each electrical usage parameter at each reference time;
[0012] Performing preprocessing on the reference parameter values of each electrical usage parameter to obtain the preprocessed parameter values of each electrical usage parameter;
[0013] Determining the peak times of each electrical usage parameter from all the reference times according to the preprocessed parameter values of each electrical usage parameter;
[0014] For each peak time of each electrical usage parameter, taking the peak time and the reference times adjacent to the peak time as target times, and taking the preprocessed parameter values of the electrical usage parameter at each target time as the peak data of the electrical usage parameter.
[0015] In a possible implementation, the performing acquisition time alignment processing on the original parameter values of each obtained electrical usage parameter to obtain the reference parameter values of each electrical usage parameter at each reference time includes:
[0016] Taking the electrical usage parameter with the smallest acquisition period of the original parameter values among all the electrical usage parameters as the reference electrical usage parameter;
[0017] Taking each original acquisition time of the original parameter values of the reference electrical usage parameter as a reference time, and taking the earliest time among all the reference times as the first starting time;
[0018] For each electrical usage parameter other than the reference electrical usage parameter, the following processing is performed:
[0019] Determining the translation time of the electrical usage parameter according to the first starting time and the original acquisition time of the original parameter values of the electrical usage parameter;
[0020] For each translation time, calculating the translation parameter value of the translation time of the electrical usage parameter according to the original parameter values of the electrical usage parameter at the original acquisition times adjacent to the translation time;
[0021] Determining the reference parameter values of the electrical usage parameter at each reference time according to each reference time and the translation parameter values of each translation time of the electrical usage parameter.
[0022] In a possible implementation manner, determining the translation time of the electricity consumption parameter according to the first starting time and the original acquisition time of the original parameter value of the electricity consumption parameter includes:
[0023] Taking the earliest time among all the original acquisition times of the original parameter value of the electricity consumption parameter as the second starting time;
[0024] Taking the duration between the first starting time and the second starting time as the translation duration;
[0025] If the first starting time is earlier than or equal to the second starting time, subtracting the translation duration from each of the original acquisition times to obtain the translation time of the electricity consumption parameter;
[0026] If the first starting time is later than the second starting time, adding the translation duration to each of the original acquisition times to obtain the translation time of the electricity consumption parameter.
[0027] In a possible implementation manner, determining the reference parameter value of the electricity consumption parameter at each reference time according to each reference time and the translation parameter value of the electricity consumption parameter at each translation time includes:
[0028] Taking the same time among all the translation times and all the reference times as the reference time;
[0029] Generating the reference parameter value of the electricity consumption parameter at each reference time according to the translation parameter value of the electricity consumption parameter at each reference time.
[0030] In a possible implementation manner, preprocessing the reference parameter value of each type of electricity consumption parameter to obtain the preprocessing parameter value of each type of electricity consumption parameter includes:
[0031] Performing whitening, kurtosis maximization, and filtering on the reference parameter value of each type of electricity consumption parameter to obtain the preprocessing parameter value of each type of electricity consumption parameter.
[0032] In a second aspect, an embodiment of the present application provides a sample generation device for a leakage classification model, including:
[0033] An acquisition module, configured to acquire leakage characteristics corresponding to each type of leakage for multiple electricity consumption parameters, and multiple peak data corresponding to each electricity consumption parameter; the multiple electricity consumption parameters include user current, user voltage, transformer frequency, distributed power source current, and distributed power source voltage; each peak data corresponding to the electricity consumption parameter includes the preprocessing parameter value of the electricity consumption parameter at multiple target times, and the multiple target times include peak times;
[0034] A processing module, configured to perform blind signal separation processing on each of the peak data of each of the electricity consumption parameters according to the peak data, the electricity consumption parameters, and the leakage characteristics corresponding to each type of leakage, and determine the leakage result corresponding to the peak data, where the leakage result is no leakage or a leakage type;
[0035] A generation module, configured to generate a training sample for each of the peak data of each of the electricity consumption parameters according to the leakage result corresponding to the peak data and the preprocessing parameter values of each of the electricity consumption parameters at the peak time of the peak data.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0037] A processor, a memory, and a communication interface;
[0038] The memory is used to store executable instructions of the processor;
[0039] Wherein, the processor is configured to execute the sample generation method of the leakage classification model according to any one of the first aspects by executing the executable instructions.
[0040] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the sample generation method of the leakage classification model according to any one of the second aspects.
[0041] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it is used to implement the sample generation method of the leakage classification model according to any one of the first aspects.
[0042] The sample generation method, device, equipment, medium, and product of the leakage classification model provided by the embodiments of the present application, by obtaining the leakage characteristics corresponding to each type of leakage for a variety of electricity consumption parameters respectively, and multiple peak data corresponding to each electricity consumption parameter, determine the leakage result corresponding to the peak data according to the peak data and the leakage characteristics, and then generate a training sample according to the leakage result corresponding to the peak data and the preprocessing parameter values of each electricity consumption parameter at the peak time of the peak data. This solution determines the leakage result corresponding to the peak data through the leakage characteristics, and then generates a sample according to the leakage result and the preprocessing parameter values, making the sample more accurate and more in line with the actual situation, and can effectively improve the accuracy of the leakage classification model. Description of the Drawings
[0043] The drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0044] Figure 1 Schematic flowchart of Embodiment 1 of the method for generating samples of the leakage classification model provided by the present application;
[0045] Figure 2 Schematic flowchart of Embodiment 2 of the method for generating samples of the leakage classification model provided by the present application;
[0046] Figure 3a Schematic flowchart of Embodiment 3 of the method for generating samples of the leakage classification model provided by the present application;
[0047] Figure 3b Schematic flowchart of the method for generating the reference parameter values of the electrical parameters at each reference moment provided by the present application;
[0048] Figure 4 Schematic structural diagram of the embodiment of the device for generating samples of the leakage classification model provided by the present application;
[0049] Figure 5 Schematic structural diagram of an electronic device provided by the present application.
[0050] Through the above-mentioned drawings, the specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Description of the Embodiments
[0051] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0052] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and above-mentioned drawings of the present application are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0053] To ensure power safety, a leakage classification model can be deployed. The real-time collected power consumption data is input into the leakage classification model to determine whether there is leakage, and when there is leakage, the type of leakage can also be determined. The types of leakage include equipment leakage, biological electric shock, overvoltage leakage, etc. Then, corresponding measures can be taken according to the type of leakage.
[0054] In the prior art, it is necessary to use samples to train a neural network model to obtain a leakage classification model. For the generation of samples, usually based on the experience of the staff themselves, the values of current, voltage, and frequency when there is leakage and no leakage are determined, and then samples are formed. Since the samples are written by the staff according to their own experience, the accuracy is low and they do not conform well to the actual situation, which will lead to the problem of low accuracy of the leakage classification model.
[0055] In view of the problems existing in the prior art, the inventor found in the process of researching the sample generation method of the leakage classification model that in order to improve the accuracy of the samples and make them more in line with the actual situation, and then improve the accuracy of the leakage classification model, the peak data determined according to the original parameter values of each actual power consumption parameter can be used. Then, combined with the leakage characteristics corresponding to each power consumption parameter and each type of leakage, the leakage result corresponding to the peak data is determined. The leakage result is no leakage or the type of leakage. Then, samples are generated according to the leakage result and the preprocessing parameter values, which improves the accuracy of the samples. Based on the above inventive concept, the sample generation scheme of the leakage classification model in this application is designed.
[0056] The execution subject of the sample generation method of the leakage classification model in this application can be a computer, or a server, a terminal device, etc. This application does not limit it. Hereinafter, an example will be given with a computer.
[0057] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0058] Hereinafter, an example will be given to illustrate the application scenario of the sample generation method of the leakage classification model provided in this application.
[0059] Exemplarily, in this application scenario, in a power distribution area served by a transformer, there are generally electrical devices such as user terminals and distributed power sources. The computer can collect user current and user voltage through the user terminal, collect transformer frequency through the transformer, and collect distributed power source current and distributed power source voltage through the distributed power source. The user terminal can be a smart meter, an energy consumption monitoring system, a separate monitoring device, etc.
[0060] To train a leakage classification model, it is necessary to first generate training samples, which requires generating multiple peak data corresponding to each electrical parameter. The electrical parameters include user current, user voltage, transformer frequency, distributed power source current, and distributed power source voltage.
[0061] The computer can collect the original parameter values of each electrical parameter. Since the collection is not synchronous, the collection times of the original parameter values of different electrical parameters may not be unified, and the original parameter values may be affected by noise. Therefore, alignment processing and preprocessing of the collection times of the original parameter values of each electrical parameter are performed to obtain the preprocessed parameter values of each electrical parameter. The time corresponding to the preprocessed parameter value is called the reference time, and the reference times of the preprocessed parameter values of each electrical parameter are unified.
[0062] Furthermore, for each electrical parameter, the peak time is determined from the reference time according to its preprocessed parameter value. Then, the peak time and the reference times adjacent to the peak time are used as the target times, and the preprocessed parameter values of this electrical parameter at each target time are used as the peak data of this electrical parameter.
[0063] After the computer obtains the leakage characteristics corresponding to each electrical parameter and each leakage type, combined with the peak data of each electrical parameter, the leakage result corresponding to the peak data is determined. The leakage result is no leakage or the leakage type.
[0064] Then, according to the leakage result corresponding to the peak data and the preprocessed parameter values of each electrical parameter at the peak time of the peak data, training samples are generated.
[0065] Subsequently, the computer trains the neural network model according to the training samples to obtain a leakage classification model. The computer can input the real-time acquired electrical data into the leakage classification model to determine whether there is leakage, and can also determine the leakage type when there is leakage.
[0066] It should be noted that the above scenario is only an example of an application scenario provided by the embodiments of the present application. The embodiments of the present application do not limit the actual forms of various devices included in this scenario, nor do they limit the interaction methods between devices. In the specific application of the solution, it can be set according to actual needs.
[0067] Next, the technical solution of the present application will be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0068] Figure 1FIG. 0 is a schematic flowchart of Embodiment 1 of the method for generating samples of the leakage classification model provided by this application. Embodiments of this application illustrate the situation where a computer generates training samples based on the peak data of each electrical parameter and the leakage characteristics corresponding to each electrical parameter and each leakage type. The method in this embodiment can be implemented in a software, hardware, or a combination of software and hardware manner. As Figure 1 shown, the method for generating samples of the leakage classification model specifically includes the following steps:
[0069] S101: Obtain the leakage characteristics corresponding to each electrical parameter and each leakage type, and multiple peak data corresponding to each electrical parameter.
[0070] In this step, in order to generate training samples with better quality, higher accuracy, and more in line with reality, it is necessary to first obtain the leakage characteristics corresponding to each electrical parameter and each leakage type, and multiple peak data corresponding to each electrical parameter.
[0071] The multiple electrical parameters include user current, user voltage, transformer frequency, distributed power source current, and distributed power source voltage, etc. Each peak data corresponding to an electrical parameter includes the preprocessing parameter values of the electrical parameter at multiple target moments, and the multiple target moments include the peak moment.
[0072] It should be noted that the leakage characteristic of an electrical parameter and a leakage type can be calculated based on the parameter values of the electrical parameter at the current moment, the previous moment of the current moment, and the next moment of the current moment when the leakage of this leakage type occurs. The time duration between the current moment and its previous moment is equal to the time duration between the current moment and its next moment, which is called the standard time duration. Divide the difference between the parameter value of the current moment and its previous moment by the standard time duration to obtain the first change rate. Divide the difference between the parameter value of the next moment of the current moment and the current moment by the standard time duration to obtain the second change rate. The first change rate and the second change rate are the leakage characteristics.
[0073] It should be noted that the moments corresponding to the preprocessing parameter values of each electrical parameter are unified. The time duration between every two adjacent target moments of the peak data is the standard time duration. The preprocessing parameter of the peak moment is the maximum value of the data in the peak data.
[0074] S102: For each peak data of each electrical parameter, perform blind source separation processing according to the peak data and the leakage characteristics corresponding to the electrical parameter and each leakage type, and determine the leakage result corresponding to the peak data.
[0075] In this step, after the computer obtains the leakage characteristics and peak data, for each peak data of each type of electrical parameter, based on the peak data, the electrical parameter, and the leakage characteristics corresponding to each type of leakage, blind source separation processing is performed using blind source separation technology to determine the leakage result corresponding to the peak data. The leakage result is no leakage or a type of leakage.
[0076] It should be noted that the types of leakage can be equipment leakage, biological electric shock, overvoltage leakage, etc. The embodiments of the present application do not limit the types of leakage, which can be determined according to the actual situation.
[0077] In one implementation, the blind source separation technology can separate the peak data into multiple sub-data. Each sub-data includes the sub-parameter value at a target moment before the peak moment, the sub-parameter value at the peak moment, and the sub-parameter value at a target moment after the peak moment. Then, for each sub-data, the sub-data is respectively matched with the leakage characteristics corresponding to the electrical parameter and each type of leakage to obtain the matching degree corresponding to each sub-data and each type of leakage. If there is a matching degree greater than the matching threshold, the type of leakage corresponding to the maximum value among all the matching degrees is used as the leakage result. If there is no matching degree greater than the matching threshold, it is determined that the leakage result is no leakage.
[0078] It should be noted that the way to match the sub-data with the leakage characteristics can be: dividing the difference between the peak moment and the sub-parameter value at a target moment before it by the standard duration as the third change rate; dividing the difference between the sub-parameter value at a target moment after the peak moment and the peak moment by the standard duration as the fourth change rate. According to the formula: , the matching degree is calculated, where, , , represents the matching degree, represents the first change rate, represents the second change rate, represents the third change rate, represents the fourth change rate.
[0079] It should be noted that the matching threshold can be 30%, 35%, 40%, etc. The embodiments of the present application do not limit the matching threshold, which can be determined according to the actual situation.
[0080] S103: For each peak data of each type of electrical parameter, based on the leakage result corresponding to the peak data and the preprocessing parameter value of each type of electrical parameter at the peak moment of the peak data, a training sample is generated.
[0081] In this step, after the computer obtains the leakage results of each peak data, for each peak data of each electrical parameter, according to the leakage result corresponding to the peak data and the preprocessing parameter values of each electrical parameter at the peak moment of the peak data, training samples are generated.
[0082] Since the computer can obtain the preprocessing parameter values of each electrical parameter at the peak moment, taking the preprocessing parameter values of each electrical parameter at the peak moment as a set of data, after labeling the leakage results for this data, training samples are obtained.
[0083] It should be noted that the obtained training samples can also be used to generate new samples by means of splicing, data augmentation, scaling, adding noise, etc. to increase the number of samples.
[0084] Subsequently, the computer can use the training samples to train the neural network model to obtain a leakage classification model. When using the leakage classification model, the computer can obtain the user current, user voltage, transformer frequency, distributed power source current, and distributed power source voltage in real time, and then input them into the leakage classification model to determine whether there is a leakage and determine the leakage type when there is a leakage. If the leakage type is determined by the leakage classification model, since the user current or user voltage corresponds to the location of the user's electrical equipment, the corresponding location of the electrical equipment can be determined, and then maintenance can be carried out.
[0085] The method for generating samples of the leakage classification model provided in this embodiment, by obtaining the leakage characteristics corresponding to each leakage type for various electrical parameters and multiple peak data corresponding to each electrical parameter, determines the leakage result corresponding to the peak data according to the peak data and the leakage characteristics, and then generates training samples according to the leakage result corresponding to the peak data and the preprocessing parameter values of each electrical parameter at the peak moment of the peak data. Compared with the prior art in which the staff writes samples according to their own experience, this solution determines the leakage result corresponding to the peak data through the leakage characteristics, and then generates samples according to the leakage result and the preprocessing parameter values, making the samples more accurate and more in line with the actual situation, and can effectively improve the accuracy of the leakage classification model.
[0086] Figure 2 It is a schematic flowchart of the second embodiment of the method for generating samples of the leakage classification model provided by this application. On the basis of the above embodiment, this application embodiment describes the situation where the computer generates peak data of electrical parameters according to the original parameter values of each electrical parameter. As Figure 2 shown, the method for generating samples of this leakage classification model specifically includes the following steps:
[0087] S201: Perform acquisition time alignment processing on the original parameter values of each electrical parameter obtained to obtain the reference parameter values of each electrical parameter at each reference moment.
[0088] In this step, the computer can obtain the original parameter values of each electricity consumption parameter. Since the acquisition moments and acquisition periods are different when collecting the original parameter values of each electricity consumption parameter, it is impossible to determine the original parameter values of each electricity consumption parameter at the same moment. For the convenience of data processing, it is necessary to perform acquisition moment alignment processing on the obtained original parameter values of each electricity consumption parameter to obtain the reference parameter values of each electricity consumption parameter at each reference moment.
[0089] It should be noted that the original parameter values of each electricity consumption parameter are collected within the same time range.
[0090] S202: Preprocess the reference parameter values of each electricity consumption parameter to obtain the preprocessed parameter values of each electricity consumption parameter.
[0091] In this step, after the computer obtains the reference parameter values of each electricity consumption parameter at each reference moment, since the reference parameter values are affected by noise and are not convenient for blind signal separation, it is necessary to preprocess the reference parameter values of each electricity consumption parameter to obtain the preprocessed parameter values of each electricity consumption parameter.
[0092] Specifically, perform whitening, kurtosis maximization, and filtering processing on the reference parameter values of each electricity consumption parameter to obtain the preprocessed parameter values of each electricity consumption parameter.
[0093] It should be noted that the preprocessed parameter values of each electricity consumption parameter can also be used for: generating leakage characteristics corresponding to each electricity consumption parameter and each leakage type. If leakage occurs during the acquisition process of the original parameter values and the corresponding leakage moment has been determined, the reference moment closest to the leakage moment can be determined, which is called the reference leakage moment; divide the difference between the preprocessed parameter values of the reference leakage moment and its previous reference moment by the standard duration to obtain the first change rate. Divide the difference between the preprocessed parameter values of the next reference moment of the reference leakage moment and the reference leakage moment by the standard duration to obtain the second change rate. The first change rate and the second change rate are leakage characteristics. The duration between adjacent reference moments is the standard duration.
[0094] S203: Determine the peak moments of each electricity consumption parameter from all reference moments according to the preprocessed parameter values of each electricity consumption parameter.
[0095] In this step, after the computer determines the preprocessed parameter values of each electricity consumption parameter, in order to generate peak data and then generate training samples later, and since there is a greater possibility of leakage at the peak moment, it is necessary to determine the peak moments of each electricity consumption parameter from all reference moments according to the preprocessed parameter values of each electricity consumption parameter.
[0096] For each electrical parameter and each reference time, if the preprocessing parameter value of the electrical parameter at the reference time is greater than the preprocessing parameter value of the previous reference time of the reference time, and the preprocessing parameter value of the electrical parameter at the next reference time of the reference time is greater than the preprocessing parameter value of the reference time, then the reference time is taken as the peak time of the electrical parameter.
[0097] S204: For each peak time of each electrical parameter, the peak time and the reference times adjacent to the peak time are taken as target times, and the preprocessing parameter value of the electrical parameter at each target time is taken as the peak data of the electrical parameter.
[0098] In this step, after the computer determines the peak time, for each peak time of each electrical parameter, the peak time and the reference times adjacent to the peak time are taken as target times, and the preprocessing parameter value of the electrical parameter at each target time is taken as the peak data of the electrical parameter.
[0099] The method for generating samples of the leakage classification model provided in this embodiment effectively improves the quality of the peak data by collecting time alignment and preprocessing the original parameter values to generate the peak data of the electrical parameters.
[0100] Figure 3a This is a schematic flowchart of the third embodiment of the method for generating samples of the leakage classification model provided in this application. On the basis of the above embodiment, this application embodiment describes the situation where the computer performs collection time alignment processing on the original parameter values to obtain the reference parameter values. As Figure 3a shown, the method for generating samples of the leakage classification model specifically includes the following steps:
[0101] S301: Take the electrical parameter with the smallest collection period of the original parameter values among all electrical parameters as the reference electrical parameter.
[0102] In this step, in order to perform collection time alignment, it is necessary to determine a reference electrical parameter, and the electrical parameter with the smallest collection period of the original parameter values among all electrical parameters can be taken as the reference electrical parameter.
[0103] Each electrical parameter collects the original parameter values according to the corresponding collection period, and the time for collecting the original parameter values is the original collection time. The collection periods corresponding to different electrical parameters may be different.
[0104] S302: Take each original collection time of the original parameter values of the reference electrical parameter as the reference time, and take the earliest time among all reference times as the first starting time.
[0105] In this step, after the computer obtains the reference power consumption parameters, it is also necessary to use each original acquisition moment of the original parameter value of the reference power consumption parameters as a reference moment, and use the earliest moment among all the reference moments as the first starting moment.
[0106] S303: For each power consumption parameter except the reference power consumption parameter, generate the reference parameter value of the power consumption parameter at each reference moment according to the original parameter value of this power consumption parameter, the first starting moment, and the reference power consumption parameter.
[0107] In this step, after the computer obtains the first starting moment of the reference moment, for each power consumption parameter except the reference power consumption parameter, generate the reference parameter value of the power consumption parameter at each reference moment according to the original parameter value of this power consumption parameter, the first starting moment, and the reference power consumption parameter.
[0108] Exemplarily, Figure 3b is a schematic flow chart for generating the reference parameter value of the power consumption parameter at each reference moment provided by this application. The process of generating the reference parameter value of a certain power consumption parameter at each reference moment in step S303 can be implemented according to the steps in Figure 3b as shown in Figure 3b and includes the following steps:
[0109] S3031: Determine the translation moment of the power consumption parameter according to the first starting moment and the original acquisition moment of the original parameter value of this power consumption parameter.
[0110] In this step, after the computer obtains the first starting moment, it is necessary to determine the translation moment of the power consumption parameter according to the first starting moment and the original acquisition moment of the original parameter value of this power consumption parameter.
[0111] Use the earliest moment among all the original acquisition moments of the original parameter value of this power consumption parameter as the second starting moment.
[0112] Use the duration between the first starting moment and the second starting moment as the translation duration.
[0113] If the first starting moment is earlier than or equal to the second starting moment, subtract the translation duration from each original acquisition moment to obtain the translation moment of this power consumption parameter.
[0114] If the first starting moment is later than the second starting moment, add the translation duration to each original acquisition moment to obtain the translation moment of this power consumption parameter.
[0115] S3032: For each translation moment, calculate the translation parameter value of this power consumption parameter at this translation moment according to the original parameter value of the power consumption parameter at the original acquisition moment adjacent to this translation moment.
[0116] In this step, after the computer obtains the translation time of the electrical parameter, for each translation time, according to the original parameter values of the electrical parameter at the original acquisition times adjacent to the translation time, calculate the translation parameter value at the translation time of the electrical parameter.
[0117] If there is no original acquisition time before the translation time, then according to the formula , calculate the translation parameter value.
[0118] If there is only one original acquisition time before the translation time, or there is only one original acquisition time after the translation time, then according to the formula , calculate the translation parameter value.
[0119] If there are two original acquisition times before the translation time and two original acquisition times after the translation time, then according to the formula , calculate the translation parameter value.
[0120] If there is no original acquisition time after the translation time, then according to the formula , calculate the translation parameter value.
[0121] Where , , , . represents the translation time, represents the first original acquisition time after the translation time, represents the second original acquisition time after the translation time, represents the first original acquisition time before the translation time, represents the second original acquisition time before the translation time, represents the translation parameter value at the translation time of the electrical parameter, represents the original parameter value of the first original acquisition time after the translation time of the electrical parameter, represents the original parameter value of the second original acquisition time after the translation time of the electrical parameter, represents the original parameter value of the first original acquisition time before the translation time of the electrical parameter, represents the original parameter value of the second original acquisition time before the translation time of the electrical parameter.
[0122] S3033: Determine the reference parameter value of the electrical parameter at each reference time according to each reference time and the translation parameter value at each translation time of the electrical parameter.
[0123] In this step, after the computer obtains the translation parameter values at the translation moments of the electrical parameter, it determines the reference parameter values of the electrical parameter at each reference moment according to each reference moment and the translation parameter values at the translation moments of the electrical parameter.
[0124] Take the same moments among all the translation moments and all the reference moments as the reference moments.
[0125] Generate the reference parameter values of the electrical parameter at each reference moment according to the translation parameter values at each reference moment of the electrical parameter. Perform interpolation calculation according to the translation parameter values at each reference moment of the electrical parameter to obtain the reference parameter values at each reference moment except the reference moments, and also take the translation parameter values at each reference moment as their reference parameter values.
[0126] The method for generating samples of the leakage classification model provided in this embodiment makes the reference moments of the reference parameter values unified by performing acquisition time alignment processing on the original parameter values, which is convenient for generating peak data and can also improve the accuracy of the peak data.
[0127] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For the details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0128] Figure 4 It is a schematic structural diagram of an embodiment of the device for generating samples of the leakage classification model provided by the present application. As Figure 4 shown, the device 40 for generating samples of the leakage classification model includes:
[0129] An acquisition module 41, configured to acquire the leakage characteristics corresponding to each leakage type of a variety of electrical parameters, and a plurality of peak data corresponding to each of the electrical parameters; the variety of electrical parameters include user current, user voltage, transformer frequency, distributed power source current, and distributed power source voltage; each of the peak data corresponding to the electrical parameter includes preprocessing parameter values of the electrical parameter at a plurality of target moments, and the plurality of target moments include peak moments;
[0130] A processing module 42, configured to perform blind signal separation processing on each of the peak data of each of the electrical parameters according to the peak data and the leakage characteristics corresponding to each leakage type of the electrical parameter, and determine the leakage result corresponding to the peak data, where the leakage result is no leakage or a leakage type;
[0131] A generation module 42, configured to generate training samples for each of the peak data of each of the electrical parameters according to the leakage result corresponding to the peak data and the preprocessing parameter values of each of the electrical parameters at the peak moment of the peak data.
[0132] Further, the processing module 42 is further configured to:
[0133] Perform acquisition time alignment processing on the original parameter values of each of the obtained power consumption parameters to obtain the reference parameter values of each of the power consumption parameters at each reference time;
[0134] Perform preprocessing on the reference parameter values of each of the power consumption parameters to obtain the preprocessed parameter values of each of the power consumption parameters;
[0135] Determine the peak time of each of the power consumption parameters from all the reference times according to the preprocessed parameter values of each of the power consumption parameters;
[0136] For each peak time of each of the power consumption parameters, use the peak time and the reference times adjacent to the peak time as target times, and use the preprocessed parameter values of the power consumption parameters at each of the target times as the peak data of the power consumption parameters.
[0137] Further, the processing module 42 is specifically further configured to:
[0138] Use the power consumption parameter with the smallest acquisition period of the original parameter values among all the power consumption parameters as the reference power consumption parameter;
[0139] Use each original acquisition time of the original parameter values of the reference power consumption parameter as a reference time, and use the earliest time among all the reference times as the first starting time;
[0140] For each of the power consumption parameters other than the reference power consumption parameter, perform the following processing:
[0141] Determine the translation time of the power consumption parameter according to the first starting time and the original acquisition time of the original parameter values of the power consumption parameter;
[0142] For each of the translation times, calculate the translation parameter value of the translation time of the power consumption parameter according to the original parameter values of the power consumption parameter at the original acquisition times adjacent to the translation time;
[0143] Determine the reference parameter values of the power consumption parameter at each reference time according to each reference time and the translation parameter values of each translation time of the power consumption parameter.
[0144] Further, the processing module 42 is specifically further configured to:
[0145] Use the earliest time among all the original acquisition times of the original parameter values of the power consumption parameter as the second starting time;
[0146] Take the duration between the first start time and the second start time as the translation duration;
[0147] If the first start time is earlier than or equal to the second start time, subtract the translation duration from each of the original acquisition times to obtain the translated times of the electrical parameters;
[0148] If the first start time is later than the second start time, add the translation duration to each of the original acquisition times to obtain the translated times of the electrical parameters.
[0149] Further, the processing module 42 is specifically further configured to:
[0150] Take the same times among all the translated times and all the reference times as the reference times;
[0151] Generate the reference parameter values of the electrical parameters at each of the reference times according to the translated parameter values of the electrical parameters at each of the reference times.
[0152] Further, the processing module 42 is specifically further configured to:
[0153] Perform whitening, kurtosis maximization, and filtering on the reference parameter values of each type of electrical parameter to obtain the preprocessed parameter values of each type of electrical parameter.
[0154] The sample generation device of the leakage classification model provided in this embodiment is used to execute the technical solutions in any of the foregoing method embodiments, and its implementation principle and technical effects are similar and will not be elaborated here.
[0155] Figure 5 It is a schematic structural diagram of an electronic device provided in the present application. As Figure 5 shown, the electronic device 50 includes:
[0156] A processor 51, a memory 52, and a communication interface 53;
[0157] The memory 52 is used to store the executable instructions of the processor 51;
[0158] Wherein, the processor 51 is configured to execute the technical solutions in any of the foregoing method embodiments by executing the executable instructions.
[0159] Optionally, the memory 52 can be either independent or integrated with the processor 51.
[0160] Optionally, when the memory 52 is a device independent of the processor 51, the electronic device 50 may further include:
[0161] The bus 54, the memory 52, and the communication interface 53 are connected to the processor 51 through the bus 54 and complete communication with each other. The communication interface 53 is used to communicate with other devices.
[0162] Optionally, the communication interface 53 can be specifically implemented by a transceiver. The communication interface is used to implement communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include a random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
[0163] The bus 54 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0164] The aforementioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0165] This electronic device is used to execute the technical solutions in any of the foregoing method embodiments. The implementation principles and technical effects are similar and will not be elaborated here.
[0166] This application embodiment also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the technical solutions provided in any of the foregoing method embodiments.
[0167] This application embodiment also provides a computer program product, including a computer program. When the computer program is executed by a processor, it is used to implement the technical solutions provided in any of the foregoing method embodiments.
[0168] Those of ordinary skill in the art can understand that all or part of the steps to implement the foregoing method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the foregoing method embodiments; and the foregoing storage medium includes: ROM, RAM, magnetic disk, or optical disk and other media that can store program codes.
[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating samples of a leakage classification model, characterized in that: include: Acquire leakage characteristics corresponding to each leakage type and a plurality of power parameters, respectively, and a plurality of peak value data corresponding to each power parameter; The multiple power consumption parameters include user current, user voltage, transformer frequency, distributed power supply current and distributed power supply voltage; each of the peak data corresponding to the power consumption parameters includes pre-processed parameter values of the power consumption parameters at multiple target moments, and the multiple target moments include peak moments; For each of the peak data of each of the power usage parameters, blind signal separation processing is performed according to the peak data, the power usage parameter and the leakage characteristics corresponding to each leakage type, to determine the leakage result corresponding to the peak data, the leakage result being no leakage or a leakage type; For each of the peak data of each of the power usage parameters, a training sample is generated according to the leakage result corresponding to the peak data and the preprocessing parameter value of each of the power usage parameters at the peak moment of the peak data.
2. The method according to claim 1, characterized in that: Before obtaining leakage characteristics corresponding to each leakage type and each of the plurality of power parameters, and a plurality of peak data corresponding to each of the power parameters, the method further includes: Performing collection time alignment processing on the acquired original parameter values of each of the power usage parameters to obtain a reference parameter value of each of the power usage parameters at each reference time; Preprocessing the reference parameter value of each power usage parameter to obtain a preprocessing parameter value of each power usage parameter; Determining the peak time of each power usage parameter from all the reference times according to the preprocessed parameter value of each power usage parameter; For each peak moment of each power usage parameter, the peak moment and the reference moment adjacent to the peak moment are taken as target moments, and the preprocessing parameter value of the power usage parameter at each target moment is taken as the peak data of the power usage parameter.
3. The method according to claim 2, characterized in that The acquiring original parameter values of each power usage parameter are aligned at the acquisition time to obtain the reference parameter value of each power usage parameter at each reference time, including: The power consumption parameter with the smallest collection period of the original parameter value among all the power consumption parameters is used as the reference power consumption parameter; Taking each original acquisition time of the original parameter value of the benchmark power consumption parameter as the benchmark time, and taking the earliest time among all the benchmark times as the first starting time; For each power usage parameter except the reference power usage parameter, the following processing is performed: Determining a translation time of the power usage parameter according to the first starting time and an original collection time of an original parameter value of the power usage parameter; For each of the translation moments, calculating the translation parameter value of the power usage parameter at the translation moment according to the original parameter value of the power usage parameter at the original collection moment adjacent to the translation moment; The reference parameter value of the power usage parameter at each reference moment is determined according to each reference moment and the translation parameter value at each translation moment of the power usage parameter.
4. The method according to claim 3, characterized in that The determining the translation time of the power usage parameter according to the first starting time and the original collection time of the original parameter value of the power usage parameter includes: The earliest time among all the original collection times of the original parameter values of the power consumption parameters is taken as the second starting time; The duration between the first starting time and the second starting time is used as the translation duration; If the first starting time is earlier than or equal to the second starting time, subtract the shift time from each of the original collection times to obtain the shift time of the power consumption parameter; If the first starting time is later than the second starting time, the shift time is added to each of the original collection times to obtain the shift time of the power consumption parameter.
5. The method according to claim 3, characterized in that: Determining the reference parameter value of the power usage parameter at each reference moment according to each reference moment and the translation parameter value of each translation moment of the power usage parameter comprises: The same moment among all the translation moments and all the reference moments is used as the reference moment; According to the translation parameter value of the power usage parameter at each of the reference moments, a reference parameter value of the power usage parameter at each of the reference moments is generated.
6. The method according to claim 2, characterized in that The preprocessing of the reference parameter value of each power usage parameter to obtain the preprocessing parameter value of each power usage parameter includes: The reference parameter value of each power usage parameter is subjected to whitening, kurtosis maximization and filtering processing to obtain a preprocessing parameter value of each power usage parameter.
7. A sample generation device for a leakage classification model, characterized in that: include: An acquisition module, used to acquire leakage characteristics corresponding to each leakage type and multiple power parameters, and multiple peak data corresponding to each power parameter; The multiple power consumption parameters include user current, user voltage, transformer frequency, distributed power supply current and distributed power supply voltage; each of the peak data corresponding to the power consumption parameters includes pre-processed parameter values of the power consumption parameters at multiple target moments, and the multiple target moments include peak moments; a processing module, configured to perform blind signal separation processing on each peak value data of each power usage parameter according to the peak value data, the power usage parameter and the leakage characteristics corresponding to each leakage type, and determine the leakage result corresponding to the peak value data, wherein the leakage result is no leakage or a leakage type; A generating module is used to generate a training sample for each peak data of each power usage parameter according to the leakage result corresponding to the peak data and the preprocessing parameter value of each power usage parameter at the peak moment of the peak data.
8. An electronic device, characterized in that: include: Processor, memory, communication interface; The memory is used to store executable instructions of the processor; The processor is configured to execute the sample generation method of the leakage classification model according to any one of claims 1 to 6 by executing the executable instructions.
9. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the sample generation method of the leakage classification model according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that It comprises a computer program, which is used to implement the sample generation method of the leakage classification model as claimed in any one of claims 1 to 6 when executed by a processor.