Method and device for collecting and processing serial port data of industrial equipment

CN122838296APending Publication Date: 2026-09-29HANGZHOU KAIMISI IOT SENSING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611038234.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

[0002]现有工业上位机在串口采集场景中普遍存在以下问题:设备寄存器映射常采用硬编码,机型变更时需要重新编码,改造成本高;轮询读请求未进行区间合并,总线往返多,实时性和效率差;通信超时后仅统计失败率,无法区分设备冻结或是链路退化;现场设备应答格式不统一,标准Modbus(一种广泛应用于工业控制领域串行通信协议)客户端易出现误判;测试过程缺乏结构化留证,问题复盘依赖零散日志,故障定位效率低

Benefits of technology

本发明的上述方案,通过获取工业设备串口采集配置文件;所述工业设备串口采集配置文件包括对工业设备的串口数据的多段寄存器读取起始地址、读取长度以及上位机与各工业设备之间的各采集通道对应的寄存器地址和数据类型;对所述工业设备串口采集配置文件中的多段寄存器读取起始地址进行合并,并对各采集通道对应的寄存器地址进行覆盖校验,得到有效采集配置数据;所述有效采集配置数据包括:合并读区间列表、通道与寄存器绑定映射表;根据所述有效采集配置数据中的合并读区间列表同步批量采集读区间列表对应的工业设备串口数据;对所述工业设备串口数据进行采集状态冻结分类,得到冻结分类结果;根据所述工业设备串口采集配置文件、所述有效采集配置数据、所述工业设备串口数据和所述冻结分类结果,得到数据采集过程证据链,可以减少总线往返次数,提高实时性和效率,通过采集状态冻结分类,可以准确区分设备冻结或是链路退化,提高故障确定的精准性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122838296A_ABST
    Figure CN122838296A_ABST
Patent Text Reader

Abstract

The application provides an industrial equipment serial port data acquisition processing method and device. The method comprises the following steps: obtaining an industrial equipment serial port acquisition configuration file; merging multiple register read start addresses in the industrial equipment serial port acquisition configuration file, and performing register address covering verification on each acquisition channel to obtain effective acquisition configuration data; synchronously batch-acquiring industrial equipment serial port data corresponding to a read interval list according to a merged read interval list in the effective acquisition configuration data; performing acquisition state freezing classification on the industrial equipment serial port data to obtain a freezing classification result; and obtaining a data acquisition process evidence chain according to the industrial equipment serial port acquisition configuration file, the effective acquisition configuration data, the industrial equipment serial port data and the freezing classification result. The application can improve the acquisition efficiency of industrial equipment serial port data.
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, and also to a method and apparatus for acquiring and processing serial port data of industrial equipment. Background Technology

[0002] Existing industrial host computers commonly suffer from the following problems in serial port acquisition scenarios: device register mapping often uses hard coding, which requires recoding when the device model changes, resulting in high modification costs; polling read requests do not perform interval merging, resulting in many bus round trips, poor real-time performance, and low efficiency; after communication timeout, only the failure rate is counted, and it is impossible to distinguish between device freezing and link degradation; the response format of field devices is not uniform, and standard Modbus (a serial communication protocol widely used in industrial control) clients are prone to misjudgment; the testing process lacks structured evidence, and problem review relies on scattered logs, resulting in low efficiency in fault location. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method and apparatus for acquiring and processing serial port data of industrial equipment, so as to improve the acquisition efficiency of serial port data of industrial equipment.

[0004] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: A first aspect of the present invention provides a method for acquiring and processing serial port data of industrial equipment, comprising: Obtain the industrial equipment serial port acquisition configuration file; the industrial equipment serial port acquisition configuration file includes the starting address and reading length of the multi-segment register for reading the serial port data of the industrial equipment, as well as the register address and data type corresponding to each acquisition channel between the host computer and each industrial equipment. The starting addresses of multiple register reads in the serial port acquisition configuration file of the industrial equipment are merged, and the register addresses corresponding to each acquisition channel are overwritten and verified to obtain valid acquisition configuration data; the valid acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table; Synchronously batch collect the serial port data of the industrial equipment corresponding to the read interval list according to the merged read interval list in the effective collection configuration data; The serial port data of the industrial equipment is subjected to a frozen classification of the acquisition status, and the frozen classification result is obtained. Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification results, an evidence chain for the data acquisition process is obtained.

[0005] Optionally, the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file are merged, and the register addresses corresponding to each acquisition channel are overwritten and verified to obtain valid acquisition configuration data, including: The validity of the industrial equipment serial port acquisition configuration file is verified. After the validity verification is passed, the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file are merged to obtain a merged read interval list. Based on the merged read interval list and the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, a coverage verification is performed on the register address corresponding to each acquisition channel to obtain the coverage verification result. Based on the coverage verification results, the merged read interval list, and the register addresses corresponding to each acquisition channel, a channel-register binding mapping table is obtained; Based on the merged read interval list and the channel-register binding mapping table, valid acquisition configuration data is obtained.

