CN114826821B - Communication method and system - Google Patents
Communication method and system Download PDFInfo
- Publication number
- CN114826821B CN114826821B CN202210299278.8A CN202210299278A CN114826821B CN 114826821 B CN114826821 B CN 114826821B CN 202210299278 A CN202210299278 A CN 202210299278A CN 114826821 B CN114826821 B CN 114826821B
- Authority
- CN
- China
- Prior art keywords
- target
- ring network
- data packet
- network module
- target data
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/42—Loop networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2212/00—Encapsulation of packets
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Small-Scale Networks (AREA)
Abstract
The application discloses a communication method and a communication system, wherein the method comprises the following steps: when the target ring network module receives a target instruction sent by a target upper computer at intervals of preset time, generating target data packets in preset formats according to the target instruction respectively; forwarding the target data packet to each ring network module in the communication network in real time according to a target forwarding path corresponding to the target ring network module, so that each ring network module acquires each target data packet in real time; when each ring network module receives a target data packet sent at the current moment, acquiring a target instruction from the target data packet based on the identification information of the target ring network module; each ring network module receives a target data packet sent at the next moment and adds response data aiming at a target instruction to the target data packet before forwarding the target data packet so as to feed back the response data to the target upper computer through the target ring network module. The method of the application can reduce the delay time.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communications method and system.
Background
With the development of modern society, a high-instantaneity data communication system is widely applied in the industrial field, and due to continuous progress of the technical level, the continuous increase of data transmission quantity and continuous improvement of the requirement of data instantaneity, how to improve the instantaneity of collected data becomes a current popular research object.
At present, most of industrial applications adopt communication technologies based on industrial Ethernet, CAN bus, serial port acquisition and the like, and the defects are that: the acquisition delay time is long, namely the minimum delay time is in the millisecond level, and the later operation and maintenance and upgrading are inconvenient.
Thus, a communication method is needed to solve the problem of long acquisition delay time.
Disclosure of Invention
In view of this, the present application provides a communication method and system, and is mainly aimed at solving the problem of long acquisition delay time.
In order to solve the above problems, the present application provides a communication method, comprising: a plurality of ring network modules; the ring network modules are connected in a head-to-tail communication mode to form a communication network with an annular structure; the at least one ring network module is in communication connection with the upper computer and is used for receiving a target instruction sent by the upper computer; the communication method is characterized by comprising the following steps:
when a target ring network module in communication connection with a target upper computer receives a target instruction sent by the target upper computer at intervals of preset time, generating target data packets in preset formats according to the target instruction respectively;
forwarding the target data packet to each ring network module in the communication network in real time according to a target forwarding path corresponding to the target ring network module, so that each ring network module acquires each target data packet in real time;
when each ring network module receives the target data packet sent at the current moment, acquiring a target instruction from the target data packet based on the identification information of the target ring network module;
each ring network module adds response data aiming at the target instruction to the target data packet before receiving the target data packet sent at the next moment and forwarding the target data packet so as to feed back the response data to the target upper computer through the target ring network module.
Optionally, after each ring network module receives the target data packet sent at the current moment, the method further includes:
carrying out validity judgment on the target data packet;
and under the condition that the target data packet is in the effective state, processing the target data packet to acquire a target instruction corresponding to the ring network module from the target data packet.
Optionally, the data storage area in the target data packet includes an upper computer identification area and an upper computer instruction area corresponding to each upper computer;
the upper computer identification area is used for storing identification information of a target ring network module in communication connection with the upper computer;
each upper computer instruction area is used for storing target instructions corresponding to each upper computer;
the obtaining a target instruction from the target data packet based on the identification information of the target ring network module specifically includes: and acquiring the target instruction from an upper computer instruction area corresponding to the identification information based on the target identification information stored in the upper computer address area in the target data packet.
Optionally, the data storage area in the target data packet further includes a real-time data area;
each ring network module sequentially stores the respective real-time information into the real-time data area according to a preset sequence before receiving the target data packet and forwarding the target data packet.
Optionally, the data storage area in the target data packet further includes a non-real-time data area corresponding to each upper computer instruction area;
each ring network module adds response data for the target instruction to the target data packet to feed back to the target upper computer, and specifically includes:
each ring network module determines a target upper computer instruction area based on the target identification information;
and each ring network module adds the response data aiming at the target instruction and the target instruction into a non-real-time data area corresponding to the target upper computer instruction area so as to feed back the non-real-time data area to an upper computer.
Optionally, the communication method further includes:
responding to the target instruction to acquire response data from a register or input a control instruction to the lower computer to control the lower computer.
Optionally, in the case that the plurality of target ring network modules respectively forward the respective generated target data packets at the same time, the method further includes:
determining a transmission priority based on the network address of each target ring network module;
and sequentially controlling each target ring network module to send the target data packets according to the high-low order of the sending priority.
To solve the above problems, the present application provides a communication system including: a plurality of ring network modules; the ring network modules are connected in a head-to-tail communication mode to form a communication network with an annular structure;
the ring network module is connected with the upper computer in a communication way and is used for receiving target data packets sent by the upper computer at intervals for a preset time.
Optionally, each ring network module includes: the device comprises a field programmable gate array module, a photoelectric conversion module, an upper computer communication interface and a data interface;
the photoelectric conversion modules in the ring network modules are respectively connected in a communication way through a data interface and are used for forwarding the target data packet;
the input end of a field programmable gate array module in a target ring network module which is in communication connection with an upper computer is in communication connection with the upper computer interface of the upper computer through an upper computer communication interface, and is used for receiving a target instruction sent by the upper computer and generating the target data packet based on the target instruction;
the input end of the field programmable gate array module in each ring network module except the target ring network module is in communication connection with the photoelectric conversion module in the respective ring network module and is used for acquiring the target data packet from the photoelectric conversion module;
the output end of the field programmable gate array module in each ring network module is in communication connection with a lower computer interface of a lower computer and is used for outputting target instructions to the lower computer.
Optionally, each ring network module further includes a power module;
the power module is electrically connected with the photoelectric conversion module and the field programmable gate array module respectively and is used for supplying power to the photoelectric conversion module and the field programmable gate array module.
The application has the beneficial effects that the target ring network modules which are in communication connection with the upper computer are utilized to package the target instructions received at intervals of preset time to obtain the target data packets, and then the target data packets are respectively forwarded, so that when the target data packets are sent for the first time, each ring network module can receive the target data packets almost simultaneously, and then the target data packets are respectively processed and responded. The ring network modules can almost synchronously process the target data packet without waiting for the ring network modules to process and respond to the target instruction, thereby reducing the waiting time. And through sending the target data packet again, each ring network module can write the previous response data into the target data packet directly and then transmit the response data back to the upper computer, so that the acquisition delay time can be reduced, and the communication efficiency is improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 is a schematic diagram of a topology of a communication network according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a format of a target packet according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a format of a target packet when multiple upper computers are connected in an embodiment of the present application;
FIG. 4 is a flow chart of data transmission of a plurality of upper computers according to another embodiment of the present application;
fig. 5 is a schematic diagram of a topology of a communication network in a communication system according to the present application;
fig. 6 is a schematic structural diagram of a ring network module.
Detailed Description
Various aspects and features of the present application are described herein with reference to the accompanying drawings.
It should be understood that various modifications may be made to the embodiments of the application herein. Therefore, the above description should not be taken as limiting, but merely as exemplification of the embodiments. Other modifications within the scope and spirit of the application will occur to persons of ordinary skill in the art.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with a general description of the application given above, and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the application will become apparent from the following description of a preferred form of embodiment, given as a non-limiting example, with reference to the accompanying drawings.
It is also to be understood that, although the application has been described with reference to some specific examples, those skilled in the art can certainly realize many other equivalent forms of the application.
The above and other aspects, features and advantages of the present application will become more apparent in light of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application will be described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application in unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not intended to be limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the word "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
An embodiment of the present application provides a communication method, where the communication method in this embodiment is specifically applied to a communication system as shown in fig. 1, and the communication system includes: a plurality of ring network modules; the ring network modules are connected in a head-to-tail communication mode to form a communication network with an annular structure; and the ring network modules are in communication connection with the upper computer and are used for receiving target instructions sent by the upper computer, and each ring network module is also in communication connection with a corresponding lower computer and is used for controlling the lower computer based on the target data packet. The communication method in this embodiment includes the steps of:
when a target ring network module in communication connection with a target upper computer receives a target instruction sent by the target upper computer at intervals of preset time, generating target data packets in preset formats according to the target instruction respectively; forwarding the target data packet to each ring network module in the communication network in real time according to a target forwarding path corresponding to the target ring network module, so that each ring network module acquires each target data packet in real time; the target forwarding paths are determined based on the target ring network modules, namely, the ring network modules connected with the upper computer are different, and the target forwarding paths are different.
When each ring network module receives the target data packet sent at the current moment, acquiring a target instruction from the target data packet based on the identification information of the target ring network module;
each ring network module adds response data aiming at the target instruction to the target data packet before receiving the target data packet sent at the next moment and forwarding the target data packet so as to feed back the response data to the target upper computer through the target ring network module.
That is, in this embodiment, after the host PC issues the target instruction to the target ring network module communicatively connected to the host PC, the target instruction is sent again at a predetermined interval, and then the target ring network module generates the target data packet with the predetermined format. The destination ring network module will thus send its generated destination packet (first destination data) at the current time and then resend it (second destination data) at the next time after an interval of 20 ms. The first time of sending the target data packet is to fast forward and transfer the target instruction in the target data packet to each ring network module in the communication network; the second sending of the target data packet is to obtain the response data of each ring network module aiming at the target instruction. The specific process is as follows:
the upper computer sends a target instruction to a target ring network module at the current moment, for example, the target ring network module 7# generates a target data packet (a first data packet) based on the target instruction, and then the target ring network module 7# forwards the first target data packet to a ring network module 6# and/or a ring network module 8#, which are in communication connection with the target ring network module; after the target ring network module forwards the target data packet, the target ring network module processes and responds the first target data packet to obtain response data. Similarly, after receiving the first target data packet sent at the current moment, the other ring network modules forward the first target data packet, process and respond the first target data packet, and correspondingly obtain response data. By adopting the steps of forwarding and responding, the forwarding rate of the target data packet can be improved, the target data packet can be rapidly transmitted to each ring network module, and each ring network module can process and respond the target data packet in a nearly synchronous manner.
In this embodiment, after receiving the first target data packet sent at the current time and before processing the first target data packet, each ring network module may perform validity judgment on the first target data packet, and process the target data packet under the condition that the validity state of the first target data packet is determined, so as to obtain a target instruction corresponding to the ring network module from the target data packet. That is, the target packet is processed and responded only when it is valid, and is not processed and responded when it is in a non-valid state, so that the workload of each ring network module can be prevented from being reduced.
Then, at the next moment of the preset time interval, the upper computer sends the same target instruction to the target ring network module, namely sends the target instruction to a target ring network module 7# in communication connection with the target ring network module, and the target ring network module 7# generates a target data packet (a second target data packet) based on the target instruction; then the target ring network module 7# writes the response data of the first target data packet at the previous moment into the second target data packet, and then forwards the second target data packet to the ring network module 6# and/or the ring network module 8# which are in communication connection with the second target data packet. Similarly, after receiving the second target data packet, the other ring network modules write the response data into the second target data packet, and then forward the second target data packet until all the ring network modules write the response data into the second target data respectively and transmit the response data back to the upper computer through the target ring network modules. In this embodiment, by sending the target command at predetermined intervals and then generating a corresponding second target data packet by the target ring network module and forwarding the second target data packet, each ring network module can quickly write response data into the second target data packet and transmit the response data back to the host computer, without waiting for the ring network module to process and respond to the target command, thereby reducing the acquisition delay time and improving the communication efficiency.
In this embodiment, the format/transmission protocol of the target data packet may at least include a real-time data area and a non-real-time data area as shown in fig. 2. The real-time data area is used for sequentially storing the real-time information written in each ring network module according to a preset sequence. That is, each ring network module transmits the target data packet at the current time, and each ring network module sequentially stores the respective real-time information in the real-time data area according to a predetermined sequence before forwarding the target data packet. In a specific implementation process, unique identification information, such as ID identification, may be configured for each ring network module, and then each ring network module writes real-time information into the real-time data area in the order of the respective ID identifications. The non-real-time data area is used for storing response data which is fed back by each ring network module and is aimed at the target instruction. That is, when each ring network module receives the target data packet (the second target data packet) sent at the next time, the response result obtained by responding to the target data packet (the first target data packet) received at the previous time is written into the non-real-time data area, so as to feed back to the target upper computer.
Specifically, in this embodiment, the destination data packet may further include a start bit, a clock synchronization bit (r bits), and an upper computer ID bit (i.e. an ID identifier of a ring network module communicatively connected to the upper computer). Wherein the target data packet can be divided into a synchronous data packet (synchronous data frame) and an asynchronous data packet (asynchronous data frame) according to the difference of the start bits; synchronous data packets differ from asynchronous data packets in that: the start bits are different, i.e. the low duration after the falling edge is different, for the two packets the data area following the start bits is the same. The synchronous data packet refers to a data packet transmitted by the upper computer according to a default/preset time interval, and the asynchronous data packet refers to a data packet transmitted by the upper computer according to a manually adjusted time interval. The upper computer ID bit is used for storing identification information of a target ring network module in communication connection with the target upper computer, namely, the ID of the ring network module used for generating the target data packet.
In this embodiment, the target ring network modules communicatively connected to the upper computer are used to encapsulate the target instructions received at predetermined intervals to obtain the target data packets, and then forward the target data packets respectively, so that when the target data packets are sent for the first time, each ring network module adopts a processing method of forwarding first and then responding, and each ring network module can receive the target data packets almost simultaneously, thereby reducing communication delay. The ring network modules can almost synchronously process the target data packet without waiting for the ring network modules to process and respond to the target instruction, thereby reducing the waiting time. And through sending the target data packet again, each looped network module can write in the target data packet with the response data before directly, then pass back to the host computer, further can reduce and gather delay time, improve communication efficiency.
In yet another embodiment of the present application, a communication network formed by a plurality of ring network modules may be simultaneously connected to a plurality of upper computers. For example, the ring network module 1#, the ring network module 2#, and the ring network module 3# are respectively connected to the upper computer. At this time, when the target ring network modules which are in communication connection with the upper computer respectively and simultaneously receive the target instructions sent by the corresponding target upper computer, corresponding target data packets are respectively generated according to the received target instructions, and when each target ring network module respectively and simultaneously forwards the target data packets, the sending priority is determined based on the network address of each target ring network module; and sequentially controlling each target ring network module to send the target data packet according to the high-low order of the sending priority. That is, after the ring network module 1# and the ring network module 3# respectively receive the target instructions sent by the corresponding upper computers at the same time and then generate the corresponding target data packets, the sending priority is determined according to the IDs of the ring network module 1# and the ring network module 3#, specifically, the priority level can be determined according to the size of the ID value, for example, the ID of the ring network module 1# is 000, the ID of the ring network module 3# is 003, and the sending priority level with the small ID is determined, so that the sending priority of the ring network module 1# is higher than the sending priority of the ring network module 3#, thereby the ring network module 1# can be controlled to forward the generated target data packets.
In this embodiment, when there are multiple upper computers connected, the format of the target data packet may be as shown in fig. 3, where the data storage area in the target data packet includes: start position: b bit, clock synchronization bit: r bits, upper computer identification area (upper computer ID bit): s bit, real-time data area: x is N bits, an upper computer instruction area corresponding to each upper computer and a non-real-time data area y is N bits corresponding to each upper computer. Wherein x is the real-time data area of each ring network module, y is the non-real-time data area of each module, and N is the number of ring network modules. In this embodiment, the upper computer identification area is configured to store identification information of a target ring network module that is communicatively connected to the target upper computer; each upper computer instruction area is used for storing target instructions of each upper computer; the obtaining a target instruction from the target data packet based on the identification information of the target ring network module specifically includes: and acquiring the target instruction from an upper computer instruction area corresponding to the target identification information based on the target identification information stored in the upper computer identification area in the target data packet. That is, when the target ring network module generates the target data packet, the ID of the target ring network module is stored in the upper computer identification area in the target data packet, and then the target instruction is stored in the corresponding upper computer instruction area. And then the target data packet is sent to other ring network modules. After receiving a target instruction sent at the current moment and generating a first target data packet, the target ring network module forwards the first target data packet to a ring network module in communication connection with the first target data packet; the target ring network module responds according to the received target instruction while forwarding the first target data packet, so as to acquire response data from a register or input a control instruction to the lower computer to control the lower computer. Similarly, when each ring network module receives the first target data packet, the processing mode is adopted, namely the first target data packet is forwarded, meanwhile, the ID identification of the target ring network module is acquired from the upper computer identification area of the first target data packet, so that the target instruction of the target upper computer is acquired from the corresponding upper computer instruction area according to the ID identification, and then the acquired target instruction is responded, namely forwarding and processing are simultaneously carried out, and response data are acquired. Then, when the target ring network module receives the target instruction at the next moment of the preset time interval, a second target data packet (which is the same as the first target data packet) is firstly generated based on the target instruction, the identification area is then added with the response data of the target instruction at the last moment and the target instruction into a non-real-time data area corresponding to the target upper computer instruction area, and finally the second target data packet is forwarded. Similarly, when each ring network module receives the second target data packet at the next moment of the preset time interval, the target upper computer instruction area is determined based on the target ring network module ID in the data packet, then the target non-real-time data area is determined according to the target upper computer instruction area, so that the previous response data is written into the non-real-time data area, and meanwhile, the target instruction corresponding to the response data can be written into the target non-real-time data area to be fed back to the upper computer.
In the method of this embodiment, the real-time transmission protocol prescribes two instructions, respectively: the control command and the query command are provided, the priority of the control command is larger than that of the query command, and when one ring network module sends the control command, the query command in the ring network/communication network can be directly interrupted.
In this embodiment, when the ring network module receives the target data packet, the ring network module directly processes the target data packet when receiving the ID bit of the upper computer (i.e., the identification information of the target ring network module), so as to improve the real-time performance of the ring network; the specific ring network delay value is calculated as follows, if the starting bit is adopted: 3, a step of; synchronizing clock bits: 5, a step of; ID bits: 8, the transmission frequency is 100MHz, and the number of ring network modules is 16, so (3+5+8) ×10×16=2560 nanoseconds=2.56 microseconds, and compared with millisecond-level communication delay of receiving and processing data frames in other current technologies, the real-time performance is greatly improved. This advantage is more pronounced as the number of ring modules increases. The method of the present embodiment can reduce acquisition delay.
In order to further explain the above embodiments, the following description is made in connection with specific application scenarios. As shown in FIG. 4, the current ring network/communication website includes 6 ring network modules, each ring network module has an upper computer connected thereto, and in this case, the length of a data frame/target data packet is increased, each upper computer occupies the same data length in the data frame/target data packet, its positions are arranged in the order of node IDs, the data field/target data packet includes an instruction area and a response data area of each module, if an instruction is already transmitted in the ring network, the 1# module sends an instruction, the instruction area of the data field corresponding to the 1# module is directly filled, and the instruction is forwarded to the next module, and the next module can determine whether there are multiple upper computers in the ID positions of the upper computers, and acquire the instruction at the corresponding positions and process and forward the instruction.
The method comprises the steps that a 1# upper computer sends an instruction to a 1# ring network module, an FPGA module of the 1# ring network module processes and encapsulates the received instruction to obtain a target data packet, whether a data frame/other target data packet which is being transmitted exists in a current ring network or not is judged, if the data frame/other target data packet which is being transmitted exists in the current ring network, the data frame/other target data packet is directly processed, and the data frame/other target data packet is forwarded to the next ring network module until the next sending time, a timing sending mechanism and a time interval are 20 milliseconds; if the current ring network has data frame/other target data packet, processing the instruction from the upper computer, filling the instruction into the instruction area of the data field appointed by the 1# upper computer in the data frame/target data packet, namely processing and packaging the target instruction to obtain the target data packet, and forwarding, wherein each module at the back processes, fills, forwards or responds to the upper computer the instruction according to the flow.
Another embodiment of the present application provides a communication system, as shown in fig. 5, including: a plurality of ring network modules; the ring network modules are connected in a head-to-tail communication mode to form a communication network with an annular structure; the ring network module is in communication connection with the upper computer and is used for receiving a target instruction sent by the upper computer at intervals of preset time and generating a target data packet based on the target instruction. For example, each ring network module can be connected end to end through optical fibers to form a ring network, and the target ring network module can be connected into the upper computer in a hot plug mode.
As shown in fig. 6, each ring network module in this embodiment includes a field programmable gate array FPGA module, a photoelectric conversion module, an upper computer communication interface, and a data interface; the photoelectric conversion modules in the ring network modules are respectively connected in a communication way through a data interface and are used for forwarding the target data packet; the input end of an FPGA module in a target ring network module which is in communication connection with the upper computer interface of the upper computer through an upper computer communication interface, and is used for receiving a target instruction sent by the upper computer so as to generate a target data packet based on the target instruction; the input end of the FPGA module in each ring network module except the target ring network module is in communication connection with the photoelectric conversion module in the respective ring network module and is used for acquiring the target data packet from the photoelectric conversion module; the output end of the FPGA module in each ring network module is in communication connection with a lower computer interface of the lower computer and is used for outputting a target instruction to the lower computer. In this embodiment, each ring network module further includes a power module. The power module is electrically connected with the photoelectric conversion module and the FPGA module respectively and is used for supplying power to the photoelectric conversion module and the FPGA module. In this embodiment, each ring network module has the same structure and interface, and includes an upper computer communication interface for communication connection with an upper computer.
The data interfaces in this embodiment include standard fiber optic interfaces and standard ethernet interfaces, which are connected using fiber optic transmission media.
The FPGA module in this embodiment is configured to implement the operations of parsing, packaging, allocating, and converting a transmission signal, and implement the function of transmitting/receiving a data frame by the ring network module. The FPGA module is connected with the upper computer through an upper computer interface and connected with the lower computer through a lower computer interface.
In the communication system of this embodiment, the target ring network modules communicatively connected to the upper computer are utilized to encapsulate the target instructions received at predetermined intervals to obtain target data packets, and then forward the target data packets respectively, so that when the target data packets are sent for the first time, each ring network module can receive the target data packets almost simultaneously, and then process and respond to the target data packets respectively. The ring network modules can almost synchronously process the target data packet without waiting for the ring network modules to process and respond to the target instruction, thereby reducing the waiting time. And through sending the target data packet again, each ring network module can write the previous response data into the target data packet directly and then transmit the response data back to the upper computer, so that the acquisition delay time can be reduced, and the communication efficiency is improved.
The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application, the scope of which is defined by the claims. Various modifications and equivalent arrangements of this application will occur to those skilled in the art, and are intended to be within the spirit and scope of the application.
Claims (6)
1. A method of communication, comprising: a plurality of ring network modules; the ring network modules are connected in a head-to-tail communication mode to form a communication network with an annular structure; the at least one ring network module is in communication connection with the upper computer and is used for receiving a target instruction sent by the upper computer; the communication method is characterized by comprising the following steps:
when a target ring network module in communication connection with a target upper computer receives a target instruction sent by the target upper computer at intervals of preset time, generating target data packets in preset formats according to the target instruction respectively;
forwarding the target data packet to each ring network module in the communication network in real time according to a target forwarding path corresponding to the target ring network module, so that each ring network module acquires each target data packet in real time, wherein the target forwarding path is determined based on the target ring network module, namely, the ring network module connected with an upper computer is different, and the target forwarding paths are different;
when each ring network module receives the target data packet sent at the current moment, acquiring a target instruction from the target data packet based on the identification information of the target ring network module;
each ring network module adds response data aiming at the target instruction to the target data packet when receiving the target data packet sent at the next moment and before forwarding the target data packet so as to feed back the response data to the target upper computer through the target ring network module;
the data storage area in the target data packet comprises an upper computer identification area and an upper computer instruction area corresponding to each upper computer;
the upper computer identification area is used for storing identification information of a target ring network module in communication connection with the upper computer;
each upper computer instruction area is used for storing target instructions corresponding to each upper computer;
the obtaining a target instruction from the target data packet based on the identification information of the target ring network module specifically includes: acquiring the target instruction from an upper computer instruction area corresponding to the identification information based on target identification information stored in an upper computer address area in the target data packet;
after issuing a target instruction to a target ring network module in communication connection with the upper computer PC, the upper computer PC sends the target instruction again at intervals of preset time, then the target ring network module generates a target data packet with a preset format, and as the target instructions sent at intervals of the upper computer are the same, the target data packets generated by the target ring network module are the same, so that the target ring network module sends a first target data packet generated by the target ring network module at the current moment, and then sends a second target data packet again at the next moment after 20 milliseconds; the first target data packet is used for rapidly forwarding and transmitting a target instruction in the first target data packet to each ring network module in the communication network; the second target data packet is used for acquiring response data of each ring network module aiming at a target instruction; after the target ring network module forwards the target data packet, the target ring network module processes and responds to the first target data packet to obtain response data; similarly, after receiving a first target data packet sent at the current moment, other ring network modules forward the first target data packet, process and respond the first target data packet, and correspondingly obtain response data; by adopting the steps of forwarding and responding, the forwarding rate of the target data packet can be improved, the target data packet can be rapidly transmitted to each ring network module, and each ring network module can process and respond the target data packet in a nearly synchronous manner.
2. The method of claim 1, wherein each ring network module, after receiving the target data packet sent at the current time, further comprises:
carrying out validity judgment on the target data packet;
and under the condition that the target data packet is in the effective state, processing the target data packet to acquire a target instruction corresponding to the ring network module from the target data packet.
3. The method of claim 1, wherein the data storage area in the target data packet further comprises a real-time data area;
each ring network module sequentially stores the respective real-time information into the real-time data area according to a preset sequence before receiving the target data packet and forwarding the target data packet.
4. The method of claim 3, wherein the data storage area in the target data packet further comprises a non-real-time data area corresponding to each of the upper computer instruction areas;
each ring network module adds response data for the target instruction to the target data packet to feed back to the target upper computer, and specifically includes:
each ring network module determines a target upper computer instruction area based on the target identification information;
and each ring network module adds the response data aiming at the target instruction and the target instruction into a non-real-time data area corresponding to the target upper computer instruction area so as to feed back the non-real-time data area to an upper computer.
5. The method of claim 2, wherein the method further comprises:
responding to the target instruction to acquire response data from a register or input a control instruction to the lower computer to control the lower computer.
6. The method of claim 1, wherein in the case where the plurality of target ring network modules respectively forward the respective generated target packets at the same time, the method further comprises:
determining a transmission priority based on the network address of each target ring network module;
and sequentially controlling each target ring network module to send the target data packets according to the high-low order of the sending priority.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210299278.8A CN114826821B (en) | 2022-03-25 | 2022-03-25 | Communication method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210299278.8A CN114826821B (en) | 2022-03-25 | 2022-03-25 | Communication method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114826821A CN114826821A (en) | 2022-07-29 |
CN114826821B true CN114826821B (en) | 2023-10-13 |
Family
ID=82531523
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210299278.8A Active CN114826821B (en) | 2022-03-25 | 2022-03-25 | Communication method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114826821B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103888189A (en) * | 2014-03-03 | 2014-06-25 | 浙江大学 | Single-optical-fiber ring network communication method suitable for large-scale power electronic system |
JP2017121005A (en) * | 2015-12-28 | 2017-07-06 | 三菱電機株式会社 | Transmission system, master station device, slave station device, and transmission method |
CN110113242A (en) * | 2019-05-07 | 2019-08-09 | 南京磐能电力科技股份有限公司 | Multi-node synchronization sampling and data transmission method in ring-type communication network |
CN110572308A (en) * | 2019-09-09 | 2019-12-13 | 西安奇点能源技术有限公司 | Distributed high-real-time ring network communication system |
CN111817940A (en) * | 2020-09-11 | 2020-10-23 | 之江实验室 | Industrial control ring network system, ring network control protocol and implementation method thereof |
-
2022
- 2022-03-25 CN CN202210299278.8A patent/CN114826821B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103888189A (en) * | 2014-03-03 | 2014-06-25 | 浙江大学 | Single-optical-fiber ring network communication method suitable for large-scale power electronic system |
JP2017121005A (en) * | 2015-12-28 | 2017-07-06 | 三菱電機株式会社 | Transmission system, master station device, slave station device, and transmission method |
CN110113242A (en) * | 2019-05-07 | 2019-08-09 | 南京磐能电力科技股份有限公司 | Multi-node synchronization sampling and data transmission method in ring-type communication network |
CN110572308A (en) * | 2019-09-09 | 2019-12-13 | 西安奇点能源技术有限公司 | Distributed high-real-time ring network communication system |
CN111817940A (en) * | 2020-09-11 | 2020-10-23 | 之江实验室 | Industrial control ring network system, ring network control protocol and implementation method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN114826821A (en) | 2022-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112671638B (en) | Gateway structure for multi-protocol conversion | |
KR102119418B1 (en) | Communication system, communication device and communication method | |
CN110177013B (en) | FPGA-based EtherCAT master-slave station design and implementation method | |
US7508824B2 (en) | Method and system for transmitting data via switchable data networks | |
CN107204110B (en) | Method for rapidly reading meter data based on broadband network | |
CN109995675B (en) | Self-adaptive industrial Ethernet gateway system and method based on software definition | |
CN105187283A (en) | Industrial control network slave station communication method and device based on EtherCAT protocol | |
EP2618544B1 (en) | Ethernet communication system and method based on mmc/sd interface | |
CN106411740A (en) | Ethernet controller based network port extension method | |
JP2002261786A (en) | Multi-access communication system and data transmitting and receiving device | |
CN105553795B (en) | A method of the transmission standard Ethernet data in Industrial Ethernet | |
CN108199822B (en) | Bus synchronization method and device of EtherCAT-NCUC | |
CN113676386B (en) | FC-AE-1553 bus protocol message communication system | |
CN103684647B (en) | Time delay removing method that PTP packet is changed between Ethernet and E1 agreement and device | |
CN114826821B (en) | Communication method and system | |
CN113328926B (en) | FC-AE-1553 and FC-AE-ASM hybrid network system | |
CN110830137B (en) | Multi-node time synchronization control system based on SRIO and synchronization control method thereof | |
CN112491620B (en) | Multi-channel data transmission controller based on SRIO and adjusting method | |
US20140334341A1 (en) | Method and Apparatus for Full Duplex Serial Shifting Mode and Switch Mode Data Transmission | |
CN116155843B (en) | PYNQ-based pulse neural network chip data communication method and system | |
CN112363479A (en) | Digital communication transmission method and system between field devices | |
CN110572308A (en) | Distributed high-real-time ring network communication system | |
WO2022127448A1 (en) | Message transmission method, terminals and storage medium | |
CN104734838A (en) | Method, system and switching matrix for synchronizing data | |
WO2024179531A1 (en) | Data transmission method, ethernet device, and optical passive switching 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 | ||
CB02 | Change of applicant information |
Address after: 710076 Room 101, floor 1, South span of No. 78 Jinye Road, high tech Zone, Xi'an, Shaanxi Province Applicant after: Xi'an Singularity Energy Co.,Ltd. Address before: 710076 Room 101, floor 1, South span of No. 78 Jinye Road, high tech Zone, Xi'an, Shaanxi Province Applicant before: Xi'an Singularity Energy Technology Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |