Method, Electronic Device, and Program Product for Communication in an EPA Network

By using the EPA master clock device in the EPA network to send periodic messages of priority and occupancy length to multiple EPA devices, and scheduling non-periodic messages, the traditional EPA network bus bandwidth and real-time problems are solved, and efficient and real-time data communication is achieved.

CN119383031BActive Publication Date: 2025-06-24ZHEJIANG GUOLI XINAN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411991276.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-06-24
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Due to the bus arbitration mechanism of the master nodes in turn, traditional EPA networks have low effective bandwidth and data communication efficiency, and cannot guarantee the real-time nature of data communication.

Method used

The EPA master clock device sends periodic messages of priority and occupancy length to multiple EPA devices, and schedules non-periodic messages sent by multiple EPA devices to avoid the master nodes being named one by one, improve the bus bandwidth and ensure real-time.

Benefits of technology

It improves the effective bus bandwidth of the EPA network, ensures the real-time nature of data communication, and meets the needs of high bandwidth and low latency communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383031B_ABST
    Figure CN119383031B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, an electronic device, and a program product for communication in an EPA network. The method is used for an EPA master clock device in the EPA network and includes: generating a plurality of first messages for a plurality of EPA devices, where the first messages include the priority and occupancy length of second messages to be sent by the EPA devices, and the plurality of EPA devices are respectively connected through a bus in the EPA network; sending the generated plurality of first messages to the plurality of EPA devices through the bus; and receiving a plurality of second messages from the plurality of EPA devices through the bus, where the second messages are sent by the EPA devices to the bus according to the priority and occupancy length in the first messages. The present invention can improve the effective bandwidth of the bus while ensuring the real-time performance of data communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention generally relate to the field of communications, and more particularly to a method, an electronic device, and a program product for communication in an EPA network. Background Art

[0002] The Industrial Automation Ethernet (EPA) bus is a real-time Ethernet bus designed based on the network communication requirements of industrial control systems and implemented based on the Ethernet physical layer. In an EPA network, each network node needs to be connected together using network cables, and there are various restrictions on the wiring rules. Once the connection is incorrect, it will cause message collisions, resulting in abnormal conditions such as error codes and packet loss. To solve this problem, in the traditional method, a master-slave protocol stack is implemented on the bus to implement a bus arbitration mechanism, thereby avoiding bus data collisions. However, in this traditional method, the master node needs to poll each slave node in turn to communicate with it, resulting in a decrease in the effective bandwidth of the bus. Moreover, due to the polling cycle of the master node, it is impossible to guarantee the real-time performance of data communication.

[0003] In summary, the deficiencies of the traditional EPA network are as follows: due to the bus arbitration mechanism of the master node polling each slave node in turn, the effective bandwidth of the bus and the efficiency of data communication are relatively low. Summary of the Invention

[0004] In view of the above problems, the present invention provides a method, an electronic device, and a program product for communication in an EPA network. In this method, the EPA master clock device can send priorities and occupancy lengths to multiple EPA devices through periodic messages, thereby scheduling the non-periodic messages sent by the multiple EPA devices, realizing the communication between the multiple EPA devices and the EPA master clock device, avoiding the EPA master clock device polling each of the multiple EPA devices one by one, and while improving the effective bandwidth of the bus, ensuring the real-time performance of data communication.

[0005] According to a first aspect of the present invention, there is provided a method for communication in an EPA network, for an EPA master clock device in an EPA network, including: generating a plurality of first messages for a plurality of EPA devices, where the first messages include the priorities and occupancy lengths of second messages to be sent by the EPA devices, and the plurality of EPA devices are respectively connected through a bus in the EPA network; sending the generated plurality of first messages to the plurality of EPA devices through the bus; and receiving a plurality of second messages from the plurality of EPA devices through the bus, where the second messages are sent by the EPA devices to the bus according to the priorities and occupancy lengths in the first messages.

[0006] In some embodiments, the EPA network is based on macro - cycle communication. The first message includes periodic messages, and sending the generated multiple first messages to multiple EPA devices via the bus includes: determining the sending times of the multiple periodic messages of the multiple EPA devices, where the sending times of the multiple periodic messages are within the cycle time of the macro - cycle; and sending the multiple periodic messages to the multiple EPA devices according to the determined sending times of the multiple periodic messages.

[0007] In some embodiments, the second message includes aperiodic messages received by the EPA master clock device during the aperiodic time of the macro - cycle, and generating the multiple first messages for the multiple EPA devices includes: determining the priorities and occupancy lengths of the multiple aperiodic messages according to the types of the multiple aperiodic messages to be sent by the multiple EPA devices; and generating the multiple periodic messages for the multiple EPA devices according to the determined priorities and occupancy lengths of the multiple aperiodic messages.

[0008] In some embodiments, determining the priorities and occupancy lengths of the multiple aperiodic messages according to the types of the multiple aperiodic messages to be sent by the multiple EPA devices includes: determining the priorities of the multiple aperiodic messages according to the types of the multiple aperiodic messages to be sent by the multiple EPA devices; determining whether there are collisions between the priorities of the multiple aperiodic messages; in response to there being collisions between the priorities of the multiple aperiodic messages, obtaining the addresses of the EPA devices corresponding to the aperiodic messages with collisions; and adjusting the priorities of the aperiodic messages with collisions based on the obtained addresses of the EPA devices.

[0009] In some embodiments, sending the generated multiple first messages to multiple EPA devices via the bus includes: obtaining, through the link - layer interface in the EPA master clock device, the first message for sending to the EPA device from the EPA protocol stack in the EPA master clock device, where the first message is generated by the EPA protocol stack based on the priority and occupancy length of the second message to be sent by the EPA device; obtaining the first timestamp from the timer in the EPA master clock device; generating, through the encoder in the EPA master clock device, the encoding of the first message and the first timestamp, where the encoding of the first message and the first timestamp is in a multi - bit - width format; converting, through the serializer in the EPA master clock device, the generated encoding of the first message and the first timestamp into a serial format to generate a scheduling frame; and sending the generated scheduling frame to the EPA device through the physical - layer interface connected to the bus in the EPA master clock device.

