CN108989111B - Method for simulating communication between nodes - Google Patents

Method for simulating communication between nodes Download PDF

Info

Publication number
CN108989111B
CN108989111B CN201810813045.9A CN201810813045A CN108989111B CN 108989111 B CN108989111 B CN 108989111B CN 201810813045 A CN201810813045 A CN 201810813045A CN 108989111 B CN108989111 B CN 108989111B
Authority
CN
China
Prior art keywords
hardware simulator
communication
message
virtual
node
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.)
Active
Application number
CN201810813045.9A
Other languages
Chinese (zh)
Other versions
CN108989111A (en
Inventor
陈苗苗
罗金山
熊飞
倪敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wu Qi Technologies Inc
Original Assignee
Shanghai Wuqi Technology Co ltd
Chongqing Wuqi Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Wuqi Technology Co ltd, Chongqing Wuqi Technology Co ltd filed Critical Shanghai Wuqi Technology Co ltd
Priority to CN201810813045.9A priority Critical patent/CN108989111B/en
Publication of CN108989111A publication Critical patent/CN108989111A/en
Application granted granted Critical
Publication of CN108989111B publication Critical patent/CN108989111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B3/00Line transmission systems
    • H04B3/54Systems for transmission via power distribution lines

Abstract

The patent discloses a method for simulating communication between nodes, which is characterized in that a virtual concentrator capable of simulating functions of a concentrator for sending an operation command and receiving an operation result is arranged; the method comprises the following steps that a plurality of hardware simulators which can simulate the message receiving and sending functions of a certain communication node of a power line carrier communication network and are controlled by an upper-layer module are arranged; setting a plurality of virtual data acquisition terminals which can simulate the message generation function and the message receiving and sending function of the data acquisition terminals; setting a control unit for configuring the hardware simulator, the virtual concentrator and the virtual data acquisition terminal; the control unit configures the virtual concentrator, the hardware simulator and the virtual data acquisition terminal so as to be connected to a simulated power carrier communication network; and enabling the virtual concentrator, the hardware simulator and the virtual data acquisition terminal to simulate the communication behavior in the power carrier communication network according to respective set scripts.

Description

Method for simulating communication between nodes
Technical Field
The invention relates to the technical field of simulation of communication networks, in particular to a method for simulating communication between nodes.
Background
The power line carrier communication (PLC) is a communication mode taking a power line as a transmission medium and is mainly applied to remote automatic meter reading, automatic control of a power distribution network, interconnection in a home, an intelligent cell, network access of the last kilometer of multimedia communication and the like. In recent years, the data transmission rate of the power line communication has been increased by the development of the related art of the broadband power line communication, and particularly, the development of the orthogonal frequency division multiplexing technology has enabled the high-speed PLC.
The remote automatic meter reading system adopting the power line broadband carrier communication technology is a full-automatic electric meter data acquisition and communication system capable of replacing manual meter reading, and is an important link for building an intelligent power grid. The power line carrier communication technology can meet the requirements of meter reading on communication speed and communication reliability, and has the advantages of low cost, convenience in installation and maintenance and the like. For this reason, the electric power industry also promulgates relevant technical standards such as DL/T645-: communication protocol-communication between master station and power information collection terminal (698.41 protocol for short) and DLT 376.2-part 2: concentrator local communication module interface protocol (376.2 protocol for short).
Fig. 1 shows a common network architecture when a power line broadband carrier communication network is applied to a remote automatic meter reading system, in which besides communication nodes such as a central controller, a collector and a common slave node, the system also needs a concentrator and an electric meter, wherein:
a central control unit (CCO), a master node, also called a master station, in the power carrier communication network, starts to send a beacon (beacon) periodically to control the state of the whole network, and a slave node monitors the beacon and sends a network access request, and the CCO determines whether to allow the node to access the network and determines which node in the network serves as a proxy node of the child node. The CCO communicates with a concentrator (CCTT) through a serial port, any command sent by the concentrator is sent to each slave node below the CCO by the CCO, and a message reported by the ammeter is translated into a protocol (such as 376.2 protocol) identified by the concentrator by the CCO and reported to the concentrator;
the common slave node (STA) is one of slave nodes of the power carrier communication network, only one electric meter can be hung below the common slave node, the hung electric meter can be searched through a serial port after the common slave node (STA) is started, and the mac address of the electric meter is obtained. The command issued by the CCO is translated into a protocol (such as 645 protocol) with the electric meter through the node and is sent to the electric meter, and a message replied by the electric meter or actively reported by the electric meter is also uploaded to the CCO by the module;
a Collector (Collector), a plurality of electric meters can be hung under the slave nodes, and other functions are consistent with those of the STA;
the device is mainly controlled by an operator to send an operation command (such as meter reading, slave node registration, network condition query and the like) to the CCO, and can display a statistical operation result.
In the development process of the power broadband carrier communication chip used on each communication node in the power carrier communication network, if the protocol layer and the application layer software can only be developed based on a real hardware platform, except that the purchase cost of physical equipment is high, the functions supported by the concentrators and the electric meters of different manufacturers are incomplete, and basically, the manual operation is only available, and the controllability is weak; therefore, software development is long in development period and difficult to debug, and completeness test cannot be performed on various abnormal conditions and different application scenes.
Disclosure of Invention
The invention aims to provide a method capable of simulating each communication node and bottom layer communication among the nodes, so that the cost of upper layer software in development is reduced, and the high controllability of testing is improved.
The method for simulating the communication between the nodes comprises the following steps:
setting a virtual concentrator which can simulate the functions of the concentrator for sending operation commands and receiving operation results;
the method comprises the steps that a plurality of hardware simulators which can simulate the message receiving and sending functions of a certain communication node of a power line carrier communication network and are controlled by an upper-layer module are arranged, wherein the hardware simulators at least comprise a first hardware simulator used for simulating a central controller and a second hardware simulator used for simulating a common slave node or a collector;
setting a plurality of virtual data acquisition terminals which can simulate the message generation function and the message receiving and sending function of the data acquisition terminals;
setting a control unit for configuring the hardware simulator, the virtual concentrator and the virtual data acquisition terminal;
configuring the virtual concentrator, the hardware simulator and the virtual data acquisition terminal by using the control unit so as to connect the virtual concentrator, the hardware simulator and the virtual data acquisition terminal into a simulated power carrier communication network;
and enabling the virtual concentrator, the hardware simulator and the virtual data acquisition terminal to simulate the communication behavior in the power carrier communication network according to respective set scripts.
The upper layer module in the patent refers to a module for executing upper layer software such as protocol layer software and application layer software.
The scheme utilizes the virtual concentrator, the hardware simulator and the virtual data acquisition terminal which only realize the functions related to the message, and utilizes the control unit to carry out the configuration of the virtual concentrator, the hardware simulator and the virtual data acquisition terminal, thereby being very convenient to realize; because the software only aims at the analysis and the receiving and sending control of the message, the scheme realizes the simulated power carrier communication network which can sufficiently support the test and the development of the software, and does not need to adopt entity equipment; meanwhile, the virtual concentrator and the virtual data acquisition terminal can be controlled randomly to realize functions necessary for testing and developing software in a mode of parameter configuration by the control unit, a virtual network required by testing is formed, and the defects that the functions supported by the concentrators and the electric meters of different manufacturers are incomplete, manual operation is basically only available, and controllability is weak are overcome. The scale of the network is conveniently realized by means of increasing and reducing hardware simulators and virtual data acquisition terminals, the software development period can be greatly shortened, the debugging difficulty is reduced, the scheme is flexible in networking, various application scenes can be quickly realized, and the operation is stable because all the aspects are controllable, so that the condition that completeness test cannot be carried out due to various abnormal conditions and different application scenes is avoided.
And further, a general hardware simulator with changeable functions is adopted to simulate any one of the central controller, the common slave nodes and the collector according to the configuration of the control unit.
Therefore, an independent hardware simulator is not needed to be designed for each type of node, and different required nodes can be obtained only by utilizing the configuration of the control unit, so that the network is greatly convenient to establish, change and adjust.
Further, the hardware simulator executes a corresponding message sending mode according to the message type sent by the upper layer module; the message sending mode comprises a time division multiplexing mode and a carrier monitoring mode.
The system can deal with different message sending modes and has wider adaptability.
Further, when a message packet sent by an upper layer module is a carrier monitoring type message packet, the hardware simulator requests a semaphore parameter from the control unit, and the message packet is sent until the semaphore parameter sent by the control unit indicates that a channel is available, or the message packet is not sent;
when the message packet is sent, the hardware simulator informs the control unit to enable the control unit to quantitatively change the semaphore parameter to the direction indicating that the channel is unavailable, and when the message packet is sent, the hardware simulator informs the control unit to quantitatively change the semaphore parameter to the direction indicating that the channel is available.
The scheme establishes a channel model equivalent to real carrier monitoring, and can quickly, simply and conveniently simulate the carrier monitoring of a real channel. The carrier monitoring process can be simulated without using a physical channel, the simulation effect of the whole communication process can not be influenced, the simulation truth degree is further improved, and the cost is reduced.
In a real power line carrier communication network, due to the problems of line attenuation and the like, whether a node in a channel is sending a message or not can not be absolutely monitored actually, so that the situation of message collision often occurs, namely two nodes send messages at the same time; that is, in a simulation environment, the channel is simply set to two states (in an extreme case of the scheme, the semaphore parameter has only two values, one represents occupied and the other represents unoccupied), which is far from the real channel condition; therefore, the scheme allows a certain number of nodes to simultaneously report at the same time point through the setting of the semaphore parameter, namely, the collision condition is allowed to occur, and a real channel is simply and effectively simulated.
Further, when a message packet sent by the upper layer module is a multiplexing type message packet, the hardware simulator appoints to send the message within preset time according to the time slot information carried in the message packet.
The time division multiplexing scene in a real network is simulated, and the simulation effect is better.
Further, a communication success rate script defining the communication success rate between every two communication nodes is obtained, and a channel communication success rate simulation module of the hardware simulator corresponding to each communication node is configured according to the communication success rate script;
the channel communication success rate simulation module randomly discards message packets from other nodes according to the configured communication success rate, so that the communication success rate between the node and other nodes specified in the communication success rate script is realized.
The method has the advantages that the signal-to-noise ratio of signal transmission is reduced and the signal quality is poor due to the fact that the real channel has noise, signal attenuation and the like, and accordingly communication failure with certain probability is caused. Moreover, if the communication success rate can be reduced according to the maximum value of the semaphore parameter, messages colliding with each other are simulated into system noise, the simulation degree of the system noise with a real network is higher, but the system overhead is not increased.
Further, the method comprises the steps of running a plurality of virtual machines on the physical machine; and arranging the hardware simulator on each virtual machine.
Further, the virtual machine adopts an embedded real-time operating system, and the hardware simulator is set to work based on the embedded real-time operating system.
Most of software needing to be developed is loaded in an embedded real-time operating system (such as freertos), and the scheme is adopted as a basis to provide simple sending and receiving interfaces for the development of upper-layer software to be tested, so that the interface function of the upper-layer software does not need to be changed to adapt to the system, the upper-layer software is convenient to call each module of the operating system, and the upper-layer software can be transplanted to real chip hardware without any redundant change;
further, a plurality of physical machines are adopted;
when the hardware simulator is configured as a central controller, the hardware simulator reads the time tick value of the physical machine where the hardware simulator is located, and sends the time tick value to the newly started hardware simulator through a clock synchronization message; when the hardware simulator is configured as a slave node, the hardware simulator parses the time tick value in the clock synchronization message from the central controller and calibrates the time at which the slave node performs various types of operations to be consistent with the central controller.
The clock synchronization message is used, the clock synchronization of each node is adjusted on the bottom layer, and the clock synchronization is completed by means of direct message packets among the nodes.
Drawings
Fig. 1 is a schematic block diagram of a power line carrier communication network applied to an automatic meter reading system in the background art.
FIG. 2 is a schematic block diagram of an embodiment of the present invention.
FIG. 3 is a schematic functional block diagram of a hardware simulator in an embodiment of the present invention.
Fig. 4 is an operation interface diagram of a channel communication success rate simulation module in the embodiment of the present invention.
Detailed Description
The following is further detailed by way of specific embodiments:
the method for simulating communication between nodes in the embodiment includes the following steps:
setting a virtual concentrator which can simulate the functions of the concentrator for sending operation commands and receiving operation results;
the method comprises the following steps that a plurality of hardware simulators which can simulate the message receiving and sending functions of a certain communication node of a power line carrier communication network and are controlled by an upper-layer module are arranged;
the system comprises a central controller, a first hardware simulator, a second hardware simulator and a control module, wherein the first hardware simulator is used for simulating the central controller, and the second hardware simulator is used for simulating a common slave node or a collector;
setting a plurality of virtual data acquisition terminals which can simulate the message generation function and the message receiving and sending function of the data acquisition terminals;
setting a control unit for configuring the hardware simulator, the virtual concentrator and the virtual data acquisition terminal;
configuring the virtual concentrator, the hardware simulator and the virtual data acquisition terminal by using the control unit so as to connect the virtual concentrator, the hardware simulator and the virtual data acquisition terminal into a simulated power carrier communication network;
and enabling the virtual concentrator, the hardware simulator and the virtual data acquisition terminal to simulate the communication behavior in the power carrier communication network according to respective set scripts.
And the system also comprises a general hardware simulator with changeable functions, and the general hardware simulator is used for simulating any one of the central controller, the common slave nodes and the collector according to the configuration of the control unit.
Therefore, an independent hardware simulator is not needed to be designed for each type of node, and different required nodes can be obtained only by utilizing the configuration of the control unit, so that the network is greatly convenient to establish, change and adjust.
The hardware simulator executes a corresponding message sending mode according to the message type sent by the upper layer module; the message sending mode comprises a time division multiplexing mode and a carrier monitoring mode.
The system can deal with different message sending modes and has wider adaptability.
When a message packet sent by an upper layer module is a carrier monitoring type message packet, the hardware simulator requests a semaphore parameter from the control unit, and the message packet is sent when the semaphore parameter sent by the control unit indicates that a channel is available, or the message packet is not sent;
when the message packet is sent, the hardware simulator informs the control unit to enable the control unit to quantitatively change the semaphore parameter to the direction indicating that the channel is unavailable, and when the message packet is sent, the hardware simulator informs the control unit to quantitatively change the semaphore parameter to the direction indicating that the channel is available.
The scheme establishes a channel model equivalent to real carrier monitoring, and can quickly, simply and conveniently simulate the carrier monitoring of a real channel. The carrier monitoring process can be simulated without using a physical channel, the simulation effect of the whole communication process can not be influenced, the simulation truth degree is further improved, and the cost is reduced.
For example, the semaphore parameter indicates that the channel is completely occupied at 0, indicates that the channel is completely available at 5, and the current semaphore parameter is 3, so if a node obtains the parameter from the control unit at this time, the node starts to send a message, and simultaneously informs the control unit that it is sending, so the control unit reduces the semaphore parameter to 2; because the parameter is not 0 at present, other nodes can also send messages, and when the messages start, the parameter is reduced to 1; by analogy, when the parameter is reduced to 0, the rest nodes cannot perform message processing at this time until a certain node completes the message and notifies the control unit, the parameter is increased to 1, the certain node can perform message processing after obtaining the semaphore parameter, the initial parameter value is set to be 5, namely, the parameter when the channel is completely available can limit that only 5 nodes perform message processing simultaneously.
And when the message packet sent by the upper layer module is the multiplexing type message packet, the hardware simulator appoints to send the message within preset time according to the time slot information carried in the message packet.
The method also comprises the steps of obtaining a communication success rate script which defines the communication success rate between every two communication nodes, and configuring a channel communication success rate simulation module of the hardware simulator corresponding to each communication node according to the communication success rate script;
the channel communication success rate simulation module randomly discards message packets from other nodes according to the configuration of the channel communication success rate simulation module, so that the communication success rate between the node and other nodes specified in the communication success rate script is realized.
The signal-to-noise ratio of signal transmission is reduced and the signal quality is deteriorated due to the conditions of noise, signal attenuation and the like of a real channel, so that communication failure with a certain probability is caused. The influence of the channel quality on the communication can be simulated without using a physical channel, the simulation effect of the whole communication process can not be influenced, the simulation truth degree is further improved, and the cost is reduced.
The method also comprises the steps of adopting a plurality of physical machines, and running a plurality of virtual machines on each physical machine; and arranging the hardware simulator on each virtual machine. The virtual machine adopts an embedded real-time operating system, and the hardware simulator is set to work based on the embedded real-time operating system; when the hardware simulator is configured as a central controller, the hardware simulator reads the time tick value of the physical machine where the hardware simulator is located, and sends the time tick value to the newly started hardware simulator through a clock synchronization message; when the hardware simulator is configured as a slave node, the hardware simulator parses the time tick value in the clock synchronization message from the central controller and calibrates the time at which the slave node performs various types of operations to be consistent with the central controller. Most of software needing to be developed is loaded in an embedded real-time operating system (such as freertos), and the scheme is adopted as a basis to provide simple sending and receiving interfaces for the development of upper-layer software to be tested, so that the interface function of the upper-layer software does not need to be changed to adapt to the system, the upper-layer software is convenient to call each module of the operating system, and the upper-layer software can be transplanted to real chip hardware without any redundant change.
In the embodiment, the virtual concentrator, the hardware simulator and the virtual data acquisition terminal which only realize the functions related to the message are utilized, and the configuration of the virtual concentrator, the hardware simulator and the virtual data acquisition terminal is carried out by utilizing the control unit, so that the implementation is very convenient; because the software only aims at the analysis and the receiving and sending control of the message, the scheme realizes the simulated power carrier communication network which can sufficiently support the test and the development of the software, and does not need to adopt entity equipment; meanwhile, the virtual concentrator and the virtual data acquisition terminal can be controlled randomly in a mode of configuring the control unit to realize functions necessary for testing and developing software, and the defects that the functions supported by the concentrators and the electric meters of different manufacturers are incomplete, manual operation is basically realized, and controllability is weak are overcome. The scale of the network is conveniently realized by means of increasing and reducing hardware simulators and virtual data acquisition terminals, the software development period can be greatly shortened, the debugging difficulty is reduced, the scheme is flexible in networking, various application scenes can be quickly realized, and the operation is stable because all the aspects are controllable, so that the condition that completeness test cannot be carried out due to various abnormal conditions and different application scenes is avoided.
FIG. 2 illustrates a system constructed using the method of the present embodiment for simulating communication between nodes, the system comprising a control unit, a virtual concentrator, a hardware simulator and a virtual electric meter;
the specific composition of the system and its operation are described below;
the control unit is respectively connected with the virtual concentrator, the hardware simulator and the virtual data acquisition terminal one by one; the hardware simulator is also connected with an upper layer module for loading protocol layer and application layer software;
the hardware simulator is a general hardware simulator, can simulate the data transceiving function of a certain communication node of the power line carrier communication network, and is controlled by the upper module; the hardware simulator is configured into a first hardware simulator through the configuration of the control module and used for simulating a node of a central controller in a power grid, and the hardware simulator is configured into a second simulator and used for simulating nodes such as a common slave node and a collector according to the difference of the number of configured interfaces and the number of lower-hanging virtual data acquisition terminals; each node has its own IP address; according to respective IP addresses of the nodes, the nodes realize communication among the nodes by using UDP message interaction;
all the configurations are recorded in a configuration file, and the control module implements the specific configurations by reading the configuration file; in this embodiment, the control module is not actually part of the power carrier communications network that we are trying to simulate, and it acts as a control for each virtual unit or simulator in the network, so its connection to each virtual unit or simulator is referred to as a command channel in this embodiment.
The virtual data acquisition terminal in this implementation is a virtual ammeter: the virtual electric meter is realized by a Python script, realizes a complete 645 protocol and a 698 protocol, can simulate a real electric meter, realizes interaction with a common slave node/collector through a serial port (UART), and has various table item functions specified by a meter searching protocol and a reading protocol. Similarly, the central controller and the virtual concentrator are communicated through a serial port;
through the control unit, the user can configure the MAC address, the work baud rate and the serial port number of the virtual electric meter.
The virtual concentrator is also realized by Python script, the script realizes the complete protocol of the national network 376.2 when running under the Windows operating system, and the communication with the central controller is realized through a serial port.
The virtual concentrator can communicate with the hardware simulator block through a serial port, is configured with a serial port number, and has various table item functions specified by a table searching and reading protocol.
After the configuration is completed, each node completely follows the working mode of the real power line carrier communication network to perform networking, so as to form a power line carrier communication network basically as shown in fig. 1, which is relatively conventional and is not described herein again.
In this embodiment, the hardware simulator runs in the Windows operating system of the physical computer in a process manner, and is integrated with the simulator of the Freertos operating system, the simulator is used for establishing a simulator adopting the Freertos operating system on the physical computer, the hardware simulator runs on the simulator, and each hardware simulator can be regarded as running on a virtual machine using the Freertos operating system; a plurality of processes can be run on one physical computer in parallel, and more processes can be deployed on a plurality of physical computers simultaneously and in parallel, and all the processes are controlled by the control unit.
A simple sending and receiving interface is provided for upper-layer software development on a virtual machine using a Freetos operating system; the modules of the operating system can be conveniently called by upper-layer software, and can be transplanted to real chip hardware without any redundant change.
As known from the foregoing, UDP packets are used between nodes, and actually, each node is a process on a physical computer, and a virtual electricity meter and a virtual concentrator are also processes on the physical computer; the communication between processes is a socket communication in this embodiment.
Therefore, under this framework, the IP address allocated to the node actually belongs to a virtual IP address, and each virtual electric meter uses the same packet based on the MAC address as the real electric meter, and during networking, the process of matching the national network protocol by the serial number is simulated between the hardware simulator and the virtual electric meter (the serial number of the contact is issued through the configuration of the control unit), and further, in this virtual environment of this embodiment, the mapping relationship occurs between the virtual IP address of the node and the virtual electric meter.
Therefore, the IP network simulation power line transmission is realized through the mapping of the IP address and the MAC address of the virtual electric meter, and the communication (including the communication of a UART serial port and the communication of a UDP interface) is realized through the inter-process reuse socket so as to simulate the communication of the IP network; therefore, in the whole simulation network, the original appearance of the ammeter message is kept, the sending and receiving of the power line carrier communication network are simulated, and the software after the test can be very quickly transplanted to a real chip without great change (such as changing an interface function) when upper-layer software is tested.
As shown in fig. 3, the hardware simulator supports both TDMA and CSMA data transmission modes;
the method comprises the steps that a transmission management module is used for identifying a message packet, when the message packet sent by an upper layer module (upper level) is a time division multiplexing (TDMA DATA) message packet, a time division multiplexing (TDMA scheduling) module is used for appointing a sending module (TX) to send the message in preset time according to time slot information carried in the message packet, and the method can be realized by the following modes:
the time division multiplexing module comprises a plurality of hw queues, and each queue has the following properties:
id: unique identification queue
Enabled: whether enabled, only the queue of enabled can be used, which is configured by the upper layer;
priority: when the queue is generated, determining that the higher the priority, the more priority is to transmit the packet in the queue;
the time division multiplexing module is used for establishing two scheduling queues as ping-pong, one scheduling queue is used for being configured by upper-layer software during execution, 1000 cmdlist can be stored in each queue, and the format of each cmdlist is roughly as follows:
TABLE 1 cmdlist field Format
Enable_bitmap Start_time End_time
Enable _ bitmap specifying hw queue to send
Start _ time the Start time when this cmd is to be executed refers to the system time.
End _ time the time when this cmd stops executing refers to the system time.
The upper layer mounts the message into a corresponding queue according to the priority of the message to be sent, and sets the queue as enabled; the upper layer will complete the corresponding cmdlist configuration and inform the time division multiplexing module.
After receiving cmdlist, the time division multiplexing module starts a timer according to start _ time in the cmdlist, and sends out messages in the cmdlist according to the hw queue priority in enable _ bitmap when the timer reaches the set time; and the reciprocating is executed until the End _ time is up.
The transmission management module comprises a carrier sense module (CSMA scheduling) to realize a carrier sense transmission mode.
Correspondingly, a semaphore parameter representing the channel occupation condition is stored in the control unit;
the carrier monitoring module is used for requesting a semaphore parameter to the control unit when a message packet sent by an upper layer module (upper level) is a carrier monitoring type message packet (non-TDMA DATA), and sending the message packet by the sending module (TX) until the semaphore parameter sent by the control unit indicates that a channel is available, or not sending the message packet;
and when the message packet is transmitted, the notification control unit enables the semaphore parameter to quantitatively develop towards the direction of indicating that the channel is unavailable, and when the message packet is transmitted, the notification control unit enables the semaphore parameter to quantitatively develop towards the direction of indicating that the channel is available.
A channel model equivalent to real carrier monitoring is established, and the carrier monitoring of a real channel can be simulated quickly, simply and conveniently. The carrier monitoring process can be simulated without using a physical channel, the simulation effect of the whole communication process can not be influenced, the simulation truth degree is further improved, the cost is reduced, and the system overhead of the algorithm is very small.
For example, the semaphore parameter indicates that the channel is completely occupied at 0, indicates that the channel is completely available at 5, and the current semaphore parameter is 3, so if a node obtains the parameter from the control unit at this time, the node starts to send a message, and simultaneously informs the control unit that it is sending, so the control unit reduces the semaphore parameter to 2; because the parameter is not 0 at present, other nodes can also send messages, and when the messages start, the parameter is reduced to 1; by analogy, when the parameter is reduced to 0, the rest nodes cannot perform message processing at this time until a certain node completes the message and notifies the control unit, the parameter is increased to 1, the certain node can perform message processing after obtaining the semaphore parameter, the initial parameter value is set to be 5, namely, the parameter when the channel is completely available can limit that only 5 nodes perform message processing simultaneously. A certain number of nodes are allowed to simultaneously report at the same time point, namely, the collision condition is allowed to occur, and a real channel is simply and effectively simulated.
The hardware simulator has the function of synchronizing the system clock and realizes barrier-free communication with the physical computer and the simulator on the cross-physical computer; when the hardware simulator is configured as a central controller, a synchronization module on the hardware simulator reads a time tick value of a physical machine where the hardware simulator is located, and sends the time tick value to the newly started hardware simulator through a clock synchronization message; when the hardware simulator is configured as a slave node, the time tick value in the clock synchronization message from the central controller is parsed and the time at which the slave node performs various types of operations is thereby calibrated to be consistent with the central controller.
The clock synchronization message is used, the clock synchronization of each node is adjusted on the bottom layer, and the clock synchronization is completed by means of direct message packets among the nodes.
In this embodiment, the control unit further includes a channel communication success rate simulation module, which provides an interface operation as shown in fig. 4, so that the control unit obtains a communication success rate script defining a communication success rate (success rate) between each two communication nodes, and configures the channel communication success rate simulation module of the hardware simulator corresponding to each communication node according to the communication success rate script;
after the receiving module (RX) receives the message, the channel communication success rate simulation module first determines which node the message is from according to its configuration, and randomly discards (drop) the message packets from other nodes, so that not all the received message packets are sent to the receive queue (RX queue), thereby implementing different communication success rates between the node and other nodes specified in the communication success rate script.
The signal-to-noise ratio of signal transmission is reduced and the signal quality is deteriorated due to the conditions of noise, signal attenuation and the like of a real channel, so that communication failure with a certain probability is caused. The influence of the channel quality on the communication can be simulated without using a physical channel, the simulation effect of the whole communication process can not be influenced, the simulation truth degree is further improved, and the cost is reduced.
The success rate of communication between any two nodes in the network is issued by the control unit through the command channel of the node, so as to realize the function of dynamically configuring the network topology. And, with the aid of the mathematical relationship between the maximum value of the semaphore parameter and the success rate of communication, the messages colliding with each other are simulated into the noise of the system, i.e. the semaphore parameter is increased, the success rate of communication is reduced, the simulation degree of the real network is higher, but the overhead of the system is not increased.
The foregoing is merely an example of the present invention, and common general knowledge in the field of known specific structures and characteristics is not described herein in any greater extent than that known in the art at the filing date or prior to the priority date of the application, so that those skilled in the art can now appreciate that all of the above-described techniques in this field and have the ability to apply routine experimentation before this date can be combined with one or more of the present teachings to complete and implement the present invention, and that certain typical known structures or known methods do not pose any impediments to the implementation of the present invention by those skilled in the art. It should be noted that, for those skilled in the art, without departing from the structure of the present invention, several changes and modifications can be made, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the implementation of the present invention and the practicability of the patent. The scope of the claims of the present application shall be determined by the contents of the claims, and the description of the embodiments and the like in the specification shall be used to explain the contents of the claims.

Claims (9)

1. A method of simulating communications between nodes, comprising: the method comprises the following steps:
setting a virtual concentrator which can simulate the functions of the concentrator for sending operation commands and receiving operation results;
the method comprises the following steps that a plurality of hardware simulators which can simulate the message receiving and sending functions of a certain communication node of a power line carrier communication network and are controlled by an upper-layer module are arranged;
the system comprises a central controller, a first hardware simulator, a second hardware simulator and a control module, wherein the first hardware simulator is used for simulating the central controller, and the second hardware simulator is used for simulating a common slave node or a collector;
setting a plurality of virtual data acquisition terminals which can simulate the message generation function and the message receiving and sending function of the data acquisition terminals;
setting a control unit for configuring the hardware simulator, the virtual concentrator and the virtual data acquisition terminal;
configuring the virtual concentrator, the hardware simulator and the virtual data acquisition terminal by using the control unit so as to connect the virtual concentrator, the hardware simulator and the virtual data acquisition terminal into a simulated power carrier communication network;
enabling the virtual concentrator, the hardware simulator and the virtual data acquisition terminal to simulate communication behaviors in the power carrier communication network according to respective set scripts;
acquiring a communication success rate script which defines the communication success rate between every two communication nodes, and configuring a channel communication success rate simulation module of a hardware simulator corresponding to each communication node according to the communication success rate script;
the channel communication success rate simulation module randomly discards message packets from other nodes according to the configuration of the channel communication success rate simulation module, so that the communication success rate between the node and other nodes specified in the communication success rate script is realized.
2. The method of simulating inter-node communication of claim 1, wherein: and the system also comprises a general hardware simulator with changeable functions, and the general hardware simulator is used for simulating any one of the central controller, the common slave nodes and the collector according to the configuration of the control unit.
3. The method of simulating inter-node communication of claim 1, wherein: and the control unit configures the parameters, the connection relation and the connection interface of the hardware simulator, the virtual concentrator and the virtual data acquisition terminal according to the configuration file read by the control unit.
4. The method of simulating inter-node communication of claim 1, wherein: the hardware simulator executes a corresponding message sending mode according to the message type sent by the upper layer module; the message sending mode comprises a time division multiplexing mode and a carrier monitoring mode.
5. The method of simulating inter-node communication of claim 4, wherein: when a message packet sent by an upper layer module is a carrier monitoring type message packet, the hardware simulator requests a semaphore parameter from the control unit, and the message packet is sent when the semaphore parameter sent by the control unit indicates that a channel is available, or the message packet is not sent;
when the message packet is sent, the hardware simulator informs the control unit to enable the control unit to quantitatively change the semaphore parameter to the direction indicating that the channel is unavailable, and when the message packet is sent, the hardware simulator informs the control unit to quantitatively change the semaphore parameter to the direction indicating that the channel is available.
6. The method of simulating inter-node communication of claim 4, wherein: and when the message packet sent by the upper layer module is the multiplexing type message packet, the hardware simulator appoints to send the message within preset time according to the time slot information carried in the message packet.
7. The method of simulating inter-node communication of claim 1, wherein: further comprising running a plurality of virtual machines on the physical machine; and arranging the hardware simulator on each virtual machine.
8. The method of simulating inter-node communication of claim 1, wherein: the virtual machine adopts an embedded real-time operating system, and the hardware simulator is set to work based on the embedded real-time operating system.
9. The method of simulating inter-node communication of claim 7, wherein: a plurality of physical machines are adopted;
when the hardware simulator is configured as a central controller, the hardware simulator reads the time tick value of the physical machine where the hardware simulator is located, and sends the time tick value to the newly started hardware simulator through a clock synchronization message; when the hardware simulator is configured as a slave node, the hardware simulator parses the time tick value in the clock synchronization message from the central controller and calibrates the time at which the slave node performs various types of operations to be consistent with the central controller.
CN201810813045.9A 2018-07-23 2018-07-23 Method for simulating communication between nodes Active CN108989111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810813045.9A CN108989111B (en) 2018-07-23 2018-07-23 Method for simulating communication between nodes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810813045.9A CN108989111B (en) 2018-07-23 2018-07-23 Method for simulating communication between nodes

Publications (2)

Publication Number Publication Date
CN108989111A CN108989111A (en) 2018-12-11
CN108989111B true CN108989111B (en) 2021-07-27

Family

ID=64550194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810813045.9A Active CN108989111B (en) 2018-07-23 2018-07-23 Method for simulating communication between nodes

Country Status (1)

Country Link
CN (1) CN108989111B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147341B (en) * 2019-05-16 2021-03-26 国网重庆市电力公司电力科学研究院 645 and 698 communication protocol compatible electric energy meter and communication method
CN110784456B (en) * 2019-10-17 2020-06-02 南方电网数字电网研究院有限公司 Automatic identification method and communication method for communication protocol

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236892A (en) * 2013-04-18 2013-08-07 国家电网公司 Carrier communication testing system
CN103760775A (en) * 2013-12-29 2014-04-30 贵州微科网能科技有限公司 Merging unit simulator
CN104202067A (en) * 2014-09-25 2014-12-10 国家电网公司 Testing simulator for intelligent electric meter carrier communication module
CN107231172A (en) * 2017-06-06 2017-10-03 中国电力科学研究院 A kind of method and system for being tested low-voltage power line bandwidth carrier Communications Interoperability
CN107294563A (en) * 2017-06-06 2017-10-24 中国电力科学研究院 A kind of low-voltage powerline carrier communication interconnects performance test methods and system
CN206819535U (en) * 2017-05-23 2017-12-29 重庆物奇科技有限公司 The power wire broadband carrier kilowatt meter reading-out system of combining wireless narrowband carrier relaying
CN108011654A (en) * 2017-10-30 2018-05-08 中国电力科学研究院有限公司 Apply the device and virtual method in PLC test systems

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236892A (en) * 2013-04-18 2013-08-07 国家电网公司 Carrier communication testing system
CN103760775A (en) * 2013-12-29 2014-04-30 贵州微科网能科技有限公司 Merging unit simulator
CN104202067A (en) * 2014-09-25 2014-12-10 国家电网公司 Testing simulator for intelligent electric meter carrier communication module
CN206819535U (en) * 2017-05-23 2017-12-29 重庆物奇科技有限公司 The power wire broadband carrier kilowatt meter reading-out system of combining wireless narrowband carrier relaying
CN107231172A (en) * 2017-06-06 2017-10-03 中国电力科学研究院 A kind of method and system for being tested low-voltage power line bandwidth carrier Communications Interoperability
CN107294563A (en) * 2017-06-06 2017-10-24 中国电力科学研究院 A kind of low-voltage powerline carrier communication interconnects performance test methods and system
CN108011654A (en) * 2017-10-30 2018-05-08 中国电力科学研究院有限公司 Apply the device and virtual method in PLC test systems

Also Published As

Publication number Publication date
CN108989111A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
CN113014449B (en) Local communication protocol pressure testing method and system of electricity consumption information acquisition system
CN108989111B (en) Method for simulating communication between nodes
CN108989112B (en) System for simulating communication between nodes
CN113938402B (en) Power line and wireless based dual-mode test system and method
CN108924006A (en) Automated testing method, system and the device of router far and near distance performance
Morato et al. The Fail Safe over EtherCAT (FSoE) protocol implemented on the IEEE 802.11 WLAN
CN103778058A (en) TETRA digital trunked air interface test method and system based on TTCN-3
CN109613467B (en) Test equipment and test method for realizing multi-meter test of simulation site
CN108632786B (en) Method, system, control end and test end for railway communication network optimization test
CN102665237B (en) Simulative Ir interface protocol conformance testing device and interoperability testing method
CN101072135A (en) Wireless LAN testing method and system
CN115657646B (en) Test method and device of CAN controller
CN108200545B (en) WLAN signaling test system and test method
CN110798862A (en) Data transmission method and device between service terminal and service master station
CN112911632B (en) Point-to-multipoint network measuring method, device, communication system and storage medium
CN105656716B (en) Protocol module performance test method and system
CN116074178A (en) Digital twin architecture of network, network session processing method and device
CN114900250B (en) Dual-mode communication testing device, system and method
CN203027498U (en) Testing device
Mishra et al. Design of EtherCAT Slave Controller using CIFX 90E-RE for HMI Display
CN116389188B (en) Data transmission method and related device
CN113194041B (en) Terminal simulation platform applied to time division multiple access internet of things
CN110784365A (en) Standby device of station control layer and entity device of transformer substation and automatic online method thereof
CN202931349U (en) Testing system for network product
CN111083298B (en) Method and system for testing power modem

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
TA01 Transfer of patent application right

Effective date of registration: 20190507

Address after: 215316 11th Floor, Block C, Haichuang Building, 288 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Applicant after: Kungao New Core Microelectronics (Jiangsu) Co.,Ltd.

Address before: 401120 14th Floor, 107 Daguzhong Road, Xiantao Street, Yubei District, Chongqing

Applicant before: WU QI TECHNOLOGIES, Inc.

Applicant before: SHANGHAI WU QI TECHNOLOGIES, Inc.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200416

Address after: 401120 Xiantao street, Yubei District, Chongqing, No. 14, 14 middle Valley Road.

Applicant after: WU QI TECHNOLOGIES, Inc.

Applicant after: SHANGHAI WU QI TECHNOLOGIES, Inc.

Address before: 215316 11th Floor, Block C, Haichuang Building, 288 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Applicant before: Kungao New Core Microelectronics (Jiangsu) Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230331

Address after: 401120 14th Floor, 107 Daguzhong Road, Xiantao Street, Yubei District, Chongqing

Patentee after: WU QI TECHNOLOGIES, Inc.

Address before: 401120 14th Floor, 107 Daguzhong Road, Xiantao Street, Yubei District, Chongqing

Patentee before: WU QI TECHNOLOGIES, Inc.

Patentee before: SHANGHAI WU QI TECHNOLOGIES, Inc.

TR01 Transfer of patent right