A test data acquisition method and system based on dynamic configuration of multi-protocol devices

CN121567620BActive Publication Date: 2026-09-01深圳市华磊迅拓科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511836773.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-09-01
Estimated Expiration
2045-12-08

AI Technical Summary

Technical Problem

现有系统通常在流程驱动下完成设备识别、握手、数据读取与结果存储,但在复杂环境中暴露出若干共性问题:其一,等待时间与超时阈值多以固定配置为主,难以适配冷启动阶段的链路暖机、网络抖动与设备负载波动,易出现误判超时与无谓等待并存的矛盾,既影响稳定性又拉长测试周期;其二,重试与回退多采用与业务无关的静态退避策略,缺乏对往返时延短时统计结构的拥塞/疏解识别与分层处置依据,导致在边界状态出现振荡与吞吐下降;其三,原始数据在编码、控制字符、帧/行边界与转义规则上差异显著,且粘包、拆包现象普遍,若缺少统一的编码归一与严格组帧、行级切分与顺序稳定化机制,易引发解析阶段的级联错误并削弱可追溯性;其四,解析侧普遍依赖刚性的分隔式规则,对字段缺失、连续分隔、可选字段或供应商微调等轻微格式漂移敏感,缺少基于记录结构稳定性进行自适应切换与回退的能力,鲁棒性不足;其五,产出侧若未与运行时变量视图解耦,且缺乏幂等键与事务化批量写入控制,容易产生重复写入、类型/约束冲突与报表—数据库结果不一致的问题,增加审计与复盘成本

Benefits of technology

1、时序自适应,降低超时与重试开销:引入协议呼吸纹作为链路节律活性指标,依据上、下稳态带与回差进行收放控制;链路波动时适度拉宽,稳定时快速收敛到基线,从机制上减少无效重试与长尾等待,缩短单轮测试周期;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567620B_ABST
    Figure CN121567620B_ABST
Patent Text Reader

Abstract

This invention discloses a test data acquisition method and system based on dynamic configuration of multi-protocol devices, belonging to the field of data acquisition technology. The method includes: loading configuration; establishing a session and sampling message intervals and round-trip delays during cold start; executing sending, waiting, and reading according to the process; calculating protocol breathing patterns and adaptively adjusting waiting and timeout; generating channel echo flux based on gating residuals and performing layered expansion or backoff; unifying the encoding of raw data, framing, cutting, and queuing; driving parsing and backoff with message skeleton curvature; and generating reports by templated variables and idempotently storing them in the database. By establishing a timing baseline, adaptively expanding and contracting waiting and timeout, implementing layered backoff for congestion, and robustly parsing and storing data in the database, the method ensures consistent and traceable results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data acquisition technology, specifically to a test data acquisition method and system based on dynamic configuration of multi-protocol devices. Background Technology

[0002] In practical applications, test and measurement platforms need to simultaneously interface with multiple communication protocols and various models of devices under test, typically including heterogeneous channels such as serial interfaces, network interfaces, and instrument bus interfaces. Existing systems usually complete device identification, handshake, data reading, and result storage under a process-driven approach, but several common problems are exposed in complex environments: First, waiting times and timeout thresholds are mostly fixed configurations, making it difficult to adapt to link warm-up, network jitter, and device load fluctuations during the cold start phase. This easily leads to the contradiction of misjudged timeouts and unnecessary waiting, affecting both stability and lengthening the test cycle. Second, retries and rollbacks often adopt static backoff strategies unrelated to business logic, lacking a basis for identifying and layering congestion / relief based on short-term statistical structures of round-trip latency, resulting in oscillations and throughput reduction at boundary states. Third, raw data encoding, control characters, frame / line boundaries, and escaping rules... The differences are significant, and the phenomena of packet merging and splitting are common. Without a unified encoding standardization and strict framing, row-level segmentation and order stabilization mechanism, cascading errors in the parsing stage are likely to occur and traceability will be weakened. Fourth, the parsing side generally relies on rigid partitioning rules, which are sensitive to slight format drifts such as missing fields, continuous partitions, optional fields or vendor fine-tuning. It lacks the ability to adaptively switch and roll back based on the stability of the record structure, and its robustness is insufficient. Fifth, if the output side is not decoupled from the runtime variable view and lacks idempotent keys and transactional batch write control, it is easy to cause problems such as duplicate writes, type / constraint conflicts and inconsistencies between report and database results, which will increase auditing and review costs.

[0003] In summary, the industry urgently needs an integrated test data acquisition solution that can complete session establishment, short-term sampling and basis determination, time-series adaptation, congestion-aware layered fallback, data cleaning and robust parsing, and templated reports, thereby improving the stability, efficiency, and engineering availability of test data acquisition in multi-protocol and cross-device scenarios. Summary of the Invention