[0006] Optionally, based on the merged read interval list and the register addresses and data types corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, a coverage check is performed on the register addresses corresponding to each acquisition channel to obtain the coverage check results, including: The acquisition channel type is determined based on the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file; If the acquisition channel type is a single register channel and the corresponding single register address is in the merged read range list, or if the acquisition channel type is a floating-point acquisition channel and the corresponding dual register addresses are both in the merged read range list, then the coverage verification result is passed.

[0007] Optionally, based on the merged read interval list in the effective acquisition configuration data, the serial port data of the industrial equipment corresponding to the read interval list is synchronously and in batches acquired, including: Based on the preset polling cycle and the list of merged read intervals in the effective collection configuration data, the batch read register instruction and status diagnosis instruction are sent to the lower-level device; Receive industrial equipment serial port data sent by the lower-level device; the industrial equipment serial port data includes business data and status diagnostic data.

[0008] Optionally, the serial port data of the industrial equipment is subjected to a data acquisition status freeze classification to obtain a freeze classification result, including: Based on the business data in the serial port data of the industrial equipment, a data acquisition status diagnosis is performed to obtain the data acquisition status diagnosis result. Based on the status diagnostic data in the serial port data of the industrial equipment and the acquired status diagnostic results, the acquired status is frozen and classified to obtain the frozen classification results.

[0009] Optionally, based on the status diagnostic data in the industrial equipment serial port data and the acquired status diagnostic results, a frozen classification of the acquired status is performed to obtain a frozen classification result, including: Based on the collected status diagnosis results and the preset timeout threshold, timeout data is obtained; Based on the status diagnosis data and timeout data in the serial port data of the industrial equipment, the status freeze classification is performed to obtain the freeze classification result.

[0010] Optionally, based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result, an evidence chain for the data acquisition process is obtained, including: An initial chain of evidence is obtained based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result. Based on the initial chain of evidence, generate summary data and chain of evidence identifiers; Based on the summary data, the evidence chain identifier, and the initial evidence chain, the evidence chain of the data collection process is obtained.

[0011] A second aspect of the present invention provides an industrial equipment serial port data acquisition and processing device, comprising: The acquisition module is used to acquire the serial port acquisition configuration file of the industrial equipment; the serial port acquisition configuration file of the industrial equipment includes the starting address and reading length of the multi-segment register for reading the serial port data of the industrial equipment, as well as the register address and data type of each acquisition channel between the host computer and each industrial equipment. The processing module is used to merge the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file, and to perform overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data. The valid acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table. The module synchronously and batch-acquires industrial equipment serial port data corresponding to the merged read interval list in the valid acquisition configuration data. It performs acquisition status freeze classification on the industrial equipment serial port data to obtain freeze classification results. Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the freeze classification results, it obtains a data acquisition process evidence chain.

[0012] A third aspect of the present invention provides a computing device, comprising: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described in the first aspect.

[0013] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect.

[0014] The above-described solution of the present invention has at least the following beneficial effects: The above-described solution of the present invention obtains an industrial equipment serial port acquisition configuration file. This configuration file includes the starting address and reading length of multiple register segments for the serial port data of the industrial equipment, as well as the register addresses and data types corresponding to each acquisition channel between the host computer and each industrial equipment. The starting addresses of the multiple register segments in the configuration file are merged, and the register addresses corresponding to each acquisition channel are overwritten and verified to obtain valid acquisition configuration data. This valid acquisition configuration data includes a merged read interval list and a channel-register binding mapping table. The industrial equipment serial port data corresponding to the merged read interval list in the valid acquisition configuration data is synchronously and batch-acquired in batches. The industrial equipment serial port data is then subjected to acquisition status freeze classification to obtain a freeze classification result. Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the freeze classification result, an evidence chain for the data acquisition process is obtained. This reduces the number of bus round trips, improves real-time performance and efficiency, and through acquisition status freeze classification, accurately distinguishes between equipment freeze and link degradation, improving the accuracy of fault determination. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the method for acquiring and processing serial port data of industrial equipment in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of the industrial equipment serial port data acquisition and processing device in an embodiment of the present invention. Detailed Implementation

[0016] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0017] like Figure 1 As shown, an embodiment of the present invention proposes a method for acquiring and processing serial port data of industrial equipment, applied to a host computer, including the following steps: Step 101: Obtain the industrial equipment serial port acquisition configuration file; the industrial equipment serial port acquisition configuration file includes the starting address and reading length of the multi-segment register for reading the serial port data of the industrial equipment, as well as the register address and data type corresponding to each acquisition channel between the host computer and each industrial equipment. Step 102: Merge the starting addresses of multiple register reads in the serial port acquisition configuration file of the industrial equipment, and perform overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data; the valid acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table; Step 103: Synchronously batch collect the serial port data of the industrial equipment corresponding to the read interval list according to the merged read interval list in the effective collection configuration data; Step 104: Perform data acquisition status freeze classification on the serial port data of the industrial equipment to obtain the freeze classification result; Step 105: Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result, obtain the evidence chain of the data acquisition process.

[0018] The industrial equipment serial port data acquisition and processing method of this invention involves: obtaining an industrial equipment serial port acquisition configuration file; merging the start addresses of multiple register reads in the industrial equipment serial port acquisition configuration file and performing overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data; synchronously batch acquiring industrial equipment serial port data corresponding to the read interval list according to the merged read interval list in the valid acquisition configuration data; performing acquisition status freeze classification on the industrial equipment serial port data to obtain freeze classification results; and obtaining a data acquisition process evidence chain based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the freeze classification results. This method can reduce the number of bus round trips, improve real-time performance and efficiency, and accurately distinguish between equipment freeze or link degradation through acquisition status freeze classification, thereby improving the accuracy of fault determination.

[0019] In an optional embodiment of the present invention, step 101 involves obtaining an industrial equipment serial port acquisition configuration file; the industrial equipment serial port acquisition configuration file includes the starting address for reading multi-segment registers of the serial port data of the industrial equipment, the reading length, and the register addresses and data types corresponding to each acquisition channel between the host computer and each industrial equipment. Specifically, the industrial equipment serial port acquisition configuration file contains `read_requests` (multi-segment register read start address and read length) and `channels` (the device register address and data type bound to each acquisition channel, including floating-point / integer / unsigned, physical quantity name, and range). The register addresses include the diagnostic register addresses corresponding to heartbeats, event codes, and communication queues. By obtaining different industrial equipment serial port acquisition configuration files and loading them onto the host computer, switching between lower-level industrial devices can be achieved without rewriting or recompiling the host computer program, significantly reducing modification costs. The industrial equipment serial port acquisition configuration files separately label the operating condition acquisition point addresses and diagnostic block addresses such as heartbeats / event codes, enabling separate reading of business data and status diagnostic data without interference. Simultaneously, the industrial equipment serial port acquisition configuration file contains all read_requests address segments and channel information for each channel: point name, data type (integer / floating-point), corresponding register address, engineering range unit, etc., providing the original rule basis for subsequent batch data acquisition. Here, industrial equipment is a lower-level machine used to collect data such as temperature and pressure on the production line. In a specific embodiment, the lower-level industrial equipment can be any one or more of the following: PLC (Programmable Logic Controller), sensor, instrument, frequency converter, electricity meter, temperature and humidity module, weighing instrument, and other field terminal equipment.

[0020] In an optional embodiment of the present invention, step 102, merging the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file and performing overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data, may include: Step 1021: Perform a validity check on the industrial equipment serial port acquisition configuration file. After the validity check is passed, merge the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file to obtain a merged read interval list. Specifically, the validity check is performed by verifying whether the starting address of the multi-segment register read in the serial port acquisition configuration file of the industrial equipment is valid. That is, whether the starting address is within the preset address range. For example, if the preset address range is 1 to 10, and the starting address of the multi-segment register read is 1 to 5, 3 to 7, and 6 to 11, then 11 in the starting address of the multi-segment register read is not within the preset address range and is invalid. At this time, the addresses that are out of bounds in the starting address of the multi-segment register read need to be removed, that is, the address 11 needs to be removed, and the modified starting address of the multi-segment register read is 1 to 5, 3 to 7, and 6 to 10, so that the modified starting address of the register read is valid.

[0021] After the modified multi-segment register read start address is valid, the multi-segment register read start addresses in the industrial equipment serial port acquisition configuration file are merged to obtain a merged read interval list. For example, if there is an overlap between 3 to 7 and 1 to 5 in the multi-segment register read start addresses, the overlapping areas are merged together, and the merged multi-segment register read start addresses become: 1 to 7; the merged 1 to 7 and 6 to 10 are adjacent (6 to 10 starting with 10 are after 7), and they are merged again to obtain a large continuous interval merged read interval list of 1 to 10. Only one instruction is needed to read the entire address, achieving the effect of fewer instructions and fewer round-trip communications, improving acquisition speed and reducing the burden on the serial bus.

[0022] Step 1022: Based on the merged read interval list and the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, perform a coverage verification on the register address corresponding to each acquisition channel to obtain the coverage verification result. In an optional embodiment of the present invention, step 1022 includes: Step 10221: Determine the acquisition channel type based on the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file; Specifically, since data types include floating-point (float) and integer, the corresponding acquisition channels are also divided into floating-point channels (corresponding to floating-point decimal parameters, such as temperature 25.6) and ordinary channels (corresponding to integer parameters, such as current 5A). Therefore, the acquisition channel type can be determined as a floating-point acquisition channel (i.e., floating-point channel) or a single-register channel (i.e., ordinary channel) based on the data type.

[0023] Step 10222: If the acquisition channel type is a single register channel and the corresponding single register address is in the merged read interval list, or if the acquisition channel type is a floating-point acquisition channel and the corresponding dual register addresses are both in the merged read interval list, then the coverage verification result is passed.

