Method and device for automatic checking of protection device settings

By automatically comparing and printing serial data from the monitoring protection device and Bluetooth documents, the problem of error detection and omission during the verification and printing process of the fixed value sheet is solved, thus improving the accuracy and efficiency of the fixed value verification.

CN122432684APending Publication Date: 2026-07-21STATE GRID HEBEI ELECTRIC POWER CO LTD BAODING POWER SUPPLY BRANCH CO +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID HEBEI ELECTRIC POWER CO LTD BAODING POWER SUPPLY BRANCH CO
Filing Date
2026-03-12
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In the operation and maintenance of substations and the commissioning of relay protection, errors and omissions are prone to occur during the verification and printing of setting sheets. Furthermore, the lack of data bridges makes manual verification time-consuming, labor-intensive, and inaccurate.

Method used

By monitoring the serial data of the protection device's hardware interface and the Bluetooth document of the Bluetooth module, layered parsing and document parsing are performed, the value sheet is automatically compared, and the printer is triggered to print when the verification results are consistent, thus realizing automatic comparison and linkage printing of value data.

Benefits of technology

It effectively avoids the problems of false detection and missed detection in manual verification, improves the accuracy and efficiency of value verification, and breaks down the data barriers between device operation data, electronic value sheets and paper archives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432684A_ABST
    Figure CN122432684A_ABST
Patent Text Reader

Abstract

The application provides a kind of protection device fixed value automatic checking method and device, listen to the serial data of hardware interface of protection device and the bluetooth document of bluetooth module;The first fixed value sheet is obtained by hierarchical analysis to serial data;The second fixed value sheet is obtained by document analysis to bluetooth document;The checking result is obtained by comparing the first fixed value sheet and the second fixed value sheet;If the checking result is consistent, trigger the printing instruction to instruct the printer to print the checked fixed value sheet and display the checked fixed value sheet on the screen.The application realizes the automatic comparison and linkage printing of fixed value data by listening and automatically analyzing the serial data and bluetooth document of protection device, breaks through the data barrier between device running data, electronic fixed value sheet and paper archive, effectively avoids the false detection and missed detection problems that may occur during manual checking, significantly improves the accuracy and efficiency of fixed value checking work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system relay protection technology, and in particular to a method and apparatus for automatic verification of protection device settings. Background Technology

[0002] In substation operation and maintenance and relay protection commissioning, the verification and printing of setting sheets is a frequent task requiring extremely high accuracy. The settings are like the "action thresholds" of the protection devices; their correctness directly affects whether a power grid fault can be accurately and quickly isolated, preventing the accident from escalating. The traditional process typically involves technicians reading the setting data from the protection device, manually comparing it item by item with the setting sheet issued by the dispatching department, and only manually operating a dot matrix printer to output a paper archive after confirming its accuracy.

[0003] The traditional method involves technician A reading setpoint data from a protection device and communicating this data to technician B via dialogue. Technician B then compares the heard setpoint data with a pre-printed setpoint sheet. This process is time-consuming and labor-intensive, and in complex substation environments, manually verifying hundreds of parameters is highly prone to errors and omissions. Furthermore, there is a lack of data bridges between the setpoints during device operation, the electronic setpoint sheets issued by dispatch, and the final printed and archived paper setpoint sheets. Data requires multiple manual transcriptions or judgments, creating a break in the "equipment-data-printing" process. Summary of the Invention

[0004] This invention provides a method and apparatus for automatic verification of protection device settings, which solves the problem that false detections and missed detections are very likely to occur during the verification and printing process of protection device settings in the prior art.

[0005] This invention provides an automatic verification method for protection device settings, comprising: The serial data of the hardware interface of the monitoring protection device and the Bluetooth documentation of the Bluetooth module; The serial data is parsed in layers to obtain the first set of values; The Bluetooth documentation is parsed to obtain the second set of values. The first and second value sheets are compared to obtain the verification results; If the verification results are consistent, a print command is triggered to instruct the printer to print the verified value sheet and display it on the screen.

[0006] In one possible implementation, the serial data is parsed in layers to obtain a first set of values, including: Perform frame structure verification on the serial data to determine valid serial data frames; Initialize the parsing environment and cyclically parse the intra-frame data fields of valid serial data frames to obtain the first set value.

[0007] In one possible implementation, the parsing environment is initialized and the intra-frame data fields of valid serial data frames are parsed cyclically, including: While constructing the structured data storage carrier, a position pointer variable is set, and the initial value is set to a fixed offset value so that the pointer points to the starting byte position of the valid data field within the frame, thus completing the initialization of the parsing environment; Read the value of the byte currently pointed to by the position pointer, and use it as the data type identifier of the field to be parsed; Offset the position pointer forward and read the byte value at that offset position as an identifier of the data length of the field to be parsed; Based on the data length identifier, a continuous byte sequence of the corresponding byte length is extracted from the current offset position of the position pointer and used as the original numerical content of the field to be parsed. Based on the data type identifier, the decoding algorithm matching the identifier is invoked to convert the original numerical content into structured data with business semantics; The converted structured data is stored in a structured data storage medium according to the preset key names; Offset the position pointer forward by the total length, so that the pointer points to the starting byte position of the next field to be parsed; Determine if the current pointer is within a valid data range. If it is outside the valid data range, terminate the loop. If it is within the valid data range, jump to the step of reading the value of the byte currently pointed to by the pointer, which serves as the data type identifier for the field to be parsed.

