Summary of the invention
In view of this, the object of the present invention is to provide a kind of modeling method of signal system, can improve the reusability of signal system model, reduce exploitation and the maintenance cost of test environment.In addition, the present invention also provides a kind of device of realizing the signal system modeling.
For achieving the above object, the invention provides following technical scheme:
A kind of modeling method of signal system comprises: create control interface, configuration interface and communication interface; Create message processing module; Create logic processing module according to type under described signal system is in simulated environment; Create port module, be specially: create for storing the message queue of described port module received message, the port attribute of determining described port module is consistent with the port attribute of described signal system physical port, and the connection attribute of configured port module is to meet the effect of described physical port, the port attribute of described port module comprises port address and port type, and described connection attribute comprises monitoring information type attribute, monitoring information source address attribute, link port attribute and destination address attribute.
Preferably, in above-mentioned modeling method, determine that the port attribute process consistent with the port attribute of described signal system physical port of described port module is specially: the port address of determining the port address of described port module and described physical port is consistent; Determine the port type of described port module according to the port type of described physical port, when the port type of described physical port is bus-type, the port type of described port module is defined as to Bus, when the port type of described physical port is end-to-end type, the port type of described port module is defined as to EndToEnd.
Preferably, in above-mentioned modeling method, the connection attribute of configured port module is specially with the process of the effect that meets described physical port: described physical port, for receiving the message of particular type, determines that the monitoring information type attribute of described port module is consistent with the type of described physical port receipt message; Described physical port, for receiving the message of particular source, determines that the monitoring information source address attribute of described port module is consistent with the address, source of described physical port receipt message; Described physical port is for linking with another physical port, and the address of another physical port that the link port attribute of definite described port module links with described physical port is consistent; Described physical port, for send message to the specific purpose address, determines that the destination address attribute of described port module is consistent with the destination address that described physical port sends message.
Preferably, in above-mentioned modeling method, the process that creates logic processing module according to type under described signal system is in simulated environment is specially: determine described signal system affiliated type in simulated environment; When support object that described signal system is simulated environment, the programming language that adopts simulated environment is to the realization of programming of the internal process of described signal system, the establishment of the logic processing module of settling signal system model; When measurand that described signal system is simulated environment, encapsulate the logic processing module of described signal system, and be its configuration data translater and network service port, the establishment of the logic processing module of settling signal system model.
Preferably, in above-mentioned modeling method, described establishment control interface comprises: create and start interface, finish interface and advance interface.
Preferably, in above-mentioned modeling method, described establishment communication interface comprises: create the receipt message interface and send message interface.
A kind of model building device of signal system comprises: the control interface creation apparatus, for creating the control interface of signal system model, the configuration interface creation apparatus, for creating the configuration interface of described signal system model, the communication interface creation apparatus, for creating the communication interface of described signal system model, the message processing module creation apparatus, for creating the message processing module of described signal system model, the logic processing module creation apparatus, for creating the logic processing module of described signal system model, the port module creation apparatus, for creating the port module of described signal system model, mainly by the message queue creating unit, port attribute determining unit and connection attribute dispensing unit form, described message queue creating unit is for creating the message queue of described port module, described port attribute determining unit is consistent with the port attribute of described signal system physical port for the port attribute of determining described port module, described connection attribute dispensing unit is for the connection attribute of configured port module, so that described connection attribute meets the effect of described physical port, the port attribute of described port module comprises port address and port type, described connection attribute comprises the monitoring information type attribute, the monitoring information source address attribute, link port attribute and destination address attribute.
Preferably, in said apparatus, described port attribute determining unit comprises: the port address determination module, determine the port address of described port module for the port address according to described physical port; The port type determination module, determine the port type of described port module for the port type according to described physical port.
Preferably, in said apparatus, described connection attribute dispensing unit comprises: monitoring information type attribute determination module, for determining the monitoring information type attribute of described port module; Monitoring information source address attribute determination module, for determining the monitoring information source address attribute of described port module; Link port attribute determination module, for determining the link port attribute of described port module; Destination address attribute determination module, for determining the destination address attribute of described port module.
Preferably, in said apparatus, described control interface creation apparatus comprises: start the interface creating unit, for creating the beginning interface; Finish the interface creating unit, for creating the end interface; Advance the interface creating unit, for creating the propelling interface.
Preferably, in said apparatus, described communication interface creation apparatus comprises: receipt message interface creating unit, for creating the receipt message interface; Send the message interface creating unit, for creating the transmission message interface.
As can be seen here, beneficial effect of the present invention is: the signal system model created according to modeling method disclosed by the invention and model building device, comprise control interface, configuration interface, communication interface, message processing module, logic processing module and port module, wherein, port module comprises message queue, port attribute and connection attribute, connection attribute can be described the annexation between signal system model and other signal system models, connection attribute according to the signal annexation between each signal system to port module is configured, according to the connection attribute after configuration, can between each signal system model, establish a connection, this annexation is consistent with the annexation between each signal system, when the structure of the simulated environment by a plurality of signal system model buildings changes, need to change the annexation between each signal system model, now only need to again to the connection attribute of port module, be configured according to the annexation after changing, and do not need signal system modeling again, improved the reusability of signal system model, also reduced the development and maintenance cost of simulated environment simultaneously.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills are not making under the creative work prerequisite, and the every other embodiment obtained, belong to protection domain of the present invention.
The invention discloses a kind of modeling method of signal system, can improve the reusability of signal system model, reduce exploitation and the maintenance cost of test environment simultaneously.
Embodiment mono-
Referring to Fig. 1, the process flow diagram of the modeling method that Fig. 1 is the embodiment of the present invention one disclosed a kind of signal system.Comprise:
Step 11: create control interface.
The function that the signal system model will be realized is simulation management, simulation process is controlled, and control interface is for realizing the control to simulation process.
Step 12: create configuration interface.
In the signal system model, configuration interface is configured for the basis signal system data to the signal system model, mainly comprises two aspects: geographical track data, speed limit data as static as circuit, line slope data, bridge data and tunneling data; The signalling arrangement data, as teleseme data, track switch data, transponder data and track circuit data.
Step 13: create communication interface.
In the integration testing process, each signal system model will carry out with simulated environment the transmission of message, and communication interface is for the transmission of messages between settling signal system model and simulated environment.
Step 14: create message processing module.
In the signal system model, message processing module becomes the status data of signal system model inside for the message conversion that communication interface is received.
Step 15: create logic processing module.
In the signal system model, the status data that logic processing module generates message processing module and the status data configured by configuration interface carry out logical calculated, obtain result of calculation, and convert result of calculation to message, transfer to port module.
Step 16: create message queue.
Step 17: the port attribute of determining port module is consistent with the port attribute of signal system physical port.
Step 18: the connection attribute of configured port module is to meet the effect of physical port.
The effect of the physical port in the port module simulating signal system in the signal system model, realize that the signal system model is connected with the signal between other device models.Port module mainly is comprised of three parts: message queue, port attribute and connection attribute.Wherein, the message that message queue arrives for storing received; Port attribute comprises port address and port type; Connection attribute comprises monitoring information type attribute, monitoring information source address attribute, link port attribute and destination address attribute.The port attribute of the port module of signal system model is consistent with the port attribute of the physical port of signal system, determines the port attribute of port module according to the port attribute of the physical port of signal system; The port module of signal system model can the simulating signal system physical port, can set up the annexation between this signal system model and other signal system models by the connection attribute of configured port module, the connection attribute according to the effect (i.e. signal annexation between this physical port and other physical ports) of the physical port of signal system to port module is configured.
The signal system model created according to above-mentioned modeling method, comprise control interface, configuration interface, communication interface, message processing module, logic processing module and port module, wherein, port module comprises message queue, port attribute and connection attribute, connection attribute can be described the annexation between signal system model and other signal system models, connection attribute according to the signal annexation between each signal system to port module is configured, according to the connection attribute after configuration, can between each signal system model, establish a connection, annexation between this annexation and each signal system is consistent, when the structure of the simulated environment by a plurality of signal system model buildings changes, need to change the annexation between each signal system model, now only need to again to the connection attribute of port module, be configured according to the annexation after changing, just can change the annexation between each signal system model, and do not need signal system modeling again, improved the reusability of signal system model, also reduced the development and maintenance cost of simulated environment simultaneously.
It is pointed out that the sequencing of each step execution in above-mentioned modeling method is not done to restriction, i.e. the establishment of modules and interface is sequentially arbitrarily, and this paper has only described wherein a kind of flow process.
Embodiment bis-
Referring to Fig. 2, the process flow diagram of the modeling method that Fig. 2 is the embodiment of the present invention two disclosed a kind of signal systems.Comprise:
Step 21: create and start interface, finish interface and advance interface.
The function that the signal system model will be realized is simulation management, simulation process is controlled.Start interface and enter simulated environment for the control signal system model, register in simulated environment; Stop interface and release simulated environment for the control signal system model, nullify in simulated environment; Advance interface to carry out the propelling of simulation process, i.e. the cycling service of simulating signal system for the control signal system model.Accordingly, the process that creates control interface is specially to create and starts interface, creates and stop interface and create advancing interface, it is pointed out that the sequencing that starts interface, stops interface and advance interface to create is arbitrarily.
Step 22: create configuration interface.
In the signal system model, configuration interface is configured for the basis signal system data to the signal system model, mainly comprises two aspects: geographical track data, speed limit data as static as circuit, line slope data, bridge data and tunneling data; The signalling arrangement data, as teleseme data, track switch data, transponder data and track circuit data.
Step 23: create the receipt message interface and send message interface.
In the integration testing process, each signal system model will carry out with simulated environment the transmission of message, and the receipt message interface is for receiving the message of simulated environment, the input function of simulating signal system; Send message interface for sending message to simulated environment, the output function of simulating signal system.
Step 24: create message processing module.
In the signal system model, message processing module becomes the status data of signal system model inside for the message conversion that communication interface is received.
The status data of signal system model inside generally includes two aspects: geographical track data, speed limit data as static as circuit, line slope data, bridge data and tunneling data; The signalling arrangement configuration data, as teleseme data, track switch data, transponder data and track circuit data.For geographical track data, adopt the mode of chained list to store, in order to mean its topological relation, for example, for all track sections on the whole piece circuit, adopt chained list to connect, when the simulation train moves on the line, can directly find its next track section from a track section, implementation space and temporal optimum.Mode for signalling arrangement the data table is stored, in order to mean its subordinate relation, for example, for equipment such as transponder, track circuits, adopt the mode of key-value pair to store, when needs are inquired about the low frequency code of the message of certain transponder or certain track circuit, can find by its key assignments structure data, implementation space and the temporal optimum corresponding with it.
Step 251: the support object that signal system is simulated environment, the programming language that adopts simulated environment is to the realization of programming of the internal process of signal system.
Step 252: the measurand that signal system is simulated environment, the logic processing module of encapsulated signal system, and be its configuration data translater and network communication interface.
Determine the type under signal system is in simulated environment, for dissimilar signal system, can adopt the logic processing module that creates in two ways the signal system model.If the signal system model belongs to the support object of simulated environment, when perhaps the internal logic of the signal system of this signal system model simulation is comparatively simple, the programming language that can adopt simulated environment is to the realization of programming of the internal process of signal system, for example, for signal systems such as transponder, track circuits, its object of support as simulated environment, have One's name is legion, feature that logic function is single, can adopt the mode of programming to create logic processing module; If the signal system model belongs to the measurand of simulated environment, radio block center for example, the core signal systems such as board units, the logic processing module of signal system encapsulated, and be its configuration data translater and network communication interface, now the structure of logic processing module is as shown in Figure 3.
Wherein, the configuration data that the status data that message processing module obtains and configuration interface obtain, transfer to the data translation device by network communication interface; The data translation device translates into by status data and configuration data the form that the logic processing module of signal system can be identified, and is sent to the logic processing module of signal system after encapsulation by network communication interface; After encapsulation, the logic processing module of signal system is carried out logical operation to discernible status data and configuration data, and the logical consequence obtained is sent to the data translation device by network communication interface; The data translation device is translated into the discernible form of simulated environment (message) by logical consequence, and transfers to port module by network communication interface.
Step 26: create message queue.
The message can the storing received message interface in message queue received from simulated environment, the message also can the stored logic processing module generated, each port module is safeguarded a message queue.
Step 27: the port address of determining port module is consistent with the port address of physical port.
The physical port of each signal system all has a port address, the port address of the port module of signal system model is defined as to the port address of physical port.
Step 281: if the port type of physical port is bus-type, the port type of determining port module is Bus.
Step 282: if the port type of physical port is end-to-end type, the port type of determining port module is EndToEnd.
The physical port of signal system can be the port of the bus-types such as Ethernet, CAN, can be also the end-to-end ports such as serial ports, I/O mouth, if the physical port of signal system is bus-type, accordingly the port type of port module is defined as to Bus, if the physical port of signal system is end-to-end type, accordingly the port type of port module is defined as to EndToEnd.
Step 29: determine the effect of physical port.
Step 2101: if physical port determines that for receiving the message of particular type the monitoring information type attribute of port module is consistent with the type of physical port receipt message.
Step 2102: if physical port determines that for receiving the message of particular source the monitoring information source address attribute of port module is consistent with the address, source of physical port receipt message.
Step 2103: if physical port for linking with another physical port, determines that the address of another physical port that the link port attribute of port module links with physical port is consistent.
Step 2104; If physical port, for send message to the specific purpose address, determines that the destination address attribute of port module is consistent with the destination address that physical port sends message.
In force, when the port type of port module is Bus, monitoring information type attribute, monitoring information source address attribute and the destination address attribute of port module can be determined, when the port type of port module is EndToEnd, the link port attribute of port module can be determined.
By the configuration to the port module connection attribute, the message between port module connects and can realize by four kinds of modes.As follows:
By configuration monitoring information type attribute, port module can be monitored the message of the particular type produced by other port module; By configuration monitoring information source address attribute, port module can be monitored all message that produced by the particular port module; Link port attribute by configuration, port module can directly be connected with another port module, realizes man-to-man communication; By the configuration purpose address properties, port module can send to message the port module of particular address.
The invention also discloses a kind of model building device of signal system, can improve the reusability of signal system model, reduce exploitation and the maintenance cost of test environment.
Referring to Fig. 4, the structural representation that Fig. 4 is a kind of signal system model building device disclosed by the invention.Comprise: control interface creation apparatus 1, configuration interface creation apparatus 2, communication interface creation apparatus 3, message processing module creation apparatus 4, logic processing module creation apparatus 5 and port module creation apparatus 6.
Control interface creation apparatus 1 is for creating the control interface of signal system model, configuration interface creation apparatus 2 is for creating the configuration interface of described signal system model, communication interface creation apparatus 3 is for creating the communication interface of described signal system model, message processing module creation apparatus 4 is for creating the message processing module of described signal system model, and logic processing module creation apparatus 5 is for creating logic processing module according to signal system type under simulated environment; Port module creation apparatus 6 is for creating the port module of described signal system model.
Wherein, control interface creation apparatus 1 comprises: start interface creating unit 11, for creating the beginning interface; Finish interface creating unit 12, for creating the end interface; Advance interface creating unit 13, for creating the propelling interface.
Communication interface creation apparatus 3 comprises: receipt message interface creating unit 31, for creating the receipt message interface; Send message interface creating unit 32, for creating the transmission message interface.
Port module creation apparatus 6 comprises: message queue creating unit 61, for creating the message queue of port module; Port attribute determining unit 62 is consistent with the port attribute of signal system physical port for the port attribute of determining port module; Connection attribute dispensing unit 63, for the connection attribute of configured port module to meet the effect of physical port.
The port attribute of port module comprises port address and port type.Port attribute determining unit 62 comprises: determine the port address determination module 621 of the port address of port module for the port address according to physical port, and the port type determination module 622 of determining the port type of port module for the port type according to physical port.
The connection attribute of port module comprises monitoring information type attribute, monitoring information source address attribute, link port attribute and destination address attribute.Connection attribute dispensing unit 63 comprises: for the monitoring information type attribute determination module 631 of the monitoring information type attribute of determining port module, for the monitoring information source address attribute determination module 632 of the monitoring information source address attribute of determining port module, for the link port attribute determination module 633 of the link port attribute of determining port module, and for the destination address attribute determination module 634 of the destination address attribute of determining port module.
The signal system model that model building device by above-mentioned signal system creates, the connection attribute of its port module can be determined the annexation between this signal system model and other signal system models, connection attribute by 63 pairs of signal system model port modules of connection attribute dispensing unit is configured, can set up the annexation between each signal system model, when the structure of the simulated environment by a plurality of signal system model buildings changes, need to change the annexation between each signal system model, now only need to be according to the annexation after changing, by connection attribute dispensing unit 63, again the connection attribute of port module is configured, just can change the annexation between each signal system model, and do not need signal system modeling again, improved the reusability of signal system model, also reduced the development and maintenance cost of simulated environment simultaneously.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment that between each embodiment, identical similar part is mutually referring to getting final product.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part partly illustrates and gets final product referring to method.
It will be understood by those skilled in the art that and can mean information, message and signal with much different technique and any one in technology.For example, the message of mentioning in above-mentioned explanation, information can be expressed as voltage, electric current, electromagnetic wave, magnetic field or magnetic particle, light field or above combination in any.