[0024] Specifically, for a normal channel, one register can store a value; however, a floating-point channel requires two consecutive registers to store complete decimal data. Therefore, when performing coverage verification on the register addresses corresponding to each acquisition channel, if the acquisition channel type is a normal channel, it is necessary to traverse the register addresses corresponding to each acquisition channel. If a register address falls within the merged read interval list, the coverage verification result is passed. In a specific embodiment, the voltage channel is bound to register 10, and the merged read interval list is 5 to 20. If 10 is within 5 to 20, the verification is successful; if the merged read interval list only includes 5 to 9 and does not include 10, the verification fails.

[0025] When the acquisition channel type is a floating-point acquisition channel, the dual register addresses corresponding to the floating-point acquisition channel must be consecutive, and both dual register addresses must fall within the merged read interval list for the coverage verification result to be successful. In a specific embodiment, the dual register addresses occupied by the temperature floating-point channel are 20 and 21, and the merged read interval list is 15 to 25. Since 20 and 21 are both within the merged read interval list, the coverage verification result is qualified; if the merged read interval list only includes 15 to 20, only 20 can be read, and 21 cannot be read, resulting in a coverage verification failure.

[0026] The purpose of coverage verification is to avoid register address errors in the serial port acquisition configuration file of industrial equipment, prevent floating-point data distortion, avoid acquiring incomplete or erroneous data from the source, and improve the effectiveness of data acquisition and the reliability of method implementation.

[0027] Step 1023: Based on the coverage verification result, the merged read interval list, and the register address corresponding to each acquisition channel, obtain the channel-register binding mapping table; Specifically, when the coverage verification result is passed, the corresponding register address falling within the merged read interval list is bound to the acquisition channel one by one, forming a channel-register binding mapping table, which facilitates the transfer of data from the register address to the corresponding acquisition channel during subsequent data acquisition.

[0028] Step 1024: Obtain valid acquisition configuration data based on the merged read interval list and the channel-register binding mapping table.

[0029] Specifically, the effective acquisition configuration data includes a merged read interval list and a channel-register binding mapping table. The merged read interval list contains the register addresses of the lower-level industrial equipment that needs to read data, and the channel-register binding mapping table contains a one-to-one correspondence between each acquisition channel and a register address.

[0030] In an optional embodiment of the present invention, step 103, synchronously batch collecting the industrial equipment serial port data corresponding to the merged read interval list according to the effective acquisition configuration data, may include: Step 1031: Based on the preset polling period and the list of merged read intervals in the valid collection configuration data, send the batch read register instruction and status diagnosis instruction to the lower-level device; Specifically, based on the merged read interval list in the valid acquisition configuration data, Modbus batch read register commands and status diagnostic commands are issued to the lower-level devices one by one to collect serial port data from industrial equipment. The read register commands and status diagnostic commands are executed synchronously within the same polling cycle to ensure that the business data and status diagnostic data in the industrial equipment's serial port data are in the same polling cycle, thus improving the accuracy of frozen classification.

[0031] Step 1032: Receive industrial equipment serial port data sent by the lower-level device; the industrial equipment serial port data includes business data and status diagnostic data.

[0032] Specifically, industrial equipment serial port data includes business data and status diagnostic data. Business data consists of raw hexadecimal values, such as temperature, pressure, and power consumption. Status diagnostic data is the operating status data of the lower-level device itself, including heartbeat values, event codes, and queue indicators. Here, the heartbeat value is a continuously incrementing counter number of the device, the event code is the device fault, abnormality, or operating status code, and the queue indicator reflects the device's internal transmit / receive buffer and the degree of task queuing congestion.

[0033] In an optional embodiment of the present invention, step 104, which involves classifying the acquisition status of the industrial equipment serial port data to obtain a frozen classification result, may include: Step 1041: Perform acquisition status diagnosis based on the service data in the industrial equipment serial port data to obtain the acquisition status diagnosis result; Specifically, when business data is received from the serial port of industrial equipment within a preset time period, the status diagnostic result is determined to be "no timeout"; otherwise, it is determined to be "timeout", and the cumulative number of consecutive timeouts is counted. The status diagnostic result includes either "no timeout" or "cumulative number of consecutive timeouts".

[0034] Step 1042: Perform a frozen classification of the acquisition status based on the status diagnostic data in the industrial equipment serial port data and the acquisition status diagnostic results to obtain the frozen classification results.

[0035] In an optional embodiment of the present invention, step 1042 includes: Step 10421: Obtain timeout data based on the collected status diagnosis results and the preset timeout threshold; Specifically, the cumulative number of consecutive timeouts in the collected status diagnosis results is compared with the preset timeout threshold. When the cumulative number of consecutive timeouts reaches the preset timeout threshold, the timeout data is obtained, indicating that the preset timeout threshold has been reached.

[0036] Step 10422: Based on the status diagnosis data and timeout data in the industrial equipment serial port data, perform data collection status freeze classification to obtain freeze classification results.

