Data transmission method and device, industrial equipment, controller, system and storage medium

By receiving and generating check values ​​of Ethernet frames in industrial networks and determining the error type of frames, the problem of insufficient flexibility in error diagnosis in the prior art is solved, and more efficient error recognition and diagnosis is achieved.

CN119583012APending Publication Date: 2025-03-07SHENZHEN INOVANCE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411681173.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The error diagnosis flexibility of Ethernet frames in existing industrial networks is poor and cannot meet the error diagnosis needs of industrial networks.

Method used

By receiving Ethernet frames in the industrial network, a check value is generated, and when the frame is checked, the error type is determined based on the first check value and the second check value, including a forwarding error or a reception error.

Benefits of technology

It realizes flexible error diagnosis of Ethernet frames in industrial networks, and can identify error types, thereby improving error diagnosis capabilities during data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583012A_ABST
    Figure CN119583012A_ABST
Patent Text Reader

Abstract

The invention relates to a data transmission method and device, industrial equipment, a controller, a system and a storage medium. The method comprises the following steps: target industrial equipment receives a first Ethernet frame sent by first industrial equipment in an industrial network, wherein the first Ethernet frame carries a first check value; generating a second verification value according to the first Ethernet frame; under the condition that the first Ethernet frame is verified to be wrong, the error type of the first Ethernet frame is determined according to the first verification value and the second verification value, and the error type comprises a forwarding error or a receiving error. By adopting the method, the error diagnosis requirement of the industrial network can be met, and the error diagnosis flexibility in the data transmission process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial network technology, and in particular to a data transmission method, device, industrial equipment, controller, system and storage medium. Background Art

[0002] In the field of industrial networks, the transmission correctness of Ethernet frames plays an important role in the stability and reliability of industrial networks.

[0003] In the data transmission process of industrial networks based on standard Ethernet, the 4-byte frame check sequence (FCS) at the end of the Ethernet frame is calculated based on the cyclic redundancy check (CRC). The sender transmits the Ethernet frame carrying the CRC value to the receiver. After receiving the Ethernet frame, the receiver recalculates the CRC value. By comparing the recalculated CRC value with the CRC value carried by the Ethernet frame, it can be identified whether an error occurs in the process of sending the Ethernet frame from the sender to the receiver.

[0004] However, the above methods can no longer meet the error diagnosis needs of industrial networks, and the flexibility of error diagnosis during data transmission is poor. Summary of the invention

[0005] Based on this, it is necessary to provide a data transmission method, device, industrial equipment, controller, system and storage medium that can meet the error diagnosis needs of industrial networks and improve the flexibility of error diagnosis during data transmission to address the above technical problems.

[0006] In a first aspect, the present application provides a data transmission method for a target industrial device in an industrial network, the method comprising:

[0007] Receiving a first Ethernet frame sent by a first industrial device in the industrial network, where the first Ethernet frame carries a first check value;

[0008] generating a second check value according to the first Ethernet frame;

[0009] In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

[0010] In one embodiment, determining the error type of the first Ethernet frame according to the first check value and the second check value includes:

[0011] Inverting the preset bit in the second check value to obtain an inverted check value;

[0012] Detect whether the inverted check value is the same as the first check value to obtain a first detection result, and determine the error type according to the first detection result.

[0013] In one embodiment, determining the error type according to the first detection result includes:

[0014] If the first detection result is that the inverted check value is the same as the first check value, determining that the error type is a forwarding error;

[0015] If the first detection result is that the inverted check value is different from the first check value, it is determined that the error type is a reception error.

[0016] In one embodiment, determining the error type of the first Ethernet frame according to the first check value and the second check value includes:

[0017] Detect whether there is a negative relationship between the second verification value and the first verification value, and obtain a second detection result;

[0018] The error type is determined according to the second detection result.

[0019] In one embodiment, determining the error type according to the second detection result includes:

[0020] If the second detection result is that there is a negation relationship between the second check value and the first check value, determining that the error type is a forwarding error;

[0021] If the second detection result is that there is no inverse relationship between the second check value and the first check value, it is determined that the error type is a reception error.

[0022] In one embodiment, the method further comprises:

[0023] Replacing the first check value in the first Ethernet frame with a negated check value to obtain a second Ethernet frame, wherein the negated check value is obtained by negating a preset bit in the second check value;

[0024] When the error type is a receiving error, the second Ethernet frame is sent to a second industrial device in the industrial network.

[0025] In one embodiment, the method further comprises:

[0026] When the error type is a forwarding error, the second Ethernet frame is sent to a second industrial device in the industrial network, or the first Ethernet frame is sent to the second industrial device in the industrial network.

[0027] In one of the embodiments, the first Ethernet frame carries a plurality of the first check values.

[0028] In one embodiment, the method further comprises:

[0029] The error type is stored, and the error type is used to determine the Ethernet frame transmission state according to the error type stored in each industrial device in the industrial network.

[0030] In one embodiment, the first check value is a first CRC value, and the second check value is a second CRC value.

[0031] In one of the embodiments, the communication mode of the industrial network is a loopback mode or a unidirectional mode.

[0032] In a second aspect, the present application provides a data transmission method for a controller in an industrial network, the method comprising:

[0033] Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame;

[0034] According to each of the error types, an Ethernet frame transmission state is determined.

[0035] In a third aspect, the present application provides a data transmission device for a target industrial device in an industrial network, the device comprising:

[0036] A receiving module, configured to receive a first Ethernet frame sent by a first industrial device in the industrial network, wherein the first Ethernet frame carries a first check value;

[0037] A generating module, configured to generate a second check value according to the first Ethernet frame;

[0038] The determination module is used to determine the error type of the first Ethernet frame according to the first check value and the second check value when the first Ethernet frame has a check error, wherein the error type includes a forwarding error or a receiving error.

[0039] In a fourth aspect, the present application provides a data transmission device for a controller in an industrial network, the device comprising:

[0040] an acquisition module, configured to acquire an error type stored in each industrial device in the industrial network, wherein the error type is determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame;

[0041] The determination module is used to determine the Ethernet frame transmission status according to each of the error types.

[0042] In a fifth aspect, the present application provides an industrial device, including a memory, a transceiver, and a processor:

[0043] A memory for storing a computer program; a transceiver for transmitting and receiving data under the control of a processor; and a processor for reading the computer program in the memory and performing the following operations:

[0044] Controlling the transceiver to receive a first Ethernet frame sent by a first industrial device in the industrial network, wherein the first Ethernet frame carries a first check value;

[0045] generating a second check value according to the first Ethernet frame;

[0046] In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

[0047] In a sixth aspect, the present application provides a controller, including a memory, a transceiver, and a processor:

[0048] A memory for storing a computer program; a transceiver for transmitting and receiving data under the control of a processor; and a processor for reading the computer program in the memory and performing the following operations:

[0049] Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame;

[0050] According to each of the error types, an Ethernet frame transmission state is determined.

[0051] In a seventh aspect, the present application provides a data transmission system, including a controller and a plurality of industrial devices;

[0052] The industrial equipment is used to perform the steps of the method described in the first aspect above;

[0053] The controller is used to execute the steps of the method described in the second aspect above.

[0054] In an eighth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect or the second aspect above are implemented.

[0055] In a ninth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect or the second aspect above.