[0010] In some embodiments, receiving multiple second messages from multiple EPA devices via a bus includes: receiving an EPA data frame from an EPA device via a physical layer interface connected to the bus in an EPA master clock device, where the EPA data frame includes a clock recovery code, a frame start code, a data code, a frame end code, and an idle status code; determining a second message of the EPA device based on the received EPA data frame; and obtaining the determined second message by an EPA protocol stack in the EPA master clock device via a link layer interface.

[0011] In some embodiments, determining a second message of an EPA device based on the received EPA data frame includes: sampling the EPA data frame by a clock in the EPA master clock device based on the clock recovery code in the received EPA data frame to obtain an EPA data frame in digital format; converting the data code in the sampled EPA data frame into a multi-bit width format by a deserializer in the EPA master clock device based on the frame start code and the frame end code in the sampled EPA data frame, where the data code converted into the multi-bit width format is aligned by the frame start code; determining a second message of the EPA device by a decoder in the EPA master clock device based on the converted data code; and obtaining the determined second message of the EPA device from the decoder by an EPA protocol stack in the EPA master clock device via a link layer interface.

[0012] In some embodiments, the data code of the EPA data frame includes an encoding of a second message and a first timestamp, and the method further includes: obtaining the first timestamp by a decoder in the EPA master clock device based on the converted data code; determining a first delay for the EPA master clock device to process data and a second delay for the EPA device to process data; and updating the first timestamp in a timer based on the determined first delay and second delay.

[0013] In some embodiments, sampling the EPA data frame by a clock in the EPA master clock device based on the clock recovery code in the received EPA data frame to obtain an EPA data frame in digital format includes: detecting a signal of the EPA data frame sent by the EPA device via multiple clocks in the EPA master clock device; in response to a first clock among the multiple clocks first detecting the signal, determining a second clock corresponding to the first clock among the multiple clocks based on a preset phase difference; and sampling the EPA data frame by the determined second clock based on the clock recovery code in the received EPA data frame to obtain an EPA data frame in digital format.

[0014] In some embodiments, sampling the EPA data frame based on the clock restoration code in the received EPA data frame by the determined second clock to obtain the EPA data frame in digital format includes: determining the sampling period of the second clock, the first jitter time, and the second jitter time of the clock in the EPA device; determining the oversampling multiple of the second clock based on the determined sampling period, the first jitter time, and the second jitter time; and sampling the EPA data frame by the second clock based on the clock restoration code in the received EPA data frame and the determined oversampling multiple of the second clock to obtain the EPA data frame in digital format.

[0015] According to a second aspect of the present invention, there is provided an electronic device, which includes: at least one processing unit; and at least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform the steps of the method according to the first aspect of the present invention.

[0016] According to a third aspect of the present invention, there is provided a machine program product, which includes a machine program, and when the machine program is executed by the machine, it performs the steps of the method according to the first aspect of the present invention.

[0017] According to a fourth aspect of the present invention, there is provided a machine-readable storage medium, on which machine program code is stored, and when the machine program code is run, it performs the steps of the method according to the first aspect of the present invention.

[0018] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings

[0019] By referring to the following description of the specific embodiments of the present invention given in the drawings, the present invention will be better understood, and other objects, details, features, and advantages of the present invention will become more obvious.

[0020] Figure 1 A schematic diagram of an EPA network showing some embodiments of the present invention.

[0021] Figure 2 A flowchart of a method for communication in an EPA network showing some embodiments of the present invention.

[0022] Figure 3A A schematic diagram showing the connection relationship of multiple EPA devices in a bus in some embodiments of the present invention.

[0023] Figure 3BSchematic diagram showing another connection relationship of multiple EPA devices in a bus according to some embodiments of the present invention.

[0024] Figure 4 Schematic diagram showing a macro cycle in the communication process according to some embodiments of the present invention.

[0025] Figure 5 Schematic diagram showing the process of EPA network communication according to some embodiments of the present invention.

[0026] Figure 6 Schematic diagram showing an EPA data frame in the communication process according to some embodiments of the present invention.

[0027] Figure 7 Schematic diagram showing clock time in the communication process according to some embodiments of the present invention.

[0028] Figure 8 Block diagram of an electronic device for implementing the embodiments of the present invention according to some embodiments of the present invention.

[0029] In the respective drawings, the same or corresponding reference numerals denote the same or corresponding parts. Detailed implementation manners

[0030] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0031] In the following description, certain specific details are set forth for the purpose of illustrating various embodiments of the invention to provide a thorough understanding of the various embodiments of the invention. However, those skilled in the relevant art will recognize that the embodiments can be practiced without one or more of these specific details. In other instances, well-known devices, structures, and techniques associated with the present application may not be shown or described in detail so as not to unnecessarily obscure the description of the embodiments.

[0032] Unless the context requires otherwise, throughout the specification and claims, the words "comprise" and its variations, such as "comprising" and "having", should be understood in an open, inclusive sense, i.e., construed as "including, but not limited to".

[0033] References to "one embodiment" or "some embodiments" in the course of the specification mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, appearances of the phrases "in one embodiment" or "in some embodiments" in various places throughout the specification are not necessarily all referring to the same embodiment. Additionally, the particular features, structures, or characteristics may be combined in any manner in one or more embodiments.

[0034] Furthermore, the terms first, second, etc. used in the specification and claims are for the sole purpose of clearly distinguishing the respective objects and do not limit the size or other order of the objects they describe.

[0035] As mentioned above, EPA networks generally achieve data communication through the physical layer based on physical layer chips or network cables. Since network cables are required to connect each network node together in an EPA network and there are many restrictions on the wiring rules, once the connection is incorrect, packet collisions are likely to occur, leading to abnormal conditions such as error codes and packet loss. Since the application scenarios of EPA networks are mostly industrial sites, their network architectures are often bus-type structures such as CAN. If the traditional industrial control bus is replaced with an EPA network based on network cables, its cost will increase significantly compared to before, and the product form will also change greatly. Moreover, network cables are easily damaged in industrial sites. Based on the above situations, EPA networks based on physical layer chips and network cables are not very suitable for complex industrial sites.

[0036] To address the complex wiring rules, easy packet loss, high cost, and easy damage of EPA networks, in the traditional method, a master-slave protocol stack is implemented on buses such as MLVDS (Multipoint-Low-Voltage Differential Signaling) to achieve a bus arbitration mechanism, thereby avoiding bus data collisions. Although this traditional method is easy to implement, it has the following defects, resulting in not meeting the requirements of high-performance bus controllers. First, the form of the master node calling names in sequence will reduce the effective bandwidth of the bus. Second, since the data upload period of the slave node depends on the polling period of the master node rather than the upload requirements of the slave node, the real-time performance of data communication between the master and slave nodes cannot be guaranteed. In the above situations, if the upload frequency of the EPA network is increased, the bandwidth utilization rate of the bus will decrease; if the upload frequency is decreased, the real-time performance of the data will be affected. Based on this, the method based on buses such as MLVDS will result in the inability to simultaneously have high bandwidth and communication real-time performance and cannot meet the high-bandwidth and low-latency communication requirements of current bus controllers.

[0037] Furthermore, in the traditional technology, data communication between the master node and the slave nodes is also achieved through multiple pairs of MLVDS buses. Multiple pairs of MLVDS buses often include a pair of synchronous clock buses, a pair of communication clock buses, a pair of control buses, and at least a pair of data buses. The master node uses the synchronous clock buses to keep the clock synchronization of each slave node, and each slave node uses the communication clock buses, control buses, and data buses to simultaneously issue communication clock signals, control signals, and data signals. However, in the traditional technology, the method of adding multiple pairs of MLVDS buses on the backplane will double both the number of drivers and the number of connector pins, and the node size will also inevitably increase, thus increasing the communication cost and not meeting the low-cost requirements of the current bus controller.

[0038] To at least partially solve one or more of the above problems and other potential problems, the present invention provides a method for communication in an EPA network. In this method, the EPA master clock device in the EPA network connects multiple EPA devices through a bus. During the communication process, the EPA master clock device can first generate a periodic message according to the priorities and occupancy lengths of the aperiodic messages to be sent by the multiple EPA devices. Then, the EPA master clock device sends the periodic message to the multiple EPA devices through the bus in the EPA network. Further, the multiple EPA devices send aperiodic messages to the EPA master clock device according to the received periodic message and the scheduling of the EPA master clock device. In this way, the EPA master clock device can send the priorities and occupancy lengths to the multiple EPA devices through the periodic message, thereby scheduling the sending of aperiodic messages by the multiple EPA devices, realizing the communication between the multiple EPA devices and the EPA master clock device, avoiding the EPA master clock device from polling each of the multiple EPA devices one by one, improving the effective bandwidth of the bus while ensuring the real-time performance of data communication.

[0039] Figure 1 FIG. shows a schematic diagram of an EPA network 100 according to some embodiments of the present invention. In some embodiments, the EPA network 100 includes an EPA master clock device 102 and multiple EPA devices, and the EPA master clock device 102 and the multiple EPA devices are connected through a bus 104. Among them, the multiple EPA devices may include, for example, an EPA device 106, an EPA device 108, and an EPA device 110. It should be understood that Figure 1 the EPA devices listed therein are only taken as an example rather than a limitation to the present invention. The EPA master clock device can be any one of the multiple EPA devices. In some embodiments, the bus 104 includes, but is not limited to, field buses such as MLVDS, BLVDS, CAN, RS485, RS422, etc., and is used to realize the communication between the EPA master clock device 102 and the multiple EPA devices.

[0040] In some embodiments, the EPA master clock device 102 may be implemented using an MCU (Micro Controller Unit), a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a GPGPU (General-purpose Computing on Graphics Processing Units), an FPGA (Field Programmable Gate Array), or other programmable logic devices, an ASIC (Application Specific Integrated Circuit), discrete gate or transistor logic devices, discrete hardware components, etc. The computing device 102 may have one or more processing units, including dedicated processing units such as GPUs, FPGAs, and ASICs, and general-purpose processing units such as CPUs. It should be understood that the EPA master clock device may be any EPA device in the EPA network 100. For example, the EPA device 106, the EPA device 108, or the EPA device 110 may all serve as the EPA master clock device.

[0041] In some embodiments, the EPA master clock device 102 includes a periodic message generation unit 112, a periodic message sending unit 114, and an aperiodic message receiving unit 116. Regarding the periodic message generation unit 112, it is used to generate multiple periodic messages (which may be referred to as the first messages) for the EPA device 106, the EPA device 108, and the EPA device 110. Taking the periodic message sent by the EPA device 106 as an example, the periodic message includes the priority and occupancy length of the aperiodic message (which may be referred to as the second message) that the EPA device 106 will send to the EPA master clock device 102 next. Regarding the periodic message sending unit 114, it is used to send the periodic messages to the EPA device 106, the EPA device 108, and the EPA device 110 through the bus 104 in the EPA network 100.

[0042] Regarding the aperiodic message receiving unit 116, it is used to receive a plurality of aperiodic messages from the EPA devices 106, 108, and 110 through the bus 104 in the EPA network, where the plurality of aperiodic messages are sent by the EPA devices 106, 108, and 110 to the EPA master clock device 102 according to the priority and occupancy length sent by the EPA master clock device 102. It should be understood that the above periodic messages and aperiodic messages are all transmitted between the EPA master clock device 102 and the EPA devices 106, 108, and 110 through the bus 104.

[0043] In an embodiment of the present invention, the EPA master clock device 102 in the EPA network 100 is connected to a plurality of EPA devices through the bus 104. During the communication process, the EPA master clock device 102 can first generate a periodic message according to the priority and occupancy length of the aperiodic messages to be sent by the plurality of EPA devices. Then, the EPA master clock device 102 sends the periodic message to the plurality of EPA devices through the bus in the EPA network. Further, the plurality of EPA devices send aperiodic messages to the EPA master clock device 102 according to the received periodic message and the scheduling of the EPA master clock device 102. In this way, the EPA master clock device 102 can send the priority and occupancy length to the plurality of EPA devices through the periodic message, thereby scheduling the sending of aperiodic messages by the plurality of EPA devices, realizing the communication between the plurality of EPA devices and the EPA master clock device 102, avoiding the EPA master clock device 102 polling each of the plurality of EPA devices one by one, and while improving the effective bandwidth of the bus 104, ensuring the real-time performance of data communication.