[0008] In one possible implementation, the Bluetooth documentation is parsed to obtain a second specification sheet, including: Extract the file signature from the Bluetooth document to obtain the file header signature; The format type identifier is determined based on the file header signature and the document type detection function; The Bluetooth document is parsed using the document parser corresponding to the format type identifier to obtain the value sheet; The second set of values ​​is obtained by processing the setpoint sheet using the data standardization function.

[0009] In one possible implementation, the first and second value sheets are compared to obtain the verification result, including: Call the key field validation function to perform preliminary validation on the core identifier fields in the first and second value sheets; Call the field extraction function to extract the sets of fields to be compared from the first and second value sheets, respectively, as the sets of fields to be compared; Iterate through each field in the set of fields to be compared and determine the differences. If there are no differences in any fields, the verification result is consistent; if there are differences in any fields, the verification result is inconsistent.

[0010] In one possible implementation, a field extraction function is called to extract the sets of fields to be compared from the first and second value sheets, respectively, as the comparison field set, including: Iterate through all structured field items in the first set of values ​​and filter them to form a first field subset; simultaneously iterate through all structured field items in the second set of values ​​and filter them to form a second field subset. The first field subset and the second field subset are merged, and the merged field set is deduplicated to form the field set to be compared. Perform naming standardization on the set of fields to be compared.

[0011] In one possible implementation, each field in the set of fields to be compared is traversed, and differences are determined, including: According to the preset traversal rules, read the individual fields in the set of fields to be compared in sequence, and extract the field value corresponding to the current comparison field from the first set value sheet and the second set value sheet respectively, and record them as the first field value and the second field value; if there is no corresponding value for the current comparison field in either set value sheet, mark its field value as null; Perform null value validation on the extracted first and second field values; If the value of the first field is empty and the value of the second field is not empty, the difference is determined to be that the first fixed value is missing the value of that field, and the core information of the difference is recorded. If the value of the first field is not empty and the value of the second field is empty, the difference is determined to be that the second fixed value is missing the value of that field, and the core information of the difference is recorded; If both the first and second field values ​​are empty, it is determined that neither type of fixed value sheet has the value of that field, and no difference is generated. If both the first and second field values ​​are non-empty, call the equality judgment function, taking the first and second field values ​​as input parameters, and perform field value consistency verification. If the equality judgment function returns a consistent result, it is determined that the field values ​​match and no difference is generated; If the equality judgment function returns inconsistent results, the difference is determined to be a mismatch in field values, and the core information of the difference is recorded. After completing the difference determination and difference information recording for the current comparison field, read the next field item in the field set to be compared, and continue until all field items in the field set to be compared have completed the difference determination, then terminate the traversal process.

[0012] In one possible implementation, the method further includes: If the verification results are inconsistent, an error value will be displayed on the screen, an audio-visual prompt will be given, and the printer will be locked.

[0013] In one possible implementation, prior to the serial data from the hardware interface of the monitoring protection device and the Bluetooth documentation from the Bluetooth module, the method further includes: The hardware interface of the protection device, Bluetooth module, and printer perform hardware and software initialization.

[0014] A second aspect of the present invention provides an automatic verification device for protection device settings, comprising: The data monitoring module is used to monitor the serial data of the hardware interface of the protection device and the Bluetooth documentation of the Bluetooth module. The first parsing module is used to perform layered parsing of serial data to obtain the first set of values; The second parsing module is used to parse the Bluetooth document to obtain the second value sheet; The verification module is used to compare the first and second value sheets to obtain the verification result; The printing module is used to trigger a printing command if the verification results are consistent, instructing the printer to print the verified value sheet and display it on the screen.

[0015] Compared to traditional technologies, this invention provides a method and apparatus for automatically verifying the settings of a protection device. The method involves monitoring the serial data of the protection device's hardware interface and the Bluetooth documentation of the Bluetooth module; performing layered parsing on the serial data to obtain a first setting sheet; parsing the Bluetooth documentation to obtain a second setting sheet; comparing the first and second setting sheets to obtain a verification result; and if the verification result is consistent, triggering a print command to instruct the printer to print the verified setting sheet and display it on the screen. This invention achieves automatic comparison and linked printing of setting data by monitoring and automatically parsing the serial data and Bluetooth documentation of the protection device. It breaks down the data barriers between device operating data, electronic setting sheets, and paper archives, effectively avoiding the errors and omissions that easily occur with manual verification, and significantly improving the accuracy and efficiency of setting verification. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the implementation of the automatic verification method for protection device settings provided in this embodiment of the invention. Figure 2 This is a flowchart illustrating the implementation of an automatic verification method for protection device settings provided in another embodiment of the present invention. Detailed Implementation

[0017] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0018] Figure 1This is a flowchart illustrating the implementation of the automatic setting verification method for the protection device provided in this embodiment of the invention. Figure 1 As shown, the method includes: S110, serial data of the hardware interface of the monitoring protection device and Bluetooth documentation of the Bluetooth module; S120, perform layered parsing of the serial data to obtain the first setpoint; S130: Parse the Bluetooth document to obtain the second setting sheet; S140, compare the first and second value sheets to obtain the verification results; S150, if the verification result is consistent, trigger the print command to instruct the printer to print the verified value sheet and display the verified value sheet on the screen.

