Method and device for recording fault recording data of direct-current relay protection device

By using DSP chip and HMI display with storage function in DC relay protection device, the problem of shortening memory life and real-time impact caused by frequent fault recording is solved, and higher stability and accuracy are achieved , and simplifies the export and viewing of fault data.

CN119471089APending Publication Date: 2025-02-18CHONGQING CRRC TIMES ELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411348404.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In frequent fault recording operations, existing DC relay protection devices lead to shortening the memory life, long reading and writing operations, affecting real-time and accuracy. At the same time, fault data export is cumbersome and not very versatile.

Method used

Designed with DSP chip and HMI display with storage function, DSP chip is only responsible for collecting the latest fault recording data and storing it in RAM space, and sending it to HMI display storage through the ModbusRTU protocol to reduce the data storage pressure of DSP and focus on for protection logic operations.

Benefits of technology

The stability and protection judgment accuracy of the relay protection device are improved, and users can easily view the fault data waveform on the HMI to help quickly judge and locate the fault.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119471089A_ABST
    Figure CN119471089A_ABST
Patent Text Reader

Abstract

The invention discloses a DC relay protection device fault recording data recording method and device, and the method employs the design of a DSP + HMI display screen with a storage function, after the relay protection device is set with a fixed value, when a fault occurs, a DSP chip stores the data before the fault and the data after the fault in an RAM space, and the data before the fault and the data after the fault are stored in the RAM space. When a complete piece of fault recording data is recorded, the DSP sends the data to the HMI display screen for storage through a Modbus RTU protocol, that is, the DSP chip is only responsible for collecting the newest piece of fault recording data and storing the newest piece of fault recording data in an RAM space in the chip, the data storage pressure and the storage space requirement of the DSP chip are reduced, the DSP chip can concentrate on the operation of protection logic, and the fault recording data can be stored in the storage space. The stability of the relay protection device and the accuracy of protection judgment are improved, after data are transferred to the HMI, a user can conveniently and directly check fault data waveforms on the HMI, and preliminary judgment and rapid positioning of faults of a power system are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fault recording data of electric power system, and more specifically, to a method and device for recording fault recording data of direct current relay protection device. Background Art

[0002] DC relay protection devices are widely used in urban rail transit power supply systems to monitor and protect the safe operation of DC power supply systems. At present, most relay protection devices adopt a storage and computing integrated design, generally using a DSP chip + FLASH memory solution. When the device is working, the working principle of the fault recording is mainly to store the fault recording data in the memory into the NAND FLASH, and then transfer it to the hard disk. However, sometimes the power system will be frequently disturbed. If the protection setting value of the device is small and the sensitivity is high, the relay protection device will frequently record waves, read and write FLASH memory, shortening the life of the memory, and reading and writing Flash is a relatively time-consuming operation, which will affect the real-time and accuracy of the protection judgment of the relay protection device. At the same time, the fault data is stored in the DSP external Flash storage. When exporting data, it must be exported through a network cable and special tool software, and the exported file is generally a binary data block. The universality of the fault data is not strong, and the export is more troublesome. It is also inconvenient to convert the data into other common formats. Summary of the invention

[0003] One of the purposes of the present invention is to provide a method for recording fault waveform data of a DC relay protection device, thereby improving the stability of the relay protection device and the accuracy of protection judgment. The second purpose of the present invention is to provide a device for recording fault waveform data of a DC relay protection device.

[0004] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0005] A first aspect of the present invention provides a method for recording fault waveform data of a DC relay protection device, characterized in that it comprises the following steps:

[0006] The data sampling channel of the fault recording, the sampling period of the fault data, the number of data points recorded before the fault and the number of data points recorded after the fault are preset on the HMI display screen with storage function;

[0007] The DSP chip initializes the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault;

[0008] The DSP chip performs data sampling according to the data sampling channel and the sampling period of the fault data, and writes the sampled data into the first array;

[0009] When the DSP chip determines that a fault has occurred, it obtains pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points;

[0010] The DSP chip samples the post-fault data according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data;

[0011] The DSP chip writes the pre-fault data and the post-fault data into the first array, obtains the fault recording data record of the current fault, and sends it to the HMI display screen with storage function for storage.