[0044] The following will be combined with Figure 2 Describe a method for communication in an EPA network according to an embodiment of the present invention. Figure 2 The flowchart of a method 200 for communication in an EPA network according to some embodiments of the present invention is shown. It should be understood that the method 200 can be executed, for example, in Figure 1 the EPA master clock device 102 described in. It should be understood that the method 200 may further include additional actions not shown and / or may omit the shown actions, and the scope of the present invention is not limited in this regard.

[0045] At step 202, multiple first messages are generated for multiple EPA devices, where the first message includes the priority and occupancy length of the second message to be sent by the EPA device, and the multiple EPA devices are respectively connected through the bus in the EPA network. In some embodiments, in the EPA network 100, the EPA master clock device 102 is respectively connected to the EPA device 106, the EPA device 108, and the EPA device 110 (collectively referred to as multiple EPA devices) through the bus 104. The EPA master clock device 102 determines the priority and occupancy length of the aperiodic messages (referred to as the second messages) to be sent by the EPA device 106, the EPA device 108, and the EPA device 110, and generates periodic messages (referred to as the first messages) according to the priority and occupancy length. Among them, the priority represents the order of sending aperiodic messages by multiple EPA devices, and the occupancy length represents the time length or field length that the EPA device needs to occupy when sending an aperiodic message within the communication macro cycle.

[0046] Regarding the second message, for example, it includes the aperiodic message received by the EPA master clock device during the aperiodic time of the macro cycle, and regarding the method for generating multiple first messages for multiple EPA devices, for example, it includes: determining the priority and occupancy length of multiple aperiodic messages according to the types of multiple aperiodic messages to be sent by multiple EPA devices; and generating multiple periodic messages for multiple EPA devices according to the determined priority and occupancy length of the multiple aperiodic messages.

[0047] Regarding the method for determining the priority and occupancy length of multiple aperiodic messages according to the types of multiple aperiodic messages to be sent by multiple EPA devices, for example, it includes: determining the priority of multiple aperiodic messages according to the types of multiple aperiodic messages to be sent by multiple EPA devices; determining whether there is a collision between the priorities of multiple aperiodic messages; in response to there being a collision between the priorities of multiple aperiodic messages, obtaining the address of the EPA device corresponding to the aperiodic message with a collision; and adjusting the priority of the aperiodic message with a collision based on the obtained address of the EPA device.

[0048] At step 204, the generated multiple first messages are sent to multiple EPA devices through the bus. In some embodiments, after generating multiple periodic messages for multiple EPA devices, the EPA master clock device 102 can send the generated multiple periodic messages to the EPA device 106, the EPA device 108, and the EPA device 110 respectively through the bus 104 in the EPA network.

[0049] Regarding an EPA network that can be based on macro-cycle communication, the first message includes a periodic message, and regarding a method for sending multiple generated first messages to multiple EPA devices via a bus, it includes, for example: determining the transmission times of multiple periodic messages of multiple EPA devices, where the transmission times of the multiple periodic messages are within the cycle time of the macro-cycle; and sending the multiple periodic messages to the multiple EPA devices according to the determined transmission times of the multiple periodic messages.

[0050] Regarding a method for sending multiple generated first messages to multiple EPA devices via a bus, it includes, for example: obtaining, through a link layer interface in an EPA master clock device, a first message for sending to an EPA device from an EPA protocol stack in the EPA master clock device, where the first message is generated by the EPA protocol stack based on the priority and occupancy length of a second message to be sent by the EPA device; obtaining a first timestamp from a timer in the EPA master clock device; generating, through an encoder in the EPA master clock device, an encoding of the first message and the first timestamp, where the encoding of the first message and the first timestamp is in a multi-bit width format; converting, through a serializer in the EPA master clock device, the generated encoding of the first message and the first timestamp into a serial format to generate a scheduling frame; and sending the generated scheduling frame to the EPA device through a physical layer interface connected to the bus in the EPA master clock device.

[0051] At step 206, receive multiple second messages from multiple EPA devices via the bus, where the second messages are sent by the EPA devices to the bus according to the priority and occupancy length in the first message. In some embodiments, EPA device 106, EPA device 108, and EPA device 110 receive periodic messages from EPA master clock device 102 and send aperiodic messages to EPA master clock device 102 respectively according to the scheduling (i.e., priority and occupancy length) of the three EPA devices in the periodic message. EPA master clock device 102 receives aperiodic messages from EPA device 106, EPA device 108, and EPA device 110 respectively via bus 104.

[0052] Regarding a method for receiving multiple second messages from multiple EPA devices via the bus, it includes, for example: receiving an EPA data frame from an EPA device through a physical layer interface connected to the bus in the EPA master clock device, where the EPA data frame includes a clock recovery code, a frame start code, a data code, a frame end code, and an idle status code; determining the second message of the EPA device based on the received EPA data frame; and obtaining the determined second message through an EPA protocol stack in the EPA master clock device via a link layer interface.

[0053] A method for determining a second message of an EPA device based on a received EPA data frame, for example, includes: sampling the EPA data frame by a clock in an EPA master clock device based on a clock reduction code in the received EPA data frame to obtain an EPA data frame in digital format; converting, by a deserialization device in the EPA master clock device, data codes in the sampled EPA data frame into a multi-bit width format based on a frame start code and a frame end code in the sampled EPA data frame, wherein the data codes converted into the multi-bit width format are aligned by the frame start code; determining, by a decoder in the EPA master clock device, a second message of the EPA device based on the converted data codes; and obtaining, by an EPA protocol stack in the EPA master clock device through a link layer interface, the determined second message of the EPA device from the decoder.

[0054] A method for sampling an EPA data frame by a clock in an EPA master clock device based on a clock reduction code in the received EPA data frame to obtain an EPA data frame in digital format, for example, includes: detecting, by a plurality of clocks in the EPA master clock device, a signal of an EPA data frame sent by the EPA device; in response to a first clock among the plurality of clocks first detecting the signal, determining, based on a preset phase difference, a second clock corresponding to the first clock among the plurality of clocks; and sampling, by the determined second clock, the EPA data frame based on the clock reduction code in the received EPA data frame to obtain an EPA data frame in digital format.