[0056] In the above-mentioned data transmission method, device, industrial equipment, controller, system and storage medium, a target industrial equipment in an industrial network receives a first Ethernet frame sent by a first industrial equipment in the industrial network, the first Ethernet frame carries a first check value, and the target industrial equipment generates a second check value based on the first Ethernet frame. Then, in the case of a check error in the first Ethernet frame, the target industrial equipment determines the error type of the first Ethernet frame based on the first check value and the second check value, and the error type includes a forwarding error or a receiving error. The receiving error may refer to an error in the first Ethernet frame during the process of the first industrial equipment sending the first Ethernet frame to the target industrial equipment. The forwarding error may refer to no error in the first Ethernet frame during the process of the first industrial equipment sending the first Ethernet frame to the target industrial equipment, but an error in the Ethernet frame during the data transmission process before the first industrial equipment. In this way, the target industrial equipment can not only identify whether the first Ethernet frame has a check error, but also identify the error type of the first Ethernet frame when the first Ethernet frame has a check error, thereby meeting the error diagnosis requirements of the industrial network and improving the flexibility of error diagnosis during data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 A schematic diagram of a network topology of an industrial network;

[0059] Figure 2 A schematic diagram of a data transmission method in one embodiment;

[0060] Figure 3 A schematic diagram of a flow chart of determining an error type of a first Ethernet frame in another embodiment;

[0061] Figure 4 A schematic diagram of a flow chart of determining an error type of a first Ethernet frame in another embodiment;

[0062] Figure 5 A schematic diagram of a flow chart of data transmission by a target industrial device in another embodiment;

[0063] Figure 6 A schematic diagram of a flow chart of a data transmission method in another embodiment;

[0064] Figure 7 A schematic diagram of a flow chart of a data transmission method in another embodiment;

[0065] Figure 8 A schematic diagram of network topology of another industrial network;

[0066] Fig. 9 is a schematic diagram of a frame structure of a data frame in another embodiment;

[0067] Fig.10 is a schematic diagram of a frame structure of a data frame in another embodiment;

[0068] Fig.11 is a schematic diagram of a frame structure of a data frame in another embodiment;

[0069] Fig.12 is a structural block diagram of a data transmission device in one embodiment;

[0070] Fig.13 is a structural block diagram of a data transmission device in another embodiment;

[0071] Fig.14 An internal structure diagram of an industrial device in one embodiment;

[0072] Fig.15 FIG. 4 is a diagram showing the internal structure of a controller in one embodiment. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0074] Industrial networks are now widely used in many fields, such as industrial automation, power electronics, Internet of Things, and aerospace. In traditional industrial networks, Ethernet frames are transmitted between industrial devices and controllers based on wired networks. The correctness of Ethernet frame transmission plays an important role in the stability and reliability of industrial networks.

[0075] In the data transmission process of industrial networks based on standard Ethernet, the 4-byte frame check sequence (FCS) at the end of the Ethernet frame is calculated based on the cyclic redundancy check (CRC). The sender transmits the Ethernet frame carrying the CRC value (or CRC value, CRC check value, etc.) to the receiver. After receiving the Ethernet frame, the receiver recalculates the CRC value. By comparing the recalculated CRC value with the CRC value carried by the Ethernet frame, it can be identified whether an error occurs in the process of sending the Ethernet frame from the sender to the receiver.

[0076] However, the above methods can no longer meet the error diagnosis needs of industrial networks, and the flexibility of error diagnosis during data transmission is poor.

[0077] In view of this, the embodiments of the present application provide a data transmission method, device, industrial equipment, controller, system and storage medium, which can meet the error diagnosis requirements of industrial networks and improve the flexibility of error diagnosis during data transmission.

[0078] The data transmission method provided in the embodiment of the present application can be applied to a wired industrial network. Figure 1 In the implementation environment shown, Figure 1 In the industrial network shown, the controller, industrial devices 1 to n (n is a positive integer greater than 1) form a linear wired industrial network topology.

[0079] Below, in conjunction with the drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0080] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0081] In an exemplary embodiment, Figure 2 As shown, a data transmission method is provided, which is applied to Figure 1Taking any industrial device in the industrial network shown in the figure (hereinafter referred to as the target industrial device) as an example, the following steps 201 and 202 are included:

[0082] Step 201: receiving a first Ethernet frame sent by a first industrial device in an industrial network, where the first Ethernet frame carries a first check value.

[0083] In an embodiment of the present application, the target industrial device may be any industrial device in the industrial network. When the target industrial device is directly connected to a controller in the industrial network, the first industrial device may be the controller. When the target industrial device is not directly connected to the controller, the first industrial device may be an upper-level industrial device that is directly connected to the target industrial device.

[0084] During data transmission in the industrial network, the target industrial device receives a first Ethernet frame sent by a first industrial device, and the first Ethernet frame may carry a first check value.

[0085] Taking the first Ethernet frame carrying a first check value as an example, the first check value can be carried in the frame check sequence FCS at the end of the first Ethernet frame, and the implementation method of the first Ethernet frame carrying multiple first check values ​​will be described in the following examples. Below, taking the first Ethernet frame carrying a first check value as an example, the implementation method of the data transmission method of the embodiment of the present application is exemplarily described.

[0086] In the embodiment of the present application, the first check value may be a first CRC value, that is, the first check value is calculated based on a CRC check algorithm. Of course, the first check value may also be calculated based on other check algorithms.

[0087] In an embodiment of the present application, the communication mode of the industrial network is a loopback mode or a one-way mode. When the communication mode of the industrial network is the loopback mode, the first Ethernet frame is a loopback frame. The loopback mode means that when the loopback frame sent by the controller reaches the destination industrial device, the destination industrial device modifies the destination address in the loopback frame to the controller address, and then loops back and transmits it to the controller; when the communication mode of the industrial network is the one-way mode, the first Ethernet frame is a one-way frame. The one-way mode means that the controller sends a one-way frame to the destination industrial device, and the destination industrial device performs frame elimination and no longer continues to transmit forward.

[0088] Step 202: Generate a second check value according to the first Ethernet frame.

[0089] After the target industrial device receives the first Ethernet frame sent by the first industrial device, the target industrial device generates a second check value according to the first Ethernet frame.

[0090] Exemplarily, the target industrial device may calculate the second check value using the same check algorithm as the first check value. For example, when the first check value is a first CRC value, the target industrial device uses the same CRC check algorithm as the first CRC value to generate the second check value according to the first Ethernet frame, so that the second check value is a second CRC value, and the CRC encoding type of the first CRC value and the second CRC value is the same.

[0091] After the target industrial device generates the second check value according to the first Ethernet frame, the target industrial device compares the second check value with the first check value. If the second check value is the same as the first check value, it indicates that the first Ethernet frame is checked correctly, that is, the first Ethernet frame is a correct frame, not an error frame, and the target industrial device continues to transmit the first Ethernet frame to the lower-level device (for example, the second industrial device). Alternatively, the target industrial device can also process the first Ethernet frame as needed and then continue to transmit it to the second industrial device.

[0092] Step 203: When there is a check error in the first Ethernet frame, determine the error type of the first Ethernet frame according to the first check value and the second check value.

[0093] If the second check value is different from the first check value, it indicates that the first Ethernet frame has a check error, that is, the first Ethernet frame is an error frame, and the target industrial device determines the error type of the first Ethernet frame according to the first check value and the second check value, wherein the error type includes a forwarding error or a receiving error.

[0094] In one possible implementation, the target industrial device can input the second check value and the first check value into a pre-trained neural network model. The neural network model predicts the error type of the first Ethernet frame based on the network parameters learned in the training phase and based on the second check value and the first check value and outputs the error type. In this way, the target industrial device obtains the error type of the first Ethernet frame.

[0095] Other possible implementations of the target industrial device determining the above error type according to the second check value and the first check value will be described in the following embodiments.

[0096] In the above embodiment, the error type of the first Ethernet frame includes a forwarding error or a receiving error. The receiving error may refer to that an error occurred in the first Ethernet frame during the process of the first industrial device sending the first Ethernet frame to the target industrial device. The forwarding error may refer to that no error occurred in the first Ethernet frame during the process of the first industrial device sending the first Ethernet frame to the target industrial device, but an error occurred in the Ethernet frame during the data transmission process before the first industrial device. In this way, the target industrial device can not only identify whether the first Ethernet frame has a checksum error, but also, in the case of a checksum error in the first Ethernet frame, can also identify the error type of the first Ethernet frame, thereby meeting the error diagnosis needs of the industrial network and improving the flexibility of error diagnosis during data transmission.

[0097] In one embodiment, based on Figure 2 In the illustrated embodiment, two possible implementations of the target industrial device determining the error type of the first Ethernet frame according to the first check value and the second check value are exemplarily described below.

[0098] 1) In one possible implementation, see Figure 3 , the target industrial equipment can perform Figure 3 Steps 301 and 302 shown implement a process of determining the error type of the first Ethernet frame according to the first check value and the second check value:

[0099] Step 301, inverting a preset bit in a second check value to obtain an inverted check value.

[0100] The second check value may include multiple bytes. In the embodiment of the present application, the preset bit may be, for example, the last eight bits in the second check value, that is, the last byte. Optionally, it may also be the last two bytes or three bytes in the second check value, etc., which is not specifically limited here. The following embodiments are all illustrated by taking the last byte as an example.

[0101] The target industrial device inverts the last byte in the second check value to obtain an inverted check value. For example, assuming that the second check value is 32'bxxxxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx, the target industrial device inverts the last byte in the second check value, and the inverted check value after inversion is 32'bxxxxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx_~x~x~x~x~x~x~x~x~x.

[0102] Step 302, detect whether the inverted check value is the same as the first check value, obtain a first test result, and determine the error type according to the first test result.

[0103] The target industrial device detects whether the inverted check value is the same as the first check value carried by the first Ethernet frame. By detecting whether the inverted check value is the same as the first check value, the error type can be determined.

[0104] Exemplarily, the target industrial equipment detects whether the inverted check value is the same as the first check value, and a first detection result can be obtained. Optionally, if the first detection result is that the inverted check value is the same as the first check value, the error type is determined to be a forwarding error; optionally, if the first detection result is that the inverted check value is different from the first check value, the error type is determined to be a receiving error.

[0105] In this way, this embodiment can identify the error type of the first Ethernet frame based on the CRC negation mechanism by comparing whether the inverted check value is consistent with the first check value. The implementation is simple, the calculation amount is small, and the flexibility of error identification is improved.

[0106] 2) In another possible implementation, see Figure 4 , the target industrial equipment can perform Figure 4 Steps 401 and 402 shown in the figure implement the process of determining the error type of the first Ethernet frame according to the first check value and the second check value:

[0107] Step 401, detecting whether there is a negative relationship between the second check value and the first check value, and obtaining a second detection result.

[0108] As described above, the second check value may include multiple bytes, and the target industrial device may detect whether there is a negation relationship between the preset bits in the second check value and the preset bits in the first check value. The preset bits may be, for example, eight bits included in the last byte.

[0109] There is a negation relationship between the last byte in the second check value and the last byte in the first check value, which means that the last byte in the first check value can be obtained by negating the last byte in the second check value.

[0110] Step 402: determine the error type according to the second detection result.

[0111] The target industrial equipment detects whether there is a negation relationship between the second check value and the first check value, and a second detection result can be obtained. Optionally, if the second detection result is that there is a negation relationship between the second check value and the first check value, the error type is determined to be a forwarding error; optionally, if the second detection result is that there is no negation relationship between the second check value and the first check value, the error type is determined to be a receiving error.

[0112] In this way, this embodiment can identify the error type of the first Ethernet frame by detecting whether there is a negation relationship between the second check value and the first check value. The implementation is simple, the calculation amount is small, and the flexibility of error identification is improved.

[0113] In the actual implementation process, through the implementation of any of the above embodiments, the target industrial equipment can determine the error type of the first Ethernet frame based on the first check value and the second check value. In the actual implementation process, the implementation method can be flexibly selected, thereby improving the implementation flexibility of the embodiments of the present application.

[0114] Below, in Figure 3 as well as Figure 4 Based on the illustrated embodiment, data transmission of the target industrial device after the target industrial device determines the error type of the first Ethernet frame is exemplarily introduced.

[0115] See also Figure 5 The data transmission method of this embodiment also includes Figure 5 Step 501, step 502 and step 503 shown:

[0116] Step 501: Replace a first check value in a first Ethernet frame with a negated check value to obtain a second Ethernet frame.

[0117] The inverted check value is obtained by inverting a preset bit in the second check value.

[0118] exist Figure 3 On the basis of the illustrated embodiment, since the target industrial equipment has inverted the preset bit in the second check value in step 301 to obtain the inverted check value, the target industrial equipment can directly use the inverted check value to update the first check value originally carried in the first Ethernet frame to obtain a new Ethernet frame, i.e., the second Ethernet frame.

[0119] exist Figure 4 On the basis of the embodiment shown, before the target industrial device executes step 501, the target industrial device first performs an inversion process on the preset bit in the second check value to obtain an inverted check value. For the manner in which the target industrial device performs an inversion process on the preset bit in the second check value, reference can be made to the implementation of step 301, which will not be described in detail here. Then, the target industrial device replaces the first check value in the first Ethernet frame with the inverted check value to obtain a second Ethernet frame.

[0120] Step 502: When the error type is a receiving error, send a second Ethernet frame to a second industrial device in the industrial network.

[0121] When the error type is a receiving error, it means that an error occurred in the first Ethernet frame when the first industrial device sent the first Ethernet frame to the target industrial device. The target industrial device sends the second Ethernet frame to the second industrial device according to the addressing rule. That is, in the case of a receiving error, the target industrial device needs to invert the second check value, replace the first check value in the first Ethernet frame, and then send the inverted and replaced second Ethernet frame to the second industrial device.

[0122] Step 503: When the error type is a forwarding error, a second Ethernet frame is sent to a second industrial device in the industrial network, or a first Ethernet frame is sent to the second industrial device in the industrial network.

[0123] When the error type is a forwarding error, it means that no error occurred in the first Ethernet frame when the first industrial device sent the first Ethernet frame to the target industrial device, but an error occurred in the Ethernet frame during the data transmission before the first industrial device. The target industrial device can send the second Ethernet frame to the second industrial device in the industrial network according to the addressing rule, or can directly send the first Ethernet frame to the second industrial device in the industrial network. That is, in the case of a forwarding error, the target industrial device can invert the second check value, replace the first check value in the first Ethernet frame, and then send the inverted and replaced second Ethernet frame to the second industrial device. Optionally, the target industrial device can also directly send the first Ethernet frame to the second industrial device.

