Ethernet communication method, communication system and Ethernet equipment

Through the introduction of logical return information collection operations in the EtherCat protocol, the reserved field indicates that Ethernet executes data collection from standing in the process of recovery from the message, solving the problem of long message transmission time in the existing technology, and improving the transmission efficiency.

CN119363855APending Publication Date: 2025-01-24深圳市三旺通信股份有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411491099.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The existing EtherCAT protocol logical addressing reading information method results in a long message transmission time and reduces transmission efficiency.

Method used

By introducing logical backhaul information collection operations into the Ethernet communication system, the reserved fields in the message frames are used to indicate whether the Ethernet slave station performs data collection operations, and data collection is only performed during the message return process, thus saving the outbound journey. Message processing time.

Benefits of technology

It improves the transmission efficiency and reduces the transmission time of equipment data, and is suitable for application fields such as industrial automation control and information collection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363855A_ABST
    Figure CN119363855A_ABST
Patent Text Reader

Abstract

The invention relates to the field of communication, and discloses an Ethernet communication method, a communication system and Ethernet equipment. When the method is applied to an Ethernet slave station in a communication system, the method comprises the following steps: if a first message frame sent by an Ethernet master station or a previous Ethernet slave station is received, analyzing the first message frame to identify a reserved field in a protocol data unit header field in the first message frame; based on the value of the reserved field, determining whether a logic backhaul information collection operation is executed currently; if it is determined that the logic backhaul information acquisition operation is executed at present, obtaining corresponding equipment data; and filling the data domain of the second message frame to be returned with the equipment data, and returning the second message frame to the previous Ethernet slave station or the Ethernet master station. According to the invention, the value of the reserved field is set to indicate each Ethernet slave station to execute the logic backhaul information acquisition operation, so that the processing time of the outbound message in the communication link is saved, and the transmission efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to an Ethernet communication method, a communication system and an Ethernet device. Background Art

[0002] At present, the EtherCAT (Ethernet for Control Automation Technology) protocol can be used in the field of industrial control (such as manufacturing, energy industry, petrochemical industry, power collection, etc.) to realize logical addressing and reading information. However, the logical addressing and reading information method in the existing EtherCAT protocol easily leads to a long transmission time of the message in the communication link and reduces the transmission efficiency of the message. Summary of the invention

[0003] In view of this, in order to solve the problems existing in the prior art, the present application provides an Ethernet communication method, a communication system and an Ethernet device.

[0004] In a first aspect, the present application provides an Ethernet communication method, which is applied to an Ethernet slave station in a communication system, wherein the communication system includes an Ethernet master station and a plurality of Ethernet slave stations, and the method includes:

[0005] If a first message frame sent by the Ethernet master station or the previous Ethernet slave station is received, the first message frame is parsed to identify a reserved field in a protocol data unit header field in the first message frame;

[0006] Based on the value of the reserved field, determining whether a logical backhaul information collection operation is currently being performed;

[0007] If it is determined that the logical return information collection operation is currently being performed, then obtaining corresponding device data;

[0008] Fill the device data into the data field of the second message frame to be returned, and return the second message frame to the previous Ethernet slave station or the Ethernet master station; the second message frame is a return message obtained based on the first message frame.

[0009] In an optional implementation manner, if it is determined that the current Ethernet slave station is the last slave station in the communication system, before filling the device data into the data field of the second message frame to be returned, it also includes:

[0010] Reading a value of a length field in a protocol data unit header field of the first message frame, and applying for storage space according to the value of the length field;

[0011] The storage space is added in the data field of the second message frame; the storage space is used to store the device data to be returned by each of the Ethernet slave stations.

[0012] In an optional implementation manner, filling the device data into a data field of a second message frame to be returned includes:

[0013] Determining a first position order of a current Ethernet slave station within the communication system;

[0014] Determine, according to the first position order, a second position order in which the device data is stored in a data field of a second message frame to be transmitted back;

