LabVIEW-based serial port communication self-defined analysis system and LabVIEW-based serial port communication self-defined analysis method

The serial communication custom parsing system developed through LabVIEW uses a custom parsing database and debugging interface to solve the problem of fixed serial communication protocol parsing methods in the existing technology, achieve efficient parsing and configuration of multiple protocols, and improve the system communication efficiency and flexibility.

CN118631907APending Publication Date: 2024-09-10SHANGHAI HUASUI ELECTRONICS TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410823473.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The existing strategy of fixed serial port communication protocol parsing methods cannot meet the data parsing needs of multiple communication protocols. As a result, when the system faces multiple serial ports and uses different protocols, the reading and parsing speed is affected and the communication efficiency is low.

Method used

A serial port communication custom parsing system based on LabVIEW is used to realize flexible configuration and parsing through the serial port communication custom parsing database and debugging interface, and generate target configuration files to custom parse serial port data to improve the versatility of the system.

Benefits of technology

It achieves efficient reading and analysis of multiple serial port protocols, reduces labor and time costs, improves system flexibility and communication efficiency, and can flexibly configure and manage multiple serial port communication protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631907A
    Figure CN118631907A
Patent Text Reader

Abstract

The invention provides a LabVIEW-based serial port communication custom analysis system and method, and relates to the technical field of communication protocols, and the method comprises the steps: receiving a configuration request of a user based on a debugging interface, receiving configuration information inputted by the user, and obtaining to-be-analyzed original measurement information through a target serial port; wherein the configuration request comprises a configuration type; based on a configuration module, calling an original configuration file from a serial port communication self-defined analysis database according to the configuration type, and updating the original configuration file according to the configuration information input by the user to obtain a target configuration file; configuration of a target serial port and a serial port communication protocol is flexibly carried out in a user-defined mode, and the universality is improved. Based on an analysis module, configuration of the target serial port and configuration of a serial port protocol are carried out through the target configuration file, original measurement information is analyzed according to the configured serial port protocol, a target analysis result is obtained, and self-defined analysis of the original measurement information is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of communication protocols, and in particular to a LabVIEW-based serial communication user-defined parsing system and method. Background Art

[0002] With the development of Internet of Things (IoT) and remote monitoring technology, serial communication will play an increasingly important role in the future. Serial communication has the advantages of high reliability, low cost and easy implementation, which makes it widely used in various fields, such as industrial automation, smart home, remote monitoring, medical equipment, etc. At the same time, with the development of embedded systems, serial communication is also widely used in communication with external devices. For example, microcontrollers can communicate with display screens, sensors and other devices through serial ports.

[0003] Among them, RS-232, RS-422, RS-485, Modbus and other communication protocol standards occupy an important position in the field of serial communication. However, the currently used serial data parsing method usually parses the data according to a fixed parsing strategy, which may not meet the technical requirements for parsing data of multiple communication protocols.

[0004] Based on this, it is necessary to propose a custom parsing system and method for serial communication based on LabVIEW. Summary of the invention

[0005] This specification provides a LabVIEW-based serial communication custom parsing system and method, which uses a serial communication custom parsing database to flexibly configure the target serial port and serial communication protocol in a custom manner, thereby improving the versatility of the system; so as to facilitate custom parsing of raw measurement information received from the target serial port.

[0006] The present application provides a LabVIEW-based serial communication custom parsing system that adopts the following technical solutions, including: a debugging module, a configuration module, and a parsing module;

[0007] The debugging module includes a serial communication custom parsing database and a debugging interface;

[0008] The serial communication custom parsing database includes a plurality of original configuration files, and each configuration type corresponds to one original configuration file;

[0009] The debugging interface is used to receive a configuration request from a user; receive configuration information input by the user; obtain original measurement information to be parsed through a target serial port; wherein the configuration request includes a configuration type;

[0010] The configuration module is used to retrieve the original configuration file from the serial communication custom parsing database according to the configuration type; update the original configuration file according to the configuration information input by the user to obtain the target configuration file;

[0011] The parsing module is used to configure the target serial port and the serial port protocol through the target configuration file; and parse the original measurement information according to the configured serial port protocol to obtain a target parsing result.

[0012] Optionally, the debugging interface includes: a plurality of configuration interfaces;

[0013] The configuration interface is pre-constructed according to the original configuration file; each configuration type corresponds to one configuration interface; and the configuration interface displays the configuration information in the original configuration file.

[0014] Optionally, the debugging interface includes: a serial port configuration and communication interaction component;

[0015] The serial port configuration and communication interaction component includes: a serial port device configuration component and a data sending and receiving component;

[0016] The serial port device configuration component is used to receive the device configuration information input by the user; the data sending and receiving component is used to control the data sending of the target serial port and / or the receiving of the original measurement information.

[0017] Optionally, the debugging interface further includes: a data analysis interaction component;

[0018] The data analysis and interaction component includes: a serial port protocol configuration component, a protocol analysis component, and an error handling component;

[0019] The serial port protocol configuration component is used to receive the protocol configuration information input by the user;

[0020] The protocol parsing component is used to call the parsing module to parse the original measurement information to obtain the target parsing result;

[0021] The error handling component is used to display errors that occur during the parsing process of the parsing module.

[0022] Optionally, the debugging interface further includes: a data distribution component;

[0023] The data distribution component is used to perform format conversion and data distribution on the target parsing result.

[0024] Optionally, the parsing module is decoupled from the debugging interface.

[0025] Optionally, the target configuration file is in JSON format.

[0026] The present application provides a LabVIEW-based serial communication custom parsing method using the following technical solutions, including:

[0027] Obtaining a configuration request from a user; the configuration request includes a configuration type;

[0028] Searching for an original configuration file corresponding to the configuration type from a custom parsing database for serial communication;

[0029] Receiving the configuration information input by the user, updating the original configuration file, and obtaining a target configuration file;

[0030] Determine the target serial port according to the configuration type, and configure the target serial port and the corresponding serial port communication protocol through the target configuration file;

[0031] The original measurement information to be analyzed is obtained through the target serial port, and the original measurement information is analyzed according to the configured serial port protocol to obtain the target analysis result.

[0032] This specification also provides an electronic device, wherein the electronic device includes:

[0033] processor; and,

[0034] A memory storing computer executable instructions, which when executed cause the processor to perform any of the above methods.

[0035] The present specification also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, any of the above methods is implemented.

[0036] In the present application, based on the debugging interface, a user's configuration request is received, configuration information input by the user is received, and original measurement information to be parsed is obtained through a target serial port; wherein the configuration request includes a configuration type; based on the configuration module, the original configuration file is retrieved from the serial communication custom parsing database according to the configuration type, and the original configuration file is updated according to the configuration information input by the user to obtain a target configuration file; the serial port device and the serial port communication protocol can be flexibly configured in a customized manner to improve the versatility of the system; based on the parsing module, the target serial port and the serial port protocol are configured through the target configuration file, and the original measurement information is parsed according to the configured serial port protocol to obtain a target parsing result, thereby achieving effective parsing of the original measurement information. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of the structure of a custom parsing system for serial communication based on LabVIEW provided in an embodiment of this specification;

[0038] Figure 2 A schematic diagram of the principle of a custom parsing method for serial communication based on LabVIEW provided in an embodiment of this specification;

[0039] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification;

[0040] Figure 4 A schematic diagram of a computer-readable storage medium provided in accordance with an embodiment of the present specification. DETAILED DESCRIPTION

[0041] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles of the present invention defined in the following description can be applied to other embodiments, variations, improvements, equivalents, and other technical solutions that do not deviate from the spirit and scope of the present invention.

[0042] Under the premise of being consistent with the technical concept of the present invention, the features, structures, characteristics or other details described in a specific embodiment do not exclude that they can be combined in one or more other embodiments in a suitable manner.

[0043] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0044] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0045] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.

[0046] Figure 1 A schematic diagram of a custom parsing system for serial communication based on LabVIEW provided in an embodiment of this specification, the system includes:

[0047] Debug module 110, configuration module 120 and parsing module 130;

[0048] The debugging module 110 includes a serial communication custom parsing database and a debugging interface;

[0049] The serial communication custom parsing database includes a plurality of original configuration files, and each configuration type corresponds to one original configuration file;

[0050] The debugging interface is used to receive a configuration request from a user; receive configuration information input by the user; obtain original measurement information to be parsed through a target serial port; wherein the configuration request includes a configuration type;

[0051] The configuration module 120 is used to retrieve the original configuration file from the serial communication custom parsing database according to the configuration type; update the original configuration file according to the configuration information input by the user to obtain the target configuration file;

[0052] The analysis module 130 is used to configure the target serial port and the serial port protocol through the target configuration file; and to parse the original measurement information according to the configured serial port protocol to obtain a target analysis result.

[0053] The existing technical status of serial communication presents the characteristics of diversification, high speed, stabilization and wide application. In terms of hardware, there are various types of serial ports, including TTL interface, RS-232 interface, RS-422 interface, RS-485 interface, etc. Each serial port has its own characteristics, and can be applied to different communication needs and environments. Among them, standards such as RS-232 / RS-422 / RS-485 occupy an important position in the field of serial communication, and the market size continues to grow, and it is expected to maintain a steady growth trend in the future. In the application field, serial communication is not only used in traditional computer communication and industrial control, but also widely used in the smart serial display screen market. Smart serial display screens can interact with various control devices, sensors, etc. for real-time data, and intuitively present relevant information to operators through the display screen. However, the serial communication protocol corresponding to the existing serial port has certain disadvantages, such as:

[0054] (1) RS-232 protocol. The RS-232 protocol is the earliest serial communication protocol. It was released in 1962 and specifies parameters such as data format, baud rate, data bit, stop bit, and parity check in serial communication. Due to the constraints of transmission speed, one-way transmission, and short transmission distance, the use of the RS-232 protocol is subject to certain restrictions. In addition, the data packet format of the RS-232 protocol may vary, and different data packet formats need to be distinguished and processed during parsing, which increases the complexity. The RS-232 protocol usually only provides a simple parity check, and may not be able to effectively detect and correct complex error conditions that occur during the transmission process.

[0055] (2) RS-422 protocol. RS-422 protocol is used for long-distance data communication. It uses differential signal transmission and has strong resistance to common-mode interference, so it can transmit over longer distances in noisy environments. Compared with RS-232, RS-422 allows full-duplex communication, but requires more signal lines to support it, which increases hardware complexity and cost.

[0056] (3) RS-485 protocol. The RS-232 protocol was originally used as a communication standard between computers and other devices, but with the development of technology, people began to improve it to increase the transmission speed and distance. By improving the communication mechanism, people achieved multi-point communication and higher performance, and proposed the RS-485 protocol. RS-485 is a multi-point communication protocol with the advantages of long communication distance, fast transmission rate, and strong anti-interference. It allows multiple devices to communicate with each other, so it is widely used in industrial automation, security, power and other fields. However, the RS-485 bus cannot achieve automatic bus arbitration, which may cause bus contention and data conflicts, reducing communication efficiency.

[0057] (4) Modbus protocol. With the development of industrial automation, Modbus protocol has gradually become a universal device communication standard. Modbus protocol is an open serial communication protocol that can realize communication between different devices, including data reading, writing, control and other functions. Due to its openness and versatility, it is widely used in industrial automation, building automation and other fields. However, in the Modbus protocol, the number of data returned by the slave is limited by the byte count. For large data reading, multiple communications may be required, which reduces communication efficiency.

[0058] Different serial communication protocols have their own unique characteristics and applicable scenarios. When there are multiple serial ports on the system and different serial communication protocols are used, the reading, parsing speed, and communication speed of the serial port data may be affected based on actual needs.

[0059] Based on this, the present invention aims to construct a custom parsing system for serial communication based on LabVIEW to efficiently read and parse a large amount of serial port data, and can flexibly configure the serial port and serial communication protocol in a custom manner to improve the versatility of the system.

[0060] Specifically, the present invention provides a LabVIEW-based serial communication custom parsing system, including: a debugging module 110 , a configuration module 120 and a parsing module 130 .

[0061] Considering the complicated development steps in the traditional human-machine interface (HMI) development process, in order to develop an efficient and stable parsing system to achieve effective management of serial port communications, in one embodiment of this specification, the LabVIEW development platform is used for development.

