Disclosure of Invention
Objects of the invention
The invention aims to provide a relay protection device based on a domestic chip and a function configuration method thereof, which reduce the risk of artificial debugging errors caused by various requirements in the prior art.
(II) technical scheme
In order to solve the above problems, a first aspect of the present invention provides a method for configuring functions of a relay protection device based on a home-made chip, including:
acquiring configuration files of each application function, wherein each configuration file comprises a standardized name and corresponding configuration information, and the configuration information comprises a configuration file real-time check code;
during initialization, comparing the real-time check code of the configuration file with a stored check code according to a standardized name;
and when the real-time check code of the configuration file is inconsistent with the stored check code, further analyzing the configuration information, and reconfiguring the application function according to the analysis result.
Specifically, the configuration information containing the configuration file real-time check code is obtained by the following method:
extracting effective information in the initial configuration information according to the key field and the preset extraction length, and converting the extracted effective information into a binary code;
and performing CRC on the converted binary code, and placing the generated CRC as a configuration file real-time check code at a preset position of the configuration file to form configuration information containing the configuration file real-time check code.
Specifically, the comparing the configuration file real-time check code with the stored check code includes:
and extracting the configuration file real-time check code from the key field, and comparing the extracted configuration file real-time check code with the stored check code.
Further, after reconfiguring the application function according to the parsing result, the method further includes:
and storing the configuration file real-time check code to update the stored check code.
The function configuration method further includes:
when the real-time check code of the configuration file is consistent with the stored check code, the corresponding configuration information is not further analyzed, the corresponding configuration file is skipped, and the original function configuration is maintained.
In a second aspect of the present application, a functional configuration of a relay protection device based on a localization chip is provided, including:
the system comprises an acquisition module, a configuration module and a configuration module, wherein the acquisition module is used for acquiring configuration files of each application function, and each configuration file comprises a standardized name and corresponding configuration information;
the comparison module is used for comparing the real-time check code of the configuration file with the stored check code according to the standardized name during initialization;
and the configuration module is used for further analyzing the configuration information when the real-time check code of the configuration file is inconsistent with the stored check code, and reconfiguring the application function according to the analysis result.
Specifically, the configuration information containing the configuration file real-time check code is obtained by the following method:
extracting effective information in the initial configuration information according to the key field and the preset extraction length, and converting the extracted effective information into a binary code; performing CRC on the converted binary code, and placing the generated CRC as a configuration file real-time check code at a preset position of the configuration file to form configuration information containing the configuration file real-time check code;
further, the comparison module is configured to extract the configuration file real-time check code from the key field, and compare the extracted configuration file real-time check code with the stored check code.
Further, the function configuration device further includes:
a storage module to: and after the application function is reconfigured according to the analysis result, the real-time check code of the configuration file is stored so as to update the stored check code.
In a third aspect of the present application, a relay protection device based on a home-made chip is provided, where a Loongson LS2K1000 is used as a main controller, and the main controller is configured to execute any one of the function configuration methods.
Furthermore, the relay protection device adopts a double-denier microelectronic FMK50T4 chip as an FPGA, an AD7606BSTZ chip to realize synchronous double-AD oversampling, and GD32F450 to realize the function of a Cortex-M4 processor.
(III) advantageous effects
The technical scheme of the invention has the following beneficial technical effects:
according to the relay protection device based on the domestic chip and the function configuration method thereof, the CRC check is carried out on the configuration file with the standardized name to obtain the implementation CRC check code, the real-time check code is compared with the check code of the standardized name memorized in the device according to the standardized name, when the two check codes are not consistent, the configuration file is determined to be different from the memory configuration, the configuration file is automatically analyzed to reconfigure the application function, and the risk of artificial debugging errors caused by various requirements in the prior art is reduced.
The invention has simple operation and flexible configuration, can reliably reduce the workload of equipment operation and maintenance, improves the operation and maintenance efficiency, and provides powerful guarantee for the safe and stable operation of a power grid
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
Referring to fig. 2, the present invention provides a function configuration method for providing a relay protection device based on a home-made chip, including:
step 101: acquiring configuration files of each application function, wherein each configuration file comprises a standardized name and corresponding configuration information;
specifically, in the embodiment of the present invention, configuration files of each application function are compiled by a programmer according to a standardized naming rule and format, and are downloaded to a relay protection device after file verification, different configuration files describe different static information representing configurations of different functions, and the static information may include, for example, device menu display items, device firewall configurations, device debugging login user names and passwords, the number of clients allowed to be connected by a device, data modeling of device and background communication, IP, gateways, configuration information of each board card of the device, and the like.
Step 102: during initialization, comparing the real-time check code of the configuration file with a stored check code according to a standardized name;
step 103: and when the real-time check code of the configuration file is inconsistent with the stored check code, further analyzing the configuration information, and reconfiguring the application function according to the analysis result.
According to the relay protection device based on the domestic chip and the function configuration method and device thereof, the real-time check code is compared with the check code of the standardized name memorized in the device, when the real-time check code is inconsistent with the check code of the standardized name memorized in the device, the configuration file is determined to be different from the memorized configuration, the configuration file is automatically analyzed to reconfigure the application function, and the risk of artificial debugging errors caused by various requirements in the prior art is reduced.
The method is simple to operate and flexible to configure, can reliably reduce the workload of equipment operation and maintenance, improves the operation and maintenance efficiency, and provides powerful guarantee for safe and stable operation of the power grid.
Specifically, the configuration information containing the configuration file real-time check code is obtained by the following method:
step a: extracting effective information in the initial configuration information according to the key field and the preset extraction length, and converting the extracted effective information into a binary code;
for example, the verification tool retrieves all key fields in the configuration file, and reads the decimal number behind all the key fields as the extraction length of the valid information, for example, if the decimal number is 100, the extraction length is 100 bits behind the key fields; and the checking tool sequentially extracts effective information according to the extraction length and converts the effective information into a binary code file.
Step b: and performing CRC on the converted binary code, and placing the generated CRC as a configuration file real-time check code at a preset position of the configuration file to form configuration information containing the configuration file real-time check code. The CRC check code is preferably placed at the end of the configuration file in this application.
The verification method places the file verification code in the corresponding configuration file for the device to inquire after being electrified. The check code is used as the unique identification code of the configuration file, so that the error probability of downloading the configuration file is reduced; in addition, the device is initially electrified only by extracting the check code in the configuration file and comparing the check code with the memory check code, if the check code is consistent with the memory check code, the file is skipped over, the configuration file does not need to be analyzed, and the initialization rate of the device is greatly improved.
Specifically, the comparing the configuration file real-time check code with the stored check code includes:
and extracting the configuration file real-time check code from the key field, and comparing the extracted configuration file real-time check code with the stored check code.
Further, after reconfiguring the application function according to the parsing result, the method further includes:
and storing the configuration file real-time check code to update the stored check code.
Further, the function configuration method further includes:
when the real-time check code of the configuration file is consistent with the stored check code, the corresponding configuration information is not further analyzed, the corresponding configuration file is skipped, and the original function configuration is maintained.
In a specific embodiment, a method for configuring functions of a relay protection device based on a home-made chip includes:
1) the method is executed by a relay protection device with configurable functions based on a home-made chip, the relay protection device adopts the nationwide chips, the relay protection device comprises a Loongson LS2K1000 serving as a main control CPU, an FPGA adopting a double-denier microelectronic FMK50T4 chip, an AD7606BSTZ chip synchronous double-AD oversampling technology, a GD32F450 high-performance Cortex-M4 chip and the like, device plug-ins are connected by a CAN bus, and an intelligent man-machine interface operates independently. The new architecture realizes the free combination of device plug-ins, enhances the universality of a human-computer interface, and has a nationwide chip design concept with high precision and high reliability.
2) The function configuration method of the relay protection device with configurable functions based on the home-made chip comprises the steps of defining the compiling rule of each configuration file, namely an ini file, before program design, wherein different configuration files describe different static information and configure different application functions;
in other embodiments, the configuration file may also be in a format of txt, xml, or the like, which is not limited in the present invention.
3) Before programming, a special i/ni FILE checking tool is provided, and the tool can analyze static information described in the i/ni FILE, check the static information, generate a FILE check CODE CRC _ CODE, and place the check CODE in a key field (FILE _ CRC) of the configuration FILE i/ni FILE to form a configuration FILE containing a configuration FILE real-time check CODE;
4) in the device power-on initialization stage, reading key fields [ FILE _ CRC ] in each configuration FILE one by one to obtain a FILE check CODE CRC _ CODE;
5) comparing the read file check CODE CRC _ CODE with a memorized file check CODE F _ CRC _ CODE by the program, if the CRC _ CODE is equal to F _ CRC _ CODE, not performing depth analysis on the file, skipping the file by the process, and maintaining the original function configuration by the program; if CRC _ CODE is not equal to F _ CRC _ CODE, then the static information in the file needs to be further analyzed, and the program reconfigures the application function according to the content described in the configuration file;
6) and after the configuration file is analyzed, updating the memorized file check CODE F _ CRC _ CODE.
The invention also provides a function configuration device of the relay protection device based on the home-made chip, which comprises the following components:
the system comprises an acquisition module, a configuration module and a configuration module, wherein the acquisition module is used for acquiring configuration files of each application function, and each configuration file comprises a standardized name and corresponding configuration information;
the comparison module is used for comparing the real-time check code of the configuration file with the stored check code according to the standardized name during initialization;
and the configuration module is used for further analyzing the configuration information when the real-time check code of the configuration file is inconsistent with the stored check code, and reconfiguring the application function according to the analysis result.
Specifically, the configuration information containing the configuration file real-time check code is obtained by the following method:
extracting effective information in the initial configuration information according to the key field and the preset extraction length, and converting the extracted effective information into a binary code; and performing CRC on the converted binary code, and storing the generated CRC as a configuration file real-time check code in the key field to form configuration information containing the configuration file real-time check code.
Further, the comparison module is configured to extract the configuration file real-time check code from the key field, and compare the extracted configuration file real-time check code with the stored check code.
Further, the function configuration device further includes:
a storage module to: and after the application function is reconfigured according to the analysis result, the real-time check code of the configuration file is stored so as to update the stored check code.
The embodiments of the function configuration device and the method of the present invention correspond to each other, and the detailed description and effects refer to the method embodiments, which are not repeated herein.
The invention also provides a relay protection device based on the home-made chip, which adopts the Loongson LS2K1000 as a main controller, and the main controller is used for executing any one of the function configuration methods.
Furthermore, the relay protection device adopts a double-denier microelectronic FMK50T4 chip as an FPGA, an AD7606BSTZ chip to realize synchronous double-AD oversampling, and GD32F450 to realize the function of a Cortex-M4 processor.
The embodiments of the relay protection device and the embodiments of the method of the present invention correspond to each other, and specific description and effects refer to the embodiments of the method, which are not described herein again.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.