Communication method, system, electronic device and storage medium

By setting up the master control group and the slave control group in the grouping of rail transit trains, and determining the relative direction register value and index number value, the problem of IP address and physical address conflict in the reconnection grouping is solved, and correct communication between groupings is achieved. and operational flexibility.

CN116095042BActive Publication Date: 2024-09-17ZHUZHOU CSR TIMES ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111272480.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2024-09-17
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

In the field of rail transit, when the operational requirements of the reconnection marshalling change, IP addresses and physical addresses may conflict, resulting in instruction sending errors. The existing reconnection methods are not flexible enough and cannot effectively solve the problems of insufficient transportation capacity and unreasonable resource allocation. question.

Method used

After receiving the main control group setting instruction in the train grouping, the target grouping is set as the main grouping, and the other groupings are slave groupings. By determining the relative direction register value and index number value of each grouping, messages are generated for communication. , to ensure that the main control group can correctly identify and issue control instructions.

Benefits of technology

It is realized that any grouping in the reconnection grouping can be set as the main control grouping, which avoids communication errors between groups and improves operational flexibility and resource allocation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095042B
    Figure CN116095042B
Patent Text Reader

Abstract

The present application provides a communication method, device, electronic device and storage medium. When one of the target marshalings of the train receives a master control marshaling setting instruction, the target marshaling is set as the master control marshaling, and the other marshalings in the reconnected marshaling except the target marshaling are set as slave control marshalings; the relative direction register value and index number value of the master control marshaling and each slave control marshaling are respectively determined, and the index number of each marshaling is different; the master control marshaling generates a message based on the index number value of each slave control marshaling, and sends it to the corresponding slave control marshaling; each slave control marshaling generates a message based on the index number value of each slave control marshaling and the corresponding relative direction register value, and sends it to the master control marshaling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rail transit technology, and in particular to a communication method, system, electronic device and storage medium. Background Art

[0002] In the field of rail transit, for rail trains, if only one marshaling is running, it will cause problems such as insufficient capacity and unreasonable resource allocation. Therefore, multiple marshaling is usually used to meet operational needs. However, when setting up multiple marshaling, the main control marshaling can only be the end marshaling, and the multiple marshaling method is not flexible enough. During the multiple marshaling, due to operational needs, the marshaling in the multiple marshaling needs to be replaced, so that after the multiple marshaling, different marshalings may have the same IP address, physical address, etc., resulting in command sending errors. Summary of the invention

[0003] In response to the above problems, the present application provides a communication method, device, electronic device and storage medium.

[0004] The present application provides a communication method, which is applied to a train of a multiple-unit train, comprising:

[0005] When one of the target marshalings of the train receives a master control marshaling setting instruction, the target marshaling is set as the master control marshaling, and the other marshalings in the reconnection marshaling except the target marshaling are set as slave control marshalings;

[0006] Determine the relative direction register value and index number value of the master control group and each slave control group respectively, the index number of each group is different;

[0007] The master control group generates a message based on the index number value of each slave control group and sends it to the corresponding slave control group;

[0008] Each slave control group generates a message based on the index number value of each slave control group and the corresponding relative direction register value, and sends it to the master control group.

[0009] In some embodiments, respectively determining the relative direction register value and the index number value of the master control group and each slave control group includes:

[0010] Setting the index number value of the master control group to a first index value;

[0011] The relative direction register value of the master control group is set to the first register value.

[0012] In some embodiments, each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are communicatively connected via the end communication line, and the method further includes:

[0013] The two communication controllers in the master control marshaling send a first relative direction identification message to the first slave control marshaling through the corresponding end communication line, the first slave control marshaling is a marshaling adjacent to the master control marshaling, the first relative direction identification message carries a message value representing the communication controller, and the message values ​​corresponding to the two communication controllers in the same marshaling are different;

[0014] The first slave control group generates a relative direction register value of the first slave control group based on the message value of the received communication controller and the end communication line information of the first slave control group receiving the first relative direction identification message.

[0015] In some embodiments, the two communication controllers include a first communication controller and a second communication controller, the message value of the communication controller corresponding to the first communication controller is a first message value, the message value of the communication controller corresponding to the second communication controller is a second message value, the first communication controller corresponds to a first end communication line, the second communication controller corresponds to a second end communication line, the first slave control group generates a relative direction register value of the first slave control group based on the received message value of the communication controller and the end communication line information of the first slave control group receiving the first relative direction identification message, including:

[0016] When the message value of the communication controller received by the first slave control group is the first message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group, the relative direction register value of the first slave control group is set to the second register value;

[0017] When the message value of the communication controller received by the first slave control group is the first message value and the first slave control group receives the first relative direction identification message through the second end communication line of the first slave control group, the relative direction register value of the first slave control group is set to the first register value;

[0018] When the message value of the communication controller received by the first slave control group is the second message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group, the relative direction register value of the first slave control group is set to the first register value;