[0062] LabVIEW was proposed by NI, based on a general hardware platform and making full use of software-defined instruments. The software implements instrument functions through the platform, and users can interact with the instrument through a friendly graphical interface; the various "icons" on the virtual instrument panel perform the same functions as the various "devices" on the traditional instrument panel; the virtual instrument measurement function is achieved through programming of graphical software flow charts, which is a manifestation of the idea of ​​"software as instrument".

[0063] LabVIEW has built-in software standard library functions. In one embodiment of the present specification, LabVIEW has built-in library functions that facilitate the application of software standards such as TCP / IP (Transmission Control Protocol / Internet Protocol) and ActiveX. Among them, the TCP / IP library functions enable LabVIEW to communicate with other computers or devices through the network to achieve remote data acquisition, monitoring and control functions. The ActiveX library functions provide a cross-platform solution that allows LabVIEW to interact with other software using ActiveX technology, thereby achieving data sharing and functional integration.

[0064] In one embodiment of the present specification, the debugging module 110 includes: a debugging interface and a serial communication custom parsing database.

[0065] (a) Debug interface.

[0066] Design of debugging interface by LabVIEW In one embodiment of the present specification, a debugging interface is created using the user interface (UI) design tool of LabVIEW.

[0067] The debugging interface includes: serial port configuration and communication interaction components, data analysis interaction components, data processing and display interaction components, user interface interaction components, log and debugging interaction components, and extension and customization interaction components.

[0068] The serial port configuration and communication interaction components include: serial port device configuration components, data sending and receiving components.

[0069] The serial port device configuration component is used to receive the device configuration information input by the user and to adapt to different serial port communications based on user modifications.

[0070] The data sending and receiving component is used to send data sending requests and data receiving requests. Based on the data sending requests and data receiving requests, data sending and data receiving between the serial port are realized to ensure that the system can communicate normally with other external hardware devices through the serial port.

[0071] The data analysis and interaction components include: serial port protocol configuration component, data analysis component, and error handling component;

[0072] The serial port protocol configuration component is used to receive the protocol configuration information input by the user and adapt to different serial port communications based on user modifications.

[0073] The protocol parsing component is used to call the parsing module 130 to parse the received original measurement information and extract meaningful information or parameters.

[0074] The error handling component is used to display errors that occur during the parsing process of the protocol parsing component, such as data format errors, verification failures, etc.

[0075] The data processing and display interaction components include: parsing data processing components and data display components.

[0076] The parsing data processing component is used to receive data display requests in order to perform data conversion on the target parsing results to obtain the converted target parsing results. Data conversion includes but is not limited to: calculation, conversion, and storage.

[0077] The data display component is used to display the converted target parsing results. The display methods of the converted target parsing results include but are not limited to: text, icon, and table.

[0078] The user interface interaction components include: configuration components, monitoring interface, operation prompts and feedback components.

[0079] The configuration component is used to display a configuration interface corresponding to the configuration type based on the configuration type selected by the user. Based on the user input on the configuration interface, the modified configuration information is received through the serial device configuration component and / or the protocol configuration component.

[0080] The monitoring component is used to display the status of serial port communication, the received raw measurement information, and the target analysis results in real time.

[0081] The operation prompt and feedback component is used to provide operation prompt information and operation feedback information to help users better use the debugging interface. The log and debugging interaction component includes: log recording component and debugging function component.

[0082] The logging component is used to record key information and error logs during the operation of this system to facilitate subsequent problem troubleshooting and system optimization.

[0083] The debugging function component is used to provide and call debugging tools and interfaces to facilitate developers to debug and optimize the system.

[0084] Extensions and customized interaction components include: plug-in support components and API interfaces.

[0085] The plug-in support component is used to allow users or developers to expand the functionality of the system through plug-ins, such as adding new protocol parsers, data processing algorithms, etc.

[0086] API interface, used to facilitate integration and communication with other modules, software, systems or external hardware devices.

[0087] (ii) Custom parsing database for serial communication.

[0088] When there are multiple serial ports on the system and different serial port communication protocols are used, in order to improve the stability and reliability of the system and reduce maintenance costs, multiple serial port communication protocols need to be managed and maintained in a unified manner.

[0089] However, since the above serial communication protocols lack detailed and unified standards in data structure and communication mechanism, or have missing / imperfect error detection and processing mechanisms, it is difficult to uniformly manage and maintain multiple serial communication protocols.

[0090] The CAN protocol is a multi-point communication protocol, commonly used in the automotive, aviation, military and other fields. It has the characteristics of fast communication speed and strong anti-interference, and is suitable for application scenarios that require high reliability and real-time performance. The CAN protocol has a standard database that other serial communication protocols do not have - the CANdb database.

[0091] Because the CAN protocol has a unique data structure and communication mechanism. It uses a non-destructive bit arbitration mechanism to ensure high utilization and real-time performance of the bus. In addition, the message frame structure of the CAN protocol includes frame start, arbitration field, control field, data field, CRC field, response field and frame end. This structure makes the organization and analysis of data more standardized. Other serial communication protocols may not have such detailed and unified data structures and communication mechanisms, making it difficult to establish a similar database.

[0092] Moreover, the CAN protocol has a powerful error detection and handling mechanism. It uses a variety of means such as cyclic redundancy check (CRC), bit stuffing, response error, bus activity monitoring, etc. to detect and handle errors, ensuring the reliability and stability of communication. Other protocols may lack such error detection and handling mechanisms, or their mechanisms are not as perfect as the CAN protocol, so it is difficult to establish a database that matches them.

[0093] Finally, the CAN protocol is widely used in industrial control, aerospace, shipbuilding, medical equipment, smart home and other fields, and its high performance, reliability and flexibility are widely recognized. This makes the CAN protocol a standardized communication protocol, and a corresponding database is established to manage and maintain its data. Other serial communication protocols may be difficult to form a similar database due to the limitations of the application field or the lack of standardization.

