Portable simulation car hook reconnection test device and control method

By using a portable simulated coupler coupling test device and control method, and employing priority hierarchical scheduling, dual mutual exclusion locks, and real-time state synchronization mechanisms, the problems of high resource consumption and poor safety in existing coupler coupling tests are solved, enabling efficient, safe, and standardized coupler coupling tests, thus improving test efficiency and safety.

CN121994517BActive Publication Date: 2026-08-04GUANGZHOU NANCHE CITY RAILS EQUIP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU NANCHE CITY RAILS EQUIP CO LTD
Filing Date
2026-04-09
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing rail transit vehicle coupler coupling tests suffer from problems such as high consumption of test resources, long preparation cycles, high manpower input, long fault location time, lack of safety interlocking mechanisms, and lack of priority protection in task scheduling. These issues result in low test efficiency and poor safety, failing to meet the requirements for efficient, safe, and standardized coupling tests.

Method used

A portable simulated coupler coupling test device is adopted, including a main control module, a power supply module, a data acquisition and output module, a command interaction module, and an HMI serial port screen module. Combined with a priority hierarchical scheduling mechanism, a dual mutual exclusion lock mechanism, and a real-time status synchronization mechanism, it can realize single-machine simulated coupler coupling, support visual real-time monitoring and rapid fault location, and ensure safety interlocking and rapid response to emergency commands.

Benefits of technology

It significantly saves test preparation time and resources, improves debugging efficiency, reduces troubleshooting time, avoids equipment damage risks, ensures test safety and operational portability, supports plug-and-play, and the portable simulated coupler coupling test device can draw power directly from the train, reducing the skill threshold for operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121994517B_ABST
    Figure CN121994517B_ABST
Patent Text Reader

Abstract

This invention discloses a portable simulated train coupler coupling test device and control method. The main control module of the device incorporates control logic for the test process, including a priority-based hierarchical scheduling mechanism, a dual mutual exclusion lock mechanism, and a real-time state synchronization mechanism. The control method includes: configuring the GPIO interface, UART communication, and mutual exclusion lock of the main control module; triggering operation commands based on the instruction interaction module and prioritizing the triggered operation commands; performing mutual exclusion adjudication on the currently executing operation commands based on the dual interlock safety state; constructing a real state mirror and synchronously updating the physical control points and virtual control points where state changes occur; and executing the input acquisition and output control of the coupled train level signals based on the acquisition and output module, and synchronously displaying the status information on the HMI serial port screen module. This invention's device is portable, easy to use, and has a low operating threshold, fully meeting the efficient and safe debugging requirements of rail transit vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rail transit technology, and in particular to a portable simulated coupler coupling test device and control method. Background Technology

[0002] In the whole-vehicle commissioning phase of rail transit metro, suburban railway, and locomotives and rolling stock, the coupler coupling function is a key performance indicator to ensure the safe operation of trains, and it must undergo rigorous functional verification and fault detection. Currently, the industry generally adopts the traditional test method of occupying the dynamic testing line and scheduling at least two actual trains for physical docking and electrical coupling. This method requires the prior completion of train transfer, line coordination, and multi-team cooperation preparation, which has problems such as high consumption of test resources, long preparation cycle, and high manpower input. At the same time, traditional tests lack a visual interface to monitor the status of input and output points in real time. Physical switches and interface displays are prone to inconsistencies due to communication delays or data packet loss. After a fault occurs, the line must be checked point by point across trains, which is time-consuming and inefficient. Manual operation is also prone to wiring errors and other derivative faults. In addition, traditional devices do not have a reliable safety interlock mechanism. There is a risk that mutually exclusive modes such as tool rescue and faulty car rescue can be activated simultaneously, which can easily cause electrical conflicts and equipment damage. In addition, the traditional polling mechanism has poor real-time performance and lacks priority protection for task scheduling, making it impossible to quickly respond to critical signals such as emergency stops. It is difficult to meet the requirements of efficient, safe, and standardized coupling tests for rail transit vehicles. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a portable simulated coupler coupling test device and control method. The device is portable, easy to use, and has a low operating threshold, fully meeting the high-efficiency and safe debugging requirements of rail transit vehicles.

[0004] This invention provides a portable simulated coupler coupling test device, which includes a main control module, a power supply module, a data acquisition and output module, a command interaction module, and an HMI serial port screen module;

[0005] The main control module is connected to the power supply module, the data acquisition and output module, the command interaction module, and the HMI serial port screen module. The main control module is an ESP32S3-N16R8 microcontroller. The main control module has built-in control logic for the test process. The control logic includes a priority hierarchical scheduling mechanism, a dual mutual exclusion lock mechanism, and a real-time status synchronization mechanism.

[0006] The power supply module includes a step-down power supply circuit, which is used to convert the output voltage of the coupled train to the working voltage of the test device.

[0007] The acquisition and output module includes several parallel acquisition and output circuits. The acquisition and output module is used to acquire the level signal of the coupled train and output the level signal to the coupled train.

[0008] The instruction interaction module is used to implement operation instruction interaction;

[0009] The HMI serial port screen module is connected to the main control module via serial communication. The HMI serial port screen module is used to display the status information during the test process.

[0010] The present invention also provides a control method for a portable simulated coupler coupling test device, the control method being implemented based on the aforementioned portable simulated coupler coupling test device, the control method comprising:

[0011] Connect the test device to the coupled train, and after the connection is completed, the power supply module powers on the main control module;

[0012] Configure the GPIO interface, UART communication, and mutex lock of the main control module;

[0013] Operation commands are triggered based on the command interaction module, and the triggered operation commands are prioritized.

[0014] The operation instructions are executed sequentially according to their priority, and mutual exclusion is determined for the operation instructions being executed based on the double interlock safety state;

[0015] Construct a real state mirror and synchronously update the physical control points and virtual control points in the real state mirror that have undergone state changes;

[0016] The acquisition and output module performs input acquisition and output control of the level signals of the coupled trains, and simultaneously displays the status information on the HMI serial port screen module.

[0017] Furthermore, connecting the test device to the coupled train includes:

[0018] Connect the power supply module of the test device to the power output point of the control host of the coupled train;

[0019] Connect the acquisition and output module of the test device to the coupler connector point of the coupled train;

[0020] Connect the command interaction module of the test device to the control hardware points of the coupled train.

[0021] Furthermore, the configuration of the main control module's GPIO interface, UART communication, and mutex lock includes:

[0022] Initialize and configure the input / output pins of the GPIO interface of the main control module;

[0023] Initialize the UART communication of the main control module;

[0024] Extract mutually exclusive functional patterns during the experiment, and define the relationship between mutually exclusive functional patterns as a mutex lock.

