Generation method and system suitable for various relay protection tester data files
By abstracting and unified processing of the data format of the relay protection tester, a unified format dictionary and inverted index library are built, the problem of incompatibility of tester data files of different brands and models is solved, and the general adaptation and efficient instruction generation of tester data files are realized.
Patent Information
- Application Number
- CN202411913909.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, the data file format of the relay protection tester lacks standards, resulting in different data files and communication protocols of each manufacturer, and it is impossible to adapt to test instruments of different brands and models, which increases the workload and complexity of test case editing.
By effectively abstracting and unified processing of the tester data formats of different manufacturers, key data are screened and extracted, irrelevant data are eliminated, similar data are integrated and integrated, and a unified format dictionary and inverted index library are built, so that the control instructions of relay protection testers of different brands and models can be standardized and unified, and a general data model is finally built.
The data file adaptation of relay protection testers of different brands and models is realized, which reduces the development of test cases, improves the universality and adaptability of the test system, and significantly improves the efficiency and accuracy of instruction generation.
Smart Images

Figure CN119829695A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of relay protection, and more specifically, relates to a method and system for generating data files applicable to a variety of relay protection testers. Background Art
[0002] The automatic test system for relay protection devices is used to test the functions and performance of relay protection devices. The test cases in the test system are composed of the control of the protection device, the result feedback and the control of the relay protection tester. The voltage, current and input and output information applied by the relay protection tester are usually stored in the form of data files. During the automatic test process, the test cases need to be edited and stored in advance to improve the test efficiency.
[0003] Since there is no relevant standard for the data file format of relay protection testers, and the data files and communication protocols of each manufacturer are different, the data files of relay protection testers must be deeply bound to a specific tester in the process of compiling test cases, that is, this set of test cases can only be tested with the specified tester and cannot be adapted to other testers. With the increase in the number of tester manufacturers and models, the workload of editing test cases will increase exponentially to adapt to different testers, and most of it is repetitive work. Summary of the invention
[0004] In order to solve the deficiencies in the prior art, the present invention provides a method and system for generating data files suitable for a variety of relay protection testers. The differences in data formats of testers from different manufacturers are effectively abstracted and uniformly processed, key data are screened and extracted, irrelevant data are eliminated, and similar data are integrated and fused. By constructing a unified format dictionary and an inverted index library, the control instructions of relay protection testers of different brands and models can be standardized and unified, and finally a universal data model is constructed.
[0005] The present invention adopts the following technical solution.
[0006] On one hand, the present invention provides a method for generating data files applicable to a variety of relay protection testers, comprising:
[0007] S1: Collect data files and communication protocols of multiple relay protection tester manufacturers, filter and extract key fields to generate field instruction database, build a custom unified format dictionary, and build an inverted index library based on the custom unified format dictionary;
[0008] S2: Establish a general data model for test instruments, collect data files and communication protocol documents related to test instrument equipment for word segmentation, and use the general data model for test instruments to filter and extract key fields and operation instruction features. Generate multi-dimensional vectors through the BERT text vectorization method, save all the extracted multi-dimensional vectors together, and build a vector index library;
[0009] S3: construct a test case file according to the custom unified format dictionary in step S1, extract key fields and operation instruction features of the set tester using the tester general data model established in step S2, perform feature matching through the RAG algorithm and vector index library, select the tester format with the highest similarity, and generate a set tester data file through the index field;
[0010] S4: The data file converted in step S3 is transmitted to the setting tester through serial communication. After receiving the data file, the tester parses it to obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction, the tester actually applies the corresponding value.
[0011] Preferably, step S1 comprises:
[0012] By collecting the acquired data files and communication protocol documents, a custom unified format dictionary is constructed, and an inverted index library is constructed based on the custom unified format dictionary. The custom unified format dictionary is a field instruction terminology dictionary commonly used in custom testers. The inverted index library retrieves documents belonging to field instructions in relay protection testers, and the field instructions include key fields and operation instructions.
[0013] Preferably, the process of establishing the custom unified format dictionary and sorting index library includes:
[0014] Collect data files and communication protocol document information of relay protection testers on the market in advance, use word segmentation tools to divide all acquired field instructions according to the common field instruction terms of custom testers, and build a custom unified format dictionary;
[0015] The Lucene full-text search framework algorithm is used to associate the obtained field instruction words with the documents they belong to. Each field instruction word is assigned one or more index items, and the relevant field instruction terms in the custom unified format dictionary are also added to the index to generate an inverted index library.
[0016] Preferably, step S2 comprises:
[0017] Collect data files and communication protocol documents related to the test instrument equipment, use word segmentation tools to segment the text, use a custom unified format dictionary to standardize and map the word segmentation results, obtain the terminology vocabulary set of the test instrument equipment, and convert the segmented data into the general data model processing format of the test instrument, including NumPy array, PandasDataFrame and TensorFlow formats.
[0018] Preferably, step S2 comprises:
[0019] The universal data model of the test instrument adopts the BERT pre-trained language model algorithm to pre-train the text data after format conversion and convert it into a multi-dimensional vector, uses the BERT pre-trained language model to further process the converted text data, and generates a multi-dimensional vector for each text unit, saves all the extracted multi-dimensional vectors together, and constructs a vector index library, wherein the text unit includes key fields and operation instructions.
[0020] Preferably, a test case file is constructed based on a custom unified format dictionary, the test case file contains operation instructions to be executed and configuration information of key fields, and a test case field index is added to each field to make it consistent with the field index in the custom unified format dictionary.
[0021] Preferably, the features of key fields and operation instructions for setting the test instrument are extracted using the general data model of the test instrument, and these features are converted into text vectors using the BERT algorithm.
[0022] Preferably, the text vector generated by the set tester and the vector index library constructed by the general data model of the tester are calculated by the RAG algorithm and the vector index library to obtain the result with the highest similarity through the cosine similarity calculation;
[0023] The formula for calculating cosine similarity is as follows:
[0024]
[0025] Where:
[0026] X represents the text vector generated by the set tester;
[0027] Y represents the vector of the vector index library constructed by the general data model of the tester;
[0028] X i represents the i-th component of vector X;
[0029] Y i represents the i-th component of vector Y;
[0030] n represents the dimension of the vector.
[0031] Preferably, step S2 comprises:
[0032] The word segmentation results are standardized and mapped using a custom unified format dictionary. The text vector and the vector representation in the vector index library are in a unified data format. The test case field index is used to establish an association between the test case and the result with the highest similarity. The result with the highest similarity is matched to the key field representation and operation instruction setting of the current setting experiment instrument through the inverted index library. After the relevant key fields and operation instructions assigned to the current setting experiment instrument are extracted, the operation instructions executed by the test case and the configuration information of the key fields are matched to generate a data file suitable for the setting experiment instrument.
[0033] The present invention also provides a generation system for data files of various relay protection testers, which runs the aforementioned generation method for data files of various relay protection testers, including: a unified format generation module, a general data model generation module, a setting experimenter data file generation module and a data file transmission module;
[0034] A unified format generation module is used to collect data files and communication protocols of multiple relay protection tester manufacturers, filter and extract key fields to generate a field instruction database, build a custom unified format dictionary, and build an inverted index library based on the custom unified format dictionary;
[0035] The general data model generation module is used to collect data files and communication protocol documents related to the test instrument equipment for word segmentation. After word segmentation, the general data model of the test instrument is used to filter and extract key fields and operation instruction features to generate multi-dimensional vectors through the BERT text vectorization method. All the extracted multi-dimensional vectors are saved together to build a vector index library.
[0036] The test instrument data file generation module is used to extract key fields and operation instruction features of the test instrument through the established test instrument general data model, perform feature matching through the RAG algorithm and vector index library, select the most relevant test instrument format, and generate the final data file based on the index field;
[0037] The data file transmission module is used to transmit the converted data file to the setting tester through serial communication. After receiving the data file, the tester parses it to obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction, the tester will actually apply the corresponding value.
[0038] Compared with the prior art, the beneficial effects of the present invention include at least:
[0039] 1) This patent proposes a method and system for generating a universal data file for a tester, which is characterized in that a universal tester data model can be used to adapt to testers of different models from different manufacturers, by effectively abstracting and uniformly processing the differences in data formats of testers from different manufacturers, screening and extracting key data, eliminating irrelevant data, integrating and merging similar data, and by building a unified format dictionary and inverted index library, the control instructions of relay protection testers of different brands and models can be standardized and unified, and finally a universal data model is built. Through the corresponding conversion interface, the universal data model is converted into a file or instruction that can be recognized by the specified tester, so as to achieve the purpose of adapting one file to different testers;
[0040] 2) This patent can be applied to the automatic test system of protection devices such as lines, buses, transformers, etc. at different voltage levels to generate a unified tester data file. During the test process, according to the actual tester model used, the corresponding conversion interface is called to generate files or messages that can be recognized by the tester, thereby releasing the deep binding between the test system and the test equipment, improving the versatility and adaptability of the test system, and reducing the development of test cases;
[0041] 3) The present invention uses RAG algorithm and vector index library for feature matching, and uses measurement methods such as cosine similarity to accurately and quickly find the most relevant test instrument format, and automatically generate corresponding instructions or files according to test cases. This process significantly improves the efficiency and accuracy of instruction generation;
[0042] 4) Through natural language processing and deep learning technologies, such as the BERT model, more complex and fine-grained features can be extracted from the communication protocols and data files of the test instruments, thereby generating more accurate test instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of a method for generating data files applicable to various relay protection testers provided in accordance with an embodiment of the present invention;
[0044] Figure 2 The present invention provides a flowchart of data conversion of a universal data model file of a test instrument. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution of the present invention will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, ordinary technicians in this field can make the above-mentioned invention without creative work.
[0046] like Figure 1As shown, embodiment 1 of the present invention provides a method for generating data files applicable to various relay protection testers, comprising the following steps:
[0047] S1: Collect data files and communication protocols of multiple relay protection tester manufacturers, filter and extract key fields to generate field instruction database, build a custom unified format dictionary, and build an inverted index library based on the custom unified format dictionary;
[0048] Preferably but not limiting, step S1 specifically comprises:
[0049] S1.1: Collect data files and communication protocol documents from multiple mainstream relay protection tester manufacturers. The communication protocol documents include communication protocol type, data frame structure and operation instruction code, and the data files include device configuration files and test command files;
[0050] In the embodiment of the present invention, there is no national standard for the current communication protocol of the relay protection tester. The external communication of the equipment of each manufacturer uses a customized private protocol, and the data format varies greatly. Different communication protocols need to be processed separately. The communication protocol document includes the communication protocol type, data frame structure, operation instruction code definition, register address and device command. The communication protocol type describes the communication protocol supported by the tester device, such as MODBUSRTU / TCP, IEC61850 and DNP3, etc. The data frame structure describes the specific data structure of the current tester device protocol, such as the command header, data field and check bit, etc. The register address is used in MODBUS or similar protocols. The communication protocol usually provides a register address mapping to indicate the function and data type of each register. The device command includes instructions and parameters for setting current, voltage, frequency, and triggering protection functions. At the same time, the data file includes a device configuration file and a test command file. The device configuration file contains conventional configurations such as setting current, voltage, frequency, etc., which can usually be provided in JSON, XML or CSV format. The test command file refers to some devices (especially high-end devices) that may support configuration and start testing through specific file formats, such as CSV, TXT, etc. These files usually list the specific operations to be performed, target parameters, time delays and other information. S1.2: Effectively abstract and uniformly process the data files and communication protocol documents collected in step S1.1, filter and extract key data, and establish a field instruction database after eliminating irrelevant data. The field instruction database includes a key field database and an operation instruction database;
[0051] The key data in the example of the present invention includes key data fields and operation instructions. The key fields are fields related to device measurement, status, and testing, including measurement data fields, device status fields, timestamps, other device status information, etc. For example, the measurement data fields include voltage, current, and frequency, etc., the device status fields include protection action status and event type, etc., and other device status information includes input switch status, etc.;
[0052] The operation instructions are used to control the tester to perform specific operations, including setting value instructions, equipment operation instructions, event trigger instructions and data request instructions, etc. For example, setting value instructions include applying voltage instructions, applying current instructions and applying power instructions, etc., and equipment operation instructions include starting / stopping equipment instructions, triggering protection instructions and configuring equipment instructions, etc. In the conventional test process of relay protection devices, depending on the different detection items, a variety of different data models such as state sequence, transition, harmonics, etc. may be used. The key data that needs to be extracted from different data models are different. For the communication protocols of different manufacturers, the same data model will have certain differences according to the characteristics of the manufacturer's own equipment. Therefore, it is necessary to abstract the communication protocols of different manufacturers, extract the common part data, and eliminate the difference content and data irrelevant to the test. Taking the state sequence as an example, the key data that needs to be extracted to construct a general state sequence data model is roughly divided into three parts, including state trigger data, voltage and current data, and switch quantity data. The state trigger data mainly includes the number of states, state switching trigger conditions, the duration of each state, input trigger logic, input trigger selection, etc. The voltage and current data mainly include the name of the voltage and current channel in each state, the voltage and current amplitude, phase and frequency. The switch quantity data mainly includes the settings of the test instrument in each state.
[0053] S1.3: Based on the data files and communication protocol documents collected in step S1.1, a custom unified format dictionary is constructed, and an inverted index library is constructed according to the custom unified format dictionary. The custom unified format dictionary is a field instruction term dictionary commonly used by custom testers. The inverted index library is used to retrieve documents belonging to field instructions in the relay protection tester, and the field instructions include key fields and operation instructions;
[0054] Preferably but not limiting, step S1.3 specifically comprises:
[0055] S1.3.1: For step S1.1, pre-collect the data files and communication protocol document information of the relay protection tester on the market, use the word segmentation tool to divide all the acquired field instructions according to the common field instructions of the custom tester, and build a custom unified format dictionary;
[0056] S1.3.2: Use the Lucene full-text search framework algorithm to associate the field instruction words obtained in step S1.3.1 with the documents to which they belong. Each field instruction word is assigned one or more index items, and the relevant field instruction terms in the custom unified format dictionary are also added to the index to generate an inverted index library.
[0057] In the examples of the present invention, different manufacturers use different terms to describe the same concept. Directly operating these documents will be very confusing. By establishing a unified format dictionary and inverted index, the same concepts in all documents can be unified into a standard term, thereby avoiding confusion and conflict in terms; using unified terminology makes subsequent operations, including instruction generation, data retrieval, data processing, etc., more efficient, avoiding the need for continuous mapping and conversion when processing equipment from different manufacturers; in the actual relay protection test process, equipment from different brands may work together. Through the unified format dictionary, the system can understand and operate equipment from all manufacturers, even if they differ in protocols or instructions; the introduction of inverted indexes allows all field instructions and terms in documents to be efficiently retrieved. In subsequent applications, users can quickly locate all relevant documents and fields through unified terms, such as voltage, current, etc., and locate specific documents to confirm which manufacturer uses which tester. Take the state sequence data model as an example: in this model, the number of states is integer data, starting from 1, state 1 is the first state, and the subsequent ones are accumulated in sequence; the state switching trigger conditions are divided into time trigger, input trigger, time plus input, the value is an integer, 0 represents time trigger, 1 represents input trigger, 2 represents time plus input; the state duration is integer data, the unit is second; the input trigger logic is divided into "AND" logic and "OR" logic, the value is an integer, 0 represents "AND" logic, 1 represents "OR" logic; the input trigger selection is an integer list, which stores the input selection data of input 1 to input 8, the input sequence number starts from 1, the input selection is 1 for valid, and 0 for invalid; the channel name in the voltage and current data is a character String type. This model supports up to 4 groups of voltages and 4 groups of currents. The names of the first to fourth groups of voltages are "Ua1, Ub1, Uc1" to "Ua4, Ub4, Uc4", and the names of the first to fourth groups of currents are "Ia1, Ib1, Ic1" to "Ia4, Ib4, Ic4". The amplitude of the voltage and current channels is a floating-point value. The unit of voltage is "V", the unit of current is "A", the phase is a floating-point value with a unit of "°", and the frequency is a floating-point value with a unit of "Hz". The switch data is an integer list, which stores the opening and closing states of outputs 1 to 8. The output sequence starts from 1. The output state of 1 indicates that the node is closed in the current state, and 0 indicates open.
[0058] S2: Establish a general data model for test instruments, collect data files and communication protocol documents related to test instrument equipment for word segmentation, and use the general data model for test instruments to filter and extract key fields and operation instruction features. Generate multi-dimensional vectors through the BERT text vectorization method, save all the extracted multi-dimensional vectors together, and build a vector index library;
[0059] Preferably but not limiting, step S2 specifically includes:
[0060] S2.1: Collect data files and communication protocol documents related to test equipment, use word segmentation tools to segment the text, use a custom unified format dictionary to standardize and map the segmentation results, and obtain a vocabulary set of test equipment terms;
[0061] Preferably, but not restrictively, reference is made to Figure 2 , step S2.1 specifically includes:
[0062] S2.1.1: Construct the current-voltage channel mapping relationship, including: extracting the voltage and current channel names in the general data model and setting the voltage and current channel names of the tester, constructing the channel mapping relationship between the general data model and the set tester channel. For example, the voltage and current channels in the general data model are "Ua1, Ub1, Uc1" to "Ua4, Ub4, Uc4", "Ia1, Ib1, Ic1" to "Ia4, Ib4, Ic4", and the names of the four groups of voltage channels in the communication protocol of a tester manufacturer are They are "Ua, Ub, Uc", "Uap, Ubp, Ucp", "Usa, Usb, Usc", "Uta, Utb, Utc", and the names of the four groups of current channels are "Ia, Ib, Ic", "Iap, Ibp, Icp", "Isa, Isb, Isc", "Ita, Itb, Itc". In this system, it is necessary to establish a mapping relationship between the two. For example, "Ua1" in the general model represents "Ua" in the communication protocol of the tester, and the rest of the channels are similar.
[0063] S2.1.2: Construct the mapping relationship between the input and output data, including: extracting the input and output data in the general data model and setting the switch input and output ports of the tester, and converting the formats as needed, constructing the mapping relationship between the general data model and the input and output data of the tester. In this model, the 8 channels of the input data are "bin1" to "bin8", and the 8 channels of the output data are "bout1" to "bout8". In the communication protocol of a certain tester manufacturer, the 8 channels of the input data are "binA", "binB", "binC", "binR", "bina", "binb", "binc", and "binr". In this system, it is necessary to establish a mapping relationship between the two. For example, "bin1" in the general model represents "binA" in the communication protocol of the tester, and the remaining channels are analogous.
[0064] S2.1.3: Construct interface mapping relationships. In this system, there are two main types of interfaces, namely control interface and communication interface. The control interface mainly includes establishing communication connection between the test system and the set tester, communication status monitoring, communication exception handling, etc. The communication interface mainly includes data leasing frames, command issuance, result reading and analysis, etc. For testers from different manufacturers, due to differences in their communication modes, communication protocols, etc., it is necessary to implement corresponding interfaces according to their application characteristics, and correspond to the manufacturers one by one, and establish a mapping relationship between the interface and testers from different manufacturers.
[0065] S2.2: converting the segmented data obtained in step S2.1 into a common data model processing format of the tester, including NumPy array, PandasDataFrame and TensorFlow formats;
[0066] S2.3: The test instrument universal data model uses the BERT pre-trained language model algorithm to pre-train the text data converted in the format of step S2.2 and convert it into a multi-dimensional vector to obtain a labeled classification data set, wherein the labeled classification data set includes a key field data set and an operation instruction data set;
[0067] S2.4: Use the BERT pre-trained language model to further process the text data converted in step S2.2, and generate a multidimensional vector for each text unit, save all the extracted multidimensional vectors together, and build a vector index library. The text unit includes key fields and operation instructions.
[0068] The vectorization result of the present invention refers to that after being processed by the BERT model, each text unit (will generate a high-dimensional vector, which contains the deep semantic information of each text unit, i.e., key fields and operation instructions in a specific context. For each command, field or instruction, BERT will provide a multi-dimensional vector representation for each text unit, which represents the semantic features of the text in its context. Therefore, the tester BERT vector is the vector representation of each tester device command, field, instruction and other text units. The multi-dimensional vectors generated by the above steps can be stored in a vector index library for subsequent query, classification, retrieval and other tasks.
[0069] S3: Construct a test case file according to the customized unified format dictionary in step S1, use the general data model of the tester established in step S2 to extract key fields and operation instruction features of the set tester, perform feature matching through the RAG algorithm and vector index library, select the most relevant tester format, and generate the final data file through the index field.
[0070] Preferably but not limiting, step S3 specifically includes:
[0071] S3.1: Construct a test case file based on the custom unified format dictionary in step S1, wherein the test case file contains the operation instructions to be executed and the configuration information of the key fields, and adds a test case field index to each field to make it consistent with the field index in the custom unified format dictionary.
[0072] S3.2: Using the general data model of the tester in step S2, extract the features of the key fields and operation instructions for setting the tester, and convert these features into text vectors through the BERT algorithm;
[0073] S3.3: Perform feature matching using the RAG algorithm and the vector index library, and calculate the cosine similarity between the text vector in step S3.2 and the vector in the vector index library in step S2.3 to obtain the result with the highest similarity in the vector index library;
[0074] The formula for calculating cosine similarity is as follows:
[0075]
[0076] Where:
[0077] X represents the text vector generated by the set tester;
[0078] Y represents the vector of the vector index library constructed by the general data model of the tester;
[0079] X i represents the i-th component of vector X;
[0080] Y i represents the i-th component of vector Y;
[0081] n represents the dimension of the vector.
[0082] In the example of the present invention, the cosine similarity is to calculate the cosine similarity of the text vector generated by the set test instrument and all the vectors in the vector index library constructed by the general data model of the test instrument, and to sort the vectors in the vector index library corresponding to the first largest cosine similarity value in descending order according to the calculation results, and find the format that best suits the current test task.
[0083] S3.4: After the text vector of the setting test instrument is matched to the result with the highest similarity in the vector index library, the result with the highest similarity is generated through the inverted index library and the test case field index to generate a data file suitable for setting the test instrument, which includes the operation instructions of the test case setting and the configuration information of the key fields.
[0084] Preferably but not limiting, step S3.4 specifically includes:
[0085] S3.4.1: Based on step S2.1, the word segmentation results are standardized and mapped using a custom unified format dictionary, wherein the text vector and the vector representation in the vector index library are in a unified data format, and the association between the test case and the result with the highest similarity is established using the test case field index;
[0086] S3.4.2: Match the result with the highest similarity through the inverted index library to the key field representation and operation instruction setting of the current setting experiment instrument, extract the relevant key fields and operation instructions assigned to the current setting experiment instrument, and then match the operation instructions of the test case execution with the configuration information of the key fields to generate a data file suitable for the setting test instrument.
[0087] S4: The data file converted by S3 is transmitted to the setting tester through serial communication. Once the tester receives the data file, it will parse it to obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction (such as set current value, applied voltage or other physical quantity), the tester will actually apply the corresponding value.
[0088] In the embodiment of the present invention, if a tester of a certain manufacturer performs external communication through TCP and performs external control in the form of data frames, in the system, it is first necessary to establish a communication connection according to the setting of the tester, establish TCP communication with the tester through the corresponding interface, and then parse the universal tester data file in the test case and convert it into a universal data model. Then, according to the current and voltage channel mapping and open-in and open-out mapping of the setting tester and the universal model, frame it through a specific interface to form a data frame that can be recognized by the tester.
[0089] S4: The data file converted in step S3 is transmitted to the setting tester through serial communication. Once the tester receives the data file, it will parse and obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction, the tester will actually apply the corresponding value.
[0090] The configuration in the instruction in the implementation of the present invention includes setting the current value, the applied voltage or other physical quantities. For example, if the instruction sets the current to 10A, the tester will adjust the current output to 10A. For conventional station devices, the applied values are the voltage, current and switching quantities required for the test. For intelligent station devices, the applied values are SV / GOOSE messages, thereby completing the test process.
[0091] Embodiment 2 of the present invention provides a system for generating data files applicable to various relay protection testers, and runs a method for generating data files applicable to various relay protection testers described in embodiment 1, including: a general data model file generating module, a tester data conversion module and an instruction transmission and application module;
[0092] A unified format generation module is used to collect data files and communication protocols of multiple relay protection tester manufacturers, filter and extract key fields to generate a field instruction database, build a custom unified format dictionary, and build an inverted index library based on the custom unified format dictionary;
[0093] The general data model generation module is used to collect data files and communication protocol documents related to the test instrument equipment for word segmentation. After word segmentation, the general data model of the test instrument is used to filter and extract key fields and operation instruction features to generate multi-dimensional vectors through the BERT text vectorization method. All the extracted multi-dimensional vectors are saved together to build a vector index library.
[0094] The test instrument data file setting module is used to extract key fields and operation instruction features of the test instrument through the established test instrument general data model, perform feature matching through the RAG algorithm and vector index library, select the most relevant test instrument format, and generate the final data file based on the index field;
[0095] The data file transmission module is used to transmit the converted data file to the setting tester through serial communication. After receiving the data file, the tester parses it to obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction, the tester will actually apply the corresponding value.
[0096] The present invention proposes a universal data file generation method and system for relay protection testers. In the system, a unified tester data file is used to adapt to testers of different models from different manufacturers, thereby eliminating the deep coupling between test cases and test equipment and reducing the redundant test case development work caused by differences in test equipment.
[0097] The present invention proposes a universal test instrument data file to adapt to test instruments from different manufacturers. In this system, a universal data model for test instruments is designed, which includes test type, channel data information, trigger conditions, duration, trigger logic, input and output data, etc. The model effectively abstracts and unifies the differences in data file formats of test instruments from different manufacturers, screens and extracts key data, eliminates irrelevant data, integrates and fuses similar data, and finally constructs a universal data model.
[0098] The first innovation of this patent is to propose a method for generating a universal data file for a tester, generating a universal tester data model file, which is an abstraction of the data formats of different manufacturers, and constructs a universal data format by screening, extracting and integrating the valid data therein. The second innovation is based on the universal data model of the first innovation, and proposes a test system. The system calls different conversion interfaces according to the actual tester used, converts the universal data model into a file or instruction that can be recognized by the specified tester, and controls the tester to apply the value.
[0099] Compared with the prior art, the beneficial effects of the present invention include at least:
[0100] 1) This patent proposes a method and system for generating universal data files for testers, which is characterized in that a universal tester data model can be used to adapt to testers of different models from different manufacturers, by effectively abstracting and uniformly processing the differences in data formats of testers from different manufacturers, screening and extracting key data, eliminating irrelevant data, integrating and merging similar data, and by constructing a unified format dictionary and inverted index library, the control instructions of relay protection testers of different brands and models can be standardized and unified, and finally a universal data model is constructed. Through the corresponding conversion interface, the universal data model is converted into a file or instruction that can be recognized by the specified tester, thereby achieving the purpose of adapting one file to different testers.
[0101] 2) This patent can be applied to the automatic test system of protection devices such as lines, busbars, transformers, etc. at different voltage levels to generate a unified tester data file. During the test process, the corresponding conversion interface is called according to the actual tester model used to generate files or messages that can be recognized by the tester, thereby releasing the deep binding between the test system and the test equipment, improving the versatility and adaptability of the test system, and reducing the development work of test cases.
[0102] 3) The present invention uses RAG algorithm and vector index library for feature matching, and uses cosine similarity and other measurement methods to accurately and quickly find the most relevant tester format, and automatically generate corresponding instructions or files according to the test case. This process significantly improves the efficiency and accuracy of instruction generation.
[0103] 4) Through natural language processing and deep learning technologies, such as the BERT model, more complex and fine-grained features can be extracted from the communication protocols and data files of the test instruments, thereby generating more accurate test instructions.
[0104] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for generating data files applicable to a variety of relay protection testers, characterized in that: include: S1: Collect data files and communication protocols of multiple relay protection tester manufacturers, filter and extract key fields to generate field instruction database, build a custom unified format dictionary, and build an inverted index library based on the custom unified format dictionary; S2: Establish a general data model for test instruments, collect data files and communication protocol documents related to test instrument equipment for word segmentation, and use the general data model for test instruments to filter and extract key fields and operation instruction features. Generate multi-dimensional vectors through the BERT text vectorization method, save all the extracted multi-dimensional vectors together, and build a vector index library; S3: construct a test case file according to the custom unified format dictionary in step S1, extract key fields and operation instruction features of the set tester using the tester general data model established in step S2, perform feature matching through the RAG algorithm and vector index library, select the tester format with the highest similarity, and generate a set tester data file through the index field; S4: The data file converted in step S3 is transmitted to the setting tester through serial communication. After receiving the data file, the tester parses it to obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction, the tester actually applies the corresponding value.
2. The method for generating data files applicable to various relay protection testers according to claim 1, characterized in that: Step S1 includes: By collecting the acquired data files and communication protocol documents, a custom unified format dictionary is constructed, and an inverted index library is constructed based on the custom unified format dictionary. The custom unified format dictionary is a field instruction terminology dictionary commonly used in custom testers. The inverted index library retrieves documents belonging to field instructions in relay protection testers, and the field instructions include key fields and operation instructions.
3. The method for generating data files applicable to various relay protection testers according to claim 2, characterized in that: The process of establishing the custom unified format dictionary and sorting index library includes: Collect data files and communication protocol document information of relay protection testers on the market in advance, use word segmentation tools to divide all acquired field instructions according to the common field instruction terms of custom testers, and build a custom unified format dictionary; The Lucene full-text search framework algorithm is used to associate the obtained field instruction words with the documents they belong to. Each field instruction word is assigned one or more index items, and the relevant field instruction terms in the custom unified format dictionary are also added to the index to generate an inverted index library.
4. The method for generating data files applicable to various relay protection testers according to claim 1, characterized in that: Step S2 includes: Collect data files and communication protocol documents related to the test instrument equipment, use word segmentation tools to segment the text, use a custom unified format dictionary to standardize and map the word segmentation results, obtain the terminology vocabulary set of the test instrument equipment, and convert the segmented data into the general data model processing format of the test instrument, including NumPy array, PandasDataFrame and TensorFlow formats.
5. A method for generating data files applicable to multiple relay protection testers according to claim 4, characterized in that: Step S2 includes: The universal data model of the test instrument adopts the BERT pre-trained language model algorithm to pre-train the text data after format conversion and convert it into a multi-dimensional vector, uses the BERT pre-trained language model to further process the converted text data, and generates a multi-dimensional vector for each text unit, saves all the extracted multi-dimensional vectors together, and constructs a vector index library, wherein the text unit includes key fields and operation instructions.
6. The method for generating data files applicable to various relay protection testers according to claim 1, characterized in that: A test case file is constructed based on a custom unified format dictionary, wherein the test case file contains operation instructions to be executed and configuration information of key fields, and a test case field index is added to each field to make it consistent with the field index in the custom unified format dictionary.
7. The method for generating data files applicable to various relay protection testers according to claim 5, characterized in that: The general data model of the test instrument is used to extract the features of the key fields and operation instructions for setting the test instrument, and these features are converted into text vectors through the BERT algorithm.
8. The method for generating data files applicable to various relay protection testers according to claim 6, characterized in that: The feature matching calculation is performed by using the RAG algorithm and the vector index library. The text vector generated by the set tester and the vector index library constructed by the general data model of the tester are calculated by cosine similarity to obtain the result with the highest similarity. The formula for calculating cosine similarity is as follows: Where: X represents the text vector generated by the set tester; Y represents the vector of the vector index library constructed by the general data model of the tester; X i represents the i-th component of vector X; Y i represents the i-th component of vector Y; n represents the dimension of the vector.
9. The method for generating data files applicable to various relay protection testers according to claim 1, characterized in that: The word segmentation results are standardized and mapped using a custom unified format dictionary. The text vector and the vector representation in the vector index library are in a unified data format. The test case field index is used to establish an association between the test case and the result with the highest similarity. The result with the highest similarity is matched to the key field representation and operation instruction setting of the current setting experiment instrument through the inverted index library. After the relevant key fields and operation instructions assigned to the current setting experiment instrument are extracted, the operation instructions executed by the test case and the configuration information of the key fields are matched to generate a data file suitable for the setting experiment instrument.
10. A system for generating data files applicable to multiple relay protection testers, running a method for generating data files applicable to multiple relay protection testers as claimed in any one of claims 1 to 9, characterized in that: A unified format generation module is used to collect data files and communication protocols of multiple relay protection tester manufacturers, filter and extract key fields to generate a field instruction database, build a custom unified format dictionary, and build an inverted index library based on the custom unified format dictionary; The general data model generation module is used to collect data files and communication protocol documents related to the test instrument equipment for word segmentation. After word segmentation, the general data model of the test instrument is used to filter and extract key fields and operation instruction features to generate multi-dimensional vectors through the BERT text vectorization method. All the extracted multi-dimensional vectors are saved together to build a vector index library. Set the test instrument data file, which is used to extract key fields and operation instruction features of the set test instrument through the established test instrument general data model, perform feature matching through the RAG algorithm and vector index library, select the most relevant test instrument format, and generate the final data file based on the index field; The data file transmission module is used to transmit the converted data file to the setting tester through serial communication. After receiving the data file, the tester parses it to obtain the execution operation instructions and configuration information of key fields. According to the configuration in the instruction, the tester will actually apply the corresponding value.