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

By generating a second check value and replacing the first check value with the inverted check value, the error type of Ethernet frame is identified and processed, which solves the problem of insufficient flexibility in error diagnosis in the existing technology and improves the stability and reliability of industrial networks.

WO2026108875A1PCT designated stage Publication Date: 2026-05-28SHENZHEN INOVANCE TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SHENZHEN INOVANCE TECH CO LTD
Filing Date
2025-11-19
Publication Date
2026-05-28

AI Technical Summary

Technical Problem

In existing technologies, Ethernet frame error diagnosis is not flexible enough to meet the error diagnosis needs of industrial networks.

Method used

By receiving Ethernet frames from the industrial network, a second check value is generated, and the error type, including forwarding error or receiving error, is determined based on the first check value and the second check value. The first check value is replaced with the inverted check value to identify and process the error frame.

Benefits of technology

It improves the flexibility of error diagnosis in Ethernet frames in industrial networks, enabling the identification and handling of error types, thereby enhancing network stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025136142_28052026_PF_FP_ABST
    Figure CN2025136142_28052026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a data transmission method, apparatus and system, an industrial device, a controller, and a storage medium. The method comprises: a target industrial device receiving a first Ethernet frame sent by a first industrial device in an industrial network, the first Ethernet frame carrying a first check value; generating a second check value on the basis of the first Ethernet frame; and when a check error occurs in the first Ethernet frame, determining an error type of the first Ethernet frame on the basis of the first check value and the second check value, the error type comprising a forwarding error or a receiving error. By means of the method, error diagnosis requirements of the industrial network can be met, and flexibility of error diagnosis during data transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission methods, devices, industrial equipment, controllers, systems, and storage media

[0001] Related applications

[0002] This application claims priority to Chinese patent application No. 202411681173.4, filed on November 22, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of industrial network technology, and in particular to a data transmission method, apparatus, industrial equipment, controller, system, and storage medium. Background Technology

[0004] In the field of industrial networks, the correct transmission of Ethernet frames plays a crucial role in the stability and reliability of industrial networks.

[0005] In industrial networks based on standard Ethernet, the 4-byte Frame Check Sequence (FCS) at the end of the Ethernet frame is calculated based on Cyclic Redundancy Check (CRC) during data transmission. The sending end transmits the Ethernet frame carrying the CRC value to the receiving end. After receiving the Ethernet frame, the receiving end recalculates the CRC value. By comparing the recalculated CRC value with the CRC value carried in the Ethernet frame, it can identify whether an error occurred during the transmission of the Ethernet frame from the sending end to the receiving end.

[0006] 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

[0007] Therefore, 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, in order to address the above-mentioned technical problems.

[0008] In a first aspect, this application provides a data transmission method for target industrial equipment in an industrial network, the method comprising:

[0009] 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;

[0010] A second checksum is generated based on the first Ethernet frame;

[0011] In the event of a checksum error in the first Ethernet frame, the error type of the first Ethernet frame is determined based on the first checksum and the second checksum, wherein the error type includes a forwarding error or a receiving error.

[0012] In one embodiment, determining the error type of the first Ethernet frame based on the first checksum and the second checksum includes:

[0013] Invert the preset bits in the second check value to obtain the inverted check value;

[0014] The system detects whether the inverted check value is the same as the first check value to obtain a first detection result, and determines the error type based on the first detection result.

[0015] In one embodiment, determining the error type based on the first detection result includes:

[0016] If the first detection result is that the inverted check value is the same as the first check value, then the error type is determined to be a forwarding error;

[0017] If the first detection result is that the inverted check value is different from the first check value, then the error type is determined to be a receiving error.

[0018] In one embodiment, determining the error type of the first Ethernet frame based on the first checksum and the second checksum includes:

[0019] The second check value is checked to see if there is an inverse relationship with the first check value, and a second check result is obtained;

[0020] The error type is determined based on the second detection result.

[0021] In one embodiment, determining the error type based on the second detection result includes:

[0022] If the second detection result shows that there is an inverse relationship between the second check value and the first check value, then the error type is determined to be a forwarding error;

[0023] If the second detection result indicates that there is no inverse relationship between the second check value and the first check value, then the error type is determined to be a reception error.

[0024] In one embodiment, the method further includes:

[0025] The first check value is replaced in the first Ethernet frame by using the inverted check value to obtain the second Ethernet frame. The inverted check value is obtained by inverting a preset bit in the second check value.

[0026] In the event of a reception error, the second Ethernet frame is sent to the second industrial device in the industrial network.

[0027] In one embodiment, the method further includes:

[0028] In the case of a forwarding error, the second Ethernet frame is sent 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.

[0029] In one embodiment, the first Ethernet frame carries multiple of the first check values.

[0030] In one embodiment, the method further includes:

[0031] The error types are stored, and these error types are used to determine the Ethernet frame transmission status based on the error types stored by each industrial device in the industrial network.

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

[0033] In one embodiment, the communication mode of the industrial network is either loopback mode or one-way mode.

[0034] Secondly, this application provides a data transmission method for a controller in an industrial network, the method comprising:

[0035] The error type stored in each industrial device in the industrial network is obtained. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a checksum error. The error type is determined by the first checksum carried in the first Ethernet frame and the second checksum is generated based on the first Ethernet frame.

[0036] The Ethernet frame transmission status is determined based on each of the error types described.

[0037] Thirdly, this application provides a data transmission apparatus for target industrial equipment in an industrial network, the apparatus comprising:

[0038] The receiving module is 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.

[0039] The generation module is used to generate a second checksum based on the first Ethernet frame;

[0040] The determination module is configured to determine the error type of the first Ethernet frame based on the first checksum and the second checksum when the first Ethernet frame checksum is incorrect, wherein the error type includes forwarding error or receiving error.

[0041] Fourthly, this application provides a data transmission device for a controller in an industrial network, the device comprising:

[0042] The acquisition module is used to acquire the error types stored by each industrial device in the industrial network. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a checksum error, based on a first checksum carried by the first Ethernet frame and a second checksum. The second checksum is generated based on the first Ethernet frame.

[0043] The determination module is used to determine the Ethernet frame transmission status based on each of the error types.

[0044] Fifthly, this application provides an industrial device, including a memory, a transceiver, and a processor:

[0045] Memory is used to store computer programs; transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs from memory and perform the following operations:

[0046] The transceiver is controlled to receive a first Ethernet frame sent by a first industrial device in the industrial network, the first Ethernet frame carrying a first check value;

[0047] A second checksum is generated based on the first Ethernet frame;