[0055] A method for sampling an EPA data frame by a determined second clock based on a clock reduction code in a received EPA data frame to obtain an EPA data frame in digital format, for example, includes: determining a sampling period of the second clock, a first jitter time, and a second jitter time of a clock in the EPA device; determining, based on the determined sampling period, the first jitter time, and the second jitter time, an oversampling multiple of the second clock; and sampling, by the second clock, the EPA data frame based on the clock reduction code in the received EPA data frame and the determined oversampling multiple of the second clock to obtain an EPA data frame in digital format.

[0056] Regarding the encoding of data codes of an EPA data frame, for example, including a second message and a first timestamp, and method 200, for example, further includes: obtaining, by a decoder in the EPA master clock device, the first timestamp based on the converted data codes; determining a first delay for the EPA master clock device to process data and a second delay for the EPA device to process data; and updating, based on the determined first delay and the second delay, the first timestamp in a timer.

[0057] In an embodiment of the present invention, an EPA master clock device in an EPA network is connected to multiple EPA devices through a bus. During communication, the EPA master clock device can first generate a periodic message according to the priorities and occupancy lengths of the aperiodic messages to be sent by the multiple EPA devices. Then, the EPA master clock device sends the periodic message to the multiple EPA devices through the bus in the EPA network. Further, the multiple EPA devices send aperiodic messages to the EPA master clock device according to the received periodic message and the scheduling of the EPA master clock device. In this way, the EPA master clock device can send priorities and occupancy lengths to the multiple EPA devices through the periodic message, so as to schedule the sending of aperiodic messages by the multiple EPA devices, realize the communication between the multiple EPA devices and the EPA master clock device, avoid the EPA master clock device polling each of the multiple EPA devices one by one, improve the effective bandwidth of the bus, and ensure the real-time performance of data communication.

[0058] Figure 3A 、 Figure 3B respectively show schematic diagrams of the connection relationships 300A and 300B of multiple EPA devices in some embodiments of the present invention in the bus. In some embodiments, referring to Figure 3A In Figure 1 in the EPA network 100 shown, the bus 104 can support dual-channel redundancy, including line 1041 and line 1042. The A ends of the EPA device 106, the EPA device 108, and the EPA device 110 are all connected to the line 1041, and the B ends are all connected to the line 1042. In other embodiments, referring to Figure 3B the B port of the EPA device 106, the A port of the EPA device 108, and the A port of the EPA device 110 are connected to the line 1041, and the A port of the EPA device, the B port of the EPA device 108, and the B port of the EPA device 110 are connected to the line 1042. It should be understood that the connection relationship 300A and the connection relationship 300B are only examples of the connection relationships between the EPA devices in the EPA network of the present invention. The A end or B end of each EAP device in the present invention can be arbitrarily connected to the line 1041 or the line 1042 without considering its wiring method, thereby reducing the wiring difficulty.

[0059] It should be understood that for a traditional EPA network based on a physical layer chip or network cable, its requirements Figure 3A or Figure 3BThe connection between the A end and the B end of the EAP devices shown in the figure, for example, the A end of the EPA device 108 must be connected to the B end of the EPA device 106, and it is not allowed that the A end of the EPA device 108 is connected to the A end of the EPA device 106, and the order of the EPA devices cannot be changed randomly. Therefore, the traditional EPA network based on the physical layer chip or network cable has a complex wiring method. In this embodiment, in this way, the wiring rules of the EPA network can be simplified, any ports between the EPA devices can be interconnected, and the order of the EPA devices can also be changed randomly, thereby reducing the wiring difficulty of the technicians and avoiding the situation of ultra-long network cables when the number of EPA devices is too large.

[0060] Figure 4 FIG. shows a schematic diagram of a macro cycle 400 in the communication process of some embodiments of the present invention. In some embodiments, Figure 1 In the EPA network 100 shown in the figure, all EPA devices communicate according to a certain period, and the time required for the EAP network 100 to complete a complete communication cycle is the macro cycle of the communication. In a macro cycle, it also includes a cycle time for transmitting cycle messages (which can be called the first message) and an aperiodic time for transmitting aperiodic messages (which can be called the second message). The bus arbitration mechanism in the EPA network 100 can thus be divided into a bus arbitration mechanism within the cycle time and a bus arbitration mechanism within the aperiodic time. The following will describe in detail the manner in which the EPA network 100 schedules messages and communicates in a macro cycle.

[0061] In some embodiments, the EPA master clock device 102 can determine the transmission time for each EPA device to send cycle messages within the cycle time. For example, referring to Figure 4 , the transmission times for the EPA device 1, EPA device 2, EPA device 3, EPA device 4, EPA device 5,..., EPA device n (since each EPA device has a corresponding EPA protocol stack, so Figure 4 the vertical axis in the figure can represent either the EPA device or the protocol stack) to send cycle messages are time 1, time 3, time 2, time 4, time 5,..., time m in sequence. Then, the EPA master clock device 102 sends the cycle messages to the above n EPA devices according to the transmission time assigned to each EPA device. In this way, the EPA master clock device 102 realizes the bus arbitration mechanism for the n EPA devices within the cycle time, ensuring that the transmission times for sending cycle messages to the n EPA devices within the cycle time are staggered from each other, thereby avoiding the collision of cycle messages within the cycle time.

[0062] In some embodiments, the periodic message sent by the EPA master clock device 102 within the periodic time may include the scheduling of the aperiodic message that the EPA device will send within the aperiodic time, that is, the declaration fields of the priority and the occupancy length. For example, the periodic message sent by the EPA master clock device 102 to the EPA device 1 may include a declaration field with a priority of 2 and an occupancy length of 2 (2 unit time periods), the periodic message sent by the EPA master clock device 102 to the EPA device 2 may include a declaration field with a priority of 15 and an occupancy length of 4, the periodic message sent by the EPA master clock device 102 to the EPA device 3 may include a declaration field with a priority of 15 and an occupancy length of 1, the periodic message sent by the EPA master clock device 102 to the EPA device 4 may include a declaration field without aperiodic data, the periodic message sent by the EPA master clock device 102 to the EPA device 5 may include a declaration field with a priority of 1 and an occupancy length of 1, and so on. In some embodiments, the priority and the occupancy length may be determined by the EPA master clock device 102 based on the type of the aperiodic message.