[0037] Specifically, after obtaining the timeout data, a fixed-length timeout window is opened, and the status diagnostic data falling within the timeout window is extracted. The first heartbeat value and the last heartbeat value of the window are extracted and compared: when the first and last heartbeat values ​​are the same, the freeze classification result is hard freeze (i.e., the device itself has not refreshed its state); when the first and last heartbeat values ​​change, the freeze classification result is communication degradation (i.e., the device refreshes normally, but the link is unstable).

[0038] In addition, communication anomaly diagnosis can be performed using event codes and queue metrics in status diagnostic data. For example, based on event codes (such as overload, memory error, program exception, watchdog-triggered shutdown, etc.) and hard freezes, the freeze classification result can be determined as a device failure. Combining event codes and heartbeat values ​​for status freeze classification prevents misjudgments. Queue metrics are used to determine if the device is overloaded. When queue increments surge and gaps are too large, it indicates that the device has too many tasks and cannot handle them, indicating that the device is under performance strain. If the link is unstable but the queue metric values ​​are stable and normal, it indicates link degradation. Significantly abnormal queue metric values ​​indicate internal congestion. Combining heartbeats, event codes, and queue metrics to comprehensively judge link or device anomalies improves the accuracy of status freeze classification.

[0039] In an optional embodiment of the present invention, step 105, obtaining the data acquisition process evidence chain based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result, may include: Step 1051: Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result, an initial chain of evidence is obtained; Specifically, according to the preset template, all data from the industrial equipment serial port acquisition configuration file, valid acquisition configuration data, industrial equipment serial port data, and frozen classification results can be filled into the preset template one by one to obtain the initial chain of evidence.

[0040] Step 1052: Generate summary data and evidence chain identifier based on the initial evidence chain; Specifically, a unique evidence chain identifier is generated for the initial evidence chain to facilitate subsequent searching and management. This identifier can be a unique timestamp derived from the initial evidence chain's generation time (using the timestamp of the initial evidence chain's generation as the identifier). The frozen classification results can be used as summary data to intuitively understand whether a device or communication system is faulty. In practice, a large model can also be used to generate summary data.

[0041] Step 1053: Obtain the data acquisition process evidence chain based on the summary data, the evidence chain identifier, and the initial evidence chain.

[0042] Specifically, the evidence chain in the data collection process includes summary data, evidence chain identifier, and initial evidence chain. The evidence chain identifier facilitates searching and tracing, the summary data allows for a quick understanding of the evidence chain content, and the initial evidence chain provides a detailed understanding of the complete data collection and diagnosis process.

[0043] In an optional embodiment of the present invention, the method for acquiring and processing serial port data of industrial equipment further includes: Step 106: Decode and convert the industrial equipment serial port data according to the channel and register binding mapping table in the effective acquisition configuration data to obtain at least one type of displayable data; Specifically, depending on whether the acquisition channel is a floating-point acquisition channel or a single-register channel, the business data in the serial port data of the industrial equipment is decoded: the floating-point acquisition channel takes two consecutive registers and converts them into floating-point values, while the single-register channel directly performs single-register conversion and matches the corresponding physical quantity engineering units, and the decoded data is used as displayable data.

[0044] Step 107: Display the at least one type of displayable data on the display interface of the host computer.

[0045] Specifically, at least one type of displayable data is displayed on the host computer's display interface for users to view business data, such as temperature and pressure.

[0046] A specific embodiment of the method for acquiring and processing serial port data of industrial equipment proposed in this invention includes: Step 111: Obtain the industrial equipment serial port acquisition configuration file; the industrial equipment serial port acquisition configuration file includes the starting address and reading length of the multi-segment register for reading the serial port data of the industrial equipment, as well as the register address and data type corresponding to each acquisition channel between the host computer and each industrial equipment. Obtain user-defined serial port acquisition configuration files for industrial equipment. These configuration files can be modified or replaced based on adjustments made to the lower-level industrial equipment.

[0047] Step 112: Merge the starting addresses of multiple register reads in the serial port acquisition configuration file of the industrial equipment, and perform overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data; the valid acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table; After the serial port acquisition configuration file of the industrial equipment passes the validity check, the starting addresses of multiple register reads are merged into a merged read interval list; and the register addresses corresponding to each acquisition channel are overwritten according to the data type acquired by the acquisition channel. After the overwriting check passes, the channel and register are bound to obtain valid acquisition configuration data.

[0048] Step 113: Synchronously batch collect the serial port data of the industrial equipment corresponding to the read interval list according to the merged read interval list in the effective collection configuration data; Based on the preset polling cycle and the list of merged read intervals in the valid collection configuration data, batch collection of industrial equipment serial port data sent by lower-level devices is performed.

[0049] Step 114: Perform data acquisition status freeze classification on the serial port data of the industrial equipment to obtain the freeze classification result; Based on the business data and status diagnostic data in the serial port data of industrial equipment, the status freeze classification is performed, and the freeze classification result is either hard freeze (equipment fault) or communication fault.

[0050] Step 115: Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result, obtain the evidence chain of the data acquisition process.

[0051] All data streams during the data acquisition process are linked together to form a chain of evidence for the data acquisition process, which facilitates retrospective management.

[0052] Step 116: Decode and convert the industrial equipment serial port data according to the channel and register binding mapping table in the effective acquisition configuration data to obtain at least one type of displayable data; The business data in the serial port data of industrial equipment is decoded according to whether the acquisition channel type is a floating-point type acquisition channel or a single register channel: the floating-point type acquisition channel takes two consecutive registers and converts them into floating-point values, while the single register channel directly performs single register conversion and matches the corresponding physical quantity engineering units, and the decoded data is used as displayable data.

[0053] Step 117: Display the at least one type of displayable data on the display interface of the host computer.

[0054] The decoded and converted displayable data is sent to the display interface of the host computer for users to view the business data.

[0055] The industrial equipment serial port data acquisition and processing method of this invention reduces the round-trip and maintenance costs of the acquisition bus under the premise of configurability and expansion; it subdivides communication timeouts into operable freeze types to improve positioning efficiency; it maintains a higher communication success rate when there are differences in device responses; it provides a standardized chain of evidence to shorten the problem review time; and it maintains consistency in diagnostic output for old and new firmware to improve compatibility.

[0056] In one specific embodiment of the present invention, the following compatibility strategy is adopted for Modbus RTU communication: The system determines the end of a frame reception based on the idle interval; it automatically identifies the complete response boundary of a frame by relying on the idle interval timestamp of the serial bus, thus solving the problem of packet fragmentation and repackaging.

[0057] The system supports both standard and short frame variant parsing for write-to-single-register and write-to-multiple-register responses; it prioritizes parsing responses based on the Modbus standard frame length and cyclic redundancy check; if standard parsing fails, it switches to short frame variant mode, parsing only the status byte to determine the success or failure of the write instruction.

[0058] For write commands with no response semantics, a delay and input buffer cleanup strategy is provided; for some devices, write operations do not return response frames, and a fixed short delay is set after sending the command to forcibly clear the serial port input buffer to prevent residual dirty data from interfering with the next round of reading.

[0059] Serial port access is mutually exclusive at the transaction level to avoid concurrent cross-contamination. The mutex lock is preempted before each read / write operation, and only one set of Modbus frames is sent and received at a time, eliminating multi-task concurrent crosstalk and message cross-contamination.

[0060] Another specific embodiment of the method for acquiring and processing serial port data of industrial equipment according to the present invention includes: After the host computer starts, it loads the configuration file containing the read request range and channel definitions and performs coverage verification. If the verification passes, the read request ranges are merged, and the merged read ranges are used to read registers in batches and construct address mappings. Finally, real-time samples are decoded and output according to the channel type. If any channel register is not covered, the acquisition process is refused to start. Coverage verification includes: when the channel type is floating-point, the starting register of the channel and subsequent consecutive registers must be covered by the read request range.

[0061] Under a fixed polling cycle, Modbus reads are performed according to the merged intervals to construct register mappings; the results of each round of readings, heartbeat values, event codes, and queue metrics are recorded. If consecutive timeouts occur and reach a threshold, a timeout window is entered; if the first and last heartbeat values ​​are consistent at the end of the window, it is determined to be a hard freeze; otherwise, it is determined to be a communication degradation. The freeze classification is further corrected for the worst-case scenario by combining diagnostic event codes, queue count increments, and communication loop gap thresholds.

[0062] After sending a write register request, the response is first checked against the standard length and cyclic redundancy check. If the standard does not match, the status byte is parsed in short frame format. In the case of a no-response semantic command, a short delay is performed followed by clearing the input buffer to prevent subsequent reads from being affected by packet fragmentation. The write register response undergoes both standard frame and short frame format compatible parsing. Communication compatibility parsing includes: after standard write response parsing fails, the status byte is parsed in short frame format to determine success or failure. For no-response semantic write commands, a delay and input buffer clearing are performed to reduce subsequent read / write interference.

[0063] During the operation of the host computer, the data generated within the cycle is written into the data processing report according to a fixed polling cycle; at the same time, field description documents are generated; after the operation is completed, a summary is output, including success rate, timeout rate, recovery latency and failure window samples, forming an auditable chain of evidence.

[0064] The industrial equipment serial port data acquisition and processing method of this invention achieves configurable acquisition and unified decoding by merging and covering read request intervals; it performs layered judgment of freeze types based on continuous timeout windows and heartbeat changes by integrating business read samples and diagnostic snapshots in polling; it improves the communication stability of heterogeneous devices by using standard frames and short frames for write responses in a dual-format compatible parsing manner; and it outputs an evidence product chain containing the original trajectory, field descriptions, and summary indicators. This solution can improve real-time performance, compatibility, diagnostics, and traceability in industrial settings.

[0065] like Figure 2 As shown, an embodiment of the present invention provides an industrial equipment serial port data acquisition and processing device 200, comprising: The acquisition module 201 is used to acquire the serial port acquisition configuration file of the industrial equipment; the serial port acquisition configuration file of the industrial equipment includes the starting address and reading length of the multi-segment register for reading the serial port data of the industrial equipment, as well as the register address and data type of each acquisition channel between the host computer and each industrial equipment. The processing module 202 is used to merge the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file, and to perform overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data. The valid acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table. The module synchronously and batch-acquires industrial equipment serial port data corresponding to the merged read interval list in the valid acquisition configuration data. The module performs acquisition status freeze classification on the industrial equipment serial port data to obtain freeze classification results. The module obtains a data acquisition process evidence chain based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the freeze classification results.

