Technology Center
The working principle and application of the heartbeat packet mechanism between the touch screen and the main control board of the charging pile
In the intelligent charging pile equipment, the touch screen (HMI human-machine interface) and the main control board are the two core software and hardware units. The touch screen undertakes interactive functions such as user operation, data display, parameter entry, and fault prompt. The main control board is responsible for core control tasks such as charging strategy execution, circuit control, data collection, and safety protection. The stable communication between the two is the foundation for the safe, reliable, and continuous operation of the charging pile. To address issues such as communication disconnection, program freezing, abnormal data synchronization, and difficulty in detecting hidden faults that occur during long-term operation of equipment, the industry generally adopts the heartbeat packet communication mechanism. As the core technology for link preservation, status self-checking, and abnormal fault tolerance between the touch screen and the main control board, it is the key to ensuring the stable coordination of human-machine interaction and equipment control in charging piles.
I. Core Definition and Design Significance of Heartbeat Packet Mechanism
A heartbeat packet is a periodic, lightweight, and fixed-format custom communication data packet. It is similar to the rhythm characteristics of a human heartbeat and is actively sent and received by both communication parties at preset time intervals to determine the smoothness of the communication link and the effectiveness of the device's working status in real time. Unlike charging parameters, fault data, start-stop instructions and other business data, heartbeat packets have no complex business meanings. They are only used for link detection and status synchronization, with extremely small data volume and very low bandwidth occupation, and will not affect normal business communication.
In the communication scenario between the touch screen of the charging pile and the main control board, the core significance of the heartbeat packet mechanism design mainly lies in three aspects. The first is link preservation. When industrial serial ports, CAN, Ethernet and other communication links have no data interaction for a long time, they are prone to be silently disconnected by network nodes. Periodic heartbeat transmission can maintain the link's permanent connection state and avoid the problem of idle disconnection. The second is real-time fault perception, which can quickly identify hidden faults such as communication disconnection, single-board freeze, and program freeze, making up for the lag of traditional passive fault detection. The third is equipment safety fault tolerance. When communication is abnormal, operation permissions are promptly locked, alarms are triggered, and the charging process is suspended to eliminate potential safety hazards such as misoperation, over-power charging, and failure to report faults caused by interaction failure, thereby enhancing the stability and safety of the charging pile's operation.
II. Communication Architecture of Charging Piles and Operating Environment of Heartbeat Packets
The mainstream smart charging piles adopt a hierarchical architecture of "touch screen + main control board", which operates independently and works in coordination with each other. Data interaction is completed through a standardized communication bus. Among them, the touch screen, as the slave device, mainly receives user operation instructions, synchronizes the operation data of the main control board, displays charging status, fault codes, battery level, voltage and current, and other information. The main control board serves as the primary device, coordinating the hardware operation of the equipment, feeding back real-time working conditions, responding to operation instructions from the touch screen, and performing core actions such as charging start and stop, overload protection, and leakage protection.
At present, the mainstream communication methods between the two are RS485 serial port, CAN bus and Ethernet communication. No matter which communication medium is adopted, a stable communication closed loop must be constructed relying on the heartbeat packet mechanism. Regular business data is transmitted in a triggered manner, only sent when the user operates or the device status changes. There is a long data gap period, and it cannot reflect the link status in real time. The heartbeat packet is actively transmitted at regular intervals, achieving all-weather monitoring of communication status and filling the gap of status detection during idle periods.
III. Core Working Principle and Interaction Process of Heartbeat Packet Mechanism
The heartbeat interaction between the touch screen of the charging pile and the main control board adopts a two-way verification mode of one question and one answer, with a fixed operation logic, parameter configuration and interaction process, forming a standardized communication self-check system.
1. Core parameter configuration (Industry General Standard
The stable operation of the heartbeat mechanism relies on precise parameter Settings. The industry-wide configuration is adapted to the industrial operation scenarios of charging piles: the heartbeat transmission interval is 1000-2000ms, that is, the device actively sends a heartbeat data packet once per second. The threshold for a single response timeout is 1500ms. If no response is received within this time limit, the single communication is considered abnormal. If the heartbeat times out for three consecutive times, it is determined that the communication link is completely disconnected, triggering the abnormal handling logic. This parameter combination takes into account both real-time detection performance and anti-interference ability. It neither occupies hardware resources due to excessively high detection frequencies nor leads to missed fault detections due to excessively low frequencies.
2. Complete interaction process
After the device is powered on and initialized, the touch screen and the main control board automatically start the heartbeat detection thread, and the entire process operates in a closed loop. The specific process is divided into three steps.
The first is to send packages at regular intervals. Usually, the touch screen serves as the heartbeat initiating end, sending fixed-format heartbeat data packets to the main control board at preset intervals. The data packets contain basic identifiers such as device address, check code, and heartbeat serial number to ensure the uniqueness and accuracy of the data.
The second is the response verification. The main control board listens in real time for communication data. After receiving a valid heartbeat packet, it immediately verifies the legitimacy of the data. Once the verification is passed, it quickly returns a response heartbeat packet and synchronously carries its current working status (normal/abnormal), completing a full heartbeat interaction.
The last step is the status determination. After receiving the response packet from the main control board, the touch screen determines that the link is normal and refreshes the communication status mark. If the response is not received on time, a timeout anomaly will be recorded. If there are three consecutive timeouts, the communication connection will be immediately determined to be disconnected. Conversely, the main control board will also synchronously detect the heartbeat signal of the touch screen, conducting two-way mutual detection to avoid the limitations of one-way detection.
Iv. Abnormal Heartbeat Packet Recognition and Fault-tolerant Processing Mechanism
As a special power equipment, the fault-tolerant handling of charging piles after communication anomalies is directly related to the safety of the equipment and the rights and interests of users. Based on the detection results of heart rate packets, the equipment can achieve hierarchical fault handling, eliminate safety risks, and ensure the stable operation of the equipment.
1. Instantaneous communication interference (single heartbeat timeout)
Outdoor operation of charging piles is prone to electromagnetic interference and voltage fluctuations. It is a normal phenomenon for a single heartbeat to be lost. The system does not immediately determine the fault. It only records abnormal logs and does not trigger alarms or shutdown operations. Normal heartbeat interactions can be automatically restored in the future, effectively avoiding misjudgment issues.
2. Persistent communication anomaly (multiple consecutive timeouts)
When there is no response to three or more consecutive heartbeats, the system determines that the communication link is faulty and immediately initiates the safety protection logic. The first is to lock the operation permission of the touch screen, prohibiting users from initiating charging, parameter modification and other operations to avoid the risk of loss of control caused by instructions not being synchronized. Second, stop the current charging operation, cut off the output circuit, and prevent the equipment from operating with faults. Thirdly, the fault code is recorded locally, and a pop-up window on the touch screen prompts "Communication anomaly". At the same time, the fault information is uploaded to the cloud background, which is convenient for operation and maintenance personnel to troubleshoot and repair. Fourth, some devices automatically attempt communication reconnection. Once the reconnection is successful, the equipment will automatically resume normal operation without the need for manual restart.
3. Fault identification of unilateral equipment
Bidirectional heartbeat detection can accurately distinguish fault points: If the touch screen continuously fails to receive a response from the main control board, it is determined that the main control board has crashed, the program is abnormal, or there is a hardware failure. If the main control board fails to receive the heartbeat from the touch screen, it is determined that the touch screen program is stuck or the circuit is loose, providing a clear basis for precise troubleshooting during operation and maintenance and significantly reducing the difficulty of maintenance.
V. Technical Advantages and Industry Value of the Heartbeat Packet Mechanism
1.Lightweight and low loss, compatible with embedded devices
The heartbeat packet data structure is simple and the size is small. The operation mode of timed transmission and reception occupies extremely low computing power and memory resources of the main control board and touch screen, fully adapting to the performance limitations of the embedded hardware of the charging pile, and will not affect the normal operation of core businesses such as charging control and data collection.
2. Proactively predict faults to enhance equipment reliability
Traditional equipment can only detect problems after user operation fails or equipment failure breaks out, which belongs to passive fault handling. The heartbeat packet mechanism achieves 7× 24-hour continuous active self-checking, which can detect hidden communication faults and hardware sub-health issues in advance, significantly reducing the equipment failure and downtime rate, and enhancing the continuous operation stability of the charging pile.
3. Improve the safety closed loop and comply with industry standards
Charging piles are classified as special equipment and have extremely high requirements for operational safety and fault tolerance. The abnormal heartbeat packet linkage shutdown, lock and alarm mechanism has established a complete equipment safety protection closed loop, effectively avoiding the charging loss of control, equipment damage and personal safety hazards caused by communication failure, and fully complies with the safety design standards of the intelligent charging pile industry.
4. Reduce operation and maintenance costs and enhance the level of intelligence
Precise fault location and log recording help operation and maintenance personnel quickly distinguish between communication faults, hardware faults, and program faults, reducing the time cost of blind troubleshooting. At the same time, fault data is synchronized in the cloud to achieve remote fault early warning and status monitoring, significantly enhancing the intelligent and efficient operation and maintenance level of charging piles.
VI. Summary
The heartbeat packet mechanism is the "health monitor" of the communication system between the touch screen of the charging pile and the main control board. With the technical advantages of lightweight, high real-time performance and high reliability, it has solved the communication stability problem between human-machine interaction and equipment control. Through periodic two-way interaction, precise fault determination, and hierarchical fault-tolerant processing, it ensures the effective synchronization of operation instructions for charging piles, real-time communication of operation status, and timely avoidance of fault risks from the bottom layer. As the core fundamental mechanism of the embedded system of intelligent charging piles, the heartbeat packet mechanism may seem simple, but it is a key technical support for the safe and stable operation of the equipment, enhancing user experience, and reducing operation and maintenance costs. It is widely applied in various AC and DC intelligent charging pile devices.