[0015] According to the second position order, the device data is stored in the data field of the second message frame.

[0016] In an optional embodiment, the first position order is inverse to the second position order.

[0017] In an optional implementation manner, the determining whether to currently perform a logical backhaul information collection operation based on the value of the reserved field includes:

[0018] Determine whether the value of the reserved field is a target value;

[0019] If so, determining that the current logical return information collection operation is being performed;

[0020] If not, it is determined that the logic backhaul information collection operation is not currently executed.

[0021] In an optional implementation manner, if it is determined that the logical backhaul information collection operation is not currently performed, the method further includes:

[0022] Based on the first message frame, the device data is acquired to add the device data to the first message frame, and the first message frame after the data is added is forwarded to the next Ethernet slave station;

[0023] The third message frame to be returned is directly forwarded to the previous Ethernet slave station or the Ethernet master station.

[0024] In a second aspect, the present application provides an Ethernet communication method, which is applied to an Ethernet master station in a communication system, wherein the communication system includes an Ethernet master station and a plurality of Ethernet slave stations, and the method includes:

[0025] Creating a first message frame, and setting a value of a reserved field in a protocol data unit header field in the first message frame to a target value;

[0026] Sending the first message frame, wherein the first message frame passes through each of the Ethernet slave stations in sequence;

[0027] A second message frame is received, where the second message frame is a return message obtained after each of the Ethernet slave stations performs a logical return information collection operation on the first message frame.

[0028] In an optional embodiment, it also includes:

[0029] Parsing the second message frame to read the working count value in the second message frame;

[0030] Determining whether the working count value is equal to the target count value;

[0031] If yes, determining that the second message frame is a normal frame;

[0032] If not, it is determined that the second message frame is an abnormal frame.

[0033] In a third aspect, the present application provides a communication system, including:

[0034] An Ethernet master station, used to execute the aforementioned Ethernet communication method;

[0035] A plurality of Ethernet slave stations are respectively used to execute the aforementioned Ethernet communication method.

[0036] In a fourth aspect, the present application provides an Ethernet device, the Ethernet device comprising a processor and a memory, the memory storing a computer program, and the processor being configured to execute the computer program to implement the aforementioned Ethernet communication method.

[0037] The embodiments of the present application have the following beneficial effects:

[0038] The embodiment of the present application provides an Ethernet communication method, which, when applied to an Ethernet slave station in a communication system, includes: if a first message frame sent by an Ethernet master station or a previous Ethernet slave station is received, the first message frame is parsed to identify a reserved field in a protocol data unit header field in the first message frame; based on the value of the reserved field, whether a logical return information collection operation is currently being performed is determined; if it is determined that a logical return information collection operation is currently being performed, the corresponding device data is obtained; the device data is filled into the data field of a second message frame to be returned, and the second message frame is returned to the previous Ethernet slave station or Ethernet master station; the second message frame is a return message obtained based on the first message frame. The embodiment of the present application instructs each Ethernet slave station to perform a logical return information collection operation by setting the value of the reserved field, thereby saving the processing time of the outbound message in the communication link and improving the transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. For ordinary technicians in this field, other related drawings can also be obtained based on these drawings without creative work.

[0040] Figure 1 A schematic diagram of the structure of a communication system in an embodiment of the present application is shown;

[0041] Figure 2 A schematic diagram of a scenario in which a message is transmitted between an Ethernet master station and each Ethernet slave station in a communication system in an embodiment of the present application is shown;

[0042] Figure 3 A schematic diagram of the frame structure of an Ethernet message frame in the prior art is shown;

[0043] Figure 4 A schematic diagram of the frame structure of a first message frame in an embodiment of the present application is shown;

[0044] Figure 5 A schematic diagram showing a flow chart of an Ethernet master station executing an Ethernet communication method in an embodiment of the present application is shown;

