Search

CN-119846935-B - Master-slave task synchronization method and device, controller and rail train

CN119846935BCN 119846935 BCN119846935 BCN 119846935BCN-119846935-B

Abstract

The invention discloses a master-slave task synchronization method, a device, a controller and a rail train, and relates to the technical field of rail transit, wherein the method comprises the following steps: the current controller identifies master-slave in-place conditions on a chassis of the rail train; determining a system master control condition corresponding to the current controller according to the master-slave in-place condition; if the system main control condition is a main control state, generating an interrupt request according to a first preset time interval, performing synchronous task processing according to the interrupt request, and sending the interrupt request to other controllers in place; according to the invention, the system master control condition corresponding to the current controller is determined according to the identified master-slave in-place condition, so that the automatic identification of the master-slave controller is realized; by generating and sending interrupt requests to other controllers serving as system slave controllers by one controller serving as a system master controller, all controllers can carry out strict master-slave task synchronization according to the interrupt requests of the system master controller, and the precision of master-slave task synchronization is improved.

Inventors

  • WU WENHUI
  • WANG XIANBING
  • CHEN DONG
  • HAO BO
  • LUO YUAN
  • MO YUN
  • TANG ZHILONG
  • ZHOU XUEXUN

Assignees

  • 中车株洲电力机车研究所有限公司

Dates

Publication Date
20260505
Application Date
20231016

Claims (12)

  1. 1. A master-slave task synchronization method, comprising: the method comprises the steps that a current controller identifies master-slave on-site conditions on a chassis of a rail train, wherein the controller on-site conditions comprise on-site conditions of controllers on preset controller positions on the chassis and preset controller positions where the current controller is located, and the current controller is any one of the controllers which are inserted and connected on the preset controller positions in the chassis of the rail train; Determining a system master control condition corresponding to the current controller according to the master-slave in-place condition; If the system main control condition is a main control state, generating an interrupt request according to a first preset time interval, performing synchronous task processing according to the interrupt request, and sending the interrupt request to other controllers in place so that the other controllers in place perform synchronous task processing according to the interrupt request; If the system main control condition is a slave control state, receiving an interrupt request sent by a system main controller according to a second preset time interval, and performing synchronous task processing according to the received interrupt request, wherein the system main controller is any one of other controllers in place; The first preset time interval is a preset time interval corresponding to a preset controller position where a current controller is located, the second preset time interval is a preset time interval corresponding to a preset controller position with highest master control selection priority among preset controller positions corresponding to in-place controllers, the preset time intervals corresponding to the preset controller positions are different, the master control selection priority corresponding to the first preset controller position is higher than the master control selection priority corresponding to the second preset controller position, the preset time interval corresponding to the first preset controller position is smaller than the preset time interval corresponding to the second preset controller position, and the first preset controller position and the second preset controller position are any two preset controller positions.
  2. 2. The master-slave task synchronization method of claim 1, wherein the current controller identifies master-slave on-site conditions on a chassis of a rail train, comprising: the current controller identifies the in-place condition of the controllers at the positions of the preset controllers; And identifying the position of the preset controller where the current controller is located according to the hardware identification number of the current controller.
  3. 3. The master-slave task synchronization method according to claim 1, wherein the determining, according to the master-slave in-place situation, a system master control situation corresponding to a current controller includes: And determining the system master control condition corresponding to the current controller according to the master-slave in-place condition and the master control selection priority corresponding to each preset controller position.
  4. 4. The master-slave task synchronization method according to claim 3, wherein the determining the system master control condition corresponding to the current controller according to the master-slave on-site condition and the master control selection priority corresponding to each of the preset controller positions includes: judging whether the highest priority in the master control selection priorities corresponding to the in-place controllers is the master control selection priority corresponding to the preset controller position where the current controller is located; If yes, determining the system main control condition as a main control state; if not, determining that the system master control condition is a slave control state.
  5. 5. The master-slave task synchronization method according to claim 4, wherein the number of the preset controller positions is 2, and the determining whether the highest priority among the master selection priorities corresponding to the in-place controllers is the master selection priority corresponding to the preset controller position where the current controller is located includes: judging whether the controllers at the two preset controller positions are in place or not; if the two positions are in place, judging whether the preset controller position where the current controller is located is a preset master control position or not; If the system master control situation is the preset master control position, determining that the system master control situation is a master control state; if the master control position is not the preset master control position, determining that the system master control condition is a slave control state; if the non-uniformity is in place, determining the system master control condition as a master control state.
  6. 6. The master-slave task synchronization method according to claim 1, wherein all the preset controller positions are ordered in the order of the corresponding master control selection priority from high to low, and a preset time interval corresponding to an i-th preset controller position in the ordering of all the preset controller positions is (i) X) milliseconds, X being a preset value.
  7. 7. The master-slave task synchronization method according to claim 6, wherein the preset controller position includes a preset master control position and a preset slave control position, the preset master control position corresponds to a preset time interval of X milliseconds, and the preset slave control position corresponds to a preset time interval of 2X milliseconds.
  8. 8. The master-slave task synchronization method according to claim 1, wherein the signal time of the interrupt request is 1ns.
  9. 9. The master-slave task synchronization method according to any one of claims 1 to 8, wherein the receiving system master controller transmits an interrupt request at a second preset time interval, and performs a synchronization task process according to the received interrupt request, comprising: judging whether an interrupt request sent by the system main controller is not received in a preset time period, wherein the preset time period is greater than or equal to the second preset time interval; if the interrupt request sent by the system main controller is not received in the preset time period, generating an interrupt request according to the first preset time interval, and performing synchronous task processing according to the generated interrupt request.
  10. 10. A master-slave task synchronization device, for use with a current controller, comprising: the system comprises an on-site identification module, a controller on-site identification module and a controller on-site identification module, wherein the on-site identification module is used for identifying master-slave on-site conditions on a chassis of a rail train, the controller on-site conditions comprise on-site conditions of controllers at preset controller positions on the chassis and preset controller positions where a current controller is located, and the current controller is any one of the controllers which are inserted and connected at the preset controller positions in the chassis of the rail train; The master control determining module is used for determining the system master control condition corresponding to the current controller according to the master-slave in-place condition; The generation control module is used for generating an interrupt request according to a first preset time interval if the system main control condition is a main control state, carrying out synchronous task processing according to the interrupt request, and sending the interrupt request to other controllers in place so as to enable the other controllers in place to carry out synchronous task processing according to the interrupt request; The system comprises a receiving control module, a synchronous task processing module and a control module, wherein the receiving control module is used for receiving an interrupt request sent by a system main controller according to a second preset time interval and carrying out synchronous task processing according to the received interrupt request if the system main control condition is a slave control state; The first preset time interval is a preset time interval corresponding to a preset controller position where a current controller is located, the second preset time interval is a preset time interval corresponding to a preset controller position with highest master control selection priority among preset controller positions corresponding to in-place controllers, the preset time intervals corresponding to the preset controller positions are different, the master control selection priority corresponding to the first preset controller position is higher than the master control selection priority corresponding to the second preset controller position, the preset time interval corresponding to the first preset controller position is smaller than the preset time interval corresponding to the second preset controller position, and the first preset controller position and the second preset controller position are any two preset controller positions.
  11. 11. A controller for a vehicle, which is configured to control a controller, characterized by comprising the following steps: A memory for storing a computer program; processor for implementing the steps of the master-slave task synchronization method according to any of claims 1 to 9 when executing said computer program.
  12. 12. A rail train is characterized by comprising a case, wherein the controller as claimed in claim 11 is arranged at each preset controller position in the case.