[0124] In this way, after the second industrial device receives the Ethernet frame (the first Ethernet frame or the second Ethernet frame), it can generate a new check field based on the Ethernet frame in the same way as the target industrial device. In the case of an Ethernet frame check error, the error type of the Ethernet frame can be determined as a forwarding error or a receiving error based on the generated check field and the check field carried by the Ethernet frame. In this way, each industrial device in the industrial network can adopt the same method as the target industrial device. In the case of a received Ethernet frame check error, it can identify the error type as a forwarding error or a receiving error, thereby improving the error diagnosis capability of each industrial device in the industrial network.

[0125] In addition, in the related art, when an error frame is received, that is, when the received Ethernet frame has an error, the Ethernet frame is usually directly discarded, or the error Ethernet frame may be directly passed down. In the embodiment of the present application, the first Ethernet frame can be inverted and replaced without increasing the frame overhead, and then the second Ethernet frame obtained by inverting and replacing can be sent to the second industrial device, thereby increasing the error handling mechanism of the industrial network, making it easier for the second industrial device to identify the error type, thereby meeting the performance and diagnosis requirements of the industrial network, solving the problem of error Ethernet frame transmission and error type identification, and improving the diagnostic capability of the industrial network.

[0126] In the embodiment of the present application, since the target industrial equipment uses the inverted check value to replace the first check value in the first Ethernet frame, the frame overhead will not be increased. The embodiment of the present application supports the inverted transmission of erroneous Ethernet frames and the identification of error types in industrial networks at transmission rates of 100M and 1000M.

[0127] The embodiments of the present application support the transmission of the inverted check value of erroneous Ethernet frames and the identification of error types in loopback mode and unidirectional mode, and support unicast, multicast and broadcast transmission mechanisms.

[0128] Take the second check value and the first check value as CRC values ​​as an example: in loopback mode, the controller sends a hierarchical loopback frame to each industrial device. The industrial device recognizes that the CRC value in the loopback frame is wrong (that is, the loopback frame is an incorrect loopback frame). The industrial device can invert the last byte of the recalculated CRC value, update and replace the CRC value in the incorrect loopback frame, and then transmit it to the destination device according to the addressing rules (of course, in the case where the error type is a forwarding error, the incorrect loopback frame can also be directly transmitted to the destination device). After the Ethernet frame transmitted in loopback reaches the destination device, the destination address is modified to the controller, and it is forwarded in sequence until it reaches the controller.

[0129] In the unidirectional mode, the controller sends a hierarchical unidirectional frame to the industrial device inside the hierarchy. The industrial device recognizes that the CRC value in the unidirectional frame is wrong (that is, the unidirectional frame is an erroneous unidirectional frame). The industrial device can negate the last byte of the recalculated CRC value, update and replace the CRC value in the erroneous unidirectional frame, and then transmit it to the destination device according to the addressing rules (of course, in the case where the error type is a forwarding error, the erroneous unidirectional frame can also be directly transmitted to the destination device), and the unidirectional frame is eliminated at the destination device. The embodiment of the present application can flexibly support data transmission in the industrial network in loopback mode and unidirectional mode.

[0130] The above embodiments are all described by taking the first Ethernet frame carrying a first check value (such as a CRC value) as an example. Optionally, the first Ethernet frame may carry multiple first check values.

[0131] The multiple first check values ​​can be carried in different positions in the first Ethernet frame, for example, carried in the frame tail of the first Ethernet frame, carried in the frame header of the first Ethernet frame, or carried in the data segment part of the first Ethernet frame, etc. The positions of the multiple first check values ​​in the first Ethernet frame are not limited here.

[0132] Regarding the process of the target industrial device generating the second check value according to the first Ethernet frame, in this embodiment, the target industrial device can generate the second check values ​​corresponding to each first check value according to the first Ethernet frame.

[0133] In the case of a first Ethernet frame check error, optionally, the target industrial device can adopt the implementation of the above embodiment for each first check value and the second check value corresponding to the first check value, and determine the error type according to the first check value and the second check value corresponding to the first check value. It can be understood that the error type determined by the target industrial device according to each second check value and the first check value corresponding to the first check value is the same.

[0134] Optionally, the target device may also arbitrarily select a group of second check values ​​and their corresponding first check values ​​to identify the error type.

[0135] When the error type is a receiving error, the target industrial device needs to invert each second check value, replace the corresponding first check value in the first Ethernet frame, and then send the inverted and replaced second Ethernet frame to the second industrial device.

[0136] When the error type is a forwarding error, optionally, the target industrial device can invert each second check value, replace the corresponding first check value in the first Ethernet frame, and then send the inverted and replaced second Ethernet frame to the second industrial device; optionally, the target industrial device can also directly send the first Ethernet frame carrying each first check value directly to the second industrial device.

[0137] The embodiments of the present application are applicable to all Ethernet frames carrying check fields (such as CRC values) in industrial networks, and support the inverted transmission of all check fields in erroneous Ethernet frames, and are applicable to a wide range of scenarios.

[0138] In one embodiment, based on any of the above embodiments, Figure 2 For example, see the embodiment shown in Figure 6 The data transmission method of this embodiment also includes Figure 6 Step 601 shown:

[0139] Step 601, store the error type.

[0140] The error type is used by the controller in the industrial network to determine the Ethernet frame transmission status according to the error type stored in each industrial device in the industrial network.

[0141] The controller obtains the error type stored in each industrial device in the industrial network. As described above, the error type is determined by the industrial device based on the first check value and the second check value carried by the first Ethernet frame when the industrial device receives the first Ethernet frame sent by the first industrial device and the first Ethernet frame has a check error. The second check value is generated based on the first Ethernet frame. The controller determines the Ethernet frame transmission status based on each error type.

[0142] In an embodiment of the present application, after determining the error type, each industrial device in the industrial network can record the error type in a register inside the industrial device. The controller reads the internal register value of each industrial device, obtains the error type of the Ethernet frame received by each industrial device, and then obtains the Ethernet frame transmission status, thereby improving the error diagnosis capability of the industrial network.

[0143] In one embodiment, Figure 7 As shown, a data transmission method is provided, which is applied to Figure 1 The controller shown in FIG. 1 is used as an example to illustrate the method, which includes the following steps 701 and 702:

[0144] Step 701, obtaining the error type stored in each industrial device in the industrial network.

[0145] The error type is determined according to a first check value and a second check value when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, and the second check value is generated according to the first Ethernet frame.

[0146] Step 702: Determine the Ethernet frame transmission status according to each error type.

[0147] Regarding the implementation and beneficial effects of the data transmission method for the controller, reference may be made to the relevant description in the above embodiment of the data transmission method for the target industrial device, which will not be repeated here.

[0148] In an exemplary embodiment, a data transmission method is provided, wherein the method is applied to Figure 2 The industrial network in the example is used to illustrate, including the following steps:

[0149] In step A1, a target industrial device receives a first Ethernet frame sent by a first industrial device in an industrial network, the first Ethernet frame carries a first check value, and the target industrial device generates a second check value according to the first Ethernet frame.

[0150] Step A2: When the first Ethernet frame has a check error, the target industrial device determines the error type of the first Ethernet frame according to the first check value and the second check value, where the error type includes a forwarding error or a receiving error.

[0151] The first Ethernet frame carries one or more first check values. The first check value is a first CRC value, and the second check value is a second CRC value. The communication mode of the industrial network is a loopback mode or a unidirectional mode.

[0152] The target industrial device may implement the process of determining the error type of the first Ethernet frame according to the first check value and the second check value in any of the following ways:

[0153] 1) The target industrial equipment inverts the preset bit in the second check value to obtain an inverted check value. The target industrial equipment detects whether the inverted check value is the same as the first check value to obtain a first detection result. If the first detection result is that the inverted check value is the same as the first check value, the error type is determined to be a forwarding error. If the first detection result is that the inverted check value is different from the first check value, the error type is determined to be a receiving error.

[0154] 2) The target industrial equipment detects whether there is a negation relationship between the second check value and the first check value, and obtains a second detection result. If the second detection result is that there is a negation relationship between the second check value and the first check value, the error type is determined to be a forwarding error. If the second detection result is that there is no negation relationship between the second check value and the first check value, the error type is determined to be a receiving error.

[0155] Step A3: Replace the first check value in the first Ethernet frame with the inverted check value to obtain a second Ethernet frame, wherein the inverted check value is obtained by inverting a preset bit in the second check value.

[0156] Step A4: When the error type is a receiving error, a second Ethernet frame is sent to a second industrial device in the industrial network.

[0157] Step A5: when the error type is a forwarding error, sending a second Ethernet frame to a second industrial device in the industrial network, or sending a first Ethernet frame to the second industrial device in the industrial network.

[0158] Step A6, storing the error type, where the error type is used to determine the Ethernet frame transmission status according to the error type stored in each industrial device in the industrial network.

[0159] Step A7, the controller obtains the error type stored in each industrial device in the industrial network, and determines the Ethernet frame transmission status according to each error type.

[0160] The following is an example to illustrate the data transmission method of the embodiment of the present application.

[0161] For example, see Figure 8 , Figure 8 The industrial network shown includes a controller and industrial devices 1 - 9 , wherein industrial devices 1 - 4 participate in the current data transmission process.

[0162] 1) The controller sends an Ethernet frame to industrial device 1.

[0163] Ethernet frames can be unidirectional frames or loopback frames.

[0164] Optionally, the Ethernet frame includes multiple CRC values. Optionally, the Ethernet frame includes one CRC value.

[0165] During the transmission of the Ethernet frame, an error occurs in the Ethernet frame, and the error frame is transmitted to the industrial device 1.

[0166] 2) Industrial device 1 receives the Ethernet frame sent by the controller, recalculates CRC based on the Ethernet frame, and compares the recalculated CRC with the CRC contained in the Ethernet frame. If an error occurs, industrial device 1 inverts the last byte in the recalculated CRC and compares whether the inverted CRC is consistent with the CRC contained in the Ethernet frame. If they are inconsistent, it is a reception error.

[0167] Industrial device 1 replaces the CRC contained in the Ethernet frame with the inverted CRC, and continues to transmit to industrial device 2 according to the addressing rule.

[0168] The industrial device 1 records the error type in an internal register.

[0169] 3) Similarly, after industrial equipment 2-4 receives the Ethernet frame sent by the preceding industrial equipment, it executes the same steps as industrial equipment 1. If an error occurs in the received Ethernet frame, it can identify the error type as a receiving error or a forwarding error, and use the inverted CRC to replace the CRC contained in the Ethernet frame, and continue to transmit to the succeeding industrial equipment according to the addressing rules.

[0170] 4) The controller reads the internal register value of each industrial device to obtain the error type of the Ethernet frame received by each industrial device, thereby determining the Ethernet frame transmission status, which can improve the system error detection capability.

[0171] The following is an example of the data transmission method of the embodiment of the present application, with reference to an exemplary frame structure of a data frame.

[0172] See also Figure 9-11 , are schematic diagrams of frame structures of exemplary data frames.

[0173] Among them, WiTSNET is Wired-wireless Time Synchronization Net, a wired-wireless time synchronization network. WiTSNET packet based on Ethernet packet (WiTSNET packet based on Ethernet packet, hereinafter referred to as packet) includes a preamble (Preamble), a start frame delimiter (SFD, Start Frame Delimiter), an Ethernet routing field, a data frame (WiTSNETFrame) and a frame tail (FCS).

[0174] In the frame format defined by standard Ethernet, the preamble has 7 bytes. According to ISO / IEC / IEEE 8802-3, the first 2 bytes ( Figure 9-11 Pre1 and Pre2 shown in the figure are used as clock synchronization codes to perform 4B / 5B or 7B / 8B encoding to form a data stream start delimiter. In the embodiment of the present application, the remaining 5 bytes of the preamble (such as Figure 9-11 The WiTSNETPre) shown in FIG. 4 customizes the priority field (Priority), the destination address field (WiTSNETDaddress) and the first reserved field (Reserve).

[0175] The priority field is used to indicate the transmission priority of the data packet. Each data packet can be transmitted according to the transmission priority indicated by the priority field (Priority) in each data packet.

[0176] The first reserved field is used to extend the preamble code later, and the embodiment of the present application does not make any specific restrictions here.

[0177] The destination address field (WiTSNETDaddress) is used to indicate the destination address corresponding to the data packet, and the destination address is associated with the link layer addressing mode corresponding to the data packet.

[0178] In the embodiment of the present application, the custom data frame (WiTSNETFrame) includes a frame header (WiTSNETHeader), multiple subframes (such as Fig.10 and Fig.11 WiTSNETSubframe1 to WiTSNETSubframex), padding field (WiTSNETDataPad), and end field (WiTSNETDataEnd) are shown. Wherein, when the frame length of the data packet is less than the minimum frame length corresponding to the standard Ethernet, the padding field (WiTSNETDataPad) is used to fill the frame length of the data packet to the minimum frame length, and the end field (WiTSNETDataEnd) is used to indicate the end position of the data frame.

[0179] In an embodiment of the present application, the customized frame header (WiTSNETHeader) includes a sub-protocol type field (EtherSubType), a priority field (Priority), a destination address field (WiTSNETDaddress), a transmission feature field (TraMS), a source address field (WiTSNETSAddress), a second reserved field (Reserve) and a first check field (CRC).

[0180] The sub-protocol type field (EtherSubType) is used to indicate the protocol information corresponding to the data packet, and the protocol information may include a protocol number and a protocol version.

[0181] The priority field (Priority) is used to indicate the transmission priority of the data packet.

[0182] The destination address field (WiTSNETDaddress) is used to indicate the destination address corresponding to the data packet, and the destination address is associated with the link layer addressing mode corresponding to the data packet.

[0183] The transmission characteristics field (TraMS) is used to indicate the transmission mode and transmission status corresponding to the data packet.

[0184] The source address field (WiTSNETSAddress) is used to indicate the source address corresponding to the data packet.

[0185] The first check field may be a CRC code, and the first check field is used to check the frame header.

[0186] The second reserved field (Reserve) is used to expand the frame header later, and the embodiment of the present application does not make any specific restrictions here.

[0187] In an embodiment of the present application, the customized subframe (WiTSNETSubframe) includes an access direction field (ACCDIR), a device address field (PA), a command field (CMD), a length field (LEN), a command status field (CSTS), a sequence number field (SeqN), a third reserved field (Reserve), a data field (Data), a count field (CEC / CES) and a second check field (CRC).

[0188] The access direction field (ACCDIR) is used to indicate the valid receiving direction of the received subframe.

[0189] The device address field (PA) is used to indicate the device address of the device (industrial device) corresponding to the subframe.

[0190] The command field (CMD) is used to indicate the data type and storage space of the transmission data included in the data field.

[0191] The length field (LEN) is used to indicate the data length of the transmitted data.

[0192] The command status field (CSTS) is used to indicate the access status of the transmission data, and the access status may be access success or access failure.

[0193] The sequence number field (SeqN) is used to indicate the transmission order of subframes.

[0194] The third reserved field (Reserve) is used to extend the subframe later.

[0195] The data field (Data) includes the transmission data.

[0196] The count field (CEC / CES) is used to record the number of accesses to the transmission data when the device address is a multicast address.

[0197] The second check field (CRC) is used to check the subframe.

[0198] The Ethernet routing field includes the Ethernet address field (EthernetAddress), which includes the destination MAC (Media Access Control) address field (Destination Address, DA) and the source MAC address field (Source Address, SA), the virtual local area network tag field (Virtual Local AreaNetwork, VLAN) and the Ethernet type field (Ether Type). Filling in the relevant address information of the data packet in the Ethernet address field can realize the transmission of the data packet in the standard Ethernet, realize the compatibility of the standard Ethernet and the custom network segment, and improve the compatibility.

[0199] In this embodiment, the following Figure 8 The industrial network shown and Figure 9-11 The frame structure of the data frame shown in FIG. 1 is used as an example to introduce the data transmission method provided in the embodiment of the present application. Figure 8 The industrial network shown includes a controller and industrial devices 1 - 9 , wherein industrial devices 1 - 4 participate in the current data transmission process.

[0200] 1) The controller sends an Ethernet frame to industrial device 1.