[0048] In the event of a checksum error in the first Ethernet frame, the error type of the first Ethernet frame is determined based on the first checksum and the second checksum, wherein the error type includes a forwarding error or a receiving error.

[0049] Sixthly, this application provides a controller, including a memory, a transceiver, and a processor:

[0050] Memory is used to store computer programs; transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs from memory and perform the following operations:

[0051] The error type stored in each industrial device in the industrial network is obtained. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a checksum error. The error type is determined by the first checksum carried in the first Ethernet frame and the second checksum is generated based on the first Ethernet frame.

[0052] The Ethernet frame transmission status is determined based on each of the error types described.

[0053] In a seventh aspect, this application provides a data transmission system, including a controller and multiple industrial devices;

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

[0055] The controller is configured to perform the steps of the method described in the second aspect above.

[0056] Eighthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first or second aspect above.

[0057] Ninthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first or second aspect above.

[0058] The aforementioned data transmission method, apparatus, industrial equipment, controller, system, and storage medium allow a target industrial device in an industrial network to receive a first Ethernet frame sent by a first industrial device in the same industrial network. This first Ethernet frame carries a first checksum. The target industrial device generates a second checksum based on the first Ethernet frame. Then, in the event of a checksum error in the first Ethernet frame, the target industrial device determines the error type of the first Ethernet frame based on the first and second checksums. This error type includes forwarding errors or receiving errors. A receiving error can refer to an error occurring in the first Ethernet frame during its transmission from the first industrial device to the target industrial device. A forwarding error can refer to a situation where no error occurred in the first Ethernet frame during its transmission from the first industrial device to the target industrial device, but an error occurred in the Ethernet frame during data transmission prior to the first industrial device. Thus, the target industrial device can not only identify whether the first Ethernet frame has a checksum error, but also identify the error type of the first Ethernet frame in the event of a checksum error, thereby meeting the error diagnosis requirements of industrial networks and improving the flexibility of error diagnosis during data transmission. Attached Figure Description

[0059] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0060] Figure 1 is a schematic diagram of the network topology of an industrial network;

[0061] Figure 2 is a flowchart illustrating a data transmission method in one embodiment;

[0062] Figure 3 is a flowchart illustrating the process of determining the error type of the first Ethernet frame in another embodiment;

[0063] Figure 4 is a flowchart illustrating the process of determining the error type of the first Ethernet frame in another embodiment;

[0064] Figure 5 is a schematic diagram of the data transmission process of the target industrial equipment in another embodiment;

[0065] Figure 6 is a flowchart illustrating the data transmission method in another embodiment;

[0066] Figure 7 is a flowchart illustrating the data transmission method in another embodiment;

[0067] Figure 8 is a schematic diagram of the network topology of another type of industrial network;

[0068] Figure 9 is a schematic diagram of the frame structure of a data frame in another embodiment;

[0069] Figure 10 is a schematic diagram of the frame structure of a data frame in another embodiment;

[0070] Figure 11 is a schematic diagram of the frame structure of a data frame in another embodiment;

[0071] Figure 12 is a structural block diagram of a data transmission device in one embodiment;

[0072] Figure 13 is a structural block diagram of a data transmission device in another embodiment;

[0073] Figure 14 is an internal structure diagram of an industrial device in one embodiment;

[0074] Figure 15 is an internal structure diagram of the controller in one embodiment. Detailed Implementation

[0075] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0076] Industrial networks are now widely used in many fields, such as industrial automation, power electronics, the Internet of Things, and aerospace. In traditional industrial networks, industrial equipment and controllers transmit Ethernet frames via wired networks, and the correctness of Ethernet frame transmission plays a crucial role in the stability and reliability of the industrial network.

[0077] In industrial networks based on standard Ethernet, the 4-byte Frame Check Sequence (FCS) at the end of the Ethernet frame is calculated based on Cyclic Redundancy Check (CRC). The sending end transmits the Ethernet frame carrying the CRC value (or CRC check value, etc.) to the receiving end. After receiving the Ethernet frame, the receiving end recalculates the CRC value. By comparing the recalculated CRC value with the CRC value carried in the Ethernet frame, it can identify whether an error occurred during the transmission of the Ethernet frame from the sending end to the receiving end.

[0078] 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.

[0079] Therefore, embodiments of this application provide a data transmission method, apparatus, 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.

[0080] The data transmission method provided in this application embodiment can be applied to wired industrial networks. For example, the data transmission method provided in this application embodiment can be applied to the implementation environment shown in FIG1. ​​In the industrial network shown in FIG1, the controller and industrial devices 1 to n (n is a positive integer greater than 1) form a linear wired industrial network topology.

[0081] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

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

[0083] In an exemplary embodiment, as shown in FIG2, a data transmission method is provided. Taking the application of this method to any industrial device (hereinafter referred to as the target industrial device) in the industrial network shown in FIG1 as an example, the method includes the following steps 201 and 202:

[0084] Step 201: Receive a first Ethernet frame sent by a first industrial device in the industrial network. The first Ethernet frame carries a first check value.

[0085] In this embodiment of the application, the target industrial equipment can be any industrial equipment in the industrial network. When the target industrial equipment is directly connected to the controller in the industrial network, the first industrial equipment can be the controller. When the target industrial equipment is not directly connected to the controller, the first industrial equipment can be the upstream industrial equipment directly connected to the target industrial equipment.

[0086] During data transmission in an industrial network, the target industrial device receives a first Ethernet frame sent by a first industrial device, which may carry a first checksum.

[0087] Taking a first Ethernet frame carrying a first check value as an example, this first check value can be carried in the Frame Check Sequence (FCS) at the end of the first Ethernet frame. Implementation methods for a first Ethernet frame carrying multiple first check values ​​will be described in the following embodiments. Below, we will first use a first Ethernet frame carrying a first check value as an example to exemplarily describe the implementation methods of the data transmission method in this application.

[0088] In this embodiment of the application, the first check value can be the first CRC value, that is, the first check value is calculated based on the CRC check algorithm. Of course, the first check value can also be calculated based on other check algorithms.

[0089] In this embodiment, the communication mode of the industrial network is either loopback mode or one-way mode. When the communication mode of the industrial network is loopback mode, the first Ethernet frame is a loopback frame. Loopback mode means that when the loopback frame sent by the controller arrives at the destination industrial device, the destination industrial device modifies the destination address in the loopback frame to the controller address and then loops back to the controller. When the communication mode of the industrial network is one-way mode, the first Ethernet frame is a one-way frame. One-way mode means that when the controller sends a one-way frame to the destination industrial device, the destination industrial device performs frame cancellation and no longer continues to transmit forward.

[0090] Step 202: Generate a second checksum based on the first Ethernet frame.

[0091] After the target industrial equipment receives the first Ethernet frame sent by the first industrial equipment, the target industrial equipment generates a second check value based on the first Ethernet frame.

[0092] For example, the target industrial equipment can calculate the second check value using the same check algorithm as the first check value. For instance, if the first check value is the first CRC value, the target industrial equipment uses the same CRC check algorithm as the first CRC value to generate the second check value based on the first Ethernet frame. In this way, the second check value is the second CRC value, and the CRC encoding types of the first CRC value and the second CRC value are the same.

[0093] After the target industrial equipment generates a second checksum based on the first Ethernet frame, it compares the second checksum with the first checksum. If the second checksum is the same as the first checksum, it indicates that the first Ethernet frame has been correctly checked, that is, the first Ethernet frame is a correct frame and not an erroneous frame. The target industrial equipment then continues to transmit the first Ethernet frame to the next-level device (e.g., the second industrial equipment). Alternatively, the target industrial equipment may process the first Ethernet frame as needed before continuing to transmit it to the second industrial equipment.

[0094] Step 203: In the case of a first Ethernet frame check error, determine the error type of the first Ethernet frame based on the first check value and the second check value.

[0095] If the second checksum differs from the first checksum, it indicates a checksum error in the first Ethernet frame, meaning the first Ethernet frame is an erroneous frame. The target industrial device then determines the error type of the first Ethernet frame based on the first and second checksums. The error type can be either a forwarding error or a receiving error.

[0096] In one possible implementation, the target industrial equipment 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 during the training phase, and outputs the error type. In this way, the target industrial equipment obtains the error type of the first Ethernet frame.

[0097] Other possible implementations for determining the above-mentioned error type based on the second and first verification values ​​of the target industrial equipment will be described in the following embodiments.

[0098] In the above embodiments, the error types of the first Ethernet frame include forwarding errors or receiving errors. A receiving error may refer to an error occurring in the first Ethernet frame during the process of the first industrial device sending the first Ethernet frame to the target industrial device. A forwarding error may refer to an error occurring in the Ethernet frame during the process of the first industrial device sending the first Ethernet frame to the target industrial device, even though no error occurred in the first Ethernet frame during the data transmission before the first industrial device. In this way, the target industrial device can not only identify whether the first Ethernet frame has a verification error, but also identify the error type of the first Ethernet frame if the first Ethernet frame has a verification error. This can meet the error diagnosis requirements of industrial networks and improve the flexibility of error diagnosis during data transmission.

[0099] In one embodiment, based on the embodiment shown in FIG2, the following describes two possible implementations for determining the error type of a first Ethernet frame based on a first check value and a second check value by a target industrial device.

[0100] 1) In one possible implementation, referring to FIG3, the target industrial device can execute steps 301 and 302 shown in FIG3 to realize the process of determining the error type of the first Ethernet frame based on the first check value and the second check value:

[0101] Step 301: Invert the preset bit in the second check value to obtain the inverted check value.

[0102] The second check value may include multiple bytes. In this embodiment, the preset bit may be, for example, the last eight bits of the second check value, i.e., the last byte. Optionally, it may also be the last two or three bytes of the second check value, etc. There is no specific limitation here. The following embodiments all use the last byte as an example for illustration.

[0103] The target industrial equipment inverts the last byte of the second check value to obtain an inverted check value. For example, assuming the second check value is 32'bxxxxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx, the target industrial equipment inverts the last byte of the second check value, resulting in an inverted check value of 32'bxxxxxxxx_xxxxxxxx_xxxxxxxx_~x~x~x~x~x~x~x~x~x.

[0104] Step 302: Check whether the inverted check value is the same as the first check value to obtain the first check result, and determine the error type based on the first check result.

[0105] The target industrial equipment detects whether the inverted check value is the same as the first check value carried in 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.

[0106] For example, the target industrial equipment detects whether the inverted check value is the same as the first check value, and obtains a first detection result. 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 not the same as the first check value, the error type is determined to be a receiving error.

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

[0108] 2) In another possible implementation, referring to FIG4, the target industrial device can execute steps 401 and 402 shown in FIG4 to implement the process of determining the error type of the first Ethernet frame based on the first check value and the second check value:

[0109] Step 401: Detect whether there is an inverse relationship between the second check value and the first check value to obtain the second detection result.

[0110] As mentioned above, the second check value may include multiple bytes. The target industrial equipment can detect whether there is an inverse 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, the eight bits included in the last byte.

[0111] The last byte of the second check value is inverted from the last byte of the first check value. This means that inverting the last byte of the second check value will yield the last byte of the first check value.

[0112] Step 402: Determine the error type based on the second detection result.

[0113] The target industrial equipment detects whether there is an inverse relationship between the second check value and the first check value, and obtains a second detection result. Optionally, if the second detection result shows that there is an inverse relationship between the second check value and the first check value, the error type is determined to be a forwarding error; alternatively, if the second detection result shows that there is no inverse relationship between the second check value and the first check value, the error type is determined to be a receiving error.

[0114] Thus, this embodiment can identify the error type of the first Ethernet frame by detecting whether there is an inverse relationship between the second check value and the first check value. The implementation method is simple, the amount of computation is small, and the flexibility of error identification is improved.

[0115] In actual implementation, through 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. The implementation method can be flexibly selected in actual implementation, which improves the implementation flexibility of the embodiments of this application.

[0116] The following describes, based on the embodiments shown in Figures 3 and 4, the data transmission of the target industrial device after determining the error type of the first Ethernet frame.

[0117] Referring to Figure 5, the data transmission method in this embodiment further includes steps 501, 502, and 503 as shown in Figure 5:

[0118] Step 501: Replace the first check value in the first Ethernet frame with the inverted check value to obtain the second Ethernet frame.

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

[0120] Based on the embodiment shown in Figure 3, since the target industrial equipment has already 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, namely the second Ethernet frame.

[0121] Based on the embodiment shown in Figure 4, before executing step 501, the target industrial equipment first inverts a preset bit in the second check value to obtain an inverted check value. The method by which the target industrial equipment inverts the preset bit in the second check value can be found in the implementation of step 301, and will not be repeated here. Then, the target industrial equipment uses the inverted check value to replace the first check value in the first Ethernet frame to obtain the second Ethernet frame.

[0122] Step 502: In the case of an error type of reception error, send a second Ethernet frame to the second industrial device in the industrial network.