[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a test data acquisition method and system based on dynamic configuration of multi-protocol devices to solve the above-mentioned technical problems.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a test data acquisition method based on dynamic configuration of multi-protocol devices, comprising: S1: Load the device list, test flowchart, parsing rules and storage template, and declare the cold start sampling period and handshake reference interval of the device; S2: Establish a communication session based on the device list, complete identification and handshake, and collect the arrival interval and round-trip delay of adjacent messages during the cold start sampling period; S3: Execute the send, wait, read, branch, and loop nodes according to the test flowchart; S4: Calculate the protocol breath pattern based on the arrival interval of adjacent messages, and adjust the step-level waiting time and timeout threshold using the protocol breath pattern. When it increases, the waiting time and timeout threshold are widened, and when it decreases, it converges to the waiting time and timeout threshold baseline determined by the handshake reference interval. S5: Calculate the channel echo flux based on the quantile gated residual of the relative lower envelope of the round-trip delay. When it is greater than the congestion threshold, it is processed in layers in the order of retry interval expansion, communication parameter backoff, and channel route backoff. When it is less than the relief threshold, the retry interval is gradually converged and the backoff measures are canceled. S6: The raw data read is encoded uniformly, control characters are removed, and frames and lines are truncated according to the protocol. Multiple records in the same frame are enqueued in the order of arrival to form a sequence of records to be parsed. S7: Segment a single record according to the delimiter to form a segment length sequence and calculate the message skeleton curvature. When it is within the steady-state band, the main parsing rule is used to extract the target data. When it crosses the steady-state band, the parsing rule backtracking chain is triggered, and the pattern matching rule is used for parsing. The parsing result, source device identifier and time information are written into the runtime variable set. S8: Based on the runtime variable set and threshold, determine the execution flow branches and loops, map the runtime variable set to the spreadsheet template to generate a formatted report, and write the data to the database according to the table and field mapping.

[0006] The invention is further configured such that the device list includes at least interface type, address, and communication parameters, and the interface type includes serial interface, network interface, and instrument bus interface; the test flowchart includes at least send, wait, read, branch, and loop nodes; the parsing rules include delimited and pattern matching; and the storage template is used to map variables to spreadsheet and database fields.

[0007] The present invention is further configured such that, in S2, cold start sampling timing and counting are started immediately after the handshake is completed, and sampling is terminated when the sampling time reaches the preset time period length, or when the number of samples in the interval between adjacent message arrivals and the number of samples in the round-trip delay simultaneously reach the minimum number of samples. Frames are assembled according to the frame integrity rules. The arrival time of each complete frame is recorded. The arrival interval of adjacent messages is obtained by the difference between the arrival time of the current complete frame and the arrival time of the previous complete frame. Round-trip delay samples are generated using echo measurement commands. The sending time is recorded when the command is sent, and the arrival time is recorded when the corresponding echo is received. The round-trip delay is obtained by the difference between the arrival time and the sending time.

[0008] The present invention is further configured such that S4 includes: The ratio of the arrival interval between adjacent messages to the handshake reference interval is monotonically compressed and mapped. Multi-order difference processing is performed on the compressed interval sequence to obtain fast-changing components and slow-changing components; the two components are nonlinearly aggregated to form fine flutter intensity and base undulation intensity; the ratio of the two intensities constitutes a dimensionless rhythmic activity index, which is set as the protocol respiratory streak. Based on historical short time windows, an upper and lower steady-state band of protocol breathing patterns are formed, and a hysteresis band is set. Within the steady-state band, the current waiting time and timeout threshold remain unchanged. If it is higher than the upper steady-state band, expansion is triggered; if it is lower than the lower steady-state band, convergence is triggered. When expansion is triggered, the waiting time and timeout threshold are adjusted incrementally according to the principle of gradual increase without sudden jump. The increment is generated by a monotonic function of hyperbolic tangent class and is constrained by the upper limit of the device capacity. When convergence is triggered, the waiting time and timeout threshold are converged to the waiting time baseline and timeout threshold baseline determined by the handshake reference interval.

[0009] The present invention is further configured to calculate the channel echo flux based on the quantized gated residual of the relative lower envelope of the round-trip delay, including: Within a sliding sampling window, segmented monotonic lower bound tracking is performed on the round-trip delay sequence to extract the lower envelope, and constraints on the maximum descent slope and minimum dwell length are set. Calculate the residuals of the round-trip delay relative to the lower envelope, and construct the gate line based on the lower and upper quantiles of the residuals within the window; The residuals that cross the gate line are compressed as effective deviations on the congestion side and the relief side according to their signs, and then accumulated in time sequence to obtain the single channel echo flux.

[0010] The present invention is further configured such that, when the congestion threshold is exceeded, the process is layered in the order of retry interval expansion, communication parameter rollback, and channel routing rollback; when the congestion threshold is exceeded, the retry interval is gradually converged and the rollback measures are revoked, including: Set congestion threshold, relief threshold, and hysteresis band. When the channel echo throughput is higher than the congestion threshold and crosses the hysteresis band, it is determined to be a congested side. When the channel echo throughput is lower than the relief threshold and crosses the hysteresis band, it is determined to be a relief side. When it is between the two thresholds or within the hysteresis band, the current strategy remains unchanged. On the congested side, the actions are performed in layers in the order of retry interval expansion, communication parameter rollback, and channel route rollback. Each layer of action records the event and sets a minimum retention time. On the relief side, the retry interval is gradually reduced, and the communication parameter rollback is cancelled in reverse order. After the stable observation period, the channel route rollback is cancelled.

[0011] The present invention is further configured such that S6 includes: The encoding characteristics of the raw data are detected, and the raw data is converted into a unified encoding format. Based on the preset allowed set, only the control characters in the set are retained. In the streaming buffer, frame boundaries are identified according to protocol elements. For frames using the length method, the length value is checked and the frame is cut. For frames using the separator or end mark method, the frame is cut according to the shortest match and escape is processed. Candidate frames are compared with length consistency, end mark integrity and check value. Frames that pass the check are marked as complete frames. Frame sequence number and source identifier are assigned to complete frames and arrival time is recorded. Within the complete frame, it is divided into multiple records according to the line separation rules agreed upon in the protocol. Meaningless whitespace at the beginning and end of the line is removed, escaped lines are restored according to the escape rules, and blank lines or lines containing only placeholders are filtered. Valid records within the same frame are stably sorted by their order of appearance within the frame as the primary order and their arrival time as the secondary order, and then written into the queue of records to be parsed one by one according to the sorting results.

[0012] The present invention is further configured such that S7 includes: The record text is segmented according to a preset set of delimiters and escaping conventions. Continuous delimiters and empty fields are processed according to compliance policies to obtain a field sequence. The number of characters in each field is counted according to the unified encoding, forming a segment length sequence, and the start and end positions of each field in the original record are recorded; The segment length sequence is mapped to the cumulative change path. The structural undulation and fine bending are measured by the changes in adjacent positions and the changes in three adjacent points, respectively. The two types of changes are nonlinearly compressed and aggregated to obtain the message skeleton curvature. Based on historical short time windows, an upper and lower steady-state band for curvature is established, and a hysteresis band is set: when the curvature is within the steady-state band and the hysteresis range, the target data is extracted according to the main parsing rules and the type, range and format are checked; when the curvature crosses the steady-state band, the pattern matching rule group is activated for extraction, and the final parsing result is determined by the hit completeness and consistency. For records that are successfully parsed, the field values, along with the source device identifier, frame number, line number, arrival time, parsing rule identifier and fallback level, and rule path, are written into the runtime variable set.

[0013] The present invention is further configured such that S8 includes: Branches and loops are determined and executed based on the set of runtime variables. If necessary variables are missing, the loop will enter the default or fault-tolerant branch. Loops are set with upper limits and exit conditions. Generate a formatted report by mapping the set of runtime variables to placeholders using a spreadsheet template; Based on the table and field mapping, construct the row set to be written, use idempotent keys to avoid duplicate writing, commit in batch transactions and perform type and constraint checks, and then write to the database.

[0014] This invention also provides a test data acquisition system based on dynamic configuration of multi-protocol devices. The system is used to implement the aforementioned test data acquisition method based on dynamic configuration of multi-protocol devices, comprising: Configuration module: Loads the device list, test flowchart, parsing rules and storage templates, and declares the cold start sampling period and handshake baseline interval for the device; Acquisition module: Establishes a communication session based on the device list, completes identification and handshake, and collects the arrival interval and round-trip delay of adjacent messages during the cold start sampling period; Execution module: Executes the send, wait, read, branch, and loop nodes according to the test flowchart; First calculation module: Calculates protocol breathing pattern based on the arrival interval of adjacent messages, and adjusts the step-level waiting time and timeout threshold with protocol breathing pattern. When it increases, it widens the waiting time and timeout threshold, and when it decreases, it converges to the waiting time and timeout threshold baseline determined by the handshake reference interval. The second calculation module calculates the channel echo flux based on the quantized gated residual of the relative lower envelope of the round-trip delay. When it exceeds the congestion threshold, it processes the echo flux in layers in the order of retry interval expansion, communication parameter backoff, and channel route backoff. When it is less than the relief threshold, it gradually converges the retry interval and cancels the backoff measures. The cleaning module encodes and unifies the raw data it reads, removes control characters, and truncates the frames and lines according to the protocol. It also queues multiple records within the same frame in the order of arrival to form a sequence of records to be parsed. Parsing module: It segments a single record according to the delimiter, forms a segment length sequence, and calculates the message skeleton curvature. When it is within the steady-state band, it uses the main parsing rule to extract the target data. When it crosses the steady-state band, it triggers the parsing rule backtracking chain and uses the pattern matching rule to parse. It writes the parsing result, source device identifier, and time information into the runtime variable set. The generation module determines the branches and loops of the execution flow based on the set of runtime variables and thresholds, maps the set of runtime variables to spreadsheet templates to generate formatted reports, and writes the data to the database according to the table and field mapping.

[0015] This invention provides a test data acquisition method and system based on dynamic configuration of multi-protocol devices. The method loads a device list, test flowchart, parsing rules, and storage templates; declares the cold start sampling period and handshake baseline interval for each device; establishes a communication session based on the device list, completes identification and handshake, and collects the arrival interval and round-trip delay of adjacent packets during the cold start sampling period; executes sending, waiting, reading, branching, and looping nodes according to the test flowchart; calculates protocol breathing patterns based on the arrival interval of adjacent packets, and adjusts the step-level waiting time and timeout threshold using the protocol breathing patterns. When the breathing patterns increase, the waiting time and timeout threshold are widened; when they decrease, they converge to the waiting time and timeout threshold baseline determined by the handshake baseline interval; calculates the channel echo flux based on the quantile-gated residual of the round-trip delay relative to the lower envelope; when the echo flux exceeds the congestion threshold, it is adjusted according to retry interval expansion, communication parameter backoff, and other methods. The process involves layering and reverting data in a backtracking order. When the threshold is less than the threshold, the retry interval is gradually reduced and the backtracking measures are revoked. The raw data is encoded, control characters are removed, and frames and lines are truncated according to the protocol. Multiple records within the same frame are queued in arrival order to form a sequence of records to be parsed. Individual records are segmented according to delimiters to form a segment length sequence and the message skeleton curvature is calculated. When the data is within the steady-state band, the main parsing rule is used to extract the target data. When the data crosses the steady-state band, the parsing rule backtracking chain is triggered, and pattern matching rules are used for parsing. The parsing results, source device identifier, and time information are written into the runtime variable set. Based on the runtime variable set and threshold, the execution flow branches and loops are determined. The runtime variable set is mapped to a spreadsheet template to generate a formatted report, and the data is written into the database according to the table and field mapping. The beneficial effects include: 1. Timing Adaptive, reducing timeout and retry overhead: Introducing protocol breathing ripple as a link rhythm activity indicator, and controlling the expansion and contraction based on the upper and lower steady-state bands and hysteresis; appropriately widening when the link fluctuates, and quickly converging to the baseline when stable, thereby reducing invalid retries and long-tail waiting from the mechanism, and shortening the single-round test cycle; 2. Layered backoff and convergence for congestion awareness to suppress oscillations: Congestion / relief is clearly determined by channel echo throughput, and layered processing is carried out according to retry interval, communication parameters and routing path order. At the same time, hysteresis and minimum hold time are set to avoid link oscillations caused by frequent back-and-forth switching, thereby improving throughput and stability. 3. Robust parsing driven by structural stability, resisting format drift: The stability of the record structure is measured by the curvature of the message skeleton: the main parsing rule is used when in the steady state band, and the pattern matching rule is automatically switched when crossing bands; this adaptive mechanism is robust to continuous separation, optional fields and minor format changes from suppliers, significantly improving the parsing success rate.

[0016] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 The flowchart illustrates a test data acquisition method based on dynamic configuration of multi-protocol devices, as an exemplary embodiment of the present invention. Detailed Implementation

[0018] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0021] Example 1: A test data acquisition method based on dynamic configuration of multi-protocol devices, such as... Figure 1 As shown, it includes: S1: Load the device list, test flowchart, parsing rules and storage template, and declare the cold start sampling period and handshake reference interval of the device; S2: Establish a communication session based on the device list, complete identification and handshake, and collect the arrival interval and round-trip delay of adjacent messages during the cold start sampling period; S3: Execute the send, wait, read, branch, and loop nodes according to the test flowchart; S4: Calculate the protocol breath pattern based on the arrival interval of adjacent messages, and adjust the step-level waiting time and timeout threshold using the protocol breath pattern. When it increases, the waiting time and timeout threshold are widened, and when it decreases, it converges to the waiting time and timeout threshold baseline determined by the handshake reference interval. S5: Calculate the channel echo flux based on the quantile gated residual of the relative lower envelope of the round-trip delay. When it is greater than the congestion threshold, it is processed in layers in the order of retry interval expansion, communication parameter backoff, and channel route backoff. When it is less than the relief threshold, the retry interval is gradually converged and the backoff measures are canceled. S6: The raw data read is encoded uniformly, control characters are removed, and frames and lines are truncated according to the protocol. Multiple records in the same frame are enqueued in the order of arrival to form a sequence of records to be parsed. S7: Segment a single record according to the delimiter to form a segment length sequence and calculate the message skeleton curvature. When it is within the steady-state band, the main parsing rule is used to extract the target data. When it crosses the steady-state band, the parsing rule backtracking chain is triggered, and the pattern matching rule is used for parsing. The parsing result, source device identifier and time information are written into the runtime variable set. S8: Based on the runtime variable set and threshold, determine the execution flow branches and loops, map the runtime variable set to the spreadsheet template to generate a formatted report, and write the data to the database according to the table and field mapping.