[0025] Furthermore, the step of triggering operation commands based on the command interaction module and prioritizing the triggered operation commands includes:

[0026] The operation command is triggered based on the command interaction module, and the corresponding operation task is generated.

[0027] Based on the preset priority classification criteria, the generated operation tasks are divided into high-priority tasks and low-priority tasks;

[0028] Prioritize executing high-priority tasks, and continue executing low-priority tasks after the high-priority tasks have been completed.

[0029] Furthermore, the mutual exclusion decision on the executing operation instructions based on the dual interlock safety state includes:

[0030] Define the flag bits for the first critical state and the second critical state respectively. The first critical state and the second critical state are mutually exclusive, and the priority of the first critical state is higher than the priority of the second critical state.

[0031] When the first key state is activated, the flag bit of the second key state is used to determine whether the second key state is active. If the second key state is active, the second key state is immediately terminated and the first key state is activated.

[0032] When activating the second key state, the system determines whether the first key state is active based on the flag of the first key state. If the first key state is active, the activation of the second key state is stopped immediately.

[0033] Furthermore, the construction of the real state mirror and the synchronous update of the physical control points and virtual control points in the real state mirror that have undergone state changes include:

[0034] Extract all physical and virtual control points during the experiment, and construct a real-state mirror based on the extracted physical and virtual control points;

[0035] Extract the previous cycle state cache array and the current cycle state cache array, and compare the previous cycle state cache array and the current cycle state cache array bit by bit;

[0036] When the rate of change in the comparison results exceeds the preset change threshold, the physical control point and virtual control point where the state change has occurred are identified, and the time difference between the current time and the last full synchronization time is monitored.

[0037] When the time difference exceeds a preset time threshold, the physical control points and virtual control points in the real state image that have undergone state changes are synchronously updated, and the corresponding full synchronization timestamps are updated.

[0038] Furthermore, the input acquisition and output control of the multiple-unit train level signal based on the acquisition and output module includes:

[0039] The acquisition and output module acquires the level signals of the coupled trains and transmits the acquired level signals to the main control module;

[0040] The main control module updates the acquired level signal based on the synchronous update status of the real state mirror, and transmits the updated level signal back to the acquisition output module;

[0041] The acquisition and output module will output the updated and processed level signal to the coupled train.

[0042] Furthermore, the synchronous display of status information on the HMI serial port screen module includes:

[0043] The main control module transmits the synchronous update status information of the real state image to the HMI serial screen module for display via serial communication. The serial communication transmission frames are marked with delimiters, and the frame structure consists of [frame header identifier] + [data field] + [frame tail identifier].

[0044] Furthermore, the control method also includes:

[0045] After the test device is powered on, a central mirror is constructed based on the initial state of the test device, and the health of the communication link of the test device is continuously monitored. When it is determined that the communication link is abnormal, the test device is forced to synchronize its state so that the state of the test device is restored to be completely consistent with the central mirror.

[0046] This invention provides a portable simulated coupler coupling test device and control method. By adopting a portable single-machine simulation architecture, a dual interlocking safety mechanism, real-time status synchronization, and a priority-based hierarchical scheduling strategy, it effectively solves many shortcomings of existing coupling tests. A single machine can replace two trains to complete the test, significantly saving train, track, and manpower costs, and significantly shortening test preparation and total time, thus improving debugging efficiency. With the help of HMI visualization real-time monitoring and incremental status synchronization, it achieves intuitive display of IO point status and rapid fault location, greatly reducing fault troubleshooting time. Through dual flag interlocking and the highest priority arbitration of hardware signals, it completely avoids conflicts between tooling rescue and faulty car rescue modes, eliminating the risk of electrical damage and improving test safety. At the same time, it optimizes task scheduling and communication mechanisms to ensure rapid response to emergency commands and high consistency in status display. The device can directly draw power from the train, is plug-and-play, highly portable, and lowers the skill threshold for operation. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a structural diagram of the portable simulated coupler reconnection test device in Embodiment 1 of the present invention;

[0049] Figure 2 This is a schematic diagram of the electrical principle of the step-down power supply circuit in Embodiment 1 of the present invention;

[0050] Figure 3 This is a schematic diagram of the electrical principle of the acquisition and output circuit in Embodiment 1 of the present invention;

[0051] Figure 4 This is a schematic diagram of the electrical principle of the HMI serial port screen control circuit in Embodiment 1 of the present invention;

[0052] Figure 5 This is a flowchart of the control method for the portable simulated coupler reconnection test device in Embodiment 2 of the present invention;

[0053] Figure 6 This is a flowchart of prioritizing operation instructions in Embodiment 2 of the present invention;

[0054] Figure 7 This is a flowchart of mutual exclusion decision based on dual interlocking security state in Embodiment 2 of the present invention;

[0055] Figure 8This is a flowchart of synchronously updating the real state image in Embodiment 2 of the present invention. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] In this invention, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, portions or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, figures, steps, behaviors, components, portions or combinations thereof are present or added.

[0058] It should also be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0059] In the traditional commissioning of rail transit vehicles, the verification and fault detection of the coupler coupling function face multiple technical challenges. Traditional testing methods rely on occupying the dynamic testing line and scheduling at least two actual trains for physical docking and electrical coupling, leading to increased consumption of test resources, extended preparation time, and increased manpower. Furthermore, the lack of a visual interface for real-time monitoring of input and output point status causes inconsistencies between physical switches and interface displays due to communication delays or data loss. After a fault occurs, the line must be checked point by point across trains, resulting in prolonged fault location time, reduced troubleshooting efficiency, and derivative faults such as wiring errors caused by manual operation. Simultaneously, traditional devices lack reliable safety interlocking mechanisms, and there is a risk of simultaneous activation of mutually exclusive modes such as tooling rescue and faulty train rescue, causing electrical conflicts and equipment damage. In addition, the traditional polling mechanism has poor real-time performance and lacks priority protection in task scheduling, making it unable to quickly respond to critical signals such as emergency stops, and failing to meet the requirements of efficient, safe, and standardized coupling tests. For example, when verifying the coupler coupling function in a subway depot, it is necessary to coordinate dynamic testing line resources in advance and schedule two actual trains for physical docking. During testing, operators discovered a discrepancy between the physical switch status of the control unit and the monitoring system display, leading to errors in the execution of operational commands. When communication failures occurred, each coupler connector point needed to be checked, a time-consuming process that could introduce new errors. Furthermore, during the simulated tooling rescue mode, the lack of a safety interlock mechanism caused the faulty vehicle rescue mode to activate unexpectedly, resulting in electrical system conflicts and equipment damage.