[0019] When the message value of the communication controller received by the first slave-control group is the second message value, and the first slave-control group receives the first relative direction identification message through the second end communication line of the first slave-control group, the relative direction register value of the first slave-control group is determined to be the second register value, wherein the first register value and the second register value are used to indicate whether the relative directions of the first slave-control group and the master-control group are consistent.

[0020] In some embodiments, when there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the method further includes:

[0021] The target communication controller of the first slave-control marshaling group sends a second relative direction identification message to the second slave-control marshaling group, and the end communication line corresponding to the target communication controller is connected to the second slave-control marshaling group; wherein the second relative direction identification message carries a message value representing the target communication controller and a relative direction register value of the first slave-control marshaling group;

[0022] The second slave control group generates a relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group, and the end communication line information of the second slave control group receiving the second relative direction identification message.

[0023] In some embodiments, the second slave control group generates a relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group, and the end communication line information of the second slave control group receiving the second relative direction identification message, including:

[0024] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0025] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0026] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0027] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0028] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0029] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0030] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the second register value;

[0031] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the first register value.

[0032] In some embodiments, the method further comprises:

[0033] The two communication controllers in the master control marshaling send a first index number establishment message to the first slave control marshaling through the corresponding end communication line, the first slave control marshaling is a marshaling adjacent to the master control marshaling, the first index number establishment message carries the index number value of the master control marshaling and the direction code value representing the communication controller in the master control marshaling that sends the first index number establishment message, wherein the direction code values ​​corresponding to the two communication controllers in the same marshaling are different;

[0034] The first slave-control group generates the index number value of the first slave-control group based on the direction code value of the communication controller in the received master-control group that sends the first index number establishment message and the index number value of the master-control group.

[0035] In some embodiments, each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line, and the first slave control marshaling generates the index number value of the first slave control marshaling based on the direction code value of the communication controller that sends the first index number establishment message in the received master control marshaling and the index number value of the master control marshaling, including:

[0036] When the direction code value of the communication controller that sends the first index number establishment message in the master control group is the first direction code value, determining the index number value of the first slave control group to be the index number value of the master control group minus 1;

[0037] When the direction code value of the communication controller that sends the first index number establishment message in the master control group is the second direction code value, the index number value of the first slave control group is determined to be the index number of the master control group plus 1.

[0038] In some embodiments, when there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the method further includes:

[0039] The target communication controller of the first slave control group sends a second index number establishment message, and the end communication line corresponding to the target communication controller is connected to the second slave control group, and the second index number establishment includes carrying the index number value of the first slave control group and the direction code value of the communication controller in the master control group that sends the first index number establishment message;

[0040] The second slave-control group generates the index number value of the second slave-control group based on the direction code value of the communication controller in the received master-control group that sends the first index number establishment message and the index number value of the first slave-control group.

[0041] In some embodiments, after the end group of the reconnected group determines the index number value of the end group, it sends an index number value feedback message to the main control group. The main control group can determine how many groups exist in the two end communication line directions of the main control group based on the index number value feedback message.

[0042] The present application provides a communication system, which is applied to a train of multiple-unit formation, including:

[0043] A first determination module is used for setting the target marshaling as the master control marshaling when one of the target marshalings of the train receives the master control marshaling setting instruction, and setting the other marshalings in the reconnection marshaling except the target marshaling as slave control marshalings;

[0044] A second determination module is used to determine the relative direction register value and index number value of the master control group and each slave control group respectively, and the index number of each group is different;

[0045] A first sending module, configured for the master control group to generate a message based on the index number value of each slave control group and send the message to the corresponding slave control group;

[0046] The second sending module is used for each slave control group to generate a message based on the index number value of each slave control group and the corresponding relative direction register value, and send it to the master control group.

[0047] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, any one of the above-mentioned communication methods is executed.

[0048] An embodiment of the present application provides a storage medium, which stores a computer program that can be executed by one or more processors and can be used to implement any of the communication methods described above.

[0049] The present application provides a communication method, system, electronic device and storage medium. After any group receives the setting instruction of the main control group, the group is determined as the main control group, so that any group in the reconnected group can be set as the main control group. By determining the relative direction register value and index number value of the main control group and each slave control group, the index number of each group is different. When communicating, the main control group generates a message based on the index number value of each slave control group and sends it to the corresponding slave control group; each slave control group generates a message based on the index number value of each slave control group and the corresponding relative direction register value, and sends it to the main control group. The main control group can correctly identify the information sent by each group and correctly send the control instruction to each group, so as to avoid communication errors between groups. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Hereinafter, the present application will be described in more detail based on embodiments and with reference to the accompanying drawings.

[0051] Figure 1 A schematic diagram of a reconnection marshaling connection structure provided in an embodiment of the present application;

[0052] Figure 2 A schematic diagram of an implementation flow of a communication method provided in an embodiment of the present application;

[0053] Figure 3 A schematic diagram of the setting of the relative direction register value of a multiple-unit train provided in an embodiment of the present application;

[0054] Figure 4A schematic diagram of setting the index number value of a multiple-unit train provided in an embodiment of the present application;

[0055] Figure 5 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0056] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0057] In the drawings, the same reference numerals are used for the same components, and the drawings are not drawn to scale. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0059] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0060] If similar descriptions of "first\second\third" appear in the application documents, the following instructions will be added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0062] Before introducing a communication method provided in an embodiment of the present application, a brief description is given of the related art and the problems existing in the related art.

[0063] Based on the problems existing in the related art, an embodiment of the present application provides a communication method, which is applied to an electronic device on a multiple-unit train, and the electronic device can be, for example, a computer, a mobile terminal, etc. The function implemented by the communication method provided in the embodiment of the present application can be implemented by calling a program code by a processor of the electronic device, wherein the program code can be stored in a computer storage medium. In the embodiment of the present application, the communication method is applied to a multiple-unit train, and the multiple-unit train includes at least two marshalings, and in some embodiments, for example, 2 marshalings, 3 marshalings, 5 marshalings, etc.

[0064] In the embodiment of the present application, Figure 1 A schematic diagram of a reconnection group connection structure provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, it includes marshaling a, marshaling b, and marshaling c; each marshaling unit is equipped with a PLC device, and each PLC device includes a communication controller 1 (communication control I in the figure), a communication controller 2 (communication control II in the figure), an input board unit, an output board unit, and a CPU unit. The CPU unit can coordinate and control the remaining four units. The communication controller 1 leads out the I-end communication line to be connected to the I-end coupler of this marshaling, and the communication controller 2 leads out the II-end communication line to be connected to the II-end coupler of this marshaling. The input board unit is used to receive input instructions set by the main control end and other input instructions or information; the output board unit outputs control instructions to this marshaling under the control of the CPU unit. Each marshaling unit is reconnected through a coupler. When the coupler is connected, the end communication line of this marshaling is connected to the end communication line of the adjacent marshaling. The PLCs of the two marshalings can realize two-way communication between adjacent marshalings through their respective communication controllers.

[0065] The present application provides a communication method. Figure 2 A schematic diagram of an implementation flow of a communication method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, including:

[0066] Step S101, when one of the target marshalings of the train receives a master control marshaling setting instruction, the target marshaling is set as the master control marshaling, and the other marshalings in the reconnected marshaling except the target marshaling are set as slave control marshalings.

[0067] In the embodiment of the present application, after the input board of the PLC of any group receives the input instruction set by the master control end, it determines that the input instruction set by the master control end is valid. If it is valid, the target group is set as the master control group. In the embodiment of the present application, the target group can be any group. In each reconnected group, there is only one master control group, and the remaining groups are slave control groups.

[0068] Step S102, respectively determining the relative direction register value and index number value of the master control group and each slave control group, wherein the index number of each group is different.

[0069] In the embodiment of the present application, two registers are provided in each marshaling, and the two registers are respectively used to store the relative direction register value relative to the main control marshaling; and to store the index number value of the reconnecting marshaling position where the present marshaling is located.

[0070] In the embodiment of the present application, the master control group and the slave control group determine the relative direction register value and index number value of the master control group and each slave control group by sending a preset message.

[0071] Step S103: the master control group generates a message based on the index number value of each slave control group and sends it to the corresponding slave control group.

[0072] Step S104: Each slave control group generates a message based on the index number value of each slave control group and the corresponding relative direction register value, and sends it to the master control group.

[0073] In the embodiment of the present application, after each slave marshaling completes the above-mentioned marshaling relative direction register value setting and index number value setting, each time it sends data to the master marshaling, it sends its own direction register value and index number value together. After receiving a message sent by a non-master marshaling, the master marshaling can locate which marshaling in the reconnection marshaling sequence sent the message, the specific position of the marshaling in the reconnection marshaling, and the relative direction of the marshaling and the master marshaling by parsing the direction register value and index number value contained in the message.

[0074] In an embodiment of the present application, when the master control group sends a control instruction message to any non-master control group (i.e., the slave control group) in the reconnected group, the index number value of the group that needs to receive the instruction is added to the sent message. The non-master control group receives the instruction message sent by the master control group, parses the index number attached to the message, and compares the index number with the value in its own index number register to determine whether the instruction message is an instruction sent to itself by the master control group.

[0075] A communication method provided by the present application determines any group as the main control group after any group receives the setting instruction of the main control group, so that any group in the reconnected group can be set as the main control group, and determines the relative direction register value and index number value of the main control group and each slave control group, and the index number of each group is different. When communicating, the main control group generates a message based on the index number value of each slave control group and sends it to the corresponding slave control group; each slave control group generates a message based on the index number value of each slave control group and the corresponding relative direction register value, and sends it to the main control group. The main control group can correctly identify the information sent by each group, and correctly send the control instruction to each group, so as to avoid communication errors between groups.

[0076] In some embodiments, the step S102 "respectively determining the relative direction register value and index number value of the master control group and each slave control group" can be implemented by the following steps:

[0077] Step S1, setting the index value of the master control group to a first index value.

[0078] Exemplarily, the index number value of the main control group can be a pre-set default value. For example, if the default value is 32, the first index value is 32. In the embodiment of the present application, the CPU of the main control group sets the index number value of the group to 32.

[0079] Step S2, setting the relative direction register value of the master control group to the first register value.

[0080] In the embodiment of the present application, the first register value may be a default value, for example, 0.

[0081] In this way, the relative direction register value and index number value of the master control group are established.

[0082] Next, establish the relative direction register value and index number value of each slave control group.

[0083] In some embodiments, each marshaling has two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line. After step S2, the method further includes:

[0084] Step S3, the two communication controllers in the main control group send a first relative direction identification message to the first slave control group through the corresponding end communication line. The first slave control group is an adjacent group to the main control group. The first relative direction identification message carries a message value representing the communication controller. The message values ​​corresponding to the two communication controllers in the same group are different.

[0085] In an embodiment of the present application, the CPU of the main control group respectively controls the communication controller I and the communication controller II to send a first relative direction identification message value to the first slave control group. The first relative direction identification message carries a message value representing the communication controller. For example, the message value of the first relative direction identification message sent by the communication controller I is set to 1, and the message value of the first relative direction identification message sent by the communication controller II is set to 2.

[0086] Step S4: the first slave control group generates a relative direction register value of the first slave control group based on the message value received from the communication controller and the communication line information of the end at which the first slave control group receives the first relative direction identification message.

[0087] In an embodiment of the present application, the first slave-control group is a group adjacent to the main-control group, and the first slave-control group receives a first relative direction identification message from the main-control group, and the relative direction register value of the first slave-control group is obtained based on the end communication line information of the first slave-control group receiving the first relative direction identification message, the message value of the received communication controller, and the relative direction register value of the first slave-control group.

[0088] In some embodiments, the two communication controllers include a first communication controller and a second communication controller, the message value of the communication controller corresponding to the first communication controller is a first message value, the message value of the communication controller corresponding to the second communication controller is a second message value, the first communication controller corresponds to a first end communication line, and the second communication controller corresponds to a second end communication line. Step S4 "the first slave control group generates a relative direction register value of the first slave control group based on the received message value of the communication controller and the end communication line information of the first slave control group receiving the first relative direction identification message" can be implemented in the following manner:

[0089] Step S41, when the message value of the communication controller received by the first slave-control group is the first message value, and the first slave-control group receives the first relative direction identification message through the first end communication line of the first slave-control group, the relative direction register value of the first slave-control group is set to the second register value.

[0090] Step S42, when the message value of the communication controller received by the first slave-control group is the first message value, and the first slave-control group receives the first relative direction identification message through the second end communication line of the first slave-control group, the relative direction register value of the first slave-control group is set to the first register value.

[0091] Step S43, when the message value of the communication controller received by the first slave-control group is the second message value, and the first slave-control group receives the first relative direction identification message through the first end communication line of the first slave-control group, the relative direction register value of the first slave-control group is set to the first register value.

[0092] Step S44, when the message value of the communication controller received by the first slave-control group is the second message value, and the first slave-control group receives the first relative direction identification message through the second end communication line of the first slave-control group, the relative direction register value of the first slave-control group is determined to be the second register value, wherein the first register value and the second register value are used to indicate whether the relative directions of the first slave-control group and the master-control group are consistent.

[0093] Exemplarily, the message value of the communication controller corresponding to the first communication controller is a first message value of 1, the message value of the communication controller corresponding to the second communication controller is a second message value of 2, the first register value is 0, the second register value is 1, the end communication line information of the first slave control group receiving the first relative direction identification message is represented by the first end communication line using the I bit end, and the end communication line information of the first slave control group receiving the first relative direction identification message is represented by the second end communication line using the II bit end. The specific settings are shown in Table 1.

[0094] Table 1 is a generation table of relative direction register values ​​of a first slave control group provided in an embodiment of the present application.

[0095]

[0096] In the embodiment of the present application, in Table 1, the relative direction register value of 0 indicates that the relative direction of the first slave-controlled group is consistent with that of the master-controlled group; for example, the master-controlled group is from left to right: I-bit end, II-bit end, and when the relative direction register value is 0, the direction of the first slave-controlled group is also: from left to right: I-bit end, II-bit end, and the relative direction register value is 1, indicating that the relative direction of this group is opposite to that of the master-controlled group.

[0097] For example, Figure 3 A schematic diagram of the setting of the relative direction register value of the multiple-unit train provided in the embodiment of the present application is shown in FIG. Figure 3 As shown, the relative direction register values ​​of group a and the main control group b are both 0, and the register value of group c is 1.

[0098] In some embodiments, when there is a second slave-controlled marshaling group in the reconnected marshaling train, the second slave-controlled marshaling group is connected to the first slave-controlled marshaling group. In some embodiments, the method further includes: generating a relative direction register value of the second slave-controlled marshaling group. After step S4, the method further includes:

[0099] Step S5, the target communication controller of the first slave-control group sends a second relative direction identification message to the second slave-control group, and the end communication line corresponding to the target communication controller is connected to the second slave-control group; wherein, the second relative direction identification message carries a message value representing the target communication controller and a relative direction register value of the first slave-control group.

[0100] In the embodiment of the present application, the first slave-control group controls the target communication controller to send a second relative direction identification message to the second slave-control group.

[0101] Step S6, the second slave control group generates a relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group and the end communication line information of the second slave control group receiving the second relative direction identification message.

[0102] In some embodiments, the second slave control group generates a relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group, and the end communication line information of the second slave control group receiving the second relative direction identification message, including:

[0103] Step S61, when the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0104] Step S62, when the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0105] Step S63, when the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0106] Step S64, when the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0107] Step S65, when the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0108] Step S66, when the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0109] Step S67, when the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0110] Step S68, when the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the first register value.

[0111] Exemplarily, the first message value is 1, the second message value is 2, the second register value is 1, the first register value is 0, the second end communication line is the II-bit end, and the first end communication line is the I-bit end. Table 2 is a generation table of the relative direction register value of the second slave control group provided in the embodiment of the present application. As shown in Table 2, Table 2 is a schematic table of the relative direction register value determined by the second slave control group provided in the embodiment of the present application.

[0112]

[0113]

[0114] In the embodiment of the present application, the relative direction register value of the grouping can be obtained by repeating the above method.

[0115] In some embodiments, the method further comprises:

[0116] Step S7, the two communication controllers in the main control group send a first index number establishment message to the first slave control group through the corresponding end communication line, the first slave control group is a group adjacent to the main control group, the first index number establishment message carries the index number value of the main control group and the direction code value representing the communication controller in the main control group that sends the first index number establishment message, wherein the direction code values ​​corresponding to the two communication controllers in the same group are different.

[0117] In the embodiment of the present application, when the main control group is established, the index number register value of the main control group is set to: 32, and the main control group sends a first index number establishment message through communication controller 1 and communication controller 2 respectively. The first index number establishment message includes the index number value of the main control group and the direction code value sent; if the main control group is a "first index number establishment message" message sent by communication controller 1, the direction code value is 1, and if it is sent by communication controller 2, the value is 2.

[0118] Step S8: The first slave control group generates the index number value of the first slave control group based on the direction code value of the communication controller that sends the first index number establishment message in the received master control group and the index number value of the master control group.

[0119] In some embodiments, each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line. Step S8 can be implemented in the following manner:

[0120] Step S81, when the direction code value of the communication controller that sends the first index number establishment message in the master control group is the first direction code value, determine the index number value of the first slave control group to be the index number value of the master control group minus 1.

[0121] Step S82: when the direction code value of the communication controller that sends the first index number establishment message in the master control group is the second direction code value, determine the index number value of the first slave control group to be the index number value of the master control group plus 1.

[0122] Exemplarily, Table 3 is a schematic table of first slave control group index values ​​determined by a first slave control group provided in an embodiment of the present application. As shown in Table 3,

[0123] Table 3 shows the index value of the first slave control group determined by the first slave control group.

[0124]

[0125] In some embodiments, in the case where there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the method further includes:

[0126] Step S9, the target communication controller of the first slave control group sends a second index number establishment message, and the end communication line corresponding to the target communication controller is connected to the second slave control group, and the second index number establishment includes carrying the index number value of the first slave control group and the direction code value of the communication controller in the master control group that sends the first index number establishment message;

[0127] Step S10: The second slave control group generates an index number value of the second slave control group based on the direction code value of the communication controller that sends the first index number establishment message in the received master control group and the index number value of the first slave control group.

[0128] Figure 4 A schematic diagram of setting the index number value of a multiple-unit train provided in an embodiment of the present application, such as Figure 4 As shown, the index number value of the adjacent group can be determined by the index number value of the main control group, and the register value stored in each index register differs by 1.

[0129] In some embodiments, after step S10, the method further includes:

[0130] Step S11, after the terminal group of the reconnected group determines the index number value of the terminal group, it sends an index number value feedback message to the main control group, and the main control group can determine how many groups exist in the two end communication line directions in the main control group based on the index number value feedback message.

[0131] In an embodiment of the present application, when the group located at the end of the reconnected group completes the generation of its own index number, it feeds back the index number generated by itself to the main control group through an "index number feedback message", and the main control group receives the "index number feedback messages" sent by the left and right groups located at the ends of the entire reconnected group through the I-end communication line and the II-end communication line respectively. By parsing the index number value of the message and combining it with the default index value of the main control group itself, it is possible to simply calculate how many groups are located in the I-end direction and the II-end direction of the main control group.

[0132] A communication method provided in an embodiment of the present application is that an intermediate group can also become a main control group, and the functions of establishing and transmitting group index numbers are added, which can achieve: any group within the reconnected group can be set as the main control group; the main control group can grasp the number of groups within the reconnected group, the relative arrangement direction of each group, the relative position between each group and other information; the main control group can correctly identify the information sent by each group, and correctly issue control instructions to each group.

