A method for matching homologous recording data based on recording file
By using the Sentence-MacBERT model and Python programming, automatic verification and data matching of waveform recording files are achieved, solving the problem of difficulty in matching waveform recording data from the same source due to differences in waveform recording file formats, and improving the operation and maintenance efficiency of smart substations.
Patent Information
- Application Number
- CN202410996665.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The protection devices and fault recording devices manufactured by different manufacturers have various models, and the channel names and index numbers of the recording files have individual differences, making it difficult to match the same source recording data. Traditional methods are labor-intensive and prone to errors.
The Sentence-MacBERT model was used for matching the names of channels from the same source. Combined with waveform file format analysis and automatic verification, Python programming was used to realize the automatic verification and data matching of waveform files.
It achieves accurate matching of waveform recording data from the same source, improves the success rate of automatic verification of waveform recording files and the accuracy of data matching, and enhances the operation and maintenance level of smart substations.
Smart Images

Figure CN118940748B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of matching waveform data from the same source, specifically a method for matching waveform data from the same source based on waveform files. Background Technology
[0002] To ensure the safe and stable operation of smart substations, relay protection systems often follow a dual configuration principle, specifying fault recording devices to be configured according to voltage level and network, requiring the ability to collect and record relay protection switching and electrical quantities. This redundant configuration generates a large amount of co-source waveform data when grid faults or disturbances occur. However, protection devices and fault recording devices manufactured by different companies vary widely in model and type. Furthermore, the recording standards for waveform data differ across periods, resulting in unique differences in channel names and index numbers in waveform files, making accurate matching of co-source waveform data difficult. Therefore, it is urgent to research methods for matching co-source waveform data, enhance the integration and utilization of massive amounts of waveform data, and assist field operators in accident analysis.
[0003] Currently, the recording format of waveform recording files mainly adopts the IEEE Common Format for Transient Data Exchange for Power Systems (COMTRADE) standard, which standardizes the storage format of power digital recording equipment when recording fault waveforms, facilitating analysis and processing by third-party parsing software. There are three versions of the COMTRADE standard: 1991, 1999, and 2013. The 1999 version added an information file to the 1991 version and provided extended information such as transformer ratios and field formats in the configuration file. The 2013 version further revised and improved the configuration file format based on the 1999 version and allowed the use of a single COMTRADE file (.CFF) to replace four independent files. Furthermore, due to the long history of power systems, a large number of protection and waveform recording devices with varying specifications and performance are distributed across substations. Taking waveform recording devices as an example, there are currently nine major manufacturers and 25 mainstream models in China, each defining the waveform recording file format according to their own interpretation of the standard, resulting in multiple versions and varying degrees of difference. Traditional manual channel matching methods are labor-intensive, time-consuming, and prone to errors in matching channels from the same source.
[0004] Therefore, this invention proposes a method for matching homogeneous waveform recording data based on waveform recording files. Summary of the Invention
[0005] The purpose of this invention is to provide a method for matching homogeneous waveform data based on waveform recording files, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for matching homogeneous waveform recording data based on waveform recording files, comprising the following steps:
[0007] Step 1, same-source waveform recording data matching technology framework: Read the same-source waveform recording files generated by the dual-configuration protection device or the protection device and fault waveform recording device in the same interval, and extract the same-source configuration file and data file; then, construct a verification information table to verify the configuration file and data file respectively; if both files are successfully verified, use the Sentence-MacBERT model to match the same-source channel names and extract the waveform recording data of the same-source channel to complete the data matching; if the verification fails, issue corresponding alarm information according to the error type in the verification information table.
[0008] Step 2, Wave Recording File Format Analysis: The wave recording file consists of four sub-files: header file, configuration file, data file, and information file; among them, the configuration file and data file are mandatory files in the wave recording file set and are also key files for extracting wave recording data, so their format characteristics need to be analyzed.
[0009] Step 3, Automatic Verification of Wave Recording Files: Due to garbled characters and missing data that may occur when reading wave recording files, file parsing may fail, making it impossible to perform subsequent matching of wave recording data from the same source. To address this, a wave recording file verification information table is constructed based on the format characteristics of configuration files and data files, as well as the types of errors that frequently occur. The automatic verification of wave recording files is implemented using Python programming.
[0010] Step 4, Matching Channel Names: Due to the naming of channels by various manufacturers based on their own understanding, the names of the waveform recording channels configured in different construction periods of smart substations have individual differences, and the order of the channels is inconsistent. When matching waveform recording data from the same source, it is necessary to match each channel name and the corresponding waveform recording data. To address this, based on the short text characteristics of channel names, text similarity matching technology is used to automatically match channel names from the same source, and the corresponding waveform recording data in the same source data file is extracted based on the matched channel index number.
[0011] Step 5, Case Implementation: Conduct a matching experiment of homologous waveform recording data using the Python programming language. The experimental environment is as follows: operating system is Windows 11, processor is Intel(R) Core(TM) i5-13500HX, graphics card is NVIDIA GeForce RTX 4060, memory size is 16GB, programming platform is PyCharm, programming language environment is Python 3.7.1, and modeling environment is PyTorch 1.10.0.
[0012] Preferably, in step two, the analysis of its format characteristics is as follows:
[0013] (1) Standard format of configuration file: The configuration file is written in ASCII text format and is used by staff or computer programs to read and analyze the waveform data in the data file.
[0014] (2) Standard format of data file: The data file is used to record the waveform data obtained from sampling, including the sampling sequence number, time stamp, and data value of each sampling channel; the data file format type is ASCII or binary, which should be consistent with the type defined in the configuration file; for ASCII format data files, the end of each line still uses <cr lf>As a delimiter, data is separated by commas; however, for binary data files, commas are not used at the end of lines. <cr lf>The data is labeled and is continuous without comma separators. If any element is missing, the sequence of variables will be destroyed.
[0015] Preferably, in step (2), the waveform data in the data file used for reading and analyzing by staff or computer programs includes the following information:
[0016] 1) Plant / station name, equipment identification, and the year of the COMTRADE standard version;
[0017] 2) Total number and type of channels;
[0018] 3) Channel name, unit, and conversion factor;
[0019] 4) Nominal grid frequency;
[0020] 5) Sampling rate information;
[0021] 6) The date and time of the first data point;
[0022] 7) The date and time of the trigger point;
[0023] 8) Data file type;
[0024] 9) Time-scale multiplier;
[0025] 10) Time encoding and local encoding;
[0026] 11) Sampling time quality;
[0027] The configuration file consists of several lines, with each line ending with a comma. <cr lf>As the end-of-line marker, each data field in each line is separated by a comma separator ","; even for data fields without input information, the comma separator must be retained.
[0028] Preferably, in step four, the extraction of corresponding waveform data from the source data file is as follows:
[0029] (1) BERT pre-trained model: To perform text similarity matching, the language model should first be used to convert the channel name into a word vector representation so that the computer can recognize and process it; the BERT model has strong universality and has the advantages of Word2Vec, ELMo and GPT models. It is composed of a bidirectional Transformer encoder structure.
[0030] (2) Construction of Sentence-MacBERT channel matching model: MacBERT is an improved pre-trained language model proposed on the basis of BERT model. It alleviates the inconsistency problem between BERT model in pre-training task and downstream fine-tuning task by designing more ingenious MLM task, which can improve the training effect and computation speed of the model.
[0031] Preferably, in step (2), the specific improvement strategy is as follows:
[0032] 1) An MLM correction strategy is proposed, which uses similar words to replace the masked characters, thereby reducing the error between the pre-training and fine-tuning stages, and randomly replacing words without synonyms;
[0033] 2) Use a full-word masking strategy instead of random masking, and use an N-gram masking strategy to determine the words that need to be masked;
[0034] 3) It is proposed to use the sentence order prediction task to replace the NSP task, so that the model can predict the order of two sentences and help the model obtain more text semantic information.
[0035] However, using only the feature vectors generated by the MacBERT model for text similarity calculation results in huge computational overhead, and its sentence representation effect is not ideal. To address this, a Sentence-MacBERT model is constructed, which uses a Siamese network structure to fine-tune the MacBERT model, generating sentence embedding vectors with semantic information, thereby enhancing the feature extraction capability of the channel name matching model and improving its computational efficiency.
[0036] Preferably, step five is implemented as follows:
[0037] (1) Automatic verification experiment of waveform recording files: In order to verify the automatic verification effect of waveform recording files, waveform recording files that failed to be parsed were extracted from the smart substation, and some correct waveform recording files were selected to artificially create other error types; the experimental environment was built using Python programming language according to the verification information table to carry out the automatic verification experiment of waveform recording files.
[0038] (2) Same-source channel name matching experiment: In order to verify the channel name matching effect based on the Sentence-MacBERT model, channel names were extracted from the waveform files of the smart substation to construct a dataset for model training; the total number of samples constructed was 3440, which were divided into training set, test set and validation set in a ratio of 8:1:1.
[0039] (3) Same source waveform recording data matching experiment: Use the trained Sentence-BERT model to match the same source channel name and channel index number, and then locate and extract the corresponding waveform recording data in the same source data file according to the waveform recording channel index number to complete the same source waveform recording data matching; take a same source waveform recording file exported from a smart substation as an example to carry out the same source waveform recording data matching experiment.
[0040] Compared with the prior art, the beneficial effects of the present invention are:
[0041] This invention enables the matching of waveform recordings from the same source when there are differences in the channel name and channel index number.
[0042] 1) The waveform recording file verification information table has been constructed, which can automatically verify the waveform recording files and issue error alarm information for files that fail to be parsed;
[0043] 2) A Sentence-MacBERT homologous channel matching model was constructed. Experiments have verified that the model can achieve an accuracy of 95.83% and an F1 score of 96.09%, which can effectively complete the homologous channel matching task.
[0044] 3) A matching technology framework for co-source waveform recording data was proposed to help operators obtain co-source waveform recording data for fault analysis, thereby improving the operation and maintenance level of smart substations. Attached Figure Description
[0045] Figure 1 This is a framework diagram of the same-source waveform recording data matching technology of the present invention;
[0046] Figure 2 This is a structural diagram of the BERT model of this invention;
[0047] Figure 3 This is a structural diagram of the Sentence-MacBERT model of this invention;
[0048] Figure 4 This is a training curve graph showing the accuracy of the present invention;
[0049] Figure 5 This is a training curve of the F1 value of this invention;
[0050] Figure 6 This is a diagram showing the matching results of the same-source waveform recording data of the present invention. Detailed Implementation
[0051] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0052] Please see Figure 1-6 This invention provides a method for matching homogeneous waveform recording data based on waveform recording files, comprising the following steps:
[0053] Step 1, same-source waveform recording data matching technology framework: Read the same-source waveform recording files generated by the dual-configuration protection device or the protection device and fault waveform recording device in the same interval, and extract the same-source configuration file and data file; then, construct a verification information table to verify the configuration file and data file respectively; if both files are successfully verified, use the Sentence-MacBERT model to match the same-source channel names and extract the waveform recording data of the same-source channel to complete the data matching; if the verification fails, issue corresponding alarm information according to the error type in the verification information table.
[0054] Step 2, Waveform Recording File Format Analysis: The waveform recording file consists of four sub-files: header file, configuration file, data file, and information file. Among them, the configuration file and data file are mandatory files in the waveform recording file set and are also key files for extracting waveform data. Their format characteristics need to be analyzed. The specific analysis of their format characteristics is as follows:
[0055] (1) Standard format of configuration file: The configuration file is written in ASCII text format and is used by staff or computer programs to read and analyze the waveform data in the data file.
[0056] (2) Standard format of data file: The data file is used to record the waveform data obtained from sampling, including the sampling sequence number, time stamp, and data value of each sampling channel; the data file format type is ASCII or binary, which should be consistent with the type defined in the configuration file; for ASCII format data files, the end of each line still uses <cr lf>As a delimiter, data is separated by commas; however, for binary data files, commas are not used at the end of lines. <cr lf>The data is labeled, and the data are continuous without comma separators. If any element is missing, the sequence of variables will be destroyed. This data is used by staff or computer programs to read and analyze the waveform data in the data file, and contains the following information:
[0057] 1) Plant / station name, equipment identification, and the year of the COMTRADE standard version;
[0058] 2) Total number and type of channels;
[0059] 3) Channel name, unit, and conversion factor;
[0060] 4) Nominal grid frequency;
[0061] 5) Sampling rate information;
[0062] 6) The date and time of the first data point;
[0063] 7) The date and time of the trigger point;
[0064] 8) Data file type;
[0065] 9) Time-scale multiplier;
[0066] 10) Time encoding and local encoding;
[0067] 11) Sampling time quality;
[0068] The configuration file consists of several lines, with each line ending with a comma. <cr lf>As the end-of-line marker, each data field in each line is separated by a comma, "; even for data fields without input information, the comma separator must be retained.
[0069] Step 3, Automatic Verification of Wave Recording Files: Due to garbled characters and missing data that may occur when reading wave recording files, file parsing may fail, making subsequent matching of wave recording data from the same source impossible. To address this, a wave recording file verification information table is constructed based on the format characteristics of configuration files and data files, as well as the types of errors that frequently occur. The automatic verification of wave recording files is implemented using Python programming. The verification information tables for configuration files and data files are shown in Tables 1 and 2, respectively.
[0070] Table 1 Configuration File Verification Information Table
[0071]
[0072] Table 2 Data File Verification Information Table
[0073]
[0074] Tables 1 and 2 list the corresponding error types and verification schemes. Error types A2, A3, A4, A8, B6, and B7 indicate that the file cannot be verified, file parsing failed, and corresponding error alarm messages are issued. Error types A1, A5, A7, B1, B2, B4, and B5 indicate that the file verification was successful, and subsequent matching of source waveform data can proceed. Error types A6 and B3 require joint judgment to determine whether the verification was successful.
[0075] Step 4, Matching Channel Names: Because various manufacturers name channels according to their own understanding, the names of the recording channels configured at different construction stages of the smart substation have individual differences, and the channel order is inconsistent. Matching channel names with corresponding recording data requires matching each channel name and its corresponding recording data. Therefore, based on the short text characteristics of channel names, text similarity matching technology is used to automatically match channel names with similar origins, and the corresponding recording data is extracted from the similar data file based on the matched channel index number. The specific extraction of the corresponding recording data from the similar data file is as follows:
[0076] (1) BERT pre-trained model: For text similarity matching, the channel names should first be converted into word vector representations using a language model so that the computer can recognize and process them; the BERT model has strong universality and has the advantages of Word2Vec, ELMo and GPT models, and is composed of a bidirectional Transformer encoder structure; see attached Figure 2 As shown:
[0077] Appendix Figure 2 In the BERT model, [CLS] is used as a marker for the start of the input text, and [SEP] is used as a marker for sentence separation or text end. After feature extraction by the bidirectional Transformer encoder, the input information ultimately yields a dynamic feature vector with text-specific information. The pre-training task of the BERT model consists of two sub-tasks: Masked Language Model (MLM) and Next Sentence Prediction (NSP). MLM learns contextual information features through random masked words to perform word prediction, while also giving the BERT model some error correction capabilities. NSP, on the other hand, predicts whether sentences are connected by learning the feature relationships between sentences. The BERT model jointly trains the MLM and NSP tasks, ensuring that the feature vector output by the BERT model represents the overall information of the input text.
[0078] (2) Construction of Sentence-MacBERT Channel Matching Model: MacBERT is an improved pre-trained language model proposed based on the BERT model. It alleviates the inconsistency between the BERT model in the pre-training task and the downstream fine-tuning task by designing a more ingenious MLM task, which can improve the training effect and computation speed of the model. The specific improvement strategies are as follows:
[0079] 1) An MLM correction strategy is proposed, which uses similar words to replace the masked characters, thereby reducing the error between the pre-training and fine-tuning stages, and randomly replacing words without synonyms;
[0080] 2) Use a full-word masking strategy instead of random masking, and use an N-gram masking strategy to determine the words that need to be masked;
[0081] 3) It is proposed to use the sentence order prediction task to replace the NSP task, so that the model can predict the order of two sentences and help the model obtain more text semantic information.
[0082] However, using only the feature vectors generated by the MacBERT model for text similarity calculation results in a huge computational cost, and its sentence representation effect is not ideal. To address this, a Sentence-MacBERT model is constructed, which fine-tunes the MacBERT model using a Siamese network structure to generate semantically informative sentence embedding vectors, enhancing the feature extraction capability of the channel name matching model and improving its computational efficiency. The model structure is attached. Figure 3 As shown:
[0083] From the appendix Figure 3 It can be seen that Sentence-MacBERT uses a Siamese network structure, inputting the waveform channel names A and B into two identical MacBERTs for encoding. The MacBERTs share the same weight parameters, and a Pooling layer is added after the MacBERT layer to perform average pooling. This invention uses the mean pooling strategy to calculate the average value of each word output vector, generating two fixed-dimensional sentence embedding vectors u and v. The similarity of the waveform channel names is measured by calculating the cosine similarity cosθ between the two vectors, and the calculation formula is shown in Equation (1).
[0084]
[0085] The larger the absolute value of the cosine similarity, the more similar the channel names are. This invention selects the match with the highest similarity as the final result and extracts the corresponding waveform data from the data file for data matching.
[0086] Step 5, Case Implementation: An experiment was conducted using the Python programming language to match waveform recordings from the same source. The experimental environment was as follows: Windows 11 operating system, Intel(R) Core(TM) i5-13500HX processor, NVIDIA GeForce RTX 4060 graphics card, 16GB of RAM, PyCharm programming platform, Python 3.7.1 programming language environment, and PyTorch 1.10.0 modeling environment. The specific implementation is as follows:
[0087] (1) Automatic Verification Experiment of Wave Recording Files: To verify the automatic verification effect of waveform recording files, waveform recording files that failed to be parsed were extracted from the intelligent substation, and other error types were artificially created from some correct waveform recording files; the experimental environment was built using Python programming language based on the verification information table to conduct the automatic verification experiment of waveform recording files; various error types and their experimental results are shown in Table 3:
[0088] Table 3. Results of Automatic Verification Experiment for Wave Recording Files
[0089]
[0090]
[0091] As shown in Table 3, the verification results of the error types are consistent with the verification scheme in the verification information table, which can complete the automatic verification of the waveform recording files and issue corresponding error alarms for waveform recording files that cannot be verified.
[0092] (2) Same-source channel name matching experiment: In order to verify the channel name matching effect based on the Sentence-MacBERT model, channel names were extracted from the waveform files of the smart substation to construct a dataset for model training; the total number of samples constructed was 3440, which were divided into training set, test set and validation set in a ratio of 8:1:1; some dataset examples are shown in Table 4.
[0093] Table 4 shows examples of some datasets.
[0094] Channel Name A Channel Name B Label 218XXⅡ line current A phase Ia 218XX2 line a phase current Ia 1 Line 7 current B phase Ib Line 7 Current -IB 1 Line 4 zero-sequence current 3Io Line 4 current I0 1 218XXⅡ line voltage A phase Ua 218XX2 line b phase voltage Ub 0 218XXⅡ line zero-sequence current 3I0 218XXⅠ line zero-sequence current 0 Line 7 current B phase Ib Line 4 current IB 0
[0095] Among them, positive samples are the text names of the same source waveform recording channels, and the corresponding label is 1; negative samples are the text names of non-same source waveform recording channels, and the corresponding label is 0.
[0096] This invention uses accuracy A and F1 score as evaluation metrics for the channel name matching model. Accuracy is the percentage of correctly predicted sample data out of the total number of samples, and the calculation formula is shown in equation (2).
[0097]
[0098] TP represents the proportion of samples where both the actual and predicted values are 1; FN represents the proportion of samples where the actual value is 1 but the predicted value is 0; FP represents the proportion of samples where the actual value is 0 but the predicted value is 1; TN represents the proportion of samples where both the actual and predicted values are 0.
[0099] However, accuracy alone is insufficient to comprehensively measure the recognition performance of the channel name matching model. Therefore, the F1 score is introduced as an evaluation metric. The F1 score is the harmonic mean of precision (P) and recall (R). A higher F1 score indicates a better overall recognition performance of the channel name matching model. The calculation formulas are shown in equations (3), (4), and (5).
[0100]
[0101] To verify the recognition performance of the proposed channel name matching model, this invention trains the Sentence-BERT model and the Sentence-MacBERT model respectively using the constructed channel name dataset, fine-tunes the models, and saves the optimal model for channel name matching experiments. The training parameters of the Sentence-MacBERT model are shown in Table 5.
[0102] Table 5 Training parameters of the Sentence-MacBERT model
[0103] Training parameters Setting value Parameter meaning Epoch 20 Training times Batch_size 16 Batch size evaluation_steps 100 Evaluation step size warmup_steps 150 preheating step
[0104] Accuracy and F1 score were used as monitoring metrics for the Sentence-BERT and Sentence-MacBERT models during training. The training results are shown in the attached figure. Figure 4 Appendix Figure 5 As shown.
[0105] From the appendix Figure 4 and attached Figure 5 It can be seen that both the Sentence-BERT and Sentence-MacBERT models achieve high accuracy and F1 scores in the early stages of training. Furthermore, with increasing training iterations, both monitoring metrics initially increase and then stabilize. The Sentence-BERT model achieves its optimal performance at the 11th epoch, with accuracy and F1 score around 87.5%; the Sentence-MacBERT model achieves its optimal performance at the 16th epoch, with both accuracy and F1 score exceeding 95%. This indicates that the training performance of the proposed Sentence-MacBERT model is superior to that of the Sentence-BERT model.
[0106] To further verify the superiority of the Sentence-MacBERT model proposed in this invention, the original BERT and MacBERT models were used to directly conduct channel name matching experiments on the test set. Then, the optimal Sentence-BERT and Sentence-MacBERT models, which were fine-tuned and saved after training, were used to conduct comparative experiments on the same test set. The experimental results of the four models are shown in Table 6.
[0107] Table 6 Experimental results of different models
[0108] Model Accuracy A F1 value BERT 67.08% 72.47% MacBERT 74.17% 75.17% Sentence-BERT 85.42% 87.80% Sentence-MacBERT 95.83% 96.09%
[0109] As shown in Table 6, the fine-tuned Sentence-BERT model improved accuracy by 18.34% and F1 score by 15.33% compared to the BERT model; the Sentence-MacBERT model improved accuracy by 21.66% and F1 score by 20.92% compared to the MacBERT model. The Sentence-MacBERT model achieved an accuracy of 95.83%, a 10.41% improvement over the Sentence-BERT model, and an F1 score of 96.09%, an 8.29% improvement over the Sentence-BERT model. This demonstrates that the proposed Sentence-MacBERT model has better recognition performance in channel name matching and can effectively complete the task of matching channel names in the same source waveform recording.
[0110] (3) Same-source waveform recording data matching experiment: The trained Sentence-BERT model is used to match the names and index numbers of the same-source channels. Then, the corresponding waveform recording data in the same-source data file is extracted according to the waveform recording channel index number to complete the same-source waveform recording data matching. Taking a waveform recording file exported from a smart substation as an example, the same-source waveform recording data matching experiment is carried out. The experimental results are shown in Table 7. Figure 6 As shown:
[0111] Table 7. Matching Results of Same-Source Channel Index Numbers
[0112]
[0113] Table 7 shows that the same-source channels in the same-source waveform recordings can all be correctly matched. (Appendix) Figure 6 The partial waveform data extracted based on the channel index number achieved source matching of the waveform data, verifying the effectiveness of the method of the present invention.
[0114] In summary, this invention proposes a method for matching source waveform recording data based on waveform recording files. First, the recording format of the waveform recording files and common errors during file interpretation are analyzed, and a verification information table is constructed to automatically check the waveform recording files. Then, the Sentence-MacBERT model is used to obtain the feature vectors of channel names, and source channel matching is achieved by calculating cosine similarity. Finally, source waveform recording data is extracted based on the location of source channels and provided to operators for comprehensive analysis and judgment, improving the level and efficiency of fault analysis in smart substations.
[0115] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / cr> < / cr> < / cr> < / cr> < / cr> < / cr>
Claims
1. A method for matching homogeneous waveform recording data based on waveform recording files, characterized in that, Includes the following steps: Step 1, same-source waveform recording data matching technology framework: Read the same-source waveform recording files generated by the dual-configuration protection device or the protection device and fault waveform recording device in the same interval, and extract the same-source configuration file and data file; then, construct a verification information table to verify the configuration file and data file respectively; if both files are successfully verified, use the Sentence-MacBERT model to match the same-source channel names and extract the waveform recording data of the same-source channel to complete the data matching; if the verification fails, issue corresponding alarm information according to the error type in the verification information table. Step 2, Wave Recording File Format Analysis: The wave recording file consists of four sub-files: header file, configuration file, data file, and information file; among them, the configuration file and data file are mandatory files in the wave recording file set and are also key files for extracting wave recording data, so their format characteristics need to be analyzed. Step 3, Automatic Verification of Wave Recording Files: Due to garbled characters and missing data that may occur when reading wave recording files, file parsing may fail, making it impossible to perform subsequent matching of wave recording data from the same source. To address this, a wave recording file verification information table is constructed based on the format characteristics of configuration files and data files, as well as the types of errors that frequently occur. The automatic verification of wave recording files is implemented using Python programming. Step 4, Matching Channel Names: Due to the naming of channels by various manufacturers based on their own understanding, the names of the waveform recording channels configured in different construction periods of smart substations have individual differences, and the order of the channels is inconsistent. When matching waveform recording data from the same source, it is necessary to match each channel name and the corresponding waveform recording data. To address this, based on the short text characteristics of channel names, text similarity matching technology is used to automatically match channel names from the same source, and the corresponding waveform recording data in the same source data file is extracted based on the matched channel index number. Step 5, Case Implementation: Conduct a matching experiment of homologous waveform recording data using the Python programming language. The experimental environment is as follows: operating system is Windows 11, processor is Intel(R) Core(TM) i5-13500HX, graphics card is NVIDIA GeForce RTX 4060, memory size is 16 GB, programming platform is PyCharm, programming language environment is Python 3.7.1, and modeling environment is PyTorch 1.10.0; In step four, the corresponding waveform data is extracted from the source data file as follows: (1) BERT pre-trained model: performs text similarity matching and uses a language model to convert channel names into word vector representations. The BERT pre-trained model consists of a bidirectional Transformer encoder structure. (2) Construction of Sentence-MacBERT channel matching model: MacBERT is an improved pre-trained language model proposed on the basis of BERT model; The specific improvement strategies are as follows: 1) MLM correction strategy: replace masked characters with similar words and randomly replace words without synonyms; 2) Use a full-word masking strategy instead of random masking, and use an N-gram masking strategy to determine the words that need to be masked; 3) Use sentence order prediction task to replace NSP task, let the model predict the order of two sentences, and help the model obtain more text semantic information; A Sentence-MacBERT model is constructed, and the MacBERT model is fine-tuned using a Siamese network structure to generate sentence embedding vectors with semantic information. Step five is implemented as follows: (1) Automatic verification experiment of waveform recording files: In order to verify the automatic verification effect of waveform recording files, waveform recording files that failed to be parsed were extracted from the smart substation, and some correct waveform recording files were selected to artificially create other error types; the experimental environment was built using Python programming language according to the verification information table, and the automatic verification experiment of waveform recording files was carried out. (2) Same-source channel name matching experiment: In order to verify the channel name matching effect based on the Sentence-MacBERT model, channel names were extracted from the waveform files of the smart substation to construct a dataset for model training; the total number of samples constructed was 3440, which were divided into training set, test set and validation set in a ratio of 8:1:
1. (3) Same source waveform recording data matching experiment: Use the trained Sentence-BERT model to match the same source channel name and channel index number, and then locate and extract the corresponding waveform recording data in the same source data file according to the waveform recording channel index number to complete the same source waveform recording data matching; take a same source waveform recording file exported from a smart substation as an example to carry out the same source waveform recording data matching experiment.
2. The method for matching homogeneous waveform recording data based on waveform recording files according to claim 1, characterized in that, In step two, the specific analysis of its format characteristics is as follows: (1) Configuration file standard format: The configuration file is written in ASCII text format and is used by staff or computer programs to read and analyze the waveform data in the data file; (2) Standard format of data file: The data file is used to record the waveform data obtained by sampling, including the sampling sequence number, time stamp and data value of each sampling channel; The data file format should be either ASCII or binary, consistent with the type defined in the configuration file; for ASCII data files, each line should still end with a period. <cr lf>As a delimiter, data is separated by commas; however, for binary data files, commas are not used at the end of lines. <cr lf> The data is labeled and is continuous without comma separators. If any element is missing, the sequence of variables will be destroyed.< / cr> < / cr> 3. The method for matching homogeneous waveform recording data based on waveform recording files according to claim 2, characterized in that, In step (2), the waveform data in the data file used by staff or computer programs to read and analyze contains the following information: 1) Plant / station name, equipment identification, and the year of the COMTRADE standard version; 2) Total number and type of channels; 3) Channel name, unit, and conversion factor; 4) Nominal grid frequency; 5) Sampling rate information; 6) The date and time of the first data point; 7) The date and time of the trigger point; 8) Data file type; 9) Time-scale multiplier; 10) Time encoding and local encoding; 11) Sampling time quality; The configuration file consists of several lines, with each line ending with a comma. <cr lf> As the end-of-line marker, each data field in each line is separated by a comma separator ","; even for data fields without input information, the comma separator must be retained.< / cr>
Citation Information
Patent Citations
Intelligent substation recording channel homologous matching method
CN116049348A
Fault recording file monitoring synchronization method and system
CN117389976A