Description

Master-slave task synchronization method and device, controller and rail train Technical Field The invention relates to the technical field of rail transit, in particular to a master-slave task synchronization method, a master-slave task synchronization device, a controller and a rail train. Background At present, in the process of realizing task synchronization, a redundant system for high-reliability communication of rail trains such as locomotives, urban rails, subways and high-speed rails often adopts respective timers of controllers in the system to realize synchronization, so that the precision of task synchronization is poor, and the introduced error is also large. For example, in the process of implementing synchronization by 2-system redundancy of two controllers, two clocks are generated by the same clock source, and the two controllers collect clocks simultaneously, if clock edge collection is easy to cause clock loss, which leads to abnormal synchronization, and if clock is collected at high and low levels, strict synchronization cannot be implemented, which leads to data collected by the two controllers at different moments Therefore, how to realize high-precision master-slave task synchronization in a redundant system is a problem which needs to be solved in the present day. Disclosure of Invention The invention aims to provide a master-slave task synchronization method, a master-slave task synchronization device, a controller and a rail train, so as to realize high-precision master-slave task synchronization in a redundant system. In order to solve the technical problems, the invention provides a master-slave task synchronization method, which comprises the following steps: The method comprises the steps that a current controller identifies master-slave on-site conditions on a chassis of a rail train, wherein the controller on-site conditions comprise on-site conditions of controllers on preset controller positions on the chassis and preset controller positions where the current controller is located, and the current controller is any controller; Determining a system master control condition corresponding to the current controller according to the master-slave in-place condition; If the system main control condition is a main control state, generating an interrupt request according to a first preset time interval, performing synchronous task processing according to the interrupt request, and sending the interrupt request to other controllers in place so that the other controllers in place perform synchronous task processing according to the interrupt request; If the system master control condition is a slave control state, receiving an interrupt request sent by a system master controller according to a second preset time interval, and performing synchronous task processing according to the received interrupt request, wherein the system master controller is any one of other controllers in place. In some embodiments, the current controller identifies a master slave presence on a chassis of a rail train, comprising: the current controller identifies the in-place condition of the controllers at the positions of the preset controllers; And identifying the position of the preset controller where the current controller is located according to the hardware identification number of the current controller. In some embodiments, the determining, according to the master-slave in-place situation, a system master control situation corresponding to the current controller includes: And determining the system master control condition corresponding to the current controller according to the master-slave in-place condition and the master control selection priority corresponding to each preset controller position. In some embodiments, the determining the system master control situation corresponding to the current controller according to the master control selection priority corresponding to the master slave on-site situation and each preset controller position includes: judging whether the highest priority in the master control selection priorities corresponding to the in-place controllers is the master control selection priority corresponding to the preset controller position where the current controller is located; If yes, determining the system main control condition as a main control state; if not, determining that the system master control condition is a slave control state. In some embodiments, the number of preset controller positions is 2, and the determining whether the highest priority in the master control selection priorities corresponding to the in-place controllers is the master control selection priority corresponding to the preset controller position where the current controller is located includes: judging whether the controllers at the two preset controller positions are in place or not; if the two positions are in place, judging whether the preset controller position where the current controll