CN110868344A - Method, system, device and computer readable medium for simulating MVB - Google Patents
Method, system, device and computer readable medium for simulating MVB Download PDFInfo
- Publication number
- CN110868344A CN110868344A CN201910989679.4A CN201910989679A CN110868344A CN 110868344 A CN110868344 A CN 110868344A CN 201910989679 A CN201910989679 A CN 201910989679A CN 110868344 A CN110868344 A CN 110868344A
- Authority
- CN
- China
- Prior art keywords
- data
- packet
- socket
- mvb
- time interval
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000005540 biological transmission Effects 0.000 claims abstract description 47
- 238000004590 computer program Methods 0.000 claims description 20
- 239000000872 buffer Substances 0.000 claims description 19
- 238000004806 packaging method and process Methods 0.000 claims description 7
- 230000003139 buffering effect Effects 0.000 claims description 4
- 238000004088 simulation Methods 0.000 abstract description 12
- 238000011161 development Methods 0.000 abstract description 3
- 238000004891 communication Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000012856 packing Methods 0.000 description 4
- 230000002457 bidirectional effect Effects 0.000 description 2
- 230000003111 delayed effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000002054 transplantation Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40013—Details regarding a bus controller
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a method, a system, a device and a computer readable medium for simulating MVB, wherein the method comprises the steps of receiving first data according to a first time interval, forming the first data into a socket data packet, sending the socket data packet through Ethernet according to a second time interval, receiving the socket data packet sent through the Ethernet according to the second time interval, decomposing the socket data packet into second data, receiving and caching the second data, and sending the second data according to the first time interval. Through Socket and Ethernet simulation MVB transmission, the undifferentiated data transmission simulation experiment of the equipment software program can be realized through one PC, and the equipment software program can be rapidly debugged in real time through the PC, so that the development efficiency is improved, and the debugging cost is reduced.
Description
Technical Field
The invention belongs to the field of rail transit, and particularly relates to a method, a system, a device and a computer readable medium for simulating MVB.
Background
The TCN (train control communication network) provides that a train communication network is divided into an MVB (multifunctional vehicle bus) and a WTB (hinged train bus), wherein the MVB is a bus topological structure and is specially used for communication between vehicle-mounted equipment in a vehicle, when the MVB carries out data transmission, the bus equipment outputs data at a certain time interval, a port is refreshed, and when other bus equipment needs the data, the data can be read from the corresponding port. The interoperability of MVBs requires real-time and accurate data transmission.
As shown in fig. 1 and 4, an MVB communication mode is adopted between actual train control vehicle-mounted ATP devices, and the MVB communication mode is characterized by interchangeability and interoperability, fixed data ports are provided for interactive data transmission between the devices, port data are periodically refreshed, and the bus devices realize communication and interaction through read-write ports.
Due to the characteristics of the MVB, the multifunctional vehicle bus is more commonly applied to train control vehicle-mounted ATP (automatic train protection), and the real MVB bus is difficult to use technically and cost in the debugging process of the PC; the establishment of the MVB bus needs a series of hardware support such as a bus controller, a gateway, a repeater, a connector and a terminator, the implementation cost is high in a laboratory environment, and the existing technical scheme based on MVB communication cannot meet the scene requirement.
Disclosure of Invention
In view of the above problems, the present invention provides a method, system, device and computer readable medium for simulating MVB.
The method for simulating MVB provided by the invention comprises the following steps
Receiving first data according to a first time interval;
forming the first data into a socket data packet;
according to a second time interval, sending a socket data packet through the Ethernet;
receiving a socket data packet sent by the Ethernet according to a second time interval, and decomposing the socket data packet into second data;
and receiving and buffering the second data, and sending the second data according to the first time interval.
Preferably, the Socket data packet includes at least one sub-packet, and the header of the sub-packet is written with the port number of the source port or the destination port;
and caching the socket data packet into a corresponding destination port based on the port number.
Preferably, a plurality of second data are received simultaneously, whether the size of the plurality of second data is larger than the cache space of the destination port is judged, and the following steps are executed according to the judgment result, wherein the steps include:
under the condition that the cache space of the plurality of destination ports is not larger than that of the plurality of destination ports, the plurality of second data are cached and enter the corresponding plurality of destination ports simultaneously;
and under the condition that the buffer space of the second data is larger than the buffer space of the plurality of destination ports, the plurality of second data enter the corresponding destination ports in a batch buffer mode.
Preferably, the socket data packet is written with an MVB identification.
Preferably, after receiving the first data, the first data is buffered.
Preferably, the second time interval is equal to or less than the first time interval.
The invention also provides a system for simulating MVB, comprising:
a sending module, configured to receive first data according to a first time interval;
the packaging module is used for forming the first data into a socket data packet;
the transmission module is used for sending the socket data packet through the Ethernet according to a second time interval;
the unpacking module is used for receiving the socket data packet sent by the Ethernet according to a second time interval and decomposing the socket data packet into second data;
and the reading module is used for receiving and caching the second data and sending the second data according to the first time interval.
Preferably, the Socket data packet includes at least one sub-packet, and the header of the sub-packet is written with the port number of the source port or the destination port;
and caching the socket data packet into a corresponding destination port based on the port number.
Preferably, the reading module receives a plurality of second data at the same time, and the reading module determines whether the size of the plurality of second data is larger than the cache space of the plurality of destination ports;
under the condition that the cache space of the plurality of destination ports is not larger than that of the plurality of destination ports, the plurality of second data are cached and enter the corresponding destination ports simultaneously;
and under the condition that the buffer space of the second data is larger than the buffer space of the plurality of destination ports, the plurality of second data enter the corresponding destination ports in a batch buffer mode.
Preferably, the socket data packet is written with an MVB identification.
Preferably, after receiving the first data, the sending module buffers the first data.
Preferably, the second time interval is equal to or less than the first time interval.
The invention also proposes a device for simulating an MVB, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method for simulating an MVB according to any one of claims 1 to 6 when executing the computer program.
The invention also proposes a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of simulating an MVB according to any one of claims 1 to 6.
According to the method and the system for simulating the MVB, the MVB transmission is simulated through the Socket and the Ethernet, a non-differential data transmission simulation experiment of the equipment software program can be realized through one PC, the equipment software program can be rapidly debugged in real time through the PC, the development efficiency is improved, and the debugging cost is reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 shows a schematic diagram of MVB transmission in the prior art;
FIG. 2 is a schematic diagram illustrating simulation of MVB in the present embodiment;
FIG. 3 is a diagram illustrating simulated MVB data transmission in the present embodiment;
FIG. 4 shows a schematic diagram of a prior art MVB port;
FIG. 5 is a schematic diagram illustrating simulation of MVB in the present embodiment;
fig. 6 is a flowchart illustrating a method for simulating MVB in this embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to simulate an information transmission environment of an ATP (automatic train protection device) platform device, a Socket (Socket) simulation MVB bus mode is adopted for communication in the embodiment, the MVB and the ethernet are set differently in a physical layer, a protocol layer, a link layer and the like of a computer network, the MVB data is stored in an MVB bus port on the premise that new data refreshing does not exist, a receiver can read the data for many times, but the ethernet data can be received only once after being sent, that is, the receiver cannot read the data again through an ethernet interface function after reading once; therefore, in this embodiment, a scheme of combining ethernet with socket is adopted to simulate the MVB.
Socket is an abstraction layer to complete data transmission between two application programs, the application programs can send or receive data through the Socket, and can perform operations such as opening, reading, writing and closing the data as files, and a Socket interface is adopted to simulate an MVB to perform data storage, so that rapid debugging and transplantation of equipment software programs are facilitated.
Referring to fig. 2, a common ethernet in a PC communication environment is selected to implement data interaction between two devices. In a PC (personal computer), simulating two train control vehicle-mounted devices, wherein each train control vehicle-mounted device comprises a train traction unit, a train brake unit, a vehicle door control unit, a display unit and the like, simulating two different train control vehicle-mounted device software in the PC according to actual test requirements, calling the simulated train control vehicle-mounted devices as virtual train control vehicle-mounted devices, adding a layer of virtual MVB software on the bottom layer of the application software of the virtual train control vehicle-mounted devices, wherein the virtual MVB software is provided with an MVB port, and the port of the virtual MVB is connected with the MVB port of the train control vehicle-mounted device software so as to realize data transmission and realize simulation of an MVB related interface function of the device application software; the virtual train control onboard device A, B and the virtual MVB workflow are as follows:
the device a/B (software program) calls the MVB related interface function to write the port, which is the virtual source port in the virtual MVB software, at a first time interval t 1.
The device A/B virtual MVB software enables data of the virtual source port to form a Socket data packet according to a certain protocol format;
every second time interval t2, the Socket data packet is sent to the device B/A through the Ethernet;
at intervals of a second time interval t2, reading Ethernet data by the B/A virtual MVB software of the equipment, splitting a Socket data packet according to a certain protocol format, and respectively storing the Socket data packet into virtual destination ports of the B/A virtual MVB software of the equipment;
and calling an MVB related interface function by the device B/A to read a port at a first time interval t1, wherein the port is a virtual destination port in virtual MVB software, so that data transmission between the device A and the device B is realized.
Fig. 3 shows a general flow of data transmission between a device a and a device B, where the device a packages data to be transmitted into a socket data packet, the socket data packet is transmitted to the device B via an ethernet, and the device B unpacks the socket data packet to obtain data.
Fig. 4 shows a schematic diagram of data transmission at an MVB port, the MVB data transmission has a fixed data port, data is packaged firstly between vehicle-mounted devices through MVB communication, the data is transmitted to an ATP device platform, the data is stored in the corresponding MVB port according to port numbers 1 to n and addresses, other devices can read the latest data from the corresponding port at any time according to requirements, and data transmission and periodic refreshing are achieved. Therefore, the virtual MVB software in this embodiment is also provided with a plurality of ports, and data is transmitted through the virtual ports of the virtual MVB software.
Specifically, referring to fig. 5, the present embodiment provides a system for simulating an MVB, that is, the virtual MVB software, including:
the system comprises a sending module, a packet module and a packet module, wherein the sending module is provided with n source ports, the source ports are provided with port numbers according to the sequence of 1-n, the sending module is used for receiving first data according to a first time interval t1, namely the virtual column control vehicle-mounted equipment in the PC writes the first data into the corresponding source port of the sending module at the time of every first time interval t1, and simultaneously sends the received first data to the packet module;
the packaging module receives the first data sent by the sending module and forms the first data into a socket data packet according to a preset protocol;
the transmission module is used for transmitting the socket data packet formed by the group package module to the unpacking module of the other simulation MVB system through the Ethernet according to a second time interval t 2;
the unpacking module is used for receiving a socket data packet sent by the transmission module of the other simulation MVB system through the Ethernet according to a second time interval t2, and decomposing the socket data packet into second data according to a preset protocol;
the reading module is provided with n destination ports, the destination ports are provided with port numbers according to the sequence of 1-n, the reading module is used for receiving second data, caching the second data to enter the corresponding destination ports, and sending the second data according to a first time interval t1, namely the virtual train control vehicle-mounted equipment in the PC reads the second data in the destination ports at the moment of every first time interval t 1.
In this embodiment, when performing packet packing, each Socket packet may include one or more source port data sub-packets, a packet header of the Socket data packet specifies a length, a data portion is formed by concatenating one or more sub-packets formed by one or more MVB port data, and each sub-packet header includes a port number and a sub-packet length. The unpacking module corresponds sub-packages to different destination port data caches according to a protocol for reading by the virtual train control vehicle-mounted equipment; specifically, the socket data packet is in the form of: the packet length (short), the packet header (short), the messages (string) + the packet tail (short), and the Message structure is as follows: [ sub-packet header 1 (length + source port number or destination port number) + sub-packet data 1] + [ sub-packet header 2 (length + source port number or destination port number) + sub-packet data 2] … … + [ sub-packet header n (length + source port number or destination port number) + sub-packet data n ]; the unpacking module is used for decomposing the socket data packet into a plurality of sub-packets after receiving the socket data packet, decomposing the sub-packets into a plurality of second data, and caching the plurality of second data to corresponding destination ports according to the port numbers written in the packet heads of the sub-packets.
According to the size of data written into a source port, the data of the source port are reasonably packaged, a sub-packet is formed by the data of each source port, and a plurality of sub-packets are connected in series to form a socket data packet and are sent together on the premise that the length of the socket data packet does not exceed the allowable length. Exemplarily, the device a sends data to the device B, where the first time interval t1 is 100ms, the second time interval t2 is 40ms, the device a writes the first data to the source port 1 and the source port 2 of the sending module every 100ms, and the sending module sends the first data to the group packet module after receiving the first data.
The first data of packet group module with source port 1 constitutes sub-packet 1, and port number 1 is write into to the packet head of sub-packet 1, constitutes sub-packet 2 with the first data of source port 2, and port number 2 is write into to the packet head of sub-packet 2, constitutes the socket data package with sub-packet 1 and sub-packet 2, and the socket data package format is: packet length (short) + packet header (short) + [ sub-packet 1 header (length + port number 1) + sub-packet 1 data ] + [ sub-packet 2 header (length + port number 2) + sub-packet 2 data ] + packet end (short).
And the transmission module sends the socket data packet to an unpacking module of virtual MVB software at the bottom layer of the device B through the Ethernet every 40 ms.
The unpacking module is used for decomposing the socket data packet to obtain a sub-packet 1 and a sub-packet 2, identifying that the port number of the packet head of the sub-packet 1 is 1, the port number of the packet head of the sub-packet 2 is 2, and then decomposing the sub-packet 1 to obtain second data, and decomposing the sub-packet 2 to obtain second data.
The reading module stores the second data analyzed by the sub-packet 1 into a destination port 1 of the reading module based on the port number of the packet head of the sub-packet 1, stores the second data analyzed by the sub-packet 2 into a destination port 2 of the reading module, and the device B reads the second data in the destination port every 100 ms; therefore, data are transmitted from the equipment A to the equipment B, and the purpose of socket and Ethernet analog MVB transmission is achieved.
Therefore, in the embodiment, the communication environment simulation of the vehicle-mounted equipment is mainly used, the socket and the Ethernet are used for simulating the MVB to perform data transmission and updating, a non-differential data transmission simulation experiment of the equipment software program can be realized through one PC, the equipment software program can be rapidly debugged in real time through the PC, the development efficiency is improved, and the debugging cost is reduced.
The n destination ports of the reading module share one storage space, and when the reading module receives a plurality of second data at the same time;
the reading module judges whether the sum of the second data is larger than the cache space;
under the condition that the cache space is not larger than the cache space, a plurality of second data are cached and enter corresponding destination ports at the same time;
and when the data size is larger than the cache space, a plurality of second data are cached in batches and enter the corresponding destination ports, and the stored data are read out and then are put into the next batch of data, so that the data loss is avoided.
For example, the storage space of the destination port is 100M, and the received second data to enter the destination port 1 is 50M, and the received second data to enter the destination port 2 is 40M, obviously, the storage space can accommodate the next two sets of second data at the same time, and therefore, the two sets of second data can be stored in the destination port 1 and the destination port 2 at the same time;
if the received second data to be entered into the destination port 1 is 50M, that is, the received second data to be entered into the destination port 2 is 60M, it is obvious that the storage space cannot accommodate the next two sets of second data, and therefore, the second data with the size of 50M may be stored into the destination port 1, and after the virtual train control onboard device reads the second data with the size of 50M, the second data with the size of 60M may be stored into the destination port 2.
The socket data packet is written with an MVB identifier, the unpacking module is identified as an MVB information packet through the MVB identifier, and the analysis is carried out according to a specified protocol.
Illustratively, the packaging module and the unpacking module agree with each other, an int value is added in front of each socket data packet of the packaging module, the unpacking module identifies the int value, and then the data in the data packet is determined to be MVB data, and the unpacking module analyzes the data.
Further, after receiving the first data, the sending module caches the first data, and organizes the data of the source port according to task scheduling.
In order to ensure the integrity and the real-time performance of data transmission, the second time interval t2 is less than or equal to the first time interval t 1; for example, the first time interval t1 is 100ms, the second time interval t2 is 40ms, and since transmission is performed every 40ms, and a socket packet is formed every 100ms, the socket packet will not be lost due to delayed transmission;
if the first time interval t1 is 40ms and the second time interval t2 is 100ms, since the transmission is performed every 100ms and the socket data packet is composed every 40ms, the transmission speed is lower than the packet-packing speed, which may result in packet loss.
In this embodiment, the socket of the emulated MVB system adopts a semi-coherent description, and performs data transmission in a streaming socket format according to the port and the local address of the virtual MVB software, and the streaming socket provides a reliable, connection-oriented, bidirectional data transmission service, and realizes error-free and repeat-free data transmission. The streaming socket is provided with flow control, and the transmitted data is regarded as a byte stream without record boundaries. In the TCP/IP protocol cluster, the TCP protocol is used to realize the transmission of byte stream, and when a user wants to send a large amount of data or has a high requirement on data transmission, a streaming socket can be used.
Referring to fig. 6, this embodiment further provides a method for simulating an MVB, including the following steps:
receiving first data at a first time interval t 1;
forming a socket data packet by the first data according to a preset protocol;
sending the socket data packet through the Ethernet according to a second time interval t 2;
receiving a socket data packet sent by the Ethernet according to a second time interval t2, and decomposing the socket data packet into second data;
and receiving and buffering the second data, and sending the second data according to the first time interval t 1.
In this embodiment, when performing packet packing, each Socket packet may include one or more source port data sub-packets, a packet header of the Socket data packet specifies a length, a data portion is formed by concatenating one or more sub-packets formed by one or more MVB port data, and each sub-packet header includes a port number and a sub-packet length. The unpacking module corresponds sub-packages to different destination port data caches according to a protocol for reading by the virtual train control vehicle-mounted equipment; specifically, the socket data packet is in the form of: the packet length (short), the packet header (short), the messages (string) + the packet tail (short), and the Message structure is as follows: [ sub-packet header 1 (length + source port number or destination port number) + sub-packet data 1] + [ sub-packet header 2 (length + source port number or destination port number) + sub-packet data 2] … … + [ sub-packet header n (length + source port number or destination port number) + sub-packet data n ]; the unpacking module is used for decomposing the socket data packet into a plurality of sub-packets after receiving the socket data packet, decomposing the sub-packets into a plurality of second data, and caching the plurality of second data to corresponding destination ports according to the port numbers written in the packet heads of the sub-packets.
According to the size of data written into a source port, the data of the source port are reasonably packaged, a sub-packet is formed by the data of each source port, and a plurality of sub-packets are connected in series to form a socket data packet and are sent together on the premise that the length of the socket data packet does not exceed the allowable length.
If a plurality of second data are received simultaneously;
judging whether the sum of the sizes of the plurality of second data is larger than the cache space of the destination port or not;
under the condition that the cache space of the destination port is not larger than that of the destination port, a plurality of second data are cached and enter a plurality of corresponding destination ports at the same time;
and under the condition that the buffer space of the destination port is larger than the buffer space of the destination port, the second data enter the corresponding destination ports in a batch buffer mode.
For example, the storage space of the destination port is 100M, and the received second data to enter the destination port 1 is 50M, and the received second data to enter the destination port 2 is 40M, obviously, the storage space can accommodate the next two sets of second data at the same time, and therefore, the two sets of second data can be simultaneously stored in the ports;
if the received second data to be entered into the destination port 1 is 50M, that is, the received second data to be entered into the destination port 2 is 60M, it is obvious that the storage space cannot accommodate the next two sets of second data, and therefore, the second data with the size of 50M may be stored into the destination port 1, and after the virtual train control onboard device reads the second data with the size of 50M, the second data with the size of 60M may be stored into the destination port 2.
The socket data packet is written with an MVB identifier, is identified as an MVB information packet through the MVB identifier, and is analyzed according to a specified protocol.
Illustratively, an int value is added in front of each socket data packet, and when the int value is identified, the data in the data packet is judged to be MVB data, and the socket data packet is analyzed.
And after receiving the first data, caching the first data, and organizing the data of the sending source port according to task scheduling.
In order to ensure the integrity and the real-time performance of data transmission, the second time interval t2 is less than or equal to the first time interval t 1; for example, the first time interval t1 is 100ms, the second time interval t2 is 40ms, and since transmission is performed every 40ms, and a socket packet is formed every 100ms, the socket packet will not be lost due to delayed transmission;
if the first time interval t1 is 40ms and the second time interval t2 is 100ms, since the transmission is performed every 100ms and the socket data packet is composed every 40ms, the transmission speed is lower than the packet-packing speed, which may result in packet loss.
In this embodiment, the socket of the simulation MVB method adopts semi-correlation description, and performs data transmission in a streaming socket format according to the port and the local address of the virtual MVB software, and the streaming socket provides a reliable, connection-oriented, bidirectional data transmission service, and realizes error-free and repeated data transmission. The streaming socket is provided with flow control, and the transmitted data is regarded as a byte stream without record boundaries. In the TCP/IP protocol cluster, the TCP protocol is used to realize the transmission of byte stream, and when a user wants to send a large amount of data or has a high requirement on data transmission, a streaming socket can be used.
The embodiment also provides a device for simulating an MVB, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for simulating an MVB when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the apparatus for simulating the MVB. For example, the computer program may be divided into a sending module, a packaging module, a transmission module, an unpacking module and a reading module, and the specific functions of the modules are as follows:
a sending module, configured to receive first data according to a first time interval t 1;
the packaging module is used for forming the first data into a socket data packet;
the transmission module is used for sending the socket data packet through the Ethernet according to a second time interval t 2;
the unpacking module is used for receiving the socket data packet sent by the Ethernet according to a second time interval t2 and decomposing the socket data packet into second data;
and the reading module is used for receiving and buffering the second data, and sending the second data according to the first time interval t 1.
The device for simulating the MVB can be a desktop computer, a notebook, a palm computer, a cloud server and other computing equipment. The means for simulating an MVB may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that fig. 5 is merely an example of a means for emulating an MVB and does not constitute a limitation of means for emulating an MVB and may include more or fewer components than shown or some components in combination or different components, e.g., the means for emulating an MVB may also include input output devices, network access devices, buses, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is the control center for the device that simulates the MVB, and connects the various parts of the entire device that simulates the MVB using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement the various functions of the apparatus for simulating an MVB by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The computer program, when executed by a processor, implements the steps of the method of simulating an MVB.
The device-integrated modules/units simulating the MVB, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer-readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (14)
1. A method for simulating MVB is characterized in that:
receiving first data according to a first time interval;
forming the first data into a socket data packet;
according to a second time interval, sending a socket data packet through the Ethernet;
receiving a socket data packet sent by the Ethernet according to a second time interval, and decomposing the socket data packet into second data;
and receiving and buffering the second data, and sending the second data according to the first time interval.
2. The method of claim 1, wherein a Socket packet comprises at least one sub-packet, and a header of the sub-packet is written to a port number of a source port or a destination port;
and caching the socket data packet into a corresponding destination port based on the port number.
3. The method of claim 2, wherein a plurality of second data are received simultaneously, whether the size of the plurality of second data is larger than the buffer space of the destination port is determined, and the following steps are performed according to the determination result, the steps including:
under the condition that the cache space of the plurality of destination ports is not larger than that of the plurality of destination ports, the plurality of second data are cached and enter the corresponding plurality of destination ports simultaneously;
and under the condition that the buffer space of the second data is larger than the buffer space of the plurality of destination ports, the plurality of second data enter the corresponding destination ports in a batch buffer mode.
4. A method of emulating an MVB as claimed in any of claims 1-3, wherein a socket packet is written with an MVB identification.
5. The method of any of claims 1-3, wherein the first data is buffered after receiving the first data.
6. The method of any of claims 1-3, wherein the second time interval is less than or equal to the first time interval.
7. A system for simulating an MVB, comprising:
a sending module, configured to receive first data according to a first time interval;
the packaging module is used for forming the first data into a socket data packet;
the transmission module is used for sending the socket data packet through the Ethernet according to a second time interval;
the unpacking module is used for receiving the socket data packet sent by the Ethernet according to a second time interval and decomposing the socket data packet into second data;
and the reading module is used for receiving and caching the second data and sending the second data according to the first time interval.
8. The system of claim 7, wherein the Socket packet includes at least one sub-packet, and a header of the sub-packet is written to a port number of the source port or the destination port;
and caching the socket data packet into a corresponding destination port based on the port number.
9. The system of claim 8, wherein the reading module receives a plurality of second data simultaneously, and the reading module determines whether the size of the plurality of second data is larger than the buffer space of the plurality of destination ports;
under the condition that the cache space of the plurality of destination ports is not larger than that of the plurality of destination ports, the plurality of second data are cached and enter the corresponding destination ports simultaneously;
and under the condition that the buffer space of the second data is larger than the buffer space of the plurality of destination ports, the plurality of second data enter the corresponding destination ports in a batch buffer mode.
10. A system for simulating an MVB as claimed in any one of claims 7 to 9, wherein the socket data packet is written with an MVB identifier.
11. The system of any one of claims 7-9, wherein the sending module buffers the first data after receiving the first data.
12. The system of any of claims 7-9, wherein the second time interval is less than or equal to the first time interval.
13. An apparatus for simulating an MVB comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for simulating an MVB of any of claims 1-6 when executing the computer program.
14. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of simulating an MVB according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910989679.4A CN110868344B (en) | 2019-10-17 | 2019-10-17 | Method, system, device and computer readable medium for simulating MVB |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910989679.4A CN110868344B (en) | 2019-10-17 | 2019-10-17 | Method, system, device and computer readable medium for simulating MVB |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110868344A true CN110868344A (en) | 2020-03-06 |
CN110868344B CN110868344B (en) | 2022-04-19 |
Family
ID=69652301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910989679.4A Active CN110868344B (en) | 2019-10-17 | 2019-10-17 | Method, system, device and computer readable medium for simulating MVB |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110868344B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115348199A (en) * | 2022-07-07 | 2022-11-15 | 株洲中车时代电气股份有限公司 | Vehicle-mounted network debugging system and method based on MVB bus |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201114156Y (en) * | 2007-08-06 | 2008-09-10 | 谢步明 | GPRS-MVB gateway based on 8051CPU core |
CN101887379A (en) * | 2010-06-18 | 2010-11-17 | 北京航空航天大学 | Virtual network card-based wireless channel simulation method |
CN201690463U (en) * | 2010-03-05 | 2010-12-29 | 中国铁道科学研究院机车车辆研究所 | Vehicle communication network analyzer |
CN102621436A (en) * | 2012-05-02 | 2012-08-01 | 中国铁道科学研究院机车车辆研究所 | Single vehicle debugging test stand and debugging method |
US20130332141A1 (en) * | 2012-06-11 | 2013-12-12 | Synopsys, Inc. | Dynamic model adaptation to interface protocols |
CN103514074A (en) * | 2013-09-06 | 2014-01-15 | 清华大学 | MVB network card development method and platform |
CN105049439A (en) * | 2015-08-06 | 2015-11-11 | 株洲南车时代电气股份有限公司 | Protocol configuration based data communication method for locomotive display equipment |
CN106254348A (en) * | 2016-08-08 | 2016-12-21 | 中国地质大学武汉 | A kind of Wireless LAN communication method based on Android |
CN106790162A (en) * | 2016-12-29 | 2017-05-31 | 中国科学院计算技术研究所 | Virtual network optimization method and system |
CN107390549A (en) * | 2017-09-04 | 2017-11-24 | 中车青岛四方车辆研究所有限公司 | CRH5 types car control logic analogue system and method |
CN109525684A (en) * | 2018-12-11 | 2019-03-26 | 杭州数梦工场科技有限公司 | Message forwarding method and device |
CN109600278A (en) * | 2018-12-10 | 2019-04-09 | 浪潮(北京)电子信息产业有限公司 | A kind of data communications method, device, equipment and medium |
-
2019
- 2019-10-17 CN CN201910989679.4A patent/CN110868344B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201114156Y (en) * | 2007-08-06 | 2008-09-10 | 谢步明 | GPRS-MVB gateway based on 8051CPU core |
CN201690463U (en) * | 2010-03-05 | 2010-12-29 | 中国铁道科学研究院机车车辆研究所 | Vehicle communication network analyzer |
CN101887379A (en) * | 2010-06-18 | 2010-11-17 | 北京航空航天大学 | Virtual network card-based wireless channel simulation method |
CN102621436A (en) * | 2012-05-02 | 2012-08-01 | 中国铁道科学研究院机车车辆研究所 | Single vehicle debugging test stand and debugging method |
US20130332141A1 (en) * | 2012-06-11 | 2013-12-12 | Synopsys, Inc. | Dynamic model adaptation to interface protocols |
CN103514074A (en) * | 2013-09-06 | 2014-01-15 | 清华大学 | MVB network card development method and platform |
CN105049439A (en) * | 2015-08-06 | 2015-11-11 | 株洲南车时代电气股份有限公司 | Protocol configuration based data communication method for locomotive display equipment |
CN106254348A (en) * | 2016-08-08 | 2016-12-21 | 中国地质大学武汉 | A kind of Wireless LAN communication method based on Android |
CN106790162A (en) * | 2016-12-29 | 2017-05-31 | 中国科学院计算技术研究所 | Virtual network optimization method and system |
CN107390549A (en) * | 2017-09-04 | 2017-11-24 | 中车青岛四方车辆研究所有限公司 | CRH5 types car control logic analogue system and method |
CN109600278A (en) * | 2018-12-10 | 2019-04-09 | 浪潮(北京)电子信息产业有限公司 | A kind of data communications method, device, equipment and medium |
CN109525684A (en) * | 2018-12-11 | 2019-03-26 | 杭州数梦工场科技有限公司 | Message forwarding method and device |
Non-Patent Citations (2)
Title |
---|
张友兵: "列控车载数据中心的软件设计", 《铁道通信信号》 * |
樊高: "基于以太列车骨干网的高速列车网络性能仿真研究", 《中国优秀硕士学位论文全文数据库 信息科技Ⅱ辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115348199A (en) * | 2022-07-07 | 2022-11-15 | 株洲中车时代电气股份有限公司 | Vehicle-mounted network debugging system and method based on MVB bus |
Also Published As
Publication number | Publication date |
---|---|
CN110868344B (en) | 2022-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110909460B (en) | V2X simulation test method, device, equipment and storage medium for Internet of vehicles | |
WO2017005010A1 (en) | Audio processing method and device, and computer storage medium | |
CN112861468B (en) | Software and hardware collaborative simulation verification method, device and medium | |
CN109743291A (en) | A kind of telemetry real time processing system and method based on round-robin queue | |
CN108123894B (en) | Method for realizing low-delay transmission of sampled data stream based on Intel gigabit network card | |
CN110297944B (en) | Distributed XML data processing method and system | |
CN102395958B (en) | Concurrent processing method and device for data packet | |
CN116028292B (en) | Simulation verification system and method for remote direct memory access simulation verification | |
US10360913B2 (en) | Speech recognition method, device and system based on artificial intelligence | |
CN104378161B (en) | A kind of FCoE agreement accelerating engine IP kernel based on AXI4 bus architecture | |
CN109951494A (en) | Emulate data processing method, device, emulator and storage medium | |
CN115905061B (en) | Data transfer device, DMA device, electronic apparatus, and data transfer method | |
CN110719215A (en) | Flow information acquisition method and device of virtual network | |
EP3982268A2 (en) | Chassis simulation method and apparatus, server, storage medium and program product | |
CN107391285A (en) | Internal memory sharing method and system | |
CN110868344B (en) | Method, system, device and computer readable medium for simulating MVB | |
CN115904259B (en) | Processing method and related device of nonvolatile memory standard NVMe instruction | |
CN107391672A (en) | The reading/writing method of data and the distributed file system of message | |
CN115002087B (en) | Audio and video data transmission method, system, device and storage medium | |
CN117730284A (en) | Method and simulator for testing at least one controller | |
CN113590408B (en) | Data access method, data access device, simulation device and simulation TCAM chip | |
CN109861967A (en) | Remote direct memory based on Spark Shuffle accesses system | |
CN114125684B (en) | Smart speaker testing method and device, electronic equipment and storage medium | |
CN109726181B (en) | Data processing method and data processing device | |
CN109558107B (en) | FC message receiving management method for shared buffer area |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |