Multi-main-control-board data interaction method and device, computer equipment and storage medium
By performing device detection and data transmission on the CAN bus, the problem of inefficient communication of multi-main control board devices is solved, automatic identification, real-time synchronization and status monitoring of main control board devices are realized, and the communication automation and accuracy of the system is improved.
Patent Information
- Application Number
- CN202510574022.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-05
AI Technical Summary
The existing multi-main control board data interaction technology has limitations in data synchronization, reliability and scalability, resulting in inefficient communication.
The CAN bus is used to perform equipment detection, determine the communication address based on the response status of the device detection command, and send data synchronization and data monitoring instructions through the data transmission channel to analyze device parameters and sensor data to realize automatic identification, real-time synchronization and status monitoring of the main control board equipment.
It improves the communication efficiency of multi-main control board devices, realizes the automation, accuracy and real-time system, and ensures that data interactions are recognizable, synchronized and monitorable.
Smart Images

Figure CN120434075A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a multi-main control board data interaction method, device, computer equipment and storage medium. Background Art
[0002] In the field of communication technology, data interaction between multiple main control boards is involved, and communication protocols such as I2C, SPI, or UART are usually used for data transmission. However, these communication protocols have certain limitations in data synchronization, reliability, and scalability, thereby reducing the communication efficiency of data interaction between multiple main control boards. Summary of the Invention
[0003] Based on this, it is necessary to provide a multi-main control board data interaction method, device, computer equipment and computer-readable storage medium to address the above technical problems, so as to improve communication efficiency in the scenario where multiple main control board devices perform data interaction.
[0004] In a first aspect, the present application provides a multi-main control board data interaction method, comprising: Generate a device detection instruction and broadcast it on a preset CAN bus, determine the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address based on the response status of the device detection instruction, and establish a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device; generating a data synchronization instruction and sending it to the main control board device based on the data transmission channel, receiving device parameter data of the main control board device in response to the data synchronization instruction, parsing the device parameter data based on a preset data synchronization format, and obtaining data synchronization information corresponding to the main control board device; generating a data monitoring instruction and sending it to the main control board device based on the data transmission channel, receiving sensor data from the main control board device in response to the data monitoring instruction, parsing the sensor data based on a preset data monitoring configuration format, and obtaining data monitoring information corresponding to the main control board device; The data transmission channel, the data synchronization information and the data monitoring information are used as the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication mode.
[0005] In a second aspect, the present application further provides a multi-main control board data interaction device, comprising: a detection module, configured to generate a device detection instruction and broadcast it on a preset CAN bus, determine a communication address corresponding to the CAN bus and a main control board device corresponding to the communication address based on a response status of the device detection instruction, and establish a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device; a synchronization module, configured to generate a data synchronization instruction and send it to the main control board device based on the data transmission channel, receive device parameter data from the main control board device in response to the data synchronization instruction, parse the device parameter data based on a preset data synchronization format, and obtain data synchronization information corresponding to the main control board device; a data monitoring module, configured to generate a data monitoring instruction and send it to the main control board device based on the data transmission channel, receive sensor data from the main control board device in response to the data monitoring instruction, parse the sensor data based on a preset data monitoring configuration format, and obtain data monitoring information corresponding to the main control board device; The recording module is used to use the data transmission channel, the data synchronization information and the data monitoring information as the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication mode.
[0006] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above steps when executing the computer program.
[0007] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the above steps when executed by a processor.
[0008] The above-mentioned multi-main control board data interaction method, device, computer equipment and computer-readable storage medium first broadcast the device detection instruction in the CAN bus and efficiently determine the correspondence between the communication address in the CAN bus and the main control board device based on the response status of the device detection instruction, thereby realizing automatic identification and effective addressing of the main control board device connected to the CAN bus; secondly, send data synchronization instructions and receive returned device parameter data through the data transmission channel between the CAN bus and the main control board device, and further obtain data synchronization information based on the data synchronization format, thereby efficiently realizing real-time synchronization of the main control board device data; and Alternatively, data monitoring instructions are sent through the data transmission channel between the CAN bus and the main control board device, and the returned sensor data is received. Data monitoring information is further parsed based on the data monitoring configuration format, thereby efficiently achieving real-time monitoring of the main control board device status. Based on this, the data transmission channel, data synchronization information, and data monitoring information are integrated into the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication method, thereby achieving a data interaction mechanism that is identifiable, synchronizable, monitorable, and centrally manageable for multiple main control board devices on the CAN bus, thereby improving the automation, accuracy, and real-time performance of system communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 1. A schematic flow chart of a multi-control board data interaction method according to an embodiment; Figure 2 A schematic diagram of a flow chart of a multi-main control board data interaction method in device detection according to an embodiment; Figure 3 A schematic diagram of a flow chart of a multi-master control board data interaction method in data synchronization according to an embodiment; Figure 4 A schematic diagram of a flow chart of a multi-main control board data interaction method at the data monitoring level in one embodiment; Figure 5 A schematic diagram of a flow chart of a multi-main control board data interaction method at the fault monitoring level in one embodiment; Figure 6 The figure is a structural block diagram of a multi-main control board data interaction device in one embodiment. DETAILED DESCRIPTION
[0011] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0012] In one embodiment, Figure 1 As shown, a method for data interaction between multiple main control boards is provided. This embodiment uses the method applied to a server as an example for illustration. It is understood that the method can also be applied to a terminal, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method is applied to a control device and includes the following steps S101 to S104.
[0013] Step S101, generate a device detection instruction and broadcast it in the preset CAN bus, determine the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address based on the response status of the device detection instruction, and build a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device.
[0014] Among them, CAN bus represents a serial communication network for multi-host communication, which is used to transmit control instructions and status data between multiple devices. For example, multiple main control board devices exchange data by connecting to the same CAN bus, thereby achieving unified communication control and information synchronization.
[0015] The main control board device represents a control unit connected to the CAN bus, with functions such as processing instructions, collecting data, and uploading parameters. The communication address represents the address number used by the main control board device on the CAN bus, which is used to implement point-to-point or point-to-multipoint communication data transmission using the CAN bus architecture.
[0016] The term "control device" refers to the core control unit within the CAN bus control system responsible for generating commands, managing communication flows, and processing feedback from the main control board devices. It coordinates the operating status of each main control board device and enables system-level data exchange and task scheduling. For example, the main control computing unit or host computer in an industrial automation system can serve as a control device, responsible for sending commands to each main control board device and receiving and parsing the returned information to achieve centralized management and control. The control system corresponding to the CAN bus represents a complete integrated hardware and software system connected to the CAN bus physical communication network and responsible for managing all communication flows, command exchange, and status processing on it.
[0017] The device detection command is a data command generated by a control device and broadcast to the CAN bus. It is used to wake up or query all main control board devices currently connected to the CAN bus to determine whether they are online and capable of communication. The response status of the device detection command is used to determine whether a device has received feedback based on the device detection command. This includes the status corresponding to receiving feedback from a specific device and the status corresponding to not receiving feedback from any device.
[0018] For example, based on the broadcast mechanism of the CAN bus, the control device sends a device detection instruction to the CAN bus for broadcast transmission. That is, the broadcast method is that the device detection instruction is physically transmitted once, and all nodes on the CAN bus can listen, so there is no need to send it separately for each device. If the main control board device receives the device detection instruction and confirms that its own status allows a response, it returns the main control board device data with its own unique identifier to the CAN bus within a specified time window. If a main control board device and main control board device data that responds to the device detection instruction are detected, the communication address field in the main control board device data is extracted, and based on the communication address field, a unique mapping relationship is established between the main control board device and the communication address of the CAN bus to ensure that subsequent communications will not cause address conflicts or recognition errors.
[0019] Furthermore, after establishing a unique mapping relationship between the communication address of the main control board device and the CAN bus, a data transmission channel is constructed between the CAN bus and the main control board device. This data transmission channel does not necessarily represent a separate line at the physical level, but a logical communication context, including parameters such as device address, communication frame format, data valid bits, timeout settings, etc., and the data transmission channel will serve as the routing basis for subsequent sending and receiving instructions. That is, when it is necessary to interact with a main control board device, the corresponding channel configuration will be found through the communication address of the main control board device, and the correct communication transmission data will be generated accordingly. This process ensures that data transmission can be accurately matched and error-checked according to the channel configuration, avoiding frame loss, miscoding or content confusion during the communication process.
[0020] Step S102, generate a data synchronization instruction and send it to the main control board device based on the data transmission channel, receive the device parameter data of the main control board device in response to the data synchronization instruction, parse the device parameter data based on the preset data synchronization format, and obtain the data synchronization information corresponding to the main control board device.
[0021] Among them, the data synchronization instruction refers to a communication instruction generated by the control device for requesting the main control board device to upload its current device parameter data; the device parameter data refers to a set of parameter information used to describe the current configuration status or working status of the main control board device, such as the communication rate setting value, voltage level, temperature control strategy parameters, etc.
[0022] The data synchronization format represents the data structure template used during the transmission of device parameter data, which is used to guide how to divide the device parameter data row fields, convert numerical values, and perform semantic analysis.
[0023] Among them, data synchronization information represents a set of structured information obtained after parsing the device parameter data according to the data synchronization format. For example, after successfully parsing the device parameter data, a structure can be formed, which includes "main control board device number: 001", "current working mode: automatic", "control voltage: 24V" and other contents to determine whether it is necessary to adjust the configuration of the main control board device or issue further instructions.
[0024] Exemplarily, a data synchronization instruction is generated by a control device, and the data synchronization instruction includes a specified communication address and a specified data identifier. The specified communication address is used to specify the main control board device to be requested, and the specified data identifier is used to specify the device parameter data to be requested; the data synchronization instruction is sent to the specified main control board device through the corresponding data transmission channel, that is, based on the frame sending mechanism of the CAN bus, the data synchronization instruction is written into the CAN bus, and is sent to the communication address bound to the specified main control board device according to the established communication timing.
[0025] Furthermore, after receiving the data synchronization instruction, the main control board device reads the device parameter data specified by the data synchronization instruction from modules such as configuration registers, operation buffers, or non-volatile memory, packages the device parameter data into one or more standard data frames according to a preset data synchronization format, and then sends the device parameter data represented in the data frame format to the control device via a data transmission channel. Furthermore, based on the data synchronization format used to package the device parameter data, the device parameter data represented in the data frame format is structured and disassembled according to the corresponding data synchronization format. That is, the device parameter data is read and converted field by field according to the data synchronization format, ultimately obtaining the data synchronization information corresponding to the corresponding main control board device.
[0026] Step S103, generate a data monitoring instruction and send it to the main control board device based on the data transmission channel, receive the sensor data of the main control board device in response to the data monitoring instruction, parse the sensor data based on the preset data monitoring configuration format, and obtain the data monitoring information corresponding to the main control board device.
[0027] Among them, the data monitoring instruction refers to a communication instruction generated by the control device for requesting the main control board device to upload the sensor data it has collected; the sensor data refers to the set of measurement data collected and packaged by the main control board device from various connected sensors. For example, the sensor can represent an acquisition unit for physical quantities such as temperature, voltage, current, speed or pressure, and the sensor data is the temperature, voltage, current, speed or pressure data collected by the corresponding sensor.
[0028] Among them, the data monitoring configuration format represents the data structure template used in the transmission process of sensor data, which is used to guide how to perform field division, numerical conversion and semantic analysis on sensor data.
[0029] Among them, the data monitoring information represents a set of structured information obtained after parsing the sensor data according to the data monitoring configuration format. After successfully parsing the device parameter data, a structure can be formed, which includes "main control board device number: 001", "sensor number: 002", "voltage: 24V" and other contents, thereby real-time monitoring of the corresponding sensor connected to the corresponding main control board device to obtain real-time collection data.
[0030] Exemplarily, a data monitoring instruction is generated by a control device, and the data monitoring instruction includes a specified communication address and a specified data identifier. The specified communication address is used to specify the main control board device to be requested, and the specified data identifier is used to specify the sensor data to be requested; the data synchronization instruction is sent to the specified main control board device through the corresponding data transmission channel, that is, based on the frame sending mechanism of the CAN bus, the data monitoring instruction is written into the CAN bus, and is sent to the communication address bound to the specified main control board device according to the established communication timing.
[0031] Furthermore, upon receiving the data monitoring instruction, the main control board device collects current sensor data from the corresponding connected sensors, packages the sensor data into one or more standard data frames according to a preset data monitoring configuration format, and then sends the sensor data represented in the data frame format to the control device via a data transmission channel. Furthermore, based on the data monitoring configuration format for data packaging of the sensor data, the sensor data represented in the data frame format is structured and disassembled according to the corresponding data monitoring configuration format. That is, the sensor data is read and converted field by field according to the data monitoring configuration format, ultimately obtaining the data monitoring information corresponding to the corresponding main control board device.
[0032] Step S104: The data transmission channel, data synchronization information, and data monitoring information are used as the data interaction results corresponding to the CAN bus communication mode between the main control board device and the control device.
[0033] For example, after completing data synchronization and data monitoring, the results of the entire data interaction need to be summarized and organized to form the final interaction output. Specifically, the established data transmission channel, the acquired data synchronization information, and the acquired data monitoring information are integrated and used as the corresponding data interaction results between the corresponding main control board device and the control device based on the CAN bus communication method. During this process, it is first necessary to ensure the integrity of the data transmission channel, that is, the established communication path remains valid so that subsequent interactions can continue. At the same time, the data synchronization information and data monitoring information need to be stored and managed according to the established format to ensure data consistency and traceability.
[0034] In the above-mentioned multi-main control board data interaction method, first, a device detection command is broadcast on the CAN bus, and based on the response status of the device detection command, the correspondence between the communication address on the CAN bus and the main control board device is efficiently determined, thereby realizing automatic identification and effective addressing of the main control board device connected to the CAN bus; secondly, a data synchronization command is sent through the data transmission channel between the CAN bus and the main control board device, and the returned device parameter data is received. Further, data synchronization information is obtained based on the data synchronization format, thereby effectively realizing real-time synchronization of the main control board device data; thirdly, a data monitoring command is sent through the data transmission channel between the CAN bus and the main control board device, and the returned sensor data is received. Further, data monitoring information is obtained based on the data monitoring configuration format, thereby effectively realizing real-time monitoring of the main control board device status; based on this, the data transmission channel, data synchronization information, and data monitoring information are integrated into the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication mode, thereby realizing a data interaction mechanism that is identifiable, synchronized, monitorable, and centrally managed for multiple main control board devices on the CAN bus, thereby improving the automation, accuracy, and real-time performance of system communication.
[0035] In an exemplary embodiment, the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address are determined based on the response status of the device detection instruction, including steps S201 to S202; based on the communication address corresponding to the main control board device, a data transmission channel between the CAN bus and the main control board device is constructed, including steps S203 to S204.
[0036] Step S201: If multiple main control board devices that respond to the device detection instruction are detected within a preset period, the device identification information corresponding to each main control board device and the communication address corresponding to each main control board device in the CAN bus are obtained.
[0037] The device identification information represents a unique identity tag inherent in each main control board device. For example, the device identification information represents a device serial number, a MAC address, or an ID code burned into a chip.
[0038] For example, when it is detected that there are multiple main control board devices returning response data based on the same device detection instruction within a preset time period, the device identification information corresponding to each main control board device and the communication address corresponding to each main control board device in the CAN bus are extracted from the response data corresponding to the multiple main control board devices, wherein: the device identification information is generally a unique mark inherent in the main control board device, such as the device factory number or system registration code, which is used to distinguish individual devices; the communication address of the main control board device in the CAN bus is generally the default setting when the main control board device leaves the factory, or is initially set when the main control board device is initially connected to the CAN bus.
[0039] In step S202, if there are multiple main control board devices corresponding to the same communication address, the communication addresses of the multiple main control board devices corresponding to the same communication address are reallocated based on the device identification information corresponding to each main control board device until a unique communication address corresponding to each main control board device in the CAN bus is obtained.
[0040] Exemplarily, conflicts are detected one by one for the communication addresses corresponding to each main control board device in the CAN bus. If there are multiple main control board devices corresponding to the same communication address, new communication addresses are reallocated for the multiple main control board devices corresponding to the same communication address based on the device identification information of the main control board device. For example: according to specific address allocation rules, new communication addresses are reallocated to these main control board devices with communication address conflicts, ensuring that each allocation is targeted at a specific main control board device, while avoiding repeated allocation of existing communication addresses; if there is still a communication address conflict during the current round of allocation, the next round of allocation will continue until all main control board devices have unique and non-conflicting communication addresses in the CAN bus. After completing this process, a one-to-one mapping relationship between each main control board device and the communication address is established.
[0041] Step S203: Generate a handshake instruction and broadcast it in the CAN bus, and receive protocol version information of each main control board device in response to the handshake instruction.
[0042] Among them, the handshake instruction represents a communication instruction generated by the control device for triggering the main control board device to report the protocol version information it currently supports; the protocol version information represents the data structure, communication method and message parsing standard compatible with the main control board device.
[0043] Exemplarily, the control device generates a handshake instruction and broadcasts it on the CAN bus to initiate a protocol confirmation request to all main control board devices that have been assigned communication addresses; furthermore, after receiving the handshake instruction, each main control board device will construct a data frame containing a protocol version identifier based on the communication protocol information recorded in the internal firmware, and return the corresponding data frame to the control device through the specified communication address.
[0044] In step S204, a multi-machine handshake channel is constructed in the CAN bus based on the communication address corresponding to each main control board device and the latest protocol version identifier in the protocol version information corresponding to each main control board device, and the multi-machine handshake channel is used as a data transmission channel between the CAN bus and each main control board device.
[0045] Among them, the multi-machine handshake channel represents the data transmission mechanism corresponding to multiple main control board devices based on the unified communication protocol standard, which is used to achieve a stable communication relationship between multiple main control board devices and control devices on the CAN bus.
[0046] For example, the protocol version identifiers supported by each main control board device are integrated, and the latest protocol version identifier is selected as the standard used in the entire communication mechanism. That is, based on version number comparison and compatibility judgment, the constructed communication mechanism is ensured to cover the communication capabilities of all current main control board devices. Furthermore, after determining the communication protocol adopted by the communication mechanism based on the latest protocol version identifier, a multi-machine handshake channel is established for multiple main control board devices at the logical level based on this communication protocol. This multi-machine handshake channel defines the consistency of protocol configurations such as frame format, response structure, verification mechanism, and data flow direction of multiple main control board devices during the communication process.
[0047] In this embodiment, first, the communication address is reallocated to each main control board device based on the device identification information in the event of a communication address conflict, thereby ensuring the uniqueness of the communication address and communication reliability on the CAN bus; secondly, the protocol version information returned by each main control board device based on the handshake instruction is received to uniformly identify the protocol capabilities of each main control board device, and then combined with the communication address of each main control board device and the latest protocol version compatible with each main control board device, a multi-machine handshake channel is constructed, thereby establishing a data transmission foundation that meets the requirements of synchronous communication of multiple devices; based on this, an identifiable, addressable and efficient communication interaction system for multiple main control board devices in a shared bus environment can be realized, thereby improving the communication stability and protocol compatibility of parallel access of multiple devices.
[0048] In an exemplary embodiment, the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address are determined based on the response status of the device detection instruction, including steps S301 to S302; based on the communication address corresponding to the main control board device, a data transmission channel between the CAN bus and the main control board device is constructed, including step S303.
[0049] Step S301: If no main control board device responding to the device detection instruction is detected within a preset period, the response status of the device detection instruction is repeatedly detected within the next preset period until a main control board device responding to the device detection instruction is determined.
[0050] In which, for example, after the control device broadcasts a device detection instruction to the CAN bus, it will continuously monitor the response of the CAN bus within a set preset period of time to determine whether there is a main control board device that responds to the device detection instruction; if no valid response from the main control board device is detected within the preset period of time, it means that there is no main control board device on the current CAN bus that is in a state that allows response, or there is a main control board device that has not been initialized, is in sleep mode, or the communication link has not been established, which affects the main control board device's ability to receive the device detection instruction. To ensure that at least one communicative main control board device can be successfully identified, the above-mentioned detection process is repeated in the next preset period of time. This process adopts a periodic polling method, that is, the device detection instruction is re-broadcast at fixed time intervals and the response status is monitored to ensure that at a certain moment, the response of a main control board device can be captured in time; furthermore, once a main control board device is detected to respond to the device detection instruction, the polling operation is immediately terminated, and the main control board device is regarded as the only main control board device connected to the CAN bus and interacting with the control device for data.
[0051] Step S302: Generate a handshake instruction and broadcast it in the CAN bus, receive the communication address of the main control board device in response to the handshake instruction, and use the communication address corresponding to the main control board device as the communication address corresponding to the CAN bus.
[0052] Exemplarily, the control device generates a handshake instruction and broadcasts it on the CAN bus to send an address confirmation request and a protocol determination request to the main control board device; furthermore, after receiving the handshake instruction, the main control board device will return the communication address and communication protocol information recorded in the internal firmware to the control device; the control device uses the communication address of the main control board device as the communication address corresponding to the CAN bus, and based on the communication protocol information, uses the communication protocol supported by the main control board device as the standard adopted in the entire communication mechanism.
[0053] Step S303: Based on the communication address corresponding to the main control board device, a single-machine handshake channel is constructed in the CAN bus, and the single-machine handshake channel is used as a data transmission channel between the CAN bus and the main control board device.
[0054] Among them, the stand-alone handshake channel represents the data transmission mechanism corresponding to a single main control board device based on a specified communication protocol standard, which is used to achieve a stable communication relationship between the single main control board device and the control device on the CAN bus.
[0055] For example, in combination with the communication address and communication protocol corresponding to the single main control board device, a stand-alone handshake channel is established for the single main control board device at the logical level. The stand-alone handshake channel defines the protocol configurations such as the frame format, response structure, verification mechanism and data flow direction of the main control board device during the communication process, without involving the alignment of protocol versions corresponding to multiple main control board devices or multi-node compatibility analysis.
[0056] In this embodiment, first, the response status of the device detection instruction is repeatedly detected to confirm the first main control board device, thereby realizing automatic detection and access guarantee when the main control device does not respond immediately; secondly, the communication address fed back by the single main control board device is recorded as a valid address, and a single-machine handshake channel is constructed based on the communication address, thereby establishing a stable data transmission path between the control device and the single main control board device; based on this, automatic discovery, address confirmation and communication channel construction can be realized for the first responding main control board device, providing a reliable communication mechanism for data interaction in the single main control board device access scenario.
[0057] In an exemplary embodiment, the device parameter data is parsed based on a preset data synchronization format to obtain data synchronization information corresponding to the main control board device, including steps S401 to S403.
[0058] Step S401 : parsing the high byte and the low byte in the device parameter data based on the high and low byte configuration status in the data synchronization format to obtain a key-value pair structure in the device parameter data.
[0059] Step S402 : parsing the key-value pair structure in the device parameter data based on the key-value pair structure configuration state in the data synchronization format to obtain the parameter address corresponding to the key structure and the target device parameter data corresponding to the value structure.
[0060] Among them, the high and low byte configuration states represent the definition rules related to byte order in the data synchronization format, which are used to explain that multi-byte data is obtained by combining according to the preset arrangement order of high bytes and low bytes; the high byte and low byte represent the two basic components of the multi-byte data, the high byte represents the high-order part of the value, and the low byte represents the low-order part of the value.
[0061] The key-value pair structure configuration state represents the definition rules related to the key-value pair structure in the data synchronization format, which is used to explain that the key-value pair data is obtained by combining preset key structure attributes and value structure attributes.
[0062] The key-value pair structure in the device parameter data represents a structured representation of data parsed from the device parameter data, which is divided into two parts: a key structure (Key) and a value structure (Value).
[0063] Exemplarily, the device parameter data is continuous byte data in which high and low bytes are sorted based on the high and low byte configuration status in the data synchronization format. Therefore, based on the high and low byte configuration status in the data synchronization format, the arrangement of the high byte and low byte of the device parameter data during the transmission process can be parsed, and the byte meaning of the device parameter data can be obtained in the continuous byte data to generate a key-value pair structure in the device parameter data.
[0064] Exemplarily, the key-value pair structure in the device parameter data is data that combines the key structure and value structure of a specific attribute based on the key-value pair structure configuration state in the data synchronization format. Therefore, the structural attributes of the key-value pair structure in the device parameter data can be determined based on the key-value pair structure configuration state in the data synchronization format, that is, the attribute of the key structure is pre-set as the parameter address, and the attribute of the value structure is pre-set as the target device parameter data, thereby parsing the specific parameter address and target device parameter data in the key-value pair structure of the device parameter data; wherein, the parameter address represents information describing the data source in the device parameter data (such as the device identification information of the main control board device, the storage address of the device parameter data in the main control board device, etc.), and the target device parameter data represents information describing specific parameters in the device parameter data (such as the communication rate setting value, voltage level, temperature control strategy parameters, etc.).
[0065] For example, the high- and low-byte configuration states and the key-value pair structure configuration states can be set to "parameter address high eight bits - parameter address low eight bits - target device parameter data high eight bits - target device parameter data low eight bits", that is, bytes 1 to 8 represent the high byte for storing the parameter address, bytes 9 to 16 represent the low byte for storing the parameter address, bytes 17 to 24 represent the high byte for storing the target device parameter data, and bytes 25 to 32 represent the low byte for storing the target device parameter data. Based on the high- and low-byte configuration states of any device parameter data, the key-value pair structure in the device parameter data is parsed, that is, bytes 1 to 16 represent the key structure, and bytes 17 to 32 represent the value structure; then based on the key-value pair structure in the key-value pair structure configuration state, the key structure corresponding to bytes 1 to 16 represents the parameter address, and the value structure corresponding to bytes 17 to 32 represents the target device parameter data.
[0066] Step S403 : The main control board device corresponding to the parameter address is regarded as the main control board device with which data has been synchronized, and the target device parameter data corresponding to the main control board device with which data has been synchronized is regarded as the data synchronization information corresponding to the main control board device with which data has been synchronized.
[0067] For example, for the main control board device that has been synchronized with data, the parameter address is used as the key and the target device parameter data is used as the value, so that the parameter address and the target device parameter data are associated with each other in a key-value pair structure and stored in the NVS space (Non-Volatile Storage) corresponding to the main control board device; if the current NVS space already stores data, the newly stored data will overwrite the existing data.
[0068] In this embodiment, first, the device parameter data is parsed in byte order through the high and low byte configuration states, thereby ensuring the accuracy of multi-byte data restoration and the integrity of the field structure; secondly, the key-value pair structure obtained by parsing is semantically parsed according to the key value and the key-value pair structure configuration state, thereby realizing the field attribution determination and clear identification of the numerical meaning of the key-value pair structure; based on this, the full-link synchronous processing of the device parameter data from the bottom-level byte parsing to the high-level semantic attribution is realized, thereby improving the accuracy of data identification and the standardization of the information structure.
[0069] In an exemplary embodiment, the sensor data is parsed based on a preset data monitoring configuration format to obtain data monitoring information corresponding to the main control board device, including steps S501 to S503.
[0070] Step S501 : identifying device identification information in sensor data based on a data monitoring configuration format, and determining a monitoring display number corresponding to the main control board device to which the device identification information belongs.
[0071] Among them, the monitoring display number represents the number identification used to distinguish each monitoring point in the display interface, which is used to clarify the physical source or logical monitoring object of the sensor data and clarify the display position of the sensor data in the display interface.
[0072] Exemplarily, based on sensor data represented in a preset data monitoring configuration format, fields related to device identification information in the data monitoring configuration format are identified, thereby obtaining the device identification information in the sensor data to clarify which specific main control board device the sensor data originates from. For example, according to a preset field mapping table, corresponding byte segments are extracted from the sensor data and converted into specific identification codes for comparison with registered device identification information, thereby determining the main control board device to which the current sensor data belongs. Furthermore, after confirming the main control board device to which the current sensor data belongs, based on a predetermined association between a monitoring display number and device identification information, a monitoring display number that matches the device identification information to which the main control board device belongs is obtained. The display area in the display interface is pre-divided according to different monitoring points, thereby determining the display positions of different monitoring points in the physical space in the display interface and the corresponding monitoring display numbers, thereby establishing an association between different monitoring display numbers and the main control board devices corresponding to the different monitoring points.
[0073] Step S502 , identifying the monitoring data category in the sensor data based on the data monitoring configuration format, determining the monitoring data category group number corresponding to the monitoring display number, and treating the sensor data as verified sensor data if the monitoring data category matches the monitoring data category group number.
[0074] Among them, the monitoring data category represents the specific category of measurement data reflected by the sensor data, which is used to indicate the physical meaning or monitoring dimension of the data. For example, the monitoring data category can represent different categories of physical quantities such as temperature, current, and pressure.
[0075] The monitoring data category group number represents the number of a pre-configured monitoring data category, which is used to verify whether the sensor data reported by a monitoring point is within the permitted range. For example, a category group with a group number of "A" includes the monitoring data category of temperature. If the monitoring data category of the received sensor data belongs to this group number, it is considered valid data.
[0076] Exemplarily, based on sensor data represented in a preset data monitoring configuration format, fields related to the monitoring data category in the data monitoring configuration format are identified to obtain the monitoring data category in the sensor data. For example, according to a preset field mapping table, corresponding byte segments are extracted from the sensor data and converted into specific category codes for comparison with registered monitoring data categories, thereby determining the monitoring data category corresponding to the current sensor data. Furthermore, the corresponding monitoring data category group number is searched based on the monitoring display number. This monitoring data category group number indicates the range of data categories that should be collected at the corresponding monitoring point and is a standardized classification method for monitoring data categories. That is, once the monitoring data category extracted from the sensor data matches the monitoring data category group number defined in the configuration, it indicates that the sensor data complies with the monitoring logic of the current monitoring point and is therefore verified sensor data. If the two do not match, it indicates that there may be a point configuration error or an abnormal collection source during the sensor data transmission process. The sensor data will be excluded from the valid data, effectively eliminating data content with unknown sources or abnormal structures.
[0077] Step S503 , based on the data attributes of the verified sensor data, performing data unit analysis and data accuracy analysis on the verified sensor data to obtain data monitoring information corresponding to the main control board device, so as to display the data monitoring information through a preset display interface.
[0078] The data attributes of the sensor data represent parameter characteristics such as unit information and numerical precision contained in the sensor data.
[0079] For example, first, the original numerical value is converted into a unit according to the unit information of the sensor data to obtain the data value after the data unit parsing process, that is, the internal coded value is converted into the actual unit representation that conforms to the business logic, for example, the internal integer temperature value is converted into Celsius with decimals; secondly, according to the numerical precision of the sensor data, the decimal place of the data value after the data unit parsing process is controlled and formatted for output, to ensure that the data obtained after the data precision parsing process has a uniform accuracy standard when displayed or stored. After these processes, the data monitoring information finally formed not only retains the accuracy of the original measurement value, but also has a clear unit identification and display-friendly data structure, which can be directly called or displayed by the downstream system; thirdly, the data monitoring information will then be displayed through a preset display interface, allowing users to clearly view the specific monitoring status of each main control board device, including the corresponding monitoring point, collection data type, real-time data value and its unit.
[0080] In this embodiment, first, the device identification information and its corresponding monitoring display number are determined based on the data monitoring configuration format, thereby realizing accurate identification of the device ownership and display location of the sensor data; secondly, the monitoring data category is determined based on the data monitoring configuration format, and the monitoring data category is matched and verified with the monitoring data category group number corresponding to the monitoring display number, thereby ensuring that the sensor data is data that complies with the monitoring logic of the current monitoring point, thereby improving the data validity; thirdly, the unit and precision attributes of the verified sensor data are format parsed, thereby realizing standardized display and processing of data monitoring information; based on this, a complete processing flow of data source confirmation, data category verification and data attribute parsing is realized, thereby improving the accuracy, structural standardization and display reliability of the sensor data.
[0081] In an exemplary embodiment, after establishing a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device, the method further includes steps S601 to S603.
[0082] Step S601: receiving heartbeat packet data sent by a main control board device based on a corresponding communication address at a preset frequency.
[0083] Among them, the heartbeat packet data represents a communication maintenance signal sent regularly by the main control board device at a preset time interval, which is used to indicate that the main control board device is currently online. For example, the main control board device sends a heartbeat packet data every 3 seconds to indicate that its communication function is normal and has not been disconnected.
[0084] For example, after completing the construction of the data transmission channel of the main control board device based on the communication address, in order to achieve dynamic maintenance of the online status of the main control board device, the control device begins to monitor the heartbeat packet data sent from each main control board device based on its communication address; wherein, the heartbeat packet data is a lightweight data frame sent periodically at a preset frequency, usually used to indicate that the main control board device is currently in a communicative state, with a simple structure and few data fields, mainly including basic content such as device identification, communication address and timestamp. Furthermore, a corresponding receiving mechanism is set at the data link layer or application layer, and by continuously monitoring the heartbeat packet data from each main control board device on the CAN bus, real-time perception of the online status of each main control board device is achieved. Furthermore, since each main control board device uses a unique communication address, the control device can quickly classify and attribute the heartbeat packet data based on the communication address, and maintain a heartbeat record table in the background to record the time when each main control board device received the most recent heartbeat packet.
[0085] Step S602: If it is detected that the target main control board device has not sent any heartbeat packet data within a preset period, the connection state of the target main control board device is set to a disconnected state, and the communication address corresponding to the target main control board device is removed.
[0086] Among them, the target main control board device represents the main control board device that has not sent heartbeat packet data within the preset time period; the connection status of the target main control board device represents the working status of the target main control board device at the communication level, which is used to identify whether the main control board device can perform normal data interaction; the disconnected status indicates that the main control board device is currently lost or abnormally interrupted.
[0087] For example, a fixed time threshold is pre-set as the effective receiving period of the heartbeat packet data, that is, if a main control board device does not send heartbeat packet data within the preset time period, it means that the main control board device may have been powered off, abnormally restarted, or the communication link has failed. Furthermore, after the control device detects that the most recent heartbeat record of the main control board device exceeds the time threshold, it determines that the main control board device is a target main control board device that is already in an inactive state, and then sets the connection state of the target main control board device to a disconnected state; furthermore, the disconnected state not only reflects that the target main control board device is currently unable to participate in communication, but also indicates that the control device should immediately terminate the data request and instruction issuance to the target main control board device, that is, in order to prevent subsequent communication operations from being sent by mistake, it is necessary to further remove the communication address corresponding to the target main control board device from the communication mapping table to ensure that the control device no longer calls the communication address when issuing instructions.
[0088] In addition, the operation of removing the communication address will also synchronously update various communication-related data structures, such as device status cache, message forwarding table, channel mapping relationship, etc., thereby completely disconnecting the logical connection with the target main control board device.
[0089] Step S603 : Based on the disconnection status of the target main control board device, a status code and a warning level corresponding to the target main control board device are generated, so as to describe the disconnection status of the target main control board device in combination with the status code and the warning level.
[0090] The status code represents a standardized status identifier generated based on the connection status of the main control board device, and is used for unified coding management of the device's connection status. For example, the status code "01" represents normal communication, "02" represents disconnected communication, and "03" represents abnormal communication.
[0091] The warning level indicates the risk level based on the severity of the disconnection status of the main control board device. For example, a low-level warning indicates a minor anomaly or a short communication interruption with no significant impact on the overall control system (such as heartbeat delay, occasional packet loss, or a short offline period that has been restored). A medium-level warning indicates a potential problem that may affect local functions (such as intermittent communication anomalies, frequent disconnections, and abnormal functions of some functions). A high-level warning indicates a serious anomaly that has a substantial impact on the operation of the control system and requires immediate response (such as a device being offline for a long time, unable to communicate, or a critical parameter exceeding the limit).
[0092] Exemplarily, based on a predetermined standardized encoding of the connection status of the main control board device, the disconnected state of the target main control board device is mapped to a specific status code, and then the status code is assigned a corresponding warning level according to the nature and duration of the disconnection behavior of the target main control board device. For example, a minor interruption may be set as a low-level warning, while a long period of no response may be set as a high-level warning. In addition, based on the set warning level strategy, it can be further decided whether to trigger the alarm mechanism, record the log, notify the upper platform, or activate the automatic repair process.
[0093] Furthermore, the combination of the status code and the warning level can also be used to describe the current connection status of the target main control board device, so that other modules or user interfaces can obtain key information such as whether the target main control board device is online, whether it is abnormal, whether it affects the business, etc. in a unified format when reading the connection status of the target main control board device, thereby forming a complete device status perception system.
[0094] In this embodiment, firstly, based on the heartbeat packet data regularly sent by the main control board device based on the communication address, real-time perception and update of the online status of the main control board device is achieved; secondly, based on the judgment logic of the absence of heartbeat packet data in the preset time period, accurate identification of the disconnection status of the main control board device and timely cleaning of the communication address are achieved; thirdly, status codes and warning levels are generated according to the disconnection status, thereby achieving standardized representation of abnormal status of the main control board device and risk level classification; based on this, a set of equipment online management mechanism based on real-time monitoring of communication behavior can be constructed, which improves the stability of communication, abnormal response efficiency and status visualization capability.
[0095] In an exemplary embodiment, after establishing a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device, the method further includes steps S701 to S704.
[0096] Step S701: before the main control board device is in a disconnected state, or when the main control board device detects that a sensor is abnormal, receiving fault detection data corresponding to the main control board device.
[0097] Among them, fault detection data refers to a structured data content generated and reported by the main control board device when an abnormal situation is detected, which is used to indicate the current fault status. For example, when the main control board device communication is abnormal or when the sensor fails, the main control board device generates fault detection data to report the specific fault type and severity.
[0098] For example, if no heartbeat packet data is received from the main control board device within a preset period of time, the main control board device is set to a disconnected state, thereby triggering the fault detection mechanism. Alternatively, the fault detection mechanism is triggered when an abnormality such as excessive value fluctuation, feedback interruption, signal drift, or logic check failure is detected in the sensor corresponding to the main control board device. Furthermore, after the fault detection mechanism is triggered, the main control board device generates the corresponding fault detection data, encapsulates it into a standard data frame, and then sends it to the control device via its communication address on the CAN bus. The control device receives the data frame in a listening state and, according to pre-set fault data identification conditions, separates it from the regular data stream and marks it as an abnormal data source.
[0099] Step S702 : parsing the fault detection data based on a preset fault detection data format to obtain device identification information, fault code, and fault warning level corresponding to the fault detection data.
[0100] Among them, the fault detection data format represents a data structure template used to standardize the arrangement, length, meaning and parsing rules of each field in the fault detection data. For example, the fault detection data format stipulates that the first two bytes are device identification information, the middle two bytes are fault codes, and the last byte is the warning level.
[0101] Among them, the fault code represents the numerical code used to identify the specific fault type in the fault detection data, and is used to classify and standardize the fault phenomenon. For example, the fault code "0x01" represents communication abnormality and "0x02" represents voltage over limit.
[0102] The fault warning level indicates the risk level of a fault event according to its impact. For example, a low-level warning is used for prompting, while an emergency level triggers an alarm or protection mechanism.
[0103] For example, after the control device receives the fault detection data from the main control board device, it performs structured analysis on each field in the fault detection data according to a preset fault detection data format, that is, the fault detection data format defines the byte offset position, field length, encoding rules and field meaning of each field in the data frame, thereby parsing to obtain the device identification information, fault code and fault warning level in the fault detection data.
[0104] Step S703: Determine description information corresponding to the fault code in a preset database, and combine the description information with the device identification information to obtain fault description information corresponding to the main control board device.
[0105] Among them, the preset database represents a data set that pre-establishes and stores the mapping relationship between fault codes and their corresponding descriptive information, which is used to quickly retrieve the corresponding descriptive information after parsing the fault code, that is, the natural language text that expresses the meaning of a certain fault code. For example, the database records that the fault code "0x03" corresponds to the descriptive information of "temperature sensor disconnected".
[0106] Among them, the fault description information represents the text content composed of the device identification information and the response description information, which is used to accurately reflect the current fault status of a certain main control board device or its corresponding sensor. For example, the fault description information "Device A: Temperature sensor disconnected" records that device A is in the fault state of temperature sensor disconnection.
[0107] For example, a mapping table between fault codes and their corresponding descriptive information is first maintained in a pre-set database. This mapping table is constructed based on the device manufacturer, protocol version, and specific functional logic, and covers all possible fault types and descriptions of main control board devices and response sensors. Furthermore, by comparing the fault code value in the pre-set database, the description corresponding to the fault type represented by the fault code is quickly retrieved. For example, the fault code "0x03" corresponds to the descriptive information "temperature sensor disconnected." Furthermore, this descriptive information is combined with the previously extracted device identification information to generate a complete fault description. This information not only reflects the fault phenomenon, but also indicates the device object where the fault occurred, making problem location more accurate.
[0108] Step S704: Display the fault description information corresponding to the main control board device based on the level window corresponding to the fault warning level.
[0109] Among them, the level window represents the interface area or display channel preset according to the fault warning level for displaying fault description information. It is used to present and manage fault description information of different severity in a differentiated manner. For example, the fault description information of low-level warnings can be displayed in a small font in the information bar, while high-level warnings will be prominently displayed in the pop-up window or main alarm interface in a highlighted, bold, or icon-based manner.
[0110] Among them, the level window not only limits the display position, but also controls the display style, color, hierarchy and interaction method, thereby realizing multi-level and clearly classified visual expression according to the fault warning level, making it easier for users to quickly identify the severity of the fault and take corresponding actions.
[0111] For example, if the fault warning level is low, the fault description information can be displayed in a gray prompt box in the general information area of the preset display interface. If the fault warning level is medium, the fault description information is placed in the key prompt area of the preset display interface, using a yellow background and a pop-up prompt. If the fault warning level is high, it will be displayed in a red warning box in the center of the preset display interface, and an audible and visual alarm or log recording operation will be triggered. In addition, the display interface also supports information refresh and status reset mechanisms. After the fault is resolved, the warning window can be automatically or manually closed to restore the interface to normal state.
[0112] In this embodiment, first, the main control board device sends fault detection data when it is disconnected or detects an abnormality in the sensor, thereby realizing active reporting and timely perception of the fault status; secondly, the fault detection data is parsed based on the fault detection data format, thereby realizing structured identification of the source, type and severity of the fault; thirdly, the descriptive information corresponding to the fault code is determined in a preset database, and the descriptive information is combined with the device identification information to obtain the fault description information, thereby improving the readability and directionality of the fault description information; thirdly, the corresponding level window is called for display according to the fault warning level, thereby realizing hierarchical presentation of the fault description information and response priority control; based on this, a closed-loop mechanism from fault occurrence, information extraction to visual feedback can be constructed, thereby improving the fault response efficiency and information processing accuracy of the control system.
[0113] In an exemplary embodiment, Figure 2 As shown, the method further includes steps S801 to S809.
[0114] Step S801: Start the timing operation of the single-device detection timer in a preset period, generate a device detection instruction and continuously broadcast it in the CAN bus. The single-device detection timer represents a timing network for detecting a single access device.
[0115] Step S802: Determine whether a response based on the device detection instruction is received within the time period corresponding to the timing operation of the stand-alone detection timer. If so, execute step S803; if not, execute step S808.
[0116] Step S803: If a response based on the device detection instruction is received within the time period corresponding to the timing operation of the single-machine detection timer, the timing operation of the single-machine detection timer is stopped, and the timing operation of the multi-machine detection timer in the preset time period is started. The multi-machine detection timer represents a timing network for detecting multiple access devices.
[0117] Step S804: within the time period corresponding to the timing operation of the multi-machine detection timer, determine the main control board device that responds to the device detection instruction, and repeat the timing operation of the multi-machine detection timer until all the main control board devices that respond to the device detection instruction are determined.
[0118] Step S805, obtain the device identification information and communication address of each main control board device that responds to the device detection instruction. If there is a main control board device with a communication address conflict, reallocate the communication address for the main control board device with the communication address conflict based on the device identification information of the main control board device until the unique communication address of each main control board device on the CAN bus is determined.
[0119] Step S806: Send the unique communication address of each main control board device on the CAN bus to the corresponding main control board device.
[0120] Step S807: Generate a handshake instruction and broadcast it in the CAN bus, receive the protocol version information of each main control board device in response to the handshake instruction, and build a multi-machine handshake channel in the CAN bus based on the latest protocol version identifier in the protocol version information corresponding to each main control board device.
[0121] Step S808: If no response based on the device detection instruction is received within the period corresponding to the timing operation of the single-device detection timer, the timing operation of the single-device detection timer is repeatedly started until a main control board device that responds to the device detection instruction is determined.
[0122] Step S809: Generate a handshake instruction and broadcast it in the CAN bus, receive the communication address of the main control board device in response to the handshake instruction, and build a single-machine handshake channel in the CAN bus based on the communication address corresponding to the main control board device.
[0123] In an exemplary embodiment, Figure 3 As shown, the method further includes steps S901 to S905.
[0124] Step S901: determine the data synchronization mode.
[0125] Step S902: If the data synchronization mode is to synchronize the device parameter data of the currently connected main control board device, then identify the communication address corresponding to the currently connected main control board device.
[0126] Step S903: Based on the communication address corresponding to the currently connected main control board device, device parameter data sent by the main control board device is received on the CAN bus.
[0127] Step S904: If the data synchronization mode is to synchronize the device parameter data of the designated main control board device, then the communication address corresponding to the designated main control board device is obtained.
[0128] Step S905 : If the communication address corresponding to the designated main control board device is the communication address recorded on the CAN bus, then based on the communication address corresponding to the designated main control board device, the device parameter data sent by the main control board device is received on the CAN bus.
[0129] In an exemplary embodiment, Figure 4 As shown, the method further includes steps S1001 to S1005.
[0130] Step S1001: assign different monitoring display numbers to different display positions in a preset display interface. Any monitoring display number corresponds to different device identification information, monitoring data category group number, and sensor data address.
[0131] Among them, the display interface can represent a user interface built based on the LVGL graphics library (Light and Versatile Graphics Library, a lightweight and versatile graphics library), which displays visual content on embedded devices (such as smart meters, industrial screens, vehicle-mounted terminals, etc.) in a graphical manner and supports user interactive operations.
[0132] Step S1002, generate a data monitoring instruction and send it to the corresponding main control board device, the data monitoring instruction includes the main control board identification information, the monitoring data category and the sensor data address, so that the main control board device to which the corresponding main control board identification information belongs collects the sensor data of the corresponding monitoring data category in the corresponding sensor data address and returns the sensor data.
[0133] Step S1003: Receive sensor data from the main control board device, determine the monitoring display number corresponding to the main control board device based on the device identification information of the main control board device, and determine the monitoring data category group number corresponding to the monitoring display number.
[0134] Step S1004 , identifying the monitoring data category in the sensor data, and if the monitoring data category matches the monitoring data category group number, treating the sensor data as verified sensor data.
[0135] Step S1005 , displaying the verified sensor data through a preset display interface in combination with the data value, data unit, and data accuracy of the verified sensor data.
[0136] In an exemplary embodiment, Figure 5 As shown, the method further includes steps S1101 to S1005.
[0137] Step S1101 , after detecting that the main control board device is physically connected to the CAN bus, a corresponding communication address is allocated to the main control board device, and communication connection of the main control board device in the CAN bus is achieved based on the corresponding communication address of the main control board device.
[0138] Step S1102: Receive the heartbeat packet data sent by the main control board device based on the corresponding communication address at a preset frequency. If it is detected that the main control board device does not send heartbeat packet data within the preset time period, receive the fault detection data corresponding to the main control board device and remove the communication address corresponding to the main control board device.
[0139] Step S1103: If it is detected that the sensor corresponding to the main control board device is abnormal, the fault detection data corresponding to the main control board device is received.
[0140] Step S1104 , parsing the fault detection data to obtain device identification information, fault code, and fault warning level corresponding to the fault detection data.
[0141] Step S1105 , determining description information corresponding to the fault code in a preset database, and combining the description information with the device identification information to obtain fault description information corresponding to the main control board device.
[0142] Step S1106: Display the fault description information corresponding to the main control board device based on the level window corresponding to the fault warning level.
[0143] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0144] Based on the same inventive concept, embodiments of the present application also provide a multi-mainboard data interaction device for implementing the multi-mainboard data interaction method mentioned above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more multi-mainboard data interaction device embodiments provided below can be found in the above-mentioned limitations of the multi-mainboard data interaction method and will not be repeated here.
[0145] In an exemplary embodiment, Figure 6 As shown, a multi-main control board data interaction device is provided, which is applied to a control device. The device includes: a detection module 601, a synchronization module 602, a data monitoring module 603 and a recording module 604, wherein: Detection module 601, configured to generate a device detection instruction and broadcast it on a preset CAN bus, determine the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address based on the response status of the device detection instruction, and establish a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device; Synchronization module 602, configured to generate a data synchronization instruction and send it to the main control board device via a data transmission channel, receive device parameter data from the main control board device in response to the data synchronization instruction, parse the device parameter data based on a preset data synchronization format, and obtain data synchronization information corresponding to the main control board device; The data monitoring module 603 is configured to generate a data monitoring instruction and send it to the main control board device via a data transmission channel, receive sensor data from the main control board device in response to the data monitoring instruction, parse the sensor data based on a preset data monitoring configuration format, and obtain data monitoring information corresponding to the main control board device; The recording module 604 is used to use the data transmission channel, data synchronization information and data monitoring information as the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication mode.
[0146] In an exemplary embodiment, the detection module 601 is also used to: if multiple main control board devices responding to the device detection instruction are detected within a preset time period, then obtain the device identification information corresponding to each main control board device and the communication address corresponding to each main control board device in the CAN bus; if there are multiple main control board devices corresponding to the same communication address, then based on the device identification information corresponding to each main control board device, reallocate the communication addresses for the multiple main control board devices corresponding to the same communication address until the communication address corresponding to each main control board device in the CAN bus is obtained; generate a handshake instruction and broadcast it in the CAN bus, and receive the protocol version information of each main control board device in response to the handshake instruction; combine the communication address corresponding to each main control board device and the latest protocol version identifier in the protocol version information corresponding to each main control board device, and construct a multi-machine handshake channel in the CAN bus, and use the multi-machine handshake channel as a data transmission channel between the CAN bus and each main control board device.
[0147] In an exemplary embodiment, the detection module 601 is also used to: if no main control board device responding to the device detection instruction is detected within a preset time period, then repeatedly detect the response status of the device detection instruction within the next preset time period until a main control board device responding to the device detection instruction is determined; generate a handshake instruction and broadcast it on the CAN bus, receive the communication address of the main control board device in response to the handshake instruction, and use the communication address corresponding to the main control board device as the communication address corresponding to the CAN bus; based on the communication address corresponding to the main control board device, construct a single-machine handshake channel in the CAN bus, and use the single-machine handshake channel as the data transmission channel between the CAN bus and the main control board device.
[0148] In an exemplary embodiment, the synchronization module 602 is also used to: parse the high byte and low byte in the device parameter data based on the high and low byte configuration status in the data synchronization format to obtain the key-value pair structure in the device parameter data; parse the key-value pair structure in the device parameter data based on the key-value pair structure configuration status in the data synchronization format to obtain the parameter address corresponding to the key structure and the target device parameter data corresponding to the value structure; use the main control board device corresponding to the parameter address as the main control board device that has been synchronized with the data, and use the target device parameter data corresponding to the main control board device that has been synchronized with the data as the data synchronization information corresponding to the main control board device that has been synchronized with the data.
[0149] In an exemplary embodiment, the data monitoring module 603: identifies the device identification information in the sensor data based on the data monitoring configuration format, and determines the monitoring display number corresponding to the main control board device to which the device identification information belongs; identifies the monitoring data category in the sensor data based on the data monitoring configuration format, and determines the monitoring data category group number corresponding to the monitoring display number. If the monitoring data category matches the monitoring data category group number, the sensor data is regarded as verified sensor data; based on the data attributes of the verified sensor data, the verified sensor data is subjected to data unit analysis processing and data accuracy analysis processing to obtain data monitoring information corresponding to the main control board device, so as to display the data monitoring information through a preset display interface.
[0150] In an exemplary embodiment, the device also includes a fault monitoring module, which is used to: receive heartbeat packet data sent by the main control board device based on the corresponding communication address at a preset frequency; if a target main control board device is detected that has not sent heartbeat packet data within a preset time period, the connection status of the target main control board device is set to a disconnected state, and the communication address corresponding to the target main control board device is removed; based on the disconnected state of the target main control board device, a status code and warning level corresponding to the target main control board device are generated to describe the disconnected state of the target main control board device in combination with the status code and warning level.
[0151] In an exemplary embodiment, the fault monitoring module is also used to: before the main control board device is in a disconnected state, or when the main control board device detects a sensor abnormality, receive the fault detection data corresponding to the main control board device, parse the fault detection data based on a preset fault detection data format, and obtain the device identification information, fault code, and fault warning level corresponding to the fault detection data; determine the description information corresponding to the fault code in a preset database, combine the description information with the device identification information to obtain the fault description information corresponding to the main control board device; and display the fault description information corresponding to the main control board device based on the level window corresponding to the fault warning level.
[0152] Each module in the multi-control board data exchange device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0153] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in any of the above embodiments when executing the computer program.
[0154] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above embodiments are implemented.
[0155] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0156] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A multi-control board data interaction method, characterized in that: Applied to a control device, the method includes: Generate a device detection instruction and broadcast it on a preset CAN bus, determine the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address based on the response status of the device detection instruction, and establish a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device; generating a data synchronization instruction and sending it to the main control board device based on the data transmission channel, receiving device parameter data of the main control board device in response to the data synchronization instruction, parsing the device parameter data based on a preset data synchronization format, and obtaining data synchronization information corresponding to the main control board device; generating a data monitoring instruction and sending it to the main control board device based on the data transmission channel, receiving sensor data from the main control board device in response to the data monitoring instruction, parsing the sensor data based on a preset data monitoring configuration format, and obtaining data monitoring information corresponding to the main control board device; The data transmission channel, the data synchronization information and the data monitoring information are used as the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication mode.
2. The method according to claim 1, characterized in that The determining, based on the response status of the device detection instruction, the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address, includes: If multiple main control board devices that respond to the device detection instruction are detected within a preset time period, the device identification information corresponding to each main control board device and the communication address corresponding to each main control board device in the CAN bus are obtained; If there are multiple main control board devices corresponding to the same communication address, then based on the device identification information corresponding to each main control board device, reallocate communication addresses for the multiple main control board devices corresponding to the same communication address until a unique communication address corresponding to each main control board device in the CAN bus is obtained; The step of constructing a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device includes: Generate a handshake instruction and broadcast it on the CAN bus, and receive protocol version information of each main control board device in response to the handshake instruction; Combined with the communication address corresponding to each main control board device and the latest protocol version identifier in the protocol version information corresponding to each main control board device, a multi-machine handshake channel is constructed in the CAN bus, and the multi-machine handshake channel is used as the data transmission channel between the CAN bus and each main control board device.
3. The method according to claim 1, characterized in that The determining, based on the response status of the device detection instruction, the communication address corresponding to the CAN bus and the main control board device corresponding to the communication address, includes: If no main control board device responding to the device detection instruction is detected within the preset time period, repeatedly detecting the response status of the device detection instruction within the next preset time period until a main control board device responding to the device detection instruction is determined; Generate a handshake instruction and broadcast it on the CAN bus, receive the communication address of the main control board device in response to the handshake instruction, and use the communication address corresponding to the main control board device as the communication address corresponding to the CAN bus; The step of constructing a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device includes: Based on the communication address corresponding to the main control board device, a single-machine handshake channel is constructed in the CAN bus, and the single-machine handshake channel is used as a data transmission channel between the CAN bus and the main control board device.
4. The method according to claim 1, wherein The parsing of the device parameter data based on a preset data synchronization format to obtain data synchronization information corresponding to the main control board device includes: Parsing the high byte and the low byte in the device parameter data based on the high and low byte configuration states in the data synchronization format to obtain a key-value pair structure in the device parameter data; Based on the key-value pair structure configuration state in the data synchronization format, the key-value pair structure in the device parameter data is parsed to obtain the parameter address corresponding to the key structure and the target device parameter data corresponding to the value structure; The main control board device corresponding to the parameter address is used as the main control board device with data synchronization, and the target device parameter data corresponding to the main control board device with data synchronization is used as the data synchronization information corresponding to the main control board device with data synchronization.
5. The method according to claim 1, wherein The sensor data is parsed based on a preset data monitoring configuration format to obtain data monitoring information corresponding to the main control board device, including: Identify the device identification information in the sensor data based on the data monitoring configuration format, and determine the monitoring display number corresponding to the main control board device to which the device identification information belongs; identifying a monitoring data category in the sensor data based on the data monitoring configuration format, determining a monitoring data category group number corresponding to the monitoring display number, and treating the sensor data as verified sensor data if the monitoring data category matches the monitoring data category group number; Based on the data attributes of the verified sensor data, the verified sensor data is subjected to data unit analysis and data accuracy analysis to obtain data monitoring information corresponding to the main control board device, so as to display the data monitoring information through a preset display interface.
6. The method according to claim 1, characterized in that After constructing the data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device, the method further includes: Receive heartbeat packet data sent by the main control board device based on the corresponding communication address at a preset frequency; If it is detected that the target main control board device has not sent heartbeat packet data within a preset period of time, the connection state of the target main control board device is set to a disconnected state, and the communication address corresponding to the target main control board device is removed; Based on the disconnection state of the target main control board device, a status code and a warning level corresponding to the target main control board device are generated, so as to describe the disconnection state of the target main control board device in combination with the status code and the warning level.
7. The method according to claim 1, characterized in that After constructing the data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device, the method further includes: Before the main control board device is in a disconnected state, or when the main control board device detects that a sensor is abnormal, receiving fault detection data corresponding to the main control board device; Parsing the fault detection data based on a preset fault detection data format to obtain device identification information, fault code, and fault warning level corresponding to the fault detection data; Determining description information corresponding to the fault code in a preset database, and combining the description information with the device identification information to obtain fault description information corresponding to the main control board device; Based on the level window corresponding to the fault warning level, the fault description information corresponding to the main control board device is displayed.
8. A multi-main control board data interaction device, characterized in that: Applied to a control device, the device comprises: a detection module, configured to generate a device detection instruction and broadcast it on a preset CAN bus, determine a communication address corresponding to the CAN bus and a main control board device corresponding to the communication address based on a response status of the device detection instruction, and establish a data transmission channel between the CAN bus and the main control board device based on the communication address corresponding to the main control board device; a synchronization module, configured to generate a data synchronization instruction and send it to the main control board device based on the data transmission channel, receive device parameter data from the main control board device in response to the data synchronization instruction, parse the device parameter data based on a preset data synchronization format, and obtain data synchronization information corresponding to the main control board device; a data monitoring module, configured to generate a data monitoring instruction and send it to the main control board device based on the data transmission channel, receive sensor data from the main control board device in response to the data monitoring instruction, parse the sensor data based on a preset data monitoring configuration format, and obtain data monitoring information corresponding to the main control board device; The recording module is used to use the data transmission channel, the data synchronization information and the data monitoring information as the data interaction results corresponding to the main control board device and the control device based on the CAN bus communication mode.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.