Direct current system fault diagnosis model construction method, fault diagnosis method and device
By building and optimizing the fault diagnosis model of the DC system and using the nearest neighbor algorithm to process historical fault data, the problems of low fault detection efficiency and low accuracy of the DC system are solved, and more efficient and accurate fault diagnosis is achieved.
Patent Information
- Application Number
- CN202411799693.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-28
AI Technical Summary
The fault detection methods of DC power systems are inefficient and have low accuracy, making it difficult to effectively identify fault categories and take timely measures, resulting in a large-scale crash in the system.
A DC system fault diagnosis model construction method is adopted. By obtaining the historical fault recording sample data of the target DC system, it is divided into a training sample set and a test sample set, the nearest neighbor algorithm is used to build the initial fault diagnosis model, and the test sample set is optimized to obtain the target fault diagnosis model.
It improves the accuracy and efficiency of the fault diagnosis model, can more accurately identify the fault categories of the DC system, and improves the accuracy, efficiency and timeliness of system status monitoring and fault diagnosis.
Smart Images

Figure CN119719936A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power fault detection, and in particular to a method for constructing a DC system fault diagnosis model, a fault diagnosis method, an apparatus, a computer device, a storage medium, and a computer program product. Background Art
[0002] In the power system, DC power system plays an increasingly important role in the power grid due to its high efficiency and flexibility. Usually, it is necessary to frequently detect the status of the DC power system to ensure the normal and stable operation of the DC power system. In the event of a fault in the DC power system, it is also necessary to promptly and accurately identify the type of fault that has occurred and take corresponding measures in a timely manner to avoid a large-scale collapse of the system.
[0003] However, compared with AC systems, DC systems have more diverse fault modes and the fault current rises extremely quickly, which poses great challenges to fault detection and isolation. Current fault detection methods for DC power systems have problems of low efficiency and low accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a DC system fault diagnosis model construction method, fault diagnosis method, device, computer equipment, storage medium and computer program product to address the above technical problems.
[0005] In a first aspect, the present application provides a method for constructing a DC system fault diagnosis model. The method comprises:
[0006] Obtain fault recording sample data of the target DC system in a historical time period;
[0007] Dividing the fault recording sample data into a training sample set and a test sample set;
[0008] Using a nearest neighbor algorithm and the training sample set, an initial fault diagnosis model for the target DC system is constructed;
[0009] The initial fault diagnosis model is optimized by using a nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0010] In one embodiment, the training sample set includes multiple training sample data; the use of the nearest neighbor algorithm and the training sample set to construct an initial fault diagnosis model for the target DC system includes: determining an algorithm parameter K value of the fault diagnosis model to be trained based on the nearest neighbor algorithm; using the algorithm parameter K value and the multiple training sample data to train the fault diagnosis model to be trained to obtain the initial fault diagnosis model.
[0011] In one embodiment, the method of using the algorithm parameter K value and the multiple training sample data to train the fault diagnosis model to be trained to obtain the initial fault diagnosis model includes: inputting the multiple training sample data into the fault diagnosis model to be trained; obtaining the training similarity between any one current training sample data among the multiple training sample data and the remaining training sample data except the current training sample data; based on the training similarity, screening out multiple matching training sample data that meet the algorithm parameter K value from the remaining training sample data; and training the fault diagnosis model to be trained based on the multiple matching training sample data to obtain the initial fault diagnosis model.
[0012] In one of the embodiments, the fault diagnosis model to be trained is trained based on the multiple matching training sample data to obtain the initial fault diagnosis model, including: determining at least one fault category corresponding to the multiple matching training sample data, and obtaining the category weight of each fault category; determining the fault category with the largest category weight as the predicted fault category label of the corresponding current training sample data; and training the fault diagnosis model to be trained based on the difference between the predicted fault category label and the actual fault category label of the corresponding current training sample data to obtain the initial fault diagnosis model.
[0013] In one of the embodiments, the obtaining of fault recording sample data of the target DC system in the historical time period includes: obtaining original fault recording data of the target DC system in the historical time period; the original fault recording data includes original fault recording data of at least one recording channel; preprocessing the original fault recording data to obtain processed fault recording data, and constructing the fault recording sample data based on the processed fault recording data.
[0014] In one of the embodiments, the preprocessing of the original fault recording data to obtain processed fault recording data includes: normalizing the original fault recording data to obtain normalized fault recording data; and concatenating the normalized fault recording data corresponding to each recording channel in series according to the recording channel to obtain the processed fault recording data.
[0015] In one embodiment, the test sample set includes multiple test sample data; the use of the nearest neighbor algorithm and the test sample set to optimize the initial fault diagnosis model to obtain the target fault diagnosis model for the target DC system includes: inputting the multiple test sample data and the actual fault category label corresponding to each of the test sample data into the initial fault diagnosis model; obtaining the test similarity between any current test sample data among the multiple test sample data and the remaining test sample data except the current test sample data; based on the test similarity, screening out multiple matching test sample data that meet the algorithm parameter K value from the remaining test sample data; based on the multiple matching test sample data, optimizing the initial fault diagnosis model to obtain the target fault diagnosis model for the target DC system.
[0016] In a second aspect, the present application provides a DC system fault diagnosis method. The method comprises:
[0017] Obtaining fault recording data of the DC system to be tested in a historical time period;
[0018] Input the fault recording data into a pre-trained target fault diagnosis model to obtain the diagnostic similarity between the fault recording data and each known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method as described in the first aspect;
[0019] According to the diagnostic similarity, at least one group of matching fault recording data corresponding to the fault recording data is screened out from at least one group of known fault recording data; at least one group of matching fault recording data corresponds to at least one fault category;
[0020] According to the category weight of each of the fault categories, a fault diagnosis result of the DC system to be tested is obtained.
[0021] In a third aspect, the present application provides a device for constructing a DC system fault diagnosis model. The device comprises:
[0022] A data acquisition module is used to acquire fault recording sample data of the target DC system in a historical time period;
[0023] A sample division module, used for dividing the fault recording sample data into a training sample set and a test sample set;
[0024] A model building module, used to build an initial fault diagnosis model for the target DC system using a nearest neighbor algorithm and the training sample set;
[0025] The optimization module is used to optimize the initial fault diagnosis model by using the nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0026] In a fourth aspect, the present application provides a DC system fault diagnosis device. The device comprises:
[0027] An acquisition module is used to acquire the fault recording data of the DC system to be tested in a historical time period;
[0028] A calculation module, used for inputting the fault recording data into a pre-trained target fault diagnosis model, and obtaining the diagnostic similarity between the fault recording data and each of the known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method as described in the first aspect;
[0029] A screening module, used for screening out at least one group of matching fault recording data corresponding to the fault recording data from at least one group of known fault recording data according to the diagnostic similarity; at least one group of matching fault recording data corresponds to at least one fault category;
[0030] The diagnosis module is used to obtain the fault diagnosis result of the DC system to be tested according to the category weight of each fault category.
[0031] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0032] Obtain fault recording sample data of the target DC system in a historical time period;
[0033] Dividing the fault recording sample data into a training sample set and a test sample set;
[0034] Using a nearest neighbor algorithm and the training sample set, an initial fault diagnosis model for the target DC system is constructed;
[0035] The initial fault diagnosis model is optimized by using a nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0036] In a sixth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0037] Obtaining fault recording data of the DC system to be tested in a historical time period;
[0038] Input the fault recording data into a pre-trained target fault diagnosis model to obtain the diagnostic similarity between the fault recording data and each known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method as described in the first aspect;
[0039] According to the diagnostic similarity, at least one group of matching fault recording data corresponding to the fault recording data is screened out from at least one group of known fault recording data; at least one group of matching fault recording data corresponds to at least one fault category;
[0040] According to the category weight of each of the fault categories, a fault diagnosis result of the DC system to be tested is obtained.
[0041] In a seventh aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0042] Obtain fault recording sample data of the target DC system in a historical time period;
[0043] Dividing the fault recording sample data into a training sample set and a test sample set;
[0044] Using a nearest neighbor algorithm and the training sample set, an initial fault diagnosis model for the target DC system is constructed;
[0045] The initial fault diagnosis model is optimized by using a nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0046] In an eighth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0047] Obtaining fault recording data of the DC system to be tested in a historical time period;
[0048] Input the fault recording data into a pre-trained target fault diagnosis model to obtain the diagnostic similarity between the fault recording data and each known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method as described in the first aspect;
[0049] According to the diagnostic similarity, at least one group of matching fault recording data corresponding to the fault recording data is screened out from at least one group of known fault recording data; at least one group of matching fault recording data corresponds to at least one fault category;
[0050] According to the category weight of each of the fault categories, a fault diagnosis result of the DC system to be tested is obtained.
[0051] In a ninth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0052] Obtain fault recording sample data of the target DC system in a historical time period;
[0053] Dividing the fault recording sample data into a training sample set and a test sample set;
[0054] Using a nearest neighbor algorithm and the training sample set, an initial fault diagnosis model for the target DC system is constructed;
[0055] The initial fault diagnosis model is optimized by using a nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0056] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0057] Obtaining fault recording data of the DC system to be tested in a historical time period;
[0058] Input the fault recording data into a pre-trained target fault diagnosis model to obtain the diagnostic similarity between the fault recording data and each known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method as described in the first aspect;
[0059] According to the diagnostic similarity, at least one group of matching fault recording data corresponding to the fault recording data is screened out from at least one group of known fault recording data; at least one group of matching fault recording data corresponds to at least one fault category;
[0060] According to the category weight of each of the fault categories, a fault diagnosis result of the DC system to be tested is obtained.
[0061] In the above-mentioned DC system fault diagnosis model construction method, fault diagnosis method, device, computer equipment, storage medium and computer program product, the fault recording sample data of the target DC system in the historical time period can be obtained; the fault recording sample data is divided into a training sample set and a test sample set; the initial fault diagnosis model for the target DC system is constructed using the nearest neighbor algorithm and the training sample set; the initial fault diagnosis model is optimized using the nearest neighbor algorithm and the test sample set to obtain the target fault diagnosis model for the target DC system. In the method provided by the embodiment of the present application, the fault recording sample data can be divided into a training sample set and a test sample set, the initial fault diagnosis model can be optimized using the test sample set to obtain the target fault diagnosis model, and the accuracy of the fault diagnosis model construction can be improved. Moreover, the target fault diagnosis model is constructed based on the nearest neighbor algorithm. Using the nearest neighbor algorithm, the accuracy of constructing the fault diagnosis model can be improved, and the accuracy of the model diagnosis can also be improved, thereby improving the accuracy, efficiency and timeliness of DC system state monitoring and fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0063] Figure 1 A schematic diagram of a flow chart of a method for constructing a DC system fault diagnosis model provided in an embodiment of the present application;
[0064] Figure 2 A schematic diagram of a process for obtaining an initial fault diagnosis model provided in an embodiment of the present application;
[0065] Figure 3 A schematic diagram of a model training process provided in an embodiment of the present application;
[0066] Figure 4 A schematic diagram of a process flow for preprocessing original fault recording data provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of a flow chart of a DC system fault diagnosis method provided in an embodiment of the present application;
[0068] Figure 6 A structural block diagram of a DC system fault diagnosis model building device provided in an embodiment of the present application;
[0069] Figure 7A structural block diagram of a DC system fault diagnosis device provided in an embodiment of the present application;
[0070] Figure 8 An internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0072] In an exemplary embodiment, Figure 1 As shown, a method for constructing a DC system fault diagnosis model is provided. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0073] Step 102: Obtain fault recording sample data of the target DC system in a historical time period.
[0074] Among them, the target DC system can be any high-voltage direct current system. High-voltage direct current (HVDC) is a technology for power transmission, mainly used for long-distance power transmission and large-scale renewable energy access. Compared with the traditional AC transmission system, the DC system has the following advantages: low loss: in long-distance power transmission, the energy loss of DC transmission is smaller than that of AC transmission because the DC system does not generate reactance loss. Better control: the DC system can better control the power flow, especially when connecting different power grids, it can achieve bidirectional power flow. Improve stability: the HVDC system has a positive impact on the stability of the system and can effectively suppress voltage fluctuations in the power grid. Reduce the footprint: under the same transmission capacity, the HVDC transmission line requires fewer conductors and a small cable volume, which is suitable for places with high space requirements such as urban environments. Adapt to the access of renewable energy: especially for the long-distance grid connection of renewable energy such as wind power and solar energy, HVDC provides an effective solution. The historical time period can be a time period that has occurred corresponding to the current time period. The number of the fault recording sample data may be multiple, and each of the multiple fault recording sample data corresponds to a fault category of the target DC system, for example, AC fault, DC fault, converter valve fault, and commutation failure, etc. In this step, obtaining the fault recording sample data of the target DC system in the historical time period may include: obtaining the original fault recording data of the target DC system in the historical time period; the original fault recording data includes the original fault recording data of at least one recording channel; and then, pre-processing the original fault recording data to obtain processed fault recording data, and constructing the fault recording sample data according to the processed fault recording data. Among them, a fault recorder can be configured in the target DC system. When a fault occurs in the target DC system, the fault recorder can automatically and accurately record the changes in various electrical quantities before and after the fault. By analyzing and comparing these electrical quantities, it plays an important role in analyzing and handling accidents, judging whether the protection is correctly operating, and improving the safe operation level of the power system. The original fault recording data can come from the fault recorder, and the original fault recording data can correspond to at least one recording channel. The recording channel of the fault recording refers to the input channel in the fault recorder used to record the changes in various electrical quantities when the power system fails. The at least one recording channel is responsible for receiving and recording analog quantities such as current and voltage, as well as signals such as switch quantities, for subsequent analysis, and the at least one recording channel can correspond to different physical quantities, such as current, voltage, and temperature.Preprocessing may include normalization processing and recording channel data serial processing, which may include: normalizing the original fault recording data to obtain normalized fault recording data; according to the recording channel, serially connecting the normalized fault recording data corresponding to each recording channel to obtain processed fault recording data.
[0075] Step 104: divide the fault recording sample data into a training sample set and a test sample set.
[0076] Among them, the fault recording sample data can be used to train and optimize the fault diagnosis model to be trained. The number of the fault recording sample data can be multiple, and each fault recording sample data in the multiple fault recording sample data corresponds to a fault category of the target DC system, such as AC fault, DC fault, converter valve fault and commutation failure, etc. The fault category corresponding to each fault recording sample data can be used as a label to mark the corresponding fault recording sample data.
[0077] In this step, the multiple fault recording sample data can be divided into a training sample set and a test sample set. The training sample set may include multiple training sample data, and the multiple training sample data can be used to train the fault diagnosis model to be trained to obtain an initial fault diagnosis model; the test sample set may include multiple test sample data, and the multiple test sample data can be used to optimize the initial fault diagnosis model to obtain the target fault diagnosis model of the target DC system. In a possible implementation, 80% of the multiple fault recording sample data can be divided into a training sample set, and 20% can be divided into a test sample set.
[0078] Step 106: construct an initial fault diagnosis model for the target DC system using a nearest neighbor algorithm and a training sample set.
[0079] The fault diagnosis model to be trained for state detection and fault diagnosis of the target DC system can be a model based on the nearest neighbor algorithm (K-Nearest Neighbor, KNN). The principle of the KNN algorithm is as follows: if most of the K most similar samples (i.e., the closest samples in the feature space) of a sample belong to a certain category, then the sample also belongs to this category. This method only determines the category of the sample to be classified based on the category of one or several closest samples in the classification decision. Specifically, first, the algorithm parameter K value of the KNN algorithm can be determined, and the algorithm parameter K value can be used to indicate the number of nearest neighboring sample data selected for each training sample data; next, the training similarity between any current training sample data among multiple training sample data and the remaining training sample data except the current training sample data can be obtained, which can be understood as obtaining the training similarity between each training sample data and each training sample data among the remaining training sample data, which can be expressed by calculating the distance between the corresponding two training sample data. The calculation method of the distance between the corresponding two training sample data can include but is not limited to Mahalanobis distance, Chebyshev distance and Euclidean distance (ED), etc. Among them, the calculation formula of Mahalanobis distance can be as shown in formula (1), the calculation formula of Chebyshev distance can be as shown in formula (2), and the calculation formula of Euclidean distance can be as shown in formula (3).
[0080]
[0081] d=max(|x1-y1|, |x2-y2|,...,|x i -y i |,|x N -y N |) (2)
[0082]
[0083] Where d is the distance between samples; N is the number of samples; S i is the standard deviation of the sample data in the i-th dimension; x and y represent the horizontal and vertical coordinates of the sample respectively.
[0084] Furthermore, the remaining K training sample data whose training similarity with the current training sample data is less than a preset similarity threshold can be determined as the matching training sample data of the current training sample data; furthermore, the fault category of each matching training sample data in the K matching training sample data can be determined, the number of matching training sample data corresponding to each fault category can be counted, and the category weight corresponding to each fault category can be determined according to the number of matching training sample data corresponding to each fault category, so that the fault category with the highest category weight can be determined as the predicted fault category label of the current training sample data. Based on this, the predicted fault category label of any current training sample data among the multiple training sample data can be obtained, so that the fault diagnosis model to be trained can be trained according to the difference between the predicted fault category label of the current training sample data and the actual fault category label, and the initial fault diagnosis model of the target DC system can be obtained.
[0085] Step 108 , optimizing the initial fault diagnosis model using the nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0086] Among them, the initial fault diagnosis model is obtained based on the nearest neighbor algorithm test, and the test sample set may include multiple test sample data, each of the multiple test sample data is marked with an actual fault category as a label, and the multiple marked test sample data can be input into the initial fault diagnosis model. In the calculation process of the initial fault diagnosis model, the test similarity between any current test sample data in the multiple test sample data and the remaining test sample data except the current test sample data is obtained; the K remaining test sample data whose test similarity with the current test sample data is less than a preset similarity threshold can be determined as the matching test sample data of the current test sample data; further, the fault category of each matching test sample data in the K matching test sample data can be determined, the number of matching test sample data corresponding to each fault category can be counted, and the category weight corresponding to each fault category can be determined according to the number of matching test sample data corresponding to each fault category, so that the fault category with the highest category weight can be determined as the predicted fault category label of the current test sample data. Based on this, the fault diagnosis accuracy of the initial fault diagnosis model can be obtained according to the difference between the predicted fault category label and the actual fault category label of the current test sample data, which can be seen in formula (4). Furthermore, based on the fault diagnosis accuracy of the initial fault diagnosis model, the initial fault diagnosis model can be optimized to obtain the target fault diagnosis model for the target DC system.
[0087]
[0088] Among them, Nlabel-true The number of test samples for accurate fault diagnosis; N label-all is the total number of test samples participating in the test.
[0089] In the method of this embodiment, the fault recording sample data of the target DC system in the historical time period is obtained; the fault recording sample data is divided into a training sample set and a test sample set; the initial fault diagnosis model for the target DC system is constructed using the nearest neighbor algorithm and the training sample set; the initial fault diagnosis model is optimized using the nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system. In the method provided by the embodiment of the present application, the fault recording sample data can be divided into a training sample set and a test sample set, the initial fault diagnosis model can be optimized using the test sample set, the target fault diagnosis model can be obtained, and the accuracy of the model diagnosis can be improved. Moreover, the target fault diagnosis model is constructed based on the nearest neighbor algorithm, and the nearest neighbor algorithm can also improve the accuracy of the model diagnosis, thereby improving the accuracy, efficiency and timeliness of DC system state monitoring and fault diagnosis.
[0090] In an exemplary embodiment, Figure 2 As shown, step 106 may include steps 202 to 204. Among them:
[0091] Step 202: Determine the algorithm parameter K value of the fault diagnosis model to be trained based on the nearest neighbor algorithm.
[0092] The algorithm parameter K value can be used to represent the number of nearest neighboring sample data selected for each fault recording sample data, and the optimal value of K value can be determined by cross-validation.
[0093] Step 204 , using the algorithm parameter K value and a plurality of training sample data, the fault diagnosis model to be trained is trained to obtain an initial fault diagnosis model.
[0094] In an exemplary embodiment, Figure 3 As shown, step 204 may include steps 302 to 308. Among them:
[0095] Step 302: input a plurality of training sample data into the fault diagnosis model to be trained.
[0096] Step 304: Obtain training similarity between any current training sample data among the multiple training sample data and the remaining training sample data except the current training sample data.
[0097] Step 306: Filter out a plurality of matching training sample data satisfying the algorithm parameter K value from the remaining training sample data according to the training similarity.
[0098] Step 308: training the fault diagnosis model to be trained according to the plurality of matching training sample data to obtain an initial fault diagnosis model.
[0099] The fault diagnosis model to be trained can be a model based on the nearest neighbor algorithm (K-Nearest Neighbor, KNN). The principle of the KNN algorithm is as follows: if most of the K most similar samples (i.e., the nearest samples in the feature space) of a sample belong to a certain category, then the sample also belongs to this category. This method only determines the category of the sample to be classified based on the category of one or several nearest samples in the classification decision. Specifically, first, the algorithm parameter K value of the KNN algorithm can be determined, and the algorithm parameter K value can be used to indicate the number of nearest neighboring sample data selected for each training sample data; next, the training similarity between any current training sample data among multiple training sample data and the remaining training sample data except the current training sample data can be obtained, which can be understood as obtaining the training similarity between each training sample data and each training sample data among the remaining training sample data, which can be expressed by calculating the distance between the corresponding two training sample data. The calculation method of the distance between the corresponding two training sample data can include but is not limited to Mahalanobis distance, Chebyshev distance and Euclidean distance (ED), etc. Among them, the calculation formula of Mahalanobis distance can be as shown in formula (1), the calculation formula of Chebyshev distance can be as shown in formula (2), and the calculation formula of Euclidean distance can be as shown in formula (3). Furthermore, the remaining K training sample data whose training similarity with the current training sample data is less than a preset similarity threshold can be determined as the matching training sample data of the current training sample data; furthermore, the fault category of each matching training sample data in the K matching training sample data can be determined, the number of matching training sample data corresponding to each fault category can be counted, and the category weight corresponding to each fault category can be determined according to the number of matching training sample data corresponding to each fault category, so that the fault category with the highest category weight can be determined as the predicted fault category label of the current training sample data. Based on this, the predicted fault category label of any current training sample data among the multiple training sample data can be obtained, so that the fault diagnosis model to be trained can be trained according to the difference between the predicted fault category label of the current training sample data and the actual fault category label, and the initial fault diagnosis model of the target DC system can be obtained.
[0100] In the method of this embodiment, the fault diagnosis model is constructed based on the nearest neighbor algorithm. The use of the nearest neighbor algorithm can also improve the accuracy of model diagnosis, thereby improving the accuracy, efficiency and timeliness of DC system state monitoring and fault diagnosis.
[0101] In an exemplary embodiment, step 308 may include:
[0102] Determine at least one fault category corresponding to multiple matching training sample data, and obtain the category weight of each fault category; determine the fault category with the largest category weight as the predicted fault category label of the corresponding current training sample data; train the fault diagnosis model to be trained based on the difference between the predicted fault category label and the actual fault category label of the corresponding current training sample data to obtain an initial fault diagnosis model.
[0103] Among them, each matching training sample data in the multiple matching training sample data corresponds to a fault category of the target DC system, for example, AC fault, DC fault, converter valve fault and commutation failure, etc., and each matching training sample data is marked with a corresponding fault category label. Therefore, at least one fault category corresponding to the multiple matching training sample data can be determined according to the fault category label of each matching training sample data, and then the category weight of each fault category can be obtained. In a possible implementation, the number of matching training sample data corresponding to each fault category can be counted, and the category weight corresponding to each fault category can be determined according to the number of matching training sample data corresponding to each fault category, so that the fault category with the highest category weight can be determined as the predicted fault category label of the current training sample data. Based on this, the predicted fault category label of any current training sample data in the multiple training sample data can be obtained, so that the fault diagnosis model to be trained can be trained according to the difference between the predicted fault category label of the current training sample data and the actual fault category label to obtain the initial fault diagnosis model of the target DC system.
[0104] In the method of this embodiment, the number of matching training sample data corresponding to each fault category can be counted, and the category weight corresponding to each fault category can be determined based on the number of matching training sample data corresponding to each fault category. Then, the fault category with the highest category weight is determined as the predicted fault category label of the current training sample data, thereby improving the accuracy of fault diagnosis performed by the fault diagnosis model.
[0105] In an exemplary embodiment, step 102 may include:
[0106] The original fault recording data of the target DC system in the historical time period is obtained; the original fault recording data includes the original fault recording data of at least one recording channel; the original fault recording data is preprocessed to obtain processed fault recording data, and fault recording sample data is constructed according to the processed fault recording data.
[0107] Among them, a fault recorder can be configured in the target DC system. When a fault occurs in the target DC system, the fault recorder can automatically and accurately record the changes in various electrical quantities before and after the fault. By analyzing and comparing these electrical quantities, it plays an important role in analyzing and handling accidents, judging whether the protection is correctly operating, and improving the safe operation level of the power system. The original fault recording data can come from the fault recorder, and the original fault recording data can correspond to at least one recording channel. The recording channel of the fault recording refers to the input channel in the fault recorder used to record the changes in various electrical quantities when the power system fails. The at least one recording channel is responsible for receiving and recording analog quantities such as current and voltage and switch quantities for subsequent analysis, and the at least one recording channel can correspond to different physical quantities, such as current, voltage, and temperature. Preprocessing can include normalization processing and recording channel data series processing.
[0108] In an exemplary embodiment, Figure 4 As shown, the steps of preprocessing the original fault recording data to obtain processed fault recording data may include steps 402 to 404. Among them:
[0109] Step 402, normalize the original fault recording data to obtain normalized fault recording data.
[0110] Among them, in this step, the preprocessing of the original fault recording data may include but is not limited to data cleaning, data normalization, feature scaling, feature construction and coding category features for each data point in the original fault recording data. Specifically, first, the original fault recording data can be cleaned to remove invalid or abnormal data points to ensure the quality and availability of the data, which may include operations such as removing noise, processing missing values, and processing abnormal values; next, different original fault recording data have different dimensions or value ranges, and the original fault recording data can be normalized or standardized. The normalization process can refer to formula (5), and the data can be scaled to a uniform range, such as between 0 and 1.
[0111]
[0112] Where: x i is the fault data to be normalized, x min is the minimum value of the fault data, xmax is the maximum value of the fault data.
[0113] Furthermore, feature extraction can be performed, and feature extraction can be performed on normalized fault recording data to obtain features with diagnostic significance. Since KNN applies distance measurement, for example, features with large numerical ranges can be avoided to dominate distance calculations. Features can be scaled, and new features can be created through mathematical combinations of existing features to capture more complex patterns. Category features can also be encoded. If there are category features in the fault data, they need to be converted into numerical form and label encoding can be applied.
[0114] Step 404 , according to the recording channels, connect the normalized fault recording data corresponding to each recording channel in series to obtain processed fault recording data.
[0115] Among them, the normalized fault recording data corresponding to each recording channel are connected in series from beginning to end to form a complete fault recording data, and it can be ensured that the data format of each recording channel is unified and has the same number of data points.
[0116] In an exemplary embodiment, step 108 may include:
[0117] Input multiple test sample data and actual fault category labels corresponding to each test sample data into an initial fault diagnosis model; obtain the test similarity between any current test sample data among the multiple test sample data and the remaining test sample data except the current test sample data; based on the test similarity, screen out multiple matching test sample data that meet the algorithm parameter K value from the remaining test sample data; based on the multiple matching test sample data, optimize the initial fault diagnosis model to obtain a target fault diagnosis model for the target DC system.
[0118] Among them, the initial fault diagnosis model is obtained based on the nearest neighbor algorithm test, and the test sample set may include multiple test sample data, each of the multiple test sample data is marked with an actual fault category as a label, and the multiple marked test sample data can be input into the initial fault diagnosis model. In the calculation process of the initial fault diagnosis model, the test similarity between any current test sample data in the multiple test sample data and the remaining test sample data except the current test sample data is obtained; the K remaining test sample data whose test similarity with the current test sample data is less than a preset similarity threshold can be determined as the matching test sample data of the current test sample data; further, the fault category of each matching test sample data in the K matching test sample data can be determined, the number of matching test sample data corresponding to each fault category can be counted, and the category weight corresponding to each fault category can be determined according to the number of matching test sample data corresponding to each fault category, so that the fault category with the highest category weight can be determined as the predicted fault category label of the current test sample data. Based on this, the fault diagnosis accuracy of the initial fault diagnosis model can be obtained according to the difference between the predicted fault category label and the actual fault category label of the current test sample data, which can be seen in formula (4). Furthermore, based on the fault diagnosis accuracy of the initial fault diagnosis model, the initial fault diagnosis model can be optimized to obtain the target fault diagnosis model for the target DC system.
[0119] In the method of this embodiment, the fault recording sample data can be divided into a training sample set and a test sample set. The test sample set can be used to optimize the initial fault diagnosis model to obtain a target fault diagnosis model, thereby improving the accuracy of model diagnosis.
[0120] In an exemplary embodiment, Figure 5 As shown, a DC system fault diagnosis method is provided, the method comprising the following steps:
[0121] Step 502: Obtain fault recording data of the DC system to be tested in a historical time period.
[0122] Step 504 , input the fault recording data into a pre-trained target fault diagnosis model, and obtain the diagnostic similarity between the fault recording data and each known fault recording data in at least one group of known fault recording data in a fault diagnosis database.
[0123] The target fault diagnosis model can be obtained by training the DC system fault diagnosis model construction method, and the target fault diagnosis model can be a model based on the nearest neighbor algorithm KNN.
[0124] Step 506: Filter out at least one group of matching fault recording data corresponding to the fault recording data from at least one group of known fault recording data according to the diagnosis similarity.
[0125] Among them, at least one set of matching fault recording data corresponds to at least one fault category.
[0126] Step 508: Obtain the fault diagnosis result of the DC system to be tested according to the category weight of each fault category.
[0127] In the method of this embodiment, a target fault diagnosis model can be used to perform fault diagnosis on the DC system under test. The target fault diagnosis model is constructed based on a nearest neighbor algorithm. The nearest neighbor algorithm can be used to improve the accuracy of model diagnosis, thereby improving the accuracy, efficiency and timeliness of DC system state monitoring and fault diagnosis.
[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0129] Based on the same inventive concept, the embodiment of the present application also provides a DC system fault diagnosis model construction device for implementing the DC system fault diagnosis model construction method involved above, and a DC system fault diagnosis device for implementing the DC system fault diagnosis method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more DC system fault diagnosis model construction device embodiments provided below can refer to the limitations of the DC system fault diagnosis model construction method in the above text, and the specific limitations in one or more DC system fault diagnosis device embodiments can refer to the limitations of the DC system fault diagnosis method in the above text, which will not be repeated here.
[0130] In one embodiment, Figure 6 As shown, a DC system fault diagnosis model construction device is provided, including: a data acquisition module 602, a sample division module 604, a model construction module 606 and an optimization module 608, wherein:
[0131] The data acquisition module 602 is used to acquire the fault recording sample data of the target DC system in the historical time period;
[0132] The sample division module 604 is used to divide the fault recording sample data into a training sample set and a test sample set;
[0133] A model building module 606 is used to build an initial fault diagnosis model for the target DC system using a nearest neighbor algorithm and the training sample set;
[0134] The optimization module 608 is used to optimize the initial fault diagnosis model by using the nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
[0135] In one embodiment, the training sample set includes multiple training sample data; the model building module 606 is also used to: determine the algorithm parameter K value of the fault diagnosis model to be trained based on the nearest neighbor algorithm; use the algorithm parameter K value and the multiple training sample data to train the fault diagnosis model to be trained to obtain the initial fault diagnosis model.
[0136] In one embodiment, the model building module 606 is also used to: input multiple training sample data into the fault diagnosis model to be trained; obtain the training similarity between any current training sample data among the multiple training sample data and the remaining training sample data except the current training sample data; based on the training similarity, screen out multiple matching training sample data that meet the algorithm parameter K value from the remaining training sample data; and train the fault diagnosis model to be trained based on the multiple matching training sample data to obtain the initial fault diagnosis model.
[0137] In one embodiment, the model building module 606 is also used to: determine at least one fault category corresponding to a plurality of the matching training sample data, and obtain the category weight of each of the fault categories; determine the fault category with the largest category weight as the predicted fault category label of the corresponding current training sample data; and train the fault diagnosis model to be trained based on the difference between the predicted fault category label and the actual fault category label of the corresponding current training sample data to obtain the initial fault diagnosis model.
[0138] In one embodiment, the data acquisition module 602 is also used to: obtain the original fault recording data of the target DC system in the historical time period; the original fault recording data includes the original fault recording data of at least one recording channel; pre-process the original fault recording data to obtain processed fault recording data, and construct the fault recording sample data based on the processed fault recording data.
[0139] In one embodiment, the data acquisition module 602 is also used to: normalize the original fault recording data to obtain normalized fault recording data; and concatenate the normalized fault recording data corresponding to each recording channel according to the recording channel to obtain the processed fault recording data.
[0140] In one embodiment, the optimization module 608 is further used to: input multiple test sample data and actual fault category labels corresponding to each test sample data into the initial fault diagnosis model; obtain the test similarity between any current test sample data among the multiple test sample data and the remaining test sample data except the current test sample data; based on the test similarity, screen out multiple matching test sample data that meet the algorithm parameter K value from the remaining test sample data; and optimize the initial fault diagnosis model based on the multiple matching test sample data to obtain the target fault diagnosis model for the target DC system.
[0141] In one embodiment, Figure 7 As shown, a DC system fault diagnosis device is provided, including: an acquisition module 702, a calculation module 704, a screening module 706 and a diagnosis module 708, wherein:
[0142] An acquisition module 702 is used to acquire fault recording data of the DC system to be tested in a historical time period;
[0143] A calculation module 704 is used to input the fault recording data into a pre-trained target fault diagnosis model to obtain a diagnostic similarity between the fault recording data and each of the known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method described above;
[0144] A screening module 706 is used to screen out at least one group of matching fault recording data corresponding to the fault recording data from at least one group of known fault recording data according to the diagnostic similarity; at least one group of matching fault recording data corresponds to at least one fault category;
[0145] The diagnosis module 708 is used to obtain the fault diagnosis result of the DC system to be tested according to the category weight of each fault category.
[0146] Each module in the DC system fault diagnosis model building device and the DC system fault diagnosis device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0147] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store DC system fault diagnosis model construction and DC system fault diagnosis related data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a DC system fault diagnosis model construction method and a DC system fault diagnosis method are implemented.
[0148] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0149] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0150] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0151] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0152] 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 used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a DC system fault diagnosis model, characterized in that: The method comprises: Obtain fault recording sample data of the target DC system in a historical time period; Dividing the fault recording sample data into a training sample set and a test sample set; Using a nearest neighbor algorithm and the training sample set, an initial fault diagnosis model for the target DC system is constructed; The initial fault diagnosis model is optimized by using a nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
2. The method according to claim 1, characterized in that The training sample set includes a plurality of training sample data; The method of constructing an initial fault diagnosis model for the target DC system by using the nearest neighbor algorithm and the training sample set includes: Determine an algorithm parameter K value of a fault diagnosis model to be trained based on the nearest neighbor algorithm; The fault diagnosis model to be trained is trained using the algorithm parameter K value and a plurality of the training sample data to obtain the initial fault diagnosis model.
3. The method according to claim 2, characterized in that The method of training the fault diagnosis model to be trained by using the algorithm parameter K value and the plurality of training sample data to obtain the initial fault diagnosis model includes: Inputting a plurality of the training sample data into the fault diagnosis model to be trained; Obtaining training similarity between any current training sample data among the plurality of training sample data and the remaining training sample data except the current training sample data; According to the training similarity, a plurality of matching training sample data satisfying the algorithm parameter K value are screened out from the remaining training sample data; The fault diagnosis model to be trained is trained according to the plurality of matching training sample data to obtain the initial fault diagnosis model.
4. The method according to claim 3, characterized in that The step of training the fault diagnosis model to be trained according to the plurality of matching training sample data to obtain the initial fault diagnosis model comprises: Determine at least one fault category corresponding to a plurality of the matching training sample data; Obtaining a category weight of each of the fault categories; Determine the fault category with the largest category weight as the corresponding predicted fault category label of the current training sample data; According to the difference between the predicted fault category label and the corresponding actual fault category label of the current training sample data, the fault diagnosis model to be trained is trained to obtain the initial fault diagnosis model.
5. The method according to claim 1, characterized in that The obtaining of fault recording sample data of the target DC system in a historical time period includes: Acquire original fault recording data of the target DC system in the historical time period; the original fault recording data includes original fault recording data of at least one recording channel; The original fault recording data is preprocessed to obtain processed fault recording data, and the fault recording sample data is constructed according to the processed fault recording data.
6. The method according to claim 5, characterized in that The preprocessing of the original fault recording data to obtain processed fault recording data includes: Normalizing the original fault recording data to obtain normalized fault recording data; According to the recording channels, the normalized fault recording data corresponding to each recording channel are connected in series from beginning to end to obtain the processed fault recording data.
7. The method according to claim 2, characterized in that The test sample set includes a plurality of test sample data; the initial fault diagnosis model is optimized by using the nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system, including: Inputting a plurality of the test sample data and actual fault category labels corresponding to the test sample data into the initial fault diagnosis model; Obtaining a test similarity between any current test sample data among the plurality of test sample data and the remaining test sample data except the current test sample data; According to the test similarity, a plurality of matching test sample data satisfying the algorithm parameter K value are screened out from the remaining test sample data; The initial fault diagnosis model is optimized according to the plurality of matching test sample data to obtain the target fault diagnosis model for the target DC system.
8. A DC system fault diagnosis method, characterized in that: The method comprises: Obtaining fault recording data of the DC system to be tested in a historical time period; The fault recording data is input into a pre-trained target fault diagnosis model to obtain the diagnostic similarity between the fault recording data and each of the known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method according to any one of claims 1 to 7; According to the diagnostic similarity, at least one group of matching fault recording data corresponding to the fault recording data is screened out from at least one group of known fault recording data; at least one group of matching fault recording data corresponds to at least one fault category; According to the category weight of each of the fault categories, a fault diagnosis result of the DC system to be tested is obtained.
9. A DC system fault diagnosis model construction device, characterized in that: The device comprises: A data acquisition module is used to acquire fault recording sample data of the target DC system in a historical time period; A sample division module, used for dividing the fault recording sample data into a training sample set and a test sample set; A model building module, used to build an initial fault diagnosis model for the target DC system using a nearest neighbor algorithm and the training sample set; The optimization module is used to optimize the initial fault diagnosis model by using the nearest neighbor algorithm and the test sample set to obtain a target fault diagnosis model for the target DC system.
10. A DC system fault diagnosis device, characterized in that: The device comprises: An acquisition module is used to acquire the fault recording data of the DC system to be tested in a historical time period; A calculation module, used for inputting the fault recording data into a pre-trained target fault diagnosis model, and obtaining the diagnostic similarity between the fault recording data and each of the known fault recording data in at least one group of known fault recording data in a fault diagnosis database; the target fault diagnosis model is obtained according to the DC system fault diagnosis model construction method according to any one of claims 1 to 7; A screening module, used for screening out at least one group of matching fault recording data corresponding to the fault recording data from at least one group of known fault recording data according to the diagnostic similarity; at least one group of matching fault recording data corresponds to at least one fault category; The diagnosis module is used to obtain the fault diagnosis result of the DC system to be tested according to the category weight of each fault category.