[0022] The invention is further configured such that the device list includes at least interface type, address, and communication parameters; the interface type includes serial interface, network interface, and instrument bus interface; the test flowchart includes at least send, wait, read, branch, and loop nodes; the parsing rules include delimited and pattern matching; the storage template is used to map variables to spreadsheet and database fields; specifically, serial devices, network devices, and instrument bus devices are simultaneously connected to the same test platform, and the device list includes: Serial device one: interface type is serial interface; port is local serial port number three; baud rate is 9600; data bits are eight bits; stop bits are one bit; parity is no parity; flow control is none; address is slave address seven. Additional communication parameters include a base frame timeout of 200 milliseconds and a maximum of three retries; Network Device 1: Interface type is network interface; Address is 192.168.110; Port is 502; Transport layer is reliable connection; Unit identifier is 2; Heartbeat interval is 30 seconds; Instrument Bus Device 1: Interface type is instrument bus interface; Bus type is general instrument bus; Address is 10; Device function is voltage measurement and current measurement; Initialization command set includes clear bus, reset, and set range; The unified record fields of the device list include interface type, address, and communication parameters. Communication parameters are extended in key-value format to meet subsequent differentiated configurations at the device level.

[0023] The test flowchart includes at least send, wait, read, branch, and loop nodes. The nodes and connections are as follows: Send Node 1: Sends a read holding register command to the serial device, with target register number 1 and a length of two registers; Wait Node 1: Waits for 200 milliseconds; if a response is received early, the process proceeds early; Read Node 1: Frames the data using a length plus checksum method, and verifies the length and checksum; Branch Node 1: If the check at Read Node 1 fails, it enters the retry branch of Loop Node 1; if the check passes, it enters Send Node 2; Send Node 2: Sends a DC voltage measurement query command to the instrument bus device; Wait Node 2 and Read Node 2: Identify the response frame by the end marker and read one record; Loop Node 1: Repeats the sub-process from Send Node 1 to Read Node 2 for a maximum of twenty times or for a duration of five minutes; When Branch Node 1 enters the retry branch, it determines whether to continue based on the remaining retry count. This flowchart is expressed in a graphical configuration using nodes and directed connections, and supports the addition of node-level timeout and exception handling strategies.