[0094] That is to say, the CANdb database is a data management library designed specifically for the CAN (Controller Area Network) network. It is mainly used to store, manage and describe messages and signals used in the CAN network. It does not have built-in functions to directly collect or process other serial communication protocols (such as RS-232, RS-422, RS-485, Modbus, etc.). Therefore, it is impossible to directly apply the CANdb database and use it directly as a custom parsing database for serial communication.

[0095] Moreover, the serial communication protocols involved in this specification are mainly used in the fields of industrial automation, smart home, remote monitoring, medical equipment, etc. The serial communication protocols commonly used in these fields (such as RS-232, RS-485, Modbus, etc.) are significantly different from the CAN protocol in terms of data transmission speed, distance, anti-interference, etc. Moreover, the data representation and management methods of these communication protocols are incompatible with the CANdb database. Therefore, it is also impossible to support other serial communication protocols by simply improving the CANdb database. Furthermore, in the face of actual needs, it is difficult to achieve flexible custom configuration of serial communication, and thus it is difficult to effectively improve communication efficiency.

[0096] Based on this, it is necessary to build a database related to serial communication in the field of test and measurement applicable to the present invention. In the field of test and measurement, serial communication is generally used to communicate with various sensors. Data analysis and data processing analysis of sensor measurements are the most important parts of the data link in the field of test and measurement. The present invention aims to perform normalization processing on the analysis of sensors of various serial communication protocols, establish a complete, clear and scalable serial communication database, and perform analysis and label binding on the data using custom formulas.

[0097] In one embodiment of the present specification, LabVIEW integrates all functions of hardware and data acquisition card communication of protocols such as General-Purpose Interface Bus (GPIB), VMEbus Extensions for Instrumentation (VXI), RS-232 and RS-485. By integrating the above protocols, LabVIEW can easily communicate with various external hardware devices and provide support for hardware communication protocols, thereby realizing data collection, analysis and control.

[0098] In one embodiment of the present specification, the serial port driver of NI is downloaded and installed; and the serial port communication is realized by programming using Labview.

[0099] At present, there are two ways to implement serial communication protocol parsing using LabVIEW: VISA serial port implementation and serial port library function implementation. However, both methods have disadvantages, specifically:

[0100] (1) The VISA library mainly provides the underlying serial port, but does not directly provide the protocol parsing function. When using VISA (Virtual Instrument Software Architecture) or similar libraries (such as the VISA library in LabVIEW) for serial communication, it is usually necessary to manually parse and construct the serial communication protocol, that is, according to the specific protocol format, use LabVIEW's array operations, string processing, conditional judgment and other functions to parse the received data. In other words, to implement protocol parsing through the VISA serial port method, it is essentially to write the protocol frame by hand, and each type of frame format needs to be written by yourself. When using VISA communication, the serial communication data and CRC check value must be calculated by yourself and ensured to be accurate, otherwise communication failure may occur.

[0101] (2) Library functions mainly rely on the packaged LabVIEW VI library. Serial communication can be realized by directly calling it, and the existing function API in the library can be directly used for read / write operations. However, if many sensors of different brands are used in a project, each sensor has its own unique communication protocol. When the starting address, data length, and data type in the communication protocol are inconsistent, the most direct solution is to parse the data one by one according to the instruction manual of each sensor. In addition to the CRC check value at the frame header and frame tail, it is also necessary to parse the data according to the corresponding starting address and length according to the type of the data, and finally get the data of the corresponding tag. This solution undoubtedly takes a lot of time and manpower. Moreover, in the later stage of the project operation, adding a new type of sensor means that a new set of parsing methods needs to be added, and the program must be recompiled.

[0102] In order to reduce the manpower, material and time costs, and to improve the configuration flexibility of custom parsing, the present invention constructs a serial communication custom parsing database. Specifically, the built-in database function of LabVIEW (such as SQLite) or an external database (such as MySQL, PostgreSQL, etc.) is used for information storage and management. The "Database Connectivity Toolkit" is used in LabVIEW to interact with the database.

[0103] In one embodiment of the present specification, the serial communication custom parsing database includes: a plurality of reusable original configuration files. Each configuration type corresponds to an original configuration file. In one embodiment of the present specification, the configuration type includes the protocol type of the serial port. The protocol type of the serial port includes but is not limited to: RS232, RS485 and Modbus. The present invention improves the diversity of parsing by supporting the formulation, parsing, sending and debugging of multiple basic serial communication protocols.

[0104] The original configuration files are predefined and stored in an address accessible to the system to ensure that the corresponding original configuration files can be matched according to the configuration type.

[0105] The original configuration file includes several configuration information. The configuration information is used to configure the serial port and / or configure the serial port communication protocol. The configuration information includes communication parameters and corresponding communication parameter values. For different serial port types, the corresponding communication parameters may be different.

[0106] The fields of communication parameters in the configuration information include but are not limited to: device identification, device type, device address (slave address), port settings, protocol name, start identifier, end identifier, field separator, field list, sample data, remarks, function code, start address and length, check mode, unit, formula. Among them, port settings include but are not limited to: baud rate, data bit, stop bit, check bit.

[0107] The specific explanation of the fields of the communication parameters is shown in Table 1:

[0108]

[0109]

[0110] (Table 1)

[0111] Each subfield in the field list may be an object. In one embodiment of the present specification, the field list includes but is not limited to the following subfields: field name, data type, length, and description.

[0112] The specific explanation of the subfields in the field list is shown in Table 2:

[0113]

[0114] (Table 2)

[0115] According to the purpose of the configuration information, the configuration information can be divided into: device configuration information for configuring the serial port device and protocol configuration information for configuring the serial port protocol.

[0116] The device configuration information is mainly used to configure the communication parameters of the serial port to ensure that the system can correctly communicate with other devices through the serial port. The protocol configuration information is mainly used to define the specific protocol of the serial port communication and how to parse the received data.

[0117] Those skilled in the art should understand that some configuration information is only used to configure serial port devices, some is only used to configure serial port communication protocols, and some configuration information is used to configure both serial port devices and serial port communication protocols. Therefore, there is a possibility that device configuration information and protocol configuration information overlap.

[0118] Multiple serial communication protocols each have their own characteristics and application scenarios. In order to improve the problems of poor adaptability and low communication efficiency of some serial communication protocols in specific environments, this manual builds a custom parsing database for serial communication, aggregates the original configuration files corresponding to multiple configuration types, and performs unified management and maintenance.