[0045] Figure 6 A schematic diagram of a flow chart of an Ethernet slave station executing an Ethernet communication method in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0047] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0048] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0049] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0050] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0051] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0052] Please refer to Figure 1 and Figure 2 The present application provides a communication system, which includes an Ethernet master station 100 and several Ethernet slave stations 200; wherein the Ethernet master station 100 refers to an EtherCAT master station, and the Ethernet slave station 200 refers to an EtherCAT slave station, that is, the communication system in this embodiment is implemented based on the EtherCAT protocol; wherein the Ethernet master station 100 can send corresponding message frames to each Ethernet slave station 200 to realize two-way data transmission between the Ethernet master station 100 and each Ethernet slave station 200.

[0053] It is worth noting that this embodiment introduces a logical return read mechanism during the data transmission process between the Ethernet master station 100 and each Ethernet slave station 200 to improve the transmission efficiency during the information or data collection process. In addition, since the purpose of this application is only to improve the execution timing of the data read command in the message frame, in order to more intuitively and concisely illustrate the technical principle of this application, the first message frame in all the embodiments shown in this application can be regarded as a message frame containing only the data read command.

[0054] For example, Figure 3As shown, the frame structure of a conventional Ethernet message frame includes an Ethernet frame header, a payload (i.e., Payload), and an Ethernet frame tail; wherein the header field of the protocol data unit in the payload (i.e., the PDU header) includes a length field (Length field), a reserved field (Reserved field), and a type field (Type field); the protocol data unit (i.e., PDU1) includes a command field (CMD), an index field (IDX), an address field (ADP) configured by the slave in the address field (ADR) and an address field (ADO) of a target register in the slave, a length field (LEN), a reserved field (Reserved), an indication field (C) for indicating whether the current frame is a periodic frame, an indication field (NEXT) for indicating the index of the next periodic frame, an indication field (TRQ) for indicating whether the slave needs to perform the requested operation, a data field (DATA), and a work count value (WKC).

[0055] In this embodiment, the frame structure of the Ethernet message frame sent by the Ethernet master station 100 is adjusted to enable the reserved field in the protocol data unit header field. By configuring the value of the reserved field, it is indicated whether the logical return information collection operation is supported, thereby efficiently realizing the information collection of logical addressing and improving the transmission efficiency of the message frame.

[0056] like Figure 4 As shown, when creating a message frame, the Ethernet master station 100 realizes the logical return read function by adjusting the reserved field in the header field of the protocol data unit in the message frame structure; specifically, this embodiment makes full use of the reserved field (Reserved field) of the PDU header field to configure the value of the reserved field, and then indicates whether the Ethernet slave station 200 that receives the message frame performs a logical return information collection operation based on the configuration value of the reserved field; wherein, the logical return information collection operation can enable each Ethernet slave station 200 to perform data collection again during the message backhaul process The operation (i.e., data read command) indicates that each Ethernet slave station 200 does not execute the data read command in the message frame during the message outbound process, but executes the data read command again during the message return process to obtain the corresponding device data, and returns the device data to the Ethernet master station 100, so that the device data collection work is implemented during the message return process, ensuring the real-time acquisition and transmission of device data, so that the Ethernet master station 100 can receive the real-time data collected by each Ethernet slave station 200, reducing the data transmission time of each Ethernet slave station 200 and improving the efficiency of data transmission.

[0057] Exemplarily, in the process of realizing bidirectional communication between the Ethernet master station 100 and each Ethernet slave station 200, the Ethernet master station 100 creates a first message frame and sets a reserved field of a header field in a protocol data unit of the first message frame to a target value. When the reserved field is configured as the target value, it is used to instruct the Ethernet slave station 200 that receives the message frame to perform a logical return information collection operation on the message frame.