[0024] The parsing rules are divided into two categories: delimited and pattern matching. Delimited rule 1: uses commas as separators and double quotes as escape sequences, allowing consecutive delimitations to produce empty fields. The field order is: time stamp, function code, value one, and value two. The time stamp is standardized, the function code is enumerated and checked, and the value fields are converted to units and checked for range. Pattern matching rule 1: matches the structure consisting of a fixed prefix and a unit suffix. If a plus or minus sign or exponent is present, the value is restored. The measurement results are subject to bit limits and validity checks. When the delimited rule fails in terms of field completeness or type check, the parsing is switched to the pattern matching rule according to the fallback strategy.

[0025] A spreadsheet template and two database tables are used to handle the output: Spreadsheet Template: The workbook contains two worksheets, "Overview" and "Details". The "Overview" table maps key indicators such as test batch number, number of devices, and pass rate from runtime variables; the "Details" table expands records by row, with columns including timestamp, source device identifier, instruction type, original frame summary, parsed field 1 and parsed field 2, status, and remarks. Placeholders are mapped using variable key names, and missing values ​​are left blank and marked as missing according to the template strategy; Database Table 1 (Original Frame Table): Fields are session identifier, device identifier, timestamp, frame sequence number, original byte, and verification status, with the primary key being session identifier and frame sequence number; Database Table 2 (Parsed Value Table): Fields are session identifier, device identifier, timestamp, field name, field value, unit, and rule identifier, with the idempotent key being session identifier, device identifier, and timestamp; The mapping relationship is declared in the template as a table and field mapping table, with variable names and column names corresponding one-to-one; The write strategy uses idempotent write, updating if a duplicate key exists, otherwise inserting.

[0026] The present invention is further configured such that, in S2, cold start sampling timing and counting are started immediately after the handshake is completed, and sampling is terminated when the sampling time reaches the preset time period length, or when the number of samples in the interval between adjacent message arrivals and the number of samples in the round-trip delay simultaneously reach the minimum number of samples. Frames are assembled according to the frame integrity rules. The arrival time of each complete frame is recorded. The arrival interval of adjacent messages is obtained by the difference between the arrival time of the current complete frame and the arrival time of the previous complete frame. Round-trip delay samples are generated using echo measurement commands. The sending time is recorded when the command is sent, and the arrival time is recorded when the corresponding echo is received. The round-trip delay is obtained by the difference between the arrival time and the sending time.

[0027] Specifically, after completing device identification and initialization, the handshake completion time is recorded, and cold start sampling timing and counting are immediately started.

[0028] Entering the non-blocking receive loop, candidate frames are segmented in the streaming buffer according to the framing rules; frames with consistent length and passing verification are marked as complete frames, and their arrival times are recorded. The interval is obtained by subtracting the arrival time of the previous complete frame from the arrival time of the current complete frame; the arrival time of the first frame is only recorded and is not included in the interval. A total of 347 complete frames are received within a 30-second window, and 5 frames that failed verification are discarded; the arrival intervals of adjacent messages are obtained as 346, with a minimum of 17 milliseconds and a maximum of 42 milliseconds (both ends are service-stable segments), which meets the requirement of a minimum sample size of 200. A measurement command is sent every 200 milliseconds. The sending time is recorded at the moment of sending. The echo matching the command is received and the arrival time is recorded. The round-trip delay is obtained by subtracting the sending time from the arrival time. A total of 132 round-trip delay samples are obtained within the sampling window. The first sample is 33 milliseconds, and most of the subsequent samples are between 32 and 36 milliseconds. The minimum number of samples of 100 has been met. At the nineteenth second, both the adjacent message arrival interval sample and the round-trip delay sample have reached the minimum sample count, triggering the "sample count satisfied" termination condition and ending the cold start sampling. The following content is fixed as session baseline data: Cold start sampling start and end time: 10:03:12:480 to 10:03:31:480; Adjacent message arrival interval sequence: stored in chronological order, with the arrival time and frame number of the two frames before and after each interval; Round-trip delay sequence: stored in the sending order, with the sending time and echo arrival time corresponding to each sample; Sampling summary: includes the number of valid frames, statistics on reasons for dropping frames (two frames with inconsistent lengths, three frames with failed verification), the number of successful command and echo matches, the number of unmatched frames (zero), and abnormal events (none).

[0029] The present invention is further configured such that S4 includes: The ratio of the arrival interval between adjacent messages to the handshake reference interval is monotonically compressed and mapped. Multi-order difference processing is performed on the compressed interval sequence to obtain fast-changing components and slow-changing components; the two components are nonlinearly aggregated to form fine flutter intensity and base undulation intensity; the ratio of the two intensities constitutes a dimensionless rhythmic activity index, which is set as the protocol respiratory streak. Based on historical short time windows, an upper and lower steady-state band of protocol breathing patterns are formed, and a hysteresis band is set. Within the steady-state band, the current waiting time and timeout threshold remain unchanged. If it is higher than the upper steady-state band, expansion is triggered; if it is lower than the lower steady-state band, convergence is triggered. When expansion is triggered, the waiting time and timeout threshold are adjusted incrementally according to the principle of gradual increase without sudden jump. The increment is generated by a monotonic function of hyperbolic tangent class and is constrained by the upper limit of the device capacity. When convergence is triggered, the waiting time and timeout threshold are converged to the waiting time baseline and timeout threshold baseline determined by the handshake reference interval.

[0030] Specifically, the handshake baseline interval after handshake is completed is 30 milliseconds; the step-level waiting time baseline is 60 milliseconds, and the timeout threshold baseline is 150 milliseconds; the upper limit of device capability is that the waiting time does not exceed 300 milliseconds, the timeout threshold does not exceed 900 milliseconds, and the waiting time is always less than the timeout threshold. Within a ten-second window, obtain a sample of adjacent message arrival intervals (in milliseconds): 28, 31, 34, 29, 45, 42, 33, 30, 29, 27... (remaining samples are processed in the same way); The ratio of each arrival interval to the handshake reference interval is monotonically compressed and mapped, and hyperbolic tangent compression is used to smoothly converge the deviation to a finite interval, thus obtaining a compressed value sequence. First-order and second-order differences are calculated on the compressed value sequence: the first-order difference represents slow fluctuations, and the second-order difference represents rapid bends. This separates the slow-changing and fast-changing components. The absolute value of the second-order difference of the fast-changing component is accumulated by power of one-third to obtain the fine jitter intensity; the absolute value of the first-order difference of the slow-changing component is added with a small positive value and then accumulated by power of two-thirds to obtain the base fluctuation intensity. The ratio of these two values ​​constitutes a dimensionless rhythmic activity index, set as the protocol breath pattern. The protocol breath pattern measures the activity level of the arrival rhythm of link messages. The dimensionless rhythmic activity index is the core numerical expression of the protocol breath pattern, equivalent to the ratio of fine jitter intensity to base fluctuation intensity. The protocol breath pattern emphasizes the adjustment bar time curve and control strategy; this index emphasizes the intensity at a single point within each time window. In this embodiment, in the short window statistics at the fifth second, the ratio of fine jitter intensity to base fluctuation intensity is approximately 0.98.

[0031] The protocol breathing pattern is divided into upper and lower stable bands by scrolling up and down using historical short windows, and a hysteresis band is set to suppress jitter. In this example, the upper stable band is 1.15, the lower stable band is 0.85, and the hysteresis band is 0.05. At the seventh second, the protocol breathing pattern surges to 1.32, exceeding the upper stable band and crossing the hysteresis band, triggering expansion. Following the principle of "gradual increase without sudden jumps," an increment is generated using a hyperbolic tangent-like monotonic function, constrained by the upper limit of capability: the waiting time increases from 60 milliseconds to 72 milliseconds, and the timeout threshold increases from 150 milliseconds to 180 milliseconds; the trigger type, before and after parameters, and timestamp are recorded.

[0032] At the twelfth second, the protocol breathing ripple dropped to 0.82, below the lower steady-state band and across the hysteresis band, triggering convergence. The waiting time decreased from 72 milliseconds to 66 milliseconds, and then converged to 60 milliseconds in the next update cycle; the timeout threshold decreased from 180 milliseconds to 170 milliseconds, and then converged to 150 milliseconds.

[0033] The present invention is further configured to calculate the channel echo flux based on the quantized gated residual of the relative lower envelope of the round-trip delay, including: Within a sliding sampling window, segmented monotonic lower bound tracking is performed on the round-trip delay sequence to extract the lower envelope, and constraints on the maximum descent slope and minimum dwell length are set. Calculate the residuals of the round-trip delay relative to the lower envelope, and construct the gate line based on the lower and upper quantiles of the residuals within the window; The residuals that cross the gate line are compressed as effective deviations on the congestion side and the relief side according to their signs, and then accumulated in time sequence to obtain the single channel echo flux.

[0034] Specifically, the sliding sampling window is set to fifteen round-trip delay samples, in milliseconds; the maximum descent slope does not exceed twenty milliseconds per sample, and the minimum dwell time is two samples. A set of samples is obtained in chronological order: thirty-two, thirty-three, thirty-one, thirty-four, thirty-six, fifty, forty-eight, forty, thirty-five, thirty-four, thirty-three, thirty-seven, sixty, forty-five, and thirty-eight.

[0035] The lower envelope is obtained by updating if the value is below the current lower bound and otherwise maintaining it, while satisfying the two constraints mentioned above: 32, 32, 31, 31, 31, 1 / 3... (and then maintaining 30 until the end of the window); based on this, the residual sequence (measured minus lower envelope) is obtained: 0, 1, 0, 3, 5, 19, 17, 9, 4, 3, 2, 6, 29, 14, 7; within this window, the lower and upper quantiles of the residuals are calculated, with the lower threshold approximately 1.2 and the upper threshold approximately 16.4. The portions below the lower threshold and above the upper threshold are considered as effective deviations on the relief side and congestion side, respectively, and the rest are considered as invalid deviations.

[0036] The deviation that crosses the gate line is compressed using the square root while retaining its sign. Examples are shown below: The deviation on the relief side (below 1.2): The first item is zero minus 1.2, which is approximately -1.095 after compression; the second item is one minus 1.2, which is approximately -0.447 after compression; the third item is the same as the first item, approximately -1.095. Congested side (above 16.4): The sixth item's deviation is 19 minus 16.4, which is approximately +1.612 after compression; the seventh item is 17 minus 16.4, which is approximately +0.775 after compression; the thirteenth item is 29 minus 16.4, which is approximately +3.549 after compression. All other terms between the two gate lines are counted as zero.

[0037] The above compression values ​​are sequentially accumulated starting from zero: the first three terms accumulate to approximately -2.637; after adding the sixth and seventh terms, it rises back to approximately -0.25; after adding the thirteenth term, it rises to approximately +3.3. This accumulated result is the channel echo flux for this window. A positive value indicates that the congestion side has a dominant impact. The channel echo flux is used to identify the link congestion / relief situation and determine layered handling such as retry interval expansion, communication parameter rollback, and route rollback.

[0038] The channel echo flux in this window is approximately +3.3, indicating that the early contribution on the relief side was offset and overtaken by several subsequent significant high latency deviations, and the link is in a slightly congested state. If the congestion threshold is set to be higher than zero and the hysteresis band is appropriate, this window will trigger tiered handling on the congestion side; if no hysteresis is set or the threshold is high, it can be recorded as "tending towards congestion" and the next window can be observed.

[0039] The present invention is further configured such that, when the congestion threshold is exceeded, the process is layered in the order of retry interval expansion, communication parameter rollback, and channel routing rollback; when the congestion threshold is exceeded, the retry interval is gradually converged and the rollback measures are revoked, including: Set congestion threshold, relief threshold, and hysteresis band. When the channel echo throughput is higher than the congestion threshold and crosses the hysteresis band, it is determined to be a congested side. When the channel echo throughput is lower than the relief threshold and crosses the hysteresis band, it is determined to be a relief side. When it is between the two thresholds or within the hysteresis band, the current strategy remains unchanged. On the congested side, the actions are performed in layers in the order of retry interval expansion, communication parameter rollback, and channel route rollback. Each layer of action records the event and sets a minimum retention time. On the relief side, the retry interval is gradually reduced, and the communication parameter rollback is cancelled in reverse order. After the stable observation period, the channel route rollback is cancelled.

[0040] Specifically, the preset parameters include: congestion threshold: 2.0; relief threshold: -1.0; backlash band: 0.5; retry interval baseline: 200 milliseconds; single expansion step size: 50 milliseconds; upper limit: 800 milliseconds; minimum hold time: 10 seconds; communication parameter fallback level: three levels (payload size from 512 bytes → 256 bytes → 128 bytes; concurrent request count from 4 → 2 → 1; pipelined transmission disabled), minimum hold time per level: 30 seconds; channel routing fallback: primary link to backup link, switching cooldown time: 120 seconds, hold time: 60 seconds; observation window: channel echo throughput is rolled every 5 seconds.

[0041] During operation (according to the observation window sequence): Window 1: Flux is 0.6, which is between the two thresholds, and the strategy remains unchanged; Window 2: The throughput is 2.6, which is higher than the congestion threshold and crosses the hysteresis band, entering the first level of congestion on the congestion side; Action: The retry interval is increased from 200 milliseconds to 250 milliseconds, and the timer is maintained for 10 seconds; Window 3: The throughput is 3.9, congestion continues and the first-level hold requirement has been met, proceed to the second level; Action: communication parameters roll back one level: payload size is reduced to 256 bytes, concurrent request count is reduced to 2, pipeline transmission is turned off; hold for 30 seconds.

[0042] Window 4: The throughput is 4.1, congestion continues and the second stage remains full, entering the third stage; Action: Switch to the backup link; Start the cooling and hold timer (120 seconds and 60 seconds respectively).

[0043] Window 5: Flux is 0.3, falling within the hysteresis band, maintaining the status quo; Window 6: The flux is negative 1.4, which is below the dewatering threshold and crosses the hysteresis band, and enters the dewatering side.

[0044] The relief and convergence sequence includes: Step 1 (Relief Trigger): The convergence retry interval is reduced from 250 milliseconds to 230 milliseconds, and then reduced by 20 milliseconds for each observation window until it returns to the 200 millisecond baseline or reaches the minimum value; Step 2 (After Hold Verification): If the throughput of two consecutive observation windows is lower than the relief threshold, the communication parameters are rolled back one level: the payload size is restored to 512 bytes, the number of concurrent requests is restored to four, the state of closed pipeline transmission is retained and another observation window is observed. If it is still stable, pipeline transmission is resumed; Step 3 (Route Rollback Cancellation): When the cooldown time and hold duration have expired, and the throughput of three consecutive observation windows is not higher than 0.5, the main link is switched back; after switching back, a 45-second observation period is set. If the throughput does not exceed the congestion threshold again, the route recovery is confirmed to be successful.

[0045] The present invention is further configured such that S6 includes: The encoding characteristics of the raw data are detected, and the raw data is converted into a unified encoding format. Based on the preset allowed set, only the control characters in the set are retained. In the streaming buffer, frame boundaries are identified according to protocol elements. For frames using the length method, the length value is checked and the frame is cut. For frames using the separator or end mark method, the frame is cut according to the shortest match and escape is processed. Candidate frames are compared with length consistency, end mark integrity and check value. Frames that pass the check are marked as complete frames. Frame sequence number and source identifier are assigned to complete frames and arrival time is recorded. Within the complete frame, it is divided into multiple records according to the line separation rules agreed upon in the protocol. Meaningless whitespace at the beginning and end of the line is removed, escaped lines are restored according to the escape rules, and blank lines or lines containing only placeholders are filtered. Valid records within the same frame are stably sorted by their order of appearance within the frame as the primary order and their arrival time as the secondary order, and then written into the queue of records to be parsed one by one according to the sorting results.

[0046] Specifically, two types of devices can be accessed simultaneously on the same platform: Device A (serial): binary frames, with a two-byte fixed identifier in the frame header, followed by a two-byte length field (including payload and checksum), and a two-byte checksum in the frame tail; Device B (network): text frames, with records ending with a carriage return and line feed, and fields separated by commas. Commas and line feeds can be escaped with backslashes.

[0047] The receiving end enables first-packet encoding detection for each source channel: Device A is identified as local single-byte encoding, and Device B is identified as unified encoding. Both data streams are converted to unified encoding; based on the "allowed set," only necessary control characters such as newline, carriage return, and tab are retained, and other control characters are deleted and recorded in the audit; all visible characters are retained.

[0048] In the streaming buffer, frame boundaries are identified according to protocol elements: Device A (length-based): Reads frames sequentially in the channel buffer, first locating the frame header, then reading the length field to check the value range, and cutting candidate frames according to length; performs length consistency and check value comparison on candidate frames, those that pass are marked as complete frames, assigned frame sequence number and source identifier, and their arrival time is recorded; those that fail enter the completion area, and are discarded and audited if they exceed the maximum completion limit or time out; Device B (end-marking method): Performs shortest matching and cutting in the channel buffer using "carriage return and line feed", while handling backslash escaping to form candidate frames; performs end-marking integrity check on candidate frames, those that pass are marked as complete frames and their source, frame sequence number, and arrival time are recorded; incomplete frames wait for completion in the buffer, and are discarded and audited if they time out.

[0049] Device A: Divides the entire frame into multiple records according to the line separator agreed upon in the protocol; removes meaningless whitespace at the beginning and end of each record; Device B: Divides the field using commas as separators and double quotes and backslashes as escaping rules; records empty fields generated by continuous separation as null values ​​according to the protocol; restores escaped line breaks; removes meaningless whitespace at the beginning and end; filters and counts lines containing only placeholders or empty lines.

[0050] Valid records within the same frame are first sorted by their order of appearance within the frame, and then by their arrival time as a secondary sorting factor for stability. Each record is then written to the "queue of records to be parsed" according to the sorting results. Each enqueued element includes: record text, source device identifier, frame number, line number, arrival time, and verification status. When the queue reaches a high water level, backpressure is triggered to slow down the upstream read rate; when the capacity is exceeded, the earliest or latest record is discarded according to a policy, and an audit entry is output.

[0051] The present invention is further configured such that S7 includes: The record text is segmented according to a preset set of delimiters and escaping conventions. Continuous delimiters and empty fields are processed according to compliance policies to obtain a field sequence. The number of characters in each field is counted according to the unified encoding, forming a segment length sequence, and the start and end positions of each field in the original record are recorded; The segment length sequence is mapped to the cumulative change path. The structural undulation and fine bending are measured by the changes in adjacent positions and the changes in three adjacent points, respectively. The two types of changes are nonlinearly compressed and aggregated to obtain the message skeleton curvature. Based on historical short time windows, an upper and lower steady-state band for curvature is established, and a hysteresis band is set: when the curvature is within the steady-state band and the hysteresis range, the target data is extracted according to the main parsing rules and the type, range and format are checked; when the curvature crosses the steady-state band, the pattern matching rule group is activated for extraction, and the final parsing result is determined by the hit completeness and consistency. For records that are successfully parsed, the field values, along with the source device identifier, frame number, line number, arrival time, parsing rule identifier and fallback level, and rule path, are written into the runtime variable set.

[0052] Specifically, based on a preset set of delimiters and escaping conventions, a single record is split once; empty fields resulting from continuous splitting are recorded as null values ​​according to compliance policies; escaped delimiters and line breaks are restored after splitting. An ordered field sequence is obtained, preserving the start and end positions of each field in the original record; the number of characters in each field is counted under unified encoding to form a segment length sequence. A polyline is constructed with the field number as the horizontal axis and the cumulative length as the vertical axis, mapping the structural rhythm of the record to a skeleton path; changes in adjacent positions measure the slow fluctuations of the structure, while changes in three adjacent points measure the subtle bends; the absolute values ​​of changes in adjacent positions are aggregated to the power of 2 / 3 to obtain the base fluctuation intensity; the absolute values ​​of changes in three adjacent points are aggregated to the power of 1 / 3 to obtain the fine jitter intensity. Both compression methods weaken the influence of extreme values ​​and preserve the overall rhythm; the fine jitter intensity divided by the base fluctuation intensity forms a dimensionless message skeleton curvature, which is used to measure the stability of a single record in its field structure and guides the selection of parsing rules: steady-state parsing uses primary parsing, while outgoing parsing uses alternative delimiters or pattern matching. Within a short historical time window, the upper and lower steady-state bands are updated on a rolling basis, and a hysteresis band is set: the structure is considered stable if it is within the steady-state band, and considered to be drifting if it crosses the band; the hysteresis band suppresses boundary jitter; when the curvature is within the steady-state band, the main parsing rule is used and the type, range, and format are checked; when the curvature crosses the band, a rollback process is triggered: first, an alternative separator combination is tried; if completeness and consistency are still not satisfied, the pattern matching rule group is enabled. The final result, along with the source information, rule path, and rollback level, is entered into the runtime variable set in the database to ensure idempotency and auditability.

[0053] The recorded text is "October 20, 2025, 10:15:23", "MEAS", 12.34, 56.7, "OK"; separated by commas, double quotes, and backslashes are used for escaping; six fields are obtained, with the fifth field being empty; the number of characters in each field after removing quotes and escaping is: 19, 4, 5, 4, 0, 2; the absolute change between adjacent positions is: 15, 1, 1, 4, 2; the absolute change between three adjacent points (equivalent to the second-order difference absolute change between adjacent positions) is: 16, 2. 1, 3, 6; Base undulation intensity = 15² + 1² + 1² + 4² + 2² ≈ 12.19; Fine flutter intensity = 16³ + 2³ + 3³ + 6³ ≈ 7.04; Curvature ≈ 7.04 ÷ 12.19 ≈ 0.58; Steady-state bands are set as follows: lower steady-state band 0.45, upper steady-state band 0.75, hysteresis band 0.05. Curvature is within the steady-state band, so the primary parsing rule is selected; extract time, type, value one, value two, and status according to the primary rule; after completing type, range, and format verification, write the field values ​​along with the source device identifier, frame number, line number, arrival time, rule identifier "primary", fallback level zero, and rule path "primary" into the runtime variable set.