[0201] Ethernet frames can be unidirectional frames or loopback frames.

[0202] The frame structure of an Ethernet frame can be as follows Figure 9-11The frame structure of the data frame shown in the figure, the Ethernet frame contains multiple CRCs: the CRC in the frame header (WiTSNETHeader), the CRC in each subframe (WiTSNETSubframe1 to WiTSNETSubframex), and the CRC in the frame tail (FCS).

[0203] During the transmission of the Ethernet frame, an error occurs in the Ethernet frame, and the error frame is transmitted to the industrial device 1.

[0204] 2) Industrial device 1 receives the Ethernet frame sent by the controller. For each CRC in the Ethernet frame, taking the CRC in the frame tail (FCS) as an example, Industrial device 1 recalculates the CRC based on the Ethernet frame and compares the recalculated CRC with the CRC included in the frame tail (FCS) in the Ethernet frame. If an error occurs, Industrial device 1 inverts the last byte in the recalculated CRC and compares the inverted CRC with the CRC included in the frame tail (FCS) in the Ethernet frame. If they are inconsistent, it is a reception error. Industrial device 1 replaces the CRC included in the frame tail (FCS) in the Ethernet frame with the inverted CRC.

[0205] For each CRC in the Ethernet frame, industrial device 1 performs similar operations as described above, and then continues to transmit to industrial device 2 according to the addressing rule.

[0206] The industrial device 1 records the error type in an internal register.

[0207] 3) Similarly, after industrial equipment 2-4 receives the Ethernet frame sent by the preceding industrial equipment, it executes the same steps as industrial equipment 1. When an error occurs in the received Ethernet frame, the error type can be identified as a receiving error or a forwarding error. In addition, for each CRC in the Ethernet frame, the inverted CRC is used to replace the CRC contained in the Ethernet frame, and the transmission to the succeeding industrial equipment continues according to the addressing rules.

[0208] 4) The controller reads the internal register value of each industrial device to obtain the error type of the Ethernet frame received by each industrial device, thereby determining the Ethernet frame transmission status, which can improve the system error detection capability.

[0209] The above-mentioned embodiment adopts loopback mode or unidirectional mode to transmit Ethernet frames. The industrial equipment recalculates the CRC of the error frame and inverts the last byte in the CRC, replaces and updates the CRC in the error frame, and solves the problem of identifying forwarding errors and receiving errors in the industrial network without increasing the frame overhead. The industrial equipment identifies the error type and records the error information, and the controller queries the error type of the Ethernet frame received by each industrial device to ensure that the error frame is not discarded, locates the location where the error frame occurs, and improves the error diagnosis and positioning performance. CRC inversion transmission is applicable to all Ethernet frames in the industrial network, and supports the identification of the error type of Ethernet frames at 100M and 1000M network transmission rates.

[0210] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0211] Based on the same technical concept, the embodiment of the present application further provides a data transmission device, which can realize the functions of the target industrial equipment side in the above embodiment.

[0212] In an exemplary embodiment, Fig.12 As shown, a data transmission device is provided, which is used for target industrial equipment in an industrial network, including:

[0213] The receiving module 1201 is configured to receive a first Ethernet frame sent by a first industrial device in the industrial network, where the first Ethernet frame carries a first check value;

[0214] A generating module 1202, configured to generate a second check value according to the first Ethernet frame;

[0215] The determination module 1203 is used to determine the error type of the first Ethernet frame according to the first check value and the second check value when the first Ethernet frame has a check error, where the error type includes a forwarding error or a receiving error.

[0216] In one embodiment, the determination module 1002 is specifically used to invert the preset bit in the second check value to obtain an inverted check value; detect whether the inverted check value is the same as the first check value to obtain a first detection result, and determine the error type based on the first detection result.

[0217] In one embodiment, the determination module 1002 is specifically configured to determine that the error type is a forwarding error if the first detection result is that the negated check value is the same as the first check value;

[0218] If the first detection result is that the inverted check value is different from the first check value, it is determined that the error type is a reception error.

[0219] In one embodiment, the determination module 1002 is specifically used to detect whether there is a negative relationship between the second check value and the first check value to obtain a second detection result; and determine the error type according to the second detection result.

[0220] In one embodiment, the determination module 1002 is specifically used to determine that the error type is a forwarding error if the second detection result is that there is a negation relationship between the second check value and the first check value; if the second detection result is that there is no negation relationship between the second check value and the first check value, then determine that the error type is a receiving error.

[0221] In one embodiment, the device further comprises:

[0222] a replacement module, configured to replace the first check value in the first Ethernet frame with a negated check value to obtain a second Ethernet frame, wherein the negated check value is obtained by negating a preset bit in the second check value;

[0223] The sending module is used to send the second Ethernet frame to the second industrial device in the industrial network when the error type is a receiving error.

[0224] In one of the embodiments, the sending module is further configured to send the second Ethernet frame to a second industrial device in the industrial network when the error type is a forwarding error, or send the first Ethernet frame to the second industrial device in the industrial network.

[0225] In one of the embodiments, the first Ethernet frame carries a plurality of the first check values.

[0226] In one embodiment, the device further comprises:

[0227] The storage module is used to store the error type, and the error type is used to determine the Ethernet frame transmission state according to the error type stored in each industrial device in the industrial network.

[0228] In one embodiment, the first check value is a first CRC value, and the second check value is a second CRC value.