[0019] In this embodiment of the invention, fixed-value data is received via a dual-channel data source (serial communication and Bluetooth), and after intelligent comparison, it is output to the pinhole printer. The entire system adopts a modular design to ensure the independence and maintainability of each functional unit. The main control algorithm adopts a multi-stage pipeline design, divided into four stages: initialization, data reception, intelligent comparison, result processing, and output.

[0020] The initialization phase configures all hardware interfaces and software components, including the protection device hardware interface, Bluetooth module, and printer control components. The data reception phase employs parallel task processing, simultaneously monitoring both serial port and Bluetooth data sources. After reading data from both sources, the data is parsed separately. The intelligent comparison phase performs multi-dimensional analysis on the two data sources. The result processing phase adopts different processing strategies based on whether the comparison results are consistent, including automatic printing and detailed display of differences. The entire algorithm uses an event-driven and state machine design to ensure the system's efficiency and reliability.

[0021] Figure 2 This is a flowchart illustrating the implementation of an automatic verification method for protection device settings provided in another embodiment of the present invention. Figure 2 As shown, in some embodiments, the serial data is parsed in layers to obtain a first set of values, including: verifying the frame structure of the serial data to determine the valid serial data frame; initializing the parsing environment and cyclically parsing the intra-frame data fields of the valid serial data frame to obtain the first set of values.

[0022] In this embodiment of the invention, the serial port data parsing algorithm adopts a layered parsing strategy. First, frame structure verification is performed, checking the frame header identifier (AA55) to ensure the data frame originates from the correct device. Next, the frame length is verified to prevent data truncation or overflow. CRC check ensures the integrity of data transmission; if the check fails, a retransmission can be requested. Data area parsing uses a TLV (Type-Length-Value) structure, a design with good scalability. The algorithm selects the appropriate decoding function, such as DECODE_DEVICE_INFO() or DECODE_OVER_CURRENT_SETTINGS(), based on the data type byte (e.g., 0x01 represents device information, 0x10 represents overcurrent protection settings). Each decoding function specifically handles a particular type of data structure; for example, overcurrent protection settings may include both current and time settings. After parsing, the algorithm verifies the existence of necessary fields, marking missing fields as "N / A" to avoid null pointer exceptions during subsequent comparisons. Finally, metadata, including data source, reception time, frame verification, and parsing version, is added for easy tracking and debugging. This layered parsing design ensures the robustness and maintainability of the algorithm.

[0023] Perform multi-dimensional frame structure verification on the received serial data byte stream, checking the legality and integrity of the data frames layer by layer. Specifically, this can be done through the following steps: 1.1 Extract a frame header field of a preset length (usually 2 bytes, with fixed signatures of 0xAA and 0x55) from the beginning position (byte index 0) of the serial data byte stream to be verified, and record it as the frame header to be verified; 1.2 The frame header to be verified is compared byte by byte with the standard frame header feature code agreed upon in the protocol. If the two are inconsistent, the serial data frame is determined to be an illegal frame header frame, directly marked as an invalid frame and the subsequent verification process is terminated; if the two are completely consistent, the next stage of verification is entered.

[0024] Phase 2: Frame length consistency verification (preliminary integrity verification).

[0025] 2.1 Extract the frame length field (usually 2 bytes after the frame header) from the serial data byte stream at the preset position of the protocol, and parse it to obtain the theoretical length value declared for the data frame (hereinafter referred to as the declared frame length). 2.2 Count the total number of actual bytes in the serial data byte stream to be verified (hereinafter referred to as the actual frame length). 2.3. Compare the declared frame length with the actual frame length. If the two values ​​are not equal, the serial data frame is determined to be a length mismatch frame, marked as an invalid frame, and the subsequent verification process is terminated; if the two values ​​are the same, proceed to the next stage of verification.

[0026] Phase 3: Cyclic Redundancy Check (CRC) (final verification of data integrity).

[0027] 3.1 Determine the range of the CRC check field: Extract all bytes from the beginning of the frame header to the end of the frame before the CRC field (i.e., exclude the CRC field of the preset length at the end, usually 2 bytes) from the serial data byte stream, and record it as the CRC check data segment; 3.2 Call the CRC16 algorithm function, take the CRC check data segment to be checked as the input parameter, and calculate the theoretical CRC check value of the data segment (hereinafter referred to as calculating the CRC value). 3.3 Extract a CRC field of a preset length (usually 2 bytes) from the end of the serial data byte stream and parse it to obtain the actual CRC check value (hereinafter referred to as the frame CRC value) carried by the data frame. 3.4. Compare the CRC value byte by byte with the frame's CRC value. If the two are inconsistent, the serial data frame is determined to be a CRC check failure frame, marked as an invalid frame, triggering a retransmission request mechanism and terminating the verification process. If the two are completely consistent, proceed to the final determination stage.

[0028] Phase 4: Valid frame determination and output.

[0029] 4.1 A serial data byte stream that passes the above three-layer verification of frame header, frame length, and CRC is determined to be a valid serial data frame; 4.2 Output the complete byte stream of this valid serial data frame as input for subsequent data parsing processes; 4.3 For invalid frames that fail verification at each stage, record the failure type (illegal frame header / length mismatch / CRC failure) and failure location to form a frame verification log, which will facilitate subsequent troubleshooting.

[0030] In some embodiments, initializing the parsing environment and cyclically parsing the intra-frame data fields of valid serial data frames includes: constructing a structured data storage carrier and setting a position pointer variable, setting the initial value to a fixed offset value, making the pointer point to the starting byte position of the valid intra-frame data field, and completing the initialization of the parsing environment; reading the value of the byte currently pointed to by the position pointer as the data type identifier of the field to be parsed; shifting the position pointer backward and reading the byte value at the offset position as the data length identifier of the field to be parsed; based on the data length identifier, extracting consecutive byte sequences of the corresponding byte length from the current offset position of the position pointer. The algorithm takes the column as the original numerical content of the field to be parsed; based on the data type identifier, it calls the decoding algorithm that matches the identifier to convert the original numerical content into structured data with business semantics; the converted structured data is stored in the structured data storage carrier according to the preset key name; the position pointer is shifted backward by the total length so that the pointer points to the starting byte position of the next field to be parsed; it is determined whether the current pointer position is within the valid data range. If it exceeds the valid data range, the loop terminates; if it does not exceed the valid data range, the loop jumps to the step of reading the value of the byte currently pointed to by the position pointer as the data type identifier of the field to be parsed.

[0031] In this embodiment of the invention, a structured data storage carrier is constructed: a key-value pair data container (such as a dictionary, hash table, etc.) is created to store the structured data after parsing each field, supporting fast access and retrieval of field information by preset key names; a position pointer variable is defined to mark the current byte position being parsed; the pointer variable is initially assigned a fixed offset value agreed upon in the protocol (the offset value is the total number of bytes of the frame header field and the frame length field, usually 4 bytes), so that the pointer accurately points to the first byte position of the valid data field within the frame; after the above operations, the storage carrier and position reference of the parsing environment are configured, and the conditions for field parsing are met.

[0032] The binary value of the byte currently pointed to by the position pointer is read and defined as the data type identifier of the field to be parsed. This identifier is used to distinguish the business category to which the field belongs (e.g., 0x01 represents a device information field, 0x10 represents an overcurrent protection parameter field). The position pointer is shifted forward by 1 byte (i.e., pointer value + 1), and the byte value at the shifted position is read and defined as the data length identifier of the field to be parsed. This identifier represents the number of bytes occupied by the original value content of the field to be parsed. Based on the obtained data length identifier, a continuous byte sequence with a length matching the data length identifier is extracted from the current offset position of the position pointer (i.e., the byte after the data length identifier byte). The byte sequence is defined as the original numerical content of the field to be parsed. Based on the obtained data type identifier, a pre-configured decoding algorithm that uniquely matches the identifier (such as device information decoding algorithm, overcurrent protection parameter decoding algorithm, etc.) is called to convert the original numerical content from a binary byte sequence into structured data with business semantics (such as converting the binary device ID into a string format, or converting the current threshold byte value into a value in amperes). The decoded structured data with business semantics is stored in the constructed structured data storage carrier according to the key names preset by the protocol (such as "device_id", "oc_i_set", etc.), thus completing the parsing and storage of the current field.

[0033] Calculate the total pointer offset length: total length = data type identifier byte length (fixed to 1 byte) + data length identifier byte length (fixed to 1 byte) + original value content byte length (i.e. the value of the data length identifier); offset the position pointer backward by the above total length so that the pointer accurately points to the starting byte position of the next field to be parsed in the frame.

[0034] The check position pointer is currently pointing to a position within the valid data range of the frame. The boundary of the valid data range is "from the start byte of the frame to the byte before the CRC check field" (i.e., pointer value < total frame length - 2, where 2 is the fixed byte length of the CRC field). If the pointer position exceeds the above valid data range, it is determined that all valid data fields within the frame have been parsed, and the loop parsing process terminates. If the pointer position does not exceed the valid data range, the process jumps to reading the value of the byte currently pointed to by the position pointer as the data type identifier, and repeats until all fields are parsed.

[0035] In some embodiments, parsing a Bluetooth document to obtain a second value sheet includes: extracting file feature codes from the Bluetooth document to obtain a file header feature code; determining a format type identifier based on the file header feature code and a document type detection function; parsing the Bluetooth document using a document parser corresponding to the format type identifier to obtain a value sheet; and processing the value sheet using a data normalization function to obtain a second value sheet.

[0036] In this embodiment of the invention, the document type (Word, Excel, PDF, etc.) is first identified through the file header feature code, and then assigned to the corresponding dedicated parsing function (PARSE_WORD_DOCUMENT(), PARSE_EXCEL_DOCUMENT(), PARSE_PDF_DOCUMENT()). Each parsing function is optimized for the characteristics of a specific document format; for example, Word documents focus on parsing table structures, Excel documents process cell data, and PDF documents handle text extraction and layout analysis. After parsing, the document standardization method STANDARDIZE_PARSED_DATA() unifies the data from different sources into the same structure. The standardization process includes four key steps: field name mapping (unifying fields with the same meaning but different names in different documents into standard names), unit conversion (unifying values ​​represented by various units into standard units, such as converting all current values ​​to amperes and time values ​​to seconds), data type conversion (converting string-type numeric values ​​to numeric types and date strings to standard date formats), and metadata addition. This design enables the system to handle single-value documents in multiple formats, while providing a consistent data format for subsequent comparisons, improving the system's compatibility and scalability.

[0037] In some embodiments, comparing the first and second value sheets to obtain a verification result includes: calling a key field verification function to perform preliminary verification on the core identifier fields in the first and second value sheets; calling a field extraction function to extract the sets of fields to be compared in the first and second value sheets respectively, as the sets of fields to be compared; traversing each field in the sets of fields to be compared and determining the differences; if there are no field differences, the verification result is consistent; if there are field differences, the verification result is inconsistent.

[0038] In this embodiment of the invention, the intelligent comparison algorithm consists of four main stages: First, the key identification fields are verified using the CHECK_CRITICAL_FIELDS() method, comparing the device name, ID, and setpoint area code to ensure the correctness of the operation object. Failure in this step will immediately terminate the process. Next, the GET_ALL_FIELDS() method calls an external image recognition interface to process the setpoint fields from both sides of the data source, forming a complete list to be compared. Then, for each field in the list, the algorithm not only checks the exact equality of the setpoint numerical value and the setpoint state value, but also strictly handles cases where a field is missing on one side, storing all unequal or missing cases in the differences list. Finally, the algorithm generates a clear binary result based on whether differences is empty. If they are completely identical, a printing command is triggered; if there are differences, a structured report is generated, along with error value and expected value comparison information, and the printer's printing function is locked.

[0039] In some embodiments, a field extraction function is invoked to extract the sets of fields to be compared from the first and second value sheets, respectively, as the field set to be compared. This includes: traversing all structured field items from the first value sheet and filtering to form a first field subset; simultaneously traversing all structured field items from the second value sheet and filtering to form a second field subset; merging the first and second field subsets, performing deduplication on the merged field set to form the field set to be compared; and performing naming standardization processing on the field set to be compared.

[0040] In this embodiment of the invention, all field items in the first setting sheet that are stored in a structured form as key-value pairs are traversed, and a field filtering operation is performed. Fields with business comparison value (such as device parameter fields, configuration information fields, identification fields, etc.) are retained, and redundant fields (such as system-generated timestamp fields, filler fields without business meaning, and duplicate auxiliary identification fields) are removed. The filtered field items are integrated into a first field subset. Simultaneously, all field items in the second setting sheet that are stored in a structured form as key-value pairs are traversed, and completely consistent filtering rules are executed (to ensure consistent filtering logic). Fields with business comparison value are retained, and redundant fields are removed. The filtered field items are integrated into a second field subset. The integrity of the field items in the first field subset and the second field subset is verified to ensure that no fields with comparison value are omitted and no redundant fields are mixed in. If the verification fails, the traversal and filtering operation is re-executed.

[0041] The first field subset and the second field subset are fully merged to generate a merged field set containing all filtered fields of the two types of fixed value sheets. The merged field set is then deduplicated based on the field name. If multiple fields with the same name exist in the merged set, only the unique identifier of the field name is retained, and duplicate field items are removed to avoid duplicate comparisons in subsequent comparison processes. After deduplication, an initial field set to be compared without duplicate field items is obtained. This field set fully covers fields that are unique to the first fixed value sheet, fields that are unique to the second fixed value sheet, and fields shared by both types of fixed value sheets.

[0042] Establish standardized field naming rules (such as using lowercase letters, underscores to separate multi-level fields, limiting field name length, and disabling special characters) as the benchmark for field name standardization; iterate through each field name in the initial set of fields to be compared, and perform conversion operations according to the preset standardized naming rules—such as converting "DeviceID" to "device_id" and "overcurrent protection current" to "over_current_protection_current"—to ensure that fields with the same name in different setting sheets have a completely consistent naming format; if a field name has an anomaly that does not conform to the standardization rules and cannot be converted (such as containing special symbols or exceeding the length limit), mark the field and output an anomaly message, and supplement the standardized name after manual confirmation; After completing the standardization conversion of all field names and handling of abnormal fields, a final set of fields to be compared with uniform format, without repetition or redundancy is generated. This set of fields can be directly used in the subsequent field-by-field difference determination process.

[0043] In some embodiments, traversing each field in the set of fields to be compared and performing difference determination includes: sequentially reading individual fields in the set of fields to be compared according to a preset traversal rule, and extracting the field value corresponding to the current comparison field from the first set of values ​​and the second set of values ​​respectively, and recording them as the first field value and the second field value; wherein, if there is no corresponding value for the current comparison field in either set of values, the field value is marked as null; performing null value status verification on the extracted first field value and second field value; if the first field value is null and the second field value is not null, determining that the difference is that the first set of values ​​is missing the field value, and recording the core information of the difference; if the first field value is not null and the second field value is null, determining that the difference is that the second set of values ​​is missing the field value. The segment value records the core information of the difference. If both the first and second field values ​​are empty, it is determined that neither type of value sheet has this field value, and no difference is generated. If both the first and second field values ​​are not empty, the equality judgment function is called, with the first and second field values ​​as input parameters, to perform field value consistency verification. If the equality judgment function returns a consistent result, it is determined that the field values ​​match, and no difference is generated. If the equality judgment function returns an inconsistent result, it is determined that the difference is that the field values ​​do not match, and the core information of the difference is recorded. After completing the difference judgment and difference information recording for the current comparison field, the next field item in the field set to be compared is read until all field items in the field set to be compared have completed the difference judgment, and the traversal process is terminated.

[0044] In this embodiment of the invention, according to preset traversal rules (such as sorting by field name alphabetical order, field priority, field type classification, etc.), individual field items in the set of fields to be compared are read sequentially and defined as the current comparison field; the field value corresponding to the current comparison field is retrieved from the first value sheet and the second value sheet respectively, and recorded as the first field value and the second field value; wherein, if there is no mapping record for the current comparison field in the structured storage carrier of a certain value sheet, or the field value is not effectively assigned, the field value of the corresponding value sheet is uniformly marked as null (NULL) to ensure that the field value extraction logic of the two types of value sheets is consistent; the extraction status of the first field value and the second field value is checked, and if an extraction abnormality occurs (such as incorrect field value format or exceeding the preset value range), the current comparison field is marked as an "extraction abnormal field" and temporarily stored, to be processed separately after the full field traversal is completed.

[0045] Perform bidirectional null value validation on the extracted first and second field values ​​to clarify the null / non-null value combination scenarios. If the value of the first field is NULL and the value of the second field is not NULL, the difference type is determined to be that the first value sheet is missing the value of that field, and the core information of the difference is recorded—at least including the name of the field being compared, the difference type identifier ("missing in the first value sheet"), the valid field value in the second value sheet, and the difference determination timestamp; If the value of the first field is not NULL and the value of the second field is NULL, the difference type is determined to be that the second value sheet is missing the value of that field, and the core information of the difference is recorded—at least including the name of the field being compared, the valid field value in the first value sheet, the difference type identifier ("second value sheet missing"), and the difference determination timestamp; If both the first and second field values ​​are NULL, it is determined that neither of the two types of fixed-value sheets has a value for that field, and there is no substantial difference. Only the determination status of that field is recorded as "no difference between double empty values" and it is not included in the difference information set.

[0046] If both the first and second field values ​​are not NULL, the equality determination process is triggered, and the preset equality determination function is called. The first and second field values ​​are used as input parameters. These two types of field values ​​are passed to an equality determination function, which performs targeted consistency checks based on the field type (e.g., numeric, string, enumeration). Numeric fields are checked for precision and range; string fields are checked for character sequence and encoding format; and enumeration fields are checked for the attribution of enumeration values. If the equality judgment function returns a "match" result, it is determined that the field values ​​match and there is no difference. The judgment status of that field is recorded as "value match with no difference". If the equality check function returns an "inconsistent" result, the difference type is determined to be a field value mismatch, and the core information of the difference is recorded. This includes at least the name of the currently compared field, the value of the first field, the value of the second field, the difference type identifier ("field value mismatch"), and the validation details of the equality check function (such as the numerical difference or the position of the string difference).

[0047] After completing the difference determination and / or difference information recording for the current comparison field, update the traversal pointer and read the next field item in the set of fields to be compared; repeat the above operation for the next field item until all field items in the set of fields to be compared have completed the difference determination; when the traversal pointer points to the end of the set of fields to be compared, and all field items (including extracted abnormal fields) have completed the determination / marking, terminate the entire traversal process; for the "extracted abnormal fields" marked during the traversal, output the abnormal list and prompt manual review, and supplement the determination results after confirming the cause of the abnormality (such as inconsistent field definitions or data parsing errors).

[0048] In some embodiments, the method further includes: if the verification results are inconsistent, displaying an error value on the screen, providing an audio-visual prompt, and locking the printer.

[0049] In this embodiment of the invention, if the verification result is inconsistent, the mismatched value items and corresponding error values ​​in the first and second value sheets are highlighted on the screen; the sound and light alarm module is triggered to issue a sound and light prompt signal at a preset frequency; at the same time, a printer lock command is generated to prevent the printer from performing any printing operation until the operator completes the abnormality confirmation and manually unlocks it.

[0050] In some embodiments, before listening to serial data from the hardware interface of the protection device and Bluetooth documents from the Bluetooth module, the method further includes: performing hardware initialization and software initialization on the hardware interface of the protection device, the Bluetooth module, and the printer.

[0051] In this embodiment of the invention, before monitoring the serial data of the hardware interface of the protection device and the Bluetooth document of the Bluetooth module, the method also synchronously performs hardware initialization and software initialization operations on the hardware interface of the protection device, the Bluetooth module, and the printer, specifically including: Hardware initialization: Configure communication parameters such as baud rate, data bits, and stop bits for the hardware interface of the protection device; complete module wake-up and pairing parameter preset for the Bluetooth module; perform hardware path detection and print mode configuration for the printer; at the same time, verify the connectivity of the hardware communication links between the hardware interface of the protection device, the Bluetooth module, the printer, and the main control unit to ensure that the physical paths of each hardware module are normal and can send and receive data normally.

[0052] Software initialization: Load the corresponding low-level drivers and communication protocol parsing libraries for the hardware interface, Bluetooth module, and printer of the protection device; configure the software running parameters of each module; initialize the software working cache of each module and clear historical data residues; verify the integrity and compatibility of the software components of each module to ensure that the software can achieve precise control and data interaction with the hardware modules.

[0053] This invention also provides an automatic verification device for protection device settings, comprising: The data monitoring module is used to monitor the serial data of the hardware interface of the protection device and the Bluetooth documentation of the Bluetooth module. The first parsing module is used to perform layered parsing of serial data to obtain the first set of values; The second parsing module is used to parse the Bluetooth document to obtain the second value sheet; The verification module is used to compare the first and second value sheets to obtain the verification result; The printing module is used to trigger a printing command if the verification results are consistent, instructing the printer to print the verified value sheet and display it on the screen.

[0054] Optionally, the first parsing module is used to: verify the frame structure of the serial data to determine the valid serial data frame; initialize the parsing environment and cyclically parse the intra-frame data fields of the valid serial data frame to obtain the first set value sheet.

[0055] Optionally, the first parsing module is used for: constructing a structured data storage carrier and setting a position pointer variable, initially assigning it a fixed offset value so that the pointer points to the starting byte position of the valid data field within the frame, thus initializing the parsing environment; reading the value of the byte currently pointed to by the position pointer as the data type identifier of the field to be parsed; shifting the position pointer backward and reading the byte value at that offset position as the data length identifier of the field to be parsed; based on the data length identifier, extracting a continuous byte sequence of the corresponding byte length from the current offset position of the position pointer as the original numerical content of the field to be parsed; calling a decoding algorithm matching the data type identifier to convert the original numerical content into structured data with business semantics; storing the converted structured data into the structured data storage carrier according to a preset key name; shifting the position pointer backward by the total length so that the pointer points to the starting byte position of the next field to be parsed; determining whether the currently pointed position is within the valid data range; if it exceeds the valid data range, terminating the loop; if it does not exceed the valid data range, jumping to the step of reading the value of the byte currently pointed to by the position pointer as the data type identifier of the field to be parsed.

[0056] Optionally, the second parsing module is used to: extract file feature codes from the Bluetooth document to obtain file header feature codes; determine the format type identifier based on the file header feature codes and the document type detection function; parse the Bluetooth document according to the document parser corresponding to the format type identifier to obtain a value sheet; and process the value sheet according to the data standardization function to obtain a second value sheet.

[0057] Optionally, the verification module is used to: call the key field verification function to perform preliminary verification on the core identifier fields in the first and second value sheets; call the field extraction function to extract the sets of fields to be compared in the first and second value sheets respectively, as the sets of fields to be compared; traverse each field in the set of fields to be compared and determine the differences; if there are no field differences, the verification result is consistent; if there are field differences, the verification result is inconsistent.

[0058] Optionally, the verification module is used to: traverse all structured stored field items from the first setpoint and filter to form a first field subset; simultaneously traverse all structured stored field items from the second setpoint and filter to form a second field subset; merge the first field subset and the second field subset, perform deduplication on the merged field set to form a field set to be compared; and perform naming standardization processing on the field set to be compared.

[0059] Optionally, the verification module is used to: sequentially read individual fields from the set of fields to be compared according to preset traversal rules, and extract the field value corresponding to the current comparison field from the first and second value sheets respectively, denoted as the first field value and the second field value; wherein, if there is no corresponding value for the current comparison field in either value sheet, the field value is marked as null; perform null value status verification on the extracted first and second field values; if the first field value is null and the second field value is not null, determine that the difference is that the first value sheet is missing the field value, and record the core information of the difference; if the first field value is not null and the second field value is null, determine that the difference is that the second value sheet is missing the field value, and record the core information of the difference. Information; if both the first and second field values ​​are empty, it is determined that neither type of value sheet has this field value, and no difference is generated; if both the first and second field values ​​are not empty, the equality judgment function is called, with the first and second field values ​​as input parameters, to perform field value consistency verification; if the equality judgment function returns a consistent result, it is determined that the field values ​​match, and no difference is generated; if the equality judgment function returns an inconsistent result, it is determined that the difference is that the field values ​​do not match, and the core information of the difference is recorded; after completing the difference judgment and difference information recording of the current comparison field, the next field item in the field set to be compared is read until all field items in the field set to be compared have completed the difference judgment, and the traversal process is terminated.

[0060] Optionally, the device also includes a prompting module for: If the verification results are inconsistent, an error value will be displayed on the screen, an audio-visual prompt will be given, and the printer will be locked.

[0061] Optionally, the device also includes an initialization module for: The hardware interface of the protection device, Bluetooth module, and printer perform hardware and software initialization.

[0062] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0063] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for automatically verifying the settings of a protection device, characterized in that, include: The serial data of the hardware interface of the monitoring protection device and the Bluetooth documentation of the Bluetooth module; The serial data is parsed in layers to obtain the first set value sheet; The Bluetooth document is parsed to obtain the second value sheet; The first value sheet and the second value sheet are compared to obtain the verification result; If the verification results are consistent, a print command is triggered to instruct the printer to print the verified value sheet and display the verified value sheet on the screen.

2. The automatic verification method for protection device settings according to claim 1, characterized in that, The serial data is parsed in layers to obtain a first set of values, including: The serial data is subjected to frame structure verification to determine valid serial data frames; The parsing environment is initialized and the intra-frame data fields of the valid serial data frames are parsed in a loop to obtain the first set value.

3. The automatic verification method for protection device settings according to claim 2, characterized in that, Initialize the parsing environment and cyclically parse the intra-frame data fields of the valid serial data frames, including: While constructing the structured data storage carrier, a position pointer variable is set, and the initial value is set to a fixed offset value so that the pointer points to the starting byte position of the valid data field within the frame, thus completing the initialization of the parsing environment; Read the value of the byte currently pointed to by the position pointer, and use it as the data type identifier of the field to be parsed; Offset the position pointer forward and read the byte value at that offset position as an identifier of the data length of the field to be parsed; Based on the data length identifier, a continuous byte sequence of the corresponding byte length is extracted from the current offset position of the position pointer and used as the original numerical content of the field to be parsed. Based on the data type identifier, a decoding algorithm matching the identifier is invoked to convert the original numerical content into structured data with business semantics; The converted structured data is stored in the structured data storage carrier according to the preset key name; Offset the position pointer forward by the total length, so that the pointer points to the starting byte position of the next field to be parsed; Determine if the current pointer is within a valid data range. If it is outside the valid data range, terminate the loop. If it is within the valid data range, jump to the step of reading the value of the byte currently pointed to by the pointer, which serves as the data type identifier for the field to be parsed.

4. The automatic verification method for protection device settings according to claim 1, characterized in that, The Bluetooth document is parsed to obtain a second set of parameters, including: The file header feature code is obtained by extracting the file feature code from the Bluetooth document; The format type identifier is determined based on the file header signature and the document type detection function; The Bluetooth document is parsed using the document parser corresponding to the format type identifier to obtain a value sheet; The setpoint sheet is processed using a data standardization function to obtain a second setpoint sheet.

5. The automatic verification method for protection device settings according to claim 1, characterized in that, The first and second value sheets are compared to obtain the verification results, including: Call the key field validation function to perform pre-validation on the core identifier fields in the first and second value sheets; Call the field extraction function to extract the sets of fields to be compared from the first and second value sheets, respectively, as the sets of fields to be compared; Iterate through each field in the set of fields to be compared and determine the differences. If there are no differences in any fields, the verification result is consistent; if there are differences in any fields, the verification result is inconsistent.

6. The automatic verification method for protection device settings according to claim 5, characterized in that, Call the field extraction function to extract the sets of fields to be compared from the first and second value sheets, respectively, as the comparison field set, including: Iterate through all structured field items in the first setpoint and filter to form a first field subset; simultaneously iterate through all structured field items in the second setpoint and filter to form a second field subset. The first field subset and the second field subset are merged, and the merged field set is deduplicated to form a field set to be compared. Perform naming standardization on the set of fields to be compared.

7. The automatic verification method for protection device settings according to claim 5, characterized in that, Iterate through each field in the set of fields to be compared and perform difference determination, including: According to the preset traversal rules, read the individual fields in the set of fields to be compared in sequence, and extract the field value corresponding to the current comparison field from the first set value sheet and the second set value sheet respectively, and record them as the first field value and the second field value; wherein, if there is no corresponding value for the current comparison field in either set value sheet, mark its field value as an empty value; Perform null value validation on the extracted first and second field values; If the value of the first field is empty and the value of the second field is not empty, the difference is determined to be that the first fixed value is missing the value of that field, and the core information of the difference is recorded. If the value of the first field is not empty and the value of the second field is empty, the difference is determined to be that the second fixed value is missing the value of that field, and the core information of the difference is recorded; If both the first and second field values ​​are empty, it is determined that neither type of fixed value sheet has the value of that field, and no difference is generated. If both the first and second field values ​​are non-empty, call the equality judgment function, taking the first and second field values ​​as input parameters, and perform field value consistency verification. If the equality judgment function returns a consistent result, it is determined that the field values ​​match and no difference is generated; If the equality judgment function returns inconsistent results, the difference is determined to be a mismatch in field values, and the core information of the difference is recorded. After completing the difference determination and difference information recording for the current comparison field, read the next field item in the set of fields to be compared until all field items in the set of fields to be compared have completed the difference determination, and then terminate the traversal process.

8. The automatic verification method for protection device settings according to claim 1, characterized in that, The method further includes: If the verification results are inconsistent, an error value will be displayed on the screen, an audio-visual prompt will be given, and the printer will be locked.

9. The automatic verification method for protection device settings according to claim 1, characterized in that, Prior to the serial data from the hardware interface of the monitoring protection device and the Bluetooth documentation from the Bluetooth module, the method further includes: Perform hardware and software initialization on the hardware interface of the protection device, the Bluetooth module, and the printer.

10. An automatic verification device for protection device settings, characterized in that, include: The data monitoring module is used to monitor the serial data of the hardware interface of the protection device and the Bluetooth documentation of the Bluetooth module. The first parsing module is used to perform layered parsing of the serial data to obtain the first set value sheet; The second parsing module is used to parse the Bluetooth document to obtain the second value sheet; The verification module is used to compare the first value sheet and the second value sheet to obtain the verification result; The printing module is used to trigger a printing command if the verification results are consistent, instructing the printer to print the verified value sheet and display the verified value sheet on the screen.