[0119] In order to achieve efficient reading and parsing, the serial communication custom parsing database in this manual supports custom parsing. Specifically, it can also be flexibly configured based on the original configuration file to generate a target configuration file for initializing the serial port and serial communication protocol, ensuring that communication can be performed in the expected manner through the serial port, thereby improving the versatility of the system. Among them, the serial communication custom parsing database does not need to be reprogrammed to achieve the purpose of adding new serial ports and parsing new serial communication protocols.

[0120] In order to facilitate the user to configure the original configuration file, a configuration interface is constructed according to the original configuration file, and each configuration type corresponds to a configuration interface.

[0121] In one embodiment of the present specification, according to the configuration type selected by the user, a connection is made to a serial communication custom parsing database through a database connection tool (such as ODBC, ADO, etc.), and by executing a query, an original configuration file corresponding to the configuration type selected by the user is searched from the serial communication custom parsing database.

[0122] The original configuration file includes several modifiable configuration information and several unmodifiable configuration information. Among them, for the modifiable configuration information, the user can adjust the specific communication parameter value based on the actual situation; for the unmodifiable configuration information, the user cannot adjust the communication parameter value. In other words, the original configuration file includes several modifiable communication parameter values ​​and several unmodifiable communication parameter values.

[0123] The configuration interface is pre-built according to the original configuration file. The retrieved original configuration file is parsed, and the configuration information is extracted to build the configuration interface, which includes fields, input controls and other controls of communication parameters corresponding to the configuration information.

[0124] In one embodiment of the present specification, the configuration information used to construct the configuration interface includes: modifiable configuration information and non-modifiable configuration information. In another embodiment of the present specification, the configuration information used to construct the configuration interface includes only: modifiable configuration information, so that the user can modify it. The modifiable configuration information can be adjusted through controls (such as text boxes, sliders, etc.) on the front panel of LabVIEW.

[0125] In one embodiment of the present specification, wizard-style customization of the target configuration file can be performed in the configuration interface. Based on the wizard-style customization, the modifiable configuration information under a certain serial port is determined, and the configuration requirements of the modifiable configuration information are determined, that is, the configuration requirements of the communication parameter values ​​therein can be determined.

[0126] The present invention can write a serial port protocol through a custom parsing database and a debugging interface through serial port communication, and can quickly generate a target configuration file according to navigation, thereby improving flexibility and scalability.

[0127] In one embodiment of the present specification, when the serial port type is Modbus, the modifiable configuration information includes: device address (slave address), baud rate, data bit, stop bit, check bit, communication mode, function code, check code, register starting address, unit, formula, length in the field list, and data type.

[0128] Use the event handling capabilities of LabVIEW to obtain the communication parameter values ​​entered by the user received by the debug interface.

[0129] (iii) Configuration module 120.

[0130] The configuration module 120 is constructed based on LabVIEW. The configuration module 120 is used to create a new configuration file, and to retrieve the original configuration file corresponding to the configuration request to the newly created configuration file; and is also used to obtain the communication parameter value input by the user received by the debugging interface, and to update the newly created configuration file according to the input communication parameter value to generate a target configuration file;

[0131] In one embodiment of the present specification, in order to improve the maintainability of the configuration file, the file I / O function of LabVIEW is used to create a new configuration file; the database connection tool is used to obtain the content of the original configuration file from the serial communication custom parsing database and copy it to the newly created configuration file. According to the communication parameter value input by the user, the string processing function of LabVIEW is used to update the configuration file to obtain a data parsing list, which includes the configured configuration file.

[0132] The data parsing list is in table format or text format; the data parsing list is converted to obtain the target parsing file. The file I / O function of LabVIEW is used to save the target configuration file to the database to achieve persistent storage of data.

[0133] In one embodiment of the present specification, the target configuration file is in a standard JSON format. JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for humans to read and write, and is also easy for machines to parse and generate. LabVIEW provides VIs and functions for processing data in JSON format. By processing VIs for JSON data, a target configuration file in JSON format can be generated.

[0134] Compared with the traditional human-machine interface (HMI) development process, the present invention does not need to build an I / O server, and directly implements I / O functions in the LabVIEW environment, supporting multi-threading and parallel processing.

[0135] In one embodiment of the present specification, the configured configuration information includes modified configuration information and unmodified configuration information.

[0136] The serial port is configured according to the configured device configuration information. The serial port communication protocol is configured according to the configured protocol configuration information. The configuration module 120 allows the user to more conveniently configure and manage the serial port and serial port communication protocol, thereby improving the flexibility of serial port communication and the simplicity of custom serial port communication.

[0137] In one embodiment of the present specification, the configured configuration information includes: the protocol name is Motor_Device; the device type is sensor (Sensor); the device identifier is Motor001; the baud rate is 9600; the data bit length is 8 bits; the stop bit length is 1 bit; the check bit is no check; the start identifier is <; the end identifier is >; the field separator is,; field list; the example data is <12.34,56>; the remark is Note: the temperature value is rounded to two decimal places.

[0138] The field list includes: the data type of the field named speed is a floating point number (float), the length is 5, the description is the current speed value, and the format is x; the data type of the field named torque is an integer (int), the length is 3, the description is the current torque value, and the format is 2*x.

[0139] At this time, the JSON format of the corresponding target configuration file can be:

[0140]

[0141]

[0142] (iv) Analysis module 130.

[0143] The serial communication custom parsing database and debugging interface is an independent software, and the parsing module 130 is an independent module that can be reused in other programs.

[0144] In one embodiment of the present specification, a set of reusable low-coupling analysis modules 130 is designed based on the object-oriented basic architecture through LabVIEW to reduce and reduce development costs. Preferably, the analysis module 130 is designed to be directly inserted into the original LabVIEW program and used as a software module to expand the source program; of course, the analysis module 130 can also be used as an independent module for data reception and forwarding, and transmit data with other programs or software through the data transmission and reception mechanism of the DDS system.

[0145] The parsing module 130 can read the target configuration file, create a reference to the serial port device according to the protocol type, parse the original measurement information according to the target configuration file, send the target parsing result to the memory space through the data transceiver mechanism of the DDS system, and the data can be read by other software.

[0146] In one embodiment of the present specification, the parsing module 130 includes: a serial communication submodule, a JSON parsing submodule, a DDS interface submodule, a data processing and conversion submodule, a user interface submodule, a log and debugging submodule, and a configuration management and storage submodule. Specifically:

[0147] The serial port communication submodule includes: a data sending and receiving unit and a serial port device configuration unit.

[0148] The data sending and receiving unit is used to communicate with the serial port device through the data sending and receiving components of the debugging interface to realize data sending and receiving, wherein the data receiving includes continuous reading of data or event-based reading.

[0149] The serial port device configuration unit is used to obtain the configured device configuration information to configure the serial port device, so as to realize continuous data reading or event-based reading, and ensure that both parties of communication can transmit data according to the same rules. Specifically, the configured device configuration information in the target configuration file is read, and according to the configured device configuration information, the serial port configuration VI of LabVIEW is used to set the serial port parameters.

[0150] In one embodiment of the present specification, the serial port device configuration unit is also used to create a serial port device reference. Specifically, it automatically configures and creates a communication reference or connection with a specific serial port device according to the protocol type. The reference is a handle or identifier pointing to the underlying hardware resource for subsequent data read and write operations.

[0151] The JSON parsing submodule includes: loading unit, parsing unit, and verification unit.

[0152] The loading unit is used to load the target configuration file, read the configured protocol configuration information in the target configuration file, configure the serial communication protocol using the serial communication VI of LabVIEW according to the configured protocol configuration information, and determine the protocol definition result. The protocol definition result is the specific details and specifications of the serial communication protocol determined according to the target configuration file. Specifically, the protocol definition result includes: protocol format and data structure.

[0153] The parsing unit is used to parse the original measurement information received through the serial port according to the instructions of the protocol parsing component of the debugging interface and the protocol definition result to obtain the target parsing result. In one embodiment of the present specification, the parsing unit is used to convert the binary original measurement information into the target parsing result of the JSON object.

[0154] The verification unit is used to obtain the target parsing result, verify the target parsing result and handle errors. If an error occurs, the parsing unit is notified to re-parse, or the target parsing result is optimized to obtain a new target parsing result. Errors that occur during the parsing process are fed back to the error handling component of the debugging interface.

[0155] The DDS interface submodule includes: a format conversion unit, a DDS interaction unit, and a monitoring unit.

[0156] The format conversion unit is used to obtain the target parsing result, perform format conversion on the target parsing result, convert it into a data format that can be processed by the DDS system, and obtain a format conversion result.

[0157] The DDS interaction unit is used to interact with the DDS system (data distribution service module), including connection management, data publishing and subscription. In one embodiment of the present specification, the DDS interaction unit is used to publish the format conversion result output by the format conversion unit to the DDS network and manage the connection with other DDS nodes.

[0158] The monitoring unit is used to monitor relevant topics in the DDS network and receive and process data published by other nodes as needed.

[0159] The data processing and conversion submodule is used to perform data conversion on the target parsing result according to the data display request in the parsing data processing component of the debugging interface, and send the converted target parsing result to the data display component of the debugging interface for display. The data processing and conversion submodule includes: a data cleaning unit, a unit conversion unit, and a calculation and analysis unit.

[0160] The data cleaning unit is used to obtain the target analysis result, perform data cleaning on the target analysis result, and obtain the cleaning result; data cleaning includes but is not limited to: removing duplicate, invalid or erroneous data.

[0161] The unit conversion unit is used to obtain the cleaning result, perform unit conversion on the cleaning result, and obtain the unit conversion result; the unit conversion includes: converting data of different units into a unified unit format.

[0162] The calculation and analysis unit is used to calculate and analyze the unit conversion results to obtain the target analysis results after conversion, such as performing data analysis, statistics or generating reports on the unit conversion results.

[0163] The log and debugging submodule includes: log recording unit, debugging tools and interface, and log processing unit.

[0164] The logging unit is used to record key events, errors and warnings during the software operation according to the logging component of the debugging interface.

[0165] Debugging tools and interfaces are used to assist developers in debugging and troubleshooting software according to the instructions of the debugging function components of the debugging interface, helping developers locate problems and fix errors.

[0166] The log processing unit is used to save and export logs for subsequent analysis and problem tracking.

[0167] The configuration management and storage submodule includes: a configuration information management unit, a storage unit, and a configuration information import and export unit.

[0168] The configuration information management unit is used to manage serial port parameters and the path of the configuration file in JSON format, etc.

[0169] The storage unit is used to persist the configuration information to ensure that the configuration information is not lost after the software is restarted.

[0170] The configuration information import and export unit is used to import and export configuration information, making it convenient for users to migrate configurations between different environments or devices.

[0171] The user interface submodule includes: a data display unit, an instruction transmission unit, and a viewing unit.

[0172] The data display unit is used to retrieve the original measurement information received from the serial port from the data sending and receiving unit, and send it to the monitoring component for display; retrieve the target analysis result from the analysis unit, and send it to the monitoring component for display; retrieve the converted target analysis result forwarded through the DDS interface, and send it to the monitoring component for display;

[0173] The instruction transmission unit is used to notify the serial port device configuration unit to perform serial port configuration based on the configuration instructions of the debugging interface; to notify the loading unit to load the protocol based on the loading instructions; and to notify the monitoring unit to monitor the communication status based on the monitoring instructions.

[0174] The viewing unit is used to retrieve and return specific logs from the log recording unit based on log viewing instructions; it is used to retrieve the results of the verification unit based on recording instructions and record key information and error information during the software operation process.

[0175] (V) Data distribution service module.

[0176] In order to facilitate data transmission, the system also includes: a data distribution service module.

[0177] The data distribution service module includes data distribution middleware. The data distribution middleware can realize the intercommunication between the present system and other systems. As a preferred embodiment, the data distribution middleware is realized by using the data distribution service (DDS), which is a new generation of distributed real-time communication middleware protocol. It adopts the publish / subscribe system architecture, emphasizes data-centricity, and provides a rich QoS service quality strategy to ensure that data is distributed in real time, efficiently, and flexibly, and can meet various distributed real-time communication application requirements. The present invention realizes data sharing in multiple programs, software, and systems through the data distribution service module.

[0178] In this specification, the coupling between the above modules is low, and they can be developed and tested separately.

[0179] Figure 2 A schematic diagram of a custom parsing method for serial communication based on LabVIEW provided in an embodiment of this specification, the method comprising:

[0180] S1 obtains a configuration request from a user; the configuration request includes a configuration type;

[0181] In one embodiment of the present specification, a configuration request of a user is obtained through a debugging interface, the configuration request includes a configuration type; a configuration interface corresponding to the configuration type selected by the user is displayed, and the configuration interface displays configuration information of the original configuration file.

[0182] The user can enter or modify the communication parameter values ​​for the configuration information that can be modified in the configuration interface. For example, define the name and model of the serial port, specify the physical interface and power supply requirements used by the device, enter the communication address or ID, data tag name, register start address, data length, unit, formula, etc.

[0183] S2 searches for an original configuration file corresponding to the configuration type;

[0184] The original configuration files are predefined and stored in an address accessible to the system to ensure that the corresponding original configuration files can be matched according to the configuration type.

[0185] S211 creates a new configuration file through the configuration module;

[0186] S212 searches for an original configuration file corresponding to the configuration type from a serial communication custom parsing database;

[0187] S213 reads the corresponding original configuration file, and imports the configuration information in the original configuration file into the newly created configuration file.

[0188] In another embodiment of the present specification, the entire original configuration file is copied as the starting point of the newly created configuration file.

[0189] S3 receives the configuration information input by the user, updates the original configuration file, and obtains a target configuration file;

[0190] In one embodiment of the present specification, the configuration information currently required to be configured is displayed in the configuration interface. Specifically, the configuration information is presented in a form.

[0191] For configuration information, users can manually modify one or more communication parameters; they can also retrieve actual data to uniformly modify some device configuration information; they can also retrieve actual data to uniformly modify some protocol configuration information.

[0192] S31 receives device configuration information input by a user through a serial port device configuration component; receives protocol configuration information input by a user through a serial port protocol configuration component;

[0193] S32 modifies the device configuration information through the first information calling control; modifies the protocol configuration information through the second information calling control;

[0194] In one embodiment of the present specification, the configuration interface is further provided with a first information retrieval control and / or a second information retrieval control. By selecting the first information retrieval control by the user, the configuration module is notified to search the serial port device address table for device information corresponding to the configuration type; based on the device information, the relevant device configuration information in the configuration page is uniformly modified. Among them, a serial port device address table is defined to manage and identify these devices. The serial port device address table is stored in the format of a special data structure JSON, which is used to store identifiers of various resources in the system (such as configuration types) and their corresponding physical or logical addresses. The serial port device address table contains a mapping from configuration type to serial port number and some device information; the system can correctly communicate with the serial port device based on the information in the serial port device address table.

[0195] By selecting the second information retrieval control by the user, the configuration module is notified to search the protocol information corresponding to the configuration type from the register address table, and the relevant protocol configuration information in the configuration page is uniformly modified based on the protocol information. Among them, a register address table is defined, and the register address table (also called register mapping table or register mapping) is a data structure for storing the addresses of all registers and other related information, such as the name, size, purpose and other information of the register.

[0196] S34 modifies the newly created configuration file based on the received device configuration information and / or the received protocol configuration information to obtain a target configuration file.

[0197] Specifically, after the user completes the configuration, the configuration information is integrated into a data parsing list, and the currently configured data parsing list is saved as a target configuration file. The target configuration file is stored as a new original configuration file in the serial communication custom parsing database. The present invention can add a new data parsing list without changing the original program, thereby reducing coupling.

[0198] In one embodiment of the present specification, the data parsing method in the device protocol address table is stored in the data parsing list. The user can add data point parsing for the corresponding serial port device as needed. The parameter information of each data point includes function code, data length, data field, checksum, etc. When the user has configured all the required data points according to the protocol, a data parsing list can be generated and the configuration file can be saved. Among them, the data point is the data with a unique identifier. Each data in the protocol address table is unique and exists in different addresses. The parsing method of the data point is obtained from the device configuration information / protocol configuration information.

[0199] S4 determines the target serial port according to the configuration type, and configures the target serial port and the corresponding serial port communication protocol through the target configuration file;

[0200] S41 searches for the address of the target serial port from the serial port device address table according to the configuration type, and determines the target serial port;

[0201] S42 uses the serial port device configuration unit to retrieve the device configuration information in the target configuration file, configure the target serial port, and create a reference to the serial port device according to the protocol type, so that the data sending and receiving unit completes data sending and receiving, thereby realizing the communication between this system and other devices through the serial port.

[0202] S43 searches for the address of the target register from the register address table according to the configuration type, and determines the target register;

[0203] S44 calls the target configuration file through the loading unit, reads the target configuration file, and parses it into a previously defined data structure.

[0204] By reading and parsing the protocol configuration information, the protocol configuration information is loaded into the internal data structure to obtain the data parsing list and perform protocol configuration. Perform single-step debugging to verify whether the data parsing is successful according to the protocol.

[0205] S5 obtains the original measurement information to be analyzed through the target serial port, analyzes the original measurement information according to the configured serial port protocol, and obtains the target analysis result.

[0206] Open the target serial port based on the user's operation. Receive the original measurement information input through the target serial port; store the original measurement information in a pre-set register. Retrieve the original measurement information from the register, parse the original measurement information based on the data parsing list, and realize the communication between this system and other devices through the target serial port.

[0207] In one embodiment of the present specification, a data parsing request is sent based on a user clicking on a data parsing component on a debugging interface; the parsing module receives the data parsing request, and based on the data parsing request, loads and parses a predefined JSON protocol file to obtain a protocol format and data structure. According to the protocol definition, the original measurement information received from the serial port is parsed, and the binary original measurement information is converted into a target parsing result in JSON format.

[0208] In one embodiment of the present specification, the target parsing result is verified and error processed, and the processing result is fed back to the error processing component for display.

[0209] By clicking on the log recording component, the key events, errors and warning information recorded in the log and debugging submodule during the software operation process can be saved and exported to facilitate subsequent analysis and problem tracking.

[0210] Of course, by clicking on the debugging function component, the user sends a debugging request; based on the debugging request, the software can be debugged and optimized through debugging tools and interfaces.

[0211] The present invention constructs a LabVIEW-based serial communication custom parsing system to efficiently read and parse a large amount of serial port data, and can flexibly configure the serial port and serial port communication protocol in a custom manner to improve the versatility of the system.

[0212] The functions of the method of the embodiment of the present invention have been described in the above-mentioned system embodiment. Therefore, for details not fully described in the description of this embodiment, please refer to the relevant description in the above-mentioned embodiment, and no further description will be given here.

[0213] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0214] The electronic device embodiment of the present invention is described below, and the electronic device can be regarded as a physical implementation of the method and device embodiments of the present invention described above. The details described in the electronic device embodiment of the present invention should be regarded as a supplement to the above method or device embodiments; details not disclosed in the electronic device embodiment of the present invention can be implemented with reference to the above method or device embodiments.

[0215] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Figure 3 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0216] like Figure 3 As shown, the computer device 300 of this exemplary embodiment is in the form of a general data processing device. The components of the computer device 300 may include but are not limited to: at least one processor 310, at least one memory 320, a network interface 330, a display unit 340, an input component 350, etc.

[0217] The memory 320 stores a computer-readable program, which may be a source program or a code of a read-only program. The program may be executed by the processor 310, so that the processor 310 performs the steps of various embodiments of the present invention. For example, the processor 310 may perform the following steps: Figure 1 Steps shown.

[0218] The memory 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) and / or a cache memory unit, and may further include a read-only memory unit (ROM). The memory 320 may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment.

[0219] Also included is a bus (not shown) which may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0220] The computer device 300 may also communicate with one or more external devices (e.g., keyboard, display, network device, Bluetooth device, etc.) so that a user can interact with the computer device 300 via these external devices, and / or so that the computer device 300 can communicate with one or more other data processing devices (e.g., routers, modems, etc.). Such communication may be performed through the network interface 330, and may also be performed through a network adapter with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet). The network adapter may communicate with other modules of the computer device 300 via a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in the computer device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0221] Figure 4 Schematic diagram of a computer readable medium embodiment of the present invention. Figure 4 As shown, the computer program can be stored on one or more computer-readable media. The computer-readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. When the computer program is executed by one or more data processing devices, the computer-readable medium is enabled to implement the above method of the present invention.

[0222] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation mode of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a data processing device (which can be a personal computer, a server, or a network device, etc.) to perform the above method according to the present invention.

[0223] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0224] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0225] In summary, the present invention can be implemented by a method, apparatus, electronic device or computer-readable medium that executes a computer program. In practice, a general data processing device such as a microprocessor or a digital signal processor (DSP) can be used to implement some or all functions of the present invention.

[0226] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A LabVIEW-based serial communication custom parsing system, characterized in that: include: Debug module, configuration module and parsing module; The debugging module includes a serial communication custom parsing database and a debugging interface; The serial communication custom parsing database includes a plurality of original configuration files, and each configuration type corresponds to one original configuration file; The debugging interface is used to receive a configuration request from a user; receive configuration information input by the user; obtain original measurement information to be parsed through a target serial port; wherein the configuration request includes a configuration type; The configuration module is used to retrieve the original configuration file from the serial communication custom parsing database according to the configuration type; update the original configuration file according to the configuration information input by the user to obtain the target configuration file; The parsing module is used to configure the target serial port and the serial port protocol through the target configuration file; and parse the original measurement information according to the configured serial port protocol to obtain a target parsing result.

2. A LabVIEW-based serial communication custom parsing system as claimed in claim 1, characterized in that: The debugging interface includes: a plurality of configuration interfaces; The configuration interface is pre-constructed according to the original configuration file; each configuration type corresponds to one configuration interface; and the configuration interface displays the configuration information in the original configuration file.

3. A LabVIEW-based serial communication custom parsing system as claimed in claim 1, characterized in that: The debugging interface includes: serial port configuration and communication interaction components; The serial port configuration and communication interaction component includes: a serial port device configuration component and a data sending and receiving component; The serial port device configuration component is used to receive the device configuration information input by the user; the data sending and receiving component is used to control the data sending of the target serial port and / or the receiving of the original measurement information.

4. A LabVIEW-based serial communication custom parsing system as claimed in claim 1, characterized in that: The debugging interface also includes: a data analysis interaction component; The data analysis and interaction component includes: a serial port protocol configuration component, a protocol analysis component, and an error handling component; The serial port protocol configuration component is used to receive the protocol configuration information input by the user; The protocol parsing component is used to call the parsing module to parse the original measurement information to obtain the target parsing result; The error handling component is used to display errors that occur during the parsing process of the parsing module.

5. A LabVIEW serial communication based custom parsing system as claimed in claim 1, characterized in that: The debugging interface also includes: a data distribution component; The data distribution component is used to perform format conversion and data distribution on the target parsing result.

6. A LabVIEW serial communication based custom parsing system as claimed in claim 1, characterized in that: The parsing module is decoupled from the debugging interface.

7. A LabVIEW-based serial communication custom parsing system as claimed in claim 1, characterized in that: The target configuration file is in JSON format.

8. A custom parsing method for serial communication based on LabVIEW, characterized in that: include: Get the user's configuration request; The configuration request includes a configuration type; Searching for an original configuration file corresponding to the configuration type from a custom parsing database for serial communication; Receiving the configuration information input by the user, updating the original configuration file, and obtaining a target configuration file; Determine the target serial port according to the configuration type, and configure the target serial port and the corresponding serial port communication protocol through the target configuration file; The original measurement information to be analyzed is obtained through the target serial port, and the original measurement information is analyzed according to the configured serial port protocol to obtain the target analysis result.

9. An electronic device, wherein: The electronic device includes: processor; and, A memory storing computer executable instructions which, when executed, cause the processor to perform the method of claim 8.

10. A computer-readable storage medium, wherein: The computer-readable storage medium stores one or more programs, which, when executed by a processor, implement the method of claim 8 .

Citation Information

Cited By

  • Product testing system, method and equipment for OAB communication and storage medium

    CN121333981A