[0133] Based on the foregoing embodiments, the embodiments of the present application provide a communication device, and the modules included in the device and the units included in the modules can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.

[0134] The present application provides a communication device. Figure 5 A schematic diagram of the structure of a communication device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the communication device 500 includes:

[0135] The first determination module 501 is used for setting the target marshaling as the master marshaling when one of the target marshalings of the train receives the master marshaling setting instruction, and setting the other marshalings in the reconnection marshaling except the target marshaling as slave marshalings;

[0136] The second determination module 502 is used to determine the relative direction register value and index number value of the master control group and each slave control group respectively, and the index number of each group is different;

[0137] A first sending module 503, configured for the master control group to generate a message based on the index number value of each slave control group, and send the message to the corresponding slave control group;

[0138] The second sending module 504 is used for each slave control group to generate a message based on the index number value of each slave control group and the corresponding relative direction register value, and send it to the master control group.

[0139] In some embodiments, the second determining module 502 includes:

[0140] A first determining unit, configured to set the index number value of the master control group to a first index value;

[0141] The second determining unit is used to set the relative direction register value of the master control group to the first register value.

[0142] In some embodiments, each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are communicatively connected via the end communication line, and the second determination module 502 further includes:

[0143] A first sending unit is used for two communication controllers in the master control marshaling to send a first relative direction identification message to a first slave control marshaling through corresponding end communication lines, wherein the first slave control marshaling is a marshaling adjacent to the master control marshaling, and the first relative direction identification message carries a message value representing the communication controller, and the message values ​​corresponding to the two communication controllers in the same marshaling are different;

[0144] The third determining unit is used for the first slave control group to generate a relative direction register value of the first slave control group based on the message value of the received communication controller and the end communication line information of the first slave control group receiving the first relative direction identification message.

[0145] In some embodiments, the two communication controllers include a first communication controller and a second communication controller, the message value of the communication controller corresponding to the first communication controller is a first message value, the message value of the communication controller corresponding to the second communication controller is a second message value, the first communication controller corresponds to a first end communication line, the second communication controller corresponds to a second end communication line, and the third determination unit includes:

[0146] A first determining subunit is configured to set the relative direction register value of the first slave control group to a second register value when the message value of the communication controller received by the first slave control group is a first message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group;

[0147] A second determining subunit is configured to set the relative direction register value of the first slave control group to the first register value when the message value of the communication controller received by the first slave control group is the first message value and the first slave control group receives the first relative direction identification message through the second end communication line of the first slave control group;

[0148] A third determining subunit is configured to set the relative direction register value of the first slave control group to the first register value when the message value of the communication controller received by the first slave control group is the second message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group;

[0149] The fourth determination subunit is used to determine the relative direction register value of the first slave-control group as a second register value when the message value of the communication controller received by the first slave-control group is a second message value and the first slave-control group receives the first relative direction identification message through the second end communication line of the first slave-control group, wherein the first register value and the second register value are used to indicate whether the relative directions of the first slave-control group and the master-control group are consistent.

[0150] In some embodiments, when it is determined that there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the second determining module further includes:

[0151] A fourth determining unit is used for the target communication controller of the first slave-control marshaling group to send a second relative direction identification message to the second slave-control marshaling group, and the end communication line corresponding to the target communication controller is connected to the second slave-control marshaling group; wherein the second relative direction identification message carries a message value representing the target communication controller and a relative direction register value of the first slave-control marshaling group;

[0152] The fifth determination unit is used for the second slave control group to generate the relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group and the end communication line information of the second slave control group receiving the second relative direction identification message.

[0153] In some embodiments, the fifth determining unit is specifically used to set the relative direction register value of the second slave control group to the second register value when the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group;

[0154] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0155] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0156] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0157] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value;

[0158] When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value;

[0159] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the second register value;

[0160] When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the first register value.

[0161] In some embodiments, the second determining module further includes:

[0162] A sixth determining unit is used for two communication controllers in the master control marshaling to send a first index number establishment message to a first slave control marshaling through corresponding end communication lines, wherein the first slave control marshaling is a marshaling adjacent to the master control marshaling, and the first index number establishment message carries the index number value of the master control marshaling and a direction code value representing the communication controller in the master control marshaling that sends the first index number establishment message, wherein the direction code values ​​corresponding to two communication controllers in the same marshaling are different;

[0163] The seventh determination unit is used for the first slave control group to generate the index number value of the first slave control group based on the direction code value of the communication controller that sends the first index number establishment message in the received master control group and the index number value of the master control group.

[0164] In some embodiments, each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line, and the seventh determination unit is specifically used to: when the direction code value of the communication controller that sends the first index number establishment message in the master control marshaling is the first direction code value, determine that the index number value of the first slave control marshaling is the index number value of the master control marshaling minus 1;

[0165] When the direction code value of the communication controller that sends the first index number establishment message in the master control group is the second direction code value, the index number value of the first slave control group is determined to be the index number of the master control group plus 1.

[0166] In some embodiments, when there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the second determining module further includes:

[0167] A second sending unit is used for the target communication controller of the first slave control group to send a second index number establishment message, and the end communication line corresponding to the target communication controller is connected to the second slave control group, and the second index number establishment includes carrying the index number value of the first slave control group and the direction code value of the communication controller in the master control group that sends the first index number establishment message;

[0168] An eighth determination unit, wherein the second slave control group generates an index number value of the second slave control group based on the direction code value of the communication controller in the received master control group that sends the first index number establishment message and the index number value of the first slave control group.

[0169] In some embodiments, the communication device further comprises:

[0170] The third sending module is used to send an index number value feedback message to the main control group after the end group of the reconnected group determines the index number value of the end group. The main control group can determine how many groups exist in the two end communication line directions of the main control group based on the index number value feedback message.

[0171] It should be noted that in the embodiment of the present application, if the above-mentioned method for determining the development parameters is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM, Read Only Memory), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0172] Accordingly, an embodiment of the present application provides a storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps in the communication method provided in the above embodiment are implemented.

[0173] An embodiment of the present application provides an electronic device; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the electronic device 600 includes: a processor 601, at least one communication bus 602, a user interface 603, at least one external communication interface 604, and a memory 605. The communication bus 602 is configured to realize the connection and communication between these components. The user interface 603 may include a display screen, and the external communication interface 604 may include a standard wired interface and a wireless interface. The processor 601 is configured to execute the communication program stored in the memory to implement the steps in the communication method provided in the above embodiment.

[0174] The description of the above display device and storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the computer device and storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0175] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0176] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0177] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0178] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0179] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0180] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0181] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read Only Memory), disks or optical disks, etc. Various media that can store program codes.

[0182] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a controller to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0183] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A communication method, characterized in that: Applied to a train with multiple trains, the method comprises: When one of the target marshalings of the train receives a master control marshaling setting instruction, the target marshaling is set as the master control marshaling, and the other marshalings in the reconnection marshaling except the target marshaling are set as slave control marshalings; Determine the relative direction register value and index number value of the master control group and each slave control group respectively, the index number of each group is different; The master control group generates a message based on the index number value of each slave control group and sends it to the corresponding slave control group; Each slave control group generates a message based on the index number value of each slave control group and the corresponding relative direction register value, and sends it to the master control group; The step of respectively determining the relative direction register value and the index number value of the master control group and each slave control group comprises: Setting the index number value of the master control group to a first index value; Setting the relative direction register value of the master control group to a first register value; Each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line. The method also includes: The two communication controllers in the master control marshaling send a first relative direction identification message to the first slave control marshaling through the corresponding end communication line, the first slave control marshaling is a marshaling adjacent to the master control marshaling, the first relative direction identification message carries a message value representing the communication controller, and the message values ​​corresponding to the two communication controllers in the same marshaling are different; The two communication controllers include a first communication controller and a second communication controller, the message value of the communication controller corresponding to the first communication controller is a first message value, the message value of the communication controller corresponding to the second communication controller is a second message value, the first communication controller corresponds to a first end communication line, and the second communication controller corresponds to a second end communication line; When the message value of the communication controller received by the first slave control group is the first message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group, the relative direction register value of the first slave control group is set to the second register value; When the message value of the communication controller received by the first slave control group is the first message value and the first slave control group receives the first relative direction identification message through the second end communication line of the first slave control group, the relative direction register value of the first slave control group is set to the first register value; When the message value of the communication controller received by the first slave control group is the second message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group, the relative direction register value of the first slave control group is set to the first register value; When the message value of the communication controller received by the first slave-control group is the second message value, and the first slave-control group receives the first relative direction identification message through the second end communication line of the first slave-control group, the relative direction register value of the first slave-control group is determined to be the second register value, wherein the first register value and the second register value are used to indicate whether the relative directions of the first slave-control group and the master-control group are consistent.

2. The method according to claim 1, characterized in that In the case where there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the method further includes: The target communication controller of the first slave-control marshaling group sends a second relative direction identification message to the second slave-control marshaling group, and the end communication line corresponding to the target communication controller is connected to the second slave-control marshaling group; wherein the second relative direction identification message carries a message value representing the target communication controller and a relative direction register value of the first slave-control marshaling group; The second slave control group generates a relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group, and the end communication line information of the second slave control group receiving the second relative direction identification message.

3. The method according to claim 2, characterized in that The second slave control group generates a relative direction register value of the second slave control group based on the message value of the target communication controller, the relative direction register value of the first slave control group, and the end communication line information of the second slave control group receiving the second relative direction identification message, including: When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value; When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value; When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value; When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the first end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value; When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the first register value; When the message value of the target communication controller is the first message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is the second register value; When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the first register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the second register value; When the message value of the target communication controller is the second message value, the relative direction register value of the first slave control group is the second register value, and the second slave control group receives the second relative direction identification message through the second end communication line of the second slave control group, the relative direction register value of the second slave control group is set to the first register value.

4. The method according to claim 1, characterized in that: The method further comprises: The two communication controllers in the master control marshaling send a first index number establishment message to the first slave control marshaling through the corresponding end communication line, the first slave control marshaling is a marshaling adjacent to the master control marshaling, the first index number establishment message carries the index number value of the master control marshaling and the direction code value representing the communication controller in the master control marshaling that sends the first index number establishment message, wherein the direction code values ​​corresponding to the two communication controllers in the same marshaling are different; The first slave-control group generates the index number value of the first slave-control group based on the direction code value of the communication controller in the received master-control group that sends the first index number establishment message and the index number value of the master-control group.

5. The method according to claim 4, characterized in that Each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line. The first slave control marshaling generates the index number value of the first slave control marshaling based on the direction code value of the communication controller that sends the first index number establishment message in the received master control marshaling and the index number value of the master control marshaling, including: When the direction code value of the communication controller that sends the first index number establishment message in the master control group is the first direction code value, determining the index number value of the first slave control group to be the index number value of the master control group minus 1; When the direction code value of the communication controller that sends the first index number establishment message in the master control group is the second direction code value, the index number value of the first slave control group is determined to be the index number of the master control group plus 1.

6. The method according to claim 5, characterized in that In the case where there is a second slave-control marshaling group, the second slave-control marshaling group is connected to the first slave-control marshaling group, and the method further includes: The target communication controller of the first slave control group sends a second index number establishment message, and the end communication line corresponding to the target communication controller is connected to the second slave control group, and the second index number establishment includes carrying the index number value of the first slave control group and the direction code value of the communication controller in the master control group that sends the first index number establishment message; The second slave-control group generates the index number value of the second slave-control group based on the direction code value of the communication controller in the received master-control group that sends the first index number establishment message and the index number value of the first slave-control group.

7. The method according to claim 6, characterized in that The method also includes: after the terminal group of the reconnected group determines the index number value of the terminal group, sending an index number value feedback message to the main control group, and the main control group can determine how many groups exist in the two end communication line directions in the main control group based on the index number value feedback message.

8. A communication system, characterized in that: Applicable to trains with multiple trains, including: A first determination module is used for setting the target marshaling as the master control marshaling when one of the target marshalings of the train receives the master control marshaling setting instruction, and setting the other marshalings in the reconnection marshaling except the target marshaling as slave control marshalings; A second determination module is used to determine the relative direction register value and index number value of the master control group and each slave control group respectively, and the index number of each group is different; A first sending module, configured for the master control group to generate a message based on the index number value of each slave control group and send the message to the corresponding slave control group; A second sending module is used for each slave control group to generate a message based on the index number value of each slave control group and the corresponding relative direction register value, and send it to the master control group; The second determining module includes: A first determining unit, configured to set the index number value of the master control group to a first index value; A second determining unit, configured to set the relative direction register value of the master control group to a first register value; Each marshaling includes: two communication controllers, each communication controller corresponds to an end communication line, and the two marshalings are connected to each other through the end communication line, and the second determination module also includes: A first sending unit is used for two communication controllers in the master control marshaling to send a first relative direction identification message to a first slave control marshaling through corresponding end communication lines, wherein the first slave control marshaling is a marshaling adjacent to the master control marshaling, and the first relative direction identification message carries a message value representing the communication controller, and the message values ​​corresponding to the two communication controllers in the same marshaling are different; The two communication controllers include a first communication controller and a second communication controller, the message value of the communication controller corresponding to the first communication controller is a first message value, the message value of the communication controller corresponding to the second communication controller is a second message value, the first communication controller corresponds to a first end communication line, the second communication controller corresponds to a second end communication line, and the third determining unit includes: A first determining subunit is configured to set the relative direction register value of the first slave control group to a second register value when the message value of the communication controller received by the first slave control group is a first message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group; A second determining subunit is configured to set the relative direction register value of the first slave control group to the first register value when the message value of the communication controller received by the first slave control group is the first message value and the first slave control group receives the first relative direction identification message through the second end communication line of the first slave control group; A third determining subunit is configured to set the relative direction register value of the first slave control group to the first register value when the message value of the communication controller received by the first slave control group is the second message value and the first slave control group receives the first relative direction identification message through the first end communication line of the first slave control group; The fourth determination subunit is used to determine the relative direction register value of the first slave-control group as a second register value when the message value of the communication controller received by the first slave-control group is a second message value and the first slave-control group receives the first relative direction identification message through the second end communication line of the first slave-control group, wherein the first register value and the second register value are used to indicate whether the relative directions of the first slave-control group and the master-control group are consistent.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the communication method according to any one of claims 1 to 7 is executed.

10. A storage medium, characterized in that: The computer program stored in the storage medium can be executed by one or more processors and can be used to implement the communication method as claimed in any one of claims 1 to 7.