[0060] If the above problems are not resolved, the reliability of the coupler coupling test will be affected, potentially leading to safety risks during train operation. Excessive consumption of testing resources will prolong the overall vehicle commissioning cycle and increase operating costs. Inefficient fault location not only extends downtime but may also cause secondary faults due to operational errors. The lack of a safety interlock mechanism means the risk of simultaneous activation of mutually exclusive modes persists, potentially causing equipment damage and threatening personnel safety. Inadequate task scheduling mechanisms will fail to guarantee timely response to emergency signals, further exacerbating safety hazards.

[0061] Example 1

[0062] Embodiment 1 of the present invention provides a portable simulated coupler coupling test device, the test device including a main control module, a power supply module, a data acquisition and output module, a command interaction module and an HMI serial port screen module;

[0063] The main control module is connected to the power supply module, the data acquisition and output module, the command interaction module, and the HMI serial port screen module. The main control module is an ESP32S3-N16R8 microcontroller. The main control module has built-in control logic for the test process. The control logic includes a priority hierarchical scheduling mechanism, a dual mutual exclusion lock mechanism, and a real-time status synchronization mechanism.

[0064] The power supply module includes a step-down power supply circuit, which is used to convert the output voltage of the coupled train to the working voltage of the test device.

[0065] The acquisition and output module includes several parallel acquisition and output circuits. The acquisition and output module is used to acquire the level signal of the coupled train and output the level signal to the coupled train.

[0066] The instruction interaction module is used to implement operation instruction interaction;

[0067] The HMI serial port screen module is connected to the main control module via serial communication. The HMI serial port screen module is used to display the status information during the test process.

[0068] In one optional implementation of this embodiment, such as Figure 1 As shown, Figure 1 The diagram shows the structure of the portable simulated coupler coupling test device according to Embodiment 1 of the present invention. The test device includes a main control module, a power supply module, a data acquisition and output module, a command interaction module, and an HMI serial port screen module. The main control module is connected to the power supply module, the data acquisition and output module, the command interaction module, and the HMI serial port screen module.

[0069] Specifically, the portable simulated coupler coupling test device in this embodiment comprises a main control module, a power supply module, a data acquisition and output module, a command interaction module, and an HMI serial port screen module. These modules work together to simulate and test the coupler coupling function of coupled trains. The main control module, as the central processing unit, is responsible for coordinating the operation of other modules; the power supply module provides energy to the entire device; the data acquisition and output module is responsible for signal interaction with external trains; the command interaction module receives user input; and the HMI serial port screen module provides a visual interface.

[0070] In an optional implementation of this embodiment, the main control module is an ESP32S3-N16R8 microcontroller, and the main control module has built-in control logic for the test process. The control logic includes a priority hierarchical scheduling mechanism, a dual mutex lock mechanism, and a real-time state synchronization mechanism.

[0071] Specifically, the main control module uses an ESP32S3-N16R8 microcontroller, which has built-in control logic for simulating coupler coupling experiments. It includes three parts: a priority hierarchical scheduling mechanism, a dual mutual exclusion lock mechanism, and a real-time state synchronization mechanism.

[0072] In an optional implementation of this embodiment, the power supply module includes a step-down power supply circuit, which is used to convert the output voltage of the coupled train to the operating voltage of the test device.

[0073] Specifically, the ESP32S3-N16R8 microcontroller used in the main control module has a rated power supply voltage of 5V. Therefore, a step-down power supply circuit is required to reduce the output voltage of the coupled train to 5V to power the main control module.

[0074] Furthermore, such as Figure 2 As shown, Figure 2 The diagram shows the electrical principle of the step-down power supply circuit in Embodiment 1 of the present invention. The step-down power supply circuit includes a power chip U1, resistors R1, R3, R4, R5, R6, a sliding rheostat N2, capacitors C1, C2, C3, C4, C5, C6, a diode D1, and an inductor L1.

[0075] The power chip U1 is an MP1584EN power chip, and pin 1 of the power chip U1 is connected to the first terminal of the inductor L1, the first terminal of the capacitor C1, and the cathode of the diode D1.

[0076] Pin 2 of the power chip U1 is connected to the first end of the resistor R1 and the first end of the resistor R3;

[0077] Pin 3 of the power chip U1 is connected to the first terminal of the capacitor C6;

[0078] Pin 4 of the power chip U1 is connected to the first end of the sliding rheostat N2 and the first end of the resistor R4;

[0079] Pin 6 of the power chip U1 is connected to the first end of the resistor R5.

[0080] Pin 7 of the power chip U1 is connected to the second terminal of the resistor R1, the first terminal of the capacitor C3, and the first terminal of the capacitor C2.

[0081] Pin 8 of the power chip U1 is connected to the second terminal of the capacitor C1;

[0082] The second end of the inductor L1 is connected to the first end of the capacitor C4, the first end of the capacitor C5, and the second end of the sliding rheostat N2;

[0083] The second terminal of capacitor C6 is connected to the first terminal of resistor R6;

[0084] Pins 5 and 9 of the power chip U1, the anode of the diode D1, the second terminal of the capacitor C2, the second terminal of the capacitor C3, the second terminal of the capacitor C4, the second terminal of the capacitor C5, the second terminal of the resistor R5, the second terminal of the resistor R6, the second terminal of the resistor R4, and the second terminal of the resistor R3 are grounded.

[0085] Furthermore, the power chip U1 uses the MP1584EN power chip, which is a high-frequency buck switching regulator with an integrated internal high-voltage side high-voltage power MOSFET. It can provide a 3A output with current-mode control, including a wide input range of 5V-28V, and a 100uA operating quiescent current. In this embodiment, it is set in the buck power supply circuit to step down the 24V voltage input from the coupled train to 5V for powering the microcontroller of the main control module.

[0086] In an optional implementation of this embodiment, the acquisition and output module includes several parallel acquisition and output circuits, which are used to acquire the level signals of the coupled trains and output level signals to the coupled trains.

[0087] Specifically, the acquisition and output module includes ten parallel acquisition and output circuits, which simultaneously acquire the 110V level signal of the coupled train and can simultaneously output a 110V level signal to the coupled train, realizing the interaction of the level signals between the test device and the coupled train, thereby realizing data interaction and test control.

[0088] Furthermore, such as Figure 3 As shown, Figure 3 The following is a schematic diagram of the electrical principle of the acquisition and output circuit in Embodiment 1 of the present invention. Figure 3 The diagram shows the electrical schematic of one of the acquisition and output circuits. The electrical structures of the other acquisition and output circuits are exactly the same. Each acquisition and output circuit specifically consists of two parts: an input circuit and a signal output circuit.