[0066] Optionally, the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file are merged, and the register addresses corresponding to each acquisition channel are overwritten and verified to obtain valid acquisition configuration data, including: The validity of the industrial equipment serial port acquisition configuration file is verified. After the validity verification is passed, the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file are merged to obtain a merged read interval list. Based on the merged read interval list and the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, a coverage verification is performed on the register address corresponding to each acquisition channel to obtain the coverage verification result. Based on the coverage verification results, the merged read interval list, and the register addresses corresponding to each acquisition channel, a channel-register binding mapping table is obtained; Based on the merged read interval list and the channel-register binding mapping table, valid acquisition configuration data is obtained.

[0067] Optionally, based on the merged read interval list and the register addresses and data types corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, a coverage check is performed on the register addresses corresponding to each acquisition channel to obtain the coverage check results, including: The acquisition channel type is determined based on the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file; If the acquisition channel type is a single register channel and the corresponding single register address is in the merged read range list, or if the acquisition channel type is a floating-point acquisition channel and the corresponding dual register addresses are both in the merged read range list, then the coverage verification result is passed.

[0068] Optionally, based on the merged read interval list in the effective acquisition configuration data, the serial port data of the industrial equipment corresponding to the read interval list is synchronously and in batches acquired, including: Based on the preset polling cycle and the list of merged read intervals in the effective collection configuration data, the batch read register instruction and status diagnosis instruction are sent to the lower-level device; Receive industrial equipment serial port data sent by the lower-level device; the industrial equipment serial port data includes business data and status diagnostic data.

[0069] Optionally, the serial port data of the industrial equipment is subjected to a data acquisition status freeze classification to obtain a freeze classification result, including: Based on the business data in the serial port data of the industrial equipment, a data acquisition status diagnosis is performed to obtain the data acquisition status diagnosis result. Based on the status diagnostic data in the serial port data of the industrial equipment and the acquired status diagnostic results, the acquired status is frozen and classified to obtain the frozen classification results.

[0070] Optionally, based on the status diagnostic data in the industrial equipment serial port data and the acquired status diagnostic results, a frozen classification of the acquired status is performed to obtain a frozen classification result, including: Based on the collected status diagnosis results and the preset timeout threshold, timeout data is obtained; Based on the status diagnosis data and timeout data in the serial port data of the industrial equipment, the status freeze classification is performed to obtain the freeze classification result.

[0071] Optionally, based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result, an evidence chain for the data acquisition process is obtained, including: An initial chain of evidence is obtained based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result. Based on the initial chain of evidence, generate summary data and chain of evidence identifiers; Based on the summary data, the evidence chain identifier, and the initial evidence chain, the evidence chain of the data collection process is obtained.

[0072] The industrial equipment serial port data acquisition and processing device of this invention obtains an industrial equipment serial port acquisition configuration file; merges the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file and performs overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data; synchronously batch acquires industrial equipment serial port data corresponding to the read interval list according to the merged read interval list in the valid acquisition configuration data; performs acquisition status freeze classification on the industrial equipment serial port data to obtain freeze classification results; and obtains a data acquisition process evidence chain based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the freeze classification results. This can reduce the number of bus round trips, improve real-time performance and efficiency, and through acquisition status freeze classification, accurately distinguish between equipment freeze or link degradation, improving the accuracy of fault determination.

[0073] It should be noted that this device corresponds to the method described above, and all implementations in the method embodiments described above are applicable to the embodiments of this device and can achieve the same technical effect. Further details are omitted in this embodiment.

[0074] This invention also provides a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described in any of the above embodiments. All implementations in the above method embodiments are applicable to the embodiments of this device and can achieve the same technical effects. Further details are omitted in this embodiment.

[0075] This invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in any of the above embodiments. All implementations in the above method embodiments are applicable to the embodiments of this device and can achieve the same technical effects. Further details are omitted in this embodiment.

[0076] It should be noted that in the apparatus and method of the present invention, the components or steps can obviously be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Furthermore, the steps for performing the above series of processes can naturally be performed in the order described and in chronological order, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel, overlapping, or independently of each other.

[0077] It should be noted that in the above embodiments, 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 a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments described above is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0078] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for acquiring and processing serial port data of industrial equipment, applied to a host computer, characterized in that, include: Obtain the serial port acquisition configuration file for industrial equipment; The industrial equipment serial port acquisition configuration file includes the starting address for reading multi-segment registers of the industrial equipment's serial port data, the reading length, and the register addresses and data types corresponding to each acquisition channel between the host computer and each industrial equipment. The starting addresses of multiple register reads in the serial port acquisition configuration file of the industrial equipment are merged, and the register addresses corresponding to each acquisition channel are overwritten and verified to obtain valid acquisition configuration data. The effective acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table; Synchronously batch collect the serial port data of the industrial equipment corresponding to the read interval list according to the merged read interval list in the effective collection configuration data; The serial port data of the industrial equipment is subjected to a frozen classification of the acquisition status, and the frozen classification result is obtained. Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification results, an evidence chain for the data acquisition process is obtained.

