Low-power-consumption acquisition method and circuit for rail transit digital quantity input

By dynamically adjusting the conduction mode of the optocoupler, combined with periodic PWM signals and continuous acquisition mode, the high power consumption and short lifespan issues of the optocoupler isolation acquisition circuit are solved, achieving low power consumption and high reliability signal acquisition.

CN121749955APending Publication Date: 2026-03-27SHENZHEN TONGYE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing rail transit systems, optocoupler-isolated acquisition circuits suffer from high power consumption and short lifespan, affecting system stability and safety.

Method used

The optocoupler LED is turned on and off by using a periodic PWM signal, combined with dynamic switching between continuous acquisition mode and periodic acquisition mode, which reduces the average power consumption of the optocoupler and extends its service life.

Benefits of technology

This effectively reduces the steady-state power consumption of the sampling resistor, extends the service life of the optocoupler, and improves the overall reliability and safety of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121749955A_ABST
    Figure CN121749955A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electrical signal acquisition, in particular to a low-power-consumption acquisition method and circuit for rail transit digital quantity input, an acquisition mode is initialized to be a periodic acquisition mode, an optocoupler control signal is set to be a periodic PWM (Pulse Width Modulation) signal, an optocoupler LED (Light Emitting Diode) is switched on during a PWM high-level period, and instantaneous sampling is carried out; switching to a continuous acquisition mode, adjusting the optocoupler control signal to be continuously conducted, carrying out continuous sampling, processing the signal in a preset observation period, returning the acquisition mode to a periodic acquisition mode when the monitored signal is stable and does not jump again, and recovering the optocoupler control signal to be a PWM signal. By dynamically adjusting the acquisition mode and the optocoupler control signal, the system power consumption is reduced, the optocoupler service life is prolonged, and the stability and reliability of the rail transit system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electrical signal acquisition technology, and in particular to a low-power acquisition method and circuit for digital input in rail transit. Background Technology

[0002] In the rail transit sector, critical components such as vehicle control and signaling systems rely on the accurate acquisition of numerous switching signals, including but not limited to relay contact states and button operation states. Due to the unique nature of rail transit systems, these switching signals are often in high-voltage form, such as the common 110VDC DC signal. However, controllers (such as PLCs and CPUs) typically only process low-voltage digital signals. Therefore, it is essential to use isolated acquisition circuits to convert high-voltage switching signals into low-voltage digital signals for subsequent processing and analysis.

[0003] Currently, optocoupler isolation acquisition circuits are widely used in the rail transit field as a solution for isolating and converting high-voltage switching signals. The basic principle of this circuit is to connect a sampling resistor in series at the input to limit the input current and prevent overcurrent damage. When an external high voltage (such as 110VDC) is present, current flows through the sampling resistor and the LED inside the optocoupler, causing the LED to light up and triggering the phototransistor on the output side of the optocoupler to conduct, outputting a low-level signal. Conversely, when there is no input voltage, the optocoupler does not conduct, outputting a high-level signal, thus achieving the conversion and isolation of high-voltage signals to low-voltage digital signals. However, traditional optocoupler isolation acquisition circuits have revealed significant drawbacks in practical applications. The primary problem is high power consumption and heat generation. To ensure reliable acquisition, especially for silver contacts that may have oxide layers, the current flowing through the contacts must be sufficiently large, typically greater than 10mA, to eliminate the influence of contact resistance and ensure the accuracy of signal acquisition. However, based on this current, the power consumption on the sampling resistor will be as high as 1.1W (taking 110VDC as an example). Considering that a typical acquisition module contains 16 or 32 channels, the total power consumption will be considerable, leading to a sharp increase in the overall temperature and severely impacting system stability. Furthermore, the lifespan of the optocoupler cannot be ignored. The LEDs inside the optocoupler operate under continuous high current (e.g., 10mA) for extended periods, accelerating their light decay process, causing a decrease in the current transfer ratio (CTR), ultimately leading to acquisition circuit failure and shortening the overall lifespan of the device. Simultaneously, excessively high overall temperature will also accelerate the aging of other peripheral electronic components, further reducing the overall reliability of the system and posing potential risks to the safe operation of rail transit.

[0004] Therefore, developing a high-voltage switching signal isolation acquisition scheme that can effectively reduce system power consumption and extend optocoupler life without reducing acquisition current is of great significance for improving the stability, reliability and safety of rail transit systems. SUMMARY

[0005] In order to overcome the deficiencies of the prior art, the present application provides a low-power acquisition method and circuit for digital input of rail transit, which effectively reduces system power consumption and prolongs the service life of optical couplers, and improves the stability, reliability and safety of rail transit systems.

[0006] The first aspect of the present application provides a low-power acquisition method for digital input of rail transit, comprising: initializing an acquisition mode as a periodic acquisition mode, and setting an optical coupler control signal as a periodic PWM signal by default; outputting the optical coupler control signal to an optical coupler control end according to the periodic acquisition mode, so that the optical coupler LED is turned on during the high level of the PWM signal; monitoring the state acquisition signal of the optical coupler LED to obtain an input level state, and performing instantaneous sampling on the input signal during the high level of each PWM period; when a signal level jump of the input level state is detected, switching the acquisition mode from the periodic acquisition mode to a continuous acquisition mode; adjusting the optical coupler control signal to a continuous conduction state according to the continuous acquisition mode, so that the optical coupler LED is continuously turned on; performing continuous sampling according to the continuous acquisition mode, and processing the continuous sampling signal within a preset observation time period; when it is monitored that the signal state is stable and does not jump again, returning the acquisition mode to the periodic acquisition mode, and restoring the optical coupler control signal to a periodic PWM signal.

[0007] In an optional embodiment, the processing of the continuous sampling signal within the preset observation time period comprises: acquiring a signal jump time, and starting timing according to the preset observation time period; when the signal state remains stable within the preset observation time period, determining that the sampling signal is valid, and outputting a valid signal state; when the signal jumps again within the preset observation time period, restarting timing according to the preset observation time period and maintaining the continuous acquisition mode until the signal is stable.

[0008] In an optional embodiment, before the acquisition mode is switched from the periodic acquisition mode to the continuous acquisition mode, the method further comprises: continuously monitoring the signal level state of the input level state within a delay time period; When the signal level remains in the jump state after the end of the delay time period, switch from the periodic acquisition mode to the continuous acquisition mode; When the signal level recovers in the delay time period, continue to maintain the periodic acquisition mode.

[0009] In an optional embodiment, the duty cycle of the periodic PWM signal is set to 1% to 20%.

[0010] In an optional embodiment, during the transient sampling process, the transient conduction current of the optocoupler LED is set to 10mA~20mA to ensure the reliability of the contact; and the average current of the optocoupler LED is reduced to 1mA~2mA through PWM chopping.

[0011] The second aspect of the present application provides a low-power acquisition method circuit for rail transit digital input, which comprises: an input module, an optocoupler isolation and acquisition module, and a controller; The controller is connected to the input module and the optocoupler isolation and acquisition module, and is used to output a control signal to the optocoupler isolation and acquisition module, so that the optocoupler isolation and acquisition module realizes the switching between the periodic acquisition mode and the continuous acquisition mode; The input module is used to receive an external signal source. The optocoupler isolation and acquisition module is connected to the input module and is used to realize the isolated acquisition of the signal according to the control signal of the controller.

[0012] In an optional embodiment, the input module comprises an input terminal for connecting an external signal source, and the input terminal is provided with a positive input terminal of an acquisition level and a negative input terminal of an acquisition level for inputting a level signal to be acquired.

[0013] In an optional embodiment, the optocoupler isolation and acquisition module comprises a sampling resistor, an optocoupler isolation branch composed of a switching element and an optocoupler LED connected in series, and the sampling resistor is connected in series between the input terminal and the optocoupler isolation branch and is used to limit the transient current; the on-off of the switching element is controlled by an optocoupler control signal output by one GPIO pin of the controller; and the output terminal of the optocoupler LED generates an optocoupler state acquisition signal and feeds back another GPIO pin of the controller.

[0014] In an optional embodiment, the sampling resistor is selected according to the voltage range of the rail transit digital input signal and the conduction characteristics of the optocoupler LED.

[0015] In an optional embodiment, the controller is used to: In the steady-state acquisition, the controller turns on and off the switching element by outputting a periodic PWM signal, so that the optocoupler LED is only turned on during the high level of the PWM signal; When the controller detects the rising or falling edge of the optocoupler state acquisition signal, the switching element is controlled to enter the continuous conduction state.

[0016] In summary, the low-power acquisition method and circuit for rail transit digital input provided by the present application have at least one of the following beneficial effects: 1. The acquisition mode is initialized as a periodic acquisition mode, and the optocoupler control signal is set as a periodic PWM signal by default. The optocoupler control signal is output to the optocoupler control end according to the periodic acquisition mode, so that the optocoupler LED is turned on during the high level of the PWM signal, and the input signal is sampled instantaneously during the high level of each PWM period. Instead of continuously turning on the optocoupler LED, the optocoupler LED is turned on for a short time during the high level of the PWM signal, greatly reducing the time of the optocoupler LED being turned on. 2. In normal conditions, the periodic acquisition mode is used, and the optocoupler LED is only turned on during the high level of the PWM signal, not continuously. This reduces the working time of the LED under large current and delays the light decay process, thereby prolonging the service life of the optocoupler. When the signal level of the input level state is detected to jump, the acquisition mode is switched from the periodic acquisition mode to the continuous acquisition mode, so that the optocoupler LED is continuously turned on for continuous sampling, and the continuous sampling signal is processed within a preset observation time period. After the processing is completed, when the signal state is stable and does not jump again, the acquisition mode returns to the periodic acquisition mode, and the optocoupler control signal is restored to the periodic PWM signal. By dynamically adjusting the acquisition mode according to the signal state, the optocoupler LED is prevented from being in a long-term large-current continuous conduction state, the service life of the optocoupler is effectively prolonged, the influence of high temperature rise of the whole machine on the aging of other surrounding electronic elements is reduced, and the overall reliability of the system is improved. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 is a module connection diagram of a low-power acquisition circuit for rail transit digital input according to an embodiment of the present application; Figure 2 is a circuit principle diagram of a low-power acquisition circuit for rail transit digital input according to an embodiment of the present application; Figure 3 is a flowchart of a low-power acquisition method for rail transit digital input according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] The present application will be further described below in conjunction with the drawings and embodiments.

[0019] The following will clearly and completely describe the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention. Furthermore, all connections / linkages involved in the patent do not simply refer to direct contact between components, but rather to the ability to form a better connection structure by adding or reducing connecting accessories according to specific implementation conditions. The various technical features in this invention can be combined interactively without contradicting each other.

[0020] Reference Figure 1 The diagram shown is a module connection diagram of a low-power acquisition circuit for digital input in rail transit, according to an embodiment of this application. It illustrates several key circuit modules of the pure hardware design provided by this solution, which include a power supply module, an input module, an optocoupler isolation and acquisition module, and a controller. These are described in detail below: Regarding the input module: The input module includes an input terminal for connecting an external signal source. The input terminal is provided with a positive input terminal (DIn_P) for acquiring the level and a negative input terminal (DIn_N) for acquiring the level signal to be acquired.

[0021] Refer to together Figure 2 The positive input terminal (DIn_P) and negative input terminal (DIn_N) of the acquisition level are connected to the external signal source of the rail transit system (such as relay contacts, button status, etc.) through terminal blocks or connectors.

[0022] In some embodiments, to ensure the stability and reliability of the input signal, some protection and filtering components can be set at the input terminal. For example, a transient voltage suppressor diode (TVS) can be connected in parallel to suppress possible transient overvoltages and protect subsequent circuit components from damage; at the same time, a small-value resistor (such as 10Ω) can be connected in series to play a certain role in current limiting and impedance matching.

[0023] Regarding the optocoupler isolation and acquisition module: The optocoupler isolation and acquisition module is connected to the input module and is used to achieve isolated acquisition of signals based on the control signals of the controller.

[0024] Refer to together Figure 2The light coupling isolation and collection module is composed of a sampling resistor, a switching element, a light coupling LED and an auxiliary circuit. The sampling resistor includes a main resistor (R86, with a resistance of 3.9KΩ, an accuracy of 1%, and a power of 1206 package) and a plurality of load resistors (for example, R82 with a resistance of 24KΩ, an accuracy of 1%, R79 with a resistance of 27KΩ, an accuracy of 1%, R83 with a resistance of 560Ω, an accuracy of 1%, and a power of 0603 package, and R84 with a resistance of 10KΩ, an accuracy of 5%, and a power of 0603 package). The sampling resistor R86 is connected in series in the input signal loop for limiting the conduction current of the light coupling LED.

[0025] The light coupling element (i.e. the light coupling LED J1 and J2) is connected with an internal light emitting diode and an external signal input side (i.e. DIn_P), and a photosensitive semiconductor and an output side (i.e. DIn_N), so as to realize an electrical isolation function. In some embodiments, the light coupling element can be selected as TLP521-1 (with a CTR range of 50%~200%) and an isolation voltage ≥2.5kV.

[0026] The gate of the switching element (such as a MOSFET) is connected with a control signal (DIn_EN_1) output by a controller, the source is grounded, and the drain is connected with the anode of the light emitting diode of the light coupling element. In some embodiments, the switching element can be an N-channel MOSFET (for example, model IRF540N, with a conduction resistance ≤0.077Ω), which is controlled by the GPIO pin of the MCU.

[0027] In addition, the output side of the light coupling element can be connected to a power supply (VDD3.3VA) through a pull-up resistor (such as R83), and an output light coupling state collection signal (DIn_Dat_1) is output to the controller.

[0028] In some embodiments, the sampling resistor is selected according to the voltage range of the rail transit digital quantity input signal and the conduction characteristics of the light coupling LED, so as to ensure that a suitable current is provided when the light coupling LED is turned on, and the average power consumption is effectively reduced when the collection is chopped. Specifically, assuming that the rail transit digital quantity input signal voltage is 110V, in order to make the conduction current of the light coupling LED reach a suitable 15mA, the resistance of the sampling resistor can be calculated according to the Ohm's law R = V / I (where V is the input signal voltage minus the LED conduction voltage, and I is the expected conduction current). The LED conduction voltage is 1.3V (in the range of 1.2V-1.5V), and then the sampling resistor R = (110V-1.3V) / 15mA ≈ 7.25KΩ. Considering the actual resistance specification, a close nominal value such as 7.5KΩ can be selected.

[0029] As to the controller, the controller is connected with the input module and the opto-isolating and collecting module, and is used for outputting a control signal to the opto-isolating and collecting module, so that the opto-isolating and collecting module realizes the switching between the periodic collecting mode and the continuous collecting mode.

[0030] Referring to Figure 2 The controller adopts a micro control unit (MCU), for example, STM32F103 series. The MCU has a plurality of general input output (GPIO) pins, part of which is used for outputting a control signal (DIn_EN_1) to control a switching element in the opto-isolating and collecting module, and another part of which is used for receiving an opto-isolating and collecting signal (DIn_Dat_1) output by the opto-isolating and collecting module.

[0031] The MCU has a function module such as a timer integrated therein, which is used for generating a periodic PWM signal to realize the control of the periodic collecting mode. Meanwhile, the MCU has a powerful data processing and logical judgment ability, and can realize real-time analysis and decision according to the received signal state, so as to realize the switching of the collecting mode. In some embodiments, the controller can select STM32F103C8T6 (ARM Cortex-M3 core) to output the PWM signal and process the sampling data.

[0032] Specifically, the working principle of the low-power acquisition circuit is as follows. For the periodic acquisition mode, in the default state, the controller outputs a PWM signal with a low duty cycle (for example, 10%) as a photocoupler control signal (DIn_EN_1) through a GPIO pin. The PWM signal controls the switching element (MOSFET) to turn on and off periodically. When the PWM signal is at a high level, the switching element is turned on, the light-emitting diode of the photocoupler is powered on and emits light, the photosensitive semiconductor inside the photocoupler is turned on by the light, the level of the output side of the photocoupler changes (usually from high to low), and the controller reads the level change through the DIn_Dat_1 pin to complete a signal sampling. Since the duty cycle of the PWM signal is very small, the light-emitting diode of the photocoupler is only turned on for a short time and is in an off state most of the time, thereby greatly reducing the average power consumption of the photocoupler. For example, if the current of the photocoupler is 10 mA and the duty cycle is 10%, the average current is only 1 mA, effectively reducing the power consumption of the sampling resistor and the entire circuit. For the continuous acquisition mode, the controller continuously monitors the signal state of the DIn_Dat_1 pin. When a rising edge (from 0 to 1) or a falling edge (from 1 to 0) change is detected, it is considered that a signal edge change is detected. At this time, the controller stops outputting the PWM signal and outputs a continuous high-level signal instead, so that the switching element is continuously turned on, the light-emitting diode of the photocoupler continuously emits light, and the output side of the photocoupler maintains a stable level state. The controller enters the continuous acquisition mode to timely and accurately capture the signal changes. At the same time, the controller starts a preset observation period (for example, 10 ms). During the observation period, the controller continuously monitors the signal state of the DIn_Dat_1 pin. If the signal remains stable and does not jump again during the observation period, the controller resumes outputting the PWM signal with a low duty cycle and switches back to the periodic acquisition mode; if the signal jumps again during the observation period, the controller restarts the timer and continues to maintain the continuous acquisition mode until the signal is stable.

[0033] The embodiment of the present application can be applied to the scene of collecting digital input signals in a rail transit vehicle control system, a signal system, a platform device, etc. The high-voltage signal (for example, 110 VDC) or the medium / low-voltage signal (24 V) is isolated and collected. On the premise of ensuring the reliability and response speed of acquisition, the steady-state power consumption of the sampling resistor is significantly reduced, the service life of the photocoupler is prolonged, the whole machine temperature rise is reduced, and the problems of high power consumption, short service life and insufficient reliability of the traditional photocoupler isolation circuit are solved.

[0034] Referring to Figure 3 FIG. 1 shows a flowchart of a low-power acquisition method for rail transit digital input according to an embodiment of the present application. The low-power acquisition method includes the following steps.

[0035] S31, initialize the acquisition mode as a periodic acquisition mode, and set the optocoupler control signal as a periodic PWM signal by default.

[0036] For the convenience of understanding the inventive idea of the present application, the following embodiments take the rail transit vehicle door control system as an example, and the low-power isolation acquisition of 110VDC digital signals (such as the state of the door switch and the state of the emergency unlocking button) is carried out. The rail transit vehicle door control system meets the following requirements: the voltage range of the input signal is 90VDC~120VDC; the response time is ≤10ms (when the signal jumps); the average power consumption is ≤0.5W (for a 16-channel acquisition module); and the working temperature range is -40℃~+85℃.

[0037] Among them, the system adopts an adaptive dual-mode control strategy based on signal characteristics, that is, the acquisition mode includes a periodic acquisition mode and a continuous acquisition mode.

[0038] After the rail transit digital quantity input acquisition system is powered on, the controller (hereinafter referred to as MCU) performs initialization operations, including clock configuration, GPIO (general input / output) pin initialization, etc. Specifically, initially, the system defaults to a periodic acquisition mode, so that the system samples signals according to the periodic sampling mode. At the same time, the optocoupler control signal is set to a periodic PWM signal by default, and the initial duty cycle of the PWM signal is set, for example, it can be set to 10%, and the frequency is 1kHz (the specific value can be adjusted according to actual requirements), which is used to periodically turn on the MOSFET in the steady state. In addition, the debounce and stabilization time can also be set to a preset observation time period (for example, 10ms), which is used for stability observation when a signal jump is detected.

[0039] It should be noted that the duty cycle of the periodic PWM signal is set to 1% to 20% to reduce power consumption, and on the premise of ensuring the reliable conduction of the optocoupler LED, the initial average power consumption is maximally reduced. For example, for the station equipment signal acquisition with extremely strict power consumption requirements, the initial duty cycle can be set to 5%; and for the signal acquisition of the vehicle control system part with slightly higher real-time requirements, the initial duty cycle can be set to 15%.

[0040] In some embodiments, an external 110VDC signal source (such as a door switch contact) is connected through an input terminal, wherein the controller (hereinafter referred to as MCU) configures two GPIO pins, respectively, DIn_EN_1 outputs a PWM signal (for example, the initial duty cycle is 10%, and the frequency is 1kHz) to control the on-off of the MOSFET; and DIn_Dat_1 is set to an input mode, and an internal pull-up resistor is enabled to read the optocoupler state.

[0041] If the PWM duty cycle is 10%, the average current is only 10mA x 10% = 1mA. The average power consumption on the sampling resistor is also reduced to 10% of the original (from 1.1W to 0.11W), thereby greatly reducing the steady-state power consumption.

[0042] The MCU sends the PWM signal according to the preset time period (for example, 10ms) when starting the timer, for example, triggering the PWM cycle interrupt once every 10ms, that is, the system runs in the low-power periodic collection mode by default, and the optocoupler is turned on for signal sampling (for example, high-voltage signal conversion to low-voltage signal, including all signals related to rail transit vehicle control) for a moment every 10ms, and is turned off immediately after sampling to reduce power consumption. In addition, the system can also turn on the time reservation optocoupler for 1ms of opening and closing delay, and turn off the rest of the time.

[0043] S32, outputting the optocoupler control signal to the optocoupler control end according to the periodic collection mode, so that the optocoupler LED is turned on during the high level of the PWM signal.

[0044] The system runs in the low-power periodic collection mode by default. In this mode, the MCU continuously outputs the PWM signal to the optocoupler control end (DIn_EN_1) according to the preset PWM parameters (frequency, duty cycle). Specifically, the MCU outputs a PWM signal with a duty cycle of 10% through the GPIO pin (DIn_EN_1), periodically (for example, once every 10ms) quickly turns on the MOSFET, so that the optocoupler LED is turned on during the high level of the PWM wave, and signal sampling is performed.

[0045] Among them, the LED inside the optocoupler is turned on during the high level of the PWM signal, the current flows through the LED and triggers the output end (phototransistor) of the optocoupler to turn on; during the low level, the LED is turned off, and the output end of the optocoupler is also turned off accordingly.

[0046] In an optional embodiment, the instantaneous sampling process, the instantaneous conduction current of the optocoupler LED is set to 10mA~20mA to ensure the contact reliability; and the average current of the optocoupler LED is reduced to 1mA~2mA through PWM chopping.

[0047] In the digital input acquisition system of rail transit, the contact reliability of the optical coupler directly affects the accuracy of signal transmission. If the driving current of the optical coupler LED is too small, it may cause poor contact of the contact, and trigger signal misjudgment; and continuous high current driving will significantly increase the power consumption of the system. The embodiments of the application consider the signal integrity and low power consumption requirements by dynamically adjusting the instantaneous conduction current and average current of the optical coupler LED. Specifically, during the instantaneous sampling process, the instantaneous conduction current of the optical coupler LED is set to 10mA~20mA to ensure the contact reliability of the contact, and to avoid signal distortion caused by poor contact. At the same time, the average current of the optical coupler LED is reduced to 1mA~2mA through PWM chopping control, so as to ensure the signal integrity while realizing low power consumption operation.

[0048] S33, monitoring the state acquisition signal of the optical coupler LED to obtain the input level state, and performing instantaneous sampling on the input signal during the high level period of each PWM cycle.

[0049] The MCU continuously monitors the signal state of the optical coupler output end through another GPIO pin (DIn_Dat_1), and the signal reflects the state of the optical coupler output end, that is, the state of the input level (high or low). During the high level period of each PWM cycle, the MCU realizes instantaneous sampling on the input signal by quickly reading the state of the DIn_Dat_1 pin, and reads the state of the current input level.

[0050] After sampling is completed, the MCU immediately turns off the MOSFET, so that the optical coupler LED is in an off state, so as to reduce power consumption. However, at this time, the optical coupler is in an intermittent conduction state, and the average current and power consumption are greatly reduced.

[0051] In some embodiments, during the high level period (1ms) of each PWM cycle, the LED inside the optical coupler is turned on, and enough light intensity is generated to make the output end (triode part) of the optical coupler conductive. During the low level period (9ms), the optical coupler LED is turned off, and the optical coupler output end is cut off. The sampling process is very short, and is ensured to be completed during the conduction period of the optical coupler LED, so as to avoid collecting invalid data during the low level period.