[0089] The input acquisition section includes resistors R89 and R90, diodes D39 and D49, optocoupler U7, resistors R91 and R92. The first end of resistor R89 ​​is connected to the input terminal IN9 of the multiple-unit train level signal. The second end of resistor R89 ​​is connected to the first end of resistor R90 and the cathode of diode D39. The anode of diode D39 is connected to the cathode of diode D49 and to the first end of optocoupler U7. The third end of optocoupler U7 is connected to the first ends of resistors R91 and R92. The fourth end of optocoupler U7 is connected to the I / O port of the microcontroller of the main control module.

[0090] The signal output section includes resistors R110 and R119, LED11, capacitor C44, resistor R87, transistor Q11, relay RLY9, resistor R88, capacitor C45, and diode D38. Resistors R110, R119, LED11, capacitor C44, and resistor R87 are connected to the base and emitter of transistor Q11. The collector of transistor Q11 is connected to the third terminal of relay RLY9. Resistors R88, capacitor C45, and diode D38 are connected to the second and fifth terminals of relay RLY9.

[0091] Furthermore, any one of the acquisition and output circuits acquires the input level signal of the coupled train through the optocoupler U7 (model PC355NJ0000F), converts the current signal into a 3.3V voltage, and feeds it back to the input I / O port of the microcontroller of the main control module. After processing the level signal, the main control module outputs an I / O signal to the transistor Q11 through the output I / O port, which drives the MMBT2222A transistor Q11 to activate the relay RLY9, and outputs a DC110 level signal to the coupled train through the diode and fuse.

[0092] The acquisition and output circuit also includes a fuse F9, which is connected between the acquisition input section and the output control section of the acquisition and output circuit.

[0093] In an optional implementation of this embodiment, the instruction interaction module is used to implement operation instruction interaction.

[0094] Specifically, the instruction interaction module is mainly used to input operation instructions, and various human-computer interaction methods can be used for instruction input.

[0095] In an optional implementation of this embodiment, the HMI serial port screen module and the main control module are connected via serial communication, and the HMI serial port screen module is used to display the status information of the test process.

[0096] Specifically, the HMI serial port screen module includes an HMI serial port screen and an HMI serial port screen control circuit. The HMI serial port screen is used to display the status information of the test process, and the structure of the HMI serial port screen control circuit is as follows: Figure 4 As shown, Figure 4 The diagram shows the electrical principle of the HMI serial port screen control circuit in Embodiment 1 of the present invention. The HMI serial port screen control circuit includes a four-pin HMI serial port screen connection serial port CN4, which consists of four pins: current source pin 1, ground pin 4, TX pin 2, and RX pin 3. TX pin 2 serves as the transmitting pin and is connected to the receiving pin GPIO17 of the microcontroller of the main control module. RX pin 3 serves as the receiving pin and is connected to the transmitting pin GPIO18 of the microcontroller of the main control module. Together, they realize the data transmission of the HMI serial port screen.

[0097] In an optional implementation of this embodiment, the main control module further includes a PIS control unit. The PIS control unit receives PIS system data from the coupled train via RS485 and UIC568 ​​buses, converts the received PIS system data into Ethernet signals, and transmits them to the speakers, microphones, and broadcast control box in the driver's cab of the coupled train, thereby realizing full-duplex intercom and passenger cab broadcast functions between the test device and the coupled train.

[0098] In summary, Embodiment 1 of this invention provides a portable simulated coupler coupling test device. By adopting a portable single-machine simulation architecture, a dual interlocking safety mechanism, real-time status synchronization, and a priority-based hierarchical scheduling strategy, it effectively solves many shortcomings of existing coupling tests. A single machine can replace two trains to complete the test, significantly saving train, track, and manpower costs, significantly shortening test preparation and total time, and improving debugging efficiency. With the help of HMI visualization real-time monitoring and incremental status synchronization, it achieves intuitive display of IO point status and rapid fault location, significantly reducing fault troubleshooting time. Through dual flag interlocking and the highest priority arbitration of hardware signals, it completely avoids conflicts between tooling rescue and faulty car rescue modes, eliminating the risk of electrical damage and improving test safety. At the same time, it optimizes task scheduling and communication mechanisms to ensure rapid response to emergency commands and high consistency in status display. The device can directly draw power from the train, is plug-and-play, highly portable, and lowers the skill threshold for operation.

[0099] Example 2

[0100] Embodiment 2 of the present invention provides a control method for a portable simulated coupler coupling test device. The control method is based on the portable simulated coupler coupling test device in Embodiment 1, and includes:

[0101] Connect the test device to the coupled train, and after the connection is completed, the power supply module powers on the main control module;

[0102] Configure the GPIO interface, UART communication, and mutex lock of the main control module;

[0103] Operation commands are triggered based on the command interaction module, and the triggered operation commands are prioritized.

[0104] The operation instructions are executed sequentially according to their priority, and mutual exclusion is determined for the operation instructions being executed based on the double interlock safety state;

[0105] Construct a real state mirror and synchronously update the physical control points and virtual control points in the real state mirror that have undergone state changes;

[0106] The acquisition and output module performs input acquisition and output control of the level signals of the coupled trains, and simultaneously displays the status information on the HMI serial port screen module.

[0107] In one optional implementation of this embodiment, such as Figure 5 As shown, Figure 5 A flowchart illustrating the control method of the portable simulated coupler coupling test device according to Embodiment 2 of the present invention is shown, including the following steps:

[0108] S501. Connect the test device to the coupled train. After the connection is completed, the power supply module powers on the main control module.

[0109] In an optional implementation of this embodiment, connecting the test device to the coupled train includes:

[0110] Connect the power supply module of the test device to the power output point of the control host of the coupled train;

[0111] Connect the acquisition and output module of the test device to the coupler connector point of the coupled train;

[0112] Connect the command interaction module of the test device to the control hardware points of the coupled train.

[0113] Specifically, firstly, the control host of the coupled train needs to be connected to 110V for power supply. Then, a hard wire is used to connect the 24V output power point of the control host to the power supply module of the test device. When the test device starts working, the step-down power supply circuit in the power supply module will step down the 24V power supply to 5V power supply for the main control module to work.

[0114] Next, the multi-channel acquisition and output circuit in the acquisition and output module of the test device is connected to the coupler connector of the coupled train to acquire the level signal of the coupled train at any time and output the level signal to the coupled train.

[0115] Finally, the instruction interaction module of the test device is connected to the control hardware points of the coupled train, specifically including hardware devices such as coupler connectors, circuit boards, broadcast control boxes, speakers, and microphones.

[0116] In addition, the HMI serial port screen module and PIS circuit of the main control module are connected to the HMI serial port screen.

[0117] Furthermore, after completing the connection between the test device and the coupled train, the power supply module of the test device began to power on the main control module.

[0118] The above technical solution establishes a comprehensive, reliable, and standardized physical connection between the test device and the coupled train. This connection ensures that the test device can stably obtain operating power, accurately acquire the voltage levels of the coupled train and output analog signals, and effectively interact with the control hardware of the coupled train. This significantly improves the realism and accuracy of the test device in simulating coupled train coupling, avoiding problems such as signal interference, data loss, or functional failure caused by unstable or mismatched connections. This guarantees the reliability of the test results and provides a solid foundation for subsequent control logic execution and state synchronization.

[0119] S502, Configure the GPIO interface, UART communication and mutex lock of the main control module;

[0120] In an optional implementation of this embodiment, the configuration of the main control module's GPIO interface, UART communication, and mutex lock includes:

[0121] Initialize and configure the input / output pins of the GPIO interface of the main control module;

[0122] Initialize the UART communication of the main control module;

[0123] Extract mutually exclusive functional patterns during the experiment, and define the relationship between mutually exclusive functional patterns as a mutex lock.

[0124] Specifically, the initialization of the GPIO interface of the main control module sets the input and output pins, and the initialization of the UART communication of the main control module are performed, that is, the initialization of the connection interface and communication interface of the main control module is performed, specifying the interface for the main control module to communicate with other modules.

[0125] Furthermore, in this embodiment, we consider extracting mutually exclusive functional modes during the experiment and defining each group of mutually exclusive functional modes as a mutual exclusion lock relationship. For example, for the "tooling rescue" mode and the "failure rescue" mode applied to the coupled train in this embodiment, these two modes are defined as a mutual exclusion lock relationship.

[0126] It should be noted that the core objective of setting up a mutual exclusion lock is to ensure that mutually exclusive electrical output modes can never be effective simultaneously. By defining conflicting logical states, such as the "tool rescue" mode and the "failure rescue" mode of a coupled train, these two modes are mutually exclusive functional modes, set as electrical modes that cannot be effective simultaneously. Through subsequent mutual exclusion adjudication mechanisms, conflicts at the logical source are prevented from causing errors.

[0127] The above technical solutions effectively solve the system instability and functional conflicts caused by insufficient initial configuration of the main control module. Precise initialization of the GPIO interface ensures the accuracy and reliability of level signal acquisition and output between the main control module and the coupled train, avoiding misjudgments or misoperations due to incorrect pin configuration. Initialization of UART communication establishes a stable and efficient communication link between the main control module and the HMI serial port module, guaranteeing real-time and accurate display of test status information and enhancing user control over the test process. Crucially, by pre-extracting and defining the mutex lock relationships between mutually exclusive function modes, a solid foundation is provided for the main control module's built-in priority-level scheduling mechanism and dual mutex lock mechanism, fundamentally eliminating resource competition and operational conflicts between key functions and significantly improving the safety and stability of the test device in complex operating environments. This enables the entire portable simulated coupler coupling test device to operate in a highly reliable and safe environment, thereby ensuring the accuracy and validity of the test results.

[0128] S503. Trigger operation commands based on the command interaction module and prioritize the triggered operation commands;

[0129] In one optional implementation of this embodiment, by hierarchically scheduling the operation tasks corresponding to different internal operation instructions, it is ensured that the operator's emergency control instructions with higher importance can receive an immediate response.

[0130] Specifically, such as Figure 6 As shown, Figure 6 The flowchart illustrating the priority division of operation instructions in Embodiment 2 of the present invention is shown, including the following steps:

[0131] S601. Trigger operation commands based on the command interaction module and generate operation tasks corresponding to the operation commands;

[0132] In one optional implementation of this embodiment, an operation command is input based on the command interaction module, and after the operation command is triggered, an operation task corresponding to the operation command is generated.

[0133] S602. According to the preset priority division criteria, the generated operation tasks are divided into high-priority tasks and low-priority tasks.

[0134] In one optional implementation of this embodiment, various operation tasks are divided into different priorities according to their urgency based on a preset priority division standard. Among them, operation tasks that receive and process operation instructions input by the instruction interaction module are given high priority, while routine tasks such as periodic monitoring and processing are set to low priority.

[0135] Specifically, high-priority tasks are usually UART communication tasks, which are mainly responsible for the external communication interface, receiving instructions and providing status feedback. They have high real-time requirements, need to respond quickly to user operations, continuously monitor serial port data, and are used to parse control instructions sent by the human-machine interface, process mode switching requests, send status synchronization instructions, and handle emergency stop commands, among other scenarios.

[0136] Low-priority tasks are typically routine monitoring tasks, including monitoring tasks of the main control module's GPIO interface. These tasks are mainly responsible for hardware status monitoring and synchronization, and are periodically executed monitoring tasks such as collecting GPIO input status, executing incremental synchronization algorithms, detecting faulty vehicle rescue signals, and maintaining status caches and timestamps.

[0137] S603. Prioritize the execution of high-priority tasks, and continue the execution of low-priority tasks after the high-priority tasks have been completed.

[0138] In an optional implementation of this embodiment, based on the hierarchical classification in step S602, the execution of the highest priority task is always prioritized at any time. If a high priority task is triggered while a low priority task is being executed, the low priority task is immediately terminated, and the high priority task is then executed. The low priority task is then processed according to the actual redundancy.

[0139] It should be noted that this means that when an operator issues a high-priority emergency command (such as stopping the test) through the command interaction module, even if the test device is performing a regular low-priority task, the regular low-priority task will be immediately interrupted and the high-priority emergency command will be responded to.

[0140] The above technical solution effectively addresses the critical operational delays that may occur when multiple commands are executed concurrently in the control method of a portable simulated train coupler coupling test device. By prioritizing operational commands and ensuring that high-priority tasks are executed first, the system can respond promptly to urgent or critical operational commands, significantly improving the real-time performance and safety of the test process. This is particularly important for scenarios like simulating coupled trains, which require extremely high operational precision and response speed. It avoids deviations in test results or potential risks caused by improper command processing order, thereby ensuring the accuracy and reliability of the simulation test.

[0141] S504. Execute the operation instructions after priority division in sequence, and make mutual exclusion decisions on the operation instructions being executed based on the double interlock safety state;

[0142] In one optional implementation of this embodiment, the executing operation instructions are mutually exclusive based on the dual interlock safety state. That is, the dual mutual exclusion lock mechanism built into the main control module is used to ensure that the two mutually exclusive state modes are not activated at the same time through two independent status flag bits and their mutual exclusion logic relationship, thereby fundamentally preventing the risk of equipment damage caused by electrical system conflicts.

[0143] Specifically, such as Figure 7 As shown, Figure 7 The flowchart illustrating mutual exclusion decision based on dual interlocking security state in Embodiment 2 of the present invention is shown, including:

[0144] First, the flag bits for the first critical state and the flag bits for the second critical state are defined respectively. In this embodiment, the "tooling rescue" mode and the "breakdown vehicle rescue" mode are used as examples for explanation. The "tooling rescue" mode and the "breakdown vehicle rescue" mode are mutually exclusive, and the "breakdown vehicle rescue" mode has a higher priority than the "tooling rescue" mode.

[0145] Define the "tool rescue" flag as gzjy and the "breakdown vehicle rescue" flag as gzcjy. When the flag is logic "0", it indicates that it is not active, and when the flag is logic "1", it indicates that it is active.

[0146] "Tooling Rescue" mode activation method: Receive a specific instruction frame sent by the main control module;

[0147] The "Faulty Vehicle Rescue" mode is activated by monitoring the level changes of the corresponding GPIO pins of the main control module. It is triggered when a transition from a high level to a low level is detected.

[0148] Next, establish two-level interlocking determination rules, where:

[0149] The first level of determination involves determining whether the second key state is active based on the flag of the second key state when the first key state is activated. If the second key state is active, the second key state is immediately terminated and the first key state is activated.

[0150] Specifically, when the "Disabled Vehicle Rescue" mode is activated, the flag bit gzcjy is immediately set to 1, and the logical state of the flag bit gzjy is judged. If gzjy==1 (indicating that the "Tooling Rescue" mode is activated), a conflict is triggered and the mutual exclusion arbitration process is started. If gzjy==0, the "Disabled Vehicle Rescue" mode is triggered immediately.

[0151] The second level of determination involves determining whether the first key state is active based on the flag of the first key state when activating the second key state. If the first key state is active, the activation of the second key state is immediately stopped.

[0152] Specifically, when the "Tooling Rescue" mode is activated, the logic state of the flag gzcjy is checked. If gzcjy==1 (indicating that the "Disabled Vehicle Rescue" mode is activated), the triggering of the "Tooling Rescue" mode is immediately stopped. If gzcjy==0, the "Tooling Rescue" mode is triggered.

[0153] Finally, in the first-level judgment, the mutual exclusion decision process is initiated. That is, when both flag bits are in the logical state "1" at the same time, the flag bit of the "tooling rescue" mode is cleared to zero (gzjy=0), and all tooling rescue related output channels are closed in sequence, the human-machine interface display state is reset to the initial state, and the conflict warning page is redirected to display the prompt information.

[0154] Furthermore, in step S502, since mutually exclusive functional modes are defined as mutex locks, in this step, an independent logical flag is set for each group of mutually exclusive functional modes, which together constitute the global state of the device. Mutual exclusion is then determined based on the global logical state flag bits for mode activation. When a mode is requested to be activated, it is first checked whether this mode is logically mutually exclusive with the currently activated mode. In this embodiment, the "tooling rescue" mode and the "failure vehicle rescue" mode are examples. If mutual exclusion exists (i.e., the requested mode and the currently activated mode are mutually exclusive), the request is immediately rejected, thereby preventing conflict at the logical source. After the software outputs the decision result, a hardware signal is finally output for forced arbitration.

[0155] By continuously monitoring the level signals from the coupled trains through the acquisition output circuit, and monitoring the signals that represent the true intention of the coupled trains, when the signal representing the true intention of the coupled trains is in a high-priority mode (such as the "failure rescue" mode), the highest-priority arbitration process is initiated: any mode mutually exclusive with the high-priority mode is unconditionally canceled, and the relevant electrical outputs are immediately cut off. This process is mandatory and has the highest priority, realizing the final decision of hardware signals on software logic.

[0156] Through the above technical solution, the test device can effectively avoid the simultaneous activation of mutually exclusive critical operations when executing operation commands, thereby significantly improving the safety and reliability of the test process. This dual interlocking safety state mechanism, through clear priority settings and conflict resolution rules, ensures that the system is in a definite and safe operating mode at all times, effectively preventing abnormal test data or equipment operation risks that may be caused by operation conflicts. This is especially important for application scenarios with extremely high safety requirements, such as simulating coupler coupling.

[0157] S505. Construct a real state mirror and synchronously update the physical control points and virtual control points in the real state mirror that have undergone state changes.

[0158] In one optional implementation of this embodiment, a unified real-state mirror is constructed for all physical and virtual control points that need to be synchronized during the experiment. When the state of physical and virtual control points changes, these physical and virtual control points that have changed state need to be synchronously updated in the real-state mirror. Here, physical control points refer to level signals, and a change in the state of physical control points means a change in the level signal. A change in the state of virtual control points usually refers to an operation command manually triggered by the operator, which results in a change in the operation task.

[0159] Specifically, such as Figure 8 As shown, Figure 8 The flowchart illustrating the synchronous update of the real-state image in Embodiment 2 of the present invention is shown, including the following steps:

[0160] First, all physical control points and virtual control points are extracted during the experiment, and a real-state mirror is constructed based on the extracted physical control points and virtual control points.

[0161] Next, extract the previous cycle state cache array and the current cycle state cache array, and compare the previous cycle state cache array and the current cycle state cache array bit by bit.

[0162] Specifically, the previous cycle state cache array and the current cycle state cache array are extracted. A dual-cache data structure is established, including the previous cycle state cache array last_states

[10] , which stores the previous synchronization cycle state of the 9 GPIO interfaces in the microcontroller of the main control module, and the current cycle state cache array current_states

[10] , which stores the currently collected GPIO interface state. Each state element occupies 1 byte, and the dual-cache data structure occupies a total of 20 bytes of memory space.

[0163] Furthermore, the status of all GPIO structures is read in batches at fixed time intervals (100ms). The batch reading is performed in each acquisition cycle, and the reading results are stored in the corresponding position of the current_states array. The acquisition timestamp t_collect is also recorded. Subsequently, the status cache array of the current cycle is compared bit by bit with the status cache array of the previous cycle to detect GPIO interface channels whose status has changed, and debouncing is performed to eliminate instantaneous interference.

[0164] Then, when the rate of change in the comparison results exceeds the preset change threshold, the physical control point and virtual control point where the state change has occurred are determined, and the time difference between the current time and the last full synchronization time is monitored.

[0165] Specifically, when the comparison results indicate a difference, if the rate of change in the comparison results exceeds the preset change threshold, the physical control point and virtual control point where the state change has occurred are identified, and the time difference between the current time and the last full synchronization time is monitored.

[0166] Furthermore, for each confirmed change in state, a corresponding display update instruction is generated and sent to the HMI serial port screen. The next channel is processed without waiting for a response. After successful transmission, the state cache of the previous cycle is updated: last_states[i] = current_states[i].

[0167] Finally, when the time difference between the current time and the last full synchronization time exceeds the preset time threshold (2000ms), the physical control points and virtual control points in the real state image that have been determined to have undergone state changes are synchronized and updated, that is, a full synchronization update is performed, and the full synchronization timestamp is updated accordingly.

[0168] This system employs a dual-buffering structure and a timestamp mechanism to achieve highly reliable synchronization between hardware input states and the HMI serial port display. A strategy combining incremental change detection and periodic forced refresh ensures the real-time performance and accuracy of state synchronization, efficiently and accurately maintaining the true state mirror. The rate-of-change-based synchronization update mechanism allows the system to quickly respond to instantaneous changes in critical states, avoiding unnecessary full synchronization operations. This significantly reduces the computational burden and communication bandwidth consumption of the main control module, improving system resource utilization efficiency. Simultaneously, the time-difference-based full synchronization mechanism effectively solves the problem of accumulated deviations between the mirror and actual states that may occur when state changes are infrequent, ensuring the eventual consistency and long-term reliability of the true state mirror. This combination of dual synchronization strategies provides highly real-time and accurate state data support for the main control module's priority-based scheduling mechanism and dual mutex lock mechanism, thereby improving the control accuracy and operational stability of the entire experimental setup and ensuring the authenticity and effectiveness of the multiple-unit train simulation test.

[0169] S506. Based on the acquisition and output module, the input acquisition and output control of the level signal of the coupled train are performed, and the status information is displayed synchronously on the HMI serial port screen module.

[0170] In one optional implementation of this embodiment, the acquisition output module acquires the level signal of the coupled train and transmits the acquired level signal to the main control module;

[0171] The main control module updates the acquired level signal based on the synchronous update status of the real state mirror, and transmits the updated level signal back to the acquisition output module;

[0172] The acquisition and output module will output the updated and processed level signal to the coupled train.

[0173] Specifically, regarding the state synchronization mechanism in step S505, it does not periodically repeat the transmission of all information. Instead, it is driven by changes in the real state mirror. When the state of a certain point in the mirror changes, only an instruction containing the change information of that point is generated and sent to the end that needs to be updated (the output control part of the HMI serial port display or the acquisition output circuit). That is, the main control module performs state synchronization on the physical control point or virtual control point corresponding to the synchronization update status of the real state mirror in the acquired level signal, rather than performing state synchronization on the entire level signal. After processing, it outputs back to the reconnected train to complete the state synchronization. This avoids the transmission of redundant information and significantly improves communication efficiency and real-time performance.

[0174] In an optional implementation of this embodiment, the synchronous display of status information on the HMI serial port screen module includes:

[0175] The main control module transmits the synchronous update status information of the real state image to the HMI serial screen module for display via serial communication. The serial communication transmission frames are marked with delimiters, and the frame structure consists of [frame header identifier] + [data field] + [frame tail identifier].

[0176] Specifically, this embodiment uses a serial communication protocol marked with delimiters, which has a clear structure, is easy to parse and verify, and ensures the reliability of data transmission. The specific frame structure includes:

[0177] The first frame is defined as 0x55. The first byte after that is the interface ID, the second byte is the button ID, and the third byte is the button status. The process continues until three consecutive bytes of 0xFF are received as the last frame, which indicates that a serial port data transmission is complete.

[0178] The field definitions include: Interface ID definition (first byte of the data field): 0x01: IO control interface; 0x02: PIS broadcast interface; 0x03: Enter IO interface command; 0x04: Exit IO interface command.

[0179] Button state definition (data field 3rd byte): 0x01: Button active / pressed state; 0x02: Button released / closed state.

[0180] Furthermore, a frame integrity verification mechanism is set up. The total length of each frame is 6 bytes. The receiving end verifies the frame integrity by detecting the fixed identifiers in the frame header and frame tail. The three consecutive 0xFFs in the frame tail ensure that they are clearly distinguished from the data fields to avoid misjudgment.

[0181] For example, the specific instruction frame format activated by the "Tooling Rescue" mode is: 0x55 0x01 0x01 0xFF 0xFF0xFF.

[0182] In an optional implementation of this embodiment, the serial communication transmission frame format further includes integration with a priority-based scheduling mechanism, a dual mutex mechanism, and a real-time state synchronization mechanism, including:

[0183] Integration with priority-based hierarchical scheduling mechanisms:

[0184] In high-priority mode, the UART communication task is responsible for receiving and parsing protocol frames, continuously listening, and reading with a 20ms timeout. It is mainly used to read data from the serial port buffer and then call the five-level state machine to parse it byte by byte. After successful parsing, it calls process_data_frame to process and releases computing resources for other tasks to execute.

[0185] In low-priority mode, GPIO interface status acquisition and HMI serial port screen synchronization are performed once every fixed 100ms period. This is used to collect GPIO status, detect changes, generate HMI status update instructions, and call uart_comm_send to send serial port data synchronization status information.

[0186] Integration with double-ended mutex mechanism:

[0187] Command triggering mechanism: The tooling rescue activation command is implemented by parsing protocol frames.

[0188] Mode interlock verification: After parsing the instruction, immediately access the flag bit under the protection of the mutex lock, execute the interlock logic judgment, ensure safe mode switching, and provide feedback information through the serial port protocol in case of conflict.

[0189] Real-time response guarantee: High-priority UART tasks ensure timely instruction parsing, mutex lock operations are timed out to prevent deadlock from affecting system response, and instruction execution results are fed back to the HMI serial port screen via protocol.

[0190] Integration with real-time state synchronization mechanisms:

[0191] Two-way communication mechanism: When the HMI serial port screen module points towards the main control module, control commands are transmitted using a protocol frame format. User operation commands are transmitted, and after the commands are parsed, GPIO output control is triggered.

[0192] When the main control module points towards the HMI serial port screen module, status feedback is transmitted using a string command format to update GPIO status. The command format is: "pX.pic=Y\xFF\xFF\xFF", which is separate from the receiving protocol to avoid parsing conflicts.

[0193] In one optional implementation of this embodiment, after the test device is powered on, a central mirror is constructed based on the initial state of the test device, and the health of the communication link of the test device is continuously monitored. When it is determined that the communication link is abnormal, the test device is forced to synchronize its state so that the state of the test device is restored to be completely consistent with the central mirror.

[0194] Specifically, after the test device is powered on, the health of the communication link is continuously monitored. Once a communication anomaly or a risk of inconsistency between the two ends is detected, a full state synchronization will be automatically initiated, forcing the HMI serial port panel module and the physical device to be restored to a state completely consistent with the central mirror, thereby ensuring the reliability and trustworthiness of the operation.

[0195] In summary, Embodiment 2 of the present invention provides a control method for a portable simulated coupler coupling test device. This control method is based on the portable simulated coupler coupling test device in Embodiment 1. By adopting a portable single-machine simulation architecture, a dual interlocking safety mechanism, real-time status synchronization, and a priority-based hierarchical scheduling strategy, it effectively solves many shortcomings of existing coupling tests. A single machine can replace two trains to complete the test, significantly saving train, track, and manpower costs, significantly shortening test preparation and total time, and improving debugging efficiency. With the help of HMI visualization real-time monitoring and incremental status synchronization, it achieves intuitive display of IO point status and rapid fault location, significantly reducing fault troubleshooting time. Through dual flag interlocking and the highest priority arbitration of hardware signals, it completely avoids conflicts between tooling rescue and faulty car rescue modes, eliminating the risk of electrical damage and improving test safety. At the same time, it optimizes task scheduling and communication mechanisms to ensure rapid response to emergency commands and high consistency in status display. The device can directly draw power from the train, is plug-and-play, highly portable, and lowers the skill threshold for operation.

[0196] The above provides a detailed description of the portable simulated coupler coupling test device and control method provided by the present invention. Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0197] Furthermore, the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A control method for a portable simulated coupler coupling test device, characterized in that, The control method is based on a portable simulated coupler coupling test device, which includes a main control module, a power supply module, a data acquisition and output module, a command interaction module, and an HMI serial port screen module. The main control module is connected to the power supply module, the data acquisition and output module, the command interaction module, and the HMI serial port screen module. The main control module is an ESP32S3-N16R8 microcontroller. The main control module has built-in control logic for the test process. The control logic includes a priority hierarchical scheduling mechanism, a dual mutual exclusion lock mechanism, and a real-time status synchronization mechanism. The power supply module includes a step-down power supply circuit, which is used to convert the output voltage of the coupled train to the working voltage of the test device. The acquisition and output module includes several parallel acquisition and output circuits. The acquisition and output module is used to acquire the level signal of the coupled train and output the level signal to the coupled train. The instruction interaction module is used to implement operation instruction interaction; The HMI serial port screen module is connected to the main control module via serial communication. The HMI serial port screen module is used to display the status information during the test process. The control method includes: Connect the test device to the coupled train, and after the connection is completed, the power supply module powers on the main control module; Configure the GPIO interface, UART communication, and mutex lock of the main control module; Operation commands are triggered based on the command interaction module, and the triggered operation commands are prioritized. The operation instructions are executed sequentially according to their priority, and mutual exclusion is determined for the operation instructions being executed based on the double interlock safety state; The mutual exclusion decision for the currently executed operation instructions based on the dual interlock safety state includes: Define the flag bits for the first critical state and the second critical state respectively. The first critical state and the second critical state are mutually exclusive, and the priority of the first critical state is higher than the priority of the second critical state. When the first key state is activated, the flag bit of the second key state is used to determine whether the second key state is active. If the second key state is active, the second key state is immediately terminated and the first key state is activated. When activating the second key state, the flag bit of the first key state is used to determine whether the first key state is active. If the first key state is active, the activation of the second key state is stopped immediately. Construct a real state mirror and synchronously update the physical control points and virtual control points in the real state mirror that have undergone state changes; The process of constructing a real-state mirror and synchronously updating the physical and virtual control points in the real-state mirror that have undergone state changes includes: Extract all physical and virtual control points during the experiment, and construct a real-state mirror based on the extracted physical and virtual control points; Extract the previous cycle state cache array and the current cycle state cache array, and compare the previous cycle state cache array and the current cycle state cache array bit by bit; When the rate of change in the comparison results exceeds the preset change threshold, the physical control point and virtual control point where the state change has occurred are identified, and the time difference between the current time and the last full synchronization time is monitored. When the time difference exceeds the preset time threshold, the physical control points and virtual control points in the real state image that have undergone state changes are synchronously updated, and the full synchronization timestamps are updated accordingly. The acquisition and output module performs input acquisition and output control of the level signals of the coupled trains, and simultaneously displays the status information on the HMI serial port screen module.

2. The control method of the portable simulated coupler coupling test device as described in claim 1, characterized in that, Connecting the test device to the coupled train includes: Connect the power supply module of the test device to the power output point of the control host of the coupled train; Connect the acquisition and output module of the test device to the coupler connector point of the coupled train; Connect the command interaction module of the test device to the control hardware points of the coupled train.

3. The control method of the portable simulated coupler coupling test device as described in claim 1, characterized in that, The configuration of the main control module's GPIO interface, UART communication, and mutex lock includes: Initialize and configure the input / output pins of the GPIO interface of the main control module; Initialize the UART communication of the main control module; Extract mutually exclusive functional patterns during the experiment, and define the relationship between mutually exclusive functional patterns as a mutex lock.

4. The control method of the portable simulated coupler coupling test device as described in claim 1, characterized in that, The step of triggering operation commands based on the command interaction module and prioritizing the triggered operation commands includes: The operation command is triggered based on the command interaction module, and the corresponding operation task is generated. Based on the preset priority classification criteria, the generated operation tasks are divided into high-priority tasks and low-priority tasks; Prioritize executing high-priority tasks, and continue executing low-priority tasks after the high-priority tasks have been completed.

5. The control method of the portable simulated coupler coupling test device as described in claim 1, characterized in that, The input acquisition and output control of the train coupling level signal based on the acquisition and output module includes: The acquisition and output module acquires the level signals of the coupled trains and transmits the acquired level signals to the main control module; The main control module updates the acquired level signal based on the synchronous update status of the real state mirror, and transmits the updated level signal back to the acquisition output module; The acquisition and output module will output the updated and processed level signal to the coupled train.

6. The control method of the portable simulated coupler coupling test device as described in claim 1, characterized in that, The synchronous display of status information on the HMI serial port screen module includes: The main control module transmits the synchronous update status information of the real state image to the HMI serial screen module for display via serial communication. The serial communication transmission frames are marked with delimiters, and the frame structure consists of [frame header identifier] + [data field] + [frame tail identifier].

7. The control method of the portable simulated coupler coupling test device as described in claim 1, characterized in that, The control method further includes: After the test device is powered on, a central mirror is constructed based on the initial state of the test device, and the health of the communication link of the test device is continuously monitored. When it is determined that the communication link is abnormal, the test device is forced to synchronize its state so that the state of the test device is restored to be completely consistent with the central mirror.