Robot operation log visualization method based on QChart component of QT platform

By using QChart components on the QT platform, combining the sensor layer, protocol conversion layer, business layer and application display layer, graphical display and analysis of robot operation logs is realized, solving the shortcomings of ROS system in the inspection robot control system, and improving the readability and analysis efficiency of log data.

CN119883842APending Publication Date: 2025-04-25NANJING TETRAELC ELECTRONICS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411969640.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing ROS system has problems such as single point failure risk, strong platform dependence, high deployment complexity and insufficient real-time in modern inspection robot control systems. At the same time, traditional log viewing methods are difficult to intuitively display the internal laws and trends of log data, reducing the efficiency of fault diagnosis and performance optimization.

Method used

The QChart component based on the QT platform is adopted to realize graphical display and analysis of the robot operation log through the combination of the sensor layer, protocol conversion layer, business layer and application display layer. Specific steps include data collection, protocol conversion, data transmission, data preprocessing and chart drawing, using QChart components to create line charts, bar charts and other charts, and providing interactive functions.

Benefits of technology

It realizes the intuitive display of the robot's running log data, improves the readability and intelligibility of the log data, and can more clearly display the internal laws and trends of the log data, helps to quickly discover potential problems and exceptions, and improves the utilization rate and analysis efficiency of the log data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883842A_ABST
    Figure CN119883842A_ABST
Patent Text Reader

Abstract

The invention provides a robot operation log visualization method based on a QChart visualization component of a QT platform, and the method comprises the steps: a sensor layer: describing a real-time data field corresponding to a sensor, and generating a corresponding source code through a generation tool for a business layer to use; and the protocol conversion layer is used for collecting data of the sensor, storing the actually-operated data into a code operation memory, storing the actually-operated data into a structural body memory converted from XML (Extensible Markup Language), and transmitting the actually-operated data through a TCP (Transmission Control Protocol) in a json character string form. And the service layer is used for receiving the JSON character string of the sensor real-time data transmitted by the protocol conversion layer, converting the character string, and storing a data structure in a memory. And the application display layer comprises a data format conversion module, a chart drawing and display module, an interaction function implementation module and a QChart component configuration module. According to the method, visual display of the robot operation log data is realized, and the readability and the understandability of the log data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visualization of robot operation log data, and in particular to a method for realizing graphical display and analysis of robot operation logs based on a QChart component of a QT platform. Background Art

[0002] In modern inspection robot control systems, ROS (Robot Operating System) is widely used for node-to-node communication. ROS uses a publish-subscribe mechanism, as shown in the schematic diagram. Figure 1 As shown in the figure, each sensor node publishes real-time data, the log aggregation node subscribes to these topics, receives and aggregates the data, and finally transmits it to the log visualization application layer for display. However, ROS has the following defects in practical applications: Single point failure risk: ROS relies on the central node (master). Once the node crashes, the communication of the entire system will be interrupted, affecting the stability of the system. Strong platform dependence: The ROS system is large and complex, and the development process has a strong dependence on its platform, which limits its flexibility and scalability. Deployment complexity: When the ROS program is released and deployed, it is necessary to install the dependent environment for ROS operation, which increases the complexity and maintenance cost of the system. Insufficient real-time performance: The communication mechanism of ROS may not perform well in industrial applications with high real-time requirements and cannot meet certain real-time control requirements.

[0003] In addition, robots generate a large amount of log data during operation, which contains key information such as the robot's working status, error information, and performance indicators. Traditional log viewing methods mainly rely on text editors or simple log viewing tools. When processing large amounts of complex log data, it is difficult to display the inherent laws and trends of the data in a timely and intuitive manner, reducing the efficiency of fault diagnosis and performance optimization. Summary of the invention

[0004] Purpose of the invention: The purpose of the present invention is to address the deficiencies of the prior art and provide a robot operation log visualization method based on the QT platform QChart visualization component, which can timely and intuitively display the inherent laws and trends of the data, thereby reducing the efficiency of fault diagnosis and performance optimization.

[0005] The technical solution provided by the present invention is a robot operation log visualization method based on the QT platform QChart visualization component, and the specific steps are as follows: Sensor layer: includes at least one sensor, adapts to the XML structure field of the sensor, describes the real-time data field corresponding to the sensor, and generates corresponding source code for use by the business layer through generation tools; Protocol conversion layer: including sensor data processing modules corresponding to the number of sensors in the sensor layer, the sensor data processing modules including data acquisition modules, protocol conversion modules and protocol transmission modules, the data acquisition modules are connected with the sensor signals of the sensor layer to collect the data of the sensors; the protocol conversion modules are used to store the collected sensor data into the code running memory and the structure memory converted from XML through the automatically generated code; the protocol transmission module transmits the sensor data structure in the form of json string through TCP protocol; The data acquisition module collects sensor data, the protocol conversion module stores the data into memory, and the protocol transmission module transmits the sensor data structure in memory in the form of a JSON string through a custom TCP protocol; Business layer: receives the JSON string of real-time sensor data transmitted by the protocol conversion layer, and stores the converted data structure in the memory; Application display layer: including data format conversion module, chart drawing and display module, interactive function realization module and QChart component configuration module, which pre-processes the sensor data, converts it into a data format recognizable by the QChart component, and realizes the visualization of log data through chart display and interactive functions.

[0006] The technical solution of the present invention is further defined as follows: the XML structure field of the sensor layer includes: the keyword object represents the name of a sensor object, and the keyword field represents various real-time data fields of the sensor.

[0007] Furthermore, the protocol conversion module of the protocol conversion layer generates a corresponding code file using an automatic code generation tool from the XML data structure defined by the sensor. The code file contains the data storage format at runtime and member variables required by the business. The code file is then put into the project for compilation. Furthermore, the method for the business layer to convert the string is: to freely convert between the json string and the running memory data structure through the ToString() function and the FromString() function in the code file, the ToString() function encapsulates various sensor data at runtime into a string in json format; the FromString() function is the reverse operation of the above conversion, that is, to parse the string received by the transport layer in json format and parse it into various member variables in the code file.

[0008] Furthermore, the data format conversion module of the application presentation layer preprocesses the parsed log data, including removing redundant information, extracting key fields, and converting the log data into a data format recognizable by the QChart component.

[0009] Furthermore, the chart drawing and display module of the application display layer uses QChart components to create corresponding charts, including using QLineSeries to create line charts, using QBarSeries to create bar charts, etc.

[0010] Furthermore, the interactive function implementation module of the application display layer displays charts through QChartView, provides functions such as mouse hover prompts, zooming, panning, and setting chart styles and color parameters. The present invention proposes a robot operation log visualization method based on the QT platform QChart visualization component. The specific beneficial effects are as follows: the present invention utilizes the QChart visualization component under the QT platform to realize the intuitive display of the robot operation log data, and improves the readability and comprehensibility of the log data. By converting the log data into a chart form, the present invention can more clearly display the inherent laws and trends of the log data, which helps users to quickly discover potential problems and anomalies. The chart interaction function provided by the present invention enables users to analyze the log data more deeply, and improves the utilization rate and analysis efficiency of the log data. The method of the present invention has good scalability and flexibility, and can adapt to different types of robot operation log data and visualization requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a traditional ROS-based log visualization schematic; Figure 2 It is a log visualization principle diagram based on a custom protocol of the present invention; Figure 3 is a flow chart of the preprocessing steps in the application presentation layer of the present invention; Figure 4 This is a status overview interface diagram of each sensor of a robot in an embodiment of the present invention; Figure 5 4 is an interface diagram of a comparative analysis tab page in an embodiment of the present invention. DETAILED DESCRIPTION

[0012] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.

[0013] Example 1 This embodiment provides a robot operation log visualization method based on the QT platform QChart visualization component, including the following steps: The technical solution of the present invention uses a custom TCP protocol for transmission. The network architecture includes a sensor layer, a protocol conversion layer, a business layer, and an application display layer. The schematic diagram is shown in FIG. Figure 2 shown.

[0014] 1. Sensor layer: includes at least one sensor. When the sensor is adapted to the protocol, the XML structure field corresponding to the sensor data is defined in the sensor for use by the business layer.

[0015] The XML structure field is used to describe the specific fields of the sensor. Each sensor has different parameter fields. Each sensor defines an XML structure and uses XML format text to describe the real-time data fields corresponding to various sensors. After the XML is defined, there are corresponding generation tools that can generate relevant source code for integrated development at the business layer.