[0229] In one of the embodiments, the communication mode of the industrial network is a loopback mode or a unidirectional mode.

[0230] It should be noted here that the above-mentioned data transmission device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned data transmission method embodiment for the target industrial equipment, and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically repeated here. Each module in the above-mentioned data transmission device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the target industrial equipment in the form of hardware, or can be stored in the memory in the target industrial equipment in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0231] Based on the same technical concept, the embodiment of the present application further provides a data transmission device, which can implement the functions of the controller side in the above embodiment.

[0232] In an exemplary embodiment, Fig.13 As shown, a data transmission device is provided, which is used for a controller in an industrial network, comprising:

[0233] An acquisition module 1301 is used to acquire an error type stored in each industrial device in the industrial network, where the error type is determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, where the second check value is generated according to the first Ethernet frame;

[0234] The determination module 1302 is used to determine the Ethernet frame transmission status according to each of the error types.

[0235] It should be noted that the above-mentioned data transmission device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned data transmission method embodiment for the controller, and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically repeated here. Each module in the above-mentioned data transmission device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the controller in the form of hardware, or can be stored in the memory in the controller in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0236] Fig.14 The schematic diagram of the structure of an industrial device provided in an embodiment of the present application is as follows. The industrial device may include a processor 1400, a transceiver 1410 and a memory 1420. The transceiver 1410 is used to receive and send data under the control of the processor 1400.

[0237] Among them, Fig.14 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 1400 and memory represented by memory 1420. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface.

[0238] The transceiver 1410 may be a plurality of components, including a transmitter and a receiver, and provides a unit for communicating with various other devices on a transmission medium, and these transmission media include transmission media such as wireless channels, wired channels, and optical cables. For different user devices, the user interface 1430 may also be an interface capable of externally connecting or internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, etc. The processor 1400 is responsible for managing the bus architecture and general processing, and the memory 1420 may store data used by the processor 1400 when performing operations.

[0239] Optionally, the processor 1400 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor 1400 may also adopt a multi-core architecture.

[0240] The processor 1400 calls the program stored in the memory to perform the following steps according to the obtained executable instructions:

[0241] Control the transceiver 1410 to receive a first Ethernet frame sent by a first industrial device in the industrial network, where the first Ethernet frame carries a first check value;

[0242] generating a second check value according to the first Ethernet frame;

[0243] In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

[0244] In one embodiment, the processor 1400 is specifically configured to perform the following operations:

[0245] Inverting the preset bit in the second check value to obtain an inverted check value;

[0246] Detect whether the inverted check value is the same as the first check value to obtain a first detection result, and determine the error type according to the first detection result.

[0247] In one embodiment, the processor 1400 is specifically configured to perform the following operations:

[0248] If the first detection result is that the inverted check value is the same as the first check value, determining that the error type is a forwarding error;

[0249] If the first detection result is that the inverted check value is different from the first check value, it is determined that the error type is a reception error.

[0250] In one embodiment, the processor 1400 is specifically configured to perform the following operations:

[0251] Detect whether there is a negative relationship between the second verification value and the first verification value, and obtain a second detection result;

[0252] The error type is determined according to the second detection result.

[0253] In one embodiment, the processor 1400 is specifically configured to perform the following operations:

[0254] If the second detection result is that there is a negation relationship between the second check value and the first check value, determining that the error type is a forwarding error;

[0255] If the second detection result is that there is no inverse relationship between the second check value and the first check value, it is determined that the error type is a reception error.

[0256] In one embodiment, the processor 1400 is further configured to perform the following operations:

[0257] Replacing the first check value in the first Ethernet frame with a negated check value to obtain a second Ethernet frame, wherein the negated check value is obtained by negating a preset bit in the second check value;

[0258] When the error type is a receiving error, the transceiver 1410 is controlled to send the second Ethernet frame to a second industrial device in the industrial network.

[0259] In one embodiment, the processor 1400 is further configured to perform the following operations:

[0260] When the error type is a forwarding error, the transceiver 1410 is controlled to send the second Ethernet frame to the second industrial device in the industrial network, or the first Ethernet frame is sent to the second industrial device in the industrial network.

[0261] In one of the embodiments, the first Ethernet frame carries a plurality of the first check values.

[0262] In one embodiment, the processor 1400 is further configured to perform the following operations:

[0263] The error type is stored, and the error type is used to determine the Ethernet frame transmission state according to the error type stored in each industrial device in the industrial network.

[0264] In one embodiment, the first check value is a first CRC value, and the second check value is a second CRC value.

[0265] In one of the embodiments, the communication mode of the industrial network is a loopback mode or a unidirectional mode.

[0266] Fig.15 The schematic diagram of the structure of a controller provided in an embodiment of the present application is as follows. The controller may include a processor 1500, a transceiver 1510 and a memory 1520. The transceiver 1510 is used to receive and send data under the control of the processor 1500.

[0267] Among them, Fig.15In the embodiment of the present invention, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 1500 and memory represented by memory 1520. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface.

[0268] The transceiver 1510 may be a plurality of elements, i.e., include a transmitter and a receiver, and provide a unit for communicating with various other devices on a transmission medium, such as a wireless channel, a wired channel, an optical cable, etc. The processor 1500 is responsible for managing the bus architecture and general processing, and the memory 1520 may store data used by the processor 1500 when performing operations.

[0269] The processor 1500 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD). The processor 1500 may also adopt a multi-core architecture.

[0270] The processor 1500 calls the program stored in the memory 1520 to execute the following steps according to the obtained executable instructions:

[0271] Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame;

[0272] According to each of the error types, an Ethernet frame transmission state is determined.

[0273] In one embodiment, a data transmission system is provided, including a controller and multiple target industrial devices, each target industrial device is used to execute the steps of the data transmission method for the target industrial device in the above embodiment, and the controller is used to execute the steps of the data transmission method for the controller in the above embodiment.

[0274] The data transmission system provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned data transmission method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.

[0275] In one embodiment, a computer-readable storage medium is provided, which can be any available medium or data storage device that can be accessed by a processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid-state drives (SSDs)), etc.

[0276] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0277] Receiving a first Ethernet frame sent by a first industrial device in the industrial network, where the first Ethernet frame carries a first check value;

[0278] generating a second check value according to the first Ethernet frame;

[0279] In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

[0280] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0281] Inverting the preset bit in the second check value to obtain an inverted check value;

[0282] Detect whether the inverted check value is the same as the first check value to obtain a first detection result, and determine the error type according to the first detection result.

[0283] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0284] If the first detection result is that the inverted check value is the same as the first check value, determining that the error type is a forwarding error;

[0285] If the first detection result is that the inverted check value is different from the first check value, it is determined that the error type is a reception error.

[0286] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0287] Detect whether there is a negative relationship between the second verification value and the first verification value, and obtain a second detection result;

[0288] The error type is determined according to the second detection result.

[0289] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0290] If the second detection result is that there is a negation relationship between the second check value and the first check value, determining that the error type is a forwarding error;

[0291] If the second detection result is that there is no inverse relationship between the second check value and the first check value, it is determined that the error type is a reception error.

[0292] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0293] Replacing the first check value in the first Ethernet frame with a negated check value to obtain a second Ethernet frame, wherein the negated check value is obtained by negating a preset bit in the second check value;

[0294] When the error type is a receiving error, the second Ethernet frame is sent to a second industrial device in the industrial network.