[0054] The present invention is further configured such that S8 includes: Branches and loops are determined and executed based on the set of runtime variables. If necessary variables are missing, the loop will enter the default or fault-tolerant branch. Loops are set with upper limits and exit conditions. Generate a formatted report by mapping the set of runtime variables to placeholders using a spreadsheet template; Based on the table and field mapping, construct the row set to be written, use idempotent keys to avoid duplicate writing, commit in batch transactions and perform type and constraint checks, and then write to the database.

[0055] Specifically, a read-only snapshot of the runtime variable set is generated upon entering the judgment cycle to ensure consistent values ​​within the same cycle. Branch selection is based on preset conditional expressions: when necessary variables are missing, the default or fault-tolerant branch is entered; a stability window and hysteresis band are set for volatile variables, and the current trend is not changed if the band is not exceeded to avoid frequent jitter. Loops support count limits and time limits and provide early exit conditions; the limits and exit conditions are checked before each iteration to ensure that the process can be terminated and audited; variables are written to the template using placeholders: cell placeholders are used for single values, and area placeholders are used for lists. List data is expanded row by row, automatically inheriting styles and widths; missing values ​​are left blank or filled with default values ​​and marked "missing" according to the template strategy. After completing the verification of numerical values, dates, and custom formats, a file is generated, with the filename containing the batch identifier, time information, and process tracking number, and the output summary record generation count and missing statistics are shown; the set of rows to be written is constructed from the variable snapshot based on the table-field mapping. An idempotent key (such as composed of source device identifier, time information, frame sequence number, or process tracking number) is calculated for each row, and when a record with the same key is encountered, an update or skip strategy is used to avoid duplicate writing. Writes are performed using batch transactions, with isolation levels and timeouts set. If the data type and constraints do not match, a safe conversion is performed or the row is moved to the failure queue. Retryable errors are retried using a backoff strategy; errors exceeding the limit are recorded without interrupting other batches. The output and receiving sides operate decoupled and in parallel, with backpressure rate limiting initiated during high water levels. All decisions, batch results, and abnormal events are written to the audit stream.

[0056] Example 2: This exemplary test data acquisition system based on dynamic configuration of multi-protocol devices is used to implement the aforementioned test data acquisition method based on dynamic configuration of multi-protocol devices, including: Configuration module: Loads the device list, test flowchart, parsing rules and storage templates, and declares the cold start sampling period and handshake baseline interval for the device; Acquisition module: Establishes a communication session based on the device list, completes identification and handshake, and collects the arrival interval and round-trip delay of adjacent messages during the cold start sampling period; Execution module: Executes the send, wait, read, branch, and loop nodes according to the test flowchart; First calculation module: Calculates protocol breathing pattern based on the arrival interval of adjacent messages, and adjusts the step-level waiting time and timeout threshold with protocol breathing pattern. When it increases, it widens the waiting time and timeout threshold, and when it decreases, it converges to the waiting time and timeout threshold baseline determined by the handshake reference interval. The second calculation module calculates the channel echo flux based on the quantized gated residual of the relative lower envelope of the round-trip delay. When it exceeds the congestion threshold, it processes the echo flux in layers in the order of retry interval expansion, communication parameter backoff, and channel route backoff. When it is less than the relief threshold, it gradually converges the retry interval and cancels the backoff measures. The cleaning module encodes and unifies the raw data it reads, removes control characters, and truncates the frames and lines according to the protocol. It also queues multiple records within the same frame in the order of arrival to form a sequence of records to be parsed. Parsing module: It segments a single record according to the delimiter, forms a segment length sequence, and calculates the message skeleton curvature. When it is within the steady-state band, it uses the main parsing rule to extract the target data. When it crosses the steady-state band, it triggers the parsing rule backtracking chain and uses the pattern matching rule to parse. It writes the parsing result, source device identifier, and time information into the runtime variable set. The generation module determines the branches and loops of the execution flow based on the set of runtime variables and thresholds, maps the set of runtime variables to spreadsheet templates to generate formatted reports, and writes the data to the database according to the table and field mapping.

[0057] It should be noted that the test data acquisition system based on dynamic configuration of multi-protocol devices provided in the above embodiments and the test data acquisition method based on dynamic configuration of multi-protocol devices provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments, and will not be repeated here. In practical applications, the test data acquisition system based on dynamic configuration of multi-protocol devices provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above, and this is not a limitation here.

[0058] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A test data acquisition method based on dynamic configuration of multi-protocol devices, characterized in that, include: S1: Load the device list, test flowchart, parsing rules and storage template, and declare the cold start sampling period and handshake reference interval of the device; S2: Establish a communication session based on the device list, complete identification and handshake, and collect the arrival interval and round-trip delay of adjacent messages during the cold start sampling period; S3: Execute the send, wait, read, branch, and loop nodes according to the test flowchart; S4: Calculate the protocol breath pattern based on the arrival interval of adjacent messages. Adjust the step-level waiting time and timeout threshold using the protocol breath pattern. When it increases, widen the waiting time and timeout threshold; when it decreases, converge to the waiting time and timeout threshold baseline determined by the handshake reference interval. Specifically, the ratio of the arrival interval of adjacent messages to the handshake reference interval is monotonically compressed and mapped. Multi-order difference processing is performed on the compressed interval sequence to obtain fast-changing and slow-changing components. Nonlinear aggregation of the two components forms the fine jitter intensity and the base undulation intensity. The ratio of the two intensities constitutes a dimensionless rhythmic activity index, which is set as the protocol breath pattern. Specifically, first-order and second-order differences are calculated on the compressed value sequence. The absolute value of the second-order difference is accumulated term by term using the power of one-third to obtain the fine jitter intensity. The absolute value of the first-order difference is added with a minimum positive value and then accumulated term by term using the power of two-thirds to obtain the base undulation intensity. S5: The channel echo flux is calculated based on the quantile-gated residuals of the round-trip delay relative to the lower envelope. When the residuals exceed the congestion threshold, they are processed in layers in the order of retry interval expansion, communication parameter backoff, and channel route backoff. When the residuals are less than the relief threshold, the retry interval is gradually converged and the backoff measures are revoked. Specifically, the lower envelope is extracted by segmented monotonic lower bound tracking of the round-trip delay sequence within the sliding sampling window, and the maximum descent slope and minimum dwell length constraints are set. The residuals of the round-trip delay relative to the lower envelope are calculated, and gates are constructed based on the lower and upper quantiles of the residuals within the window. The residuals that cross the gates are compressed as effective deviations on the congestion side and the relief side, respectively, according to their signs, and accumulated in time order to obtain a single channel echo flux. S6: The raw data read is encoded uniformly, control characters are removed, and frames and lines are truncated according to the protocol. Multiple records in the same frame are enqueued in the order of arrival to form a sequence of records to be parsed. S7: Segment a single record according to the delimiter to form a segment length sequence and calculate the message skeleton curvature. When it is within the steady-state band, the main parsing rule is used to extract the target data. When it crosses the steady-state band, the parsing rule fallback chain is triggered, and the pattern matching rule is used for parsing. The parsing result, source device identifier, and time information are written into the runtime variable set. Specifically, the record text is segmented according to the preset delimiter set and escape convention. Continuous delimiters and empty fields are processed according to the compliance strategy to obtain the field sequence. The number of characters in each field is counted according to the unified encoding to form a segment length sequence. The start and end positions of each field in the original record are recorded. The segment length sequence is mapped to the cumulative change path. The structural fluctuations and minor bends are measured by the changes in adjacent positions and the changes in adjacent three points, respectively. The two types of changes are non-linearly compressed and aggregated to obtain the message skeleton curvature. S8: Based on the runtime variable set and threshold, determine the execution flow branches and loops, map the runtime variable set to the spreadsheet template to generate a formatted report, and write the data to the database according to the table and field mapping.

2. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, The equipment list should at least include interface type, address, and communication parameters. Interface types include serial interface, network interface, and instrument bus interface. The test flowchart should at least include send, wait, read, branch, and loop nodes. Parsing rules should include delimited and pattern matching. Storage templates are used to map variables to spreadsheet and database fields.

3. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, In S2, cold start sampling timing and counting are started immediately after the handshake is completed. Sampling is terminated when the sampling time reaches the preset time period length, or when the number of samples in the interval between adjacent message arrivals and the number of samples in the round-trip delay both reach the minimum number of samples. Frames are assembled according to the frame integrity rules. The arrival time of each complete frame is recorded. The arrival interval of adjacent messages is obtained by the difference between the arrival time of the current complete frame and the arrival time of the previous complete frame. Round-trip delay samples are generated using echo measurement commands. The sending time is recorded when the command is sent, and the arrival time is recorded when the corresponding echo is received. The round-trip delay is obtained by the difference between the arrival time and the sending time.

4. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, S4 also includes: Based on historical short time windows, an upper and lower steady-state band of protocol breathing patterns are formed, and a hysteresis band is set. Within the steady-state band, the current waiting time and timeout threshold remain unchanged. If it is higher than the upper steady-state band, expansion is triggered; if it is lower than the lower steady-state band, convergence is triggered. When expansion is triggered, the waiting time and timeout threshold are adjusted incrementally according to the principle of gradual increase without sudden jump. The increment is generated by a monotonic function of hyperbolic tangent class and is constrained by the upper limit of the device capacity. When convergence is triggered, the waiting time and timeout threshold are converged to the waiting time baseline and timeout threshold baseline determined by the handshake reference interval.

5. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, When the congestion threshold is exceeded, the system is processed in a layered manner in the order of retry interval expansion, communication parameter rollback, and channel route rollback. When the threshold is less than the relief threshold, the retry interval is gradually reduced and the rollback measures are revoked, including: Set congestion threshold, relief threshold, and hysteresis band. When the channel echo throughput is higher than the congestion threshold and crosses the hysteresis band, it is determined to be a congested side. When the channel echo throughput is lower than the relief threshold and crosses the hysteresis band, it is determined to be a relief side. When it is between the two thresholds or within the hysteresis band, the current strategy remains unchanged. On the congested side, the actions are performed in layers in the order of retry interval expansion, communication parameter rollback, and channel route rollback. Each layer of action records the event and sets a minimum retention time. On the relief side, the retry interval is gradually reduced, and the communication parameter rollback is cancelled in reverse order. After the stable observation period, the channel route rollback is cancelled.

6. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, S6 include: The encoding characteristics of the raw data are detected, and the raw data is converted into a unified encoding format. Based on the preset allowed set, only the control characters in the set are retained. In the streaming buffer, frame boundaries are identified according to protocol elements. For frames using the length method, the length value is checked and the frame is cut. For frames using the separator or end mark method, the frame is cut according to the shortest match and escape is processed. Candidate frames are compared with length consistency, end mark integrity and check value. Frames that pass the check are marked as complete frames. Frame sequence number and source identifier are assigned to complete frames and arrival time is recorded. Within the complete frame, it is divided into multiple records according to the line separation rules agreed upon in the protocol. Meaningless whitespace at the beginning and end of the line is removed, escaped lines are restored according to the escape rules, and blank lines or lines containing only placeholders are filtered. Valid records within the same frame are stably sorted by their order of appearance within the frame as the primary order and their arrival time as the secondary order, and then written into the queue of records to be parsed one by one according to the sorting results.

7. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, S7 also includes: Based on historical short time windows, an upper and lower steady-state band for curvature is established, and a hysteresis band is set: when the curvature is within the steady-state band and the hysteresis range, the target data is extracted according to the main parsing rules and the type, range and format are checked; when the curvature crosses the steady-state band, the pattern matching rule group is activated for extraction, and the final parsing result is determined by the hit completeness and consistency. For records that are successfully parsed, the field values, along with the source device identifier, frame number, line number, arrival time, parsing rule identifier and fallback level, and rule path, are written into the runtime variable set.

8. The test data acquisition method based on dynamic configuration of multi-protocol devices according to claim 1, characterized in that, S8 includes: Branches and loops are determined and executed based on the set of runtime variables. If necessary variables are missing, the loop will enter the default or fault-tolerant branch. Loops are set with upper limits and exit conditions. Generate a formatted report by mapping the set of runtime variables to placeholders using a spreadsheet template; Based on the table and field mapping, construct the row set to be written, use idempotent keys to avoid duplicate writing, commit in batch transactions and perform type and constraint checks, and then write to the database.

9. A test data acquisition system based on dynamic configuration of multi-protocol devices, used to implement the test data acquisition method based on dynamic configuration of multi-protocol devices as described in any one of claims 1-8, characterized in that, include: Configuration module: Loads the device list, test flowchart, parsing rules and storage templates, and declares the cold start sampling period and handshake baseline interval for the device; Acquisition module: Establishes a communication session based on the device list, completes identification and handshake, and collects the arrival interval and round-trip delay of adjacent messages during the cold start sampling period; Execution module: Executes the send, wait, read, branch, and loop nodes according to the test flowchart; First calculation module: Calculates protocol breathing pattern based on the arrival interval of adjacent messages, and adjusts the step-level waiting time and timeout threshold with protocol breathing pattern. When it increases, it widens the waiting time and timeout threshold, and when it decreases, it converges to the waiting time and timeout threshold baseline determined by the handshake reference interval. The second calculation module calculates the channel echo flux based on the quantile gated residual of the relative lower envelope of the round-trip delay. When it exceeds the congestion threshold, it processes the echo flux in layers in the order of retry interval expansion, communication parameter backoff, and channel route backoff. When the threshold is less than the relief threshold, gradually reduce the retry interval and cancel the rollback measures; The cleaning module encodes and unifies the raw data it reads, removes control characters, and truncates the frames and lines according to the protocol. It also queues multiple records within the same frame in the order of arrival to form a sequence of records to be parsed. Parsing module: It segments a single record according to the delimiter, forms a segment length sequence, and calculates the message skeleton curvature. When it is within the steady-state band, it uses the main parsing rule to extract the target data. When it crosses the steady-state band, it triggers the parsing rule backtracking chain and uses the pattern matching rule to parse. It writes the parsing result, source device identifier, and time information into the runtime variable set. The generation module determines the branches and loops of the execution flow based on the set of runtime variables and thresholds, maps the set of runtime variables to spreadsheet templates to generate formatted reports, and writes the data to the database according to the table and field mapping.

Citation Information

Patent Citations

  • Adaptive packet data transmission system and method based on Beidou short message

    CN120151815A

  • Satellite constellation network topology state rapid sensing method

    CN120811460A