[0123] If the error type is a reception error, it means 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 target industrial device then sends a second Ethernet frame to the second industrial device according to the addressing rules. That is, in the case of a reception 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.

[0124] Step 503: If the error type is forwarding error, send a second Ethernet frame to the second industrial device in the industrial network, or send a first Ethernet frame to the second industrial device in the industrial network.

[0125] In the case of a forwarding error, it means that the first Ethernet frame did not encounter an error 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 before the first industrial device. The target industrial device can then send the second Ethernet frame to the second industrial device in the industrial network according to the addressing rules, or it 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.

[0126] In this way, after the second industrial device receives an Ethernet frame (either the first 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. Thus, each industrial device in the industrial network can use the same method as the target industrial device to identify the error type as a forwarding error or a receiving error when the received Ethernet frame check is incorrect, thereby improving the error diagnosis capability of each industrial device in the industrial network.

[0127] Furthermore, in related technologies, when an erroneous frame is received, i.e., when the received Ethernet frame contains an error, the Ethernet frame is usually discarded directly, or it may be directly passed down. This application's embodiment can, without increasing frame overhead, invert and replace the first Ethernet frame, and then send the inverted and replaced second Ethernet frame to the second industrial device. This adds an error handling mechanism to the industrial network, making it easier for the second industrial device to identify the error type, thereby meeting the performance and diagnostic needs of the industrial network, solving the problems of erroneous Ethernet frame transmission and error type identification, and improving the diagnostic capabilities of the industrial network.

[0128] In this embodiment of the application, since the target industrial equipment replaces the first check value in the first Ethernet frame with the inverted check value, the frame overhead is not increased. This embodiment of the 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.

[0129] This application supports loopback mode and unidirectional mode, and supports the transmission of inverted checksum values ​​of erroneous Ethernet frames and the identification of error types under unicast, multicast and broadcast transmission mechanisms.

[0130] Taking the CRC value as an example, where the second and first checksums are both CRC values: In loopback mode, the controller sends hierarchical loopback frames to each industrial device. If the industrial device detects an error in the CRC value of the loopback frame (i.e., the loopback frame is faulty), it can invert the last byte of the recalculated CRC value, update the CRC value in the faulty loopback frame, and then transmit it to the destination device according to the addressing rules (of course, in the case of a forwarding error, the faulty loopback frame can also be directly transmitted to the destination device). After the loopback-transmitted Ethernet frame arrives at the destination device, the destination address is modified to the controller, and the frame is forwarded sequentially until it reaches the controller.

[0131] In unidirectional mode, the controller sends a hierarchical unidirectional frame to the industrial equipment within the hierarchy. The industrial equipment detects an error in the CRC value of the unidirectional frame (i.e., the unidirectional frame is erroneous). The industrial equipment can invert the last byte of the recalculated CRC value, update 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 of a forwarding error, the erroneous unidirectional frame can also be transmitted directly to the destination device). The unidirectional frame is then eliminated at the destination device. This application embodiment can flexibly support data transmission in both loopback and unidirectional modes in industrial networks.

[0132] The above embodiments are all illustrated using the example of a first Ethernet frame carrying a first check value (such as a CRC value). Optionally, the first Ethernet frame may carry multiple first check values.

[0133] The multiple first check values ​​can be carried in different positions in the first Ethernet frame, such as in the frame tail, frame header, or data segment of the first Ethernet frame, etc. The position of the multiple first check values ​​in the first Ethernet frame is not limited here.

[0134] Regarding the process of the target industrial equipment generating a second check value based on the first Ethernet frame, in this embodiment, the target industrial equipment can generate a second check value corresponding to each first check value based on the first Ethernet frame.

[0135] In the event of a first Ethernet frame checksum error, optionally, the target industrial device may, for each first checksum and its corresponding second checksum, employ the implementation method described above to determine the error type based on the first checksum and its corresponding second checksum. It is understood that the error type determined by the target industrial device based on each second checksum and its corresponding first checksum is the same.

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

[0137] In the case of a reception 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.

[0138] In the case of a forwarding error, the target industrial device may optionally 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; alternatively, the target industrial device may also directly send the first Ethernet frame carrying each first check value to the second industrial device.

[0139] The embodiments of this application are applicable to all Ethernet frames carrying check fields (such as CRC values) in industrial networks, and support the inversion of all check fields in erroneous Ethernet frames, making them suitable for a wide range of scenarios.

[0140] In one embodiment, based on any of the above embodiments, taking the embodiment shown in FIG2 as an example and referring to FIG6, the data transmission method of this embodiment further includes step 601 shown in FIG6:

[0141] Step 601, store the error type.

[0142] Error types are used by controllers in industrial networks to determine the Ethernet frame transmission status based on the error types stored in each industrial device in the network.

[0143] The controller obtains the error types stored by each industrial device in the industrial network. As mentioned above, the error type is determined by the industrial device when it receives the first Ethernet frame sent by the first industrial device and the first Ethernet frame has a check error, based on the first check value and the second check value carried in the first Ethernet frame. 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.

[0144] In this embodiment of the application, after determining the error type, each industrial device in the industrial network can record the error type in the register inside the industrial device. The controller reads the register value inside each industrial device to obtain 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.

[0145] In one embodiment, as shown in FIG7, a data transmission method is provided. Taking the application of this method to the controller shown in FIG1 as an example, the method includes the following steps 701 and 702:

[0146] Step 701: Obtain the error types stored in each industrial device in the industrial network.

[0147] The error type is determined by the industrial equipment when it receives the first Ethernet frame sent by the first industrial equipment and the first Ethernet frame has a check error, based on the first check value and the second check value, which is generated based on the first Ethernet frame.

[0148] Step 702: Determine the Ethernet frame transmission status based on each error type.

[0149] For details regarding the implementation methods and beneficial effects of the data transmission method for the controller, please refer to the relevant descriptions in the embodiments of the data transmission method for the target industrial equipment above, which will not be repeated here.

[0150] In an exemplary embodiment, a data transmission method is provided, which is illustrated by taking the application of the method to the industrial network in Figure 2 as an example, and includes the following steps:

[0151] Step A1: The target industrial device receives a first Ethernet frame sent by a first industrial device in the industrial network. The first Ethernet frame carries a first check value, and the target industrial device generates a second check value based on the first Ethernet frame.

[0152] Step A2: In the event of a checksum error in the first Ethernet frame, the target industrial device determines the error type of the first Ethernet frame based on the first checksum and the second checksum. The error type may include a forwarding error or a receiving error.

