A method and printer for intelligently identifying printed data information of power grid relay protection
By detecting and adjusting the printing character data output by the power grid relay protection device, the problem of unable to identify and print data of the printers of different manufacturers can be solved, and intelligent identification and normal printing of different manufacturers' data are realized.
Patent Information
- Application Number
- CN202110483739.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-04-30
AI Technical Summary
The printing data information of the existing power grid relay protection device cannot be intelligently identified, resulting in printers from different manufacturers being unable to identify and print data normally.
By receiving the printing character data output by the output of the successive power grid relay protection device, to detect whether to carry the scheduled printing logo, and combine the width value of the printer's maximum printing character, identify and adjust the data to ensure that the data can be compiled normally and automatically replaced.
The intelligent recognition and normal printing of the printing data information output of the relay protection device output of different manufacturers, ensuring the accuracy and consistency of printing data.
Smart Images

Figure CN113190188B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of relay protection, and in particular to an intelligent identification method for power grid relay protection printed data information and a printer. Background Art
[0002] At present, the data information of protection devices of various power grid companies is first printed on paper manually on site, and then summarized and reported to relevant management personnel.
[0003] However, the existing method has shortcomings, and the shortcomings are: because the relay protection devices used by the power grid company are from different manufacturers, the printers connected to some relay protection devices cannot intelligently identify the print data information, resulting in print data errors. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present invention is to provide a method and a printer for intelligently identifying printed data information of power grid relay protection, which can intelligently identify the printed data information output by relay protection devices of different manufacturers and ensure that the printed data is normal.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for intelligently identifying printed data information of a power grid relay protection, the method comprising the following steps:
[0006] S1, receiving printing character data output by the target power grid relay protection device, wherein the printing character data is compiled from the fixed value protection data generated by the target power grid relay protection device;
[0007] S2, detecting whether the printing character data carries a predetermined printing line feed mark;
[0008] S3, in combination with a preset maximum print character width value, identifying the print character data that does not carry the predetermined print line feed mark line by line, and after adding or replacing the predetermined print line feed mark at the end of all identified lines, decompiling; or identifying the print character data that carries the predetermined print line feed mark line by line and directly decompiling;
[0009] S4. Start printing so that the fixed value protection data obtained by decompilation can be printed in automatic line breaks.
[0010] Wherein, the step S3 specifically includes:
[0011] If it is detected that the printing character data does not carry the predetermined printing line feed identifier, the printing character data is identified line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are no other printing line feed identifiers different from the predetermined printing line feed identifier at the end of all identified lines, the predetermined printing line feed identifier is added to the end of all identified lines, and the printing character data with the predetermined printing line feed identifier added is further decompiled.
[0012] Wherein, the step S3 further includes:
[0013] If it is detected that the printing character data does not carry the predetermined printing line break identifier, the printing character data is identified line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that any other printing line break identifier different from the predetermined printing line break identifier exists at the end of all identified lines, the printing line break identifiers existing at the end of all identified lines are replaced with the predetermined printing line break identifier, and the printing character data replaced with the predetermined printing line break identifier is further decompiled.
[0014] Wherein, the step S3 further includes:
[0015] If it is detected that the printing character data already carries the predetermined printing line feed mark, the printing character data is identified line by line and directly decompiled using the preset maximum printing character width value as the basic length unit.
[0016] Before step S1, the method further comprises the following steps:
[0017] The predetermined printing line feed identifier and the maximum printing character width value are pre-stored.
[0018] The printing character data is a string expressed in hexadecimal.
[0019] An embodiment of the present invention further provides a printer, comprising:
[0020] A receiving unit, used for receiving printing character data outputted by the target power grid relay protection device, wherein the printing character data is compiled from the fixed value protection data generated by the target power grid relay protection device;
[0021] A detection unit, used for detecting whether the printing character data carries a predetermined printing line feed mark;
[0022] A compiling unit, for identifying the printing character data that does not carry the predetermined printing line feed mark line by line in combination with a preset maximum printing character width value, and performing decompilation after the tails of all identified lines are added or replaced with the predetermined printing line feed mark; or identifying the printing character data that carries the predetermined printing line feed mark line by line and directly performing decompilation;
[0023] The printing unit is used to start printing so that the fixed value protection data obtained by decompilation can be automatically printed in line breaks.
[0024] Wherein, the compilation unit includes:
[0025] The first compiling module is used for, if it is detected that the printing character data does not carry the predetermined printing line feed mark, identifying the printing character data line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are no other printing line feed marks different from the predetermined printing line feed mark at the end of all identified lines, adding the predetermined printing line feed mark to the end of all identified lines, and further decompiling the printing character data with the predetermined printing line feed mark added.
[0026] Wherein, the compilation unit further includes:
[0027] The second compilation module is used for, if it is detected that the printing character data does not carry the predetermined printing line feed identifier, identifying the printing character data line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are any other printing line feed identifiers different from the predetermined printing line feed identifier at the end of all identified lines, replacing the printing line feed identifiers at the end of all identified lines with the predetermined printing line feed identifier, and further decompiling the printing character data replaced with the predetermined printing line feed identifier.
[0028] Wherein, the compilation unit further includes:
[0029] The third compiling module is used for, if it is detected that the printing character data already carries the predetermined printing line feed mark, identifying the printing character data line by line and directly decompiling it with the preset maximum printing character width value as the basic length unit.
[0030] Implementing the embodiments of the present invention has the following beneficial effects:
[0031] The present invention is based on the fact that different power grid relay protection devices output the same protection fixed value data, detects whether the printed character data after detection compilation carries a predetermined printing line feed mark, and adjusts the printed character data line by line in combination with the maximum printing character width value of the printer itself, so that the fixed value protection data obtained by decompilation can all be automatically printed in line feeds, thereby being able to intelligently identify the printed data information output by relay protection devices of different manufacturers to ensure that the printed data is normal. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, without paying creative labor, other drawings obtained based on these drawings still belong to the scope of the present invention.
[0033] Figure 1 A flowchart of a method for intelligently identifying printed data information of a power grid relay protection provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of the structure of a printer provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings.
[0036] like Figure 1 As shown in the figure, a method for intelligently identifying power grid relay protection printing data information is provided in an embodiment of the present invention, which is used on a printer connected to a target power grid relay protection device. The method includes the following specific steps:
[0037] Step S1, receiving printing character data output by a target power grid relay protection device, wherein the printing character data is compiled from fixed value protection data generated by the target power grid relay protection device;
[0038] The specific process is that the fixed value protection data generated by the target power grid relay protection device is usually composed of binary 0 and 1. However, in order to reduce the length of the character data and facilitate storage and processing, the character data is converted from binary to a hexadecimal string.
[0039] At this time, during the printing process of the setting list, the target power grid relay protection device converts the setting protection data to be printed into printing character data, and sends it to the printer through the RS232 serial port in a one-way data transmission mode.
[0040] It should be noted that the fixed value protection data output by relay protection devices of different manufacturers, different models and different versions must be the same. For example, in the national standard, the corresponding code for the word "relay" is BC CC, the corresponding code for the word "electricity" is B5 E7, the corresponding code for the word "protection" is B1 A3, and the corresponding code for the word "protection" is BB A4. Therefore, the collected and saved BC CC B5 E7 B1 A3BB A4 will be identified as the four Chinese characters "relay protection". Similarly, in the national standard, it can be found that: phase: CFE0, interval: BCE4, distance: BEE0, distance: C0EB, III: A2F3, section: B6CE, fixed: B6A8, value: D6B5. Therefore, the collected and saved CF E0 BC E4 BE E0C0 EB A2 F3 B6 CE B6 A8 D6 B5 will be identified as "phase-to-phase distance III section fixed value".
[0041] Step S2, detecting whether the print character data carries a predetermined print line feed mark;
[0042] The specific process is that the printer pre-stores a predetermined print line feed mark, and can automatically identify its own maximum print width (that is, the maximum print character width value, which can be represented by the total number of characters) in advance, and identifies whether the print character data carries the predetermined print line feed mark by scanning each character one by one.
[0043] It should be noted that all printers equipped with relay protection devices use the ESC instruction set, and this instruction set complies with the national printer industry standards.
[0044] Step S3, in combination with a preset maximum print character width value, identifying the print character data that does not carry the predetermined print line feed mark line by line, and after adding or replacing the predetermined print line feed mark at the end of all identified lines, decompiling; or identifying the print character data that carries the predetermined print line feed mark line by line and directly decompiling;
[0045] The specific process is to check whether the print character data carries the predetermined print line feed mark, which is divided into the following three cases:
[0046] (1) The line break mark is not included and is empty:
[0047] If it is detected that the printing character data does not carry a predetermined printing line break mark, the printing character data is identified line by line with a preset maximum printing character width value as the basic length unit, and when it is determined that there are no other printing line break marks different from the predetermined printing line break mark at the end of all identified lines, the predetermined printing line break mark is added to the end of all identified lines, and the printing character data with the predetermined printing line break mark added is further decompiled to obtain the fixed value protection data generated by the target power grid relay protection device.
[0048] (2) Carrying other printing line break marks but not carrying the predetermined printing line break marks:
[0049] If it is detected that the printing character data does not carry a predetermined printing line break mark, the printing character data is identified line by line with a preset maximum printing character width value as the basic length unit, and when it is determined that there are any other printing line break marks different from the predetermined printing line break marks at the end of all identified lines, the printing line break marks at the end of all identified lines are replaced with the predetermined printing line break marks, and the printing character data replaced with the predetermined printing line break marks are further decompiled to obtain the fixed value protection data generated by the target power grid relay protection device.
[0050] (3) Carrying a predetermined printing line break mark:
[0051] If it is detected that the print character data already carries a predetermined print line break mark, the print character data is identified line by line and directly decompiled based on the preset maximum print character width value as the basic length unit.
[0052] Step S4, start printing, so that the fixed value protection data obtained by decompilation can be automatically printed in line breaks.
[0053] The specific process is that the decompiled fixed value protection data has a predetermined print line break mark, so that the printer can automatically print in line breaks, thereby intelligently identifying the print data information output by relay protection devices of different manufacturers to ensure that the print data is normal.
[0054] In one embodiment, all printers equipped with relay protection devices use the ESC instruction set, which is the industrial standard for printers. Taking the relay protection devices of the two companies "NARI" and "SIFANG" as examples, it is explained how the same printer can complete automatic printing recognition.
[0055] Output content: NSR-201RDN high voltage line protection device - protection setting
[0056] In the relay protection device of NARI, the results are:
[0057] B8 DF D1 B9 CF DF C2 B7 B1 A3 BB A4 D7 B0 D6 C3 A9 A5 A9 A5 A9 A5 B1A3 BB A4 B6 A8 D6 B5 0A 0D C3 A9 A5 A9
[0058] In the relay protection device of "Sifang" company, the results obtained are:
[0059] B8 DF D1 B9 CF DF C2 B7 B1 A3 BB A4 D7 B0 D6 C3 A9 A5 A9 A5 A9 A5 B1A3 BB A4 B6 A8 D6 B5
[0060] By comparison, it can be seen that the print data output by "Nanrui" company has an additional print line feed mark 0A 0D, but the print data output by "Sifang" company does not have the print line feed mark 0A 0D.
[0061] According to the analysis results, when the printer identification program processes the print data, if there is a predetermined print line feed mark 0A 0D, it is a product of "Nanrui" company and no further processing is required; if there is no 0A 0D, it is a product of "Sifang" company and the maximum print width judgment is required. When the maximum print width value is reached, the printer identification program needs to add the print line feed mark 0A 0D line by line in the print data to ensure correct line feed.
[0062] like Figure 2 As shown in the figure, a printer is provided in an embodiment of the present invention, including:
[0063] The receiving unit 110 is used to receive the printing character data output by the target power grid relay protection device, wherein the printing character data is compiled from the fixed value protection data generated by the target power grid relay protection device;
[0064] The detection unit 120 is used to detect whether the printing character data carries a predetermined printing line feed mark;
[0065] The compiling unit 130 is used to identify the printing character data that does not carry the predetermined printing line feed mark line by line in combination with the preset maximum printing character width value, and perform decompilation after the tails of all identified lines are added or replaced with the predetermined printing line feed mark; or identify the printing character data that carries the predetermined printing line feed mark line by line and directly perform decompilation;
[0066] The printing unit 140 is used to start printing so that the fixed value protection data obtained by decompilation can be automatically printed in line breaks.
[0067] The compiling unit 130 includes:
[0068] The first compiling module is used for, if it is detected that the printing character data does not carry the predetermined printing line feed mark, identifying the printing character data line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are no other printing line feed marks different from the predetermined printing line feed mark at the end of all identified lines, adding the predetermined printing line feed mark to the end of all identified lines, and further decompiling the printing character data with the predetermined printing line feed mark added.
[0069] The compiling unit 130 further includes:
[0070] The second compilation module is used for, if it is detected that the printing character data does not carry the predetermined printing line feed identifier, identifying the printing character data line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are any other printing line feed identifiers different from the predetermined printing line feed identifier at the end of all identified lines, replacing the printing line feed identifiers at the end of all identified lines with the predetermined printing line feed identifier, and further decompiling the printing character data replaced with the predetermined printing line feed identifier.
[0071] The compiling unit 130 further includes:
[0072] The third compiling module is used for, if it is detected that the printing character data already carries the predetermined printing line feed mark, identifying the printing character data line by line and directly decompiling it with the preset maximum printing character width value as the basic length unit.
[0073] Implementing the embodiments of the present invention has the following beneficial effects:
[0074] The present invention is based on the fact that different power grid relay protection devices output the same protection fixed value data, detects whether the printed character data after detection compilation carries a predetermined printing line feed mark, and adjusts the printed character data line by line in combination with the maximum printing character width value of the printer itself, so that the fixed value protection data obtained by decompilation can all be automatically printed in line feeds, thereby being able to intelligently identify the printed data information output by relay protection devices of different manufacturers to ensure that the printed data is normal.
[0075] It is worth noting that in the above-mentioned device embodiment, the various device units included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the various functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0076] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, disk, CD-ROM, etc.
[0077] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for intelligently identifying printed data information of power grid relay protection, characterized in that: The method comprises the following steps: S1, receiving printing character data output by the target power grid relay protection device, wherein the printing character data is compiled from the fixed value protection data generated by the target power grid relay protection device; S2, detecting whether the printing character data carries a predetermined printing line feed mark; S3, in combination with a preset maximum print character width value, identifying the print character data that does not carry the predetermined print line feed mark line by line, and after adding or replacing the predetermined print line feed mark at the end of all identified lines, decompiling; or identifying the print character data that carries the predetermined print line feed mark line by line and directly decompiling; S4, start printing, so that the fixed value protection data obtained by decompilation can be automatically printed in line breaks; Wherein, the step S3 further includes: If it is detected that the printing character data does not carry the predetermined printing line break identifier, the printing character data is identified line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that any other printing line break identifier different from the predetermined printing line break identifier exists at the end of all identified lines, the printing line break identifiers existing at the end of all identified lines are replaced with the predetermined printing line break identifier, and the printing character data replaced with the predetermined printing line break identifier is further decompiled.
2. The method for intelligently identifying printed data information of power grid relay protection according to claim 1, characterized in that: The step S3 specifically includes: If it is detected that the printing character data does not carry the predetermined printing line feed identifier, the printing character data is identified line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are no other printing line feed identifiers different from the predetermined printing line feed identifier at the end of all identified lines, the predetermined printing line feed identifier is added to the end of all identified lines, and the printing character data with the predetermined printing line feed identifier added is further decompiled.
3. The method for intelligently identifying printed data information of power grid relay protection according to claim 1, characterized in that: The step S3 further comprises: If it is detected that the printing character data already carries the predetermined printing line feed mark, the printing character data is identified line by line and directly decompiled using the preset maximum printing character width value as the basic length unit.
4. The method for intelligently identifying printed data information of power grid relay protection according to claim 1, characterized in that: Before step S1, the method further comprises the following steps: The predetermined printing line feed identifier and the maximum printing character width value are pre-stored.
5. The method for intelligently identifying printed data information of power grid relay protection according to claim 1, characterized in that: The printing character data is a string expressed in hexadecimal.
6. A printer, characterized in that: include: A receiving unit, used for receiving printing character data outputted by the target power grid relay protection device, wherein the printing character data is compiled from the fixed value protection data generated by the target power grid relay protection device; A detection unit, used for detecting whether the printing character data carries a predetermined printing line feed mark; A compiling unit, for identifying the printing character data that does not carry the predetermined printing line feed mark line by line in combination with a preset maximum printing character width value, and performing decompilation after the tails of all identified lines are added or replaced with the predetermined printing line feed mark; or identifying the printing character data that carries the predetermined printing line feed mark line by line and directly performing decompilation; The printing unit is used to start printing, so that the fixed value protection data obtained by decompilation can be automatically printed in line breaks; Wherein, the compilation unit further includes: The second compilation module is used for, if it is detected that the printing character data does not carry the predetermined printing line feed identifier, identifying the printing character data line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are any other printing line feed identifiers different from the predetermined printing line feed identifier at the end of all identified lines, replacing the printing line feed identifiers at the end of all identified lines with the predetermined printing line feed identifier, and further decompiling the printing character data replaced with the predetermined printing line feed identifier.
7. The printer according to claim 6, characterized in that: The compilation unit comprises: The first compiling module is used for, if it is detected that the printing character data does not carry the predetermined printing line feed mark, identifying the printing character data line by line with the preset maximum printing character width value as the basic length unit, and when it is determined that there are no other printing line feed marks different from the predetermined printing line feed mark at the end of all identified lines, adding the predetermined printing line feed mark to the end of all identified lines, and further decompiling the printing character data with the predetermined printing line feed mark added.
8. The printer according to claim 6, wherein: The compilation unit also includes: The third compiling module is used for, if it is detected that the printing character data already carries the predetermined printing line feed mark, identifying the printing character data line by line and directly decompiling it with the preset maximum printing character width value as the basic length unit.
Citation Information
Patent Citations
Printer
JP1990039962A