Proxy server-based train communication front-end interface extension method and system
By setting up an extension interface on the communication front-end machine and using a proxy server for message forwarding, the problems of high load and computing pressure on the communication front-end machine and high system upgrade costs are solved, achieving secure and efficient message transmission and flexible project configuration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-03-17
AI Technical Summary
Existing communication front-end units face heavy loads and computational pressures when dealing with the information needs of rail transit signaling systems, and system upgrades are costly, making it difficult to meet diverse project requirements.
By setting up extended interfaces on the communication front-end machine and using a proxy server for message forwarding, interface types are distinguished by configuration file prefix identification and identification identifiers. Message packetization and serialization are performed in combination with message ID processing and manufacturer-defined protocols, reducing dependence on the front-end machine software.
It reduces the load and computational pressure on the communication front-end, reduces system maintenance costs, improves the security of message transmission through the extended interface, and reduces coupling and impact between different projects, enabling flexible configuration.
Smart Images

Figure CN115604002B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of railway signaling system technology, and in particular to a method and system for extending the interface of a train communication front-end unit based on a proxy server. Background Technology
[0002] As part of the signaling system, the communication front-end unit provides users with crucial operational information and the working status of internal and external interfaces. For most projects, the communication front-end unit provides predicted arrival and departure points, first and last train information, and train operation status information. However, as rail transit owners place increasingly higher demands on the informatization level of the signaling system, many new requirements have arisen for the communication front-end unit. Upgrading the signaling system for each new requirement, however, is extremely costly. Summary of the Invention
[0003] This invention aims to at least partially solve one of the technical problems in related technologies. Therefore, the first objective of this invention is to provide a method for extending the interface of a train communication front-end based on a proxy server, which can reduce the load and computational pressure on the communication front-end, meet the needs of different projects, and reduce system maintenance costs.
[0004] The second objective of this invention is to provide a train communication front-end interface extension system based on a proxy server.
[0005] A third objective of this invention is to provide a computer storage medium.
[0006] The fourth object of the present invention is to provide an electronic device.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solution:
[0008] A method for extending the interface of a train communication front-end unit based on a proxy server includes:
[0009] The communication front-end machine is initialized to run the main thread and system parameters, wherein the communication front-end machine is equipped with an expansion interface;
[0010] The main thread reads the configuration file of the extended interface and starts the interface thread of the extended interface;
[0011] The system retrieves and caches messages to be forwarded, and sends these messages to the target object via the started interface thread.
[0012] Optionally, the steps of initializing the communication front-end machine to run the main thread and run system parameters include:
[0013] The main thread reads the system configuration file, obtains the system parameters, and initializes the system parameters, which include the network node information, line name, log level, and central station number of the communication front-end machine.
[0014] Optionally, before the main thread reads the configuration file of the extended interface, the method further includes: pre-configuring a configuration file with a prefix identifier for each extended interface.
[0015] Optionally, the step of the main thread reading the configuration file of the extended interface and starting the interface thread of the extended interface includes:
[0016] The main thread iterates through all configuration files with the prefix identifier and starts a corresponding interface thread for each configuration file's extended interface.
[0017] Optionally, the extended interface includes a general interface and a special interface, and each configuration file also has an identification identifier. The method further includes: being able to identify the type of the interface corresponding to the configuration file through the identification identifier.
[0018] Optionally, the method further includes: after startup, the interface threads also initialize their respective network ports, wherein the interface threads of the general interface use the TCP communication protocol to communicate when sending and receiving data.
[0019] Optionally, the message to be forwarded is identified by a message ID, and the step of obtaining and caching the message to be forwarded includes:
[0020] Loop through the internal message queue to read messages awaiting forwarding;
[0021] Obtain the message ID of each message to be forwarded, and send the corresponding message to the corresponding message processing module for preprocessing according to the message ID, and cache the preprocessed message to be forwarded locally. The message to be forwarded includes the real-time operation status information of the train.
[0022] Optionally, the step of sending the message to be forwarded to the target object through the started interface thread includes:
[0023] After startup, the general interface thread and the dedicated interface thread assemble the locally cached messages to be forwarded into packets according to different packet assembly methods. The general interface thread sends the assembled message packets to the proxy server, while the dedicated interface thread sends the assembled message packets to the professional client.
[0024] Optionally, the general interface thread uses a pre-defined packet assembly method to assemble the locally cached messages to be forwarded.
[0025] Optionally, before the general interface thread sends the packetized message to be forwarded to the proxy server, the method further includes: performing serialization processing on the message to be forwarded based on a manufacturer-defined protocol.
[0026] Optionally, the step of serializing the message packet to be forwarded based on the manufacturer's custom protocol includes:
[0027] Create an internal message definition format file;
[0028] The message header file, serialization and deserialization processing file corresponding to the message to be forwarded are generated using the internal message definition format file, and then compiled into a static link library.
[0029] Add the generated message header file and the compiled static link library to the project file of the communication front-end machine;
[0030] The corresponding serialization function is called from the project file to serialize the message packet to be forwarded.
[0031] Optionally, after the general interface thread sends the assembled message packet to be forwarded to the proxy server, the method further includes:
[0032] The proxy server parses and processes the message packets to be forwarded, reassembles the parsed message packets, and sends the reassembled message packets to the user terminal.
[0033] Optionally, when the proxy server parses and processes the message packet to be forwarded, it uses a manufacturer-defined protocol to deserialize the message packet.
[0034] To achieve the above objectives, a second aspect of the present invention provides a train communication front-end interface extension system based on a proxy server, comprising:
[0035] An initialization module is used to initialize the main thread and system parameters of the communication front-end machine, wherein the communication front-end machine is equipped with an expansion interface;
[0036] A control module, connected to the initialization module, is used to control the main thread to read the configuration file of the extended interface, start the interface thread of the extended interface, obtain the message to be forwarded, and control the started interface thread to send the message to be forwarded to the target object.
[0037] To achieve the above objectives, a third aspect of the present invention provides a computer storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the above-described method for extending the train communication front-end interface based on a proxy server.
[0038] To achieve the above objectives, a fourth aspect of the present invention provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it implements the above-described method for extending the train communication front-end interface based on a proxy server.
[0039] This invention has at least the following technical effects:
[0040] This invention accurately identifies the extended interfaces of the communication front-end through prefix identifiers in the configuration file, and can accurately distinguish between general-purpose and dedicated interfaces to meet the message sending needs of users and projects. Simultaneously, when acquiring messages to be forwarded, preprocessing is performed according to the message ID through the corresponding message processing module. When sending messages using extended interfaces, different packetization methods corresponding to different interface types are used to assemble messages, and serialization processing of the message packets to be forwarded using a manufacturer-defined protocol enables encrypted transmission of the message packets, thereby effectively improving the security of extended interface message transmission. Furthermore, this invention does not... Modifying the communication front-end software, by modifying configuration files, adding general interfaces, and adding proxy servers, allows messages to be sent to the user end, reducing system maintenance costs. Furthermore, the general interfaces are the same across different projects, allowing proxy servers to be flexibly configured according to different project needs, resulting in low coupling and minimal mutual influence between projects. Moreover, this invention uses a manufacturer-defined protocol to serialize messages sent from the communication front-end to the proxy server, reducing network traffic and the load on the communication front-end. Moving some logical operations to the proxy server also effectively reduces the computational burden on the communication front-end.
[0041] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0042] Figure 1 A flowchart of a train communication front-end interface extension method based on a proxy server provided in an embodiment of the present invention;
[0043] Figure 2 A flowchart illustrating the method for starting the interface thread of an extended interface according to an embodiment of the present invention;
[0044] Figure 3This is a flowchart of a method for obtaining messages to be forwarded according to an embodiment of the present invention;
[0045] Figure 4 This is a schematic diagram of the external interaction of the communication front-end expansion interface provided in an embodiment of the present invention;
[0046] Figure 5 A flowchart of a train communication front-end interface extension method based on a proxy server, provided as a specific example of the present invention;
[0047] Figure 6 This is a structural block diagram of a train communication front-end interface extension system based on a proxy server, provided in an embodiment of the present invention. Detailed Implementation
[0048] The following describes this embodiment in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the invention, and should not be construed as limiting the invention.
[0049] The following description, with reference to the accompanying drawings, illustrates the method and system for extending the train communication front-end interface based on a proxy server.
[0050] Figure 1 This is a flowchart illustrating a method for extending the train communication front-end interface based on a proxy server, as provided in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0051] Step S1: Initialize the main thread and system parameters of the communication front-end machine. The communication front-end machine is equipped with an extension interface.
[0052] Specifically, in this embodiment, the communication front-end is installed in the ATS (Automatic Train Supervision) system. To address the increasing demands of actual projects and users and reduce the software maintenance costs of the ATS system, multiple expansion interfaces can be configured on the communication front-end. Message packets are transmitted through these expansion interfaces to meet the needs of actual projects and users. The following will explain how to securely send messages through the expansion interfaces. First, the main thread and system parameters of the communication front-end must be initialized.
[0053] The steps for initializing the communication front-end machine to run the main thread and system parameters include:
[0054] The main thread reads the system configuration file, obtains the system parameters, and initializes the system parameters. The system parameters include the network node information of the communication front-end, the line name, the log level, and the central station number where the device is located.
[0055] In one embodiment of the present invention, before the main thread reads the configuration file of the extended interface, the method further includes: pre-configuring a configuration file with a prefix identifier for each extended interface.
[0056] For example, each extended interface can be pre-configured with a configuration file prefixed with task_ and placed in the working directory.
[0057] Step S2: The main thread reads the configuration file of the extended interface and starts the interface thread of the extended interface.
[0058] The steps of the main thread reading the configuration file of the extension interface and starting the interface thread of the extension interface include: the main thread traversing all configuration files with prefix identifiers and starting the corresponding interface thread for each configuration file's extension interface.
[0059] The main thread can traverse all configuration files in the working directory that have a prefix such as task_, and create an interface thread for each extended interface corresponding to a configuration file with the prefix task_, and start the corresponding interface thread.
[0060] Specifically, such as Figure 2 As shown, the system can read the runtime configuration file, obtain runtime parameters, and then create and start a MainTask thread to handle network events with the application server. This application server is used to send messages to be forwarded through the extended interface. The MainTask thread, or main thread, can read all configuration files prefixed with "task_", then initialize and start all interface threads according to the configuration files, and load the respective configuration files for each interface thread.
[0061] In this embodiment, the extended interface may include a general interface and a special interface. Each configuration file also has an identification identifier. The method further includes: being able to identify the type of interface corresponding to the configuration file through the identification identifier.
[0062] For example, the main thread can identify whether the interface corresponding to a configuration file is a general interface or a special interface based on the identification identifier in the configuration file, so as to start the corresponding interface thread. It should be noted that the main thread starts the corresponding interface thread for each interface corresponding to a configuration file.
[0063] Furthermore, after the interface threads start, they also initialize their respective network ports. Specifically, the interface threads of the general interface use the TCP (Transmission Control Protocol) communication protocol to send and receive data.
[0064] Step S3: Obtain and cache the message to be forwarded, and send the message to be forwarded to the target object through the interface thread after startup.
[0065] The messages to be forwarded are identified by message ID (Identity document). In this embodiment, the steps of obtaining and caching the messages to be forwarded include: reading the messages to be forwarded in the internal message queue in a loop; obtaining the message ID of each message to be forwarded, and sending the corresponding message to be forwarded to the corresponding message processing module for preprocessing according to the message ID; and caching the preprocessed messages to be forwarded locally. The messages to be forwarded include the real-time operation status information of the train.
[0066] The internal message queue is used to receive messages sent by the application server. In this embodiment, messages to be forwarded in the internal message queue can be read cyclically and then preprocessed.
[0067] Specifically, such as Figure 3 As shown, the system can receive messages sent by the application server and cache them in a message queue. These messages can be real-time train operation status information. Then, based on the message ID, the message is assigned to the corresponding processing function for preprocessing, and the preprocessed message is cached locally. For example, if the message ID is identified as ID_1, it is assigned to the ID_1 processing function for preprocessing.
[0068] In one embodiment of the present invention, after preprocessing the message to be forwarded, the message to be forwarded can be sent to the target object through the started interface thread.
[0069] The step of sending the message to be forwarded to the target object through the interface thread after startup includes: the general interface thread and the special interface thread after startup respectively assemble the locally cached message to be forwarded into packets according to different packet assembly methods. The general interface thread sends the packetized message to be forwarded to the proxy server, and the special interface thread sends the packetized message to be forwarded to the professional client, i.e., the dedicated software.
[0070] like Figure 4As shown, the communication front-end configuration of the ATS system can include two general interfaces and three dedicated interfaces. The two general interfaces are referred to as General Interface 1 and General Interface 2, and the three dedicated interfaces are referred to as ISCS interface, PIS interface and RADIO interface. General Interface 1 and Communication Interface 2 communicate with the corresponding proxy server 1 and proxy server 2, respectively. ISCS interface, PIS interface and RADIO interface communicate with the corresponding ISCS software, PIS interface and RADIO interface, respectively.
[0071] For example, General Interface 1 can use its initiated Communication Interface 1 thread to assemble messages to be forwarded into packets, and send the assembled message packets to Proxy Server 1. Then, the external Proxy Server 1 sends them to the user end, i.e., the user software. General Interface 1 thread can use a pre-defined packet assembly method to assemble locally cached messages to be forwarded, while the packet assembly method of the dedicated interface thread can be determined according to the specific project.
[0072] In one embodiment of the present invention, before the general interface thread sends the packetized message to be forwarded to the proxy server, the method further includes: performing serialization processing on the message to be forwarded based on the manufacturer's custom protocol.
[0073] The steps for serializing the message packets to be forwarded based on the manufacturer's custom protocol include: creating an internal message definition format file; using the internal message definition format file to generate the message header file, serialization and deserialization processing files corresponding to the message to be forwarded, and compiling them into a static link library; adding the generated message header file and the compiled static link library to the project file of the communication front-end machine; and calling the corresponding serialization function from the project file to serialize the message packets to be forwarded.
[0074] Furthermore, after the general interface thread sends the reassembled message packet to the proxy server, the method also includes: the proxy server parsing and processing the message packet to be forwarded, reassembling the parsed message packet, and sending the reassembled message packet to the user terminal. Specifically, when the proxy server parses and processes the message packet to be forwarded, it uses a vendor-defined protocol to deserialize the message packet.
[0075] Specifically, the proxy server can deserialize the received message packets to be forwarded, reassemble the deserialized message packets, and send the reassembled message packets to the user terminal. Different proxy servers can be selected for reassembling the message packets and sending the reassembled message packets to the user terminal.
[0076] As a concrete example, such as Figure 5 As shown, the MainTask thread can be started. The MainTask thread reads the runtime system configuration file, obtains the runtime system parameters, and performs initialization settings. Then, it reads configuration files with the prefix Task_, such as Task_*.cfg, loads the configuration file, and starts the corresponding interface thread. After traversing and reading the configuration files with the prefix Task_, it obtains the real-time train operation status information from the ATS system and synchronizes it to all extended interfaces. When synchronizing to an extended interface, it determines whether the thread of that extended interface is a general interface thread or a dedicated interface thread. If it is a general interface thread, it serializes the message packets according to the manufacturer's custom protocol. If it is a dedicated interface thread, it performs business processing according to the project protocol and sends the message packets to the corresponding professional software.
[0077] Figure 6 This is a structural block diagram of a train communication front-end interface extension system based on a proxy server, provided in an embodiment of the present invention. Figure 6 As shown, the train communication front-end interface extension system 10 based on a proxy server includes an initialization module 11 and a control module 12. The control module 12 is connected to the initialization module 11. The initialization module 11 is used to initialize the main thread and system parameters of the communication front-end. The communication front-end is equipped with an extension interface. The control module 12 is used to control the main thread to read the configuration file of the extension interface, start the interface thread of the extension interface, obtain the message to be forwarded, and control the started interface thread to send the message to be forwarded to the target object.
[0078] Specifically, control module 12 controls the main thread to read configuration files with the prefix "Task_", such as "Task_*.cfg", loads the configuration file, and controls the startup of the corresponding interface threads. After controlling the main thread to traverse and read the configuration files with the prefix "Task_", it also obtains the real-time train operation status information from the ATS system and synchronizes it to all extended interfaces. When synchronizing to an extended interface, control module 12 also determines whether the thread of the extended interface is a general interface thread or a dedicated interface thread. If it is a general interface thread, it controls the general interface thread to serialize the message packets according to the manufacturer's custom protocol and send them to the proxy server so that they can be sent to the user software through the proxy server. If it is a dedicated interface thread, it controls the dedicated interface thread to perform business processing according to the project protocol and send the message packets to the corresponding professional software.
[0079] It should be noted that the specific implementation of the train communication front-end interface extension system based on the proxy server in this embodiment can be found in the specific implementation of the train communication front-end interface extension method based on the proxy server described above. To avoid redundancy, it will not be repeated here.
[0080] Furthermore, the present invention also provides a computer storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the above-described method for extending the train communication front-end interface based on a proxy server.
[0081] Furthermore, the present invention also provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it implements the above-described method for extending the train communication front-end interface based on a proxy server.
[0082] In summary, this invention accurately identifies the extended interfaces of the communication front-end through prefix identifiers in the configuration file, and accurately distinguishes between general-purpose and dedicated interfaces to meet the message sending needs of users and projects. Furthermore, when acquiring messages to be forwarded, preprocessing is performed according to the message ID using the corresponding message processing module. When sending messages using extended interfaces, different packetization methods corresponding to different interface types are used to assemble the messages. Additionally, serialization processing of the message packets to be forwarded using a manufacturer-defined protocol enables encrypted transmission of the message packets, thereby effectively improving the security of extended interface message transmission. Moreover, this invention can address new interface expansion requirements. Without modifying the communication front-end software, messages can be sent to the user terminal by modifying configuration files, adding general interfaces, and adding proxy servers, reducing system maintenance costs. Furthermore, the general interfaces are the same across different projects, allowing the proxy server to be flexibly configured according to different project needs, resulting in low coupling and minimal mutual influence between projects. Moreover, this invention uses a manufacturer-defined protocol to serialize messages sent from the communication front-end to the proxy server, reducing network traffic and the load on the communication front-end. Moving some logical operations to the proxy server also effectively reduces the computational burden on the communication front-end.
[0083] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0084] Although the present invention has been described in detail through the preferred embodiments above, it should be understood that the above description should not be considered as a limitation of the present invention. Various modifications and substitutions to the present invention will be apparent to those skilled in the art after reading the above description. Therefore, the scope of protection of the present invention should be defined by the appended claims.
Claims
1. A method for proxy server based extension of Train Communication Front End interface, characterized in that, The method comprises the following steps: initializing a communication front-end main thread and a running system parameter, wherein an extension interface is arranged on the communication front end; the main thread reads a configuration file of the extension interface and starts an interface thread of the extension interface, wherein the extension interface comprises a general interface and a special interface, and each configuration file is further provided with an identification mark, and the method further comprises the following steps: the type of the interface corresponding to the configuration file can be identified through the identification mark; obtaining and buffering a to-be-forwarded message, and sending the to-be-forwarded message to a target object through the started interface thread, which specifically comprises the following steps: a general interface thread is started, the to-be-forwarded message is subjected to serialization processing based on a manufacturer-defined protocol, and is sent to a proxy server; a special interface thread is started, a business process is performed according to a project protocol, and the to-be-forwarded message is sent to a corresponding professional client.
2. The proxy server based extension of train communication front end processor interface method as claimed in claim 1 wherein, The step of initializing the communication front-end main thread and the running system parameter comprises the following steps: the main thread reads a running system configuration file, obtains a running system parameter, and initializes the running system parameter, wherein the running system parameter comprises network node information, a line name, a log level and a centralized station number of the communication front end.
3. The proxy server based extension of train communication front end processor interface method as claimed in claim 2 wherein, Before the main thread reads the configuration file of the extension interface, the method further comprises the following step: a configuration file with a prefix mark is configured for each extension interface in advance.
4. The proxy server based extension of train communication front end processor interface method as claimed in claim 3 wherein, The step of the main thread reading the configuration file of the extension interface and starting the interface thread of the extension interface comprises the following steps: the main thread traverses all the configuration files with the prefix mark, and starts a corresponding interface thread for each configuration file corresponding to the extension interface.
5. The proxy server based extension of train communication front end processor interface method as claimed in claim 4, wherein, The method further comprises the following step: the started interface thread further initializes a network port thereof, wherein the general interface thread uses a TCP communication protocol to communicate when receiving and sending data.
6. The proxy server based extension of train communication front end processor interface method as claimed in claim 5 wherein, The to-be-forwarded message is identified by a message ID, and the step of obtaining and buffering the to-be-forwarded message comprises the following steps: cyclically reading the to-be-forwarded message in an internal message queue; obtaining a message ID of each to-be-forwarded message, sending the corresponding to-be-forwarded message to a corresponding message processing module for preprocessing according to the message ID, and buffering the preprocessed to-be-forwarded message to a local device, wherein the to-be-forwarded message comprises real-time running state information of a train.
7. The proxy server based extension of train communication front end processor interface method as claimed in claim 6 wherein, The step of serializing the to-be-forwarded message based on the manufacturer-defined protocol comprises the following steps: creating an internal message definition format file; customizing the message header file, the serialization and deserialization processing file corresponding to the to-be-forwarded message by using the internal message definition format file, and compiling a static link library; adding the generated message header file and the compiled static link library to an engineering file of the communication front end; calling a corresponding serialization function from the engineering file to serialize the to-be-forwarded message.
8. The proxy server based extension of train communication front end processor interface method as claimed in claim 7, wherein, After the general interface thread sends the packaged to-be-forwarded message to the proxy server, the method further comprises the following steps: The proxy server parses the to-be-forwarded message packet, re-packs the parsed to-be-forwarded message packet, and sends the re-packed to-be-forwarded message packet to the user end.
9. The proxy server based extension of train communication front end processor interface method as claimed in claim 8, wherein, When the proxy server parses the to-be-forwarded message packet, the to-be-forwarded message packet is deserialized by using a manufacturer-defined protocol.
10. A proxy server-based train communication front-end processor interface extension system, which is implemented by using the proxy server-based train communication front-end processor interface extension method according to any one of claims 1-9, characterized in that, The application relates to a train communication front-end machine interface extension method based on a proxy server. An initialization module is used for initializing a communication front-end machine running main thread and running system parameters, wherein an extension interface is arranged on the communication front-end machine; A control module is connected with the initialization module, and the control module is used for controlling the main thread to read a configuration file of the extension interface, starting an interface thread of the extension interface, acquiring a to-be-forwarded message, and controlling the started interface thread to send the to-be-forwarded message to a target object.
11. A computer storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to realize the train communication front-end machine interface extension method based on the proxy server.
12. An electronic device, comprising: The computer program is executed by the processor to realize the train communication front-end machine interface extension method based on the proxy server.
Citation Information
Patent Citations
Method and device for extending software function based on micro service architecture
CN106612188A