[0063] After receiving the periodic message sent by the EPA master clock device 102, each EPA device may determine the transmission time of its aperiodic message within the aperiodic time according to the declaration fields of the priority and the occupancy length of the aperiodic message in the periodic message. In this way, the EPA network 100 implements a bus arbitration mechanism within the aperiodic time. In this way, it is possible to implement the scheduling of the aperiodic time segments of the aperiodic message and the transmission of high-priority data based on the periodic message sent by the EPA master clock device 102, so as to achieve the timing of the aperiodic message sent by each EPA device, avoid the collision of the aperiodic message, and effectively utilize the bandwidth of the bus 104.

[0064] In some embodiments, due to reasons such as the possible same type of aperiodic messages, there may be a collision between the priorities of the aperiodic messages. For example, the priorities in the periodic messages sent by the EPA master clock device 102 to the EPA device 2 and the EPA device 3 are both 15. Therefore, the EPA master clock device 102 needs to further process the EPA devices with colliding priorities when generating the periodic message. For example, the EPA master clock device 102 may further combine the address of the EPA device to determine the priority of the EPA device sending the aperiodic message.

[0065] In some embodiments, if there is a collision in the priorities determined by the EPA master clock device 102 according to the types of aperiodic messages, the addresses of the EPA devices with colliding priorities can be further obtained, and the corresponding priorities can be adjusted according to the addresses of the EPA devices. For example, if there is a collision in the priorities of the aperiodic messages sent by EPA device 2 and EPA device 3, the EPA master clock device 102 can determine that the priority of EPA device 2 is higher than that of EPA device 3 according to the order of the addresses. In this way, the EPA master clock device 102 can achieve the scheduling of multiple EPA devices when there is a collision in the priorities of aperiodic messages.

[0066] Reference Figure 4 , based on the above embodiments, since the priority of EPA device 5 is the highest (priority is 1), the aperiodic message of EPA device 5 is sent at time a and its occupied length is 1. The priority of EPA device 1 is the second highest (priority is 2), so the aperiodic message of EPA device 1 is sent at time b and its occupied length is 2. Then, since the priorities of both EPA device 2 and EPA device 3 are 15, based on the method that the EPA device with the earlier address sends first, the aperiodic message of EPA device 2 is sent at time c and its occupied length is 4, and the aperiodic message of EPA device 3 is sent at time d and its occupied length is 1. Since EPA device 4 declares that there is no aperiodic message, EPA device 4 does not send aperiodic messages during the aperiodic time. The bus arbitration mechanism of the above embodiments can achieve accurate bus arbitration without affecting the bus bandwidth.

[0067] Figure 5 shows a schematic diagram of the process 500 of EPA network communication in some embodiments of the present invention. In some embodiments, in the EPA network 100 shown in Figure 1 , the EPA master clock device 102 includes a bus driver 1021 and an EPA protocol stack 1022. It should be understood that the process 500 can be executed, for example, in the bus driver 1021 and the EPA protocol stack 1022. It should be understood that the process 500 may further include additional actions not shown and / or the actions shown may be omitted, and the scope of the present invention is not limited in this regard.

[0068] In some embodiments, the EPA protocol stack 1022 generates periodic messages according to the priorities and occupancy lengths of multiple EPA devices. Then, the bus driver 1021 obtains the periodic messages from the EPA protocol stack 1022 through the link layer interface 512. Among them, the link layer interface 512 can implement multiple link layer interfaces, including but not limited to data interfaces such as RGMII, GMII, SGMII, MII, and RMII, for realizing the format conversion of data. Then, the bus driver 1021 obtains the currently recorded timestamp (which can be called the first timestamp) from the timer 510 and adds this timestamp to the periodic message.

[0069] Furthermore, the bus driver 1021 encodes the periodic message with the added timestamp through the encoder 514, so as to combine the data and the clock signal. The generated encoding can be in a multi-bit width format. After passing through the encoder 514, the generated encoding is then converted into a serial format through the serializer 516. In this way, the periodic message is converted into a scheduling frame for bus communication, and this scheduling frame is used to carry the periodic message. Finally, the bus driver 1021 sends this data frame to the bus 104 through the physical layer interface 502 and transmits it to multiple EPA devices through the bus 104. Among them, the encoder 514 can support multiple encoding standards, including but not limited to 4B / 5B, 8B / 10B, NRZI, NRZ, etc. The physical layer interface 502 can implement multiple bus physical layer interfaces, including but not limited to physical layer interfaces such as MLVDS, BLVDS, CAN, RS485, and RS422. In this way, the bus driver 1021 can quickly send periodic messages to multiple EPA devices, thereby improving the scheduling efficiency for multiple EPA devices.

[0070] In some embodiments, after receiving the periodic message through the bus 104, the EPA device sends an aperiodic message to the bus driver 1021 according to the scheduling in the periodic message. This aperiodic message is sent by the EPA device to the bus driver 1021 in the form of an EPA data frame, and the bus driver 1021 receives the EPA data frame from the bus 104 through the physical layer interface 502. Among them, the EPA data frame can include a clock recovery code, a frame start code, a data code, a frame end code, and an idle status code, etc. The following will be combined with Figure 6 to further describe the structure of the EPA data frame.

[0071] After the bus driver 1021 obtains the EPA data frame, it can parse the aperiodic message according to the EPA data frame and send it to the EPA protocol stack 1022 through the link layer interface 512. In some embodiments, the EPA protocol stack 1022 can read the format of the aperiodic message and determine whether to accept the aperiodic message and perform further analysis according to the IP address or physical address of the EPA device included in the aperiodic message, etc. The following embodiments will describe in detail the process of the bus driver 1021 parsing the EPA data frame to obtain the aperiodic message.

[0072] In some embodiments, the bus driver 1021 performs digital sampling on the EPA data frame based on the clock reduction code in the EPA data frame through the clock 504, so as to obtain the EPA data frame in digital format. At this time, multiple EPA data frames in digital format are in serial format. Then, the bus driver 1022 determines the data code field in each EPA data frame based on the frame start code and frame end code in the EPA data frame through the deserialiser 506, so as to convert the serial format data code into a multi-bit width format, and the data code is aligned by the frame start code. Further, the bus driver 1021 decodes the data code converted into a multi-bit width format through the decoder 508, so as to obtain the aperiodic message sent by the EPA device. In this way, the efficiency of parsing the EPA data frame can be improved, thereby improving the communication efficiency of the EPA network 100.