[0052] S34, when it is detected that the signal level of the input level state jumps, the acquisition mode is switched from the periodic acquisition mode to the continuous acquisition mode.

[0053] The MCU continuously monitors the state change of the DIn_Dat_1 pin, and after each transient sampling, checks whether the current input level state is consistent with the last sampling result. If not, it is considered that a signal level jump has occurred. Once a signal level jump is detected, that is, when a signal level jump from high to low or from low to high is detected, the MCU immediately switches the collection mode from the periodic collection mode to the continuous collection mode. The switching process is achieved by modifying the PWM output mode to continuous high level output, that is, the DIn_EN_1 pin continuously outputs high level, so that the optocoupler LED is continuously turned on.

[0054] In an optional embodiment, before the collection mode is switched from the periodic collection mode to the continuous collection mode, the method further comprises: continuously monitoring the signal level state of the input level state within a delay time period; when the signal level still remains in the jump state after the end of the delay time period, switching from the periodic collection mode to the continuous collection mode; when the signal level recovers to the original state within the delay time period, continuing to maintain the periodic collection mode.

[0055] In the low-power collection method of rail transit digital quantity input, in order to avoid false switching to the continuous collection mode due to transient interference, a delay monitoring link is added after the signal edge jump is detected. By continuously verifying the signal stability within the delay period, it is ensured that only the real and effective level change is responded to. In some embodiments, the MCU monitors the optocoupler output state through the GPIO pin (DIn_Dat_1) in real time. When the signal jumps from low level (0) to high level (1) (or high level to low level) is detected, the jump direction is recorded and the delay monitoring process is triggered. The internal timer of the MCU starts a preset delay period (for example, 1 ms, which can be adjusted according to the actual noise frequency). During the 1 ms delay period, the MCU continuously reads the level state of DIn_Dat_1 and records whether the signal remains in the state after the jump (such as high level) and whether there is a reverse jump (such as falling from high level to low level). If all sampling values are consistent with the initial jump direction (such as continuously high level), it is determined that it is a real signal change; if any sampling value recovers to the state before the jump (such as falling from high level to low level), it is determined that it is transient interference.

[0056] If the signal remains in the jumping state (e.g., high level) after the 1 ms delay, the MCU immediately switches the collection mode from the periodic collection mode to the continuous collection mode, and adjusts the optocoupler control signal (DIn_EN_1) to a continuously conducting state, so that the optocoupler LED continuously works, ensuring signal integrity. If the signal returns to the original state (e.g., from high level to low level) within the 1 ms delay, the MCU ignores the jump and continues to maintain the periodic collection mode; the optocoupler control signal maintains PWM chopping output to reduce power consumption. After entering the continuous collection mode, the MCU continuously monitors the signal stability within a preset observation period (e.g., 10 ms). If the signal does not jump again within the observation period, the valid signal state (e.g., high level valid) is output; if a reverse jump occurs, the observation period is reset and the delay monitoring process is returned to.

[0057] S35, adjusting the optocoupler control signal to a continuously conducting state according to the continuous collection mode, so that the optocoupler LED is continuously turned on.

[0058] At the same time, the optocoupler control signal is adjusted to a continuously conducting state, i.e., in the continuous collection mode, the MCU changes the output mode of the DIn_EN_1 pin from PWM output to continuous high level output, so that the optocoupler LED remains conducting during the entire continuous collection period, thereby allowing continuous monitoring of the input signal.

[0059] S36, continuously sampling according to the continuous collection mode, and processing the continuously sampled signal within a preset observation time period.

[0060] In the continuous collection mode, the MCU continuously reads the state of the DIn_Dat_1 pin for continuous sampling. A preset observation time period (e.g., 10 ms) is set, and the continuously sampled signal is processed within this period using a multi-stage filtering algorithm to distinguish between real signal changes and transient disturbances. The processing process includes de-bouncing (eliminating transient disturbances) and stability judgment to distinguish between real signal changes and transient disturbances.

[0061] In an optional embodiment, the processing of the continuously sampled signal within the preset observation time period includes: acquiring the signal jump time and starting the timing according to the preset observation time period; when the signal state remains stable within the preset observation time period, determining that the sampled signal is valid, and outputting a valid signal state; when the signal jumps again within the preset observation time period, resetting the timing according to the preset observation time period and maintaining the continuous collection mode until the signal is stable.

[0062] In some embodiments, the first level of hardware debouncing is performed by filtering the optocoupler state acquisition signal (DIn_Dat_1) through an RC filter circuit, which eliminates high-frequency noise interference in the input signal and ensures smooth signal edges. For example, an RC filter circuit is designed in the input path of the optocoupler state acquisition signal (DIn_Dat_1). The specific parameters are as follows: a 10kΩ resistor can be selected and connected in series with the optocoupler output to limit transient current and form a low-pass filter, and a 0.1μF ceramic capacitor is connected in parallel to form an RC time constant τ=RC=1ms filter network. Since the frequency of high-frequency noise (such as switching power supply interference, electromagnetic pulse) is much higher than the cutoff frequency (f=1 / (2πRC)≈1.6kHz) of the RC circuit, the signal is significantly attenuated when passing through, only allowing low-frequency signals (such as real level transitions) to pass through, ensuring smooth edges of DIn_Dat_1 without oscillation.