[0016] Summary of typical XML description methods: This XML description method is used to define sensor objects and their properties. It has a clear structure and contains the following main contents: Overall structure: <xml>The tag wraps the entire definition content.

[0017] Each object passes <object>Tag definition, including the object's name, instantiation attributes, type, and other meta information.

[0018] Object properties: Object name: defined by the name attribute, for example "PtzPdSensorStatus" represents the partial discharge sensor status.

[0019] Instantiation: singleinstance specifies whether it is a single instance, and instancesize defines the number of instances.

[0020] Type: Use type to describe the object type, for example, publish represents published data.

[0021] Version and display attributes: version specifies the version number, and qtshow indicates whether to display it in the QT interface.

[0022] Field Description: Each object consists of several <field>Tags define specific fields.

[0023] Field properties include: name: field name (such as "towave_background" means ground wave partial discharge background noise).

[0024] units: units (e.g. "dB").

[0025] type: data type (such as float, int).

[0026] defaultvalue: default value.

[0027] description: Field description.

[0028] Access Control: <access>The label describes the field access permissions, such as readwrite or readonly.

[0029] Transmission method: <telemetry>Tags define how data is transmitted: publish: whether to publish.

[0030] updatemode: Update mode, such as periodic (periodic update).

[0031] period: transmission period.

[0032] Logging: <logging>Tags define the monitoring method of the playback center and support periodic updates and monitoring.

[0033] It can be seen that there are several keywords in XML: object, field, etc. Object represents the name of a sensor object, and the figure shows a partial discharge sensor; field is the various real-time data fields of the sensor, and there are five data fields in the figure.

[0034] A C++ class named TCPtzPdSensorStatus is defined to represent the status information of the partial discharge sensor. This class contains multiple member variables, corresponding to different data fields of the sensor, such as geomagnetic wave partial discharge background noise (towave_background), ultrasonic partial discharge background noise (supwave_background), geomagnetic wave partial discharge (towave), ultrasonic partial discharge (supwave) and warning error code (warning). Each member variable is equipped with a mutex (std::mutex) to ensure safe access to data in a multi-threaded environment. The class provides corresponding getter and setter methods to get and set the values ​​of these member variables. In addition, the class also implements ToString() and FromString() methods, which are used to serialize objects into JSON strings and deserialize from JSON strings to objects, respectively, to facilitate data transmission and storage. In general, this class is used to encapsulate the status data of partial discharge sensors and provide thread-safe access and serialization functions.

[0035] The C++ class named TCPtzPdSensorStatus is automatically generated based on the provided XML data structure, which is used to represent the status of the PD sensor. This class inherits from TCIObjectBase and contains multiple member variables corresponding to different data fields of the sensor, such as geomagnetic wave PD background noise (towave_background), ultrasonic PD background noise (supwave_background), geomagnetic wave PD (towave), ultrasonic PD (supwave) and warning error code (warning). Each member variable is equipped with a mutex (std::mutex) to ensure thread safety in a multi-threaded environment.

[0036] The class constructor initializes these member variables and the corresponding mutexes, and calls the reset() method to set the member variables to their default values. The reset() method sets all member variables to their default values ​​and initializes the object header information (objHeader), such as the object name, version, description, etc.

[0037] In addition, this class provides ToString() and FromString() methods for serialization and deserialization operations between JSON strings and object instances. This makes it easy to convert objects to and from JSON format data, facilitating data transmission and storage.

[0038] The class also defines to_json and from_json friend functions, using the nlohmann::json library to implement object-to-JSON conversion. At the same time, it provides Get and Set methods for each member variable, allowing safe access and modification of member variable values.

[0039] The design of this class makes the management of sensor data more standardized and secure, especially in a multi-threaded environment, ensuring data consistency and integrity. By automatically generating code, human errors can be reduced, development efficiency can be improved, and consistency between code and data structure definition can be ensured.

[0040] 2. Protocol conversion layer: including sensor data processing modules corresponding to the number of sensors in the sensor layer, the sensor data processing modules including data acquisition modules, protocol conversion modules and protocol transmission modules, the data acquisition module is connected with the sensor signals of the sensor layer to collect the data of the sensors; the protocol conversion module stores the collected data into the code running memory and the structure memory converted from XML through the automatically generated code; the protocol transmission module transmits the sensor data structure stored in the memory in the form of a custom binary data json format string through the TCP protocol.

[0041] This layer converts the structured XML language defined by the hardware sensor into the actual corresponding source code, and integrates the source code into the project for code compilation. The code file describes the data storage format at runtime, the member variables required by the business, and some additional conversion functions, which are different from the defined XML format. Then the code file is put into the project for compilation, so that the relevant data format can be run at runtime for conversion and transmission at the business layer. The code file defines the various member variables required by the business, which are abstracted for each sensor to store related data.

[0042] 3. Business layer: including log aggregation processing module, which is connected to the protocol transmission module of the protocol conversion layer through TCP protocol, converts the received real-time data JSON format string of the sensor through automatically generated code to the data structure in the running memory to receive and process the real-time data of the sensor, which is the forward processing of log visualization.

[0043] (1) In the business layer, the communication between each sensor and the system does not have a central node like ROS. Instead, it adopts a decentralized distributed architecture. Each sensor can communicate with the system directly. If it needs to be disconnected, it will only disconnect one sensor, not all sensors.

[0044] (2) In the source code automatically generated by the XML file, there are ToString() and FromString() functions for free conversion between json strings and running memory data structures. This conversion process is also called serialization and deserialization. The ToString() function encapsulates various sensor data at runtime into a string in json format; the FromString() function is the reverse operation of the above conversion, that is, parsing the string received by the transport layer in json format and parsing it into various member variables in the code file.

[0045] (3) Using the automatically generated source code file can simplify the business layer coding process. There is no need to know how to convert the underlying data structure or how TCP transmission is performed at the underlying layer, which greatly improves the coding efficiency.

[0046] 4. Application display layer: It is a visual client, including data format conversion module, chart drawing and display module, interactive function implementation module and QChart component configuration module.

[0047] (1) The data format conversion module first preprocesses the parsed log data, such as removing redundant information, extracting key fields, etc. Then, according to the analysis requirements, the log data is converted into a data format that can be recognized by the QChart component, such as QLineSeries (for drawing line charts) and QBarSet (for drawing bar charts).

[0048] Preprocessing includes the steps of log data separation, extraction, and parsing. The flowchart is as follows: Figure 3 shown.

[0049] Data separation is to separate the information of different keywords in the log file, such as battery data using TCMotionBatteryStatus, track travel motor data using TCMotionMotorMoveTrackStatus, system core status data using TCSystemStatus, wheel travel motor data using TCMotionMotorMoveNaviStatus, wheel steering motor data using TCMotionMotorTurnStatus.

[0050] The following figure takes battery sensor data as an example: The separated sensor data are extracted. Taking the data volume of one hour as an example, the data volume of one hour is extracted, one line of data, one line of battery data information in JSON format, including basic information of battery sensors such as quantity power and current current.

[0051] Then, the data of each line is parsed and processed into the data of the battery sensor at this moment, and the timestamp of this line is also parsed out. That is, the battery sensor power value and current value are parsed from the json format string through the FromString() function and stored in the member variables of the TCMotionBatteryStatus class at runtime. Then the upper business layer performs other processing on these data, and the parsing will use the automatically generated battery data source code.

[0052] Finally, these timestamps and the corresponding battery sensor data are graphed to form a data curve on the interface.

[0053] (2) Chart drawing and display module: Use QChart components to create corresponding charts according to the processed data format. For example, you can use QLineSeries to create a line chart to show the response time trend of the system; use QBarSeries to create a bar chart to show the error rate in different time periods, etc.

[0054] (3) Interactive function implementation module: embeds the created chart into the user interface of the Qt application and displays it through QChartView.

[0055] Users can view and analyze log data more flexibly through mouse hover prompts, zooming and panning functions. At the same time, users can also meet personalized needs by setting chart styles, colors and other parameters. There are two functions here: one is the graphical display of real-time data of various sensors; the other is the data comparison and analysis function of sensors of the same type. This client can greatly improve the efficiency of log data analysis and processing, and provide powerful tool support for software development and maintenance personnel.