[0073] In some embodiments, the bus driver 1021 may include multiple clocks, and the bus driver 1021 can respectively detect the rising edge or falling edge of the signal of the EPA data frame received from the physical layer interface 502 through the multiple clocks. Then, after a clock (which can be called the first clock) first detects the rising edge or falling edge of the signal, another clock (which can be called the second clock, that is, the clock 504) corresponding to the clock is selected according to a certain phase difference. The other clock can sample the center position of the rising edge or falling edge of the signal. Further, the bus driver 1021 samples the signal through the other clock, so as to obtain the EPA data frame in digital format. In this way, the accuracy of the clock for sampling the EPA data frame can be ensured, thereby improving the accuracy of sampling the EPA data frame and the aperiodic message.

[0074] In some embodiments, regarding the oversampling ratio (or the number of clock phases) n of the clock 504, it can be determined in the following way: First, the bus driver 1021 determines the sampling period of the clock 504 and the jitter time of the clock 504 (which can be called the first jitter time) and the jitter time of the clock in the EPA device (which can be referred to as the second jitter time). Then, the bus driver 1021 determines the oversampling multiple n of the clock 504 according to the sampling period of the clock 504 , the jitter time of the clock 504 , and the jitter time of the clock in the EPA device . The specific calculation formula is as follows.

[0075]

[0076]

[0077] For example, if the rate of the bus 104 is 200 Mbps, then the sampling period of the clock 504 , the jitter time of the clock 504 , and the jitter time of the clock in the EPA device . Thus, the oversampling multiple n > 2.3 can be obtained. At this time, the oversampling multiple n can be determined according to this range. In this way, the oversampling multiple of the clock 504 can be quickly determined, thereby improving the sampling efficiency of the EPA data frame.

[0078] Figure 6 shows a schematic diagram of the EPA data frame 600 in the communication process of some embodiments of the present invention. In some embodiments, taking the Nth frame as an example, the frame structure of the EPA data frame 600 consists of a control code and a data code. The control code can be divided into a clock recovery code, a frame start code, a frame end code, and an idle state code (used to separate the Nth frame and the (N + 1)th frame) according to functions. The clock recovery code is used to recover data and the clock to obtain the correct bus data. The frame start code is used for frame synchronization to achieve field alignment after deserialization. The frame end code is used to determine the end of the bus message. The idle state code is used for the reset of the bus driver to ensure the continuous operation of the bus driver. The data code is generated after the non-periodic message is encoded and includes the EPA message header and application data.

[0079] Figure 7 shows a schematic diagram of the clock time 700 in the communication process of some embodiments of the present invention. In some embodiments, the main clock time T1 is the clock time in the EPA main clock device 102, and the slave clock time T2 is the clock time in the EPA device. It should be understood that since communication is carried out through the bus 104 in the present invention, the line delay is almost 0, so the time of the line delay can be ignored. From the main clock time T1 to the slave clock time T2, the time experienced includes the delay 1 (which can be referred to as the first delay) for the EPA main clock device 102 to process data and the delay 2 (which can be referred to as the second delay) for the EPA device to process data.

[0080] In some embodiments, the data code of the EPA data frame includes not only the encoding of the aperiodic message but also the encoding of a timestamp (which can be referred to as the first timestamp). Among them, the timestamp is sent by the bus driver 1021 when sending a periodic message to the EPA device, and the EPA device encapsulates the aperiodic message and the timestamp into the data code before sending the EPA data frame. After decoding the data code through the decoder 508, the bus driver 1021 can obtain the aperiodic message and the timestamp. Then, the bus driver 1021 calculates the current timestamp based on the delay 1 for the EPA master clock device 102 to process data and the delay 2 for the EPA device to process data, and updates the timestamp previously recorded in the timer 510 to the current timestamp.

[0081] In this way, the bus driver 1021 can achieve the full-network time synchronization of the EPA network 100. Since the bus driver 1021 adds a timestamp through the encoder 514 when sending a periodic message, and obtains the timestamp at the decoder 508 when receiving an aperiodic message, and the EPA network 100 is a bus type (without wireless delay), the timestamp is processed as a stream during the communication process without any residence time. Thus, only by the processing delays of the master and slave nodes can the timestamp be accurately updated, and its synchronization accuracy is higher than the method of adding a timestamp at the physical layer and the EPA master clock device 102 obtaining the timestamp. Moreover, the accuracy will not deteriorate with the increase in the number of slave nodes, and at the same time, the process of updating the timestamp is more simplified.

[0082] Figure 8 The block diagram of the electronic device 800 suitable for implementing the embodiments of the present invention is schematically shown. The electronic device 800 can be used to implement the EPA master clock device 102. The electronic device 800 can be a device for implementing the Figure 2 shown method 200. As Figure 8 shown, the electronic device 800 includes a central processing unit (CPU) 801, which can execute various appropriate actions and processes according to the computer program instructions stored in the read-only memory (ROM) 802 or the computer program instructions loaded from the storage unit 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The CPU 801, ROM 802, and RAM 803 are connected to each other through the bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0083] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and the central processing unit 801 executes the various methods and processes described above, such as executing the method 200. For example, in some embodiments, the various processes or operations described above may be implemented as a computer software program, which is stored in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU 801, the various methods and processes described above may be executed, such as one or more operations of executing the method 200. Alternatively, in other embodiments, the CPU 801 may be configured to execute the various methods and processes described above, such as one or more actions of executing the method 200, by any other suitable means (e.g., by means of firmware).

[0084] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0085] The computer program instructions for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or, alternatively, may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the present invention.

[0086] These computer - readable program instructions may be provided to the processing unit of a processor, a general - purpose computer, a special - purpose computer, or other programmable data - processing device in a voice interaction device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data - processing device, a device is produced that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer - readable program instructions may also be stored in a computer - readable storage medium, and these instructions cause the computer, the programmable data - processing device, and / or other devices to work in a specific manner.

[0087] The embodiments of the present invention have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of the technology in the market, or to enable other ordinary skilled persons in the technical field to understand the disclosed embodiments.