[0063] Next, the second level of software debouncing is performed by setting a software delay module in the MCU, which continuously monitors the optocoupler output state through GPIO (DIn_Dat_1). When an rising edge (0→1) or falling edge (1→0) is detected, the delay timer is immediately started. The delay time is set to 5ms (configurable to 5~10ms, adjusted according to actual noise frequency). During the delay period, the MCU ignores any state changes of DIn_Dat_1 and only records the initial transition direction (up / down). After the delay ends, the MCU re-reads the current state of DIn_Dat_1 and compares it with the initial transition direction for verification. For example, if a rising edge is detected and DIn_Dat_1 falls to 0 temporarily due to noise within 5ms, the MCU will still use the final stable value (1) as the reference after the delay ends, avoiding false positives caused by interference.

[0064] Further, the third level of stability verification is performed by continuously monitoring the signal state after hardware and software debouncing within a 10ms observation period. Specifically, after the second level of software debouncing is completed, the MCU starts a 10ms timer and enters continuous monitoring mode, sampling the DIn_Dat_1 state every 1ms and recording the number of transitions and directions. If the signal does not transition again within the 10ms observation period, it is determined to be a real signal change and the valid signal state (such as high level 1) is output. If the signal transitions again (e.g., from 1→0) within the observation period, the 10ms timer is reset and the second level of software debouncing is reprocessed until the signal stabilizes.

[0065] When the real signal is determined, the MCU switches the acquisition mode according to the signal direction, i.e., if the signal is a valid high level (1), the continuous acquisition mode is maintained for 10ms to confirm stability; if the signal returns to low level (0), the periodic acquisition mode is returned and the PWM chopping control is restored.

[0066] S37, when the signal state is stable and the jump is not detected again, return the collection mode to the periodic collection mode, and restore the optocoupler control signal to the periodic PWM signal.

[0067] After the preset observation time period ends, if the signal state is stable and the jump is not detected again, the MCU judges that the signal change is real and valid. The MCU switches the collection mode from the continuous collection mode back to the periodic collection mode, restores the PWM output mode of the DIn_EN_1 pin, and sets the original duty cycle (such as 10%). The system continues to run in the low-power periodic collection mode until the signal level jump is detected again.

[0068] The application fully considers the dynamic characteristics of the optocoupler switch. In the periodic collection mode, the optocoupler opening delay, stable establishment time and closing recovery time are accurately calculated, the sampling window design is optimized, and effective signal sampling is ensured within a limited collection period, rather than simple duty cycle chopping. When a potential signal jump is detected, the system immediately switches to the event-driven continuous monitoring mode, ensures complete capture of signal characteristics by prolonging the optocoupler conduction time, and distinguishes real signal changes from transient interference by using a multi-stage filtering algorithm. The system intelligently adjusts the monitoring strategy according to the signal dynamic characteristics, maximizes the power efficiency under the premise of ensuring signal integrity, and realizes the coordinated optimization of collection reliability, response speed and energy efficiency ratio.

[0069] Compared with the prior art, the application converts the continuous conduction of the optocoupler to intermittent conduction through chopping technology, ensures that the instantaneous collection current meets the contact reliability requirements (> 10 mA), and reduces the average current and sampling resistance power by several times (power reduction reaches 90%) using a low duty cycle (such as 10%), effectively solving the problem of excessive temperature rise of the whole machine. At the same time, the effective working time of the optocoupler LED is greatly reduced, the light decay process is significantly slowed down, and the overall service life and reliability of the collection module are prolonged. In the signal edge detection, the chopping is cancelled by software algorithm to realize full-current fast response, ensuring that the signal detection delay is consistent with the traditional constant conduction mode, without sacrificing the real-time performance of the system. In addition, the reduction of the whole machine power and temperature reduces the burden of the heat dissipation system, improves the long-term working reliability and system stability of all electronic components, and the application only needs to increase the software control logic on the basis of the existing hardware, without additional expensive hardware components, realizing low cost and easy upgrading of existing products, with high cost-effectiveness.

[0070] It should be noted that, for the foregoing method embodiments, the sequences of the described operations are not necessarily required to practice the application, nor are the sequences of the described operations necessarily required in the implementations of other embodiments of the application. Further, some of the described operations can occur simultaneously, be divided among multiple operations, be combined with other operations, or in some cases, be eliminated altogether. Moreover, the described embodiments can be implemented in hardware, software, firmware, or any combination thereof. Further, the described embodiments can be implemented in a computer program product tangibly embodied in a machine-readable storage medium for execution by a programmable processor; and methods of the application can be implemented by such a computer program product. The described embodiments can also be implemented as a system, apparatus, method, or article of manufacture that includes a machine-readable storage medium having stored thereon, computer-executable instructions that, if executed by a machine, cause the machine to perform a method or realize the system, apparatus, or article of manufacture. The machine can be any suitable processing device, such as a programmable processor, a computer, a system on a chip (SoC), or multiple ones of the same togeth er. The computer-executable instructions can include any set of instructions that, if executed by the machine, cause the machine to perform a method or realize the system, apparatus, or article of manufacture. The computer-executable instructions can be written in any suitable programming language to cause the machine to perform a method or realize the system, apparatus, or article of manufacture.

[0071] In the above embodiments, the description of each embodiment is focused on a certain aspect, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0072] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the described embodiments. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A low-power acquisition method for digital input in rail transit, characterized in that, The method includes: The initial acquisition mode is set to periodic acquisition mode, and the optocoupler control signal is set to a periodic PWM signal by default. According to the periodic acquisition mode, the optocoupler control signal is output to the optocoupler control terminal so that the optocoupler LED is turned on during the high level of the PWM signal; The status signal of the optocoupler LED is monitored to obtain the input level status, and the input signal is instantaneously sampled during the high level of each PWM cycle; When a signal level change in the input level state is detected, the acquisition mode is switched from the periodic acquisition mode to the continuous acquisition mode; The optocoupler control signal is adjusted to a continuously conducting state according to the continuous acquisition mode, so that the optocoupler LED is continuously turned on; Continuous sampling is performed according to the continuous acquisition mode, and the continuous sampling signals are processed within a preset observation time period; When the signal state is detected to be stable and no further transition occurs, the acquisition mode is returned to the periodic acquisition mode, and the optocoupler control signal is restored to a periodic PWM signal.

2. The low-power acquisition method for digital input in rail transit according to claim 1, characterized in that, The processing of the continuously sampled signal within the preset observation time period includes: Acquire the signal transition time and start timing according to the preset observation time period; If the signal state remains stable within the preset observation time period, the sampled signal is determined to be valid, and the valid signal state is output. If the signal changes again within the preset observation time period, the timing will be restarted according to the preset observation time period and the continuous acquisition mode will be maintained until the signal stabilizes.

3. The low-power acquisition method for digital input in rail transit according to claim 1, characterized in that, Before switching the acquisition mode from the periodic acquisition mode to the continuous acquisition mode, the method further includes: The signal level status of the input level is continuously monitored during the delay time period; If the signal level remains in a fluctuating state after the delay period ends, the system switches from the periodic acquisition mode to the continuous acquisition mode. If the signal level returns to its original state within the delay period, the periodic acquisition mode will continue.

4. The low-power acquisition method for digital input in rail transit according to claim 1, characterized in that, The duty cycle of the periodic PWM signal is set to 1% to 20%.

5. The low-power acquisition method for digital input in rail transit according to claim 1, characterized in that, During the instantaneous sampling process, the instantaneous conduction current of the optocoupler LED is set to 10mA~20mA to ensure contact reliability; and the average current of the optocoupler LED is reduced to 1mA~2mA by PWM chopping.

6. A low-power acquisition circuit for digital input in rail transit, characterized in that, The circuit, applied to the low-power acquisition method as described in any one of claims 1 to 5, comprises: Input module, optical isolation and acquisition module and controller; The controller connects the input module and the optocoupler isolation and acquisition module, and is used to output control signals to the optocoupler isolation and acquisition module so that the optocoupler isolation and acquisition module can switch between periodic acquisition mode and continuous acquisition mode. The input module is used to receive external signal sources; The optocoupler isolation and acquisition module is connected to the input module and is used to achieve isolated acquisition of signals based on the control signals of the controller.

7. The low-power acquisition circuit for digital input in rail transit according to claim 6, characterized in that, The input module includes an input terminal for connecting an external signal source. The input terminal is provided with a positive input terminal for acquiring the level and a negative input terminal for acquiring the level signal to be acquired.

8. The low-power acquisition circuit for digital input in rail transit according to claim 7, characterized in that, The optocoupler isolation and acquisition module includes a sampling resistor connected in sequence and an optocoupler isolation branch composed of a switching element and an optocoupler LED connected in series. The sampling resistor is connected in series between the input terminal and the optocoupler isolation branch to limit instantaneous current. The switching element is controlled by an optocoupler control signal output from one of the GPIO pins of the controller. The output of the optocoupler LED generates an optocoupler status acquisition signal, which is fed back to another GPIO pin of the controller.

9. The low-power acquisition circuit for digital input in rail transit according to claim 8, characterized in that, The sampling resistor is selected based on the voltage range of the digital input signal of the rail transit system and the conduction characteristics of the optocoupler LED.

10. The low-power acquisition circuit for digital input in rail transit according to claim 6, characterized in that, The controller is used for: During steady-state acquisition, the controller outputs a periodic PWM signal to turn the switching element on and off, so that the optocoupler LED is turned on only during the high level of the PWM signal; When the controller detects the rising or falling edge of the optocoupler status acquisition signal, it controls the switching element to enter a continuously conducting state.