2. The method for acquiring and processing serial port data of industrial equipment according to claim 1, characterized in that, The starting addresses of multiple register reads in the serial port acquisition configuration file of the industrial equipment are merged, and the register addresses corresponding to each acquisition channel are overwritten and verified to obtain valid acquisition configuration data, including: The validity of the industrial equipment serial port acquisition configuration file is verified. After the validity verification is passed, the starting addresses of multiple register reads in the industrial equipment serial port acquisition configuration file are merged to obtain a merged read interval list. Based on the merged read interval list and the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, a coverage verification is performed on the register address corresponding to each acquisition channel to obtain the coverage verification result. Based on the coverage verification results, the merged read interval list, and the register addresses corresponding to each acquisition channel, a channel-register binding mapping table is obtained; Based on the merged read interval list and the channel-register binding mapping table, valid acquisition configuration data is obtained.

3. The method for acquiring and processing serial port data of industrial equipment according to claim 2, characterized in that, Based on the merged read interval list and the register addresses and data types corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file, a coverage check is performed on the register addresses corresponding to each acquisition channel to obtain the coverage check results, including: The acquisition channel type is determined based on the register address and data type corresponding to each acquisition channel in the industrial equipment serial port acquisition configuration file; If the acquisition channel type is a single register channel and the corresponding single register address is in the merged read range list, or if the acquisition channel type is a floating-point acquisition channel and the corresponding dual register addresses are both in the merged read range list, then the coverage verification result is passed.

4. The method for acquiring and processing serial port data of industrial equipment according to claim 1, characterized in that, Synchronously and batch collect industrial equipment serial port data corresponding to the read interval list according to the merged read interval list in the effective acquisition configuration data, including: Based on the preset polling cycle and the list of merged read intervals in the effective collection configuration data, the batch read register instruction and status diagnosis instruction are sent to the lower-level device; Receive industrial equipment serial port data sent by the lower-level device; the industrial equipment serial port data includes business data and status diagnostic data.

5. The method for acquiring and processing serial port data of industrial equipment according to claim 1, characterized in that, The serial port data of the industrial equipment is subjected to acquisition status freeze classification to obtain freeze classification results, including: Based on the business data in the serial port data of the industrial equipment, a data acquisition status diagnosis is performed to obtain the data acquisition status diagnosis result. Based on the status diagnostic data in the serial port data of the industrial equipment and the acquired status diagnostic results, the acquired status is frozen and classified to obtain the frozen classification result.

6. The method for acquiring and processing serial port data of industrial equipment according to claim 5, characterized in that, Based on the status diagnostic data in the industrial equipment serial port data and the acquired status diagnostic results, the acquired status is classified into frozen states to obtain frozen classification results, including: Based on the collected status diagnosis results and the preset timeout threshold, timeout data is obtained; Based on the status diagnosis data and timeout data in the serial port data of the industrial equipment, the status freeze classification is performed to obtain the freeze classification result.

7. The method for acquiring and processing serial port data of industrial equipment according to claim 1, characterized in that, Based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification results, an evidence chain for the data acquisition process is obtained, including: An initial chain of evidence is obtained based on the industrial equipment serial port acquisition configuration file, the valid acquisition configuration data, the industrial equipment serial port data, and the frozen classification result. Based on the initial chain of evidence, generate summary data and chain of evidence identifiers; Based on the summary data, the evidence chain identifier, and the initial evidence chain, the evidence chain of the data collection process is obtained.

8. A serial port data acquisition and processing device for industrial equipment, characterized in that, include: The acquisition module is used to acquire the serial port acquisition configuration file of industrial equipment; The industrial equipment serial port acquisition configuration file includes the starting address for reading multi-segment registers of the industrial equipment's serial port data, the reading length, and the register addresses and data types corresponding to each acquisition channel between the host computer and each industrial equipment. The processing module is used to merge the starting addresses of multiple registers in the serial port acquisition configuration file of the industrial equipment, and to perform overwrite verification on the register addresses corresponding to each acquisition channel to obtain valid acquisition configuration data. The effective acquisition configuration data includes: a merged read interval list and a channel-register binding mapping table; synchronously batch-acquiring industrial equipment serial port data corresponding to the read interval list according to the merged read interval list in the effective acquisition configuration data; performing acquisition status freeze classification on the industrial equipment serial port data to obtain freeze classification results; and obtaining a data acquisition process evidence chain based on the industrial equipment serial port acquisition configuration file, the effective acquisition configuration data, the industrial equipment serial port data, and the freeze classification results.

9. A computing device, characterized in that, include: A processor, a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The system stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 7.