[0295] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0296] When the error type is a forwarding error, the second Ethernet frame is sent to a second industrial device in the industrial network, or the first Ethernet frame is sent to the second industrial device in the industrial network.

[0297] In one of the embodiments, the first Ethernet frame carries a plurality of the first check values.

[0298] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0299] The error type is stored, and the error type is used to determine the Ethernet frame transmission state according to the error type stored in each industrial device in the industrial network.

[0300] In one embodiment, the first check value is a first CRC value, and the second check value is a second CRC value.

[0301] In one of the embodiments, the communication mode of the industrial network is a loopback mode or a unidirectional mode.

[0302] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0303] Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame;

[0304] According to each of the error types, an Ethernet frame transmission state is determined.

[0305] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps:

[0306] Receiving a first Ethernet frame sent by a first industrial device in the industrial network, where the first Ethernet frame carries a first check value;

[0307] generating a second check value according to the first Ethernet frame;

[0308] In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

[0309] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0310] Inverting the preset bit in the second check value to obtain an inverted check value;

[0311] Detect whether the inverted check value is the same as the first check value to obtain a first detection result, and determine the error type according to the first detection result.

[0312] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0313] If the first detection result is that the inverted check value is the same as the first check value, determining that the error type is a forwarding error;

[0314] If the first detection result is that the inverted check value is different from the first check value, it is determined that the error type is a reception error.

[0315] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0316] Detect whether there is a negative relationship between the second verification value and the first verification value, and obtain a second detection result;

[0317] The error type is determined according to the second detection result.

[0318] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:

[0319] If the second detection result is that there is a negation relationship between the second check value and the first check value, determining that the error type is a forwarding error;

[0320] If the second detection result is that there is no inverse relationship between the second check value and the first check value, it is determined that the error type is a reception error.

[0321] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0322] Replacing the first check value in the first Ethernet frame with a negated check value to obtain a second Ethernet frame, wherein the negated check value is obtained by negating a preset bit in the second check value;

[0323] When the error type is a receiving error, the second Ethernet frame is sent to a second industrial device in the industrial network.

[0324] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0325] When the error type is a forwarding error, the second Ethernet frame is sent to a second industrial device in the industrial network, or the first Ethernet frame is sent to the second industrial device in the industrial network.

[0326] In one of the embodiments, the first Ethernet frame carries a plurality of the first check values.

[0327] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0328] The error type is stored, and the error type is used to determine the Ethernet frame transmission state according to the error type stored in each industrial device in the industrial network.

[0329] In one embodiment, the first check value is a first CRC value, and the second check value is a second CRC value.

[0330] In one of the embodiments, the communication mode of the industrial network is a loopback mode or a unidirectional mode.

[0331] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps:

[0332] Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame;

[0333] According to each of the error types, an Ethernet frame transmission state is determined.

[0334] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0335] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0336] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data transmission method, characterized in that: For a target industrial device in an industrial network, the method comprises: Receiving a first Ethernet frame sent by a first industrial device in the industrial network, where the first Ethernet frame carries a first check value; generating a second check value according to the first Ethernet frame; In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

2. The method according to claim 1, characterized in that The determining the error type of the first Ethernet frame according to the first check value and the second check value includes: Inverting the preset bit in the second check value to obtain an inverted check value; Detect whether the inverted check value is the same as the first check value to obtain a first detection result, and determine the error type according to the first detection result.

3. The method according to claim 2, characterized in that The determining the error type according to the first detection result includes: If the first detection result is that the inverted check value is the same as the first check value, determining that the error type is a forwarding error; If the first detection result is that the inverted check value is different from the first check value, it is determined that the error type is a reception error.

4. The method according to claim 1, characterized in that: The determining the error type of the first Ethernet frame according to the first check value and the second check value includes: Detect whether there is a negative relationship between the second verification value and the first verification value, and obtain a second detection result; The error type is determined according to the second detection result.

5. The method according to claim 4, characterized in that The determining the error type according to the second detection result includes: If the second detection result is that there is a negation relationship between the second check value and the first check value, determining that the error type is a forwarding error; If the second detection result is that there is no inverse relationship between the second check value and the first check value, it is determined that the error type is a reception error.

6. The method according to claim 3 or 5, characterized in that: The method further comprises: Replacing the first check value in the first Ethernet frame with a negated check value to obtain a second Ethernet frame, wherein the negated check value is obtained by negating a preset bit in the second check value; When the error type is a receiving error, the second Ethernet frame is sent to a second industrial device in the industrial network.

7. The method according to claim 6, characterized in that The method further comprises: When the error type is a forwarding error, the second Ethernet frame is sent to a second industrial device in the industrial network, or the first Ethernet frame is sent to the second industrial device in the industrial network.

8. The method according to claim 7, characterized in that The first Ethernet frame carries a plurality of the first check values.

9. The method according to claim 1, characterized in that: The method further comprises: The error type is stored, and the error type is used to determine the Ethernet frame transmission state according to the error type stored in each industrial device in the industrial network.

10. The method according to claim 1, characterized in that The first check value is a first CRC value, and the second check value is a second CRC value.

11. The method according to claim 1, characterized in that: The communication mode of the industrial network is a loopback mode or a unidirectional mode.

12. A data transmission method, characterized in that: For use in a controller in an industrial network, the method comprises: Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame; According to each of the error types, an Ethernet frame transmission state is determined.

13. A data transmission device, characterized in that: For a target industrial device in an industrial network, the device comprises: A receiving module, configured to receive a first Ethernet frame sent by a first industrial device in the industrial network, wherein the first Ethernet frame carries a first check value; A generating module, configured to generate a second check value according to the first Ethernet frame; The determination module is used to determine the error type of the first Ethernet frame according to the first check value and the second check value when the first Ethernet frame has a check error, wherein the error type includes a forwarding error or a receiving error.

14. A data transmission device, characterized in that: A controller for an industrial network, the device comprising: an acquisition module, configured to acquire an error type stored in each industrial device in the industrial network, wherein the error type is determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame; The determination module is used to determine the Ethernet frame transmission status according to each of the error types.

15. An industrial device, characterized in that: Including memory, transceiver, processor: The memory is used to store a computer program; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer program in the memory and perform the following operations: Controlling the transceiver to receive a first Ethernet frame sent by a first industrial device in the industrial network, wherein the first Ethernet frame carries a first check value; generating a second check value according to the first Ethernet frame; In the case of a checksum error in the first Ethernet frame, an error type of the first Ethernet frame is determined according to the first checksum value and the second checksum value, where the error type includes a forwarding error or a receiving error.

16. A controller, characterized in that: Including memory, transceiver, processor: The memory is used to store a computer program; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer program in the memory and perform the following operations: Obtaining an error type stored in each industrial device in the industrial network, the error type being determined by the industrial device according to a first check value and a second check value carried by the first Ethernet frame when the industrial device receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, wherein the second check value is generated according to the first Ethernet frame; According to each of the error types, an Ethernet frame transmission state is determined.

17. A data transmission system, characterized in that: Including controllers and multiple industrial devices; The industrial equipment is used to perform the steps of the method according to any one of claims 1 to 11; The controller is used to execute the steps of the method according to claim 12.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Cited By

  • Data transmission method, apparatus and system, industrial device, controller, and storage medium

    WO2026108875A1