Laboratory equipment access and configuration method and system based on dynamic protocol analysis
By automatically identifying the communication protocol of laboratory equipment by monitoring port signals, dynamically analyzing and generating instruction templates, the problem of poor protocol compatibility in traditional laboratory equipment access systems is solved, and efficient and stable device access and configuration is achieved.
Patent Information
- Application Number
- CN202510626612.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-12
AI Technical Summary
There are problems in traditional laboratory equipment access systems with poor protocol compatibility, low configuration efficiency and high maintenance costs. Especially when facing heterogeneous devices with multiple manufacturers and multi-protocols, it is difficult for the existing technology to realize automatic protocol analysis and dynamic adaptation.
By monitoring the physical connection signal of the port, the device communication protocol type and data frame structure are automatically identified, and the preset device mapping table and protocol matching rule library are used to dynamically analyze the protocol, and the communication instruction template is generated, and the communication status is monitored in real time for visual display.
It realizes fully automatic access and configuration of laboratory equipment, reduces deployment costs, improves configuration efficiency and communication stability, and improves user experience.
Smart Images

Figure CN120475086A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laboratory equipment configuration, and more particularly to a laboratory equipment access and configuration method and system based on dynamic protocol analysis. Background Art
[0002] With the increasing demand for intelligent laboratories, the integration and unified management of multi-vendor, multi-protocol devices have become key challenges. Traditional laboratory equipment typically uses heterogeneous communication protocols with diverse interface types. Common heterogeneous communication protocols include Modbus, CAN, and RS485, and communication interfaces include serial, network, and wireless. This leads to problems such as poor protocol compatibility, low configuration efficiency, and high maintenance costs when connecting devices to the system. Currently, most protocols rely on manual configuration of protocol parameters and fixed protocols, which pose problems such as high communication failure rates due to complex configuration processes and poor protocol scalability that makes it difficult to adapt to updates and iterations of laboratory equipment.
[0003] To address these issues, existing technologies attempt to improve compatibility through protocol conversion modules or universal interface adapters, but they still cannot achieve automatic protocol parsing and dynamic adaptation. Centralized protocol gateways require manual pre-defined conversion rules and are unable to handle unknown devices or new protocols. Therefore, a fully automated protocol adaptation and efficient management of laboratory equipment access and configuration technology are urgently needed. Summary of the Invention
[0004] In view of the above problems, the purpose of the present invention is to provide a laboratory equipment access and configuration method and system based on dynamic protocol parsing. By monitoring the physical connection signal of the port and dynamic protocol parsing, the device communication protocol type and data frame structure are automatically identified without manual configuration of protocol parameters, thereby reducing deployment costs; by configuring the table to drive the instruction generation and exception handling mechanism, the stability in high-frequency monitoring scenarios is guaranteed; and by configuring the table to drive the dynamic rendering of the data display template, a variety of views such as curve charts and dashboards are supported, thereby improving the user experience.
[0005] A first aspect of the present invention provides a method for accessing and configuring laboratory equipment based on dynamic protocol parsing, the method comprising:
[0006] Obtain the physical connection signal of the device through the monitoring port, and configure the underlying communication link according to the physical connection signal;
[0007] Based on the underlying communication link, obtaining first identification information;
[0008] Determine the protocol family type according to the first identification information and a preset device mapping table;
[0009] Acquire first monitoring data, and perform segmented parsing based on the protocol family type to obtain a field data frame;
[0010] Based on a preset protocol matching rule library, first configuration information is obtained according to the field data frame, including a name, a unit, a data type, and an instruction format;
[0011] Generate a communication instruction template according to the first configuration information, for obtaining first interaction data;
[0012] According to the first interaction data, monitoring the communication status and triggering abnormal processing;
[0013] Based on a preset interactive platform, a visual display is performed according to the first interactive data.
[0014] In this solution, configuring the underlying communication link according to the physical connection signal is specifically as follows:
[0015] The physical interface type identification module determines whether the device access mode is a serial port, a network port or a wireless communication interface;
[0016] Call the corresponding communication protocol stack initialization parameters according to the interface type. Among them, the serial communication configuration includes baud rate, data bits, stop bits and parity mode, and the network communication configuration includes IP address allocation, port number binding and TCP / UDP protocol selection;
[0017] After establishing a communication session, a handshake command is sent to the lab device;
[0018] If no response is received, the port retry mechanism is triggered. If the retry count threshold is exceeded, it is marked as a communication access abnormality.
[0019] Record communication link configuration parameters and session identifiers and store them in the system log.
[0020] In this solution, the first identification information is obtained based on the underlying communication link, specifically:
[0021] Sending a first identification request instruction to the device through the underlying communication link;
[0022] Parsing the first identification feedback instruction to obtain device information, wherein the device information includes at least a manufacturer code, a device model, a firmware version, and an interface type;
[0023] Extracting first identification information based on the device information;
[0024] matching the first identification information with a database of pre-registered devices;
[0025] If the device is not registered, the corresponding protocol feature library is downloaded according to the manufacturer code and stored in the local rule library.
[0026] In this solution, the protocol family type is determined according to the first identification information and a preset device mapping table, specifically:
[0027] searching a preset device-protocol mapping table based on the first identification information;
[0028] If the match is successful, the protocol family type is directly associated;
[0029] If the match fails, the feature code of the data frame sent by the device is extracted and matched with the protocol feature template in the local rule base through the rule tree traversal;
[0030] Calculating a matching degree based on the data frame feature code and the protocol feature template;
[0031] Select the protocol feature template with the highest matching degree as the device protocol family;
[0032] The selected protocol feature template is bound to the first identification information and updated to the device-protocol mapping table.
[0033] In this solution, the first monitoring data is obtained and segmented parsed based on the protocol family type to obtain a field data frame, specifically:
[0034] Define the start flag, end flag, and checksum field positions of the communication data frame according to the frame structure rules corresponding to the protocol family type;
[0035] Scanning the communication data stream based on a preset byte sliding window, identifying the boundary of a valid data frame, and extracting first monitoring data;
[0036] Verifying the first monitoring data based on the protocol family type;
[0037] If the verification fails, the data frame is discarded and a data retransmission request is triggered;
[0038] If the verification is successful, it is split into address field data, function field data, data field data and verification field data according to the field division rules defined in the protocol.
[0039] In this solution, the communication instruction template is generated according to the first configuration information to obtain the first interaction data, specifically:
[0040] Generate a basic instruction frame according to the field data frame;
[0041] Fill in dynamic parameters according to the first configuration information, including data name, data unit and data type;
[0042] Transcode the instructions based on the configured underlying communication link and generate instruction templates. The transcoding methods include hexadecimal transcoding, ASCII encoding, or two's complement conversion;
[0043] The generated instruction template is bound to the first identification information and stored in the instruction cache pool.
[0044] In this solution, the communication status is monitored and the abnormality processing is triggered according to the first interaction data, specifically:
[0045] Monitor command response timeouts, data verification errors, and link interruption events in real time, and record the exception type and occurrence time;
[0046] If a command response timeout or data verification error is detected, the command will be resent at increasing intervals. If the preset number of resends is exceeded, an exception will be marked;
[0047] If a link interruption is detected, the current session is closed and an attempt is made to reinitialize the communication link;
[0048] An exception report is generated and pushed to the management platform, wherein the exception report includes an exception code and first identification information.
[0049] A second aspect of the present invention provides a laboratory equipment access and configuration system based on dynamic protocol parsing, including a laboratory equipment access and configuration method program based on dynamic protocol parsing. When the laboratory equipment access and configuration method program based on dynamic protocol parsing is executed by the processor, the following steps are implemented:
[0050] Obtain the physical connection signal of the device through the monitoring port, and configure the underlying communication link according to the physical connection signal;
[0051] Based on the underlying communication link, obtaining first identification information;
[0052] Determine the protocol family type according to the first identification information and a preset device mapping table;
[0053] Acquire first monitoring data, and perform segmented parsing based on the protocol family type to obtain a field data frame;
[0054] Based on a preset protocol matching rule library, first configuration information is obtained according to the field data frame, including a name, a unit, a data type, and an instruction format;
[0055] Generate a communication instruction template according to the first configuration information, for obtaining first interaction data;
[0056] According to the first interaction data, monitoring the communication status and triggering abnormal processing;
[0057] Based on a preset interactive platform, a visual display is performed according to the first interactive data.
[0058] In this solution, configuring the underlying communication link according to the physical connection signal is specifically as follows:
[0059] The physical interface type identification module determines whether the device access mode is a serial port, a network port or a wireless communication interface;
[0060] Call the corresponding communication protocol stack initialization parameters according to the interface type. Among them, the serial communication configuration includes baud rate, data bits, stop bits and parity mode, and the network communication configuration includes IP address allocation, port number binding and TCP / UDP protocol selection;
[0061] After establishing a communication session, a handshake command is sent to the lab device;
[0062] If no response is received, the port retry mechanism is triggered. If the retry count threshold is exceeded, it is marked as a communication access abnormality.
[0063] Record communication link configuration parameters and session identifiers and store them in the system log.
[0064] In this solution, the first identification information is obtained based on the underlying communication link, specifically:
[0065] Sending a first identification request instruction to the device through the underlying communication link;
[0066] Parsing the first identification feedback instruction to obtain device information, wherein the device information includes at least a manufacturer code, a device model, a firmware version, and an interface type;
[0067] Extracting first identification information based on the device information;
[0068] matching the first identification information with a database of pre-registered devices;
[0069] If the device is not registered, the corresponding protocol feature library is downloaded according to the manufacturer code and stored in the local rule library.
[0070] The present invention provides an access and configuration method and system for laboratory equipment based on dynamic protocol parsing. First, by monitoring the physical connection signal of the port, the communication link configuration is automatically triggered, and the preset protocol parameters are called based on the interface type to obtain the first identification information of the device; then, based on the preset protocol mapping table or dynamic matching rule library, the protocol type is determined, the original data stream is segmented and parsed based on the protocol type, valid frames are identified and the integrity is verified, and field definitions, instruction templates and communication parameters are obtained for binding and storing with the unique identification of the device; finally, instructions are automatically generated according to the communication configuration and communicate and interact with the laboratory equipment. By monitoring the communication status in real time, retransmission or link recovery operations are triggered in the event of an abnormality; in addition, the communication status of the laboratory equipment is displayed in real time through an interactive platform; the present invention reduces deployment costs through fully automatic identification and configuration, and improves communication stability through communication link optimization and abnormality handling. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope.
[0072] Figure 1 A flow chart showing a method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to the present invention is shown;
[0073] Figure 2 A flow chart showing the configuration of an underlying communication link provided by an embodiment of the present invention is shown;
[0074] Figure 3 shows a flowchart of extracting first identification information provided by an embodiment of the present invention;
[0075] Figure 4 A block diagram of a laboratory equipment access and configuration system based on dynamic protocol analysis according to the present invention is shown.
[0076] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0077] Unless otherwise defined, all terms (including technical and scientific terms) used in the embodiments of the present invention have the same meaning as commonly understood by those skilled in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or extremely formal sense, unless explicitly defined in this manner in the embodiments of the present invention.
[0078] The terms "first," "second," and similar words used in the embodiments of the present invention do not indicate any order, quantity, or importance, but are only used to distinguish different components. Terms such as "a," "an," or "the" do not indicate a limit on quantity, but rather indicate the presence of at least one. Similarly, terms such as "include," "comprise," and "comprising" mean that the elements or objects preceding the term include the elements or objects listed after the term and their equivalents, without excluding other elements or objects.
[0079] "Connected" or "connected" and similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The preceding or subsequent steps of the methods of the embodiments of the present invention do not necessarily need to be performed in exact order. Instead, various steps may be performed in reverse order or simultaneously. Furthermore, other operations may be added to these processes, or one or more steps may be removed from these processes.
[0080] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0081] Figure 1 The flowchart of the present invention shows a method for accessing and configuring laboratory equipment based on dynamic protocol analysis.
[0082] like Figure 1 As shown, the first aspect of the present invention discloses a method for accessing and configuring laboratory equipment based on dynamic protocol parsing, the method comprising:
[0083] Obtain the physical connection signal of the device through the monitoring port, and configure the underlying communication link according to the physical connection signal;
[0084] Based on the underlying communication link, obtaining first identification information;
[0085] Determine the protocol family type according to the first identification information and a preset device mapping table;
[0086] Acquire first monitoring data, and perform segmented parsing based on the protocol family type to obtain a field data frame;
[0087] Based on a preset protocol matching rule library, first configuration information is obtained according to the field data frame, including a name, a unit, a data type, and an instruction format;
[0088] Generate a communication instruction template according to the first configuration information, for obtaining first interaction data;
[0089] According to the first interaction data, monitoring the communication status and triggering abnormal processing;
[0090] Based on a preset interactive platform, a visual display is performed according to the first interactive data.
[0091] It should be noted that, first, the device's physical connection signals are monitored in real time via a listening port. For example, serial port level changes are monitored via a serial port monitoring thread, and TCP handshake requests are monitored via a network port scanning module. Based on the interface type, the underlying communication link is automatically established using preset default communication protocol stack parameters; for example, the serial port baud rate and parity bits are set to default parameters, and the network port IP address is set to dynamically allocated. Based on the underlying communication link, an identification request command is sent to the laboratory device to obtain basic information about the laboratory device, including the device identification code, manufacturer code, and device model. The device identification code is the first identification information. This embodiment reduces deployment costs and improves configuration efficiency by fully automatically identifying devices and configuration protocols, replacing manual configuration. Based on the device identification code, the protocol family type is matched according to a device-protocol mapping table preset in memory. Based on the protocol family type, the raw data stream is segmented and parsed according to the frame structure defined by the protocol, extracting valid fields. The raw data stream is then used to generate a structured configuration template by matching the field meanings using regular expressions in the protocol rule base. The structured configuration template defines the name, unit, data type, and instruction format. This application is based on a dynamic template mapping protocol family, which automatically matches structured templates to facilitate compatibility with new laboratory equipment. At the same time, based on the structured configuration template, data can be queried through fields to improve the efficiency of data analysis. Subsequently, when communicating data with laboratory equipment, corresponding communication instructions are generated according to the configuration template. At this time, by monitoring and analyzing the interactive data during communication, it is used to detect communication states such as timeouts or verification errors, and trigger a retransmission mechanism based on the communication state to ensure communication reliability. In addition, through interactive platforms such as clients or Web platforms, interactive data when communicating with laboratory equipment is obtained from the server in real time for visual display, including curve charts, parameter tables, operating status, etc., to enhance the user experience.
[0092] Figure 2 A configuration flow chart of the underlying communication link provided by an embodiment of the present invention is shown.
[0093] According to an embodiment of the present invention, Figure 2 As shown, configuring the underlying communication link according to the physical connection signal is specifically as follows:
[0094] The physical interface type identification module determines whether the device access mode is a serial port, a network port or a wireless communication interface;
[0095] Call the corresponding communication protocol stack initialization parameters according to the interface type. Among them, the serial communication configuration includes baud rate, data bits, stop bits and parity mode, and the network communication configuration includes IP address allocation, port number binding and TCP / UDP protocol selection;
[0096] After establishing a communication session, a handshake command is sent to the lab device;
[0097] If no response is received, the port retry mechanism is triggered. If the retry count threshold is exceeded, it is marked as a communication access abnormality.
[0098] Record communication link configuration parameters and session identifiers and store them in the system log.
[0099] It should be noted that this embodiment provides a configuration process for the underlying communication link. First, the system identifies the access mode of the laboratory equipment through the physical interface detection module, wherein the access mode includes a serial port, a network port, or a wireless communication interface. Taking the serial port as an example, the default protocol stack initialization parameters are called to initialize the serial port configuration, including the baud rate, data bits, stop bits, and check mode. As an implementation method, the baud rate in the initialization parameters is 115200bps, the data bits are 8 bits, the stop bits are 1 bit, and the check mode is parity check. Taking Tongluo communication as an example, it is configured as DHCP dynamic IP address allocation, the binding port number is 8080, and the transmission protocol is TCP. After establishing a communication session, a handshake instruction is sent to the laboratory equipment; if the handshake is successful, the laboratory equipment information is obtained based on the handshake feedback instruction; if no response is received, a retry mechanism is triggered, for example, resending at an interval of 2 seconds. When the number of retransmissions exceeds the set maximum number, an exception is marked and a log is recorded. When an exception is marked, all configuration parameters and session status are stored in the system log, and historical records can be queried by timestamp to facilitate troubleshooting communication failures.
[0100] Figure 3 A flowchart of extracting the first identification information provided by an embodiment of the present invention is shown.
[0101] According to an embodiment of the present invention, Figure 3 As shown, the first identification information is obtained based on the underlying communication link, specifically:
[0102] Sending a first identification request instruction to the device through the underlying communication link;
[0103] Parsing the first identification feedback instruction to obtain device information, wherein the device information includes at least a manufacturer code, a device model, a firmware version, and an interface type;
[0104] Extracting first identification information based on the device information;
[0105] matching the first identification information with a database of pre-registered devices;
[0106] If the device is not registered, the corresponding protocol feature library is downloaded according to the manufacturer code and stored in the local rule library.
[0107] It should be noted that this embodiment provides a process for obtaining and verifying device identification information. A standard query instruction, namely a first identification request instruction, is sent to the laboratory equipment through the underlying communication link. Based on the laboratory equipment feedback instruction, the device information of the laboratory equipment is parsed, which includes at least the manufacturer code, device model, firmware version and interface type. Then, based on the device information, a unique identifier is extracted to represent the laboratory equipment, wherein the unique identifier can be used to link the local database to find protocol features. According to the unique identifier, the local registered device database is queried; if the device is registered, the historical configuration is loaded according to the database; if the device is not registered, the protocol download process is entered. The protocol feature library is downloaded from the cloud according to the manufacturer code and stored in the local rule library. This embodiment improves the compatibility with laboratory equipment by updating the local protocol template through the cloud, and realizes automatic identification and configuration of the communication protocol.
[0108] According to an embodiment of the present invention, determining the protocol family type according to the first identification information and a preset device mapping table is specifically:
[0109] searching a preset device-protocol mapping table based on the first identification information;
[0110] If the match is successful, the protocol family type is directly associated;
[0111] If the match fails, the feature code of the data frame sent by the device is extracted and matched with the protocol feature template in the local rule base through the rule tree traversal;
[0112] Calculating a matching degree based on the data frame feature code and the protocol feature template;
[0113] Select the protocol feature template with the highest matching degree as the device protocol family;
[0114] The selected protocol feature template is bound to the first identification information and updated to the device-protocol mapping table.
[0115] It should be noted that this embodiment provides dynamic matching logic for protocol family types. The preset device-protocol mapping table is queried based on the device's unique identifier; if a mapping record exists, the protocol type is directly bound; if not, the protocol type is dynamically matched based on the local rule base. When dynamically matching protocol types, first, the data frame feature code of the communication data sent by the laboratory equipment is extracted, and the protocol feature template in the local rule base is traversed in the order of the rule tree to calculate the field overlap rate with the data frame feature code in the rule base, that is, the matching degree; then, sort by matching degree, and select the highest one as the default protocol; finally, the final protocol type is bound to the unique identification code of the laboratory equipment, and updated to the device-protocol mapping table to accelerate the recognition efficiency of subsequent similar devices. This embodiment solves the problem of manual configuration required when new devices are connected through dynamic matching logic, thereby improving the adaptability and compatibility of the system.
[0116] According to an embodiment of the present invention, the first monitoring data is obtained, and segmented parsing is performed based on the protocol family type to obtain a field data frame, specifically:
[0117] Define the start flag, end flag, and checksum field positions of the communication data frame according to the frame structure rules corresponding to the protocol family type;
[0118] Scanning the communication data stream based on a preset byte sliding window, identifying the boundary of a valid data frame, and extracting first monitoring data;
[0119] Verifying the first monitoring data based on the protocol family type;
[0120] If the verification fails, the data frame is discarded and a data retransmission request is triggered;
[0121] If the verification is successful, it is split into address field data, function field data, data field data and verification field data according to the field division rules defined in the protocol.
[0122] It should be noted that this embodiment provides a segmented parsing process for data frames. First, according to the protocol family type, the positions of the frame start flag, end flag and check field are defined. Based on the maximum length of the data frame in the protocol family type, the size of the sliding window is set. First, the data stream is scanned according to the sliding window algorithm, and the valid frame data is identified based on the start flag and end flag to obtain the first monitoring data. The integrity of the data frame is then checked according to the check value; if the check fails, the data frame is discarded and retransmission is requested; if the check passes, the fields are split according to the protocol rules, and the physical meaning is marked. This embodiment reduces invalid data processing and saves system resources through the verification mechanism; splits data according to the protocol rules to ensure the accuracy of subsequent configuration generation.
[0123] According to an embodiment of the present invention, generating a communication instruction template according to the first configuration information for obtaining the first interaction data is specifically:
[0124] Generate a basic instruction frame according to the field data frame;
[0125] Fill in dynamic parameters according to the first configuration information, including data name, data unit and data type;
[0126] Transcode the instructions based on the configured underlying communication link and generate instruction templates. The transcoding methods include hexadecimal transcoding, ASCII encoding, or two's complement conversion;
[0127] The generated instruction template is bound to the first identification information and stored in the instruction cache pool.
[0128] It should be noted that this embodiment provides a process for generating communication instructions. First, an instruction framework is generated based on the field address and data type in the configuration table; device address data, length data, target data, check data, and other information are filled into the instruction framework to generate the original communication instruction. Then, transcoding is performed according to the corresponding interface protocol, including but not limited to hexadecimal transcoding, ASCII encoding, or binary complement conversion. In addition, the generated instruction template is bound to the first identification information and stored in the instruction cache pool for subsequent cyclic calls. This embodiment improves the efficiency and accuracy of instruction generation by automatically combining instructions.
[0129] According to an embodiment of the present invention, monitoring the communication status and triggering exception processing based on the first interaction data is specifically as follows:
[0130] Monitor command response timeouts, data verification errors, and link interruption events in real time, and record the exception type and occurrence time;
[0131] If a command response timeout or data verification error is detected, the command will be resent at increasing intervals. If the preset number of resends is exceeded, an exception will be marked;
[0132] If a link interruption is detected, the current session is closed and an attempt is made to reinitialize the communication link;
[0133] An exception report is generated and pushed to the management platform, wherein the exception report includes an exception code and first identification information.
[0134] It should be noted that this embodiment provides a communication status monitoring and exception handling mechanism. Communication abnormalities include but are not limited to response timeouts, data verification errors, and link interruptions. As an implementation method, when a timeout or verification error occurs, the command is resent at increasing intervals, up to 5 times; if it still fails, the device is marked as abnormal. As an implementation method, when the link is interrupted, the current session is closed and communication is reinitialized. Finally, the Shanghai abnormality report is pushed to the management platform, where the report includes an abnormality code, a unique identifier, or recommended measures.
[0135] It is worth mentioning that the preset interactive platform performs a visual display based on the first interactive data, specifically:
[0136] Extracting corresponding display data according to the first interaction data and filling it into a corresponding data area of the interaction platform;
[0137] Dynamically render device data display templates based on the configuration table of the interactive platform, including curve charts, dashboards, and parameter tables;
[0138] Adjust the data display area and style of the interactive platform based on the user-defined view layout.
[0139] It should be noted that this embodiment provides a control mechanism for a visualization platform. Through interactive platforms such as client or web platforms, real-time data from the server regarding communication with laboratory equipment is obtained for visualization, including graphs, parameter tables, and operating status, enhancing the user experience. Furthermore, users can customize the data display area and style of the interactive platform, further enhancing the user experience.
[0140] It is worth mentioning that it also includes device configuration migration and batch management mechanisms, specifically:
[0141] Applied to cross-system migration scenarios;
[0142] Export device configuration tables and protocol rule bases to generate migration configuration files;
[0143] When importing a migration configuration file, the protocol rule base version of the target system is automatically matched. If there is a difference, a compatibility warning is displayed.
[0144] It should be noted that this embodiment provides a laboratory equipment configuration migration process. A migration file is generated by exporting the configuration file and its associated protocol rule base. When importing the migration file, the rule base version of the target environment is compared. If there is a discrepancy, the user is prompted to manually update.
[0145] It is worth mentioning that the construction and update of the protocol matching rule base includes the following steps:
[0146] The rule base is stored as an extensible tree structure, which includes protocol signatures, field mapping relationships, and instruction generation templates;
[0147] When adding a new protocol type, import the protocol description file through the graphical interface, automatically parse and generate rule nodes, and insert them into the rule tree.
[0148] It should be noted that this embodiment provides a mechanism for constructing and dynamically updating a protocol rule base. As an implementation, the rule base is stored in a tree-like hierarchy, with the root node representing the protocol family and the child nodes representing the field mapping rules for specific function codes. Based on protocol description files uploaded by the user through the interface, including but not limited to XML and JSON files, the rule base is automatically parsed and generated into rule nodes.
[0149] Figure 4 A block diagram of a laboratory equipment access and configuration system based on dynamic protocol analysis according to the present invention is shown.
[0150] like Figure 4 As shown, the second aspect of the present invention discloses a laboratory equipment access and configuration system 4 based on dynamic protocol parsing, including a memory 41 and a processor 42. The memory includes a laboratory equipment access and configuration method program based on dynamic protocol parsing. When the laboratory equipment access and configuration method program based on dynamic protocol parsing is executed by the processor, the following steps are implemented:
[0151] Obtain the physical connection signal of the device through the monitoring port, and configure the underlying communication link according to the physical connection signal;
[0152] Based on the underlying communication link, obtaining first identification information;
[0153] Determine the protocol family type according to the first identification information and a preset device mapping table;
[0154] Acquire first monitoring data, and perform segmented parsing based on the protocol family type to obtain a field data frame;
[0155] Based on a preset protocol matching rule library, first configuration information is obtained according to the field data frame, including a name, a unit, a data type, and an instruction format;
[0156] Generate a communication instruction template according to the first configuration information, for obtaining first interaction data;
[0157] According to the first interaction data, monitoring the communication status and triggering abnormal processing;
[0158] Based on a preset interactive platform, a visual display is performed according to the first interactive data.
[0159] It should be noted that, first, the device's physical connection signals are monitored in real time via a listening port. For example, serial port level changes are monitored via a serial port monitoring thread, and TCP handshake requests are monitored via a network port scanning module. Based on the interface type, the underlying communication link is automatically established using preset default communication protocol stack parameters; for example, the serial port baud rate and parity bits are set to default parameters, and the network port IP address is set to dynamically allocated. Based on the underlying communication link, an identification request command is sent to the laboratory device to obtain basic information about the laboratory device, including the device identification code, manufacturer code, and device model. The device identification code is the first identification information. This embodiment reduces deployment costs and improves configuration efficiency by fully automatically identifying devices and configuration protocols, replacing manual configuration. Based on the device identification code, the protocol family type is matched according to a device-protocol mapping table preset in memory. Based on the protocol family type, the raw data stream is segmented and parsed according to the frame structure defined by the protocol, extracting valid fields. The raw data stream is then used to generate a structured configuration template by matching the field meanings using regular expressions in the protocol rule base. The structured configuration template defines the name, unit, data type, and instruction format. This application is based on a dynamic template mapping protocol family, which automatically matches structured templates to facilitate compatibility with new laboratory equipment. At the same time, based on the structured configuration template, data can be queried through fields to improve the efficiency of data analysis. Subsequently, when communicating data with laboratory equipment, corresponding communication instructions are generated according to the configuration template. At this time, by monitoring and analyzing the interactive data during communication, it is used to detect communication states such as timeouts or verification errors, and trigger a retransmission mechanism based on the communication state to ensure communication reliability. In addition, through interactive platforms such as clients or Web platforms, interactive data when communicating with laboratory equipment is obtained from the server in real time for visual display, including curve charts, parameter tables, operating status, etc., to enhance the user experience.
[0160] According to an embodiment of the present invention, configuring the underlying communication link according to the physical connection signal is specifically:
[0161] The physical interface type identification module determines whether the device access mode is a serial port, a network port or a wireless communication interface;
[0162] Call the corresponding communication protocol stack initialization parameters according to the interface type. Among them, the serial communication configuration includes baud rate, data bits, stop bits and parity mode, and the network communication configuration includes IP address allocation, port number binding and TCP / UDP protocol selection;
[0163] After establishing a communication session, a handshake command is sent to the lab device;
[0164] If no response is received, the port retry mechanism is triggered. If the retry count threshold is exceeded, it is marked as a communication access abnormality.
[0165] Record communication link configuration parameters and session identifiers and store them in the system log.
[0166] It should be noted that this embodiment provides a configuration process for the underlying communication link. First, the system identifies the access mode of the laboratory equipment through the physical interface detection module, wherein the access mode includes a serial port, a network port, or a wireless communication interface. Taking the serial port as an example, the default protocol stack initialization parameters are called to initialize the serial port configuration, including the baud rate, data bits, stop bits, and check mode. As an implementation method, the baud rate in the initialization parameters is 115200bps, the data bits are 8 bits, the stop bits are 1 bit, and the check mode is parity check. Taking Tongluo communication as an example, it is configured as DHCP dynamic IP address allocation, the binding port number is 8080, and the transmission protocol is TCP. After establishing a communication session, a handshake instruction is sent to the laboratory equipment; if the handshake is successful, the laboratory equipment information is obtained based on the handshake feedback instruction; if no response is received, a retry mechanism is triggered, for example, resending at an interval of 2 seconds. When the number of retransmissions exceeds the set maximum number, an exception is marked and a log is recorded. When an exception is marked, all configuration parameters and session status are stored in the system log, and historical records can be queried by timestamp to facilitate troubleshooting communication failures.
[0167] According to an embodiment of the present invention, the acquiring of the first identification information based on the underlying communication link is specifically:
[0168] Sending a first identification request instruction to the device through the underlying communication link;
[0169] Parsing the first identification feedback instruction to obtain device information, wherein the device information includes at least a manufacturer code, a device model, a firmware version, and an interface type;
[0170] Extracting first identification information based on the device information;
[0171] matching the first identification information with a database of pre-registered devices;
[0172] If the device is not registered, the corresponding protocol feature library is downloaded according to the manufacturer code and stored in the local rule library.
[0173] It should be noted that this embodiment provides a process for obtaining and verifying device identification information. A standard query instruction, namely a first identification request instruction, is sent to the laboratory equipment through the underlying communication link. Based on the laboratory equipment feedback instruction, the device information of the laboratory equipment is parsed, which includes at least the manufacturer code, device model, firmware version and interface type. Then, based on the device information, a unique identifier is extracted to represent the laboratory equipment, wherein the unique identifier can be used to link the local database to find protocol features. According to the unique identifier, the local registered device database is queried; if the device is registered, the historical configuration is loaded according to the database; if the device is not registered, the protocol download process is entered. The protocol feature library is downloaded from the cloud according to the manufacturer code and stored in the local rule library. This embodiment improves the compatibility with laboratory equipment by updating the local protocol template through the cloud, and realizes automatic identification and configuration of the communication protocol.
[0174] According to an embodiment of the present invention, determining the protocol family type according to the first identification information and a preset device mapping table is specifically:
[0175] searching a preset device-protocol mapping table based on the first identification information;
[0176] If the match is successful, the protocol family type is directly associated;
[0177] If the match fails, the feature code of the data frame sent by the device is extracted and matched with the protocol feature template in the local rule base through the rule tree traversal;
[0178] Calculating a matching degree based on the data frame feature code and the protocol feature template;
[0179] Select the protocol feature template with the highest matching degree as the device protocol family;
[0180] The selected protocol feature template is bound to the first identification information and updated to the device-protocol mapping table.
[0181] It should be noted that this embodiment provides dynamic matching logic for protocol family types. The preset device-protocol mapping table is queried based on the device's unique identifier; if a mapping record exists, the protocol type is directly bound; if not, the protocol type is dynamically matched based on the local rule base. When dynamically matching protocol types, first, the data frame feature code of the communication data sent by the laboratory equipment is extracted, and the protocol feature template in the local rule base is traversed in the order of the rule tree to calculate the field overlap rate with the data frame feature code in the rule base, that is, the matching degree; then, sort by matching degree, and select the highest one as the default protocol; finally, the final protocol type is bound to the unique identification code of the laboratory equipment, and updated to the device-protocol mapping table to accelerate the recognition efficiency of subsequent similar devices. This embodiment solves the problem of manual configuration required when new devices are connected through dynamic matching logic, thereby improving the adaptability and compatibility of the system.
[0182] According to an embodiment of the present invention, the first monitoring data is obtained, and segmented parsing is performed based on the protocol family type to obtain a field data frame, specifically:
[0183] Define the start flag, end flag, and checksum field positions of the communication data frame according to the frame structure rules corresponding to the protocol family type;
[0184] Scanning the communication data stream based on a preset byte sliding window, identifying the boundary of a valid data frame, and extracting first monitoring data;
[0185] Verifying the first monitoring data based on the protocol family type;
[0186] If the verification fails, the data frame is discarded and a data retransmission request is triggered;
[0187] If the verification is successful, it is split into address field data, function field data, data field data and verification field data according to the field division rules defined in the protocol.
[0188] It should be noted that this embodiment provides a segmented parsing process for data frames. First, according to the protocol family type, the positions of the frame start flag, end flag and check field are defined. Based on the maximum length of the data frame in the protocol family type, the size of the sliding window is set. First, the data stream is scanned according to the sliding window algorithm, and the valid frame data is identified based on the start flag and end flag to obtain the first monitoring data. The integrity of the data frame is then checked according to the check value; if the check fails, the data frame is discarded and retransmission is requested; if the check passes, the fields are split according to the protocol rules, and the physical meaning is marked. This embodiment reduces invalid data processing and saves system resources through the verification mechanism; splits data according to the protocol rules to ensure the accuracy of subsequent configuration generation.
[0189] According to an embodiment of the present invention, generating a communication instruction template according to the first configuration information for obtaining the first interaction data is specifically:
[0190] Generate a basic instruction frame according to the field data frame;
[0191] Fill in dynamic parameters according to the first configuration information, including data name, data unit and data type;
[0192] Transcode the instructions based on the configured underlying communication link and generate instruction templates. The transcoding methods include hexadecimal transcoding, ASCII encoding, or two's complement conversion;
[0193] The generated instruction template is bound to the first identification information and stored in the instruction cache pool.
[0194] It should be noted that this embodiment provides a process for generating communication instructions. First, an instruction framework is generated based on the field address and data type in the configuration table; device address data, length data, target data, check data, and other information are filled into the instruction framework to generate the original communication instruction. Then, transcoding is performed according to the corresponding interface protocol, including but not limited to hexadecimal transcoding, ASCII encoding, or binary complement conversion. In addition, the generated instruction template is bound to the first identification information and stored in the instruction cache pool for subsequent cyclic calls. This embodiment improves the efficiency and accuracy of instruction generation by automatically combining instructions.
[0195] According to an embodiment of the present invention, monitoring the communication status and triggering exception processing based on the first interaction data is specifically as follows:
[0196] Monitor command response timeouts, data verification errors, and link interruption events in real time, and record the exception type and occurrence time;
[0197] If a command response timeout or data verification error is detected, the command will be resent at increasing intervals. If the preset number of resends is exceeded, an exception will be marked;
[0198] If a link interruption is detected, the current session is closed and an attempt is made to reinitialize the communication link;
[0199] An exception report is generated and pushed to the management platform, wherein the exception report includes an exception code and first identification information.
[0200] It should be noted that this embodiment provides a communication status monitoring and exception handling mechanism. Communication abnormalities include but are not limited to response timeouts, data verification errors, and link interruptions. As an implementation method, when a timeout or verification error occurs, the command is resent at increasing intervals, up to 5 times; if it still fails, the device is marked as abnormal. As an implementation method, when the link is interrupted, the current session is closed and communication is reinitialized. Finally, the Shanghai abnormality report is pushed to the management platform, where the report includes an abnormality code, a unique identifier, or recommended measures.
[0201] It is worth mentioning that the preset interactive platform performs a visual display based on the first interactive data, specifically:
[0202] Extracting corresponding display data according to the first interaction data and filling it into a corresponding data area of the interaction platform;
[0203] Dynamically render device data display templates based on the configuration table of the interactive platform, including curve charts, dashboards, and parameter tables;
[0204] Adjust the data display area and style of the interactive platform based on the user-defined view layout.
[0205] It should be noted that this embodiment provides a control mechanism for a visualization platform. Through interactive platforms such as client or web platforms, real-time data from the server regarding communication with laboratory equipment is obtained for visualization, including graphs, parameter tables, and operating status, enhancing the user experience. Furthermore, users can customize the data display area and style of the interactive platform, further enhancing the user experience.
[0206] It is worth mentioning that it also includes device configuration migration and batch management mechanisms, specifically:
[0207] Applied to cross-system migration scenarios;
[0208] Export device configuration tables and protocol rule bases to generate migration configuration files;
[0209] When importing a migration configuration file, the protocol rule base version of the target system is automatically matched. If there is a difference, a compatibility warning is displayed.
[0210] It should be noted that this embodiment provides a laboratory equipment configuration migration process. A migration file is generated by exporting the configuration file and its associated protocol rule base. When importing the migration file, the rule base version of the target environment is compared. If there is a discrepancy, the user is prompted to manually update.
[0211] It is worth mentioning that the construction and update of the protocol matching rule base includes the following steps:
[0212] The rule base is stored as an extensible tree structure, which includes protocol signatures, field mapping relationships, and instruction generation templates;
[0213] When adding a new protocol type, import the protocol description file through the graphical interface, automatically parse and generate rule nodes, and insert them into the rule tree.
[0214] It should be noted that this embodiment provides a mechanism for constructing and dynamically updating a protocol rule base. As an implementation, the rule base is stored in a tree-like hierarchy, with the root node representing the protocol family and the child nodes representing the field mapping rules for specific function codes. Based on protocol description files uploaded by the user through the interface, including but not limited to XML and JSON files, the rule base is automatically parsed and generated into rule nodes.
[0215] In summary, the present invention provides a method and system for accessing and configuring laboratory equipment based on dynamic protocol parsing. First, by monitoring the physical connection signal of the port, the communication link configuration is automatically triggered, and the preset protocol parameters are called based on the interface type to obtain the first identification information of the device; then, based on the preset protocol mapping table or dynamic matching rule library, the protocol type is determined, the original data stream is segmented and parsed based on the protocol type, valid frames are identified and the integrity is verified, and field definitions, instruction templates and communication parameters are obtained for binding and storing with the unique identification of the device; finally, instructions are automatically generated according to the communication configuration and communicate and interact with the laboratory equipment, and the communication status is monitored in real time to trigger retransmission or link recovery operations in the event of an abnormality; in addition, the communication status of the laboratory equipment is displayed in real time through an interactive platform; the present invention reduces deployment costs through fully automatic identification and configuration, and improves communication stability through communication link optimization and exception handling.
[0216] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0217] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for accessing and configuring laboratory equipment based on dynamic protocol analysis, characterized in that: The method comprises: Obtain the physical connection signal of the device through the monitoring port, and configure the underlying communication link according to the physical connection signal; Based on the underlying communication link, obtaining first identification information; Determine the protocol family type according to the first identification information and a preset device mapping table; Acquire first monitoring data, and perform segmented parsing based on the protocol family type to obtain a field data frame; Based on a preset protocol matching rule library, first configuration information is obtained according to the field data frame, including a name, a unit, a data type, and an instruction format; Generate a communication instruction template according to the first configuration information, for obtaining first interaction data; According to the first interaction data, monitoring the communication status and triggering abnormal processing; Based on a preset interactive platform, a visual display is performed according to the first interactive data.
2. The method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to claim 1, characterized in that: The configuring of the underlying communication link according to the physical connection signal is specifically: The physical interface type identification module determines whether the device access mode is a serial port, a network port or a wireless communication interface; Call the corresponding communication protocol stack initialization parameters according to the interface type. Among them, the serial communication configuration includes baud rate, data bits, stop bits and parity mode, and the network communication configuration includes IP address allocation, port number binding and TCP / UDP protocol selection; After establishing a communication session, a handshake command is sent to the lab device; If no response is received, the port retry mechanism is triggered. If the retry count threshold is exceeded, it is marked as a communication access abnormality. Record communication link configuration parameters and session identifiers and store them in the system log.
3. The method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to claim 1, characterized in that: The acquiring of the first identification information based on the underlying communication link is specifically: Sending a first identification request instruction to the device through the underlying communication link; Parsing the first identification feedback instruction to obtain device information, wherein the device information includes at least a manufacturer code, a device model, a firmware version, and an interface type; Extracting first identification information based on the device information; matching the first identification information with a database of pre-registered devices; If the device is not registered, the corresponding protocol feature library is downloaded according to the manufacturer code and stored in the local rule library.
4. The method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to claim 1, characterized in that: The determining of the protocol family type according to the first identification information and a preset device mapping table is specifically: searching a preset device-protocol mapping table based on the first identification information; If the match is successful, the protocol family type is directly associated; If the match fails, the feature code of the data frame sent by the device is extracted and matched with the protocol feature template in the local rule base through the rule tree traversal; Calculating a matching degree based on the data frame feature code and the protocol feature template; Select the protocol feature template with the highest matching degree as the device protocol family; The selected protocol feature template is bound to the first identification information and updated to the device-protocol mapping table.
5. The method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to claim 1, characterized in that: The first monitoring data is obtained, and segmented parsing is performed based on the protocol family type to obtain a field data frame, specifically: Define the start flag, end flag, and checksum field positions of the communication data frame according to the frame structure rules corresponding to the protocol family type; Scanning the communication data stream based on a preset byte sliding window, identifying the boundary of a valid data frame, and extracting first monitoring data; Verifying the first monitoring data based on the protocol family type; If the verification fails, the data frame is discarded and a data retransmission request is triggered; If the verification is successful, it is split into address field data, function field data, data field data and verification field data according to the field division rules defined in the protocol.
6. The method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to claim 1, characterized in that: The generating of a communication instruction template according to the first configuration information, for obtaining the first interaction data, is specifically: Generate a basic instruction frame according to the field data frame; Fill in dynamic parameters according to the first configuration information, including data name, data unit and data type; Transcode the instructions based on the configured underlying communication link and generate instruction templates. The transcoding methods include hexadecimal transcoding, ASCII encoding, or two's complement conversion; The generated instruction template is bound to the first identification information and stored in the instruction cache pool.
7. The method for accessing and configuring laboratory equipment based on dynamic protocol analysis according to claim 1, characterized in that: The monitoring of the communication status and triggering of abnormal processing according to the first interaction data is specifically as follows: Monitor command response timeouts, data verification errors, and link interruption events in real time, and record the exception type and occurrence time; If a command response timeout or data verification error is detected, the command will be resent at increasing intervals. If the preset number of resends is exceeded, an exception will be marked; If a link interruption is detected, the current session is closed and an attempt is made to reinitialize the communication link; An exception report is generated and pushed to the management platform, wherein the exception report includes an exception code and first identification information.
8. A laboratory equipment access and configuration system based on dynamic protocol analysis, characterized in that: The system includes a memory and a processor. The memory includes a method program for accessing and configuring laboratory equipment based on dynamic protocol parsing. When the method program for accessing and configuring laboratory equipment based on dynamic protocol parsing is executed by the processor, the following steps are implemented: Obtain the physical connection signal of the device through the monitoring port, and configure the underlying communication link according to the physical connection signal; Based on the underlying communication link, obtaining first identification information; Determine the protocol family type according to the first identification information and a preset device mapping table; Acquire first monitoring data, and perform segmented parsing based on the protocol family type to obtain a field data frame; Based on a preset protocol matching rule library, first configuration information is obtained according to the field data frame, including a name, a unit, a data type, and an instruction format; Generate a communication instruction template according to the first configuration information, for obtaining first interaction data; According to the first interaction data, monitoring the communication status and triggering abnormal processing; Based on a preset interactive platform, a visual display is performed according to the first interactive data.
9. The laboratory equipment access and configuration system based on dynamic protocol analysis according to claim 8, characterized in that: The configuring of the underlying communication link according to the physical connection signal is specifically: The physical interface type identification module determines whether the device access mode is a serial port, a network port or a wireless communication interface; Call the corresponding communication protocol stack initialization parameters according to the interface type. Among them, the serial communication configuration includes baud rate, data bits, stop bits and parity mode, and the network communication configuration includes IP address allocation, port number binding and TCP / UDP protocol selection; After establishing a communication session, a handshake command is sent to the lab device; If no response is received, the port retry mechanism is triggered. If the retry count threshold is exceeded, it is marked as a communication access abnormality. Record communication link configuration parameters and session identifiers and store them in the system log.
10. The laboratory equipment access and configuration system based on dynamic protocol analysis according to claim 8, characterized in that: The acquiring of the first identification information based on the underlying communication link is specifically: Sending a first identification request instruction to the device through the underlying communication link; Parsing the first identification feedback instruction to obtain device information, wherein the device information includes at least a manufacturer code, a device model, a firmware version, and an interface type; Extracting first identification information based on the device information; matching the first identification information with a database of pre-registered devices; If the device is not registered, the corresponding protocol feature library is downloaded according to the manufacturer code and stored in the local rule library.
Citation Information
Cited By
Visual configuration method and system based on modular AI gateway
CN120768757A
A visual configuration method and system based on a modular AI gateway
CN120768757B
Automatic loading method and system for pool sonar test process
CN120779378A
Method and system for automatically loading a sonar test procedure
CN120779378B
Automatic detection system and method for optical characteristics of semiconductor laser
CN121253119A