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

By identifying the master-slave positioning situation on the rail train chassis, determining the current controller's system master control situation, and generating an interrupt request, the automatic identification and high-precision synchronization of the master-slave controller in the rail train redundant system are realized, and the problem of poor task synchronization accuracy in the existing technology is solved.

CN119846935AActive Publication Date: 2025-04-18CRRC ZHUZHOU ELECTRIC LOCOMOTIVE RESEARCH INSTITUTE CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202311337288.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-16
Publication Date
2025-04-18
Estimated Expiration
2043-10-16

AI Technical Summary

Technical Problem

When the existing redundant system of rail trains realizes task synchronization, the accuracy and error are poor, making it difficult to achieve strict master-slave task synchronization.

Method used

By identifying the master-slave positioning situation on the rail train chassis, determining the current controller's system master control situation, and generating an interrupt request based on this situation, automatic identification and strict synchronization of the master-slave controller are achieved.

Benefits of technology

Improve the accuracy of master-slave task synchronization, reduce errors, and ensure that the controller in the redundant system can perform synchronization processing according to the interrupt request of the system master controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119846935A_ABST
    Figure CN119846935A_ABST
Patent Text Reader

Abstract

The invention discloses a master-slave task synchronization method and device, a controller and a rail train, and relates to the technical field of rail transit, and the method comprises the steps that the current controller identifies the master-slave in-place condition on a case 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 master control condition is a master 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 automatic identification of the master and slave controllers is realized; one controller serving as a system master controller generates and sends the interrupt request to other controllers serving as system slave controllers, so that all the controllers can perform strict master-slave task synchronization according to the interrupt request of the system master controller, and the precision of master-slave task synchronization is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of rail transit technology, and in particular to a master-slave task synchronization method, device, controller and rail train. Background Art

[0002] At present, in the process of achieving task synchronization, the redundant systems of high-reliability communication for rail trains such as locomotives, urban rail, subways and high-speed railways often use the timers of each controller in the system to achieve synchronization. This has poor task synchronization accuracy and introduces large errors. For example, in the process of achieving synchronization of two controllers with 2-system redundancy, two clocks will be generated by the same clock source. The two controllers collect clocks at the same time. If the clock is collected at the clock edge, it is easy to cause clock loss, resulting in abnormal synchronization. If the clock is collected at high and low levels, it will make it impossible to achieve strict synchronization, resulting in the two controllers collecting data at different times.

[0003] Therefore, how to achieve high-precision master-slave task synchronization in a redundant system is an issue that needs to be solved urgently. Summary of the invention

[0004] The object of the present invention is to provide a master-slave task synchronization method, device, controller and rail train to achieve high-precision master-slave task synchronization in a redundant system.

[0005] In order to solve the above technical problems, the present invention provides a master-slave task synchronization method, comprising:

[0006] The current controller identifies the master and slave positions on the chassis of the rail train; wherein the controller position status includes the position status of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any of the controllers;

[0007] According to the master-slave status, determine the system master control status corresponding to the current controller;

[0008] If the system master control situation is in the master control state, an interrupt request is generated at a first preset time interval, synchronization task processing is performed according to the interrupt request, and the interrupt request is sent to other controllers in place, so that the other controllers in place perform synchronization task processing according to the interrupt request;

[0009] If the system master control state is a slave control state, an interrupt request sent by the system master controller at a second preset time interval is received, and synchronization task processing is performed according to the received interrupt request; wherein the system master controller is any other controller in place.

[0010] In some embodiments, the current controller identifies the master and slave positions on the chassis of the rail train, including:

[0011] The current controller identifies the presence status of the controllers at each of the preset controller positions;

[0012] According to the hardware identification number of the current controller, the preset controller position where the current controller is located is identified.

[0013] In some embodiments, determining the system master control status corresponding to the current controller according to the master and slave status includes:

[0014] The system master control status corresponding to the current controller is determined according to the master-slave status and the master control selection priority corresponding to each of the preset controller positions.

[0015] In some embodiments, determining the system master control status corresponding to the current controller according to the master-slave status and the master control selection priority corresponding to each preset controller position includes:

[0016] Determine whether the highest priority among the master control selection priorities corresponding to the controllers in place is the master control selection priority corresponding to the preset controller position where the current controller is located;

[0017] If so, determining that the system master control status is a master control state;

[0018] If not, it is determined whether the system master control state is a slave control state.

[0019] In some embodiments, the number of the preset controller positions is 2, and determining whether the highest priority among the master control selection priorities corresponding to the controllers in place is the master control selection priority corresponding to the preset controller position where the current controller is located includes:

[0020] Determining whether the controllers at the two preset controller positions are both in place;

[0021] If both are in place, determine whether the preset controller position where the current controller is located is the preset master control position;

[0022] If it is the preset master control position, determining the system master control situation as the master control state;

[0023] If it is not the preset master control position, determining that the system master control situation is a slave control state;

[0024] If they are not all in place, it is determined that the system master control situation is a master control state.

[0025] In some embodiments, the first preset time interval is the preset time interval corresponding to the preset controller position where the current controller is located; the second preset time interval is the preset time interval corresponding to the preset controller position with the highest priority selected by the master control among the preset controller positions corresponding to the in-place controllers.

[0026] In some embodiments, the preset time intervals corresponding to the preset controller positions are different.

[0027] In some embodiments, 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, and 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; wherein the first preset controller position and the second preset controller position are any two of the preset controller positions.

[0028] In some embodiments, all of the preset controller positions are sorted in descending order according to the corresponding master control selection priority, and the preset time interval corresponding to the i-th preset controller position in the sorting of all of the preset controller positions is (i*X) milliseconds, where X is a preset value.

[0029] In some embodiments, the preset controller position includes a preset master position and a preset slave position, the preset master position corresponds to a preset time interval of X milliseconds, and the preset slave position corresponds to a preset time interval of 2X milliseconds.

[0030] In some embodiments, the signal time of the interrupt request is 1 ns.

[0031] In some embodiments, the receiving system main controller sends an interrupt request at a second preset time interval, and performs synchronization task processing according to the received interrupt request, including:

[0032] Determining whether an interrupt request sent by the system main controller is not received within a preset time period; wherein the preset time period is greater than or equal to the second preset time interval;

[0033] If no interrupt request sent by the system main controller is received within the preset time period, an interrupt request is generated according to the first preset time interval, and synchronization task processing is performed according to the generated interrupt request.

[0034] The present invention also provides a master-slave task synchronization device, which is applied to the current controller and includes:

[0035] An in-place identification module, used to identify the master and slave in-place conditions on the chassis of the rail train; wherein the controller in-place conditions include the in-place conditions of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any of the controllers;

[0036] A master control determination module is used to determine the system master control status corresponding to the current controller according to the master and slave status;

[0037] A generation control module is used for generating an interrupt request at a first preset time interval if the system master control situation is in the master control state, performing synchronization 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 synchronization task processing according to the interrupt request;

[0038] The receiving control module is used to receive an interrupt request sent by the system main controller at a second preset time interval if the system main control state is a slave control state, and perform synchronization task processing according to the received interrupt request; wherein the system main controller is any other controller in place.

[0039] The present invention also provides a controller, comprising:

[0040] Memory for storing computer programs;

[0041] A processor is used to implement the steps of the master-slave task synchronization method as described above when executing the computer program.

[0042] In addition, the present invention also provides a rail vehicle, comprising: a chassis; wherein the controllers as described above are arranged at each preset controller position in the chassis.

[0043] A master-slave task synchronization method provided by the present invention comprises: a current controller identifies the master-slave status on a chassis of a rail train; wherein the controller status includes the status of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any controller; according to the master-slave status, a system master control status corresponding to the current controller is determined; if the system master control status is a master control state, an interrupt request is generated at a first preset time interval, synchronization task processing is performed according to the interrupt request, and the interrupt request is sent to other controllers in place, so that the other controllers in place perform synchronization task processing according to the interrupt request; if the system master control status is a slave control state, an interrupt request sent by the system master controller at a second preset time interval is received, and synchronization task processing is performed according to the received interrupt request; wherein the system master controller is any other controller in place;

[0044] It can be seen that the present invention determines the system master control status corresponding to the current controller according to the identified master-slave status, thereby realizing automatic identification of master-slave controllers in a redundant system; a controller as a system master controller generates and sends an interrupt request to other controllers as system slave controllers, so that all controllers can perform strict master-slave task synchronization according to the interrupt request of the system master controller, thereby improving the accuracy of master-slave task synchronization. In addition, the present invention also provides a master-slave task synchronization device, a controller and a rail train, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 A flowchart of a master-slave task synchronization method provided by an embodiment of the present invention;

[0047] Figure 2 A schematic diagram of a chassis configuration of another master-slave task synchronization method provided by an embodiment of the present invention;

[0048] Figure 3 A signal diagram of an interrupt request of another master-slave task synchronization method provided by an embodiment of the present invention;

[0049] Figure 4 A structural block diagram of a master-slave task synchronization device provided by an embodiment of the present invention;

[0050] Figure 5 A schematic diagram of the structure of a controller provided by an embodiment of the present invention;

[0051] Figure 6 A schematic diagram of the structure of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Please refer to Figure 1 , Figure 1 A flowchart of a master-slave task synchronization method provided by an embodiment of the present invention. The method may include:

[0054] Step 101: The current controller identifies the master and slave status on the chassis of the rail train; wherein the controller status includes the status of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any controller.

[0055] It can be understood that the current controller in this embodiment can be any controller plugged into and connected to each preset controller position in the chassis of the rail train, such as Figure 2 A controller (main controller 1 or main controller 2) is inserted into two preset controller positions (main controller 1 position and main controller 2 position) in the embodiment. The preset controller position in this embodiment can be a position pre-set in the chassis of the rail train for setting (such as inserting and connecting) a controller, and each preset controller position can be set with a controller.

[0056] Correspondingly, the master-slave status identified by the current controller in this embodiment can be information for identifying the master-slave controllers (i.e., the system master controller and the system slave controller) of the redundant system of the rail train; the specific content of the master-slave status identified by the current controller in this embodiment can be set by the designer according to the practical scenario and user needs, such as the master-slave status can include the status of the controllers at each preset controller position on the chassis, that is, whether the controllers at each preset controller position are currently in place (such as in place or not in place), so as to determine the number and position of the controllers inserted on the chassis; the master-slave status can also include the preset controller position where the current controller is located, that is, the preset controller position where the current controller itself is located, so that the current controller can determine whether it is the system master controller; the master-slave status can also include other information such as the identification information of each controller in place (such as a hardware identification number). As long as the current controller can use the identified master-slave status to determine whether it is a system master controller or a system slave controller, this embodiment does not impose any restrictions on this.

[0057] It should be noted that the specific method for the current controller to identify the master and slave status on the chassis of the rail train in this step can be set by the designer according to practical scenarios and user needs, such as the current controller identifying the status of the controllers at each preset controller position; identifying the preset controller position where the current controller is located according to the hardware identification number of the current controller; for example, the current controller can compare the hardware identification number corresponding to each preset controller position (that is, the hardware identification number of the controller in place) with the hardware identification number stored in the current controller itself, and determine the preset controller position corresponding to the stored hardware identification number as the preset controller position where the current controller is located.

[0058] Step 102: Determine the system master control status corresponding to the current controller according to the master and slave status.

[0059] Among them, the system master control situation corresponding to the current controller in this embodiment may be whether the current controller is the system master controller; that is, the system master control situation may include the master control state and the slave control state. If the system master control situation is the master control state, the current controller may be used as the system master controller; if the system master control situation is the slave control state, the current controller may be used as any system slave controller.

[0060] Correspondingly, the specific manner in which the current controller in this embodiment determines the system master control situation corresponding to the current controller according to the master-slave status can be set by the designer according to practical scenarios and user needs. For example, the master control selection priority corresponding to each preset controller position can be pre-set in this embodiment, and the current controller can determine the system master control situation corresponding to the current controller according to the master-slave status and the master control selection priority corresponding to each preset controller position; for example, if the master control selection priority corresponding to the preset controller position where the current controller is located is the highest among the master control selection priorities corresponding to the preset controller positions of all the controllers in place, then it can be determined that the system master control situation corresponding to the current controller is in the master control state, that is, the current controller serves as the system master controller; if the master control selection priority corresponding to the preset controller position where the current controller is located is not the highest, then it can be determined that the system master control situation corresponding to the current controller is in the slave control state, that is, the current controller serves as the system slave controller.

[0061] Correspondingly, the specific method of determining the system master control situation corresponding to the current controller based on the master-slave status and the master control selection priority corresponding to each preset controller position can be set by the designer according to practical scenarios and user needs. For example, the current controller can determine whether the highest priority among 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 so, the system master control situation is determined to be the master control state; if not, the system master control state is determined to be the slave control state. For example, when the number of preset controller positions is 2, that is, the preset controller positions include a preset master control position and a preset slave control position, and the master control selection priority corresponding to the preset master control position is higher than the master control selection priority corresponding to the preset slave control position, the current controller can determine whether the controllers at the two preset controller positions are both in place; if both are in place, determine whether the preset controller position where the current controller is located is the preset master control position; if it is the preset master control position, determine that the system master control situation is in the master control state; if it is not the preset master control position (that is, the preset slave control position), determine that the system master control situation is in the slave control state; if both are not in place, determine that the system master control situation is in the master control state, or directly generate an interrupt request at the first preset time interval, and perform synchronization task processing according to the generated interrupt request.

[0062] Correspondingly, the current controller can also communicate with other controllers in place, and randomly select a controller in place as the system master controller; if the current controller is the system master controller, the system master control state corresponding to the current controller is determined to be the master control state; if the current controller is the system slave controller, the system master control state corresponding to the current controller is determined to be the slave control state. This embodiment does not impose any restrictions on this.

[0063] Step 103: if the system master control is in the master control state, an interrupt request is generated at a first preset time interval, synchronization task processing is performed according to the interrupt request, and the interrupt request is sent to other controllers in place, so that the other controllers in place perform synchronization task processing according to the interrupt request.

[0064] It can be understood that in this step, the current controller can be in the master control state when the system is in the master control state, that is, when the current controller acts as the system master controller, it generates an interrupt request according to the first preset time interval, and sends the interrupt request to other controllers in place (that is, controllers in place other than the current controller), so that all controllers in place can perform synchronous task processing according to the interrupt request triggered by the first preset time interval, that is, other controllers in place act as system slave controllers.

[0065] Correspondingly, the specific value of the first preset time interval in this embodiment can be set by the designer according to practical scenarios and user needs. For example, in this embodiment, the preset time interval corresponding to each preset controller position can be pre-set, that is, the first preset time interval can be the preset time interval corresponding to the preset controller position where the current controller is located; for example, the preset time interval corresponding to each preset controller position can be set according to the master control selection priority corresponding to the preset controller position, such as the higher the master control selection priority, the smaller the preset time interval; that is, when 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 can be smaller than the preset time interval corresponding to the second preset controller position; wherein the first preset controller position and the second preset controller position are any two preset controller positions.

[0066] Accordingly, the preset time interval corresponding to each preset controller position can be an integer multiple of X milliseconds, such as the preset time interval corresponding to each preset controller position can be an integer multiple of X milliseconds (ms). For example, when the preset time intervals corresponding to all preset controller positions are different, all preset controller positions are sorted in descending order according to the corresponding master control selection priority, and the preset time interval corresponding to the i-th preset controller position in the sorting of all preset controller positions is (i*X) milliseconds, where X is a preset value (such as 5), and i is a positive integer greater than or equal to 1; that is, the preset time interval of the preset controller position corresponding to the master control selection priority with the highest priority can be X milliseconds, the preset time interval of the preset controller position corresponding to the master control selection priority with the second highest priority can be 2X milliseconds, and the preset time interval of the preset controller position corresponding to the master control selection priority with the third highest priority can be 3X milliseconds.

[0067] like Figure 2 and Figure 3 As shown, the position of the preset controller position is 2, that is, when the preset controller position includes the preset master control position (master control 1 position) and the preset slave control position (master control 2 position), the preset time interval corresponding to the preset master control position is X milliseconds, and the preset time interval corresponding to the preset slave control position is 2X milliseconds; if the current controller (master control 1) is set at the master control 1 position, the master control 1 can be used as the system master controller, and the time interval of the IRQ (Interrupt Request) of the master control 1 (that is, the first preset time interval) can be Xms; when the current controller (master control 2) is set at the master control 2 position and the master control 1 is not set at the master control 1 position, the master control 2 can be used as the system master controller, and the time interval of the IRQ of the master control 2 (that is, the first preset time interval) can be 2Xms.

[0068] Accordingly, this embodiment does not limit the specific signal time of the interrupt request. Figure 3 As shown, the signal time of the interrupt request is 1 nanosecond (ns), so that the interrupt time can be in the nanosecond level; the signal time of the interrupt request is 1 microsecond (us), and this embodiment does not impose any limitation on this.

[0069] It should be noted that the specific manner in which the current controller performs synchronization task processing according to the interrupt request in this embodiment, that is, the specific synchronization task processing process of the current controller performing synchronization task processing according to the generated interrupt request each time, can be set by the designer himself, such as being implemented in the same or similar manner as the synchronization task processing method of the controller in the prior art, and this embodiment does not impose any restrictions on this.

[0070] Furthermore, in this embodiment, the first preset time interval can be a hardware timing time, such as the time that the current controller uses its hardware timer to time the interrupt interval, so as to reduce the accuracy error of the master-slave task synchronization and enable the accuracy error to be less than 30ns.

[0071] Step 104: if the system master control state is a slave control state, an interrupt request sent by the system master controller at a second preset time interval is received, and synchronization task processing is performed according to the received interrupt request; wherein the system master controller is any other controller in place.

[0072] It can be understood that in this step, the current controller can receive the interrupt request sent by the system master controller according to the second preset time interval when the system master control situation is in the slave control state, that is, when the current controller acts as the system slave controller, so that all controllers in place can perform synchronous task processing according to the interrupt request triggered by the second preset time interval.

[0073] Correspondingly, for the specific value of the second preset time interval in this embodiment, it can be set in a similar manner to the first preset time interval. For example, in this embodiment, the preset time interval corresponding to each preset controller position can be pre-set, and the preset time interval corresponding to each preset controller position is set according to the master control selection priority corresponding to each preset controller position. In the case where the higher the master control selection priority, the smaller the preset time interval, the second preset time interval can be the preset time interval corresponding to the preset controller position with the highest master control selection priority among the preset controller positions corresponding to the in-place controllers. Figure 2 and Figure 3 As shown, when the current controller (master control 2) is set at the master control 2 position and the master control 1 is set at the master control 1 position, the current controller can act as a system slave controller, receive the IRQ sent by the master control 1 at an interval of Xms (i.e., the second preset time interval), and perform synchronous task processing according to the IRQ received every Xms.

[0074] Furthermore, in the present embodiment, the current controller acts as a system slave controller, receives an interrupt request sent by the system master controller at a second preset time interval, and in the process of performing synchronization task processing according to the received interrupt request, it can also detect whether an abnormality occurs in the synchronization signal (i.e., the interrupt request) of the system master controller, so as to complete the synchronization task processing using the interrupt request generated by itself when an abnormality occurs in the interrupt request of the system master controller. For example, the current controller can determine whether an interrupt request sent by the system master controller has not been received within a preset time period; if an interrupt request sent by the system master controller has not been received within the preset time period, an interrupt request is generated at a first preset time interval, and synchronization task processing is performed according to the generated interrupt request; wherein the preset time period is greater than or equal to the second preset time interval, such as the preset time period can be Y times the second preset time interval, that is, when the current controller does not detect an interrupt request sent by the system master controller for Y consecutive second preset time intervals, it can determine that an abnormality occurs in the interrupt request of the system master controller, and an interrupt request can be generated at the first preset time interval, and synchronization task processing is performed according to the generated interrupt request. Figure 2 and Figure 3 As shown, when the current controller (master control 2) is set at the master control 2 position and master control 1 is set at the master control 1 position, the current controller may no longer trust the interrupt request of master control 1 when it fails to detect the interrupt request of master control 1 for Y consecutive Xms (such as 5ms), and it may generate interrupt requests at intervals of 2Xms (such as 10ms). At this time, the synchronization of the master and slave controllers of the redundant system will no longer be strict synchronization, but master control 1 and master control 2 will be synchronized at regular intervals.

[0075] Correspondingly, when the number of controllers in place is greater than or equal to 3, the current controller may also perform synchronization task processing according to the interrupt request of the third preset time interval when an exception occurs in the interrupt request of the system main controller; the third preset time interval may be a preset time interval of the preset controller position corresponding to the second highest priority master controller selected in the preset controller position corresponding to the in-place controller. This embodiment does not impose any limitation on this.

[0076] In this embodiment, the embodiment of the present invention determines the system master control status corresponding to the current controller based on the identified master and slave status, thereby realizing automatic identification of master and slave controllers in a redundant system; by generating an interrupt request from a controller serving as the system master controller and sending it to other controllers serving as system slave controllers, all controllers can perform strict master-slave task synchronization according to the interrupt request of the system master controller, thereby improving the accuracy of master-slave task synchronization.

[0077] Corresponding to the above method embodiment, the embodiment of the present invention further provides a master-slave task synchronization device. The master-slave task synchronization device described below and the master-slave task synchronization method described above can refer to each other.

[0078] Please refer to Figure 4 , Figure 4 This is a structural block diagram of a master-slave task synchronization device provided by an embodiment of the present invention. The device is applied to the current controller and may include:

[0079] The in-place identification module 10 is used to identify the master and slave in-place conditions on the chassis of the rail train; wherein the controller in-place conditions include the in-place conditions of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any controller;

[0080] The master control determination module 20 is used to determine the system master control status corresponding to the current controller according to the master and slave status;

[0081] A generation control module 30 is used to generate an interrupt request at a first preset time interval if the system master control situation is in the master control state, perform synchronization task processing according to the interrupt request, and send the interrupt request to other controllers in place, so that the other controllers in place perform synchronization task processing according to the interrupt request;

[0082] The receiving control module 40 is used to receive an interrupt request sent by the system main controller at a second preset time interval if the system main control state is a slave control state, and perform synchronization task processing according to the received interrupt request; wherein the system main controller is any other controller in place.

[0083] In some embodiments, the presence identification module 10 may include:

[0084] An in-place identification submodule, used for the current controller to identify the in-place status of the controllers at each preset controller position;

[0085] The position identification submodule is used to identify the preset controller position where the current controller is located according to the hardware identification number of the current controller.

[0086] In some embodiments, the master control determination module 20 may be specifically configured to determine the system master control status corresponding to the current controller according to the master and slave status and the master control selection priority corresponding to each preset controller position.

[0087] In some embodiments, the master control determination module 20 may include:

[0088] The priority judgment submodule is used to judge whether the highest priority among the master control selection priorities corresponding to the in-place controller is the master control selection priority corresponding to the preset controller position where the current controller is located; if so, it is determined that the system master control status is the master control state; if not, it is determined that the system master control status is the slave control state.

[0089] In some embodiments, the number of preset controller positions is 2, and the priority judgment submodule can be specifically used to determine whether the controllers at the two preset controller positions are both in place; if both are in place, then determine whether the preset controller position where the current controller is located is the preset master control position; if it is the preset master control position, then determine that the system master control situation is the master control state; if it is not the preset master control position, then determine that the system master control situation is the slave control state; if both are not in place, then determine that the system master control situation is the master control state.

[0090] In some embodiments, the first preset time interval is the preset time interval corresponding to the preset controller position where the current controller is located; the second preset time interval is the preset time interval corresponding to the preset controller position with the highest priority selected by the master control among the preset controller positions corresponding to the in-place controllers.

[0091] In some embodiments, the preset time intervals corresponding to the preset controller positions are different.

[0092] In some embodiments, 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, and 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; wherein the first preset controller position and the second preset controller position are any two preset controller positions.

[0093] In some embodiments, all preset controller positions are sorted in descending order according to the corresponding master control selection priority, and the preset time interval corresponding to the i-th preset controller position in the sort of all preset controller positions is (i*X) milliseconds, where X is a preset value.

[0094] In some embodiments, the preset controller positions include a preset master position and a preset slave position, the preset master position corresponds to a preset time interval of X milliseconds, and the preset slave position corresponds to a preset time interval of 2X milliseconds.

[0095] In some embodiments, the signal time of the interrupt request is 1 ns.

[0096] In some embodiments, the receiving control module 40 may include:

[0097] The abnormality detection submodule is used to determine whether an interrupt request sent by the system main controller is not received within a preset time period; wherein the preset time period is greater than or equal to a second preset time interval;

[0098] The abnormal synchronization submodule is used to generate an interrupt request at a first preset time interval if no interrupt request sent by the system main controller is received within a preset time period, and perform synchronization task processing according to the generated interrupt request.

[0099] In this embodiment, the embodiment of the present invention determines the system master control status corresponding to the current controller according to the identified master and slave status through the master control determination module 20, thereby realizing automatic identification of master and slave controllers in the redundant system; by generating an interrupt request from a controller serving as the system master controller and sending it to other controllers serving as system slave controllers, all controllers can perform strict master-slave task synchronization according to the interrupt request of the system master controller, thereby improving the accuracy of master-slave task synchronization.

[0100] Corresponding to the above method embodiment, the embodiment of the present invention further provides a controller. The controller described below and the master-slave task synchronization method described above can refer to each other.

[0101] Please refer to Figure 5 , Figure 5 A schematic diagram of the structure of a controller provided by an embodiment of the present invention. The controller may include:

[0102] A memory D1, for storing computer programs;

[0103] The processor D2 is used to implement the steps of the master-slave task synchronization method provided by the above method embodiment when executing a computer program.

[0104] Corresponding to the above method embodiment, an embodiment of the present invention further provides a rail train. The rail train described below and the master-slave task synchronization method described above can refer to each other.

[0105] A rail train comprises: a chassis; wherein each preset controller position in the chassis is provided with a controller as provided in the previous embodiment.

[0106] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium described below and the master-slave task synchronization method described above can refer to each other.

[0107] Please refer to Figure 6 , Figure 6The computer readable storage medium 50 stores a computer program 51, which implements the master-slave task synchronization method provided in the above method embodiment when executed by a processor.

[0108] The computer-readable storage medium 50 may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which may store program codes.

[0109] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device, controller, rail vehicle and computer-readable storage medium disclosed in the embodiment, since they correspond to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0110] The above is a detailed introduction to a master-slave task synchronization method, device, controller and rail train provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A master-slave task synchronization method, characterized in that: include: The current controller identifies the master and slave positions on the chassis of the rail train; wherein the controller position status includes the position status of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any of the controllers; According to the master-slave status, determine the system master control status corresponding to the current controller; If the system master control situation is in the master control state, an interrupt request is generated at a first preset time interval, synchronization task processing is performed according to the interrupt request, and the interrupt request is sent to other controllers in place, so that the other controllers in place perform synchronization task processing according to the interrupt request; If the system master control state is a slave control state, an interrupt request sent by the system master controller at a second preset time interval is received, and synchronization task processing is performed according to the received interrupt request; wherein the system master controller is any other controller in place.

2. The master-slave task synchronization method according to claim 1, characterized in that: The current controller identifies the master and slave positions on the chassis of the rail train, including: The current controller identifies the presence status of the controllers at each of the preset controller positions; According to the hardware identification number of the current controller, the preset controller position where the current controller is located is identified.

3. The master-slave task synchronization method according to claim 1, characterized in that: Determining the system master control status corresponding to the current controller according to the master-slave status includes: The system master control status corresponding to the current controller is determined according to the master-slave status and the master control selection priority corresponding to each of the preset controller positions.

4. The master-slave task synchronization method according to claim 3, characterized in that: The determining the system master control status corresponding to the current controller according to the master-slave status and the master control selection priority corresponding to each preset controller position includes: Determine whether the highest priority among the master control selection priorities corresponding to the controllers in place is the master control selection priority corresponding to the preset controller position where the current controller is located; If so, determining that the system master control status is a master control state; If not, it is determined whether the system master control state is a slave control state.

5. The master-slave task synchronization method according to claim 4, characterized in that: The number of preset controller positions is 2, and the determining whether the highest priority among the master control selection priorities corresponding to the controllers in place is the master control selection priority corresponding to the preset controller position where the current controller is located includes: Determining whether the controllers at the two preset controller positions are both in place; If both are in place, determine whether the preset controller position where the current controller is located is the preset master control position; If it is the preset master control position, determining the system master control situation as the master control state; If it is not the preset master control position, determining that the system master control situation is a slave control state; If they are not all in place, it is determined that the system master control situation is a master control state.

6. The master-slave task synchronization method according to claim 1, characterized in that: The first preset time interval is the preset time interval corresponding to the preset controller position where the current controller is located; the second preset time interval is the preset time interval corresponding to the preset controller position with the highest priority selected by the master control among the preset controller positions corresponding to the in-place controllers.

7. The master-slave task synchronization method according to claim 6, characterized in that: The preset time intervals corresponding to the preset controller positions are different.

8. The master-slave task synchronization method according to claim 7, characterized in that: 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, and 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; wherein the first preset controller position and the second preset controller position are any two of the preset controller positions.

9. The master-slave task synchronization method according to claim 8, characterized in that: All the preset controller positions are sorted in descending order according to the corresponding master control selection priority, and the preset time interval corresponding to the i-th preset controller position in the sorting of all the preset controller positions is (i*X) milliseconds, where X is a preset value.

10. The master-slave task synchronization method according to claim 9, characterized in that: The preset controller positions include 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.

11. The master-slave task synchronization method according to claim 1, characterized in that: The signal time of the interrupt request is 1 ns.

12. The master-slave task synchronization method according to any one of claims 1 to 11, characterized in that: The receiving system main controller sends an interrupt request at a second preset time interval, and performs synchronization task processing according to the received interrupt request, including: Determining whether an interrupt request sent by the system main controller is not received within a preset time period; wherein the preset time period is greater than or equal to the second preset time interval; If no interrupt request sent by the system main controller is received within the preset time period, an interrupt request is generated according to the first preset time interval, and synchronization task processing is performed according to the generated interrupt request.

13. A master-slave task synchronization device, characterized in that: Applies to the current controller, including: An in-place identification module, used to identify the master and slave in-place conditions on the chassis of the rail train; wherein the controller in-place conditions include the in-place conditions of the controllers at each preset controller position on the chassis and the preset controller position where the current controller is located, and the current controller is any of the controllers; A master control determination module is used to determine the system master control status corresponding to the current controller according to the master and slave status; A generation control module is used for generating an interrupt request at a first preset time interval if the system master control situation is in the master control state, performing synchronization 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 synchronization task processing according to the interrupt request; The receiving control module is used to receive an interrupt request sent by the system main controller at a second preset time interval if the system main control state is a slave control state, and perform synchronization task processing according to the received interrupt request; wherein the system main controller is any other controller in place.

14. A controller, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the master-slave task synchronization method as described in any one of claims 1 to 12 when executing the computer program.

15. A rail train, characterized in that: include: Chassis; wherein, a controller as described in claim 14 is arranged at each preset controller position in the chassis.

Citation Information

Patent Citations

  • Wireless synchronization control system and method of aviation obstruction lights

    CN104837284A

  • Method, system and device for controlling dc motor of hydraulic brake system

    CN109050506A

  • Wireless synchronization method, wireless slave, wireless host and wireless synchronization system

    CN109586832A

  • File synchronization method and device, network node and storage medium

    CN109726184A

  • IO request processing method, device and system

    CN112306927A