[0012] Among the above technical means, the design of DSP + HMI display screen with storage function is adopted. After the relay protection device sets the fixed value, when a fault occurs, the DSP chip stores the data before and after the fault in the RAM space. When a complete fault recording data is recorded, the DSP will send the data to the HMI display screen for storage through the ModbusRTU protocol, that is, the DSP chip is only responsible for collecting the latest fault recording data and storing it in the RAM space inside the chip. This reduces the data storage pressure and storage space requirements of the DSP chip, and can focus on the operation of protection logic, improve the stability of the relay protection device and the accuracy of protection judgment. After the data is transferred to the HMI, the user can easily view the fault data waveform directly on the HMI, which is helpful for the preliminary judgment and rapid location of power system faults.

[0013] Further, initializing a first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault includes:

[0014] Initialize the size of the first array to:

[0015] FAULT_MSG_HEAD+FAULT_RECORD_NUM*FAULT_RECORD_SIZE

[0016] Wherein, FAULT_MSG_HEAD is the size of the fault information header, including a one-bit fault ID code and data on the time when the fault occurred, FAULT_RECORD_NUM is the number of channels for data sampling, FAULT_RECORD_SIZE is the total number of sampled data points for a single channel for data sampling, FAULT_RECORD_SIZE=t_pre+t_post, t_pre is the number of data points recorded before the fault, and t_post is the number of data points recorded after the fault.

[0017] Further, data sampling is performed according to the data sampling channel and the sampling period of the fault data, and the sampled data is written into the first array, including:

[0018] Dividing the first array into a fault information header area and a sampling channel data area, wherein the sampling channel data area is divided in equal proportion according to the number of channels for data sampling;

[0019] In the i-th sampling cycle, the data collected by the channel at the n-th data sampling is written into the array position with index i+(n-1)*FAULT_RECORD_SIZE in the sampling channel data area.

[0020] Furthermore, data sampling is performed according to the data sampling channel and the sampling period of the fault data, and the sampled data is written into the first array, and further includes:

[0021] The first index variable index_pre is set to record the index of the data write position of the channel collected by the current first data sampling. When index_pre=FAULT_RECORD_SIZE, index_pre is cleared to zero, and data is written from the starting position of the sampling channel data area.

[0022] Further, obtaining the pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points includes:

[0023] When the first index variable index_pre is less than the number of data points recorded before the fault occurs, for the data collected by the channel of the nth data sampling in the first array, the data from the index position of n*FAULT_RECORD_SIZE-(t_pre-index_pre) to the index position of n*FAULT_RECORD_SIZE, and the data from the index position of 1+(n-1)*FAULT_RECORD_SIZE to the index position of 1+(n-1)*FAULT_RECORD_SIZE+index_pre are sequentially obtained as the pre-fault data of the channel of the nth data sampling;

[0024] When the first index variable index_pre is not less than the number of data points recorded before the fault occurs, t_pre, for the data collected by the channel of the nth data sampling in the first array, the data from the index position of (n-1)*FAULT_RECORD_SIZE+index_pre-t_pre to the index position of (n-1)*FAULT_RECORD_SIZE+index_pre are obtained in sequence as the pre-fault data of the channel of the nth data sampling.

[0025] Further, the post-fault data is sampled according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data, including:

[0026] For the nth data sampling channel, the sampling period of the fault data is used as the sampling rate, and the post-fault data of the number of recorded data points after the fault is collected to obtain the post-fault data of the nth data sampling channel.

[0027] Further, the pre-fault data and the post-fault data are written into the first array to obtain the fault recording data record of the current fault, including:

[0028] Initialize a second array according to the number of data points recorded before the fault and the number of data points recorded after the fault, wherein the size of the second array is the sum of the number of data points recorded before the fault and the number of data points recorded after the fault;

[0029] For the nth data sampling channel, the pre-fault data and the post-fault data of the nth data sampling channel are copied to the second array in sequence to obtain the second array of the nth data sampling channel;

[0030] Copy the data of the second array of the channel of the nth data sampling back to the first array at the (n-1)*FAULT_RECORD_SIZE index position to the n*FAULT_RECORD_SIZE index position;

[0031] After the second arrays of all data sampling channels are copied back to the first array, the fault recording data record of the current fault is obtained.

[0032] Further, after obtaining the fault recording data record of the current fault, the following steps are also included:

[0033] Export the fault recording data of the current fault into a CSV file format to obtain a fault file. The fault file naming rule is:

[0034] Fault time_fault type name.csv;

[0035] The first line of data in the fault file is the fault flag information header data and the preset fault recording data sampling channel, fault data sampling period, number of data points recorded before the fault and number of data points recorded after the fault. The n+1th line of data is the pre-fault data and post-fault data of the nth data sampling channel.

[0036] Furthermore, after obtaining the fault file, the fault file is converted into a COMTRADE format, including:

[0037] Get the folder path where the fault file is located, and traverse all files ending with .csv in the folder and its subfolders;

[0038] After traversing to a csv file, obtain the file name of the csv file and the absolute path where the file is stored, and package the file name of the csv file and the absolute path where the file is stored into a structure object named CSVFileNode. The CSVFileNode structure contains two member attributes, fileName and FilePath, which store the file name and file path respectively.

[0039] Add the packaged CSVFileNode object to the CSVFileList queue;

[0040] When all csv files are traversed, the CSVFileList queue stores all the csv file information to be converted;

[0041] Get the fileName attribute in the CSVFileList queue, split the string, extract the time when the fault occurred, open the file stream object, extract the first line of data, and extract the preset fault recording data sampling channel, fault data sampling period, number of data points recorded before the fault, and number of data points recorded after the fault by splitting the comma;

[0042] Extract the data of each channel line by line and store them in an array;

[0043] According to the extracted fault occurrence time and the sampling period of fault data, the standard date and time of the first sampling point is the fault occurrence time - the sampling period of fault data * the number of data points recorded before the fault. After obtaining the time of the first point, calculate the standard date and time of each sampling point;

[0044] According to the extracted file name and file storage path, split string, and four configuration files of COMTREADE standard, the parsed input information is written line by line according to the COMTRADE format rules.

[0045] When all CSVFileNodes in the CSVFileList queue are processed, the fault file in COMTRADE format is obtained.

[0046] A second aspect of the present invention provides a DC relay protection device fault recording data recording device, comprising:

[0047] A parameter setting module, wherein the parameter setting module presets a data sampling channel for fault recording, a sampling period for fault data, a number of data points recorded before a fault, and a number of data points recorded after a fault;

[0048] An initialization module, wherein the initialization module initializes the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault;

[0049] A pre-fault sampling module, which performs data sampling according to the data sampling channel and the sampling period of fault data, and writes the sampled data into the first array;

[0050] A pre-fault data acquisition module, wherein when it is determined that a fault has occurred, the pre-fault data acquisition module acquires pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points;

[0051] A post-fault sampling module, wherein the post-fault sampling module samples the post-fault data according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data;

[0052] A fault recording data module is used to write the pre-fault data and the post-fault data into the first array to obtain a fault recording data record of the current fault.

[0053] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0054] The present invention realizes the collection and storage of fault recording data of a DC relay protection device, adopts a DSP+HMI display screen solution with storage function, separates storage from calculation, reduces the data storage pressure of the DSP bottom board of the DC relay protection device, focuses on protection logic operations, improves the stability of the relay protection device and the accuracy of protection judgment, and the user can intuitively view the fault data waveform on the HMI, which is helpful for rapid fault judgment and positioning. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic flow chart of a method for recording fault waveform data of a DC relay protection device provided by an embodiment of the present invention;

[0056] Figure 2 A schematic diagram of the hardware architecture of a DC relay protection device provided in an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of writing data into a first array provided by an embodiment of the present invention;

[0058] Figure 4 A schematic diagram of obtaining pre-fault data in a first array provided by an embodiment of the present invention;

[0059] Figure 5 Another schematic diagram of obtaining pre-fault data in a first array provided by an embodiment of the present invention;

[0060] Figure 6 A schematic diagram of a process for converting a fault file into a COMTRADE file provided by an embodiment of the present invention;

[0061] Figure 7 A module schematic diagram of a fault recording data recording device for a DC relay protection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0063] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0064] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0065] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0066] Example 1

[0067] This embodiment provides a method for recording fault waveform data of a DC relay protection device, such as Figure 1 As shown, the following steps are included:

[0068] The data sampling channel of the fault recording, the sampling period of the fault data, the number of data points recorded before the fault and the number of data points recorded after the fault are preset on the HMI display screen with storage function;

[0069] The DSP chip initializes the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault;

[0070] The DSP chip performs data sampling according to the data sampling channel and the sampling period of the fault data, and writes the sampled data into the first array;

[0071] When the DSP chip determines that a fault has occurred, it obtains pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points;

[0072] The DSP chip samples the post-fault data according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data;

[0073] The DSP chip writes the pre-fault data and the post-fault data into the first array, obtains the fault recording data record of the current fault, and sends it to the HMI display screen with storage function for storage.

[0074] In this embodiment, the Figure 2 The DC relay protection device structural schematic diagram shown adopts DSP chip + HMI display screen design, and the HMI is a human-machine interface display screen with storage function.

[0075] In a specific embodiment, the data sampling channels can be set to three channels for sampling current, voltage and current change rate. The sampling period of fault data can be set to 0.5ms, 2000 data points can be collected in one second, the number of data points recorded before the fault can be set to 2000, and the number of data points recorded after the fault can be set to 3000. The total number of fault data points of a single channel is 5000. There are three channels in total, and the data area of ​​a fault recording data record has 15,000 data points.

[0076] In a further embodiment, initializing the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault includes:

[0077] Initialize the size of the first array to:

[0078] FAULT_MSG_HEAD+FAULT_RECORD_NUM*FAULT_RECORD_SIZE

[0079] Wherein, FAULT_MSG_HEAD is the size of the fault information header, including a one-bit fault ID code and data on the time when the fault occurred, FAULT_RECORD_NUM is the number of channels for data sampling, FAULT_RECORD_SIZE is the total number of sampled data points for a single channel for data sampling, FAULT_RECORD_SIZE=t_pre+t_post, t_pre is the number of data points recorded before the fault, and t_post is the number of data points recorded after the fault.

[0080] In a specific embodiment, the fault occurrence time data includes the year, month, day, hour, minute, second, and millisecond data of the fault occurrence time. The fault information header contains a total of 8 data. Assuming 3 channels and a single channel collects 5000 points, the size of the first array is 15008 points.

[0081] In a further embodiment, the enable is turned on, the fault recording button is pressed, and the function is started. A fault recording data record mainly goes through three states, RECORD_WAITFORTRIG (the state before the fault occurs). At this time, the bottom board samples data according to the set sampling rate, specifically:

[0082] The method of performing data sampling according to the data sampling channel and the sampling period of the fault data, and writing the sampled data into the first array, comprises:

[0083] Divide the first array into a fault information header area and a sampling channel data area, wherein the sampling channel data area is divided in equal proportion according to the number of channels for data sampling, and the size of each memory area is FAULT_RECORD_SIZE;

[0084] In the i-th sampling cycle, the data collected by the channel at the n-th data sampling is written into the array position with index i+(n-1)*FAULT_RECORD_SIZE in the sampling channel data area.

[0085] In a further embodiment, data sampling is performed according to the data sampling channel and the sampling period of the fault data, and the sampled data is written into the first array, further comprising:

[0086] The first index variable index_pre is set to record the index of the data write position of the channel collected by the current first data sampling. When index_pre=FAULT_RECORD_SIZE, index_pre is cleared to zero, and data is written from the starting position of the sampling channel data area.

[0087] In a specific embodiment, Figure 3 As shown, in the first sampling cycle, the data collected by channel 1 is written into the array position with index 1, the data collected by channel 2 is written into the array position with index 1+FAULT_RECORD_SIZE, the data collected by channel 3 is written into the position with index 1+FAULT_RECORD_SIZE*2, and so on. If no fault occurs, when the sampled data reaches the maximum number of recording points, that is, index_pre=FAULT_RECORD_SIZE, index_pre is cleared, and the loop is entered again to write data from the starting position of each data area.

[0088] In a further embodiment, obtaining the pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points includes:

[0089] Assume that during the acquisition process, when the DSP determines that a fault has occurred, the DSP will obtain the current system time and write the information to the fault information header position of the recordData array. The written information is the fault ID + fault time (year, month, day, hour, minute, second, millisecond). At this time, the recorded data before the fault will be fixed. At this time, there are several situations to be processed:

[0090] When the first index variable index_pre is less than the number of data points recorded before the fault occurs, for the data collected by the channel of the nth data sampling in the first array, the data from the index position of n*FAULT_RECORD_SIZE-(t_pre-index_pre) to the index position of n*FAULT_RECORD_SIZE, and the data from the index position of 1+(n-1)*FAULT_RECORD_SIZE to the index position of 1+(n-1)*FAULT_RECORD_SIZE+index_pre are sequentially obtained as the pre-fault data of the channel of the nth data sampling;

[0091] In a specific embodiment, it is assumed that the data of channel 1 is processed, and it is required to record 2000 data points before the fault, 3000 data points after the fault, and a single channel records 5000 data points. If when the fault occurs, index_pre=1000, which is less than 2000, then the data of 2000 points before the fault should be sorted according to the sampling time, which should be the data of 1000 points from index 4000 to 5000, plus the data of 1000 points from index 1 to index 1000, totaling 2000 points, as the pre-fault data of channel 1, such as Figure 4 As shown;

[0092] When the first index variable index_pre is not less than the number of data points recorded before the fault occurs, t_pre, for the data collected by the channel of the nth data sampling in the first array, the data from the index position of (n-1)*FAULT_RECORD_SIZE+index_pre-t_pre to the index position of (n-1)*FAULT_RECORD_SIZE+index_pre are obtained in sequence as the pre-fault data of the channel of the nth data sampling;

[0093] In a specific embodiment, if index_pre>=t_pre at this time, the data at the data position from index 1 to index t_pre in the data area of ​​sampling channel i at this time is the data of t_pre points before the fault time, such as Figure 5 shown.

[0094] In a further embodiment, the post-fault data is sampled according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data, including:

[0095] For the nth data sampling channel, the sampling period of the fault data is used as the sampling rate, and the post-fault data of the number of recorded data points after the fault is collected to obtain the post-fault data of the nth data sampling channel.

[0096] In a specific embodiment, after the pre-fault data of all channels are fixed, the RECORD_RECORDING state is entered (after the fault occurs), and the data after the fault is initialized to be written into the index variable index_post as 0. After entering a sampling cycle, the sampling value of each channel is written into the index index_post+t_pre position of the sampling channel data area of ​​the second array. When index_post is equal to t_post. The recordData array contains a complete fault recording data. When a single recording data record is completed, the HMI is notified to read the data. When the HMI reads it, the bottom-level program re-enters the RECORD_WAITFORTRIG state and enters the next fault recording data collection.

[0097] In a further embodiment, the pre-fault data and the post-fault data are written into the first array to obtain a fault recording data record of the current fault, including:

[0098] Initialize a second array according to the number of data points recorded before the fault and the number of data points recorded after the fault, wherein the size of the second array is the sum of the number of data points recorded before the fault and the number of data points recorded after the fault;

[0099] For the nth data sampling channel, the pre-fault data and the post-fault data of the nth data sampling channel are copied to the second array in sequence to obtain the second array of the nth data sampling channel;

[0100] In a specific embodiment, 2000 data points of pre-fault data are sequentially copied to array positions 1-2000 in the second array, and 3000 data points of post-fault data are sequentially copied to array positions 2001-5000 in the second array;

[0101] Copy the data of the second array of the channel of the nth data sampling back to the first array at the (n-1)*FAULT_RECORD_SIZE index position to the n*FAULT_RECORD_SIZE index position;

[0102] After the second arrays of all data sampling channels are copied back to the first array, the fault recording data record of the current fault is obtained.

[0103] This embodiment adopts the design of DSP + HMI display screen with storage function. After the relay protection device sets the fixed value, when a fault occurs, the DSP chip stores the data before and after the fault in the RAM space. When a complete fault recording data is recorded, the DSP will send the data to the HMI display screen for storage through the ModbusRTU protocol, that is, the DSP chip is only responsible for collecting the latest fault recording data and storing it in the RAM space inside the chip. This reduces the data storage pressure and storage space requirements of the DSP chip, and can focus on the operation of protection logic, improve the stability of the relay protection device and the accuracy of protection judgment. After the data is transferred to the HMI, the user can conveniently view the fault data waveform directly on the HMI, which is helpful for the preliminary judgment and rapid location of power system faults.

[0104] Example 2

[0105] Based on Example 1, this example discloses the specific steps of converting the fault recording data into COMTRADE format, such as Figure 6 As shown, including:

[0106] After obtaining the fault recording data record of the current fault, the steps include:

[0107] Export the fault recording data of the current fault into a CSV file format to obtain a fault file. The fault file naming rule is:

[0108] Fault time_fault type name.csv;