[0153] The first Ethernet frame carries one or more first checksum values. The first checksum value is a first CRC value, and the second checksum value is a second CRC value. The industrial network uses either loopback mode or unidirectional mode for communication.

[0154] 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 any of the following ways:

[0155] 1) The target industrial equipment inverts the preset bits in the second check value to obtain the inverted check value. The target industrial equipment detects whether the inverted check value is the same as the first check value and obtains the 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 not the same as the first check value, the error type is determined to be a receiving error.

[0156] 2) The target industrial equipment detects whether there is an inverse relationship between the second check value and the first check value to obtain the second detection result. If the second detection result shows that there is an inverse 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 shows that there is no inverse relationship between the second check value and the first check value, the error type is determined to be a receiving error.

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

[0158] Step A4: In the case of an error type of reception error, send a second Ethernet frame to the second industrial device in the industrial network.

[0159] Step A5: If the error type is forwarding error, send a second Ethernet frame to the second industrial device in the industrial network, or send a first Ethernet frame to the second industrial device in the industrial network.

[0160] Step A6: Store the error type. The error type is used to determine the Ethernet frame transmission status based on the error type stored by each industrial device in the industrial network.

[0161] Step A7: The controller obtains the error types stored in each industrial device in the industrial network and determines the Ethernet frame transmission status based on each error type.

[0162] The following example illustrates the data transmission method of this application.

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

[0164] 1) The controller sends Ethernet frames to industrial device 1.

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

[0166] Optionally, the Ethernet frame may contain multiple CRC values. Alternatively, the Ethernet frame may contain only one CRC value.

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

[0168] 2) Industrial equipment 1 receives the Ethernet frame sent by the controller. Industrial equipment 1 recalculates the CRC based on the Ethernet frame and compares the recalculated CRC with the CRC contained in the Ethernet frame. If an error occurs, industrial equipment 1 inverts the last byte of 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 receiving error.

[0169] 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 rules.

[0170] Industrial equipment 1 records the error type into an internal register.

[0171] 3) Similarly, after receiving the Ethernet frame sent by the upstream industrial equipment, industrial equipment 2-4 performs 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, replace the CRC contained in the Ethernet frame with the inverted CRC, and continue to transmit to the downstream industrial equipment according to the addressing rules.

[0172] 4) The controller reads the internal register values ​​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 and improving the system's error detection capability.

[0173] The data transmission method of this application embodiment will be illustrated below with reference to an exemplary data frame structure.

[0174] See Figures 9-11, which are schematic diagrams of the frame structure of an exemplary data frame.

[0175] WiTSNET stands for Wired-wireless Time Synchronization Net. A WiTSNET packet based on an Ethernet packet (hereinafter referred to as a packet) includes a preamble, a start frame delimiter (SFD), an Ethernet routing field, a data frame (WiTSNETFrame), and a frame trailer (FCS).

[0176] In the frame format defined by standard Ethernet, the preamble has 7 bytes. According to ISO / IEC / IEEE 8802-3, the first 2 bytes (Pre1 and Pre2 shown in Figures 9-11) are used as clock synchronization codes and encoded in 4B / 5B or 7B / 8B to form the data stream start separator. In the embodiments of this application, the remaining 5 bytes of the preamble (WiTSNETPre shown in Figures 9-11) are used to define a priority field, a destination address field, and a first reserved field.

[0177] The priority field is used to indicate the transmission priority of data packets. Data packets can be transmitted according to the transmission priority indicated by the priority field in each data packet.

[0178] The first reserved field is used for later expansion of the preamble, and this application embodiment does not impose specific limitations here.

[0179] The destination address field (WiTSNETDaddress) indicates the destination address of the data packet, and the destination address is associated with the link layer addressing mode of the data packet.

[0180] In this embodiment, the custom data frame (WiTSNETFrame) includes a frame header (WiTSNETHeader), multiple subframes (WiTSNETSubframe1 to WiTSNETSubframex as shown in Figures 10 and 11), a padding field (WiTSNETDataPad), and an end field (WiTSNETDataEnd). Specifically, when the frame length of the data packet is less than the minimum frame length corresponding to 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.

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

[0182] The EtherSubType field indicates the protocol information corresponding to the data packet, which may include the protocol number and protocol version.

[0183] The Priority field is used to indicate the transmission priority of data packets.

[0184] The destination address field (WiTSNETDaddress) indicates the destination address of the data packet, and the destination address is associated with the link layer addressing mode of the data packet.

[0185] The Transmission Characteristics field (TraMS) is used to indicate the transmission mode and transmission status of the data packet.

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

[0187] The first check field can be a CRC code, and it is used to check the frame header.

[0188] The second reserved field is used for later expansion of the frame header, and this application embodiment does not impose specific limitations on it.

[0189] In this embodiment of the application, the custom 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 counter field (CEC / CES), and a second check field (CRC).

[0190] The Access Direction field (ACCDIR) is used to indicate the valid reception direction of the received subframe.

[0191] The Device Address (PA) field is used to indicate the device address of the device (industrial equipment) corresponding to the subframe.

[0192] The command field (CMD) is used to indicate the data type and storage space of the transmitted data, including the data field.

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

[0194] The Command Status field (CSTS) is used to indicate the access status of the transmitted data, which can be either successful or failed.

[0195] The sequence number field (SeqN) is used to indicate the order in which subframes are sent.

[0196] The third reserved field is used for later expansion of the subframe.

[0197] The data field includes the transmitted data.

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

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

[0200] The Ethernet routing field includes the Ethernet Address field, which comprises the Destination MAC (Media Access Control) Address field (DA), the Source MAC Address field (SA), the Virtual Local Area Network (VLAN) tag field, and the Ethernet Type field. Entering the relevant address information for data packets into the Ethernet Address field enables data packet transmission within standard Ethernet networks, achieving compatibility between standard Ethernet and custom network segments, thus improving overall compatibility.

[0201] In this embodiment, the data transmission method provided by this application embodiment will be described by way of example, with reference to the industrial network shown in Figure 8 and the frame structure of the data frames shown in Figures 9-11. The industrial network shown in Figure 8 includes a controller and industrial devices 1-9, wherein industrial devices 1-4 participate in the current data transmission process.

[0202] 1) The controller sends Ethernet frames to industrial device 1.

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

[0204] The frame structure of an Ethernet frame can be shown in Figures 9-11. An 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).

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

[0206] 2) Industrial device 1 receives Ethernet frames 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 contained in the frame tail (FCS). If an error occurs, industrial device 1 inverts the last byte of the recalculated CRC and compares it with the CRC contained in the frame tail (FCS). If they do not match, a reception error has occurred. Industrial device 1 replaces the CRC contained in the frame tail (FCS) with the inverted CRC.

[0207] For each CRC in the Ethernet frame, industrial device 1 performs the same operation as described above, and then continues to transmit to industrial device 2 according to the addressing rules.

[0208] Industrial equipment 1 records the error type into an internal register.

[0209] 3) Similarly, after receiving the Ethernet frame sent by the upstream industrial equipment, industrial equipment 2-4 performs the same steps as industrial equipment 1. In the event of an error in the received Ethernet frame, it can identify the error type as a receiving error or a forwarding error. Furthermore, for each CRC in the Ethernet frame, it replaces the CRC contained in the Ethernet frame with the inverted CRC and continues to transmit to the downstream industrial equipment according to the addressing rules.

[0210] 4) The controller reads the internal register values ​​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 and improving the system's error detection capability.

[0211] The above embodiments use loopback or unidirectional mode to transmit Ethernet frames. The industrial equipment recalculates the CRC of the erroneous frame and inverts the last byte of the CRC, replacing the CRC in the updated erroneous frame. Without increasing frame overhead, it solves the problem of identifying forwarding and receiving errors in industrial networks. The industrial equipment identifies the error type and records the error information, and the controller queries the error type of the Ethernet frames received by each industrial equipment to ensure that erroneous frames are not discarded, locate the location of the erroneous frame, and improve the error diagnosis and location performance. CRC inversion transmission is applicable to all Ethernet frames in industrial networks and supports the identification of Ethernet frame error types at 100M and 1000M network transmission rates.

[0212] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0213] Based on the same technical concept, this application also provides a data transmission device. This data transmission device can realize the functions of the target industrial equipment side in the foregoing embodiments.

[0214] In an exemplary embodiment, as shown in FIG12, a data transmission apparatus is provided for target industrial equipment in an industrial network, comprising:

[0215] The receiving module 1201 is used 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.

[0216] Generation module 1202 is used to generate a second check value based on the first Ethernet frame;

[0217] The determination module 1203 is used to determine the error type of the first Ethernet frame based on the first check value and the second check value when the first Ethernet frame check error occurs. The error type includes forwarding error or receiving error.

[0218] In one embodiment, the determining module 1002 is specifically used to invert a 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.

[0219] In one embodiment, the determining module 1002 is specifically used to determine the error type as a forwarding error if the first detection result is that the inverted check value is the same as the first check value;

[0220] If the first detection result is that the inverted check value is different from the first check value, then the error type is determined to be a receiving error.

[0221] In one embodiment, the determining module 1002 is specifically used to detect whether there is an inverse relationship between the second check value and the first check value, and obtain a second detection result; and determine the error type based on the second detection result.

[0222] In one embodiment, the determining module 1002 is specifically used to determine the error type as a forwarding error if the second detection result shows that there is an inversion relationship between the second check value and the first check value; and to determine the error type as a receiving error if the second detection result shows that there is no inversion relationship between the second check value and the first check value.

[0223] In one embodiment, the device further includes:

[0224] The replacement module is used to replace the first check value in the first Ethernet frame with the inverted check value to obtain a second Ethernet frame. The inverted check value is obtained by inverting a preset bit in the second check value.

[0225] The transmitting module is configured to transmit the second Ethernet frame to a second industrial device in the industrial network when the error type is a reception error.

[0226] In one embodiment, the sending module is further configured to send the second Ethernet frame to a second industrial device in the industrial network, or to send the first Ethernet frame to a second industrial device in the industrial network, in the event that the error type is a forwarding error.

[0227] In one embodiment, the first Ethernet frame carries multiple of the first check values.

[0228] In one embodiment, the device further includes:

[0229] A storage module is used to store the error types, which are used to determine the Ethernet frame transmission status based on the error types stored by each industrial device in the industrial network.

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

[0231] In one embodiment, the communication mode of the industrial network is either loopback mode or one-way mode.

[0232] It should be noted that the data transmission device provided in this application embodiment can implement all the method steps implemented in the above-described data transmission method embodiment for target industrial equipment, and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here. Each module in the above-described data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the target industrial equipment in hardware form, or it can be stored in the memory of the target industrial equipment in software form, so that the processor can call and execute the operations corresponding to each module.

[0233] Based on the same technical concept, this application also provides a data transmission device. This data transmission device can realize the functions of the controller side in the foregoing embodiments.

[0234] In an exemplary embodiment, as shown in FIG13, a data transmission device is provided for a controller in an industrial network, comprising:

[0235] The acquisition module 1301 is used to acquire the error type stored by each industrial device in the industrial network. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a check error, based on a first check value and a second check value carried in the first Ethernet frame. The second check value is generated based on the first Ethernet frame.

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

[0237] It should be noted that the data transmission device provided in this application embodiment can implement all the method steps implemented in the above-described data transmission method embodiment for the controller, and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here. Each module in the above-described data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the controller in hardware form, or stored in the memory of the controller in software form, so that the processor can call and execute the operations corresponding to each module.

[0238] Figure 14 is a schematic diagram of an industrial device provided in an embodiment of this application. The industrial device may include a processor 1400, a transceiver 1410, and a memory 1420. The transceiver 1410 is used to receive and transmit data under the control of the processor 1400.

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

[0240] The transceiver 1410 may consist of multiple components, including a transmitter and a receiver, providing a unit for communicating with various other devices over a transmission medium, including wireless channels, wired channels, optical fibers, and other transmission media. For different user equipment, the user interface 1430 may also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc. The processor 1400 is responsible for managing the bus architecture and general processing, and the memory 1420 can store data used by the processor 1400 during operation.

[0241] Optionally, the processor 1400 can be a CPU (Central Processing Unit), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or CPLD (Complex Programmable Logic Device), and the processor 1400 can also adopt a multi-core architecture.

[0242] The processor 1400 invokes a program stored in memory to perform the following steps according to the obtained executable instructions:

[0243] The transceiver 1410 is controlled to receive a first Ethernet frame sent by a first industrial device in the industrial network, the first Ethernet frame carrying a first check value;

[0244] A second checksum is generated based on the first Ethernet frame;

[0245] In the event of a checksum error in the first Ethernet frame, the error type of the first Ethernet frame is determined based on the first checksum and the second checksum, wherein the error type includes a forwarding error or a receiving error.

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

[0247] Invert the preset bits in the second check value to obtain the inverted check value;

[0248] The system detects whether the inverted check value is the same as the first check value to obtain a first detection result, and determines the error type based on the first detection result.

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

[0250] If the first detection result is that the inverted check value is the same as the first check value, then the error type is determined to be a forwarding error;

[0251] If the first detection result is that the inverted check value is different from the first check value, then the error type is determined to be a receiving error.

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

[0253] The second check value is checked to see if there is an inverse relationship with the first check value, and a second check result is obtained;

[0254] The error type is determined based on the second detection result.

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

[0256] If the second detection result shows that there is an inverse relationship between the second check value and the first check value, then the error type is determined to be a forwarding error;

[0257] If the second detection result indicates that there is no inverse relationship between the second check value and the first check value, then the error type is determined to be a reception error.

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

[0259] The first check value is replaced in the first Ethernet frame by using the inverted check value to obtain the second Ethernet frame. The inverted check value is obtained by inverting a preset bit in the second check value.

[0260] In the event of a reception error, the transceiver 1410 is controlled to send the second Ethernet frame to a second industrial device in the industrial network.

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

[0262] In the event of a forwarding error, the transceiver 1410 is controlled to send the second Ethernet frame to the second industrial device in the industrial network, or to send the first Ethernet frame to the second industrial device in the industrial network.

[0263] In one embodiment, the first Ethernet frame carries multiple of the first check values.

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

[0265] The error types are stored, and these error types are used to determine the Ethernet frame transmission status based on the error types stored by each industrial device in the industrial network.

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

[0267] In one embodiment, the communication mode of the industrial network is either loopback mode or one-way mode.

[0268] Figure 15 is a schematic diagram of a controller provided in an embodiment of this application. The controller may include a processor 1500, a transceiver 1510, and a memory 1520. The transceiver 1510 is used to receive and transmit data under the control of the processor 1500.

[0269] In Figure 15, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 1500 and memory represented by memory 1520. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface.

[0270] Transceiver 1510 may consist of multiple components, including a transmitter and a receiver, providing a unit for communicating with various other devices over a transmission medium, including wireless channels, wired channels, optical fibers, etc. Processor 1500 is responsible for managing the bus architecture and general processing, and memory 1520 can store data used by processor 1500 during operation.

[0271] The processor 1500 can 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 can also adopt a multi-core architecture.

[0272] Processor 1500 executes the following steps according to the obtained executable instructions by calling the program stored in memory 1520:

[0273] The error type stored in each industrial device in the industrial network is obtained. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a checksum error. The error type is determined by the first checksum carried in the first Ethernet frame and the second checksum is generated based on the first Ethernet frame.

[0274] The Ethernet frame transmission status is determined based on each of the error types described.

[0275] In one embodiment, a data transmission system is provided, including a controller and a plurality of target industrial devices, each target industrial device being configured to perform the steps of the data transmission method for the target industrial device described in the above embodiment, and the controller being configured to perform the steps of the data transmission method for the controller described in the above embodiment.

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

[0277] In one embodiment, a computer-readable storage medium is provided, which may be any available medium or data storage device that can be accessed by a processor, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO) etc.), optical memory (e.g., CD, DVD, BD, HVD etc.), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD) etc.).

[0278] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0279] 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;

[0280] A second checksum is generated based on the first Ethernet frame;

[0281] In the event of a checksum error in the first Ethernet frame, the error type of the first Ethernet frame is determined based on the first checksum and the second checksum, wherein the error type includes a forwarding error or a receiving error.

[0282] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0283] Invert the preset bits in the second check value to obtain the inverted check value;

[0284] The system detects whether the inverted check value is the same as the first check value to obtain a first detection result, and determines the error type based on the first detection result.

[0285] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0286] If the first detection result is that the inverted check value is the same as the first check value, then the error type is determined to be a forwarding error;

[0287] If the first detection result is that the inverted check value is different from the first check value, then the error type is determined to be a receiving error.

[0288] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0289] The second check value is checked to see if there is an inverse relationship with the first check value, and a second check result is obtained;

[0290] The error type is determined based on the second detection result.

[0291] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0292] If the second detection result shows that there is an inverse relationship between the second check value and the first check value, then the error type is determined to be a forwarding error;

[0293] If the second detection result indicates that there is no inverse relationship between the second check value and the first check value, then the error type is determined to be a reception error.

[0294] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:

[0295] The first check value is replaced in the first Ethernet frame by using the inverted check value to obtain the second Ethernet frame. The inverted check value is obtained by inverting a preset bit in the second check value.

[0296] In the event of a reception error, the second Ethernet frame is sent to the second industrial device in the industrial network.

[0297] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:

[0298] In the case of a forwarding error, the second Ethernet frame is sent 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.

[0299] In one embodiment, the first Ethernet frame carries multiple of the first check values.

[0300] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:

[0301] The error types are stored, and these error types are used to determine the Ethernet frame transmission status based on the error types stored by each industrial device in the industrial network.

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

[0303] In one embodiment, the communication mode of the industrial network is either loopback mode or one-way mode.

[0304] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0305] The error type stored in each industrial device in the industrial network is obtained. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a checksum error. The error type is determined by the first checksum carried in the first Ethernet frame and the second checksum is generated based on the first Ethernet frame.

[0306] The Ethernet frame transmission status is determined based on each of the error types described.

[0307] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0308] 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;

[0309] A second checksum is generated based on the first Ethernet frame;

[0310] In the event of a checksum error in the first Ethernet frame, the error type of the first Ethernet frame is determined based on the first checksum and the second checksum, wherein the error type includes a forwarding error or a receiving error.

[0311] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0312] Invert the preset bits in the second check value to obtain the inverted check value;

[0313] The system detects whether the inverted check value is the same as the first check value to obtain a first detection result, and determines the error type based on the first detection result.

[0314] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0315] If the first detection result is that the inverted check value is the same as the first check value, then the error type is determined to be a forwarding error;

[0316] If the first detection result is that the inverted check value is different from the first check value, then the error type is determined to be a receiving error.

[0317] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0318] The second check value is checked to see if there is an inverse relationship with the first check value, and a second check result is obtained;

[0319] The error type is determined based on the second detection result.

[0320] In one embodiment, when the computer program is executed by the processor, it specifically implements the following steps:

[0321] If the second detection result shows that there is an inverse relationship between the second check value and the first check value, then the error type is determined to be a forwarding error;

[0322] If the second detection result indicates that there is no inverse relationship between the second check value and the first check value, then the error type is determined to be a reception error.

[0323] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:

[0324] The first check value is replaced in the first Ethernet frame by using the inverted check value to obtain the second Ethernet frame. The inverted check value is obtained by inverting a preset bit in the second check value.

[0325] In the event of a reception error, the second Ethernet frame is sent to the second industrial device in the industrial network.

[0326] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:

[0327] In the case of a forwarding error, the second Ethernet frame is sent 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.

[0328] In one embodiment, the first Ethernet frame carries multiple of the first check values.

[0329] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:

[0330] The error types are stored, and these error types are used to determine the Ethernet frame transmission status based on the error types stored by each industrial device in the industrial network.

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

[0332] In one embodiment, the communication mode of the industrial network is either loopback mode or one-way mode.

[0333] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0334] The error type stored in each industrial device in the industrial network is obtained. The error type is determined by the industrial device when it receives a first Ethernet frame sent by a first industrial device and the first Ethernet frame has a checksum error. The error type is determined by the first checksum carried in the first Ethernet frame and the second checksum is generated based on the first Ethernet frame.

[0335] The Ethernet frame transmission status is determined based on each of the error types described.

[0336] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0337] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.

[0338] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method of data transmission, wherein, A method for a target industrial device in an industrial network, the method comprising: receiving a first Ethernet frame sent by a first industrial device in the industrial network, the first Ethernet frame carrying a first check value; generating a second check value according to the first Ethernet frame; in a case where the first Ethernet frame is checked to be erroneous, determining an error type of the first Ethernet frame according to the first check value and the second check value, the error type comprising a forwarding error or a receiving error.

2. The method of claim 1, wherein, The determining of the error type of the first Ethernet frame according to the first check value and the second check value comprises: performing an inversion processing on a preset bit in the second check value to obtain an inverted check value; detecting whether the inverted check value is same as the first check value to obtain a first detection result, and determining the error type according to the first detection result.

3. The method of claim 2, wherein, The determining of the error type according to the first detection result comprises: if the first detection result is that the inverted check value is same as the first check value, determining that the error type is the forwarding error; if the first detection result is that the inverted check value is not same as the first check value, determining that the error type is the receiving error.

4. The method of claim 1, wherein, The determining of the error type according to the first check value and the second check value comprises: detecting whether there is an inversion relationship between the second check value and the first check value to obtain a second detection result; determining the error type according to the second detection result.

5. The method of claim 4, wherein, The determining of the error type according to the second detection result comprises: if the second detection result is that there is the inversion relationship between the second check value and the first check value, determining that the error type is the forwarding error; if the second detection result is that there is not the inversion relationship between the second check value and the first check value, determining that the error typeis the receiving error.

6. The method of claim 3 or 5, wherein, The method further comprises: replacing the first check value in the first Ethernet frame with an inverted check value to obtain a second Ethernet frame, the inverted check value being obtained by performing the inversion processing on the preset bit in the second check value; in a case where the error type is the receiving error, sending the second Ethernet frame to a second industrial device in the industrial network.

7. The method of claim 6, wherein, The method further comprises: in a case where the error type is the forwarding error, sending the second Ethernet frame to the second industrial device in the industrial network, or sending the first Ethernet frame to the second industrial device in the industrial network.

8. The method of claim 7, wherein, The first Ethernet frame carries a plurality of the first check values.

9. The method of claim 1, wherein, The method further comprises: storing the error type, the error type being used to determine an Ethernet frame transmission state according to error types stored by respective industrial devices in the industrial network.

10. The method of claim 1, wherein, The first check value is a first CRC value, and the second check value is a second CRC value.

11. The method of claim 1, wherein, A communication mode of the industrial network is a loopback mode or a unidirectional mode.

12. A data transmission method, wherein, A method for a controller in an industrial network, the method comprising: acquire error types stored by each industrial device in the industrial network, the error type being determined according to a first check value carried by a first Ethernet frame and a second check value generated according to the first Ethernet frame in a case that the first Ethernet frame sent by a first industrial device is received by the industrial device and the first Ethernet frame is checked to be erroneous; determine an Ethernet frame transmission state according to each of the error types.

13. A data transmission apparatus, wherein, A device for a target industrial device in an industrial network, the device comprising: a receiving module configured to receive a first Ethernet frame sent by a first industrial device in the industrial network, the first Ethernet frame carrying a first check value; a generating module configured to generate a second check value according to the first Ethernet frame; a determining module configured to determine an error type of the first Ethernet frame according to the first check value and the second check value in a case that the first Ethernet frame is checked to be erroneous, the error type including a forwarding error or a receiving error.

14. A data transmission apparatus, wherein, A device for a controller in an industrial network, the device comprising: an acquiring module configured to acquire error types stored by each industrial device in the industrial network, the error type being determined according to the first check value carried by the first Ethernet frame and the second check value generated according to the first Ethernet frame in a case that the first Ethernet frame sent from a first industrial device is received by the industrial device and the first Ethernet frame is checked to be incorrect, the second check value being generated according to the first Ethernet frame; a determining module configured to determine an Ethernet frame transmission state according to each of the error types.

15. An industrial plant, wherein, comprise a memory, a transceiver, and a processor: the memory is configured to store a computer program; the transceiver is configured to transceive data under control of the processor; and the processor is configured to read the computer program in the memory and perform the following operations: control the transceiver to receive a first Ethernet frame sent by a first industrial device in the industrial network, the first Ether frame carrying a first check value; generate a second check value according to the first Ethernet frame; determine an error type of the first Ethernet frame according to the first check value and the second check value, in a case that the first Ethernet frame is checked to be incorrect, the error type including a forwarding error or a receiving error.

16. A controller, wherein, comprise a memory, a transceiver, and a processor: the memory is configured to storage a computer program; the transceiver is configured to transceive data under control of the processor; the processor is configured to read the computer program in the memory and perform the following operations: acquire error types stored by each industrial device in the industrial network, the error type being determined by a first check value carried by a first Ethernet frame and a second check value generated according to the Ethernet frame in a case that the first Ethernet frame sent by a first industrial device is received by an industrial device and the first Ethernet frame is checked to be incorrect, the second check value being generated by the first Ethernet frame; determine an Ethernet frame transmission state according to each of the error types.

17. A data transmission system wherein, comprise a controller and a plurality of industrial devices; the industrial device is configured to perform steps of the method in any one of claims 1 to 11. The controller is configured to perform the steps of the method of claim 12.

18. A computer readable storage medium having stored thereon a computer program, wherein, The computer program which, when executed by the processor, implements the steps of the method of any one of claims 1 to 12.

19. A computer program product comprising a computer program, wherein, The computer program which, when executed by the processor, implements the steps of the method of any one of claims 1 to 12.