Edge node decoupling access method and system based on protocol automatic analysis
By generating device message timing sequences, byte-level alignment, and protocol structure conservation chains, field misalignment is identified and corrected, solving the problem of field misalignment in multi-protocol access of edge nodes. This achieves stable decoupled access and virtual field mapping, improving the stability and accuracy of access.
Patent Information
- Application Number
- CN202610764753.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-25
AI Technical Summary
In existing technologies, when parsing rules change or private extended fields are inserted, field misalignment is difficult to identify, leading to data upload errors and coupling between upper-layer applications and physical field offsets, making it difficult to achieve stable decoupled access.
By collecting access monitoring data to generate device message timing sequences, preprocessing based on check flags, performing byte-level alignment, extracting cross-version stable anchor points, generating protocol structure conservation chains, identifying and parsing response decoupling fields, determining misaligned callback fields and starting offset values, establishing field semantic inertial graphs, generating virtual field address values and mapping tables, and realizing decoupled access of edge nodes.
It can identify byte structure offsets caused by changes in parsing rule versions when the original message passes verification, reduce the mapping rate of error fields and the proportion of uploaded error values, improve access stability, and reduce misjudgment of device status and false alarm triggering.
Smart Images

Figure CN122640494A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of protocol processing technology, specifically to a method and system for decoupling and accessing edge nodes based on automatic protocol parsing. Background Technology
[0002] With the development of the Industrial Internet, edge computing, and multi-protocol device access technologies, edge nodes are no longer limited to data forwarding but are increasingly taking on tasks such as device identification, protocol adaptation, field parsing, rule loading, and upper-layer application data provision. In scenarios where multiple vendors' devices access each other in parallel, edge nodes need to process data based on device network addresses, communication ports, function codes, field identifiers, and parsing rule versions to convert raw messages from different sources into unified business fields. Simultaneously, the development of identifier resolution technology has made the mapping relationship between device identifiers, field identifiers, and application-side call identifiers a crucial foundation for edge access systems. Related technologies have been explored in areas such as edge node management, service distribution, process access, and interface updates.
[0003] For example, application CN115113911B provides a software management system and method, relating to the field of artificial intelligence, specifically cloud computing, cloud operations and maintenance, and edge computing technologies, which can be applied in intelligent cloud scenarios. The specific implementation scheme is as follows: A software management system includes: a central node configured to acquire a service description file, convert the service description file into service data, determine a mapping table of machine tags and services based on the service data, and assign machine tags to connected edge nodes according to a preset tag management table; at least one edge node, each edge node configured to acquire the machine tags, mapping table, and service data assigned to it from the central node, query the target service corresponding to the assigned machine tag from the mapping table, and download and install the file according to the file package information of the target service in the service data.
[0004] For example, application CN113778517B provides a method, apparatus, server, medium, and product for updating process orchestration. The method includes: determining the process nodes to be opened in the target process body; generating corresponding front-end access specification interface data based on the process nodes to be opened, the front-end access specification interface data including parameters of the front-end business identity identifier; if a data acquisition request is received from the front-end server, sending the front-end access specification interface data to the front-end server, the front-end access specification interface data instructing the front-end server to generate a corresponding development data package to be updated, the development data package to be updated including the front-end business identity identifier; if the update conditions for the development data package of the process node to be opened are detected, updating the development data package of the process node to be opened based on the development data package to be updated and the corresponding front-end business identity identifier.
[0005] However, existing technologies focus more on edge node service deployment, process interface updates, or business identity management, paying insufficient attention to the cross-version parsing issues of original message fields when edge nodes connect to multi-protocol devices. When devices are upgraded online, parsing rule versions change, or private extended fields are inserted, the original message may still pass length and checksum verification, but the starting offset, field length, or field order of the business fields may have changed, making it difficult to identify field misalignments in a timely manner. If edge nodes still directly output field values to upper-layer applications based on the original parsing rules, it can easily lead to errors in business data upload, misjudgment of device status, and false alarm triggering. Furthermore, it makes upper-layer applications continuously dependent on specific physical field offsets, making it difficult to achieve stable decoupled access.
[0006] Therefore, in order to address the above issues, there is an urgent need for a method and system for decoupling access to edge nodes based on automatic protocol parsing. Summary of the Invention
[0007] Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a method and system for decoupling edge node access based on automatic protocol parsing. This solves the problem in existing multi-protocol access of edge nodes where changes in parsing rules or the insertion of private extended fields lead to misaligned fields that are difficult to identify, resulting in data upload errors and coupling between upper-layer applications and physical fields.
[0008] Technical solution To achieve the above objectives, the present invention provides the following technical solution: an edge node decoupling access method based on automatic protocol parsing, comprising: S1, collecting access monitoring data and generating a device message timing sequence according to the arrival timestamp of the original message, generating a verification flag based on the original message byte sequence and the received checksum value, and outputting preprocessed access monitoring data; S2, performing byte-level alignment of the cross-version original message byte sequence based on the preprocessed access monitoring data, extracting cross-version stable anchors based on conserved endpoints, determining private extended fields between cross-version stable anchors, and generating a protocol. S3, based on the control receipt arrival timestamp, determine the receipt response window, identify and parse the response decoupling field, and determine the misaligned reconnection field and the starting offset value of the reconnection field within the candidate reconnection interval defined by the protocol structure conservation chain, generating the field misaligned reconnection result; S4, based on the protocol structure conservation chain and the field misaligned reconnection result, generate candidate semantic nodes, establish a field semantic inertial map and determine the starting offset value of the target physical field, generate virtual field address values and virtual-physical field mapping table, parse the subsequent original message byte sequence based on the virtual-physical field mapping table, and output the edge node decoupling access result.
[0009] Further, the specific steps for collecting access monitoring data and generating device message timing sequences based on the original message arrival timestamps, and generating verification markers based on the original message byte sequences and received checksum values are as follows: Access monitoring data generated when edge nodes access multi-protocol devices is collected. This access monitoring data includes the original message byte sequence, original message arrival timestamp, device communication port number, device network address value, function code value, data area start byte sequence number, data area byte length value, received checksum value, control command sending timestamp, control receipt arrival timestamp, parsing rule version number value, parsing rule loading timestamp, field parsing start offset value, field parsing length value, field parsing value, field unit identifier value, and uploaded field. The system generates device message timing sequences by sorting access monitoring data corresponding to the same device network address value and the same device communication port number in ascending order according to the original message arrival timestamp; calculating the difference between the arrival timestamps of two adjacent original messages in the device message timing sequence to obtain the adjacent message arrival interval; subtracting the control instruction sending timestamp from the control receipt arrival timestamp to obtain the control receipt delay value; performing checksum calculation on the original message byte sequence using a cyclic redundancy check algorithm to obtain the locally calculated checksum value; comparing the locally calculated checksum value with the received checksum value; generating a checksum pass flag when they are the same, and generating a checksum fail flag when they are different; and outputting the preprocessed access monitoring data.
[0010] Furthermore, based on the preprocessed access monitoring data, the cross-version original message byte sequences are aligned at the byte level. The specific steps for extracting cross-version stable anchors based on conserved endpoints are as follows: Read the preprocessed access monitoring data, filter the data records corresponding to the verification pass markers, group them according to the device communication port number, device network address value, and function code value, and arrange them in ascending order according to the original message arrival timestamp within each group; use the parsing rule loading timestamp corresponding to the later parsing rule version number value among two adjacent parsing rule version number values as the boundary to divide the data records into old version message sequences and new version message sequences; read the original message byte sequences in the old version message sequences and new version message sequences, and perform byte-level alignment using the Needleman-Wunsch global sequence alignment algorithm; use the byte segments corresponding to the device network address value, the byte segments corresponding to the function code value, the byte positions corresponding to the data area start byte sequence number, the byte segments corresponding to the data area byte length value, and the byte segments corresponding to the received check code value as conserved endpoints; determine the byte segments with a consecutive matching byte number greater than the anchor byte number threshold between conserved endpoints as cross-version stable anchors.
[0011] Furthermore, the specific steps for determining private extended fields and generating the protocol structure conservation chain between cross-version stable anchors are as follows: Between the same pair of cross-version stable anchors, read byte segments that are not present in the old version's original message byte sequence but exist in the new version's original message byte sequence; when a byte segment maintains the same byte length in N consecutive frames of the new version's original message byte sequence, and the corresponding insertion position is within the data area defined by the data area's starting byte sequence number and the data area's byte length value, the byte segment is determined as a candidate extended field, and the starting byte sequence number, ending byte sequence number, and candidate insertion length of the candidate extended field are recorded. Degree value; calculate the difference between the starting offset value of field parsing for the same field unit identifier value in the new version message sequence and the old version message sequence to obtain the anchor chain relative offset difference; when the anchor chain relative offset difference corresponding to at least two adjacent field unit identifier values after the same candidate extension field is equal to the same candidate insertion length value, and the version increment of the data area byte length value is equal to the candidate insertion length value, the corresponding candidate extension field is determined as a private extension field; generate the protocol structure conservation chain according to the order of conservation endpoint, cross-version stable anchor point, private extension field and field parsing starting offset value in the original message byte sequence.
[0012] Furthermore, the specific steps for determining the response window based on the control receipt arrival timestamp and identifying the parsing response decoupling field are as follows: Read the protocol structure conservation chain and preprocessed access monitoring data; round up the ratio of the control receipt delay value to the adjacent message arrival interval value to obtain the number of response periods; determine the sampling period interval corresponding to the number of response periods after the control receipt arrival timestamp as the response window; read the field parsing value, uploaded field value, and device status code value corresponding to the same field unit identifier value within the response window; use the Bayesian online change point detection algorithm to calculate the field parsing value change point, uploaded field value change point, and device status code change point respectively; when the field parsing value change point is outside the response window, and the uploaded field value change point and device status code change point are both within the response window, determine the corresponding field unit identifier value as the parsing response decoupling field.
[0013] Furthermore, the specific steps for determining the misaligned callback field and the starting offset value of the callback field within the candidate callback interval defined by the protocol structure conservation chain, and generating the field misalignment callback result, are as follows: Read the new version of the original message byte sequence corresponding to the parsed response decoupling field, the field parsing starting offset value, the field parsing length value, the data area starting byte sequence number, the data area byte length value, the candidate insertion length value, and the anchor chain relative offset difference; add the field parsing starting offset value to the anchor chain relative offset difference to obtain the candidate callback center offset value; within the data area defined by the data area starting byte sequence number to the data area byte length value, extend the candidate insertion length value forward and backward, centered on the candidate callback center offset value, to obtain the candidate callback interval; using the field parsing length value as the window length, extract candidate replacement byte segments byte by byte within the candidate callback interval, and follow the parsing rules... Based on the data type and byte order rules of the field corresponding to this value, the candidate replacement byte segment is converted into a candidate replacement field value. A Bayesian online change point detection algorithm is used to calculate the change points of the candidate replacement field values. Based on the change points of the candidate replacement field values, the change points of the uploaded field values, the change points of the device status code, the starting byte sequence number of the candidate replacement byte segment, the starting offset value of the field parsing, the relative offset difference of the anchor chain, the candidate insertion length value, the candidate replacement field value, and the uploaded field value, a misalignment reconnection matching value is calculated. The candidate replacement byte segment with the largest misalignment reconnection matching value is determined as the misalignment reconnection field, and the starting byte sequence number of the misalignment reconnection field is determined as the starting offset value of the reconnection field. The parsing response decoupling field, the misalignment reconnection field, the reconnection field starting offset value, the misalignment reconnection matching value, and the parsing rule version number value are bound together to generate the field misalignment reconnection result.
[0014] Further, the specific steps for calculating the misalignment reconnection matching value are as follows: Add the absolute value of the difference between the timestamp of the candidate replacement field value change and the timestamp of the uploaded field value change to the absolute value of the difference between the timestamp of the candidate replacement field value change and the timestamp of the device status code change, divide by the sum of the control receipt delay value and the adjacent message arrival interval value, and then take a negative exponent with the natural constant e as the base to obtain the response synchronization item; Subtract the anchor chain relative offset difference from the difference between the starting byte sequence number of the candidate replacement byte segment and the starting offset value of the field parsing, take the absolute value, divide by the candidate insertion length value plus one, and then take a negative exponent with the natural constant e as the base to obtain the location reconnection item; Divide the absolute value of the difference between the candidate replacement field value and the uploaded field value within the receipt response window by the sum of the standard deviation of the uploaded field value and the minimum constant, calculate the average, add one to the average, and take the reciprocal to obtain the value matching item; Multiply the response synchronization item, the location reconnection item, and the value matching item together to obtain the misalignment reconnection matching value.
[0015] Further, based on the protocol structure conservation chain and field misalignment reconnection results, candidate semantic nodes are generated, a field semantic inertia graph is established, and the specific steps for determining the starting offset value of the target physical field are as follows: Read the protocol structure conservation chain and field misalignment reconnection results; combine the field parsing starting offset value, reconnection starting offset value, field parsing length value, and misalignment reconnection matching value corresponding to the same field unit identifier value under different parsing rule version number values to form candidate semantic nodes; using the same field unit identifier value, the same field parsing length value, and misalignment reconnection matching value greater than the reconnection matching threshold as node connection conditions, establish a semantic inertia edge between two adjacent candidate semantic nodes corresponding to parsing rule version number values after sorting by parsing rule loading timestamp; when the semantic inertia edge corresponds to... If the absolute value of the difference between the starting offset value of the callback field and the starting offset value of the field parsing is not greater than the candidate insertion length value, and the difference between the starting offset value of the callback field and the starting offset value of the field parsing has the same sign as the difference between the relative offsets of the anchor chain, the corresponding semantic inertial edge is marked as a usable semantic inertial edge, and a field semantic inertial graph is generated; edges in the field semantic inertial graph that are not marked as usable semantic inertial edges are deleted; among the usable semantic inertial edges corresponding to the unit identifier value of the same field, the target semantic inertial edge is selected in the following order: the largest number of cross-version stable anchor points, the largest misaligned callback matching value, and the smallest absolute value of the difference between the starting offset value of the callback field and the starting offset value of the field parsing, and the starting offset value of the callback field corresponding to the endpoint of the target semantic inertial edge is determined as the starting offset value of the target physical field.
[0016] Further, the specific steps for generating virtual field address values and a virtual-physical field mapping table, parsing subsequent original message byte sequences based on the virtual-physical field mapping table, and outputting the edge node decoupling access results are as follows: Generate a virtual field address value for each field unit identifier value. The virtual field address value is obtained by hashing the device network address value, function code value, field unit identifier value, and field parsing length value, and appending the device communication port number to form a unique address in case of hash collisions; bind the virtual field address value with the target physical field start offset value, field parsing length value, parsing rule version number value, function code value, and private extended field to generate the virtual-physical field mapping table; wherein, the virtual field address value remains unchanged when the parsing rule version number value changes, and the target physical field start offset value changes with the parsing rule version number value and the private extended field... The process involves updating the data as needed; reading subsequent raw message byte sequences, extracting target physical field byte segments according to the virtual-physical field mapping table, and converting them into virtual field parsing values; calculating the absolute value of the difference between the virtual field parsing value and the uploaded field value corresponding to the same field unit identifier value to obtain the virtual field access deviation value; when the virtual field access deviation value of the same field unit identifier value is less than the access deviation threshold for K consecutive sampling periods, the corresponding virtual field address value is marked as a stable decoupling field; when all virtual field address values corresponding to the same device network address value are marked as stable decoupling fields, the corresponding device network address value is marked as a successfully decoupled access device; and outputting the edge node decoupling access result, which includes the virtual field address value, the virtual-physical field mapping table, the stable decoupling field, and the successfully decoupled access device.
[0017] The second aspect of this invention provides an edge node decoupled access system based on automatic protocol parsing, comprising: an access packet timing processing module, a protocol structure conservation construction module, a receipt causal field callback module, and a semantic address decoupled access module, wherein: the access packet timing processing module is used to collect access monitoring data and generate a device packet timing sequence according to the arrival timestamp of the original packet, generate a verification flag based on the original packet byte sequence and the received checksum value, and output the preprocessed access monitoring data; the protocol structure conservation construction module is used to perform byte-level alignment of the cross-version original packet byte sequence based on the preprocessed access monitoring data, extract cross-version stable anchors based on the conservation endpoints, and perform cross-version stable anchor... Private extended fields are determined between points to generate a protocol structure conservation chain; the receipt causal field callback module is used to determine the receipt response window based on the control receipt arrival timestamp, identify and parse the response decoupling field, and determine the misaligned callback field and the starting offset value of the callback field within the candidate callback interval defined by the protocol structure conservation chain, generating the field misalignment callback result; the semantic address decoupling access module is used to generate candidate semantic nodes based on the protocol structure conservation chain and the field misalignment callback result, establish a field semantic inertial graph and determine the starting offset value of the target physical field, generate virtual field address values and a virtual-physical field mapping table, parse the subsequent original message byte sequence based on the virtual-physical field mapping table, and output the edge node decoupling access result.
[0018] Beneficial effects The present invention has the following beneficial effects: (1) The edge node decoupling access method and system based on protocol automatic parsing extracts cross-version stable anchor points based on the conservation endpoint and determines private extension fields between cross-version stable anchor points. It can identify the byte structure offset caused by the version change of parsing rules while the original message still passes the verification, and avoid the failure to judge private extension fields due to relying only on single frame length verification and check code verification.
[0019] (2) The edge node decoupling access method and system based on protocol automatic parsing constructs a receipt response window by using the control receipt arrival timestamp, and identifies the parsing response decoupling field by combining the field parsing value change point, the uploaded field value change point and the device status code change point. Then, the misaligned reconnection field and the reconnection field start offset value are determined by the candidate reconnection interval. This can distinguish between real working condition changes and field parsing misalignment, and reduce the error field mapping rate and the proportion of uploaded error values.
[0020] (3) Edge node decoupling access method and system based on protocol automatic parsing: Based on the protocol structure conservation chain and field misalignment back-up results, establish field semantic inertial graph, determine the starting offset value of the target physical field, and generate virtual field address value and virtual-real field mapping table, so that the upper layer application can read the field value through the virtual field address value, reduce the dependence on the specific physical field offset, and improve the access stability after the parsing rules change.
[0021] (4) The edge node decoupling access method and system based on protocol automatic parsing, through misaligned reconnection matching value, stable decoupling field and continuous determination of decoupling access successful devices, links byte-level structure changes, causal response of receipt and virtual and real field mapping results for verification. It can maintain the consistency of business field output in scenarios such as online device upgrade, private extended field insertion and field order change, and reduce the number of device status misjudgments and alarm false triggers. Attached Figure Description
[0022] Figure 1 Flowchart of edge node decoupling access method based on protocol automatic resolution; Figure 2 Diagram of the edge node decoupled access system based on protocol automatic resolution; Figure 3 Generate a flowchart for the conservation chain of private extended fields; Figure 4 This is a discriminant diagram for dual-track selection within the candidate reconnection interval. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Please see Figures 1-4 This invention provides a technical solution: an edge node decoupling access method based on automatic protocol parsing, comprising: S1, collecting access monitoring data and generating a device message timing sequence according to the arrival timestamp of the original message, generating a verification flag based on the original message byte sequence and the received checksum value, and outputting preprocessed access monitoring data; S2, performing byte-level alignment of the cross-version original message byte sequence based on the preprocessed access monitoring data, extracting cross-version stable anchors based on conserved endpoints, determining private extended fields between cross-version stable anchors, and generating a protocol structure conservation mechanism. Chain; S3, determine the receipt response window based on the control receipt arrival timestamp, identify and parse the response decoupling field, and determine the misaligned reconnection field and the starting offset value of the reconnection field within the candidate reconnection interval defined by the protocol structure conservation chain, and generate the field misaligned reconnection result; S4, generate candidate semantic nodes based on the protocol structure conservation chain and the field misaligned reconnection result, establish a field semantic inertial map and determine the starting offset value of the target physical field, generate virtual field address values and virtual-physical field mapping table, parse the subsequent original message byte sequence based on the virtual-physical field mapping table, and output the edge node decoupling access result.
[0025] Specifically, the steps for collecting access monitoring data and generating device message timing sequences based on the original message arrival timestamps, and generating verification markers based on the original message byte sequences and received checksum values are as follows: Access monitoring data generated when edge nodes access multi-protocol devices is collected. This access monitoring data includes the original message byte sequence, original message arrival timestamp, device communication port number, device network address value, function code value, data area start byte sequence number, data area byte length value, received checksum value, control command sending timestamp, control receipt arrival timestamp, parsing rule version number value, parsing rule loading timestamp, field parsing start offset value, field parsing length value, field parsing value, field unit identifier value, uploaded field value, and device... The status code values are as follows: The original message byte sequence is read from the receive buffer of the device communication port by the edge node, and obtained by truncating a single frame according to the frame header byte, length byte, and frame tail check byte; the original message arrival timestamp is recorded by the edge node when the single frame of original message reception is completed by calling the local clock; the device communication port number is obtained by the edge node from the access channel configuration table, and is used to distinguish between serial port channels, Ethernet monitoring ports, and fieldbus channels; the device network address value is read from the device address byte segment in the original message byte sequence, or it can be read from the remote address field in the edge node's communication connection record; the function code value is read from the position of the function code byte in the original message byte sequence, and is used to distinguish... The commands are divided into data acquisition commands, status reading commands, and control receipt commands. The starting byte sequence number of the data area is obtained by reading the starting position of the data area recorded in the current parsing rule version. The byte length value of the data area is obtained by reading the length field in the original message byte sequence and verifying it in conjunction with the starting byte sequence number of the data area and the byte position of the received checksum value. The received checksum value is read from the checksum byte segment at the end of the original message byte sequence. The control command transmission timestamp is recorded by the edge node when the control command is written to the transmission buffer and transmission is completed. The control receipt arrival timestamp is recorded by the edge node when it receives the receipt message corresponding to the control command and compares it with the control command transmission record using the device network address value, device communication port number, and function code value. Matching complete; the parsing rule version number is obtained from the parsing rule file currently loaded by the edge node; the parsing rule loading timestamp is recorded when the edge node completes loading the parsing rule file and writes it to the runtime configuration record; the field parsing start offset is obtained from the starting byte position of the corresponding field in the current parsing rule version; the field parsing length is obtained from the number of bytes occupied by the corresponding field in the current parsing rule version; the field parsing value is obtained by the edge node extracting field byte segments from the original message byte sequence according to the field parsing start offset and field parsing length, and then converting them according to the byte order and value conversion method in the current parsing rule version; the field unit identifier value is obtained from the unit encoding of the corresponding field in the current parsing rule version.The uploaded field values are first read from the field upload log by the edge node; if there is no record of the same sampling period in the field upload log, they are read from the data reporting buffer; if there is no record of the same sampling period in the data reporting buffer, they are read from the upper-layer application's sending queue, and the corresponding data source marker is recorded to represent the actual business field values output by the edge node to the upper-layer application; the device status code values are read from the status code field in the original message byte sequence and converted according to the current parsing rule version, and are used to represent the operating status of multi-protocol devices in the corresponding sampling period. The original message byte sequence is a complete binary message byte stream received by the edge node from the device communication port. The original message arrival timestamp is the time recorded when the edge node completes the reception of a single frame of original message. The device communication port number and device network address value are used to distinguish different access channels and different multi-protocol devices. The function code value is used to distinguish data acquisition instructions, status reading instructions, and control receipt instructions under the same multi-protocol device. The data area start byte sequence number and data area byte length value are used to define the data area boundary where the service fields are located. The received checksum value is the checksum carried at the end of the original message byte sequence. The parsing rule version number value and parsing rule loading timestamp are used to identify the parsing rule version corresponding to the current original message. The field parsing start offset value, field parsing length value, field parsing value, and field unit identifier value are obtained by the edge node parsing the original message byte sequence according to the current parsing rule version. The uploaded field value is the service field value output by the edge node to the upper layer application. The device status code value is the running status code fed back by the multi-protocol device in the current sampling period. According to the original message arrival timestamp, the edge node parses the data acquisition instructions, status reading instructions, and control receipt instructions under the same device network address value and the same device communication port number. The monitoring data is sorted in ascending order to generate a device message time sequence. When generating the device message time sequence, data records with the same device network address value and device communication port number are first grouped into the same device message set. Then, they are arranged from earliest to latest according to the original message arrival timestamp, ensuring that the same multi-protocol device forms a continuous sampling order within the same access channel. The system also retains the function code value, parsing rule version number value, field parsing start offset value, field parsing length value, field parsing value, field unit identifier value, uploaded field value, and device status code value corresponding to each original message frame. Binding relationships prevent data records from different devices and communication ports from being mixed in the same time sequence; calculate the difference in arrival timestamps between two adjacent frames of original messages in the device message time sequence to obtain the adjacent message arrival interval value; the adjacent message arrival interval value is used to represent the actual arrival time difference between two consecutive frames of original messages in the same device message time sequence. When the adjacent message arrival interval value deviates significantly from the device sampling period, it can be combined with the field parsing value change point and the upload field value change point to determine whether the current change is affected by message delay, message accumulation and parsing rule version change;The control receipt delay value is obtained by subtracting the control command sending timestamp from the control receipt arrival timestamp. The control command sending timestamp is the moment the edge node sends the control command to the multi-protocol device, and the control receipt arrival timestamp is the moment the edge node receives the corresponding control receipt message. The control receipt delay value is used to determine the time range within which the service field values and device status code values should change after the control action is completed, ensuring that the subsequent receipt response window is formed based on actual communication delays rather than fixed experience windows. A cyclic redundancy check (CRC) algorithm is used to perform checksum calculations on the original message byte sequence to obtain a locally calculated checksum value. This locally calculated checksum value is compared with the received checksum value. If they are the same, a checksum pass flag is generated; if they are different, a checksum fail flag is generated, and the preprocessed access monitoring data is output. During the checksum calculation, the byte segment containing the received checksum value is first removed from the original message byte sequence, and then the remaining byte segment is locally checked using the CRC algorithm. The system performs a checksum calculation to obtain a locally calculated checksum value. This locally calculated checksum value is then compared bit-by-bit with the received checksum value. If the bit-by-bit comparison results are consistent, it indicates that no byte errors that can be identified by cyclic redundancy check occurred during the transmission of the original message byte sequence, and a checksum pass flag is generated. If the bit-by-bit comparison results are different, it indicates that there is a risk of transmission errors in the original message byte sequence, and a checksum fail flag is generated. The preprocessed access monitoring data includes at least the device message timing sequence, the arrival interval between adjacent messages, the control receipt delay value, the locally calculated checksum value, the checksum pass flag, and the checksum fail flag. It also retains the correspondence between the original message byte sequence, the field parsing start offset value, the field parsing length value, the field parsing value, the field unit identifier value, the uploaded field value, the device status code value, the parsing rule version number value, and the parsing rule loading timestamp. This correspondence is used for subsequent cross-version original message byte sequence alignment, protocol structure conservation chain generation, parsing response decoupling field identification, and field misalignment reconnection.
[0026] This implementation plan unifies the data source, time sequence, instruction receipt relationship, and verification generation method of the access monitoring data, ensuring that the original message byte sequence, field parsing information, uploaded field values, device status code values, and parsing rule version information maintain a stable correspondence within the same device message time sequence. This provides a continuous, reliable, and traceable data foundation for cross-version original message byte sequence alignment, protocol structure conservation chain generation, parsing response decoupling field identification, and field misalignment reconnection, reducing misjudgments of field offsets caused by mixed device channels, disordered time sequence, and inconsistent verification criteria.
[0027] Specifically, the steps for byte-level alignment of cross-version original message byte sequences based on preprocessed access monitoring data and extraction of cross-version stable anchor points based on conserved endpoints are as follows: Read the preprocessed access monitoring data, filter and verify the data records corresponding to the verification marks, group them according to device communication port number, device network address value, and function code value, and sort them in ascending order according to the original message arrival timestamp within each group; during grouping, data records with the same device communication port number, device network address value, and function code value are grouped into the same message group, ensuring that data records within the same message group originate from the same access channel, the same multi-protocol device, and the same functional instruction class. The data records corresponding to the failed verification are then removed to prevent byte errors from participating in the cross-version alignment process. Within each group, when sorting by the original message arrival timestamp in ascending order, the correspondence between the original message byte sequence and the parsing rule version number, parsing rule loading timestamp, data area start byte sequence number, data area byte length, field parsing start offset, and field unit identifier value is preserved. This ensures that subsequent old and new version message sequences can be compared under the same device source and the same function code semantics. The parsing rule loading timestamp corresponding to the later parsing rule version number value among two adjacent parsing rule version number values serves as the boundary. The data records are divided into old version message sequences and new version message sequences. Specifically, data records whose original message arrival timestamp is earlier than the subsequent parsing rule loading timestamp are assigned to the old version message sequence, and data records whose original message arrival timestamp is not earlier than the subsequent parsing rule loading timestamp are assigned to the new version message sequence. This ensures that the division result is consistent with the actual loading time order of parsing rules at the edge nodes. The parsing rule loading timestamp is used as the boundary because private extended fields are usually introduced by online device upgrades, parsing rule updates, and protocol version changes. The parsing rule loading timestamp can separate the original message byte structures before and after the update, avoiding the mixing of data within the same version. The sampling fluctuations were misjudged as cross-version structural changes; the original message byte sequences in the old version message sequence and the new version message sequence were read, and the Needleman-Wunsch global sequence alignment algorithm was used for byte-level alignment; when performing byte-level alignment, the original message byte sequence of the old version was used as the first sequence to be aligned, and the original message byte sequence of the new version was used as the second sequence to be aligned. The same byte value was used as the matching condition, the different byte value was used as the replacement condition, and the existence of a gap on one side was used as the insertion and missing condition. A dynamic programming matrix was constructed according to the Needleman-Wunsch global sequence alignment algorithm, and the global alignment result was obtained by backtracking.The reason for using global sequence alignment is that, even after the insertion of private extended fields, the original message byte sequence still retains a stable structure of bytes related to the device address, function code, data area boundary, and checksum. Global alignment can preserve the relative order between stable byte segments throughout the entire message length, thereby identifying the positions of newly added bytes in the new version of the original message byte sequence relative to the old version. This involves aligning the field positions of the device network address value, the function code value, the data area start boundary corresponding to the data area start byte sequence number, the length field position or length calculation boundary corresponding to the data area byte length value, and the received checksum value in the original message byte sequence. Field positions serve as conserved endpoints; specifically, the field positions of the device network address value, function code value, and receive checksum value in the original message byte sequence are given by the existing parsing rule or protocol specification corresponding to the parsing rule version number value; the data area start boundary position is determined by the data area start byte sequence number; and the length field position or length calculation boundary position corresponding to the data area byte length value is determined by the existing parsing rule or protocol specification corresponding to the parsing rule version number value. The field position corresponding to the device network address value is used to limit the message source, the field position corresponding to the function code value is used to limit the message service type, and the data area start boundary position and data area byte length... The position of the length field corresponding to the value or the boundary position of the length calculation is used to limit the boundary of the data area where the business field is located, and the position of the field corresponding to the received check code value is used to limit the check position at the end of the message. These byte positions are used as conserved endpoints because within the message group corresponding to the same device communication port number, the same device network address value, and the same function code value, the conserved endpoints still have a stable structural constraint effect before and after the version of the parsing rule changes, and can serve as the positioning benchmark for cross-version byte-level alignment results. Byte segments with a consecutive matching byte number greater than the anchor byte number threshold between conserved endpoints are determined as cross-version stable anchors. When determining cross-version stable anchors, the consecutive matching byte segments located between adjacent conserved endpoints are first read from the global alignment result. Next, the number of consecutive matching bytes in each consecutive matching byte segment is counted. When the number of consecutive matching bytes exceeds the anchor byte count threshold, the start byte sequence number, end byte sequence number, number of consecutive matching bytes, and corresponding conserved endpoint number of the consecutive matching byte segment are written into the cross-version stable anchor record. The anchor byte count threshold is determined by the length of the shortest stable matching byte segment in historically validated messages under the same function code value, ensuring that short, noisy matching byte fragments are not mistakenly used as structural anchors. By limiting the extraction range of cross-version stable anchors through conserved endpoints, byte segments that truly remain unchanged with the parsing rule version can be distinguished from byte segments whose message content changes, providing definite byte boundaries for subsequently determining private extended fields between cross-version stable anchors.
[0028] In this implementation scheme, the message source is limited by the device communication port number, device network address value, and function code value. The old version message sequence and the new version message sequence are divided by loading timestamps according to the parsing rules. This allows the original message byte sequences across versions to be compared under the same device source, the same functional semantics, and the same time evolution relationship. Furthermore, by combining the Niedermann-Onsch global sequence alignment algorithm and extracting stable anchor points across versions using the conservation endpoint and anchor byte number thresholds, the relative order of stable structures in the original message byte sequence can be preserved when the insertion of private extension fields causes changes in message length and field offset. This reduces the interference of transmission errors, sampling fluctuations, and short noise matching fragments on protocol structure identification, and provides a clear and stable byte boundary basis for subsequent private extension field location and field misalignment reconnection.
[0029] Specifically, the steps for determining private extended fields between cross-version stable anchors and generating a protocol structure conservation chain are as follows: Figure 3As shown, between the same pair of cross-version stabilizing anchors, byte segments that are not present in the original byte sequence of the old version but exist in the original byte sequence of the new version are read. When reading byte segments, the old version's terminating byte number and the new version's starting byte number in the global alignment result of the same pair of cross-version stabilizing anchors are used as boundaries to extract consecutive byte segments where the corresponding position in the original byte sequence of the old version is empty and the corresponding position in the original byte sequence of the new version has an actual byte value, and the insertion position of this byte segment in the original byte sequence of the new version is recorded. This method is used because inserting the private extended field does not change the byte value of the cross-version stabilizing anchor itself, but it will cause a byte segment that only exists in the original byte sequence of the new version to appear between the two cross-version stabilizing anchors. The initial message byte sequence consists of consecutive byte segments. Therefore, the newly added byte region can be located by the correspondence between the empty spaces in the old version and the actual byte values in the new version. When a byte segment maintains the same byte length in N consecutive frames of the original message byte sequence of the new version, and the corresponding insertion position is located within the data area defined by the starting byte sequence number and the byte length value of the data area, the byte segment is determined as a candidate extension field. The starting byte sequence number, ending byte sequence number, and candidate insertion length value of the candidate extension field are recorded. Here, N represents the number of consecutive frames of the original message byte sequence of the new version used to verify the stability of the candidate extension field length. The value of N ranges from 3 to 10. N is determined by the historical new version corresponding to the same device network address value, the same device communication port number, and the same function code value. The message arrival frequency is determined; when the interval between adjacent message arrivals is less than 1 second, N is 5 to 10; when the interval between adjacent message arrivals is not less than 1 second, N is 3 to 5. In this embodiment, N is 5, which is used to eliminate the misjudgment of newly added bytes caused by single-frame message jitter without significantly extending the online access confirmation time. When determining whether the byte length remains the same, the length of the byte segment corresponding to the same insertion position in the byte sequence of the new version of the original message in N consecutive frames is compared frame by frame. If the length of the byte segment in each frame is consistent with the length of the byte segment in the first frame, the byte segment length is determined to be stable. When determining whether the insertion position is located in the data area, the starting byte sequence number of the candidate extended field is compared with the starting byte sequence number of the data area, and the ending byte sequence number of the candidate extended field is compared with the starting byte sequence number of the data area. The starting byte sequence number is added to the data area byte length value to obtain the ending byte sequence number of the data area. If the starting byte sequence number of the candidate extended field is not less than the starting byte sequence number of the data area, and the ending byte sequence number of the candidate extended field is not greater than the ending byte sequence number of the data area, then the candidate extended field is determined to be located within the data area. The combination of stable length of N consecutive frames and data area boundary limitation is used for judgment because occasional byte misalignment caused by communication jitter is difficult to maintain the same insertion length in multiple consecutive frames, while private extended fields introduced by the version change of the parsing rules are usually located in the business data area and have a stable byte length. The difference between the starting offset value of field parsing in the new version message sequence and the old version message sequence for the same field unit identifier value is calculated to obtain the anchor chain relative offset difference.Specifically, the starting offset values for field parsing in the old and new version message sequences are paired according to the field unit identifier value. The starting offset value for field parsing in the new version message sequence is subtracted from the starting offset value for the same field unit identifier value in the old version message sequence to obtain the relative offset difference of the anchor chain corresponding to each field unit identifier value. Pairing by field unit identifier value is used to maintain semantic consistency of the same business field under different parsing rule versions, avoiding field mismatches caused by pairing only based on field arrangement. When the relative offset difference of the anchor chain corresponding to at least two adjacent field unit identifier values after the same candidate extended field is equal to the same candidate insertion length value, and the number... When the version increment of the data area byte length value equals the candidate insertion length value, the corresponding candidate extended field is determined as a private extended field. At least two adjacent field unit identifier values are limited by an adjacent field quantity threshold. This threshold represents the minimum number of fields required to verify the overall translation relationship of the business fields after the candidate extended field. The adjacent field quantity threshold ranges from 2 to 4 and is determined by the number of field unit identifier values within the data area corresponding to the current function code value. In this embodiment, the adjacent field quantity threshold is 2, meaning that the relative offset difference between the anchor chains corresponding to the unit identifier values of two consecutive fields after the candidate extended field is read, and it is determined whether both relative offset differences are equal to the candidate insertion length value. The version increment of the segment length value is the data area byte length value in the new version message sequence minus the data area byte length value in the old version message sequence. When judging the unit identifier value of adjacent fields, the order of fields after the candidate extended field is determined according to the order of the field parsing start offset value in the original byte sequence of the new version, and the relative offset difference of the anchor chain corresponding to the number of consecutive adjacent fields after the candidate extended field is read. If the relative offset difference of the number of consecutive adjacent fields is equal to the candidate insertion length value, it means that after the candidate extended field is inserted, its subsequent business fields are shifted backward by the same byte length. If the version increment of the data area byte length value is also equal to the candidate insertion length value, it means that the data area... The total length increase is consistent with the length of the candidate extended field itself, which can eliminate misjudgments caused by changes in field values, fluctuations in field content, and single-field parsing anomalies; the protocol structure conservation chain is generated according to the order of the conservation endpoint, cross-version stable anchor point, private extended field, and field parsing start offset value in the original message byte sequence; when generating the protocol structure conservation chain, the conservation endpoint is used as the link boundary node, the cross-version stable anchor point is used as the structure stable node, the private extended field is used as the structure new node, and the field parsing start offset value is used as the business field start node, and the nodes are connected in ascending order of the start byte sequence number in the new version's original message byte sequence to form a protocol structure conservation chain that can represent the order of cross-version message structure changes;The protocol structure's conserved chain simultaneously records the start byte sequence number, end byte sequence number, node type, parsing rule version number, and corresponding function code value for each node. This allows for the subsequent limitation of candidate reconnection intervals based on the position of private extended fields within the chain and the relative offset difference between the anchor chain and the target chain. It also provides a traceable byte structure basis for reconnecting misaligned decoupling fields in the parsed response.
[0030] In this implementation scheme, by jointly constraining the newly added byte segments, data area boundaries, field unit identifier value offset relationships, and data area byte length value version increments in the original message byte sequence of the new version, it is possible to distinguish the private extension fields truly introduced by the parsing rule version changes from field content fluctuations, communication jitter, and single field parsing anomalies. This enables the protocol structure conservation chain to not only record the stable byte structure of cross-version messages, but also to clarify the overall translation relationship caused by the private extension fields to the starting position of subsequent business fields. This provides a continuous and reliable byte structure basis for limiting candidate callback intervals, locating parsing response decoupling fields, and determining misaligned callback fields.
[0031] Specifically, the steps for determining the response window based on the control receipt arrival timestamp and identifying and parsing the response decoupling field are as follows: Read the protocol structure conservation chain and preprocessed access monitoring data; round up the ratio of the control receipt delay value to the adjacent message arrival interval value to obtain the number of response cycles; determine the sampling period interval corresponding to the number of response cycles after the control receipt arrival timestamp as the response window; wherein, the control receipt delay value is obtained by subtracting the control command sending timestamp from the control receipt arrival timestamp; the adjacent message arrival interval value is obtained by subtracting the arrival timestamps of two adjacent original message frames in the device message timing sequence; and the number of response cycles is used to convert the actual communication delay of the control command into the number of sampling cycles, so that the response window... The response window can adaptively change according to the arrival rhythm of messages corresponding to the current device network address value, device communication port number, and function code value. When determining the response window, the sampling period corresponding to the control response arrival timestamp is first located in the device message timing sequence. Then, several sampling periods of consecutive response periods are read after this sampling period to form the response window. When the control response delay value is less than the adjacent message arrival interval value, the number of response periods is rounded up to 1, so that at least one sampling period is included in the response window. When the adjacent message arrival interval value is 0, the median of the adjacent message arrival interval values of the first H frames in the same device message timing sequence is used as the replacement interval value. The value of H ranges from 3 to 7. In this embodiment, H is set to 0. 5. To avoid the inability to calculate the number of receipt response cycles due to writing the same timestamp, read the field parsing value, uploaded field value, and device status code value corresponding to the same field unit identifier value in the receipt response window. Use the Bayesian online change point detection algorithm to calculate the change points of the field parsing value, uploaded field value, and device status code respectively. When reading data, use the field unit identifier value as an index to extract the field parsing value sequence and uploaded field value sequence of the same field unit identifier value in the receipt response window from the preprocessed access monitoring data. Simultaneously extract the device status code value sequence corresponding to the same device network address value, the same device communication port number, and the same function code value. Among them, the field parsing value sequence reflects... The current parsing rule version calculates field changes from the original message byte sequence based on the field parsing start offset and field parsing length. The uploaded field value sequence reflects the field changes actually output from the edge node to the upper-layer application, and the device status code value sequence reflects the changes in the operating status of multi-protocol devices after control receipt. When calculating change points using the Bayesian online change point detection algorithm, the field parsing value sequence, the uploaded field value sequence, and the device status code value sequence are input into the Bayesian online change point detection algorithm in the order of sampling period. The posterior probability of each sampling period becoming a change point is calculated, and the sampling period with a posterior probability greater than the change point probability threshold is determined as the corresponding change point. The change point probability threshold ranges from 0.6 to 0.9. The probability threshold for change points is determined by training on manually labeled field change times in historical control receipt samples. In this embodiment, the probability threshold for change points is 0.75. When the change point of the parsed field value is outside the receipt response window, and the change points of the uploaded field value and the device status code are both inside the receipt response window, the corresponding field unit identifier value is determined as the parsed response decoupling field. Specifically, the timestamp of the field parsed value change point is compared with the start and end timestamps of the receipt response window. If the timestamp of the field parsed value change point is earlier than the start timestamp of the receipt response window, or later than the end timestamp of the receipt response window, then it is determined that the field parsed value change point is outside the receipt response window. The timestamps of the uploaded field value change point and the device status code change point are compared with the start and end timestamps of the receipt response window, respectively. If neither is earlier than the start timestamp of the receipt response window and neither is later than the end timestamp of the receipt response window, then... The determination method is based on the fact that both the change point of the uploaded field value and the change point of the device status code are located within the receipt response window. This method is used because after the control receipt arrives, the device status code value and the uploaded field value should change synchronously within the receipt response window under the actual control response. However, the field parsing value did not change synchronously within the receipt response window, indicating that the original message byte position corresponding to the current field parsing start offset value did not reflect the actual business field change. The field parsing result corresponding to the field unit identifier value is decoupled from the uploaded output and the device status response. Therefore, this field unit identifier value is identified as the parsing response decoupling field, and the field unit identifier value, the timestamp of the field parsing value change point, the timestamp of the uploaded field value change point, the timestamp of the device status code change point, the control receipt arrival timestamp, the receipt response window start timestamp, and the receipt response window end timestamp are recorded. These timestamps are used to subsequently determine the misaligned callback field and the callback field start offset value within the candidate callback interval defined by the protocol structure conservation chain.
[0032] In this implementation, by unifying the control receipt delay value, adjacent message arrival interval value, and receipt response window into the device message timing sequence, and by placing the field parsing value change point, the upload field value change point, and the device status code change point under the same time constraint, it is possible to distinguish between the actual device response after the control receipt and the parsing response caused by the mismatch of the field parsing start offset value. This ensures that the business semantics corresponding to the field unit identifier value no longer depends solely on the current physical byte position, thereby enhancing the temporal causal consistency of edge nodes in identifier parsing, field misalignment identification, and subsequent misalignment reconnection. This reduces the risk of real operating condition changes being misjudged as parsing errors and field misalignments being misjudged as device status changes.
[0033] Specifically, the steps for determining the misaligned callback field and the starting offset value of the callback field within the candidate callback interval defined by the protocol structure conservation chain, and generating the field misaligned callback result are as follows: Read the new version of the original message byte sequence corresponding to the parsing response decoupling field, the field parsing starting offset value, the field parsing length value, the data area starting byte sequence number, the data area byte length value, the candidate insertion length value, and the anchor chain relative offset difference; when reading data, first extract the new version of the original message byte sequence from the preprocessed access monitoring data before the field misaligned callback based on the field unit identifier value corresponding to the parsing response decoupling field, and simultaneously read the field parsing starting offset value and field parsing length value bound to the field unit identifier value under the same parsing rule version number. The value is then read from the protocol structure conservation chain, along with the position of the private extension field corresponding to the same function code value, the candidate insertion length value, and the anchor chain relative offset difference. This ensures that subsequent callback searches are performed only within the data range corresponding to the same device network address value, the same device communication port number, the same function code value, and the same parsing rule version number value. The field parsing start offset value is added to the anchor chain relative offset difference to obtain the candidate callback center offset value. Here, the field parsing start offset value represents the original physical starting position given by the current parsing rule version for the parsing response decoupling field, and the anchor chain relative offset difference represents the byte shift of the service field corresponding to the same field unit identifier value relative to the old version message sequence after the private extension field is inserted. The sum of the two values yields the desired result. The parsing response decoupling field is used to determine the possible reconnection center position in the new version's original message byte sequence. Within the data area defined by the starting byte number and the data area byte length, the candidate reconnection interval is obtained by extending the candidate insertion length forward and backward, centered on the candidate reconnection center offset. When determining the candidate reconnection interval, the starting byte number of the data area is first used as the minimum allowed boundary of the candidate reconnection interval. Then, the starting byte number of the data area is added to the data area byte length to obtain the ending byte number of the data area, and the ending byte number of the data area is used as the maximum allowed boundary of the candidate reconnection interval. The starting position of the candidate reconnection interval is the larger of the candidate reconnection center offset minus the candidate insertion length and the starting byte number of the data area. The candidate callback interval termination position is determined by the smaller of the candidate callback center offset value plus the candidate insertion length value and the data area termination byte sequence number. The candidate insertion length value is used to limit the search range before and after because field misalignment caused by private extended fields usually manifests as an overall shift of subsequent fields, with the shift range consistent with the length of the newly added byte. If the search range deviates from this shift range, non-target business fields will be included in the candidate range, increasing the risk of erroneous callbacks. The field parsing length value is used as the window length. Candidate replacement byte segments are extracted byte by byte within the candidate callback interval, and the candidate replacement byte segments are converted into candidate replacement field values according to the field data type, byte order rule, sign bit rule, and proportional conversion rule corresponding to the parsing rule version number value.During byte-by-byte truncation, starting from the beginning of the candidate callback interval, the field parsing length is used as the fixed truncation length. The truncation window moves one byte forward each time until the end of the truncation window does not exceed the end of the candidate callback interval. For each candidate replacement byte segment, the correspondence between the starting byte number, ending byte number, candidate replacement field value, and field unit identifier value is recorded. Byte-by-byte sliding truncation using a fixed field parsing length is employed because the field length is determined by the business semantics corresponding to the field unit identifier value. Misaligned callbacks require correction of the field's starting offset position, not a change in the field parsing length. A Bayesian online change point detection algorithm is used to calculate the change points of the candidate replacement field values, based on the number of candidate replacement fields. The algorithm calculates the misalignment and reconnection matching value for the following parameters: value change point, uploaded field value change point, device status code change point, starting byte sequence number of candidate replacement byte segment, field parsing starting offset value, anchor chain relative offset difference value, candidate insertion length value, candidate replacement field value, and uploaded field value. When calculating the candidate replacement field value change point, the candidate replacement field values corresponding to each sampling period within the receipt response window are input into the Bayesian online change point detection algorithm in ascending order of the original message arrival timestamp to obtain the candidate replacement field value change point timestamp. Then, the candidate replacement field value change point timestamp is compared with the uploaded field value change point timestamp and the device status code change point timestamp to characterize whether the candidate replacement byte segment is synchronized with the actual business changes after the control receipt. Simultaneously, the difference between the starting byte sequence number of the candidate replacement byte segment and the starting offset value of the field parsing is compared with the relative offset difference of the anchor chain to characterize whether the candidate replacement byte segment conforms to the byte translation relationship caused by the private extended field; then, the candidate replacement field value in the receipt response window is compared with the uploaded field value on a sampling periodic basis to characterize whether the candidate replacement field value matches the actual transmitted value; the misaligned reconnection matching value simultaneously constrains the response timing, byte position, and numerical alignment relationship, so that the field reconnection result does not only depend on a single offset distance, nor only on a single numerical similarity; the candidate replacement byte segment with the largest misaligned reconnection matching value is determined as the misaligned reconnection field, and the starting byte sequence number of the misaligned reconnection field is determined as the starting offset value of the reconnection field; after determining the misaligned reconnection field... When reconnecting a field, all candidate replacement byte segments formed within the candidate reconnect interval for the same parsed response decoupling field are sorted from largest to smallest by their misalignment reconnection matching value. The candidate replacement byte segment with the highest sorting value is selected as the misalignment reconnection field. If multiple candidate replacement byte segments have the same misalignment reconnection matching value, the candidate replacement byte segment whose starting byte sequence number is closest to the candidate reconnection center offset value is selected as the misalignment reconnection field. The maximum misalignment reconnection matching value is used to determine the reconnection field because this candidate replacement byte segment has the strongest acknowledgment response synchronization, the most consistent anchor chain offset relationship, and the closest upload field value change, which can more accurately represent the true physical position of the parsed response decoupling field in the new version's original message byte sequence.The parsing response decoupling field, misaligned callback field, callback field start offset value, misaligned callback matching value, and parsing rule version number are bound together to generate a field misaligned callback result. The field misaligned callback result synchronously records the device communication port number, device network address value, function code value, field unit identifier value, field parsing length value, candidate callback center offset value, and candidate callback interval. This allows for subsequent correction of the target physical field start offset value based on the callback field start offset value and provides a definite physical field location basis for the generation of the virtual field address value and the virtual-physical field mapping table.
[0034] In this implementation scheme, by limiting the decoupling field of the parsing response to the data area boundary corresponding to the protocol structure conservation chain, and by uniformly incorporating the candidate callback center offset value, candidate insertion length value, candidate replacement field value change point, upload field value change point, and device status code change point into the misaligned callback matching value, the byte shift relationship caused by the private extended field can be correlated with the actual business response after the control receipt. This makes the determination of the misaligned callback field no longer dependent on single frame message length verification and static field offset configuration, thereby accurately restoring the actual physical field position corresponding to the field unit identifier value after the parsing rule version changes, reducing the risks of field misalignment upload, control response misjudgment, and callback position drift.
[0035] Specifically, the steps for calculating the misalignment reconnection matching value are as follows: Add the absolute value of the difference between the candidate substitution field value change point timestamp and the upload field value change point timestamp to the absolute value of the difference between the candidate substitution field value change point timestamp and the device status code change point timestamp, divide by the sum of the control acknowledgment delay value and the adjacent message arrival interval value, and then take a negative exponent with the natural constant e as the base to obtain the response synchronization item; where the candidate substitution field value change point timestamp is obtained by using the Bayesian online change point detection algorithm within the acknowledgment response window, the upload field value change point timestamp is obtained by using the Bayesian online change point detection algorithm within the acknowledgment response window, and the device status code change point timestamp... The status code change timestamp is obtained by using a Bayesian online change point detection algorithm within the acknowledgment response window based on the device status code value. When calculating the response synchronization item, the first time deviation between the candidate replacement field value change timestamp and the uploaded field value change timestamp is calculated first. Then, the second time deviation between the candidate replacement field value change timestamp and the device status code change timestamp is calculated. The first and second time deviations are added together to obtain the total response deviation. This total deviation is then normalized using the sum of the control acknowledgment delay value and the arrival interval of adjacent messages, ensuring that candidate replacement byte segments with different sampling frequencies and communication delays can be compared on the same time scale. A negative... The exponential form is used because the closer the timestamp of the candidate replacement field value change point is to the timestamp of the upload field value change point and the timestamp of the device status code change point, the smaller the total response deviation value and the closer the response synchronization item is to 1, indicating that the candidate replacement byte segment is more consistent with the actual response timing after the control receipt. The position recovery item is obtained by subtracting the anchor chain relative offset difference from the difference between the candidate replacement byte segment's starting byte sequence number and the field parsing starting offset value, taking the absolute value, dividing it by the candidate insertion length value plus one, and then taking a negative exponent with the natural constant e as the base. Here, the candidate replacement byte segment's starting byte sequence number indicates the starting position of the candidate replacement byte segment in the new version's original message byte sequence, and the field parsing starting offset value indicates the parsing... The response decoupling field is the original parsing start position under the current parsing rule version. The anchor chain relative offset difference represents the byte shift of the field parsing start offset value relative to the old version message sequence after the private extension field is inserted. When calculating the position reconnection item, the candidate replacement byte segment start byte sequence number is first subtracted from the field parsing start offset value to obtain the candidate actual offset value. Then, the candidate actual offset value is subtracted from the anchor chain relative offset difference to obtain the candidate offset residual value. The absolute value of the candidate offset residual value is then taken. The value after adding one to the candidate insertion length value is used as the denominator for position normalization, which can avoid division by zero when the candidate insertion length value is zero and make the candidate offset residual value scaled according to the insertion scale of the private extension field.The negative exponential form is used because the closer the candidate actual offset value is to the relative offset difference of the anchor chain, the smaller the candidate offset residual value, and the closer the position reconnection term is to 1, indicating that the candidate replacement byte segment is more consistent with the overall field translation relationship caused by the private extended field. The candidate replacement field values corresponding to the M sampling periods within the receipt response window are paired with the uploaded field values periodically. The absolute value of the difference between the two in each sampling period is calculated and divided by the sum of the standard deviation of the uploaded field value and the minimum constant to obtain M single-period normalized numerical deviation values. The arithmetic mean of the M single-period normalized numerical deviation values is calculated, and the reciprocal of the mean plus one is taken to obtain the numerical fit term; where M is the reconnection term. The number of sampling periods in the response window that can simultaneously obtain the values of candidate replacement fields and uploaded fields. All candidate replacement byte segments corresponding to the same parsed response decoupling field use the same M. Among them, the candidate replacement field values in the response window are paired with the uploaded field values according to the arrival timestamp of the original message, and the absolute value of the difference between the candidate replacement field value and the uploaded field value in the same sampling period is first calculated. Then, it is divided by the sum of the standard deviation of the uploaded field value and the minimum constant to obtain the single-period normalized numerical deviation value. The standard deviation of the uploaded field value is calculated from all uploaded field values in the response window. The range of the minimum constant is: arrive In this embodiment, the minimum constant is taken as This is used to avoid division by zero when the standard deviation of the uploaded field value is zero. The average deviation value of all single-cycle normalized values is obtained by averaging the deviation values. Then, the window average deviation value is increased by one and the reciprocal is taken to obtain the numerical fitting term, so that the numerical fitting term is within the positive range. The smaller the window average deviation value, the closer the numerical fitting term is to 1, indicating that the candidate replacement field value is more consistent with the uploaded field value within the acknowledgment response window. The response synchronization term, position return term, and numerical fitting term are multiplied to obtain the misaligned return matching value. The misaligned return matching value is constrained by the response synchronization term, position return term, and numerical fitting term. If any constraint relationship deviates, the misaligned return matching value will decrease. This ensures that the finally selected candidate replacement byte segment simultaneously satisfies the timing response relationship after the control acknowledgment, the byte translation relationship caused by the private extended field, and the numerical fitting relationship of the uploaded field, thereby determining the misaligned return field and the start offset value of the return field.
[0036] The specific formula for calculating the misaligned reconnection matching value is as follows: ; In the formula, This represents the misalignment reconnection match value corresponding to the m-th candidate replacement byte segment; This represents the timestamp of the change point in the value of the candidate replacement field corresponding to the m-th candidate replacement byte segment; This represents the timestamp indicating the point in time when the uploaded field's value changed. Indicates the timestamp of the device status code change point; Indicates the control acknowledgment delay value; Indicates the interval between adjacent message arrivals; Indicates the starting byte number of the m-th candidate replacement byte segment; This indicates the starting offset value for parsing the field corresponding to the unhooked field in the parsed response; This indicates the relative offset difference of the anchor chain; Indicates the candidate insertion length value; Indicates the number of sampling periods within the receipt response window; This represents the candidate substitution field value calculated from the m-th candidate substitution byte segment in the q-th sampling period; This indicates the uploaded field value corresponding to the unit identifier value of the same field in the qth sampling period; This represents the standard deviation of the uploaded field values within the receipt response window; This represents a minimal constant to prevent the denominator from being zero.
[0037] In this implementation scheme, by uniformly mapping the timestamps of changes in candidate replacement field values, upload field values, device status code changes, candidate replacement byte segment start byte sequence number, anchor chain relative offset difference, candidate replacement field values, and upload field values to misaligned callback matching values, it is possible to simultaneously constrain the timing of receipt responses, byte shift positions, and field value consistency under the same discrimination scale. This ensures that misaligned callback fields are no longer determined solely by a single time proximity relationship, a single byte offset relationship, or a single numerical similarity relationship, thereby reducing the risk of misselection of candidate replacement byte segments, improving the stability of determining the starting offset value of callback fields, and providing a more reliable matching basis for generating the virtual-real field mapping table.
[0038] Table 1. Matching Values of Candidate Alternate Byte Segment Misalignment Reconnection
[0039] In this embodiment, the starting offset value for field parsing is 20, the relative offset difference of the anchor chain is 4, the candidate insertion length is 4, and therefore the candidate reconnection center offset value is 24; the control receipt delay value is 1.2, the adjacent message arrival interval is 0.5, the timestamp of the uploaded field value change point is 10.8, and the timestamp of the device status code change point is 11.0; the uploaded field values in the receipt response window are 100, 122, 124, and 126 respectively, the standard deviation of the uploaded field values is 10.488, and the minimum constant is 0.000001. Table 1 is a data table of candidate replacement byte segment misalignment reconnection matching values, used to illustrate the process of determining misalignment reconnection fields within the candidate reconnection interval. Specifically, it lists the starting byte sequence number, the timestamp of the candidate replacement field value change point, the candidate replacement field value in the receipt response window, the response synchronization item, the position reconnection item, the value matching item, and the misalignment reconnection matching value of the five candidate replacement byte segments within the candidate reconnection interval. Among them, C1's starting byte sequence number is 22, the timestamp of the candidate substitution field value change point is 13.0, and the candidate substitution field values in the receipt response window are 89, 94, 95, and 96, with a corresponding misalignment reconnection matching value of 0.017; C2's starting byte sequence number is 23, the timestamp of the candidate substitution field value change point is 12.0, and the candidate substitution field values in the receipt response window are 96, 111, 113, and 114, with a corresponding misalignment reconnection matching value of 0.118; C3's starting byte sequence number is 24, the timestamp of the candidate substitution field value change point is 10.9, and the timestamp of the candidate substitution field value change point in the receipt response window is 13.0, with a corresponding misalignment reconnection matching value of 0.017. The selected replacement field values are 101, 121, 125, and 127, with a corresponding misalignment matching value of 0.812; the starting byte sequence number of C4 is 25, the timestamp of the candidate replacement field value change point is 11.3, and the candidate replacement field values in the receipt response window are 106, 132, 136, and 139, with a corresponding misalignment matching value of 0.259; the starting byte sequence number of C5 is 26, the timestamp of the candidate replacement field value change point is 9.5, and the candidate replacement field values in the receipt response window are 115, 144, 148, and 151, with a corresponding misalignment matching value of 0.042.
[0040] like Figure 4 As shown, the timing determination results of misaligned callback fields within the candidate callback interval are displayed. The horizontal axis represents the starting byte sequence number of the candidate replacement byte segment, and the vertical axis represents the timestamp of the change point. Dashed lines represent the timestamp of the upload field value change point, dotted lines represent the timestamp of the device status code change point, dots represent the value change points of each candidate replacement field, and pentagrams represent the confirmed misaligned callback fields. Figure 4As can be seen, candidate replacement byte segments C1 to C5 correspond to different starting byte sequences and misalignment recovery matching values. Among them, C3 is located at the starting byte sequence number 24. Its candidate replacement field value change point timestamp is close to both the upload field value change point timestamp and the device status code change point timestamp. Moreover, the misalignment recovery matching value R=0.812, which is the maximum value among all candidate replacement byte segments. Therefore, C3 is determined as the misalignment recovery field, and the starting byte sequence number 24 is determined as the recovery field starting offset value, which is used to generate the field misalignment recovery result. Figure 4 It can intuitively show the matching relationship between the candidate replacement byte segment and the timing of the receipt response, making the process of determining the misaligned callback field clearer.
[0041] Specifically, the steps for generating candidate semantic nodes based on the protocol structure conservation chain and field misalignment reconnection results, establishing a field semantic inertia graph, and determining the starting offset value of the target physical field are as follows: Read the protocol structure conservation chain and field misalignment reconnection results, and combine the corresponding field parsing starting offset value, reconnection field starting offset value, field parsing length value, and misalignment reconnection matching value for the same field unit identifier value under different parsing rule version numbers to form candidate semantic nodes; when combining candidate semantic nodes, first limit the reading range according to the device communication port number, device network address value, and function code value, and then arrange the field misalignment reconnection results in ascending order of parsing rule version number values, so that the same field unit identifier value changes during the parsing rule version process. The physical location changes within the record can form a continuous record; each candidate semantic node records at least the field unit identifier value, parsing rule version number, field parsing start offset value, reconnection field start offset value, field parsing length value, misaligned reconnection matching value, candidate insertion length value, anchor chain relative offset difference value, and corresponding protocol structure conservation chain number. The field unit identifier value is used to maintain semantic consistency of business fields, the field parsing length value is used to maintain consistent field reading range, the reconnection field start offset value is used to represent the candidate physical location obtained after misaligned reconnection, and the misaligned reconnection matching value is used to represent the comprehensive consistency between the candidate physical location and the receipt response timing, byte shift relationship, and uploaded field value fit relationship; the field unit identifier value is used to maintain semantic consistency of business fields, the field parsing length value is used to maintain semantic consistency of business fields, the field parsing length value is used to maintain consistent field reading range, the reconnection field start offset value is used to represent the candidate physical location obtained after misaligned reconnection, and the misaligned reconnection matching value is used to represent the comprehensive consistency between the candidate physical location and the receipt response timing, byte shift relationship, and uploaded field value fit relationship; the field unit identifier value is used to maintain semantic consistency of business fields, the field parsing start offset ... The conditions for node connection are the same field parsing length value and a misalignment reconnection matching value greater than the reconnection matching threshold. Semantic inertia edges are established between candidate semantic nodes corresponding to two adjacent parsing rule version number values after sorting by parsing rule loading timestamps. The reconnection matching threshold ranges from 0.60 to 0.85, and is determined by the lower quartile of the misalignment reconnection matching value corresponding to the correctly reconnected field in historical misalignment reconnection samples (manually confirmed). In this embodiment, the reconnection matching threshold is 0.70. When establishing semantic inertia edges, only candidate semantic nodes with adjacent parsing rule version number values are connected, and the two candidate semantic nodes must have the same field unit identifier value and the same field parsing length value to avoid different... Error connections are formed between business fields. This connection method is adopted because changes in the parsing rule version usually only change the physical starting position of the business field in the original message byte sequence, without changing the business semantics and field parsing length value corresponding to the unit identifier value of the same field. Therefore, the candidate semantic nodes between adjacent parsing rule version numbers can represent the cross-version positional continuation relationship of the same business field. When the absolute value of the difference between the starting offset value of the callback field and the starting offset value of the field parsing corresponding to the semantic inertia edge is not greater than the candidate insertion length value, and the difference between the starting offset value of the callback field and the starting offset value of the field parsing has the same sign as the difference between the relative offset of the anchor chain, the corresponding semantic inertia edge is marked as a usable semantic inertia edge, and a field semantic inertia graph is generated.When determining if the difference has the same sign, first calculate the return offset difference by subtracting the field parsing start offset from the return field's starting offset value. Then, calculate the product of the return offset difference and the anchor chain relative offset difference. If the product is greater than zero, the return offset difference and the anchor chain relative offset difference are considered to have the same sign. When both the return offset difference and the anchor chain relative offset difference are zero, they are considered to satisfy the same-direction stability condition. The restriction that the absolute value of the difference should not exceed the candidate insertion length value is because the field position change caused by the private extended field should not exceed the byte translation scale limited by the candidate insertion length value. The same sign judgment is used because the movement direction of the return field's starting offset value relative to the field parsing start offset value should be consistent with the overall direction represented by the anchor chain relative offset difference. Consistent translation direction is essential to demonstrate that semantic inertia edges reflect genuine cross-version positional continuity caused by the insertion of private extended fields, rather than reverse jumps caused by mismatches between adjacent fields. The field semantic inertia graph uses candidate semantic nodes as graph nodes and semantic inertia edges as graph edges, recording the starting point parsing rule version number, ending point parsing rule version number, callback offset difference, anchor chain relative offset difference, candidate insertion length, and available semantic inertia edge markers for each edge. Edges not marked as available semantic inertia edges in the field semantic inertia graph are deleted. When deleting edges, all candidate semantic nodes are retained, and only edges that do not meet the requirements of consistent field semantics, consistent field length, callback matching threshold, translation amplitude, and same-direction translation are removed. The semantic inertia edge of the condition ensures that the subsequent selection of the target semantic inertia edge is only performed within the trusted cross-version connection range. Among the available semantic inertia edges corresponding to the unit identifier value of the same field, the target semantic inertia edge is selected in the following order: maximum number of cross-version stable anchors, maximum misaligned back-loop matching value, and minimum absolute value of the difference between the back-loop field start offset value and the field parsing start offset value. The back-loop field start offset value corresponding to the endpoint of the target semantic inertia edge is determined as the target physical field start offset value. Among them, the number of cross-version stable anchors is read from the protocol structure conservation chain corresponding to the target semantic inertia edge, which is used to represent the strength of the cross-version connection under the constraint of the stable byte structure. The misaligned back-loop matching value is obtained from the target semantic inertia edge. Endpoint candidate semantic nodes are read to indicate the degree of matching between the reconnected field and the response timing, byte position, and field value. The absolute value of the difference between the starting offset of the reconnected field and the starting offset of the field parsing is used to indicate the position correction magnitude. This selection order is adopted because the more cross-version stable anchors there are, the more fully the protocol structure conservation chain constrains the field position continuity relationship. When the number of cross-version stable anchors is the same, the larger the misaligned reconnection matching value, the more consistent the reconnected field is with the real response. When the misaligned reconnection matching values are the same, the smaller the absolute value of the difference, the smaller the correction magnitude of the target physical field's starting offset to the original parsed field position, which can reduce field mismatch caused by excessive reconnection.The final target physical field's starting offset value is bound to the field unit identifier value, field parsing length value, parsing rule version number value, function code value, and device network address value. This binding is used to subsequently generate virtual field address values and a virtual-physical field mapping table.
[0042] In this implementation plan, by uniformly incorporating the field unit identifier value, field parsing length value, misalignment reconnection matching value, anchor chain relative offset difference, and cross-version stable anchor point number into the field semantic inertia graph, the physical position continuity relationship of the same business field under different parsing rule version number values can be stably expressed. This allows the starting offset value of the target physical field to no longer be directly determined by a single misalignment reconnection result, but to be selected under the conditions of semantic consistency, length consistency, translation direction consistency, and sufficient structural anchoring. This enhances the binding stability between the field unit identifier value and the actual physical field position during the identifier parsing process and reduces the risk of field jumps, reverse mismatches, and over-correction caused by changes in parsing rule versions.
[0043] Specifically, the steps for generating virtual field address values and a virtual-physical field mapping table, parsing subsequent original message byte sequences based on the virtual-physical field mapping table, and outputting the edge node decoupling access results are as follows: A virtual field address value is generated for each field unit identifier value. The virtual field address value is obtained by hashing the device network address value, function code value, field unit identifier value, and field parsing length value. In case of hash collisions, the device communication port number and an incrementing collision sequence number are appended to form a unique address. When generating the virtual field address value, the device network address value, function code value, field unit identifier value, and field parsing length value are first concatenated into the address text in a fixed order, and then the SHA-256 hash algorithm is used to hash the address. The original text undergoes hash calculation, and the first L bits of the hash result are extracted as the virtual field address value. The value of L ranges from 16 to 32 hexadecimal characters; in this embodiment, L is 24 hexadecimal characters. After generating the virtual field address value, the virtual-physical field mapping table is checked to see if there is a matching virtual field address value. If no matching virtual field address value exists, the virtual field address value is written to the virtual-physical field mapping table. If a matching virtual field address value exists but the corresponding address text is different, a hash collision is determined to have occurred. The device communication port number and the incrementing collision sequence number are appended to the end of the address text, and the SHA-256 hash calculation is re-executed. The virtual-physical field mapping table is checked again until the virtual-physical field mapping table is completed. The table does not contain duplicate virtual field address values. Virtual field address values are generated using device network address values, function code values, field unit identifier values, and field parsing length values because these data can stably represent the same multi-protocol device, the same functional instruction type, and the same business field semantics, and do not change with the parsing rule version number, thus ensuring that the virtual field address value remains unchanged even when the parsing rule version number changes. The virtual field address value is compared with the target physical field start offset value, field parsing length value, parsing rule version number value, function code value, private extended field start byte sequence number, private extended field end byte sequence number, candidate insertion length value, and the cross-version stable anchor point interval identifier and anchor. The relative offset difference of the chain is bound to generate a virtual-physical field mapping table. The virtual-physical field mapping table uses the virtual field address value as the index, the target physical field start offset value and field parsing length value as the physical read value, the parsing rule version number value and function code value as the version adaptation value, and the private extended field start byte sequence number, private extended field end byte sequence number, candidate insertion length value, cross-version stable anchor point interval identifier, and anchor chain relative offset difference as the offset change source value. The virtual field address value remains unchanged when the parsing rule version number value changes, while the target physical field start offset value is updated as the parsing rule version number value, the private extended field position, and the anchor chain relative offset difference change.This binding method is adopted because the business semantics corresponding to the field unit identifier value need to remain stable across different parsing rule version number values. However, the actual byte positions in the original message byte sequence shift with the insertion of private extended fields. Therefore, the business semantics are fixed using virtual field address values, while the target physical field's starting offset value adapts to changes in physical location. Subsequent original message byte sequences are read, and the target physical field byte segment is extracted according to the virtual-physical field mapping table and converted into a virtual field parsing value. When reading subsequent original message byte sequences, the corresponding record in the virtual-physical field mapping table is first matched based on the device network address value, device communication port number, function code value, and parsing rule version number value. Then, the target physical field byte segment is extracted from the original message byte sequence. The physical field's starting offset is used as the truncation point, and the field parsing length is used as the truncation length. The target physical field byte segment is truncated, and the virtual field parsing value is obtained by converting it according to the field data type, byte order rule, sign bit rule, and proportional conversion rule corresponding to the parsing rule version number value. The absolute value of the difference between the virtual field parsing value and the uploaded field value corresponding to the same field unit identifier value is calculated to obtain the virtual field access deviation value. When calculating the virtual field access deviation value, the virtual field parsing value corresponding to the same field unit identifier value within the same sampling period is paired with the uploaded field value, and the absolute value of the difference between the two is taken to obtain the virtual field access deviation value for a single sampling period. When the same field unit identifier value is within K consecutive... When the virtual field access deviation value within the sampling period is less than the access deviation threshold, the corresponding virtual field address value is marked as a stable decoupling field. Here, K represents the number of consecutive sampling periods used to confirm stable access of the virtual field address value. The value of K ranges from 3 to 8, and K is determined by the historical sampling frequency corresponding to the same device network address value and the same function code value. In this embodiment, K is set to 5. The access deviation threshold is determined by the historical upload field value fluctuation range corresponding to the same field unit identifier value. Specifically, twice the standard deviation of the upload field value within the historical normal access interval is taken as the access deviation threshold. When this value is less than the minimum allowable deviation value, the minimum allowable deviation value is used. Confirmation is performed using K consecutive sampling periods because within a single sampling period... Virtual field access deviation values may be affected by message delays and instantaneous field fluctuations. If the access deviation threshold is met for multiple consecutive sampling periods, it indicates that the starting offset value of the target physical field in the virtual-physical field mapping table has stabilized and corresponds to the uploaded field value. When all virtual field address values corresponding to the same device network address value are marked as stable decoupling fields, the corresponding device network address value is marked as a successfully decoupled access device. When determining a successfully decoupled access device, first count the total number of virtual field address values written to the virtual-physical field mapping table under the same device network address value and the same function code value, then count the number of virtual field address values marked as stable decoupling fields. When the two are consistent, the corresponding device network address value is marked as a successfully decoupled access device.The output includes the edge node decoupling access result, which contains the virtual field address value, the virtual-physical field mapping table, the stable decoupling field, and the successfully decoupled devices. The result also records the device communication port number, device network address value, function code value, field unit identifier value, target physical field start offset value, field parsing length value, parsing rule version number value, virtual field access deviation value, and corresponding sampling period. This allows subsequent original packet byte sequences to access the target physical field start offset value under the current parsing rule version number without relying on a fixed field parsing start offset value. This enables continuous access for the same field unit identifier value even after parsing rule version changes.
[0044] In this implementation scheme, by solidifying the business semantics corresponding to the field unit identifier value into a virtual field address value, and establishing a stable correspondence between the target physical field starting offset value, the parsing rule version number value, the private extended field, and the virtual-physical field mapping table, the subsequent original packet byte sequence can still complete field reading according to the same virtual field address value after the parsing rule version changes, avoiding access interruption due to changes in the physical byte position of the business field. At the same time, the virtual field access deviation value within K consecutive sampling periods is used to confirm the stability of the virtual-physical field mapping table, ensuring that the field semantics, physical position, and uploaded field value remain consistent during the identifier resolution process. This reduces the risk of field misalignment upload caused by the insertion of private extended fields and improves the access continuity and field resolution reliability after online upgrades of multi-protocol devices.
[0045] like Figure 2As shown, the second aspect of the present invention provides an edge node decoupled access system based on automatic protocol parsing, comprising: an access packet timing processing module, a protocol structure conservation construction module, a receipt causal field callback module, and a semantic address decoupled access module, wherein: the access packet timing processing module is used to collect access monitoring data and generate a device packet timing sequence according to the arrival timestamp of the original packet, generate a verification flag based on the original packet byte sequence and the received checksum value, and output the preprocessed access monitoring data; the protocol structure conservation construction module is used to perform byte-level alignment of the cross-version original packet byte sequence based on the preprocessed access monitoring data, extract cross-version stable anchor points based on the conservation endpoints, and perform cross-version stable... Private extended fields are determined between anchor points to generate a protocol structure conservation chain; the receipt causal field back-up module is used to determine the receipt response window based on the control receipt arrival timestamp, identify and parse the response decoupling field, and determine the misaligned back-up field and the starting offset value of the back-up field within the candidate back-up interval defined by the protocol structure conservation chain, generating the field misalignment back-up result; the semantic address decoupling access module is used to generate candidate semantic nodes based on the protocol structure conservation chain and the field misalignment back-up result, establish a field semantic inertial graph and determine the starting offset value of the target physical field, generate virtual field address values and a virtual-physical field mapping table, parse the subsequent original message byte sequence based on the virtual-physical field mapping table, and output the edge node decoupling access result.
[0046] In this implementation scheme, by continuously transmitting monitoring data, protocol structure conservation chain, field misalignment callback results, and virtual-physical field mapping table, the decoupled access of the original message byte sequence from reception timing, cross-version byte structure, causal relationship of receipt response to virtual field address value forms a closed-loop processing link. Under the conditions of parsing rule version change and private extended field insertion, it can maintain a stable correspondence between field unit identifier value, target physical field starting offset value, uploaded field value and device status code value. This makes identifier parsing no longer dependent on fixed field parsing starting offset value, thereby reducing the risk of erroneous upload caused by field parsing misalignment despite normal communication, and improving the stability of field positioning and online upgrade adaptability after multi-protocol device access.
[0047] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0048] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for decoupling access of edge nodes based on automatic protocol parsing, characterized in that, Includes the following steps: S1: Collect access monitoring data and generate device message timing sequence according to the arrival timestamp of the original message. Generate a verification mark based on the original message byte sequence and the received check code value, and output the preprocessed access monitoring data. S2, based on the preprocessed access monitoring data, perform byte-level alignment of the original cross-version message byte sequence, extract cross-version stable anchors based on the conserved endpoints, and determine private extended fields between cross-version stable anchors to generate a protocol structure conservation chain; S3, determine the receipt response window based on the control receipt arrival timestamp, identify and parse the response decoupling field, and determine the misaligned reconnection field and the reconnection field start offset value within the candidate reconnection interval defined by the protocol structure conservation chain, and generate the field misalignment reconnection result; S4 generates candidate semantic nodes based on the protocol structure conservation chain and field misalignment reconnection results, establishes a field semantic inertial graph and determines the starting offset value of the target physical field, generates virtual field address values and virtual-physical field mapping table, parses the subsequent original message byte sequence based on the virtual-physical field mapping table, and outputs the edge node decoupling access result.
2. The edge node decoupling access method based on automatic protocol parsing according to claim 1, characterized in that: The specific steps for collecting access monitoring data, generating device message timing sequences based on the original message arrival timestamps, and generating verification markers based on the original message byte sequences and received checksum values are as follows: The system collects access monitoring data generated when edge nodes access multi-protocol devices. This access monitoring data includes the original packet byte sequence, original packet arrival timestamp, device communication port number, device network address value, function code value, data area start byte sequence number, data area byte length value, received checksum value, control command sending timestamp, control receipt arrival timestamp, parsing rule version number value, parsing rule loading timestamp, field parsing start offset value, field parsing length value, field parsing value, field unit identifier value, uploaded field value, and device status code value. Based on the original message arrival timestamp, the access monitoring data corresponding to the same device network address value and the same device communication port number are sorted in ascending order to generate a device message time sequence. The difference between the arrival timestamps of two adjacent original frames in the device message timing sequence is used to obtain the adjacent message arrival interval; the control receipt arrival timestamp is subtracted from the control command sending timestamp to obtain the control receipt delay value. The Cyclic Redundancy Check (CRC) algorithm is used to perform check calculations on the original message byte sequence to obtain the locally calculated check code value. The locally calculated check code value is compared with the received check code value. If the two are the same, a check pass flag is generated. If the two are different, a check fail flag is generated. The preprocessed access monitoring data is then output.
3. The edge node decoupling access method based on automatic protocol parsing according to claim 2, characterized in that: The specific steps for performing byte-level alignment of the original cross-version packet byte sequences based on preprocessed access monitoring data and extracting cross-version stable anchor points based on conserved endpoints are as follows: Read the preprocessed access monitoring data, filter and verify the data records corresponding to the markers, group them according to the device communication port number, device network address value and function code value, and sort them in ascending order according to the original message arrival timestamp within each group; The data records are divided into old version message sequences and new version message sequences, with the loading timestamp of the parsing rule corresponding to the later parsing rule version number value among two adjacent parsing rule version number values as the boundary. The original message byte sequences in the old version message sequence and the new version message sequence are read, and byte-level alignment is performed using the Needleman-Wunsch global sequence alignment algorithm. The byte segments corresponding to the device network address value, the function code value, the data area start byte sequence number, the data area byte length value, and the received check code value are used as conserved endpoints. The byte segments with a consecutive matching number of bytes between the conserved endpoints that is greater than the anchor byte number threshold are determined as cross-version stable anchors.
4. The edge node decoupling access method based on automatic protocol parsing according to claim 3, characterized in that: The specific steps for determining private extended fields between cross-version stable anchors and generating a protocol structure conservation chain are as follows: Between the same pair of cross-version stable anchors, read byte segments that are not present in the original byte sequence of the old version but exist in the original byte sequence of the new version; when the byte segment maintains the same byte length in the original byte sequence of the new version for N consecutive frames, and the corresponding insertion position is located within the data area defined by the starting byte sequence number and the byte length value of the data area, the byte segment is determined as a candidate extension field, and the starting byte sequence number, ending byte sequence number and candidate insertion length value of the candidate extension field are recorded; Calculate the difference between the starting offset values of field parsing for the same field unit identifier value in the new version message sequence and the old version message sequence to obtain the anchor chain relative offset difference; when the anchor chain relative offset difference corresponding to at least two adjacent field unit identifier values after the same candidate extension field is equal to the same candidate insertion length value, and the version increment of the data area byte length value is equal to the candidate insertion length value, the corresponding candidate extension field is determined as a private extension field; The protocol structure conservation chain is generated according to the order of the conservation endpoints, cross-version stable anchors, private extended fields, and field parsing start offset values in the original message byte sequence.
5. The edge node decoupling access method based on automatic protocol parsing according to claim 4, characterized in that: The specific steps for determining the receipt response window based on the control receipt arrival timestamp and identifying and parsing the response decoupling field are as follows: Read the protocol structure conservation chain and preprocessed access monitoring data. Round up the ratio of the control receipt delay value to the adjacent message arrival interval value to obtain the receipt response cycle number. Determine the sampling period interval corresponding to the receipt response cycle number after the control receipt arrival timestamp as the receipt response window. Read the field parsing value, uploaded field value, and device status code value corresponding to the unit identifier value of the same field within the receipt response window. Use the Bayesian online change point detection algorithm to calculate the change points of the field parsing value, uploaded field value, and device status code respectively. When the change point of the field parsing value is outside the receipt response window, and the change points of the uploaded field value and device status code are both within the receipt response window, determine the corresponding field unit identifier value as the parsing response decoupling field.
6. The edge node decoupling access method based on automatic protocol parsing according to claim 5, characterized in that: The specific steps for determining the misaligned reconnection field and the starting offset value of the reconnection field within the candidate reconnection interval defined by the protocol structure conservation chain, and generating the field misalignment reconnection result are as follows: Read the new version of the original message byte sequence corresponding to the decoupling field in the parsing response, the field parsing start offset value, the field parsing length value, the data area start byte sequence number, the data area byte length value, the candidate insertion length value, and the anchor chain relative offset difference; add the field parsing start offset value and the anchor chain relative offset difference to obtain the candidate callback center offset value; within the data area defined by the data area start byte sequence number to the data area byte length value, expand the candidate insertion length value forward and backward with the candidate callback center offset value as the center to obtain the candidate callback interval; Using the field parsing length as the window length, candidate replacement byte segments are extracted byte by byte within the candidate callback interval. These segments are then converted into candidate replacement field values according to the field data type and byte order rules corresponding to the parsing rule version number. A Bayesian online change point detection algorithm is used to calculate the candidate replacement field value change points. Based on these change points, the uploaded field value change points, the device status code change points, the starting byte sequence number of the candidate replacement byte segment, the field parsing starting offset value, the anchor chain relative offset difference, the candidate insertion length value, the candidate replacement field value, and the uploaded field value, a misaligned callback matching value is calculated. The candidate replacement byte segment with the largest misaligned callback match value is determined as the misaligned callback field, and the starting byte sequence number of the misaligned callback field is determined as the starting offset value of the callback field; the parsed response unhooking field, misaligned callback field, starting offset value of the callback field, misaligned callback match value and parsing rule version number are bound together to generate the field misaligned callback result.
7. The edge node decoupling access method based on automatic protocol parsing according to claim 6, characterized in that: The specific steps for calculating the misaligned reconnection matching value are as follows: The absolute value of the difference between the timestamp of the candidate replacement field value change and the timestamp of the upload field value change is added to the absolute value of the difference between the timestamp of the candidate replacement field value change and the timestamp of the device status code change, and then divided by the sum of the control receipt delay value and the adjacent message arrival interval value. The result is then calculated by taking a negative exponent with the natural constant e as the base. The position reconnection item is obtained by subtracting the anchor chain relative offset difference from the difference between the candidate replacement byte segment start byte sequence number and the field parsing start offset value, taking the absolute value, dividing by the candidate insertion length value plus one, and then taking a negative exponent with the natural constant e as the base. The position reconnection item is obtained by averaging the absolute value of the difference between the candidate replacement field value and the upload field value within the receipt response window, dividing by the sum of the upload field value standard deviation and the minimum constant, and then taking the reciprocal of the average value. The value matching item is obtained by multiplying the response synchronization item, the position reconnection item, and the value matching item together.
8. The edge node decoupling access method based on automatic protocol parsing according to claim 6, characterized in that: The specific steps for generating candidate semantic nodes based on the protocol structure conservation chain and field misalignment reconnection results, establishing a field semantic inertia graph, and determining the starting offset value of the target physical field are as follows: Read the protocol structure conservation chain and the field misalignment reconnection results, and combine the field parsing start offset value, reconnection field start offset value, field parsing length value and misalignment reconnection matching value corresponding to the same field unit identifier value under different parsing rule version number values into candidate semantic nodes; Using the same field unit identifier value, the same field parsing length value, and the misaligned callback matching value being greater than the callback matching threshold as node connection conditions, a semantic inertial edge is established between two adjacent candidate semantic nodes corresponding to the parsing rule version number values after being sorted according to the parsing rule loading timestamp. When the absolute value of the difference between the callback field starting offset value and the field parsing starting offset value corresponding to the semantic inertial edge is not greater than the candidate insertion length value, and the difference between the callback field starting offset value and the field parsing starting offset value and the anchor chain relative offset difference have the same sign, the corresponding semantic inertial edge is marked as a usable semantic inertial edge, and a field semantic inertial graph is generated. Delete edges that are not marked as available semantic inertial edges in the field semantic inertial graph; among the available semantic inertial edges corresponding to the unit identifier value of the same field, select the target semantic inertial edge in the following order: the largest number of cross-version stable anchor points, the largest misaligned reconnection matching value, and the smallest absolute value of the difference between the reconnection field start offset value and the field parsing start offset value, and determine the reconnection field start offset value corresponding to the endpoint of the target semantic inertial edge as the target physical field start offset value.
9. The edge node decoupling access method based on automatic protocol parsing according to claim 8, characterized in that: The specific steps for generating virtual field address values and a virtual-to-real field mapping table, parsing the subsequent original message byte sequence based on the virtual-to-real field mapping table, and outputting the edge node decoupling access result are as follows: For each field unit identifier value, a virtual field address value is generated. The virtual field address value is obtained by hashing the device network address value, function code value, field unit identifier value, and field parsing length value. In case of hash collision, the device communication port number is appended to form a unique address. The virtual field address value is bound to the target physical field start offset value, field parsing length value, parsing rule version number value, function code value, and private extension field to generate a virtual-physical field mapping table. The virtual field address value remains unchanged when the parsing rule version number value changes, while the target physical field start offset value is updated as the parsing rule version number value and private extension field change. Read the subsequent original message byte sequence, extract the target physical field byte segment according to the virtual-physical field mapping table and convert it into virtual field parsing value; calculate the absolute value of the difference between the virtual field parsing value and the upload field value corresponding to the unit identifier value of the same field to obtain the virtual field access deviation value; when the virtual field access deviation value of the same field unit identifier value is less than the access deviation threshold in K consecutive sampling periods, mark the corresponding virtual field address value as a stable decoupling field; When all virtual field address values corresponding to the network address value of the same device are marked as stable decoupling fields, the corresponding device network address value is marked as a device with successful decoupling access; the edge node decoupling access result is output, which includes virtual field address values, virtual and physical field mapping table, stable decoupling fields, and devices with successful decoupling access.
10. An edge node decoupled access system based on automatic protocol resolution, characterized in that, include: The access message timing processing module, protocol structure conservation construction module, receipt causality field callback module, and semantic address decoupling access module are included, among which: The access message timing processing module is used to collect access monitoring data and generate device message timing sequence according to the arrival timestamp of the original message, generate a verification mark based on the original message byte sequence and the received verification code value, and output the preprocessed access monitoring data. The protocol structure conservation construction module is used to perform byte-level alignment of cross-version original message byte sequences based on preprocessed access monitoring data, extract cross-version stable anchors based on conservation endpoints, determine private extended fields between cross-version stable anchors, and generate a protocol structure conservation chain. The receipt cause-effect field reconnection module is used to determine the receipt response window based on the control receipt arrival timestamp, identify and parse the response decoupling field, and determine the misaligned reconnection field and the reconnection field start offset value within the candidate reconnection interval defined by the protocol structure conservation chain, and generate the field misalignment reconnection result. The semantic address decoupling access module is used to generate candidate semantic nodes based on the protocol structure conservation chain and field misalignment reconnection results, establish a field semantic inertial map and determine the starting offset value of the target physical field, generate virtual field address values and virtual-physical field mapping table, parse the subsequent original message byte sequence based on the virtual-physical field mapping table, and output the edge node decoupling access results.
Citation Information
Patent Citations
Update Method, Device, Server, Medium and Product for Process Orchestration
CN113778517B
Software management system and method
CN115113911B