[0058] Among them, when configuring the value of the reserved field, each value and the meaning corresponding to the value can be adaptively set according to actual needs; for example, when the value of the reserved field can be set to 1, it means that the message frame supports the logical return information collection operation; if the value of the reserved field is 0, it means that the message frame does not support the logical return information collection operation; and then, the target value corresponds to 1. Furthermore, if the reserved field of the message frame is configured as the target value, it indicates that the several Ethernet slave stations 200 that receive the message frame can only execute the data read command carried by the message frame during the message return process; if the reserved field of the message frame is not configured as the target value, each Ethernet slave station 200 that receives the message frame can execute the data read command after receiving the message frame, without waiting for the message return.

[0059] In some examples, the first message frame sent by the Ethernet master station 100 can be set to not contain any data information, that is, the data field of the first message frame sent by the master station is set to empty, so as to reduce the data volume and message length of the first message frame on the outbound journey, thereby shortening the transmission time of the message frame in the communication link and each slave station on the outbound journey, thereby improving transmission efficiency.

[0060] Furthermore, when creating the first message frame, the Ethernet master station 100 only enables other fields (such as ADR, CMD, LEN, etc.) in the protocol data unit (i.e., PDU) that are not in the data domain in the first message frame, wherein the message frame is used to instruct each Ethernet slave station 200 to execute a data read command to obtain device data of a corresponding length (such as sensor readings, status information, etc.) from itself, and transmit the device data back, so that each Ethernet slave station 200 performs corresponding processing on the first message frame according to the configuration values ​​of each field in the PDU.

[0061] It can be understood that the Ethernet master station 100 creates a first message frame and sets the Reserved field in the first message frame to 1, indicating that the logical return information collection operation is supported. Subsequently, the Ethernet master station 100 sends the first message frame, the total length of which is determined according to the specific requirements of the message (at least 64 bytes, or the minimum packet length supported by the device), and the data field of the message frame is empty.

[0062] Furthermore, the first message frame passes through each Ethernet slave station 200 in sequence, and after each Ethernet slave station 200 receives the first message frame, it determines whether to perform a logic return information collection operation according to the value of a reserved field in the first message frame.

[0063] That is, each Ethernet slave station 200 can receive the first message frame sent from the Ethernet master station 100 or the previous Ethernet slave station 200, wherein, if the current Ethernet slave station 200 is the first slave station in the communication system, the first message frame received by itself is the original message frame sent by the Ethernet master station 100; if the current Ethernet slave station 200 is an intermediate slave station or the last slave station, the first message frame received is the message frame forwarded by the previous Ethernet slave station 200.

[0064] After receiving the first message frame, each Ethernet slave station 200 parses the first message frame, and then identifies the reserved field in the protocol data unit header field in the first message frame to determine whether the value of the reserved field is the target value; if the value of the reserved field is the target value, it is determined that the logical return information collection operation is currently being performed; if it is determined that the reserved field is not the target value, it is determined that the logical return information collection operation is not currently being performed.

[0065] Furthermore, if it is determined that the value of the reserved field is the target value, the current Ethernet slave station 200 performs a logical feedback information collection operation, and the data read command within the first message frame is not executed at present, but the first message frame is directly passed to the next Ethernet slave station 200 until it reaches the last Ethernet slave station 200.

[0066] After the last Ethernet slave station 200 receives the first message frame, since the data field of the first message frame is empty, it first reads the value of the length field (Length) in the protocol data unit header field in the first message frame, and applies for storage space according to the value of the length field, such as Figure 4 As shown, the value of the length field can be set to 800 bits, etc., wherein the value of the length field can be set accordingly according to actual needs, and this embodiment does not limit this.

[0067] Then, the applied storage space is added to the data field of the first message frame, and the storage space is used to store the device data collected by each Ethernet slave station 200 after executing the data read command. Then, the last Ethernet slave station 200 executes the data read command in the first message frame to collect the corresponding device data, and adds the device data to the corresponding position of the storage space in the data field of the first message frame, thereby completing the data collection of the current Ethernet slave station 200.

[0068] Furthermore, when the last Ethernet slave station 200 completes data collection, the first message frame containing the device data is returned to the Ethernet master station 100 through the reverse path through each Ethernet slave station 200 in sequence. In this embodiment, for the convenience of distinction, the first message frame in the return process is used as the second message frame; further, in the return process, each Ethernet slave station 200 executes a data read command to add the device data collected by itself to the corresponding position of the data field of the message frame until the Ethernet master station 100 receives the message frame containing the device data of all Ethernet slave stations 200.

[0069] It can be understood that if the message frame indicates that a logical feedback information collection operation needs to be performed, then during the message feedback process, each Ethernet slave station 200 receives the second message frame returned by the next Ethernet slave station 200, and then executes a data read command on the second message frame to obtain the device data, and adds the device data to the corresponding position in the storage space of the data field in the second message frame, and then returns the second message frame with the added device data to the previous Ethernet slave station 200 until it finally reaches the Ethernet master station 100.

[0070] In some examples, the position where the device data of each Ethernet slave station 200 is added to the second message frame can be determined according to the position order of each Ethernet slave station 200 itself in the communication system. Furthermore, when each Ethernet slave station 200 adds device data to the returned message frame, it determines the first position order of the current Ethernet slave station 200 in the communication system; then, according to the first position order, it determines the second position order in which the device data is stored in the data field of the second message frame; and then, according to the second position order, the device data is stored in the data field of the second message frame. Among them, the first position order can be the inverse of the second position order, or the first position order is equal to the second position order. The position storage relationship of the device data of each Ethernet slave station 200 can be set accordingly according to actual needs, and this embodiment does not limit this.

[0071] Optionally, the first position order may be the reverse of the second position order. That is, the device data of the last slave station may be stored as the first device data in the data field of the second message frame, that is, the device data of the last slave station is placed at the first position in the data field of the second message frame, and so on, the device data of the first slave station is placed at the end of the data field of the second message frame.

[0072] In one embodiment, each time each Ethernet slave station 200 executes an operation command carried in a message, the corresponding work count value in the message will increase according to the number of command executions. Therefore, the abnormality check of the message can be achieved through the work count value inside the message.

[0073] Furthermore, the Ethernet master station 100 can also perform an abnormality detection on the received second message frame to determine that the received second message frame is not an abnormal frame. After receiving the second message frame, the Ethernet master station 100 parses the second message frame to read the working count value in the second message frame; determines whether the message frame is abnormal based on the comparison result between the working count value and the target count value; and because the second message frame is a message frame containing the device data of all Ethernet slave stations 200, it can be determined whether the communication link is complete based on the abnormality check result of the second message frame, that is, the integrity check of the communication link is realized.

[0074] It can be understood that if the Ethernet master station 100 receives a second message frame containing device data of each Ethernet slave station 200, the second message frame can be parsed to obtain information for determining the position order of all Ethernet slave stations 200 (such as target slave station identification, address, etc.), and then the total number of all Ethernet slave stations 200 in the communication system is determined based on the information; then, the cumulative value of the corresponding working count value of each Ethernet slave station 200 when executing the corresponding operation command between the last slave station and the first slave station is calculated based on the total number; wherein the cumulative value of the working count value indicates the total number of times each slave station completes the corresponding operation command in the process of the second message frame passing through each slave station in sequence from the last slave station and finally being transmitted back to the first slave station.

[0075] Furthermore, it is determined whether the working count value is equal to the target count value. If it is determined that the working count value is not equal to the target count value, it means that the second message frame is abnormal and the communication link is incomplete; otherwise, it means that the second message frame is normal and the communication link is complete.

[0076] Obviously, this embodiment instructs each Ethernet slave station 200 to perform a logical return information collection operation by setting the value of the reserved field, thereby saving the processing time of the outbound message in the communication link and improving the transmission efficiency. At the same time, the data field of the outbound message is set to empty to reduce the length and data volume of the outbound message, and after the last slave station receives the outbound message, it requests sufficient storage space to store the data based on the value of the length field in the message frame. Therefore, during the message return process, the collected device data is directly inserted into the requested storage space in the message frame, without the need for additional data exchange, which significantly reduces the message processing time and message load.

[0077] Furthermore, the detailed process of the above communication system performing Ethernet communication can refer to the following embodiment of the Ethernet communication method.

[0078] For reference, when the Ethernet communication method is applied to an Ethernet master station 100 within a communication system, the Ethernet master station 100 can pre-configure a reserved field in the first message frame to enable the Ethernet slave station 200 to perform a logical return information collection operation according to the value of the reserved field, thereby optimizing the process of logical addressing and reading information, reducing the transmission time of data after collection, and improving the overall system performance.

[0079] For example, Figure 5 As shown, the Ethernet master station 100 may include the following steps in the process of performing Ethernet communication:

[0080] S110: Create a first message frame, and set the value of a reserved field in a protocol data unit header field in the first message frame to a target value.

[0081] S120 , sending a first message frame, wherein the first message frame passes through each Ethernet slave station 200 in sequence.

[0082] S130, receiving a second message frame, wherein the second message frame is a message frame returned after each Ethernet slave station 200 performs a logical return information collection operation on the first message frame.

[0083] The Ethernet master station 100 creates a first message frame. During this process, the data field of the first message frame is set to empty, and the reserved field of the protocol data unit in the first message frame is set to a target value, which is used to instruct each Ethernet slave station 200 to perform a logical backhaul information collection operation.

[0084] After the first message frame is sent down by the Ethernet master station 100, it is forwarded to the next Ethernet slave station 200 in sequence through each Ethernet slave station 200. Each Ethernet slave station 200 performs a logical return information collection operation according to the value of the reserved field in the first message frame, that is, the data collection operation is performed only during the message return process, and the collected device data is added to the return message (i.e., the second message frame). Each device data is returned to the Ethernet master station 100 through each Ethernet slave station 200 in sequence along with the return message.

[0085] Correspondingly, when the Ethernet slave station 200 in the communication system executes the Ethernet communication method, each Ethernet slave station 200 can determine whether to perform a logical return information collection operation based on the value of a reserved field in the message frame sent by the Ethernet master station 100, thereby improving data transmission efficiency by performing a logical return information collection operation.

[0086] For example, Figure 6 As shown, the Ethernet slave station 200 can specifically perform the following steps during the Ethernet communication process:

[0087] S210: If a first message frame sent by the Ethernet master station 100 or the previous Ethernet slave station 200 is received, the first message frame is parsed to identify a reserved field in a protocol data unit header field in the first message frame.

[0088] Among them, the data field in the first message frame is empty.

[0089] S220: Determine whether to currently perform a logical backhaul information collection operation based on the value of the reserved field.

[0090] S230: If it is determined that the logical return information collection operation is currently being performed, corresponding device data is obtained.

[0091] S240 , filling the device data into the data field of the second message frame to be returned, and returning the second message frame to the previous Ethernet slave station 200 or the Ethernet master station 100 .

[0092] When each Ethernet slave station 200 receives an outbound message (i.e., the first message frame), it determines whether to perform a logical return information collection operation based on the value of a reserved field in the protocol data unit header field in the first message frame; wherein, if the value of the reserved field is a target value, it is determined to perform a logical return information collection operation, so as to perform a data collection operation on the return message during the message return process.

[0093] Furthermore, after completing the data collection operation in the backhaul process, each Ethernet slave station 200 adds the collected device data to the backhaul message (second message frame), and transmits the second message frame with the added data back to the previous Ethernet slave station 200 or the Ethernet master station 100. The second message frame passes through each Ethernet slave station 200 in turn and finally reaches the Ethernet master station 100.

[0094] In one embodiment, if the value of the reserved field in the protocol data unit header field in the first message frame is not the target value, each Ethernet slave station 200 processes the first message frame according to the normal message processing mechanism (i.e., the normal communication mechanism), that is, directly performs the data acquisition operation during the message outbound process. After receiving the first message frame, each Ethernet slave station 200 obtains the device data based on the first message frame to add the device data to the first message frame, and then forwards the first message frame with the added data to the next Ethernet slave station 200; and then, in the message backhaul process, directly forwards the received second message frame to be returned to the previous Ethernet slave station 200 or the Ethernet master station 100, without processing the second message frame.

[0095] It can be understood that in this embodiment, the value of the reserved field in the message frame is set accordingly to indicate whether the logical return information collection operation is supported when the message frame is sent. In addition, the last slave station can also be set to apply for additional storage space according to the length field in the message frame to store the device data collected by each Ethernet slave station 200.

[0096] Furthermore, after the last slave station receives the message frame, it parses the message frame to determine that the reserved field is the target value, which means that the message frame supports the logical return information collection operation. At this time, the last slave station will apply for all the required storage space according to the length field of the protocol data unit header field to store the device data, and after completing the data collection, the device data is stored in the storage space, and the message frame with the added data is returned to the previous Ethernet slave station 200. Then, during the message return process, each Ethernet slave station 200 performs the data collection operation, and after completing the data collection, the collected device data is pushed into the return message until the return message reaches the Ethernet master station 100.

[0097] Therefore, during the communication process, starting from the last slave station, the logical return information collection operation of the message is executed in a predetermined order (from the last slave station to the first slave station), which effectively reduces the transmission time of the device data, thereby significantly improving the time efficiency of the entire data collection process. The logical addressing return information collection saves the time for the outbound message to be transmitted in the communication link and the slave station, thereby improving the transmission efficiency.

[0098] For example, if the length of the outbound message (i.e., corresponding to the first message frame) is 800 bytes, when each Ethernet slave station 200 passes through receives and forwards the message according to the normal communication mechanism and at a rate of 100Mbps, the processing time of each Ethernet slave station 200 for the outbound message is: 800Byte*8 / (100000000bps)=0.000064s=64us; further, if the communication system includes 100 Ethernet slave stations 200, the total processing time of these 100 slave stations is approximately 64us*100=6.4ms; further, since this embodiment does not process the outbound message, but only processes the return message, this embodiment can enable these 100 slave stations to save approximately 6.4ms of transmission time when transmitting an 800-byte message frame round trip for one cycle.

[0099] Moreover, in the present embodiment, before returning the message, the last slave station applies for storage space according to the value of the length field of the outbound message, and then performs logically addressed data collection, and on the return journey, pushes the collected device data into the return message before returning the message, thereby making the transmission time of the message in the communication system less than the processing time of the outbound message, thereby improving the message processing efficiency, so that the communication system can be applied to application scenarios such as chain topology communication with a large number of slave stations and a relatively long collection data.

[0100] Based on this, this embodiment reduces the transmission time of long outbound messages between the communication link and each slave station by implementing a logical return information collection operation, thereby improving the overall transmission efficiency, optimizing the response time of the communication system, and significantly improving the efficiency of logical addressing and reading information, so that the communication system can be applied to multiple application fields such as industrial automation control and information collection, and is particularly suitable for complex network environments with long messages and multiple slave stations, and has important practical application value and broad market prospects.

[0101] The present application also provides an Ethernet device, which includes but is not limited to network devices (such as hubs, switches, routers and repeaters, etc.), controllers, actuators, sensors, etc.; illustratively, the Ethernet device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the Ethernet device to execute the above-mentioned Ethernet communication method.

[0102] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0103] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0104] The present application also provides a computer storage medium for storing the computer program used in the above Ethernet device. For example, the computer readable storage medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0105] In several embodiments provided in the present application, it should be understood that the disclosed system and method can also be implemented in other ways. The system embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] In addition, each step in each embodiment of the present application can be implemented by a functional module or unit, and the functional modules or units can be integrated together to form an independent part, or each module or unit can exist separately, or two or more modules or units can be integrated to form an independent part.

[0107] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable an Ethernet device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0108] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An Ethernet communication method, characterized in that: Applied to an Ethernet slave station in a communication system, the communication system comprising an Ethernet master station and a plurality of Ethernet slave stations, the method comprising: If a first message frame sent by the Ethernet master station or the previous Ethernet slave station is received, the first message frame is parsed to identify a reserved field in a protocol data unit header field in the first message frame; Based on the value of the reserved field, determining whether a logical backhaul information collection operation is currently being performed; If it is determined that the logical return information collection operation is currently being performed, then obtaining corresponding device data; Fill the device data into the data field of the second message frame to be returned, and return the second message frame to the previous Ethernet slave station or the Ethernet master station; the second message frame is a return message obtained based on the first message frame.

2. The Ethernet communication method according to claim 1, characterized in that: If it is determined that the current Ethernet slave station is the last slave station in the communication system, before filling the device data into the data field of the second message frame to be returned, the method further includes: Reading a value of a length field in a protocol data unit header field of the first message frame, and applying for storage space according to the value of the length field; The storage space is added in the data field of the second message frame; the storage space is used to store the device data to be returned by each of the Ethernet slave stations.

3. The Ethernet communication method according to claim 1 or 2, characterized in that: The step of filling the device data into the data field of the second message frame to be returned includes: Determining a first position order of a current Ethernet slave station within the communication system; Determine, according to the first position order, a second position order in which the device data is stored in a data field of a second message frame to be transmitted back; According to the second position order, the device data is stored in the data field of the second message frame.

4. The Ethernet communication method according to claim 3, characterized in that: The first position order is the reverse of the second position order.

5. The Ethernet communication method according to claim 1, characterized in that: The determining, based on the value of the reserved field, whether to currently perform a logical backhaul information collection operation includes: Determine whether the value of the reserved field is a target value; If so, determining that the current logical return information collection operation is being performed; If not, it is determined that the logic backhaul information collection operation is not currently executed.

6. The Ethernet communication method according to claim 1, characterized in that: If it is determined that the logic backhaul information collection operation is not currently performed, the method further includes: Based on the first message frame, the device data is acquired to add the device data to the first message frame, and the first message frame after the data is added is forwarded to the next Ethernet slave station; The third message frame to be returned is directly forwarded to the previous Ethernet slave station or the Ethernet master station.

7. An Ethernet communication method, characterized in that: Applied to an Ethernet master station in a communication system, the communication system comprising an Ethernet master station and a plurality of Ethernet slave stations, the method comprising: Creating a first message frame, and setting a value of a reserved field in a protocol data unit header field in the first message frame to a target value; Sending the first message frame, wherein the first message frame passes through each of the Ethernet slave stations in sequence; A second message frame is received, where the second message frame is a return message obtained after each of the Ethernet slave stations performs a logical return information collection operation on the first message frame.

8. The Ethernet communication method according to claim 7, characterized in that: Also includes: Parsing the second message frame to read the working count value in the second message frame; Determining whether the working count value is equal to the target count value; If yes, determining that the second message frame is a normal frame; If not, it is determined that the second message frame is an abnormal frame.

9. A communication system, characterized in that: include: An Ethernet master station, configured to execute the Ethernet communication method according to any one of claims 7 to 8; A plurality of Ethernet slave stations, each used to execute the Ethernet communication method according to any one of claims 1 to 6.

10. An Ethernet device, characterized in that: The Ethernet device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the Ethernet communication method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Communication method, system and equipment based on improved Ethercat protocol

    CN120567953A