CN110083945A - A kind of distribution multinode simulation management method - Google Patents
A kind of distribution multinode simulation management method Download PDFInfo
- Publication number
- CN110083945A CN110083945A CN201910352591.1A CN201910352591A CN110083945A CN 110083945 A CN110083945 A CN 110083945A CN 201910352591 A CN201910352591 A CN 201910352591A CN 110083945 A CN110083945 A CN 110083945A
- Authority
- CN
- China
- Prior art keywords
- management
- transceiver
- program
- data packet
- simulation
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/16—Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
- G06F15/161—Computing infrastructure, e.g. computer clusters, blade chassis or hardware partitioning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention discloses a kind of distributed multinode simulation management method, it will thus provide more management computers, the method controlled from multiple places, node the primary condition setting of artificial tasks, simulation run process;The state for realizing more management computers will be consistent, and operating caused state from the management on a management computer should be reflected on other all management computers;The management instruction for ensuring to issue on management computer receives defect that is primary and only receiving the unreliability for once avoiding udp from transmitting or cyclical transmission waste network bandwidth by target program by distribution order;After participating in one or several restarting in the computer of communication, correspondence when last time runs can restore automatically, and reliable communication may continue to carry out.
Description
Technical field
The present invention discloses a kind of distributed multinode simulation management method, more particularly to one kind under distributed environment from
The method being managed to artificial tasks is realized in multiple simulation management node publication simulation management instructions, is related to Computer Simulation
Administrative skill field.
Background technique
In flight simulator distributed analogue system, emulation primary condition, the simulation run process to emulation are needed
Etc. being managed.For example, flight simulator, the management for emulating primary condition includes aircraft initial position, oil mass, load-carrying, meteorology
The setting such as condition;The management of simulation run process includes execution, end, the pause etc. of artificial tasks.This emulation is carried out now
The method of management is one simulation management computer of setting, runs a simulation supervisory program, simulation management journey on the computer
Sequence provides man-machine interface, usually graphical human.People carry out emulation primary condition, emulation by operating man-machine interface
The management of operational process etc..Currently, disclosed technical solution is, simulation management computer be either located in simulation cabin or
It is located remotely from the instructor console of simulation cabin, i.e., a simulation management node is only provided.If one can be provided from multiple
The method that place, node are managed emulation, it will obtain managing beneficial effect that is convenient, improving simulation run efficiency.
Summary of the invention
The purpose of the present invention is disclose a kind of distributed multinode simulation management method, it will thus provide more management computers,
The method that the primary condition setting of artificial tasks, simulation run process are controlled from multiple places, node;Realize more
The state of management computer will be consistent, and should be reflected in from state caused by the management operation on a management computer other
On all management computers;Ensure to manage the management instruction issued on computer by distribution order by target program receive it is primary and
Only receive primary, the defect for unreliability or cyclical transmission the waste network bandwidth for avoiding udp from transmitting;Participate in the calculating of communication
After one or several in machine restarting, correspondence when last time runs can restore automatically, and reliable communication still can be after
It is continuous to carry out.
To achieve the above object, the present invention provides a kind of distributed multinode simulation management method, technical solution
It is as follows:
Including the first simulation computer, the second simulation computer ..., M simulation computer, first management computer, second pipe
Manage computer ..., N manage computer;It further include a route computer;These computers are connected by Ethernet switch
Connect the Ethernet for constituting an intercommunication;
First simulation computer, the second simulation computer ..., be separately operable on M simulation computer the first simulated program,
Second simulated program ..., M simulated program;
It is described first management computer, second management computer ..., N management computer on be separately operable the first management program,
Second management program ..., N management program;
A routing program is run on the route computer;
The simulated program executes specific artificial tasks, receives the simulated conditions configuration and simulation run control of the management program
System;
The management program (hereinafter referred to as manages and refers to simulated program publication simulated conditions configuration and simulation run control instruction
It enables);
The simulated conditions configuration is related to the specific artificial tasks that specific simulated program executes;
The simulation run control includes the control items such as execution, end, the pause of control simulated program;
The management program provides the man-machine interface of the publication management instruction;
The routing program distributes the management instruction between the simulated program and the management program;
The simulated program, simulated program, routing program have communication automatic synchronizing function, i.e., when any simulated program, emulation
After program, routing program restarting, the management instruction can still be transmitted between these programs;It can choose from any pipe
Any management instruction of man-machine interface selection of program is managed, the management program selected is known as current management program, is selected
Management instruction be known as current management instruction;
The management program, simulated program, the process of the management instruction of the distribution between routing program are as follows:
Step 1, current management instruction is selected from the man-machine interface of current management program;
Step 2, current management instruction is transferred to the routing program by Ethernet by current management program;
Step 3, current management instruction is transferred to all other management program by Ethernet and all imitated by the routing program
Proper program;
Step 4, all other management program updates respective man-machine interface according to current management instruction and shows, makes all management
The always consistent state of program;
Step 5, all simulated programs execute response corresponding with current management instruction.
The management program, simulated program, management instruction between routing program transmission communication use reliable transmission side
Formula.
The reliable transmission mode uses tcp agreement.
The reliable transmission mode can also use the connectionless reliable transmission mode based on udp agreement.
The implementation method of the connectionless reliable transmission mode based on udp agreement is, including a class
UdpReliable;The object of the class UdpReliable is known as transceiver;Each transceiver includes the local port pair IP
With a port pair remote I P;The port IP is constituted to by IP address and port numbers;Two transceivers to match each other are constituted
One logic channel;It is described matching be logic channel one end transceiver the local port IP to and the port remote I P to respectively with
The port remote I P of the transceiver of the logic channel other end to the local port IP to equal;When the receipts using logic channel one end
Send out device Send operation send data after, the Recv of the transceiver of logic channel other end operation can ensure that data received in-order and
It only receives primary;It is it to, destination address that it is its local port IP that the Send operation of transceiver, which sends the source address of data,
The port pair remote I P;The reception address of the Recv operation of transceiver is its local port pair IP, and only receiving source address is it
The port pair remote I P data;One program can pass through N(N > 1) a transceiver sets up with one or more of the other program
N number of logic channel;The simulated program, management program, routing program establish logic channel by creating transceiver, pass through logic
The Send of the transceiver of channel one end is operated to logic channel and is sent management instruction, by the transceiver of the logic channel other end
Recv operation receives management instruction from logic channel;First simulated program creates the first emulating transceiver, the second emulation journey
Sequence create the second emulating transceiver ..., the M simulated program create M emulating transceiver;The first management program creation
First management transceiver, second management program creation second management transceiver ..., the N management program creation N pipe
Manage transceiver;The routing program creates (M+N) a transceiver, is referred to as the first via and is imitated by emulating transceiver, secondary route
True transceiver ..., M routing simulation transceiver, the first routing management transceiver, secondary route management transceiver ..., the road N
By management transceiver;The first via constitutes a logic channel, described second by emulating transceiver and the first emulating transceiver
Routing simulation transceiver and the second emulating transceiver constitute a logic channel ..., the M routing simulation transceiver and M
Emulating transceiver constitutes a logic channel;The first routing management transceiver and the first management transceiver constitute a logic
Channel, the secondary route management transceiver with second management transceiver constitute a logic channel ..., the N routing pipe
It manages transceiver and N management transceiver constitutes a logic channel.
The transceiver includes that a transmit queue is used to store transmission data packet, a receiving queue for storing up reception number
According to packet;The class UdpReliable maintains a background thread, which is responsible for driving each transceiver in a program complete
At following operation:
A) the transmission data packet for being located at the transmit queue head of the queue is sent, and from described after the transmission data packet is successfully received
The transmission data packet is deleted in transmit queue;
B) it receives and sends data packet, and receiving queue tail of the queue is added in effective data packets;The effective data packets refer to ensure by
Sequence receives primary and only receives primary transmission data packet;
C) the communication automatic synchronizing function is realized;
The transmission data packet refers to the protocol Data Unit with the management instruction for user data for network transmission;Institute
State received data packet refer to storage it is described management instruction submit data cell.
The implementation method of the communication automatic synchronizing function is as follows:
A) transceiver maintains a transmission to count, initial value 0;
B) transceiver maintains a count pick up, initial value 0;
C) transceiver, which will be sent, counts with data packet transmission is sent, and the transmission in transmission data packet, which counts, is known as data packet hair
Send counting;Count is incremented for transmission after transmission data packet is successfully received;
D) transceiver often receives a data packet and sends the transmission data packet for counting and being equal to count pick up, and count pick up adds
1;
E) when the transceiver often receives duplicate transmission data packet, a reply data packet is sent, is wrapped in reply data packet
Current value containing the count pick up, the count pick up in reply data packet are known as data packet count pick up;
F) meet while the transceiver continuously receives certain amount (depending on particular number is according to different embodiments)
After the transmission data packet or reply data packet of the following conditions:
Condition one is all transmission data packet, or is all reply data packet;
Condition two, all data packets for sending data packet send the data packet reception meter for being counted as 0 or all reply data packets
Number is 0;
Condition three, all data packets for sending data packet send the number for counting and being less than count pick up or all reply data packets
It is less than to send according to packet count pick up and counts;
Execute following communication automatic synchronization operation:
E.1 the transmit queue and the receiving queue) are emptied;
E.2) setting the transmission and counting with the count pick up is 0;
The Send operation of the transceiver, which is responsible for generating, to be sent data packet and transmission data packet is added to the transmission team
Line up tail;The Recv operation of the transceiver is responsible for obtaining the received data packet of the receiving queue head of the queue, and deletes the reception
Data packet.
The positive effect of the present invention is:
1, more management computers are provided, can increase the convenient of simulation management in multiple places, node to simulation implementation management
The high efficiency of property and simulation run;
2, using reliable transmission mode, it is ensured that the management instruction issued on management computer is received by distribution order by target program
Once and only receive the defect of the unreliability for once avoiding simple udp transmission or cyclical transmission waste network bandwidth;
3, using transceiver Mechanism establishing logic channel and management instruction send and receive, make simulated program, management program and
The exploitation of routing program is very convenient;
4, using distribution mechanisms in the management instruction set of routing program be entire analogue system management data flow it is relatively sharp, make
The extension of simulated program, management program is very easy to;
5, the autonomous feature for having fully considered each host operation of distributed emulation, when one or several hosts are because of the system failure
Etc. reasons occur after being operating abnormally and restarting, the correspondence for managing instruction can restore automatically, without carrying out whole system
It resets, emulation is avoided to do again from the beginning.
Detailed description of the invention:
Fig. 1 is the analogue system structure using distributed multinode simulation management method;
Fig. 2 is a specific flight simulator communication structure using distributed multinode simulation management method.
Specific embodiment
Below with reference to a preferred embodiment of the invention, the invention will be further described.
As shown in Figure 1, a kind of distribution management method of simulation run, which is characterized in that including the first simulation computer,
Second simulation computer ..., M simulation computer, first management computer, second management computer ..., N management calculate
Machine;It further include a route computer;These computers are connected to form the Ethernet of an intercommunication by Ethernet switch;
First simulation computer, the second simulation computer ..., be separately operable the first simulated program, second on M simulation computer
Simulated program ..., M simulated program;It is described first management computer, second management computer ..., N management computer on
Be separately operable the first management program, the second management program ..., N management program;A routing is run on the route computer
Program;The simulated program executes specific artificial tasks, it receives the simulated conditions configuration and emulation fortune of the management program
Row control;The management program (hereinafter referred to as manages simulated program publication simulated conditions configuration and simulation run control instruction
Instruction);The simulated conditions configuration is related to the specific artificial tasks that specific simulated program executes;The simulation run control
The control items such as execution, end, pause including control simulated program;The management program provides the people of the publication management instruction
Machine interface;The routing program distributes the management instruction between the simulated program and the management program;The emulation
Program, simulated program, routing program have communication automatic synchronizing function, i.e., when any simulated program, simulated program, routing program
After restarting, the management instruction can still be transmitted between these programs;It can choose from the man-machine of any management program
Any management instruction of interface selection, the management program selected are known as current management program, and the management instruction selected claims
Currently to manage instruction;The management program, simulated program, the management instruction of the distribution between routing program process such as
Under:
Step 1, current management instruction is selected from the man-machine interface of current management program;
Step 2, current management instruction is transferred to the routing program by Ethernet by current management program;
Step 3, current management instruction is transferred to all other management program by Ethernet and all imitated by the routing program
Proper program;
Step 4, all other management program updates respective man-machine interface according to current management instruction and shows, makes all management
The always consistent state of program;
Step 5, all simulated programs execute response corresponding with current management instruction.
The management program, simulated program, management instruction between routing program transmission communication use reliable transmission side
Formula.
The reliable transmission mode uses tcp agreement.
The reliable transmission mode can also use the connectionless reliable transmission mode based on udp agreement.
The implementation method of the connectionless reliable transmission mode based on udp agreement is, including a class
UdpReliable;The object of the class UdpReliable is known as transceiver;Each transceiver includes the local port pair IP
With a port pair remote I P;The port IP is constituted to by IP address and port numbers;Two transceivers to match each other are constituted
One logic channel;It is described matching be logic channel one end transceiver the local port IP to and the port remote I P to respectively with
The port remote I P of the transceiver of the logic channel other end to the local port IP to equal;When the receipts using logic channel one end
Send out device Send operation send data after, the Recv of the transceiver of logic channel other end operation can ensure that data received in-order and
It only receives primary;It is it to, destination address that it is its local port IP that the Send operation of transceiver, which sends the source address of data,
The port pair remote I P;The reception address of the Recv operation of transceiver is its local port pair IP, and only receiving source address is it
The port pair remote I P data;One program can pass through N(N > 1) a transceiver sets up with one or more of the other program
N number of logic channel;The simulated program, management program, routing program establish logic channel by creating transceiver, pass through logic
The Send of the transceiver of channel one end is operated to logic channel and is sent management instruction, by the transceiver of the logic channel other end
Recv operation receives management instruction from logic channel;First simulated program creates the first emulating transceiver, the second emulation journey
Sequence create the second emulating transceiver ..., the M simulated program create M emulating transceiver;The first management program creation
First management transceiver, second management program creation second management transceiver ..., the N management program creation N pipe
Manage transceiver;The routing program creates (M+N) a transceiver, is referred to as the first via and is imitated by emulating transceiver, secondary route
True transceiver ..., M routing simulation transceiver, the first routing management transceiver, secondary route management transceiver ..., the road N
By management transceiver;The first via constitutes a logic channel, described second by emulating transceiver and the first emulating transceiver
Routing simulation transceiver and the second emulating transceiver constitute a logic channel ..., the M routing simulation transceiver and M
Emulating transceiver constitutes a logic channel;The first routing management transceiver and the first management transceiver constitute a logic
Channel, the secondary route management transceiver with second management transceiver constitute a logic channel ..., the N routing pipe
It manages transceiver and N management transceiver constitutes a logic channel.
The class UdpReliable realizes the following configuration that function:
UdpReliable(const char * l_ip, unsigned short l_port,
Const char * r_ip, unsigned short r_port);
Wherein, l_ip is the local address ip, decimal system point character string reference format;L_port is local port number, with host sequence
It indicates;R_ip is the long-range address ip, decimal system point character string reference format;R_port is local port number, is indicated with host sequence;
It is stored with the information of l_ip, l_port, r_ip, r_port equivalence;The stored information table with l_ip and l_port equivalence
It is shown as (l_ip, l_port);The stored information with r_ip and r_port equivalence is expressed as (r_ip, r_port).
As shown in Figure 1, the establishment process of each logic channel is as follows:
A) UdpReliable first manage transceiver (
" 128.1.1.1 ", 1024, " 128.1.1.7 ", 11024);
The first routing management of UdpReliable transceiver (
" 128.1.1.7 ", 11024, " 128.1.1.1 ", 1024);
B) UdpReliable second manage transceiver (
" 128.1.1.2 ", 1024, " 128.1.1.7 ", 11025);
UdpReliable secondary route management transceiver (
" 128.1.1.7 ", 11025, " 128.1.1.2 ", 1024);
C) UdpReliable N manage transceiver (
" 128.1.1.3 ", 1024, " 128.1.1.7 ", 11026);
UdpReliable N routing management transceiver (
" 128.1.1.7 ", 11026, " 128.1.1.3 ", 1024);
D) the first emulating transceiver of UdpReliable (
" 128.1.1.4 ", 1024, " 128.1.1.7 ", 21024);
The UdpReliable first via by emulating transceiver (
" 128.1.1.7 ", 21024, " 128.1.1.4 ", 1024);
E) the second emulating transceiver of UdpReliable (
" 128.1.1.5 ", 1024, " 128.1.1.7 ", 21025);
UdpReliable secondary route emulating transceiver (
" 128.1.1.7 ", 21025, " 128.1.1.5 ", 1024);
F) UdpReliable M emulating transceiver (
" 128.1.1.6 ", 1024, " 128.1.1.7 ", 21026);
UdpReliable M routing simulation transceiver (
" 128.1.1.7 ", 21026, " 128.1.1.6 ", 1024);
The transceiver includes that a transmit queue is used to store transmission data packet, a receiving queue for storing up reception data
Packet;The transmission data packet refers to the protocol Data Unit with the management instruction for user data for network transmission;Institute
State received data packet refer to storage it is described management instruction submit data cell.
The transmission data packet is defined as follows:
struct SendPDU
{
unsigned short size;// data packet total bytes contain this domain
char type;// type of data packet, it is necessary to be 1
unsigned long recvCount;// expectation Receive sequence number
unsigned long sendCount;// send sequence number
char data[];// management instruction, determines according to specific Simulation Application
};
The received data packet is defined as follows:
struct RecvPDU
{
unsigned short size;// data packet total bytes contain this domain
char data[];// management instruction, determines according to specific Simulation Application
};
In the present embodiment, the element of transmit queue is the pointer of struct SendPDU type data packets;The member of receiving queue
Element is the pointer of struct RecvPDU type data packets.
In the present embodiment, reply data packet is defined as follows
struct AckPDU
{
unsigned short size;// data packet total bytes contain this domain
char type;// type of data packet, it is necessary to be 2
unsigned long recvCount;// expectation Receive sequence number
};
The class UdpReliable definition has following data member:
A) local socket
SOCKET m_sock;
B) the long-range address ip, is indicated with binary network sequence;
unsigned long m_remoteIp;
C) remote port slogan is indicated with network sequence;
unsigned short m_remotePort;
D) it sends and counts
unsigned long m_sendCount;
E) transmit queue
std::vector<struct SendHead*> m_sendPDUs;
F) count pick up
unsigned long m_recvCount;
G) receiving queue
std::vector<struct RecvPDU*> m_recvPDUs;
F) synchronous filtering counts
int m_synCount;
The class UdpLink there is also defined following static data member:
A) set of the pointer of class UdpReliable object
std::vector<UdpReliable*> ms_allLinks;
The class UdpReliable there is also defined a static thread function:
void Update();
The constructed fuction of the class UdpReliable:
UdpReliable(const char * l_ip, unsigned short l_port,
Const char * r_ip, unsigned short r_port);
Specifically execute following initialization operation:
Step 1, the local UDP socket m_sock is created;
Step 2, by the local m_sock socket bind to the local address ip l_ip and local port number l_port;
Step 3, the long-range address ip r_ip is converted to binary network sequence indicates and is stored in m_remoteIp, by remote port
Number r_port, which is converted to network sequence, to be indicated and is stored in m_remotePort;
Step 4, m_sendCount sets 0;M_sendPDUs is emptied;M_recvCount sets 0;M_recvPDUs is emptied;m_
RecvSynCount sets 0;
Step 5, if ms_allLinks is sky, creation executes the thread of function using Update function as thread;
Step 6, ms_allLinks is added in the pointer of this object (this);
Step 7, operation terminates;
The class UdpReliable maintains a background thread, which creates in above-mentioned steps 5.The thread is with Update
Function is that thread executes function, and Update function is responsible for driving each transceiver in a program to complete following operation:
A) the transmission data packet for being located at the transmit queue head of the queue is sent, and from described after the transmission data packet is successfully received
The transmission data packet is deleted in transmit queue;
B) it receives and sends data packet, and receiving queue tail of the queue is added in effective data packets;The effective data packets refer to ensure by
Sequence receives primary and only receives primary transmission data packet;
C) the communication automatic synchronizing function is realized, the method is as follows:
The implementation method of the communication automatic synchronizing function is as follows:
C.1) transceiver, which will be sent, counts with data packet transmission is sent, and the transmission in transmission data packet, which counts, is known as data packet
It sends and counts;Count is incremented for transmission after transmission data packet is successfully received;
C.2) transceiver often receives a data packet and sends the transmission data packet for counting and being equal to count pick up, count pick up
Add 1;
C.3 when) transceiver often receives duplicate transmission data packet, a reply data packet is sent, in reply data packet
Current value comprising the count pick up, the count pick up in reply data packet are known as data packet count pick up;
C.4) meet the transmission of the following conditions while the transceiver continuously receives certain amount (the present embodiment takes 128)
After data packet or reply data packet:
Condition one is all transmission data packet, or is all reply data packet;
Condition two, all data packets for sending data packet send the data packet reception meter for being counted as 0 or all reply data packets
Number is 0;
Condition three, all data packets for sending data packet send the number for counting and being less than count pick up or all reply data packets
It is less than to send according to packet count pick up and counts;
Execute following communication automatic synchronization operation:
C.4.1 the transmit queue and the receiving queue) are emptied;
C.4.2) setting the transmission and counting with the count pick up is 0;.
Based on the above analysis, the detailed algorithm of available Update function is as follows:
Step 1, data packet reception area buf is defined, buf indicates its first address, to be directed toward struct SendPDU
The pointer of type;
Step 2, next link in ms_allLinks is taken (to return to first if the last one element if reaching in set
Element), it executes:
Step 2.1, data are received from link- > m_sock and stored to buf;
Step 2.2, if the sender of data packet is not (link- > m_remoteIp, link- > m_remotePort), turn
Step 2;
Step 2.3, if buf- > type is 1, data packet is to send data packet, is executed:
Step 2.1, if buf- > sendCount==m_recvCount,
A) application memory: p=(struct RecvPDU*) new char [sizeof (struct RecvPDU)+buf- >
size- sizeof(struct SendPDU)];
B) p- > size=sizeof (struct RecvPDU)+buf- > size- sizeof (struct SendPDU);
C) buf- > size- sizeof (struct SendPDU) a byte is copied to p- > data from buf- > data;
D) p is added to m _ recvPDUs tail of the queue;
E) m _ recvCount++;m_synCount=0;
F) reply data packet ack is sent out:
ack. size=sizeof(struct AckPDU);
ack.type=2;
ack. recvCount = m _recvCount;
Ack is sent from m_sock to (m_remoteIp, m_remotePort);
Step 2.2, if buf->sendCount==0, and buf->sendCount<m_recvCount, then
m_synCount++;
If m_synCount > 128, following simultaneously operating is executed:
A) m_sendPDUs and m_recvPDUs are emptied;
B) setting m_sendCount and m_recvCount is 0;
C) reply data packet ack is sent out:
ack. size=sizeof(struct AckPDU);
ack.type=2;
ack. recvCount = m _recvCount;
Ack is sent from m_sock to (m_remoteIp, m_remotePort);Go to step 2.
Step 2.4, if buf- > type is 2, data packet is reply data packet, is executed:
Step 2.4.1, if m_sendPDUs non-empty, and buf- > recvCount==m_sendPDUs head of the queue element ->
SendCount then removes m_sendPDUs head of the queue element and discharges its memory, and m_synCount=0 goes to step 2.
Step 2.4.2, if buf->recvCount==0, and buf->recvCount<m_recvCount, then
m_synCount++;
If m_synCount > 128, following simultaneously operating is executed:
A) m_sendPDUs and m_recvPDUs are emptied;
B) setting m_sendCount and m_recvCount is 0;
C) reply data packet ack is sent out:
ack. size=sizeof(struct AckPDU);
ack.type=2;
ack. recvCount = m _recvCount;
Ack is sent from m_sock to (m_remoteIp, m_remotePort);Go to step 2.
Step 2.5,2 are gone to step.
The class transceiver realizes following transmission function Send:
Int Send(void * buf, int size);
Wherein, buf is the user data sent, and size(is greater than the 0) byte number for user data;Return value is greater than 0, is expressed as
The byte number that function is sent;Return value indicates to send failure less than 0;
The transmission function Send is performed the following operations:
Step 1, request for data packet memory:
p=new char[sizeof(struct SendPDU)+size];
If p=NULL, return (- 1), operation terminates;
Step 2, data packet head is set:
p->size=sizeof(struct SendPDU)+size;
p->type=1;
p-> recvCount=0;
p-> sendCount = m_ sendCount;
m_ sendCount++;
Step 3, data are copied: copying the data of size byte from buf to p- > data;
Step 4, p is added to m_sendPDUs tail of the queue, returns to size value, operation terminates;
The class transceiver realizes following receiver function Recv:
Int Recv(void * buf, int size);
Wherein, buf is reception data buffer, and size(is greater than the 0) byte number for reception data buffer;Return value is greater than 0,
Indicate successfully received byte number;Return value is equal to 0, and expression receives synchronization packets;Return value indicates that no data arrives less than 0
It reaches, reception failure;
The transmission function Recv is performed the following operations:
Step 1, m_recvPDUs is sky, is returned (- 1), and operation terminates;
Step 2, the head of the queue data packet of m_recvPDUs is removed to struct RecvPDU type pointer p;
Step 3, data are copied: by the data copy of p- > size byte in total to buf;
Step 4, the memory that release p is directed toward, returns to size value, and operation terminates.
As shown in Fig. 2, describing a specific flight simulation using distributed multinode simulation management method
Device communication structure.The system use two management computers, one be positioned at instructor station instructor station manage computer, i.e., first
Computer is managed, which runs the first management program;One is the cabin management computer in cabin, i.e., the second management meter
Calculation machine, the machine run the second management program;First management program, the second management program provide graphic user interface, can be with
Respond the operation with mouse and keyboard of user;The system includes three simulation computers, and one is flight simulation computer, i.e., first
Simulation computer, flight simulation program of the machine operation for flying quality simulation, i.e. the first simulated program;One is that platform is imitative
Genuine computer, i.e. the second simulation computer, machine operation are used for the platform emulation program of aircraft sensation simulation, i.e., the second emulation journey
Sequence;One is imaging simulation computer, i.e. third simulation computer, and machine operation is used for the imaging simulation program of visual simulation,
That is third simulated program;The system uses a route computer, which runs routing program.First management program,
Two management programs, flight simulation program, platform emulation computer, imaging simulation program, routing program are according to following three step
Complete a data exchange:
Step 1, user is operated using the graphic user interface that first management program, the second management program provide, according to
According to the operation of user, the first supervisor call first manages the Send operation of transceiver, the second supervisor call second pipe
The Send operation issue of reason transceiver manages data cell accordingly;The type definition of the management data cell are as follows:
struct {
unsigned short type;
double value;
};
Wherein, type is the type for managing data cell, takes natural number;
Value is the real data for managing data cell;
Management data cell is defined as follows:
A) type=0, value=aircraft longitude, unit angle;
B) type=1, value=aircraft altitude, unit angle;
C) type=2, value=aircraft altitude, unit rice;
D) type=3, value=vector angle, unit angle;
E) type=4, value=aircraft oil mass, unit kilogram;
F) type=5, value=aircraft load-carrying, unit kilogram;
G) type=6, the value=cloud level, unit rice;
H) type=7, value=cloud are thick, unit rice;
I) type=8, value=visibility, unit rice;
J) type=9, value=imaging what comes into a driver's time, unit minute;
K) type=10, value=heavy snow, moderate snow, slight snow, heavy rain, moderate rain, light rain, cloudy day, fine day, enumeration type, no unit;
L) type=11, the execution of value=artificial tasks, end, pause, enumeration type, no unit.
Step 2, routing program periodically carries out following operation: the Recv operation of the first routing management transceiver being called to connect
The management data received the first management program, the Recv operation of secondary route management transceiver is called to receive the second management program
Then unit calls the first via to be operated by the Send of emulating transceiver and is distributed to flight simulation program, calls secondary route emulation
The Send operation of transceiver is distributed to platform emulation program, the Send operation of third routing simulation transceiver is called to be distributed to imaging
Simulated program;
Step 3, the Recv of the first emulating transceiver is called to flight simulation routines periodically to operate, platform emulation program periodicity
It calls the Recv operation of the second emulating transceiver, the Recv of third emulating transceiver is called to imaging simulation routines periodically to grasp in ground
Make to receive the management data cell that routing program is distributed, the type according to management data cell carries out management data cell
It explains, executes operation as defined in management data cell.
Claims (8)
1. a kind of distribution multinode simulation management method, it is characterised in that:
Including the first simulation computer, the second simulation computer ..., M simulation computer, first management computer, second pipe
Manage computer ..., N manage computer;It further include a route computer;These computers are connected by Ethernet switch
Connect the Ethernet for constituting an intercommunication;
First simulation computer, the second simulation computer ..., be separately operable on M simulation computer the first simulated program,
Second simulated program ..., M simulated program;It is described first management computer, second management computer ..., N management calculate
Be separately operable on machine the first management program, the second management program ..., N management program;
A routing program is run on the route computer;
The simulated program executes specific artificial tasks, it receives the simulated conditions configuration and simulation run of the management program
Control;
The management program (hereinafter referred to as manages and refers to simulated program publication simulated conditions configuration and simulation run control instruction
It enables);
The simulated conditions configuration is related to the specific artificial tasks that specific simulated program executes;
The simulation run control includes the control items such as execution, end, the pause of control simulated program;
The management program provides the man-machine interface of the publication management instruction;
The routing program distributes the management instruction between the simulated program and the management program;The emulation journey
Sequence, simulated program, routing program have communication automatic synchronizing function, i.e., when any simulated program, simulated program, routing program weight
After new starting, the management instruction can still be transmitted between these programs;It can choose the man-machine boundary from any management program
Any management instruction of face selection, the management program selected are known as current management program, and the management instruction selected is known as
Current management instruction;
The management program, simulated program, the process of the management instruction of the distribution between routing program are as follows:
Step 1, current management instruction is selected from the man-machine interface of current management program;
Step 2, current management instruction is transferred to the routing program by Ethernet by current management program;
Step 3, current management instruction is transferred to all other management program by Ethernet and all imitated by the routing program
Proper program;
Step 4, all other management program updates respective man-machine interface according to current management instruction and shows, makes all management
The always consistent state of program;
Step 5, all simulated programs execute response corresponding with current management instruction.
2. a kind of distributed multinode simulation management method according to claim 1, it is characterised in that:
The management program, simulated program, management instruction between routing program transmission communication use reliable transmission mode.
3. a kind of distributed multinode simulation management method according to claim 2, it is characterised in that:
The reliable transmission mode uses tcp agreement.
4. a kind of distributed multinode simulation management method according to claim 2, it is characterised in that:
The reliable transmission mode uses the connectionless reliable transmission mode based on udp agreement.
5. a kind of distributed multinode simulation management method according to claim 4, it is characterised in that:
The implementation method of the connectionless reliable transmission mode based on udp agreement is, including a class UdpReliable;Institute
The object for stating class UdpReliable is known as transceiver;Each transceiver include local port IP to and an end remote I P
Mouth is right;The port IP is constituted to by IP address and port numbers;Two transceivers to match each other constitute a logic channel;Institute
State matching be logic channel one end transceiver the local port IP to and the port remote I P to respectively with the logic channel other end
Transceiver the port remote I P to the local port IP to equal;When the Send of the transceiver using logic channel one end is operated
After sending data, the Recv operation of the transceiver of the logic channel other end can ensure that data received in-order and only receive primary;It receives
It is its port pair remote I P to, destination address that it is its local port IP that the Send operation of hair device, which sends the source address of data,;
The reception address of the Recv operation of transceiver is its local port pair IP, and only receives the port pair remote I P that source address is it
Data;One program can pass through N(N > 1) a transceiver and one or more of the other program set up N number of logic channel;Institute
It states simulated program, management program, routing program and establishes logic channel, by the transmitting-receiving of logic channel one end by creating transceiver
The Send of device is operated to logic channel and is sent management instruction, operated by the Recv of the transceiver of the logic channel other end from logic
Channel receives management instruction;First simulated program creates the first emulating transceiver, the second emulation of the second simulated program creation
Transceiver ..., the M simulated program create M emulating transceiver;The first management of first management program creation transmitting-receiving
Device, second management program creation second management transceiver ..., the N management program creation N manage transceiver;Institute
State routing program creation (M+N) a transceiver, be referred to as the first via by emulating transceiver, secondary route emulating transceiver ...,
M routing simulation transceiver, the first routing management transceiver, secondary route management transceiver ..., N routing management transceiver;
The first via is made of a logic channel, the secondary route emulating transceiver emulating transceiver and the first emulating transceiver
With the second emulating transceiver constitute a logic channel ..., the M routing simulation transceiver and M emulating transceiver composition
One logic channel;The first routing management transceiver and the first management transceiver constitute a logic channel, described second
Routing management transceiver and the second management transceiver constitute a logic channel ..., the N routing management transceiver and N
It manages transceiver and constitutes a logic channel.
6. a kind of distributed multinode simulation management method according to claim 5, it is characterised in that:
The transceiver includes that a transmit queue is used to store transmission data packet, a receiving queue for storing up reception data
Packet;The class UdpReliable maintains a background thread, which is responsible for driving each transceiver in a program to complete
Following operation:
A) the transmission data packet for being located at the transmit queue head of the queue is sent, and from described after the transmission data packet is successfully received
The transmission data packet is deleted in transmit queue;
B) it receives and sends data packet, and receiving queue tail of the queue is added in effective data packets;The effective data packets refer to ensure by
Sequence receives primary and only receives primary transmission data packet;
C) the communication automatic synchronizing function is realized;
The transmission data packet refers to the protocol Data Unit with the management instruction for user data for network transmission;Institute
State received data packet refer to storage it is described management instruction submit data cell.
7. a kind of distributed multinode simulation management method according to claim 6, which is characterized in that the communication is automatic
The implementation method of synchronizing function is as follows:
A) transceiver maintains a transmission to count, initial value 0;
B) transceiver maintains a count pick up, initial value 0;
C) transceiver, which will be sent, counts with data packet transmission is sent, and the transmission in transmission data packet, which counts, is known as data packet hair
Send counting;Count is incremented for transmission after transmission data packet is successfully received;
D) transceiver often receives a data packet and sends the transmission data packet for counting and being equal to count pick up, and count pick up adds
1;
E) when the transceiver often receives duplicate transmission data packet, a reply data packet is sent, is wrapped in reply data packet
Current value containing the count pick up, the count pick up in reply data packet are known as data packet count pick up;
F) meet while the transceiver continuously receives certain amount (depending on particular number is according to different embodiments)
After the transmission data packet or reply data packet of the following conditions:
Condition one is all transmission data packet, or is all reply data packet;
Condition two, all data packets for sending data packet send the data packet reception meter for being counted as 0 or all reply data packets
Number is 0;
Condition three, all data packets for sending data packet send the number for counting and being less than count pick up or all reply data packets
It is less than to send according to packet count pick up and counts;
Execute following communication automatic synchronization operation:
1) transmit queue and the receiving queue are emptied;
2) setting the transmission and counting with the count pick up is 0.
8. a kind of distributed multinode simulation management method according to claim 6, which is characterized in that the transmitting-receiving
The Send operation of device, which is responsible for generating, to be sent data packet and transmission data packet is added to the transmit queue tail of the queue;The transceiver
Recv operation be responsible for obtaining the received data packet of the receiving queue head of the queue, and delete the received data packet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910352591.1A CN110083945B (en) | 2019-04-29 | 2019-04-29 | Distributed multi-node simulation management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910352591.1A CN110083945B (en) | 2019-04-29 | 2019-04-29 | Distributed multi-node simulation management method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110083945A true CN110083945A (en) | 2019-08-02 |
CN110083945B CN110083945B (en) | 2023-03-24 |
Family
ID=67417490
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910352591.1A Active CN110083945B (en) | 2019-04-29 | 2019-04-29 | Distributed multi-node simulation management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110083945B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104880961A (en) * | 2015-04-29 | 2015-09-02 | 北京理工大学 | Real-time simulation experiment system of multi-unmanned plane distributed synergetic hardware in loop |
CN105763570A (en) * | 2016-04-26 | 2016-07-13 | 北京交通大学 | Virtualization-technology-based distributed real-time network simulation system |
CN106571888A (en) * | 2016-11-10 | 2017-04-19 | 中国人民解放军空军航空大学军事仿真技术研究所 | Automatic synchronous reliable communication method for simulation system |
US20170329635A1 (en) * | 2016-05-13 | 2017-11-16 | University Of Utah Research Foundation | Systems and methods for distributed computing |
CN109188933A (en) * | 2018-09-21 | 2019-01-11 | 北京大翔航空科技有限公司 | A kind of cluster unmanned plane distributed hardware is in loop simulation system |
-
2019
- 2019-04-29 CN CN201910352591.1A patent/CN110083945B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104880961A (en) * | 2015-04-29 | 2015-09-02 | 北京理工大学 | Real-time simulation experiment system of multi-unmanned plane distributed synergetic hardware in loop |
CN105763570A (en) * | 2016-04-26 | 2016-07-13 | 北京交通大学 | Virtualization-technology-based distributed real-time network simulation system |
US20170329635A1 (en) * | 2016-05-13 | 2017-11-16 | University Of Utah Research Foundation | Systems and methods for distributed computing |
CN106571888A (en) * | 2016-11-10 | 2017-04-19 | 中国人民解放军空军航空大学军事仿真技术研究所 | Automatic synchronous reliable communication method for simulation system |
CN109188933A (en) * | 2018-09-21 | 2019-01-11 | 北京大翔航空科技有限公司 | A kind of cluster unmanned plane distributed hardware is in loop simulation system |
Non-Patent Citations (2)
Title |
---|
WU YONGLIANG ET AL: "Research on Clock Synchronization Mechanism of Distributed Simulation System based on DDS", 《2019 IEEE 3RD INFORMATION TECHNOLOGY,NETWORKING,ELECTRONIC AND AUTOMATION CONTROL CONFERENCE》 * |
何波玲: "一种分布式仿真通讯软件总线实现方法", 《实践方法》 * |
Also Published As
Publication number | Publication date |
---|---|
CN110083945B (en) | 2023-03-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101645813B (en) | Distributed semi-physical network simulation system and controlling method of semi-physical port thereof | |
CN101404547B (en) | Satellite network simulation system | |
Macedonia et al. | NPSNET: a network software architecture for largescale virtual environments | |
US8352223B1 (en) | Network communications testbed | |
CN103647664B (en) | Towards the distributing emulation system of many repeater satellite communications of deep space | |
Chen | Utsaf: a multi-agent-based framework for supporting military-based distributed interactive simulations in 3d virtual environments | |
Zhou et al. | Modeling and performance analysis using extended fuzzy-timing Petri nets for networked virtual environments | |
CN104880961A (en) | Real-time simulation experiment system of multi-unmanned plane distributed synergetic hardware in loop | |
CN110266368A (en) | Incorporate information network emulation mode based on cloud platform | |
CN108234187A (en) | A kind of height link simulation method true to nature of data-oriented message forwarding | |
CN105978817A (en) | Method for transmitting data, storage, and network adapter | |
CN114422018B (en) | Satellite network simulation system, testing method, testing device, storage medium and product | |
CN109905280A (en) | A kind of emulation mode and system towards mobile satellite network | |
CN108919831A (en) | A method of can be realized in a browser simulation unmanned plane during flying scene in real time | |
CN110674584B (en) | Multi-aircraft joint simulation system | |
CN116016207A (en) | SDN-based low-orbit constellation on-orbit big data processing simulation platform | |
Lin et al. | Federated learning with dynamic aggregation based on connection density at satellites and ground stations | |
CN106571888B (en) | A kind of analogue system automatic synchronization reliable communication method | |
CN110083945A (en) | A kind of distribution multinode simulation management method | |
CN112947125B (en) | Embedded unmanned aerial vehicle cluster simulation system based on high-speed serial bus | |
CN104468722A (en) | Method for classified storage of training data in navigation management training system | |
US7526420B2 (en) | Method and system for virtual injection of network application codes into network simulation | |
CN115913426A (en) | Virtual-real cooperative world integrated scene simulation system | |
CN105681311B (en) | A kind of rocket ground network heterogeneous system based on cloud computing technology | |
CN113965470B (en) | Aviation information network experiment simulation system |
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 |