[0088] The above are only optional embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for communication in an EPA network, for use in an EPA master clock device in an EPA network, characterized in that: include: Generate a plurality of first messages for a plurality of EPA devices, wherein the first messages include the priority and occupied length of a second message to be sent by the EPA device, the plurality of EPA devices are respectively connected via a bus in an EPA network, the bus includes a first line and a second line, one end of an EPA device in the plurality of EPA devices is connected to the first line of the bus, and the other end is connected to the second line of the bus, and the EPA master clock device is an EPA device selected from the plurality of EPA devices; Sending the generated multiple first messages to multiple EPA devices via a bus; as well as receiving a plurality of second messages from a plurality of EPA devices via the bus, wherein the second messages are sent to the bus by the EPA devices according to the priority and occupied length in the first messages; The receiving of a plurality of second messages from a plurality of EPA devices via the bus comprises: Detecting the signal of the EPA data frame sent by the EPA device through multiple clocks in the EPA master clock device; In response to a first clock among the multiple clocks first detecting an upper edge or a lower edge of a signal of the EPA data frame, based on a preset phase difference, determining a second clock corresponding to the first clock among the multiple clocks, wherein the second clock is used to sample a center position of an upper edge or a lower edge of the signal; Based on the clock recovery code in the received EPA data frame, the determined second clock samples the EPA data frame to obtain the EPA data frame in a digital format; and Based on the sampled EPA data frame in digital format, a second message of the EPA device is determined.

2. The method according to claim 1, characterized in that: The EPA network is based on macrocycle communication, the first message includes a periodic message, and the multiple first messages generated and sent to the multiple EPA devices through the bus include: Determining a transmission time of a plurality of periodic messages of a plurality of EPA devices, wherein the transmission time of the plurality of periodic messages is within a periodic time of a macrocycle; and According to the determined sending times of the multiple periodic messages, multiple periodic messages are sent to multiple EPA devices.

3. The method according to claim 2, characterized in that The second message includes a non-periodic message received by the EPA master clock device during the non-periodic time of the macro cycle, and generating a plurality of first messages for a plurality of EPA devices includes: determining priorities and occupied lengths of the multiple non-periodic messages according to types of the multiple non-periodic messages to be sent by the multiple EPA devices; and According to the determined priorities and occupied lengths of the multiple non-periodic messages, multiple periodic messages for the multiple EPA devices are generated.

4. The method according to claim 3, characterized in that According to the types of the multiple non-periodic messages to be sent by the multiple EPA devices, the priorities and occupied lengths of the multiple non-periodic messages are determined including: Determine priorities of the multiple non-periodic messages according to types of the multiple non-periodic messages to be sent by the multiple EPA devices; Determine whether there is a conflict between the priorities of multiple non-periodic messages; In response to a collision between priorities of the plurality of non-periodic messages, acquiring addresses of EPA devices corresponding to the non-periodic messages having the collision; and Based on the acquired address of the EPA device, the priority of the non-periodic message with collision is adjusted.

5. The method according to claim 1, characterized in that Sending the generated multiple first messages to the multiple EPA devices through the bus includes: Obtaining, through a link layer interface in the EPA master clock device, from an EPA protocol stack in the EPA master clock device a first message for sending to the EPA device, wherein the first message is generated by the EPA protocol stack based on a priority and an occupied length of a second message to be sent by the EPA device; Obtaining a first timestamp from a timer in an EPA master clock device; Generate, by an encoder in the EPA master clock device, an encoding of the first message and the first timestamp, wherein the encoding of the first message and the first timestamp is in a multi-bit wide format; Converting the generated first message and the encoding of the first timestamp into a serial format through a serializer in the EPA master clock device to generate a scheduling frame; The generated scheduling frame is sent to the EPA device through a physical layer interface connected to the bus in the EPA master clock device.

6. The method according to claim 5, characterized in that Receiving a plurality of second messages from a plurality of EPA devices via the bus comprises: Receive an EPA data frame from the EPA device through a physical layer interface connected to the bus in the EPA master clock device, wherein the EPA data frame includes a clock recovery code, a frame start code, a data code, a frame end code, and an idle state code; Determining a second message of the EPA device based on the received EPA data frame; and The EPA protocol stack in the EPA master clock device obtains the determined second message through the link layer interface.

7. The method according to claim 6, characterized in that Based on the received EPA data frame, determining the second message of the EPA device includes: The clock in the EPA master clock device samples the EPA data frame based on the clock recovery code in the received EPA data frame to obtain the EPA data frame in a digital format; The deserializer in the EPA master clock device converts the data code in the sampled EPA data frame into a multi-bit width format based on the frame start code and the frame end code in the sampled EPA data frame, wherein the data code converted into the multi-bit width format is aligned by the frame start code; Determining, by a decoder in the EPA master clock device, a second message of the EPA device based on the converted data code; and The EPA protocol stack in the EPA master clock device obtains the second message of the determined EPA device from the decoder through the link layer interface.

8. The method according to claim 7, characterized in that The data code of the EPA data frame includes the encoding of the second message and the first timestamp, and the method further includes: The decoder in the EPA master clock device obtains a first time stamp based on the converted data code; determining a first delay for the EPA master clock device to process the data and a second delay for the EPA device to process the data; and Based on the determined first delay and the second delay, a first timestamp in the timer is updated.

9. The method according to claim 1, characterized in that: The method of recovering the clock in the received EPA data frame based on the determined second clock and sampling the EPA data frame to obtain the EPA data frame in a digital format comprises: Determine a sampling period of a second clock, a first jitter time, and a second jitter time of a clock in an EPA device; Determining an oversampling multiple of the second clock based on the determined sampling period, the first jitter time, and the second jitter time; and The EPA data frame is sampled by the second clock based on the clock recovery code in the received EPA data frame and the determined oversampling multiple of the second clock to obtain the EPA data frame in a digital format.

10. An electronic device, characterized in that: include: at least one processing unit; At least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, and the instructions, when executed by the at least one processing unit, cause the electronic device to perform the steps of the method according to any one of claims 1 to claim 9.

11. A machine program product, characterized in that The method comprises a machine program, which, when executed by a machine, performs the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • EPA (ethemet for plant automation) on-chip system, EPA communication system and EPA communication method

    CN106685735A

  • Distributed control aperiodic communication method

    CN112764407A

  • Clock synchronization method, slave clock equipment, master clock equipment and system

    CN113411157A

  • EPA equipment

    CN113873046A