Data transmission method and system
By converting and processing the original physical layer data in the data transmission system, adapting to the needs of different network port speeds, the packet loss and transmission delay problems caused by network congestion in the prior art are solved, and the real-time and stability of the system are improved.
Patent Information
- Application Number
- CN202411965709.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-28
AI Technical Summary
In the transmission of high-traffic data, the port mirroring technology increases the burden on the switch, affects the real-time nature of the control network, and may cause network congestion when the high-speed network port sends data to the low-speed network port, resulting in packet loss and transmission delay.
The original physical layer data collected by the physical layer transceiver is received through the data receiving port, and the data is converted to obtain the original link layer data of the target transmission rate, and the data is forwarded to another physical layer transceiver according to the transmission rate of the data sending port, and the data is processed to obtain the target link layer data, and uploaded to the server.
The data transmission, processing and uploading process at different network port rates is realized, network congestion is avoided, and the real-time and stability of the system is improved.
Smart Images

Figure CN119728738A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial Ethernet, and in particular to a data transmission method and system. Background Art
[0002] As a bridge between field equipment and control systems, the control network ensures the accuracy of monitoring data and the timely execution of control instructions through efficient and real-time data transmission. In order to improve the stability and efficiency of the production process, a data acquisition system can be deployed in the control network to monitor and collect key data of industrial field equipment in real time, and upload the processed data to the upper computer interface for display, so that users can monitor the status of the control network in real time.
[0003] When data is transmitted between network interfaces with different transmission rates, the data in the control network is usually collected through the switch's port mirroring technology and auto-negotiation technology. Port mirroring technology copies the data stream of one port to another port for monitoring and analysis. This process is usually completed on switches, routers, or network devices, which usually have dedicated mirror ports or mirroring functions. Auto-negotiation technology enables network devices to automatically identify and set the optimal connection parameters, including transmission rate (such as 10 / 100 / 1000Mbps) and working mode (half-duplex or full-duplex). Once the two devices at both ends determine the best operating mode that they both support through auto-negotiation, data transmission can be managed through caching mechanisms and flow control protocols to ensure smooth transmission of data packets between interfaces with different rates. Data can be collected in the control network through the switch's port mirroring method, but this method has significant disadvantages when transmitting high-traffic data. Specifically, port mirroring will increase the burden on the switch, resulting in reduced performance; at the same time, the mirrored traffic will occupy a large amount of bandwidth resources, affecting the real-time performance of the control network; the data collected through port mirroring does not contain timestamp information, and the timing of the frame will also change, affecting the real-time performance of data analysis and making it impossible to accurately monitor the status of the control network. It is also possible to use auto-negotiation technology to transmit data between network ports with different transmission rates instead of using a switch to collect network data, but there are also some problems. For example, when a high-speed network port sends data to a low-speed network port, network congestion may occur. This congestion will not only significantly slow down the data transmission speed, but may also cause problems such as packet loss and transmission delay, affecting the real-time performance and stability of the system. Summary of the invention
[0004] The present invention provides a data transmission method and system to solve the technical problem in the prior art that data packet loss and transmission delay caused by network congestion lead to poor system real-time performance and stability.
[0005] According to one aspect of the present invention, a data transmission method is provided, the method comprising:
[0006] receiving raw physical layer data collected by a physical layer transceiver through a data receiving port;
[0007] Performing data conversion on the original physical layer data to obtain original link layer data of a target transmission rate;
[0008] forwarding the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port;
[0009] The original link layer data collected by the physical layer transceiver is processed to obtain target link layer data, and the target link layer data is uploaded to the server.
[0010] According to another aspect of the present invention, there is provided a data transmission system, comprising: a data transmission device and a server; wherein the data transmission device comprises at least three physical layer transceivers and a data processing module;
[0011] Wherein, one of the physical layer transceivers is connected to the data processing module via a data receiving port, another of the physical layer transceivers is connected to the data processing module via a data sending port, an input end of yet another of the physical layer transceivers is connected to the data processing module via a data uploading port, and an output end is connected to the server;
[0012] The data processing module receives the original physical layer data collected by a physical layer transceiver through the data receiving port, and performs data conversion on the original physical layer data to obtain the original link layer data of the target transmission rate; the data processing module forwards the original link layer data to another physical layer transceiver according to the data transmission rate of the data sending port;
[0013] The data processing module processes the original link layer data to obtain target link layer data, and sends the target link layer data to another physical layer transceiver through the data upload port, and uploads the target link layer data to the server through the another physical layer transceiver.
[0014] The technical solution of the embodiment of the present invention performs data conversion on the original physical layer data collected by a physical layer transceiver to obtain the original link layer data of the target transmission rate, then forwards the original link layer data to another physical layer transceiver according to the data transmission rate of the data sending port, processes the original data link layer data to obtain the target link layer data, and uploads the target link layer data to the server, thereby realizing the data transmission, processing and uploading process at different network port rates, solving the technical problem of poor system real-time and stability caused by data packet loss and transmission delay caused by network congestion in the prior art, and ensuring the real-time and stability of the system.
[0015] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 is a flow chart of a data transmission method provided by an embodiment of the present invention;
[0018] Figure 2 is a flow chart of another data transmission method provided by an embodiment of the present invention;
[0019] Figure 3 is a structural schematic diagram of a data transmission system provided by an embodiment of the present invention;
[0020] Figure 4 is a structural schematic diagram of another data transmission system provided by an embodiment of the present invention;
[0021] Figure 5 is a structural schematic diagram of a data transmission device provided by an embodiment of the present invention;
[0022] Figure 6 is a structural diagram of a data processing module provided by an embodiment of the present invention;
[0023] Figure 7 It is a structural diagram of another data transmission system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] In one embodiment, Figure 1 : is a flow chart of a data transmission method provided by an embodiment of the present invention. This embodiment is applicable to data collection and transmission in industrial Ethernet. In the embodiment, the data transmission system includes: a data transmission device and a server. Among them, the data transmission device includes: a data processing module and a physical layer transceiver. The method can be executed by the data processing module in the data transmission system, and the data transmission system can be implemented in the form of hardware and / or software. Exemplarily, the data processing module can be an FPGA. Figure 1 As shown, the method includes:
[0027] S110 , receiving original physical layer data collected by a physical layer transceiver through a data receiving port.
[0028] The data receiving port is a port in the data transmission device and is used for receiving data. One or more data receiving ports can be configured in the data transmission device. The physical layer transceiver is used to implement the data receiving and sending functions at the physical layer. For example, the physical layer transceiver can be a PHY chip. Raw physical layer data refers to the unprocessed data collected by the physical layer transceiver from the physical layer.
[0029] In an embodiment, the physical layer transceiver for data collection collects data of the physical layer as raw physical layer data; then the physical layer transceiver for data collection sends the raw physical layer data to the data processing module through the data receiving port.
[0030] S120: Perform data conversion on the original physical layer data to obtain original link layer data of the target transmission rate.
[0031] The link layer data refers to a data unit that can be transmitted and processed at the link layer. Generally speaking, the link layer data can be called an original link layer data frame or an original link layer data message. Correspondingly, the original link layer data refers to an unprocessed link layer data frame that can be transmitted and processed at the link layer.
[0032] In an embodiment, the data processing module is directly connected to the physical layer transceiver. The original physical layer data received from the physical layer is different from the link layer data frame format. It is necessary to perform data conversion on the original physical layer data to obtain the original link layer data. The data conversion process may include: the conversion process of frequency, bit width and data frame format. For example, the data frame of the physical layer data is not limited to a unified frame header, data part and frame tail structure, but only converts the digital signal into an analog signal or optical signal suitable for physical medium transmission; the data frame of the link layer data generally consists of a frame header, a data part and a frame tail. The frame header contains the destination MAC address, the source MAC address, the type field, etc.; the data part is used to carry the actual user data from the upper layer protocol; the frame tail generally contains a cyclic redundancy check (CRC) code for error detection, etc.
[0033] The target transmission rate refers to the transmission rate that the original link layer data needs to meet. For example, the target transmission rate can be a gigabit rate. Correspondingly, the original physical layer data can be converted into 8-bit data with a frequency of 125M, that is, the frequency of the original link layer data is 125M, and the bit width is 8 bits; and the original link layer data is converted according to the frame format of the link layer data to obtain the original link layer data that meets the frame format of the link layer data.
[0034] S130. Forward the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port.
[0035] Among them, the data transmission port is a port in the data transmission device and is used for data transmission. One or more data transmission ports can be configured in the data transmission device. It should be noted that the number of data transmission ports included in the data transmission device is the same as the number of data receiving ports. In an embodiment, the data transmission port and the data receiving port are paired, that is, one data transmission port corresponds to one data receiving port. Exemplarily, it is assumed that the data transmission device includes 2 data transmission ports and 2 data receiving ports.
[0036] In an embodiment, the data transmission rate of the data transmission port is associated with the data transmission rate supported by another physical layer transceiver. For example, if the data transmission rate supported by another physical layer transceiver is 100 Mbps, the data transmission rate of the corresponding data transmission port is 100 Mbps; for another example, if the data transmission rate supported by another physical layer transceiver is 1000 Mbps, the data transmission rate of the corresponding data transmission port is 1000 Mbps. In one embodiment, the original link layer data is forwarded to another physical layer transceiver according to the data transmission rate of the data transmission port, including: when the data transmission rates of the data receiving port and the data transmission port are inconsistent, the original link layer data is converted according to the data transmission rate of the data transmission port to obtain new link layer data; and the new link layer data is forwarded to another physical layer transceiver. Among them, the new link layer data refers to the link layer data that meets the data transmission rate of the data transmission port. When the data transmission rates of the data receiving port and the data transmission port are inconsistent, the original link layer data collected by a physical layer transceiver can be converted according to the data transmission rate of the data transmission port to obtain new link layer data that meets the data transmission rate of the data transmission port, and the new link layer data is forwarded to another physical layer transceiver. For example, assuming that the data transmission rate of the data sending port is 100 Mbps, the original link layer data can be converted into 4-bit data with a frequency of 25M; if assuming that the data transmission rate of the data sending port is 1G, the original link layer data can be converted into 4-bit data with a frequency of 250M.
[0037] Exemplarily, when the data transmission rate of the data receiving port is 100 Mbps and the data transmission rate of the data sending port is 1 Gigabit, the original link layer data received from the data receiving port can be cached in the data processing module, and data transmission can be performed only when the amount of cached original link layer data can meet the data transmission rate of the data sending port, thereby avoiding data transmission interruptions; when the data transmission rate of the data receiving port is 1 Gigabit and the data transmission rate of the data sending port is 100 Mbps, the original link layer data received from the data receiving port can be converted into new link layer data of 100 Mbps to avoid communication congestion during the transmission process, which in turn leads to data transmission stability.
[0038] In one embodiment, the original link layer data is forwarded to another physical layer transceiver according to the data transmission rate of the data transmission port, including: when the data transmission rates of the data receiving port and the data transmitting port are consistent, the original link layer data is directly transparently transmitted to another physical layer transceiver. When the data transmission rates of the data receiving port and the data transmitting port are consistent, there is no need to perform rate conversion on the original link layer data, and the original link layer data can be directly transparently transmitted to another physical layer transceiver, thereby reducing delays and improving the real-time performance of data transmission.
[0039] S140: Process the original link layer data collected by the physical layer transceiver to obtain target link layer data, and upload the target link layer data to the server.
[0040] Among them, the target link layer data refers to the link layer data including the data receiving timing. In the actual data transmission process, a data receiving port with a higher priority receives the original physical layer data later than a data receiving port with a lower priority, and the data processing module prioritizes the processing and uploading of the target link layer data associated with the original physical layer data received by the data receiving port with a higher priority, which causes the server to mistakenly believe that a data receiving port with a higher priority receives the original physical layer data earlier than a data receiving port with a lower priority. In order to avoid this situation, the original link layer data can be timestamped to ensure that the server can judge the receiving time of the original physical layer data based on the timestamp, so as to effectively monitor the status of each industrial control device in the industrial control network. The technical solution of this embodiment converts the original physical layer data collected by a physical layer transceiver to obtain the original link layer data of the target transmission rate, then forwards the original link layer data to another physical layer transceiver according to the data transmission rate of the data sending port, processes the original data link layer data to obtain the target link layer data, and uploads the target link layer data to the server, thereby realizing the data transmission, processing and uploading process at different network port rates, solving the technical problem of poor system real-time and stability caused by data packet loss and transmission delay caused by network congestion in the prior art, and ensuring the real-time and stability of the system.
[0041] In one embodiment, before the original physical layer data is converted to obtain the original link layer data of the target transmission rate, it also includes: clock synchronization of the original physical layer data according to its own system master clock. The system master clock refers to the working clock frequency of the data processing module; illustratively, the working clock frequency of the data processing module can be about 50MHz-100MHz. In an embodiment, all the original physical layer data received from the data receiving port can be synchronized to the system master clock, which can eliminate the phase difference that may be generated after the collected original physical layer data passes through the physical layer transceiver.
[0042] In one embodiment, the data transmission method further includes: receiving a clock synchronization message sent by a server; timing the system master clock of the system master clock according to the clock synchronization message, so that the system master clock is calibrated to a preset absolute time. Wherein, the clock synchronization message refers to a specific data message that can realize the clock synchronization of each module in the data processing module. The clock synchronization message can be a frame message generated according to a specified format. Exemplarily, the clock synchronization message can be a synchronization message in the IEEE1588 precision time protocol, or a message in the network time protocol, which is not limited. The data processing module itself contains a system clock with a working clock frequency. In order to ensure the clock synchronization of each module in the data processing module, the clock synchronization message sent by the server can be received by the clock synchronization module in the data processing module. The clock synchronization module automatically identifies and extracts the timestamp carried in the clock synchronization message as the preset absolute time, and assigns the timestamp to the register used to maintain the local clock, so as to time the various modules in the data processing module, thereby ensuring the clock synchronization of each module in the data processing module. Wherein, the preset absolute time can be based on the local clock of the server. In one embodiment, receiving a clock synchronization message sent by a server includes: receiving a clock synchronization message sent by a server in response to a device power-on operation; and periodically receiving a clock synchronization message sent by a server during system operation. Since all registers in the data processing module are reset to zero each time the data processing module is powered off, the data transmission device needs to be timed by the clock synchronization module in the data processing module each time the power is turned on, so that the system master clock can be calibrated to a preset absolute time. Since the local clock frequency of the data processing module may have a certain error during operation, after the initial time synchronization at power-on, the server also needs to periodically synchronize the time with the data transmission device through the clock synchronization module to ensure the accuracy of its local clock.
[0043] In one embodiment, Figure 2 FIG. 1 is a flow chart of another data transmission method provided by an embodiment of the present invention. This embodiment further illustrates the data processing process of the original link layer data based on the above embodiment. Figure 2 As shown, the method includes:
[0044] S210: Receive original physical layer data collected by a physical layer transceiver through a data receiving port.
[0045] S220: Perform data conversion on the original physical layer data to obtain original link layer data of the target transmission rate.
[0046] S230 . Forward the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port.
[0047] S240: Split and remove the original link layer data to obtain intermediate link layer data.
[0048] In an embodiment, the process of splitting the original link layer data may be a process of unpacking the original link layer data; the process of removing the original data layer data may include a process of removing the preamble and CRC check bits in the original link layer. In an embodiment, a CRC check may be performed on each frame of the original link layer data, and the preamble and CRC check in each frame of the original link layer data may be removed; then the bit width of the original link layer data may be adjusted to obtain intermediate link layer data that meets the target bit width. For example, assuming that the bit width of the intermediate link layer data is 16 bits, and the bit width of the original link layer data is 8 bits, the bit width of the original link layer data may be adjusted to obtain intermediate link layer data with a bit width of 16 bits. Generally speaking, when the data transmission rate of the port is constant, the larger the bit width, the lower the corresponding operating frequency can be. In order to reduce the operating frequency of the data processing module, the target link layer data may also be adjusted to link layer data with a bit width of 32 bits, thereby reducing the power consumption and processing complexity of the data processing module.
[0049] S250: Perform a data adding operation on the intermediate link layer data to obtain candidate link layer data.
[0050] In one embodiment, a data adding operation is performed on the intermediate link layer data to obtain candidate link layer data, including: obtaining an ingress timestamp, an egress timestamp, delay information, port status information and device identification information of a data transmission device associated with the intermediate link layer data; adding the ingress timestamp, the egress timestamp, the delay information, the port status information and the device identification information of the data transmission device to the intermediate link layer data to obtain the candidate link layer data. Among them, the ingress timestamp refers to the timestamp when the data processing module receives the original physical layer data; the egress timestamp refers to the timestamp when the data processing module outputs the original physical layer data; the delay information refers to the time required for the data processing module to process and transmit the original physical layer data, and the difference between the egress timestamp and the ingress timestamp can be used as the delay information; the port status information is used to characterize the relevant status information of each port in the data processing module, for example, the port status information can include but is not limited to the following parameters: the status of each data receiving end, data sending port and data uploading port in the data processing module, and the working rate, duplex mode and connection status of the physical layer transceiver associated with each port; the device identification information of the data transmission device is used to characterize the information uniquely identifying each data transmission device, for example, the device identification information of the data transmission device can be the ID of the data transmission device. After adding the ingress timestamp, the egress timestamp, the delay information, the port status information and the device identification information of the data transmission device to the intermediate link layer data, the candidate link layer data can be obtained.
[0051] It should be noted that a data transmission device may include N data transmission ports and N data receiving ports, as well as N data upload ports, and the data transmission ports correspond one to one with the data receiving ports. Of course, a data transmission device may include N data transmission ports and N data receiving ports, as well as one data upload port, that is, data is uploaded through the data upload port. Wherein, N is an integer greater than or equal to 1.
[0052] S260: Encapsulate the candidate link layer data to obtain target link layer data.
[0053] The encapsulation process of the candidate link layer data may include adding a preamble and a CRC check bit to the candidate link layer data. In an embodiment, the encapsulation process of the candidate link layer data may be the reverse process of the unpacking process of the original link layer data, which will not be described in detail.
[0054] S270, uploading the target link layer data to the server.
[0055] After obtaining the target link layer data, the data processing module uploads the target link layer data to the server, so that the server performs information security and situation awareness functions of the industrial control network based on the target link layer data.
[0056] In one embodiment, uploading the target link layer data to the server includes: sending the target link layer data to another physical layer transceiver through a data upload port; uploading the target link layer data to the server through the physical layer transceiver. Among them, another physical layer transceiver refers to a physical layer transceiver used for data upload, for example, another physical layer transceiver can be a PHY chip. The data upload port is configured in the data processing module, and the data processing module can send the target link layer data to the physical layer transceiver used for data upload through the data upload port, and upload the target link layer data to the server through the physical layer transceiver used for data upload. It should be noted that the data transmission rate of the data upload port can be the same as the data transmission rate of the data transmission port and the data receiving port, or it can be different. Exemplarily, the data transmission rate of the data upload port only supports 1000Mbps, while the data transmission rate of the data transmission port and the data receiving port can support 100Mbps or 1000Mbps, then the two physical layer transceivers used for data acquisition can self-negotiate the data transmission rate they adopt.
[0057] In one embodiment, Figure 3 FIG. 1 is a schematic diagram of a data transmission system provided by an embodiment of the present invention. Figure 3 As shown, the data transmission system includes: a data transmission device 30 and a server 40; wherein the data transmission device 30 includes at least three physical layer transceivers 301 and a data processing module 302;
[0058] Among them, one physical layer transceiver 301 is connected to the data processing module 302 through a data receiving port, another physical layer transceiver 301 is connected to the data processing module 302 through a data sending port, and the input end of another physical layer transceiver 301 is connected to the data processing module 302 through a data uploading port, and the output end is connected to the server 40;
[0059] The data processing module 302 receives the original physical layer data collected by a physical layer transceiver 301 through the data receiving port, and performs data conversion on the original physical layer data to obtain the original link layer data of the target transmission rate; the data processing module 302 forwards the original link layer data to another physical layer transceiver 301 according to the data transmission rate of the data sending port;
[0060] The data processing module 302 processes the original link layer data to obtain target link layer data, and sends the target link layer data to another physical layer transceiver 301 through the data upload port, and uploads the target link layer data to the server 40 through another physical layer transceiver 301.
[0061] In one embodiment, Figure 4 This is a schematic diagram of the structure of another data transmission system provided by an embodiment of the present invention. Figure 3 Based on this, the structure of the data processing module is further explained. Figure 4 As shown, the data processing module 302 includes: a data synchronization module 3021, a first rate conversion module 3022, a second rate conversion module 3023, an Ethernet MAC receiving module 3024, an Ethernet MAC sending module 3025 and a message processing module 3026;
[0062] Among them, the input end of the data synchronization module 3021 is connected to the data receiving port, and the output end is connected to one end of the first rate conversion module 3022; the other end of the first rate conversion module 3022 is respectively connected to one end of the second rate conversion module 3023 and one end of the Ethernet MAC receiving module 3024; the other end of the second rate conversion module 3023 is connected to the data sending port; the Ethernet MAC receiving module 3024 is connected to one end of the message processing module 3026, and the other end of the message processing module 3026 is connected to the Ethernet MAC sending module 3025; the Ethernet MAC sending module 3025 is connected to another physical layer transceiver 301 through the data upload port;
[0063] The data synchronization module 3021 is used to synchronize the original physical layer data according to its own system master clock;
[0064] The first rate conversion module 3022 is used to perform data conversion on the original physical layer data to obtain the original link layer data of the target transmission rate;
[0065] The second rate conversion module 3023 is used to forward the original link layer data to another physical layer transceiver 301 according to the data transmission rate of the data transmission port;
[0066] The Ethernet MAC receiving module 3024 is used to split and remove the original link layer data, obtain the intermediate link layer data, and send it to the message processing module;
[0067] The message processing module 3026 is used to perform a data addition operation on the intermediate link layer data to obtain candidate link layer data;
[0068] The Ethernet MAC sending module 3025 is used to encapsulate the candidate link layer data to obtain the target link layer data, and transmit the target link layer data to another physical layer transceiver 301 through the data upload port.
[0069] In one embodiment, the data processing module further includes: a clock synchronization module; wherein the clock synchronization module is connected to the server via another physical layer transceiver;
[0070] The clock synchronization module is used to receive the clock synchronization message sent by the server through another physical layer transceiver, and synchronize its own system master clock according to the clock synchronization message, so that the system master clock is calibrated to the preset absolute time.
[0071] In one embodiment, a physical layer transceiver establishes a connection with a field device to collect relevant data of the field device as original physical layer data; another physical layer transceiver is connected to a host computer through a switch to perform status monitoring on the field device.
[0072] It should be noted that the explanation of parameters such as the physical layer transceiver, data processing module, original physical layer data, original link layer data, target link layer data in the data transmission system can be found in the description of the corresponding parameters in the above-mentioned data transmission method, and will not be repeated here.
[0073] The data transmission system provided in the embodiment of the present invention can execute the data transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0074] In one embodiment, Figure 5 1 is a schematic diagram of the structure of a data transmission device provided by an embodiment of the present invention. In this embodiment, the structure of the data transmission device is described by taking the physical layer transceiver as a PHY chip and the data processing module as an FPGA as an example. Among them, the physical layer transceivers used for data acquisition may be PHY1 and PHY2, and the physical layer transceiver used for data upload may be PHY3.
[0075] like Figure 5 As shown, the data transmission device in this embodiment includes: FPGA, PHY1, PHY2, PHY3 and server. Among them, PHY1 and PHY2 are used to connect to the data sending port or the data receiving port, and the ports connected to PHY1 and PHY2 are different (that is, when PHY1 is connected to the data sending port, PHY2 is connected to the data receiving port; when PHY2 is connected to the data receiving port, PHY1 is connected to the data sending port), and PHY3 is used to connect the data upload port and the server. FPGA is used to control PHY1 and PHY2 to collect data in the industrial control network, and upload the processed data to PHY3. The FPGA chip is the core of the data transmission device, which is used for transparent transmission of data between PHY1 and PHY2, and adding timestamps and other information to the data collected by PHY1 and PHY2 and sending them to PHY3; the server monitors and controls the messages in the industrial control network, and sends commands such as message filtering to control the FPGA chip to implement message filtering.
[0076] In one embodiment, Figure 6 1 is a schematic diagram of the structure of a data processing module provided by an embodiment of the present invention. In this embodiment, the data processing module is FPGA, the first rate conversion module is phy_to_mac module, the second rate conversion module is mac_to_ddio module, the Ethernet MAC receiving module is ether_mac_recv module, and the Ethernet MAC sending module is ether_mac_send module as an example to illustrate the structure of the data processing module.
[0077] The data transmission device can realize the message forwarding and transparent transmission functions between different data transmission ports and data receiving ports, as well as the data upload function and time synchronization function of the data upload port. FPGA, as the core of the data transmission device, can include synchronization module, phy_to_mac module, mac_to_ddio module, clock synchronization module, ether_mac module and message data processing module, such as Figure 6 shown.
[0078] Among them, the functions of each module in FPGA are as follows:
[0079] The data synchronization module is used to synchronize all received original physical layer data to the same master clock, eliminating the phase difference that may be generated after the collected original physical layer data passes through the phy chip;
[0080] The phy_to_mac module is used to convert all the original physical layer data from the data synchronization module into 8-bit data with a frequency of 125M as the original link layer data;
[0081] The mac_to_ddio module is used to convert 8-bit data of 125M frequency into 4-bit data of 25M or 250M frequency according to the data transmission rate of the data transmission port;
[0082] Clock synchronization module: The FPGA itself has a system clock with a frequency of 125MHz, but all registers of the FPGA will be set to 0 every time the power is turned off. Therefore, every time the power is turned on, the server needs to synchronize the data transmission equipment through this module to calibrate the local clock to the preset absolute time. Since there may be a certain error in the local clock frequency, after the initial synchronization, the couple also needs to periodically synchronize the time with the data transmission equipment through the clock synchronization module.
[0083] ether_mac module: This module is divided into two parts: ether_mac_send and ether_mac_recv. The ether_mac_recv module is used to "unpack" the received original link layer data, remove the leading code, perform CRC check on each frame message, remove the CRC check bit, and combine the 8-bit data into 16 bits for subsequent processing to obtain the intermediate link layer data.
[0084] The message data processing module is used to process the intermediate link layer data after "unpacking", add the entry timestamp, exit timestamp, delay information, port status information and device identification information, and obtain the candidate link layer data.
[0085] The ether_mac_send module is used to encapsulate the candidate link layer data pairs. The encapsulation process is the reverse process of the unpacking process and will not be described in detail. After the encapsulation is completed, it is sent to the PHY3 chip.
[0086] In one embodiment, Figure 7 This embodiment is based on the above embodiment, taking the example that the physical layer transceiver for data collection can be port A and port B, and the physical layer transceiver for data upload can be port C.
[0087] like Figure 7 As shown, when the data transmission device is connected in series in the industrial control network, the data acquisition port A is used to connect the control network layer / production monitoring layer (for example, operator station, engineer station, workstation and OPC server), and the data acquisition port B is used to connect the field control layer (ie PLC1, PLC2...PLC4). The data transmission rate of ports A and B is 100Mbps / 1000Mbps auto-negotiation. Port C for data upload is used to connect to the server through the data acquisition aggregation switch group, and the transmission rate of port C only supports 1000Mbps. The data aggregation cluster includes N aggregators (aggregator 1, aggregator 2...aggregator N), which are used to aggregate the data collected by multiple data transmission devices and upload them to the server.
[0088] In one example, the data transmission rates of the data acquisition ports A and B are inconsistent. When the data transmission device implements the data forwarding and transparent transmission function, it is necessary to first synchronize the signal with the system master clock, convert the data transmission rate of the data receiving port to Gigabit, and finally convert it to the data transmission rate of the data sending port. The specific steps of the forwarding and transparent transmission function implementation process include:
[0089] Step 1: Ports A and B receive messages from the phy chip to the FPGA core, and all signals are synchronized with the system master clock through the synchronization module;
[0090] Step 2: determine whether the data transmission rate of the receiving port is 100M or 1G, and then convert it to 1G through the phy_to_mac module as the original link layer data;
[0091] Step 3: According to the data transmission rate of the data transmission port, determine whether it is 1000M forwarding or 100M forwarding, and convert it into the corresponding transmission rate through the mac_to_ddio module.
[0092] In one example, the data transmission rates of the data acquisition ports A and B and the data upload port C are inconsistent. When implementing the data upload function, the transmission rate of the received data is first converted to Gigabit, and then the message is processed, and the timestamp and other information are added to the end of the message. Finally, the data is sent to the upload port for uploading. The specific implementation process steps include:
[0093] Step 1: Ports A and B receive messages from the phy chip to the FPGA core, and all signals are synchronized with the system master clock through the synchronization module;
[0094] Step 2, determine whether the data transmission rate of the receiving port is 100M or 1G, convert the received data to 1G through the phy_to_mac module, and obtain the original link layer data;
[0095] Step 3, the ether_mac_recv module removes the leading code of the message, performs CRC check, and processes the data content of the message to obtain the intermediate link layer data;
[0096] Step 4, adding timestamp information, delay information, device identification information and port status information to the end of the message through the data processing module to obtain candidate link layer data;
[0097] Step 5: The ether_mac_send module adds the preamble and CRC check bits to the candidate link layer data to obtain the target link layer data, and then splits the target link layer data into single bytes and sends them to the server from port C at a frequency of 125M.
[0098] The technical solution of this embodiment realizes data transmission, processing and uploading at different network port rates, prevents network congestion during data transmission, and ensures the stability and real-time performance of the control system.
[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data transmission method, characterized in that: The method comprises: receiving raw physical layer data collected by a physical layer transceiver through a data receiving port; Performing data conversion on the original physical layer data to obtain original link layer data of a target transmission rate; forwarding the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port; The original link layer data collected by the physical layer transceiver is processed to obtain target link layer data, and the target link layer data is uploaded to the server.
2. The method according to claim 1, characterized in that: The method of forwarding the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port includes: In the case where the data transmission rates of the data receiving port and the data transmitting port are inconsistent, performing rate conversion on the original link layer data according to the data transmission rate of the data transmitting port to obtain new link layer data; The new link layer data is forwarded to another physical layer transceiver.
3. The method according to claim 1, characterized in that The method of forwarding the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port includes: When the data transmission rates of the data receiving port and the data sending port are consistent, the original link layer data is directly transparently transmitted to another physical layer transceiver.
4. The method according to claim 1, characterized in that: The processing of the original link layer data collected by the physical layer transceiver to obtain target link layer data, and uploading the target link layer data to the server includes: Performing splitting and removal operations on the original link layer data to obtain intermediate link layer data; Performing a data adding operation on the intermediate link layer data to obtain candidate link layer data; Performing an encapsulation operation on the candidate link layer data to obtain target link layer data; The target link layer data is uploaded to the server.
5. The method according to claim 4, characterized in that The performing a data adding operation on the intermediate link layer data to obtain candidate link layer data includes: Obtaining an ingress timestamp, an egress timestamp, delay information, port status information, and device identification information of a data transmission device associated with the intermediate link layer data; The ingress timestamp, egress timestamp, delay information, port status information and device identification information of the data transmission device are added to the intermediate link layer data to obtain candidate link layer data.
6. The method according to claim 4, characterized in that The uploading of the target link layer data to the server includes: Sending the target link layer data to another physical layer transceiver via a data upload port; The target link layer data is uploaded to the server via the physical layer transceiver.
7. The method according to any one of claims 1 to 6, characterized in that: Before performing data conversion on the original physical layer data to obtain the original link layer data of the target transmission rate, the method further includes: The original physical layer data is clock synchronized according to its own system master clock.
8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Receiving a clock synchronization message sent by the server; The system master clock is timed according to the clock synchronization message so that the system master clock is calibrated to a preset absolute time.
9. The method according to claim 8, characterized in that The receiving a clock synchronization message sent by the server includes: In response to a power-on operation of the device, receiving a clock synchronization message sent by the server; During the operation of the system, the clock synchronization message sent by the server is periodically received.
10. A data transmission system, characterized in that: include: Data transmission equipment and server; wherein the data transmission equipment comprises at least three physical layer transceivers and a data processing module; Wherein, one of the physical layer transceivers is connected to the data processing module via a data receiving port, another of the physical layer transceivers is connected to the data processing module via a data sending port, an input end of yet another of the physical layer transceivers is connected to the data processing module via a data uploading port, and an output end is connected to the server; The data processing module receives the original physical layer data collected by a physical layer transceiver through the data receiving port, and performs data conversion on the original physical layer data to obtain the original link layer data of the target transmission rate; the data processing module forwards the original link layer data to another physical layer transceiver according to the data transmission rate of the data sending port; The data processing module processes the original link layer data to obtain target link layer data, and sends the target link layer data to another physical layer transceiver through the data upload port, and uploads the target link layer data to the server through the another physical layer transceiver.
11. The system according to claim 10, characterized in that The data processing module includes: a data synchronization module, a first rate conversion module, a second rate conversion module, an Ethernet MAC receiving module, an Ethernet MAC sending module and a message processing module; Wherein, the input end of the data synchronization module is connected to the data receiving port, and the output end is connected to one end of the first rate conversion module; the other end of the first rate conversion module is respectively connected to one end of the second rate conversion module and one end of the Ethernet MAC receiving module; the other end of the second rate conversion module is connected to the data sending port; the Ethernet MAC receiving module is connected to one end of the message processing module, and the other end of the message processing module is connected to the Ethernet MAC sending module; the Ethernet MAC sending module is connected to the further physical layer transceiver through the data upload port; Wherein, the data synchronization module is used to perform clock synchronization on the original physical layer data according to its own system master clock; The first rate conversion module is used to perform data conversion on the original physical layer data to obtain original link layer data of the target transmission rate; The second rate conversion module is used to forward the original link layer data to another physical layer transceiver according to the data transmission rate of the data transmission port; The Ethernet MAC receiving module is used to split and remove the original link layer data to obtain intermediate link layer data, and send it to the message processing module; The message processing module is used to perform a data addition operation on the intermediate link layer data to obtain candidate link layer data; The Ethernet MAC sending module is used to encapsulate the candidate link layer data to obtain target link layer data, and transmit the target link layer data to the further physical layer transceiver through the data upload port.
12. The system according to claim 10, characterized in that The data processing module also includes: a clock synchronization module; Wherein, the clock synchronization module is connected to the server via another physical layer transceiver; The clock synchronization module is used to receive the clock synchronization message sent by the server through the other physical layer transceiver, and to synchronize its own system master clock according to the clock synchronization message, so that the system master clock is calibrated to a preset absolute time.
13. The system according to any one of claims 10 to 12, characterized in that: The one physical layer transceiver establishes a connection with the field device to collect relevant data of the field device as original physical layer data; the other physical layer transceiver is connected to the host computer through a switch to perform status monitoring on the field device.