[0109] The first line of data in the fault file is the fault flag information header data and the preset fault recording data sampling channel, fault data sampling period, number of data points recorded before the fault and number of data points recorded after the fault. The n+1th line of data is the pre-fault data and post-fault data of the nth data sampling channel.

[0110] In a specific embodiment, the fault recording data is stored in the HMI. When it is to be exported, the USB flash drive can be inserted into the USB interface of the HMI, and the fault export button can be clicked to export with one click. The exported data is in CSV file format. CSV is the abbreviation of "Comma-Separated Values" and is a common text file format. It stores table data in a simple format, where each row consists of values ​​separated by commas. After exporting, the naming rule of a single CSV file is "fault time_fault type name.csv";

[0111] The first line of data in the file is the fault flag information header data, including the station name, recording device identifier, sampling frequency, number of sampling points before the fault, number of sampling points after the fault, number of channels, channel name 1, channel name 2, etc., arranged in sequence;

[0112] The second row starts with the data of the first channel sampling data point, data point 1 data, data point 2, data point 3... arranged in sequence. The third row of data is the data of the second channel sampling data point, and all channel sampling data are arranged row by row.

[0113] COMTRADE is the IEEE standard for the exchange of transient data in power systems. It is a file of transient waveforms and accident data collected by standard power systems. This format provides a general format for data exchange that is described in detail. It was proposed in 1991 and revised and improved in 1999. It mainly includes four files.

[0114] Title file (xxxxxxxx.HDR)

[0115] The header file is an optional ASCII text file created by the originator of the COMTRADE data. The creator of the header file can create any information in any order desired. The format of the header file is ASCII. The header file is not required.

[0116] Configuration file (xxx.CFG)

[0117] The configuration file is an ASCII text file that correctly describes the format of the data (.DAT) file and must be saved in a specific format. The file interprets the information contained in the data (.DAT) file, including items such as sampling rate, number of channels, frequency, channel information, etc. A field in the first line of the configuration file identifies the year of the COMTRADE standard version to which the file complies (for example, 1991, 1999, etc.). If this field does not exist or is empty, it is assumed that the file complies with the original publication date of the standard (1991). The configuration file also contains a field that identifies whether the accompanying data file is stored in ASCII or binary format. The configuration file is essential.

[0118] Data file (xxx.DAT)

[0119] The data file contains the values ​​of all input channels for each sample in the record. The data file contains a sequence number and a time stamp for each sample. In addition to recording the data of the analog input, these sample values ​​also record the state, that is, the input of the on / off signal, and the data file is also indispensable.

[0120] Information file (xxxxxxxx.INF)

[0121] An information file is a file that contains special information that the creator of the file wants to make useful to the user. An information file is an optional file.

[0122] Among the above files, the configuration file xxxxxxxx.CFG and the data file xxxxxxxx.DAT are necessary files for waveform viewing.

[0123] In a further embodiment, after copying the data in the USB disk to the computer, the fault file is converted into COMTRADE format using the developed tool software, including:

[0124] Get the folder path where the fault file is located, and traverse all files ending with .csv in the folder and its subfolders;

[0125] After traversing to a csv file, obtain the file name of the csv file and the absolute path where the file is stored, and package the file name of the csv file and the absolute path where the file is stored into a structure object named CSVFileNode. The CSVFileNode structure contains two member attributes, fileName and FilePath, which store the file name and file path respectively.

[0126] Add the packaged CSVFileNode object to the CSVFileList queue;

[0127] When all csv files are traversed, the CSVFileList queue stores all the csv file information to be converted;

[0128] Get the fileName attribute in the CSVFileList queue, split the string, extract the time when the fault occurred, open the file stream object, extract the first line of data, and extract the preset fault recording data sampling channel, fault data sampling period, number of data points recorded before the fault, and number of data points recorded after the fault by splitting the comma;

[0129] Extract the data of each channel line by line and store them in an array;

[0130] According to the extracted fault occurrence time and the sampling period of fault data, the standard date and time of the first sampling point is the fault occurrence time - the sampling period of fault data * the number of data points recorded before the fault. After obtaining the time of the first point, calculate the standard date and time of each sampling point;

[0131] According to the extracted file name and file storage path, split string, and four configuration files of COMTREADE standard, the parsed input information is written line by line according to the COMTRADE format rules.

[0132] When all CSVFileNodes in the CSVFileList queue are processed, the fault file in COMTRADE format is obtained.

[0133] Example 3

[0134] This embodiment provides a DC relay protection device fault recording data recording device based on the first and second embodiments. Figure 7 As shown, including:

[0135] A parameter setting module, wherein the parameter setting module presets a data sampling channel for fault recording, a sampling period for fault data, a number of data points recorded before a fault, and a number of data points recorded after a fault;

[0136] An initialization module, wherein the initialization module initializes the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault;

[0137] A pre-fault sampling module, which performs data sampling according to the data sampling channel and the sampling period of fault data, and writes the sampled data into the first array;

[0138] A pre-fault data acquisition module, wherein when it is determined that a fault has occurred, the pre-fault data acquisition module acquires pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points;

[0139] A post-fault sampling module, wherein the post-fault sampling module samples the post-fault data according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data;

[0140] A fault recording data module is used to write the pre-fault data and the post-fault data into the first array to obtain a fault recording data record of the current fault.

[0141] The same or similar reference numerals correspond to the same or similar components;

[0142] The terms used in the drawings to describe positional relationships are only used for illustrative purposes and should not be construed as limiting this patent;

[0143] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for recording fault waveform data of a DC relay protection device, characterized in that: The following steps are involved: The data sampling channel of the fault recording, the sampling period of the fault data, the number of data points recorded before the fault and the number of data points recorded after the fault are preset on the HMI display screen with storage function; The DSP chip initializes the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault; The DSP chip performs data sampling according to the data sampling channel and the sampling period of the fault data, and writes the sampled data into the first array; When the DSP chip determines that a fault has occurred, it obtains pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points; The DSP chip samples the post-fault data according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data; The DSP chip writes the pre-fault data and the post-fault data into the first array, obtains a single complete fault recording data record of the current fault, and sends it to the HMI display screen with storage function for storage.

2. The method for recording fault waveform data of a DC relay protection device according to claim 1, characterized in that: Initializing a first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault, including: Initialize the size of the first array to: FAULT_MSG_HEAD+FAULT_RECORD_NUM*FAULT_RECORD_SIZE Wherein, FAULT_MSG_HEAD is the size of the fault information header, including a one-bit fault ID code and data on the time when the fault occurred, FAULT_RECORD_NUM is the number of channels for data sampling, FAULT_RECORD_SIZE is the total number of sampled data points for a single channel for data sampling, FAULT_RECORD_SIZE=t_pre+t_post, t_pre is the number of data points recorded before the fault, and t_post is the number of data points recorded after the fault.

3. The method for recording fault waveform data of a DC relay protection device according to claim 2, characterized in that: The method of performing data sampling according to the data sampling channel and the sampling period of the fault data, and writing the sampled data into the first array, comprises: Dividing the first array into a fault information header area and a sampling channel data area, wherein the sampling channel data area is divided in equal proportion according to the number of channels for data sampling; In the i-th sampling cycle, the data collected by the channel at the n-th data sampling is written into the array position with index i+(n-1)*FAULT_RECORD_SIZE in the sampling channel data area.

4. The method for recording fault waveform data of a DC relay protection device according to claim 3, characterized in that: The method further comprises: performing data sampling according to the data sampling channel and the sampling period of the fault data, and writing the sampled data into the first array; The first index variable index_pre is set to record the index of the data write position of the channel collected by the current first data sampling. When index_pre=FAULT_RECORD_SIZE, index_pre is cleared to zero, and data is written from the starting position of the sampling channel data area.

5. The method for recording fault waveform data of a DC relay protection device according to claim 4, characterized in that: Acquiring pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points, including: When the first index variable index_pre is less than the number of data points recorded before the fault occurs, for the data collected by the channel of the nth data sampling in the first array, the data from the index position of n*FAULT_RECORD_SIZE-(t_pre-index_pre) to the index position of n*FAULT_RECORD_SIZE, and the data from the index position of 1+(n-1)*FAULT_RECORD_SIZE to the index position of 1+(n-1)*FAULT_RECORD_SIZE+index_pre are sequentially obtained as the pre-fault data of the channel of the nth data sampling; When the first index variable index_pre is not less than the number of data points recorded before the fault occurs, t_pre, for the data collected by the channel of the nth data sampling in the first array, the data from the index position of (n-1)*FAULT_RECORD_SIZE+index_pre-t_pre to the index position of (n-1)*FAULT_RECORD_SIZE+index_pre are obtained in sequence as the pre-fault data of the channel of the nth data sampling.

6. The method for recording fault waveform data of a DC relay protection device according to claim 5, characterized in that: The post-fault data is sampled according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data, including: For the nth data sampling channel, the sampling period of the fault data is used as the sampling rate, and the post-fault data of the number of recorded data points after the fault is collected to obtain the post-fault data of the nth data sampling channel.

7. The method for recording fault waveform data of a DC relay protection device according to claim 6, characterized in that: The pre-fault data and the post-fault data are written into the first array to obtain the fault recording data record of the current fault, including: Initialize a second array according to the number of data points recorded before the fault and the number of data points recorded after the fault, wherein the size of the second array is the sum of the number of data points recorded before the fault and the number of data points recorded after the fault; For the nth data sampling channel, the pre-fault data and the post-fault data of the nth data sampling channel are copied to the second array in sequence to obtain the second array of the nth data sampling channel; Copy the data of the second array of the channel of the nth data sampling back to the first array at the (n-1)*FAULT_RECORD_SIZE index position to the n*FAULT_RECORD_SIZE index position; After the second arrays of all data sampling channels are copied back to the first array, the fault recording data record of the current fault is obtained.

8. The method for recording fault waveform data of a DC relay protection device according to claim 7, characterized in that: After obtaining the fault recording data record of the current fault, the steps include: Export the fault recording data of the current fault into a CSV file format to obtain a fault file. The fault file naming rule is: Fault time_fault type name.csv; The first line of data in the fault file is the fault flag information header data and the preset fault recording data sampling channel, fault data sampling period, number of data points recorded before the fault and number of data points recorded after the fault. The n+1th line of data is the pre-fault data and post-fault data of the nth data sampling channel.

9. A method for recording fault waveform data of a DC relay protection device according to any one of claims 1 to 8, characterized in that: After obtaining the fault file, the method further includes converting the fault file into a COMTRADE format, including: Get the folder path where the fault file is located, and traverse all files ending with .csv in the folder and its subfolders; After traversing to a csv file, obtain the file name of the csv file and the absolute path where the file is stored, and package the file name of the csv file and the absolute path where the file is stored into a structure object named CSVFileNode. The CSVFileNode structure contains two member attributes, fileName and FilePath, which store the file name and file path respectively. Add the packaged CSVFileNode object to the CSVFileList queue; When all csv files are traversed, the CSVFileList queue stores all the csv file information to be converted; Get the fileName attribute in the CSVFileList queue, split the string, extract the time when the fault occurred, open the file stream object, extract the first line of data, and extract the preset fault recording data sampling channel, fault data sampling period, number of data points recorded before the fault, and number of data points recorded after the fault by splitting the comma; Extract the data of each channel line by line and store them in an array; According to the extracted fault occurrence time and the sampling period of fault data, the standard date and time of the first sampling point is the fault occurrence time - the sampling period of fault data * the number of data points recorded before the fault. After obtaining the time of the first point, calculate the standard date and time of each sampling point; According to the extracted file name and file storage path, split string, and four configuration files of COMTREADE standard, the parsed input information is written line by line according to the COMTRADE format rules. When all CSVFileNodes in the CSVFileList queue are processed, the fault file in COMTRADE format is obtained.

10. A DC relay protection device fault recording data recording device, characterized in that: include: A parameter setting module, wherein the parameter setting module presets a data sampling channel for fault recording, a sampling period for fault data, a number of data points recorded before a fault, and a number of data points recorded after a fault; An initialization module, wherein the initialization module initializes the first array according to the data sampling channel, the number of data points recorded before the fault, and the number of data points recorded after the fault; A pre-fault sampling module, which performs data sampling according to the data sampling channel and the sampling period of fault data, and writes the sampled data into the first array; A pre-fault data acquisition module, wherein when it is determined that a fault has occurred, the pre-fault data acquisition module acquires pre-fault data from the first array according to the data sampling channel and the number of pre-fault recorded data points; A post-fault sampling module, wherein the post-fault sampling module samples the post-fault data according to the data sampling channel, the sampling period of the fault data and the number of data points recorded after the fault to obtain the post-fault data; A fault recording data module is used to write the pre-fault data and the post-fault data into the first array to obtain a fault recording data record of the current fault.