[0056] Figure 4 It shows an overview of the status of each sensor of a robot, where the collected sensor data include: data of the robot system core board, battery data, track travel motor data, pan / tilt motor data, lifting arm motor data, and partial discharge motor data. The tree structure on the left lists the list of the robot's sensors, and the right shows the data curve displayed by selecting a sensor on the left. Among them, the data of the robot system core board include: CPU occupancy, CPU temperature, memory occupancy, and disk occupancy. The real-time data tab shows the real-time refreshed data of the robot, and the collection frequency is refreshed once a second. Through these curves, the real-time status of the robot can be well analyzed, which is convenient for debugging personnel to locate the usage of each sensor of the robot, which is very intuitive.

[0057] The comparative analysis tab displays the status of each sensor from another dimension, such as Figure 5 As shown in: From the dimension of motor temperature, the real-time temperature values ​​of each motor sensor are compared. In the same picture, the temperature of the track travel motor, the temperature of the pan-tilt horizontal motor, the temperature of the pan-tilt visible light motor, the temperature of the pan-tilt thermal imager motor, the temperature of the lifting arm motor, and the temperature of the partial discharge motor are displayed in one picture, which is very intuitive for comparison. In addition, other comparison dimensions include: motor current comparison, motor voltage comparison, and motor speed comparison.

[0058] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.< / logging> < / telemetry> < / access> < / field> < / object> < / xml>

Claims

1. A robot operation log visualization method based on the QT platform QChart visualization component, characterized in that: The specific steps are as follows: Sensor layer: includes at least one sensor, adapts to the XML structure field of the sensor, describes the real-time data field corresponding to the sensor, and generates corresponding source code for use by the business layer through generation tools; Protocol conversion layer: including sensor data processing modules corresponding to the number of sensors in the sensor layer, the sensor data processing modules including data acquisition modules, protocol conversion modules and protocol transmission modules, the data acquisition modules are connected with the sensor signals of the sensor layer to collect the data of the sensors; the protocol conversion modules are used to store the collected sensor data into the code running memory and the structure memory converted from XML through the automatically generated code; the protocol transmission module transmits the sensor data structure in the form of json string through TCP protocol; The data acquisition module collects sensor data, the protocol conversion module stores the data into the memory, and the protocol transmission module transmits the sensor data structure in the memory in the form of a JSON string through a custom TCP protocol; Business layer: receives the JSON string of real-time sensor data transmitted by the protocol conversion layer, and stores the converted data structure in the memory; Application display layer: including data format conversion module, chart drawing and display module, interactive function realization module and QChart component configuration module, which pre-processes the sensor data, converts it into a data format recognizable by the QChart component, and realizes the visualization of log data through chart display and interactive functions.

2. According to claim 1, a robot operation log visualization method based on the QT platform QChart visualization component is characterized in that: The XML structure fields of the sensor layer include: the keyword object represents the name of a sensor object, and the keyword field represents various real-time data fields of the sensor.

3. According to claim 1, a robot operation log visualization method based on the QT platform QChart visualization component is characterized in that: The protocol conversion module of the protocol conversion layer generates a corresponding code file using an automatic code generation tool from the XML data structure defined by the sensor. The code file contains the data storage format at runtime and member variables required by the business, and then puts the code file into the project for compilation.

4. According to claim 3, a robot operation log visualization method based on the QT platform QChart visualization component is characterized in that: The method for the business layer to convert the string is: to freely convert between the json string and the running memory data structure through the ToString() function and the FromString() function in the code file. The ToString() function encapsulates various sensor data at runtime into a string in json format; the FromString() function is the reverse operation of the above conversion, that is, to parse the string received by the transport layer in json format and parse it into various member variables in the code file.

5. According to claim 1, a robot operation log visualization method based on the QT platform QChart visualization component is characterized in that: The data format conversion module of the application presentation layer preprocesses the parsed log data, including removing redundant information, extracting key fields, and converting the log data into a data format recognizable by the QChart component.

6. According to claim 1, a robot operation log visualization method based on the QT platform QChart visualization component is characterized in that: The chart drawing and display module of the application display layer uses the QChart component to create corresponding charts, including using QLineSeries to create line charts, using QBarSeries to create bar charts, etc.

7. According to claim 1, a robot operation log visualization method based on the QT platform QChart visualization component is characterized in that: The interactive function implementation module of the application display layer displays charts through QChartView, provides functions such as mouse hover prompts, zooming, panning, and setting chart styles and color parameters.

Citation Information

Cited By

  • Communication method and system based on conventional communication protocol and QT

    CN121547503A