A data frame real-time forwarding method, device, equipment and storage medium
By performing address comparison and forwarding instruction determination in parallel during data frame forwarding, the problem of data frame forwarding delay in hybrid network topologies is solved, achieving higher real-time performance and low-latency forwarding.
Patent Information
- Application Number
- CN202510320178.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-03-18
AI Technical Summary
In existing technologies, when data frames are forwarded between different networks or nodes in a hybrid network topology, the address needs to be identified before forwarding, which leads to processing delays and affects the real-time performance of data frame forwarding.
While forwarding downlink data frames to the subnet, the target address and node address are compared. Based on the comparison result, the forwarding instruction is determined and the corresponding operation is executed.
By processing data transmission and address identification in parallel, the real-time performance of data frame forwarding is improved and the forwarding latency is reduced.
Smart Images

Figure CN119854208B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network communication, and in particular to a data frame real-time forwarding method and device, equipment and a storage medium. BACKGROUND
[0002] With the wide application of computer networks, different application scenarios have different requirements for network performance, reliability, scalability, etc. For example, enterprise networks need high reliability and scalability to support a large number of employees and business systems; while home networks focus more on cost and ease of use. Therefore, a hybrid network topology is usually adopted to combine different topological structures, thereby improving network performance and optimizing data transmission paths.
[0003] In the prior art, when the hybrid network topology forwards data at different networks or nodes, the address of the data frame is usually identified first, and the data frame is forwarded after the address is determined to be correct. The address identification step needs to be completed before forwarding, which will cause a certain processing delay, resulting in reduced real-time performance of data frame forwarding. SUMMARY
[0004] Based on the above problems, the present application provides a data frame real-time forwarding method, device, equipment and storage medium, which aims to improve the real-time performance of data frame forwarding and reduce the forwarding delay of data frames.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] In a first aspect, the present application provides a data frame real-time forwarding method, which comprises:
[0007] obtaining a downlink data frame from a main network; the downlink data frame is a data frame forwarded to a sub-network through the main network;
[0008] comparing a target address of the downlink data frame with a node address of the sub-network while forwarding the downlink data frame to the sub-network, to obtain an address comparison result corresponding to the downlink data frame;
[0009] determining a forwarding instruction corresponding to the downlink data frame according to the address comparison result corresponding to the downlink data frame, and executing the forwarding instruction.
[0010] Optionally, the method described above, wherein the determining a forwarding instruction corresponding to the downlink data frame according to the address comparison result corresponding to the downlink data frame, and executing the forwarding instruction, comprises:
[0011] if the address comparison result of the downlink data frame is the same address, determining that the forwarding instruction corresponding to the downlink data frame is to continue forwarding, and continuing the forwarding operation of the downlink data frame.
[0012] or,
[0013] If the address comparison result of the downlink data frame is that the addresses are different, it is determined that the forwarding instruction corresponding to the downlink data frame is to stop forwarding, and the forwarding operation of the downlink data frame is stopped.
[0014] Optionally, the method described above further comprises:
[0015] adding the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame to a frame address comparison list; the frame address comparison list is used for querying the address comparison result;
[0016] in response to an uplink data frame obtained from the sub-network, determining the address comparison result corresponding to the uplink data frame from the frame address comparison list; the uplink data frame is a data frame forwarded to the main network through the sub-network;
[0017] If the address comparison result corresponding to the uplink data frame is that the addresses are the same, the forwarding operation of the uplink data frame is continued; or, if the address comparison result corresponding to the uplink data frame is that the addresses are different, the forwarding operation of the uplink data frame is stopped.
[0018] Optionally, the method described above, the adding the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame to a frame address comparison list, comprises:
[0019] generating the sequence number identifier corresponding to the downlink data frame by using a counter while forwarding the downlink data frame to the sub-network, and adding the sequence number identifier to the corresponding downlink data frame;
[0020] storing the sequence number identifier corresponding to the downlink data frame and the address comparison result corresponding to the downlink data frame in the frame address comparison list.
[0021] Optionally, the method described above, the determining the address comparison result corresponding to the uplink data frame from the frame address comparison list in response to an uplink data frame obtained from the sub-network, comprises:
[0022] determining the second sequence number identifier of the uplink data frame according to the first sequence number identifier of the last obtained uplink data frame while obtaining the uplink data frame from the sub-network;
[0023] querying the address comparison result corresponding to the second sequence number identifier from the frame address comparison list according to the second sequence number identifier; the address comparison result corresponding to the second sequence number identifier is the address comparison result corresponding to the uplink data frame.
[0024] Optionally, the method as described above, the uplink data frame is of the same data frame format as the downlink data frame.
[0025] In a second aspect, the present application provides a data frame real-time forwarding device, comprising:
[0026] an acquisition module, configured to acquire a downlink data frame from a master network; the downlink data frame is a data frame to be forwarded to a slave network through the master network;
[0027] a first processing module, configured to, while forwarding the downlink data frame to the slave network, compare a target address of the downlink data frame with a node address of the slave network, and obtain an address comparison result corresponding to the downlink data frame;
[0028] a second processing module, configured to determine a forwarding instruction corresponding to the downlink data frame according to the address comparison result corresponding to the downlink data frame, and execute the forwarding instruction.
[0029] In a third aspect, the present application provides a hybrid network topology, comprising: a master network, a plurality of slave networks, and a data frame real-time forwarding device corresponding to each of the plurality of slave networks;
[0030] the master network adopts field bus technology; and the slave network adopts Ethercat network;
[0031] the slave network communicates with the master network through the data frame real-time forwarding device corresponding to the slave network;
[0032] the data frame real-time forwarding device is configured to implement the data frame real-time forwarding method described in any of the above embodiments.
[0033] In a fourth aspect, the present application provides an electronic device, comprising: a processor, and a memory connected to the processor in communication;
[0034] the memory stores computer execution instructions;
[0035] the processor executes the computer execution instructions stored in the memory, so as to implement the data frame real-time forwarding method described in any of the above embodiments.
[0036] In a fifth aspect, the present application provides a computer readable storage medium, which stores computer execution instructions; when the computer execution instructions are executed by a processor, the computer execution instructions are configured to implement the data frame real-time forwarding method described in any of the above embodiments.
[0037] Compared with the prior art, the present application has the following beneficial effects:
[0038] The downlink data frame is obtained from the main network, and the target address of the downlink data frame is compared with the node address of the sub-network when the downlink data frame is forwarded to the sub-network, so as to obtain the address comparison result corresponding to the downlink data frame, and the forwarding instruction corresponding to the downlink data frame is determined according to the address comparison result, and the forwarding instruction is executed. The method provided by the application directly forwards the downlink data frame while comparing the addresses when the downlink data frame is obtained, so as to execute the corresponding forwarding instruction according to the comparison result, thereby improving the real-time performance of the data frame forwarding and reducing the forwarding delay of the data frame. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0040] Figure 1 A flowchart of an embodiment of a data frame real-time forwarding method provided by the present application;
[0041] Figure 2 A flowchart of another embodiment of a data frame real-time forwarding method provided by the present application;
[0042] Figure 3 A flowchart of another embodiment of a data frame real-time forwarding method provided by the present application;
[0043] Figure 4 A flowchart of another embodiment of a data frame real-time forwarding method provided by the present application;
[0044] Figure 5 A structural diagram of an embodiment of a data frame real-time forwarding device provided by the present application;
[0045] Figure 6 A structural diagram of another embodiment of a data frame real-time forwarding device provided by the present application;
[0046] Figure 7 A structural diagram of an embodiment of a hybrid network topology provided by the present application;
[0047] Figure 8 A structural diagram of an embodiment of an electronic device provided by the present application. DETAILED DESCRIPTION
[0048] As described above, in a computer network, when data needs to be transmitted between different networks or nodes in a hybrid network topology, the system first checks the target address of the data frame to ensure the address is accurate before forwarding the data. However, this address verification process must be completed before forwarding, thus introducing a certain time delay, which affects the immediacy of data frame forwarding.
[0049] Through research, the present application provides a real-time data frame forwarding method, device, equipment and storage medium to improve the real-time performance of data frame forwarding and reduce the forwarding delay of data frames.
[0050] To make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0051] Referring to Figure 1 The figure is a flowchart of one embodiment of a data frame real-time forwarding method provided by the present application. The method is applied to a data frame real-time forwarding device, and the method comprises the following steps:
[0052] S101: Obtain a downlink data frame from a main network. The downlink data frame is a data frame to be forwarded to a sub-network through the main network.
[0053] S102: While forwarding the downlink data frame to the sub-network, compare the target address of the downlink data frame with the node address of the sub-network to obtain an address comparison result corresponding to the downlink data frame.
[0054] In the embodiment, when the downlink data frame is obtained through the main network, the downlink data frame is directly forwarded to the sub-network. At the same time, the downlink data frame is parsed to identify the destination address in the downlink data frame, and the target address of the downlink data frame is compared with the node address of the current sub-network to determine whether the downlink data frame should be forwarded to the current sub-network.
[0055] For example, if the sub-networks include sub-network 1 and sub-network 2, sub-network 1 communicates with the main network through the data frame real-time forwarding device 1, and sub-network 2 communicates with the main network through the data frame real-time forwarding device 2. In the data frame real-time forwarding device corresponding to each sub-network, the downlink data frame sent by the main network is received and directly forwarded to the corresponding sub-network. At the same time, the data frame real-time forwarding device identifies the target address of the downlink data frame, and compares the target address with the node address of the corresponding sub-network stored in the data frame real-time forwarding device, so as to obtain the address comparison result of the downlink data frame in the current sub-network.
[0056] S103: According to the address comparison result corresponding to the downlink data frame, the forwarding instruction corresponding to the downlink data frame is determined, and the forwarding instruction is executed.
[0057] In this embodiment, if the address comparison result of the downlink data frame is the same address, it is determined that the forwarding instruction corresponding to the downlink data frame is to continue forwarding, and the forwarding operation of the downlink data frame is continued. Alternatively, if the address comparison result of the downlink data frame is not the same address, it is determined that the forwarding instruction corresponding to the downlink data frame is to stop forwarding, and the forwarding operation of the downlink data frame is stopped.
[0058] In this embodiment, the downlink data frame is obtained from the main network, and the target address of the downlink data frame is compared with the node address of the sub-network while the downlink data frame is forwarded to the sub-network, so as to obtain the address comparison result corresponding to the downlink data frame. According to the address comparison result corresponding to the downlink data frame, the forwarding instruction corresponding to the downlink data frame is determined, and the forwarding instruction is executed. The method of the present application directly compares the addresses while forwarding the downlink data frame when the downlink data frame is obtained, executes the corresponding forwarding instruction according to the comparison result, realizes the parallel processing of data transmission and address recognition, and improves the real-time performance of data frame forwarding and reduces the forwarding delay of data frame.
[0059] Further, on the basis of the above-mentioned embodiments, one specific implementation of "determining the forwarding instruction corresponding to the downlink data frame according to the address comparison result corresponding to the downlink data frame, and executing the forwarding instruction" in S103 includes:
[0060] If the address comparison result of the downlink data frame is the same address, it is determined that the forwarding instruction corresponding to the downlink data frame is to continue forwarding, and the forwarding operation of the downlink data frame is continued.
[0061] Alternatively,
[0062] If the address comparison result of the downlink data frame is not the same address, it is determined that the forwarding instruction corresponding to the downlink data frame is to stop forwarding, and the forwarding operation of the downlink data frame is stopped.
[0063] In this embodiment, when the address comparison result of the downlink data frame is that the destination address of the downlink data frame is the same as the node address of the sub-network, it is determined that the forwarding instruction corresponding to the current downlink data frame is to continue forwarding, and the forwarding operation of the current downlink data frame is continued. When the address comparison result of the downlink data frame is that the destination address of the downlink data frame is not the same as the node address of the sub-network, it is determined that the forwarding instruction corresponding to the current downlink data frame is to stop forwarding, and the forwarding operation of the downlink data frame is stopped.
[0064] In this embodiment, if the address comparison result of the downlink data frame is that the address is the same, the forwarding instruction corresponding to the downlink data frame is determined to be continue forwarding, and the forwarding operation of the downlink data frame is continued; however, once the address mismatch is found, the forwarding operation is interrupted, and the downlink data frame becomes a residual frame. The residual frame does not affect the internal devices of the self-network, thereby reducing the delay of data transmission and improving the real-time performance of data transmission.
[0065] See also Figure 2 This figure is a flow chart of another embodiment of a real-time data frame forwarding method provided by this application. After the main network sends a downlink data frame to the sub-network, the sub-network returns the uplink data frame corresponding to the downlink data frame. Therefore, in order to improve the real-time forwarding of the uplink data frame, based on the above embodiment, the method may further include:
[0066] S104: Add the serial number identifier of the downlink data frame and the address comparison result of the downlink data frame to a frame address comparison list, wherein the frame address comparison list is used to query the address comparison result.
[0067] In this embodiment, while forwarding the downlink data frame to the subnetwork, a frame ID counter is started to generate a sequence number corresponding to the downlink data frame, ensuring that each data frame receives a unique and incrementing sequence number. Furthermore, this sequence number is typically embedded in a specific field of the data frame and transmitted along with the data frame. The sequence number of the downlink data frame and its corresponding uplink data frame are identical. The sequence number is then added to the corresponding downlink data frame header or specific field to facilitate identification during subsequent processing. The sequence number corresponding to the downlink data frame and the corresponding address comparison result are then stored together in a frame address comparison list.
[0068] S105: In response to the uplink data frame obtained from the sub-network, determine the address comparison result corresponding to the uplink data frame from the frame address comparison list.
[0069] The uplink data frame is a data frame forwarded to the main network through the sub-network; the uplink data frame and the downlink data frame have the same data frame format.
[0070] In the embodiment, the sequence number identifier of the previous uplink data frame of the uplink data frame is obtained while obtaining the uplink data frame from the sub-network, so as to determine the sequence number identifier of the current uplink data frame. Then, the frame address comparison list is accessed immediately to query the address comparison result corresponding to the sequence number identifier of the current uplink data frame according to the sequence number identifier, and the address comparison result obtained is the address matching result of the current uplink data frame.
[0071] S106: If the address comparison result corresponding to the uplink data frame is the same address, the forwarding operation of the uplink data frame is continued; or if the address comparison result corresponding to the uplink data frame is different address, the forwarding operation of the uplink data frame is stopped.
[0072] In the embodiment, when the address comparison result corresponding to the uplink data frame is the same address, the forwarding operation of the uplink data frame is continued to forward the uplink data frame from the sub-network to the main network. When the address comparison result corresponding to the uplink data frame is different address, the forwarding operation of the uplink data frame is stopped, so that the current uplink data frame will not be forwarded to the main network.
[0073] In the embodiment, the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame are added to the frame address comparison list; then, the address comparison result corresponding to the uplink data frame is determined from the frame address comparison list in response to the uplink data frame obtained from the sub-network, if the address comparison result corresponding to the uplink data frame is the same address, the forwarding operation of the uplink data frame is continued; or if the address comparison result corresponding to the uplink data frame is different address, the forwarding operation of the uplink data frame is stopped, so that the real-time forwarding of the uplink data frame is realized, the real-time performance of the uplink data frame forwarding is improved, and the delay of the uplink data frame forwarding is reduced.
[0074] Referring to Figure 3 , the figure is a flow diagram of another embodiment of a data frame real-time forwarding method provided by the application. On the basis of the above-mentioned embodiments, one specific implementation of "adding the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame to the frame address comparison list" in S104 includes:
[0075] S1041: While forwarding the downlink data frame to the sub-network, the sequence number identifier corresponding to the downlink data frame is generated by using the counter, and the sequence number identifier is added to the corresponding downlink data frame.
[0076] In the embodiment, while forwarding the downlink data frame to the sub-network, the downlink data frame is counted by using the frame ID counter, the sequence number identifier corresponding to the current downlink data frame is generated, and the sequence number identifier is added to any position of the downlink data frame, which can be added to the frame header or behind the target address.
[0077] S1042: Store the sequence number identifier corresponding to the downlink data frame and the address comparison result corresponding to the downlink data frame into a frame address comparison list.
[0078] In this embodiment, the sequence number identifier corresponding to the downlink data frame and the address comparison result corresponding to the downlink data frame are stored in a frame address comparison table. Because data frames are forwarded using a first-in, first-out (FIFO) queue, the frame address comparison table maintains the address comparison result corresponding to each downlink data frame according to the sequence number identifier.
[0079] In this embodiment, while forwarding the downlink data frame to the subnetwork, a counter is used to generate a serial number identifier corresponding to the downlink data frame, and the serial number identifier is added to the corresponding downlink data frame. The serial number identifier corresponding to the downlink data frame and the address comparison result corresponding to the downlink data frame are then stored in a frame address comparison list, which facilitates quick retrieval and subsequent data frame management, ensuring the orderliness and traceability of data frame forwarding.
[0080] See also Figure 4 , this figure is a flow chart of another embodiment of a real-time forwarding method for data frames provided by the present application. On the basis of the above embodiment, since the forwarding order of the uplink data frame is the same as the forwarding order of the downlink data frame, the uplink data frame is also forwarded in real time, and the address and sequence number identifier of the current uplink data frame cannot be checked in real time, the address and sequence number identifier of the previous uplink data frame that has been forwarded can be queried to determine the address comparison result corresponding to the uplink data frame from the frame address comparison list. Therefore, a specific implementation method of "determining the address comparison result corresponding to the uplink data frame from the frame address comparison list in response to the uplink data frame obtained from the subnetwork" in S105 includes:
[0081] S1051: While acquiring an uplink data frame from the subnetwork, determine a second sequence number identifier of the uplink data frame according to the first sequence number identifier of the last acquired uplink data frame.
[0082] In this embodiment, for example, when an uplink data frame is obtained from the subnetwork, the first sequence number of the previous uplink data frame obtained is 018. The second sequence number corresponding to the current uplink data frame is obtained by adding one to the first sequence number, that is, 019.
[0083] S1052: According to the second sequence number identifier, query the address comparison result corresponding to the second sequence number identifier from the frame address comparison list, wherein the address comparison result corresponding to the second sequence number identifier is the address comparison result corresponding to the uplink data frame.
[0084] In the embodiment, the address comparison result corresponding to the second serial number identifier can be queried from the frame address comparison list. Since the downlink data frame and the uplink data frame corresponding thereto have the same serial number identifier, the address comparison result corresponding to the second serial number identifier is the address comparison result corresponding to the current uplink data frame.
[0085] In the embodiment, the second serial number identifier of the uplink data frame is determined according to the first serial number identifier of the last acquired uplink data frame while the uplink data frame is acquired, and the address comparison result corresponding to the second serial number identifier is queried from the frame address comparison list according to the second serial number identifier. Since the uplink data frame and the downlink data frame corresponding thereto have the same serial number identifier, the address comparison result of the uplink data frame can be quickly determined by querying the frame address comparison list while the uplink data frame is acquired, the address comparison is quickly completed, the real-time performance of the uplink data frame forwarding is improved, and the delay of the uplink data frame forwarding is reduced.
[0086] Referring to Figure 5 , the figure is a structural schematic diagram of an embodiment of a data frame real-time forwarding device provided by the application. The device 50 comprises an acquisition module 51, a first processing module 52, and a second processing module 53.
[0087] The acquisition module 51 is configured to acquire a downlink data frame from a main network. The downlink data frame is a data frame to be forwarded to a sub-network through the main network. The first processing module 52 is configured to compare a target address of the downlink data frame with a node address of the sub-network while forwarding the downlink data frame to the sub-network, and obtain an address comparison result corresponding to the downlink data frame. The second processing module 53 is configured to determine a forwarding instruction corresponding to the downlink data frame according to the address comparison result corresponding to the downlink data frame, and execute the forwarding instruction.
[0088] The data frame real-time forwarding device provided by the embodiment of the application can execute the technical solutions shown in the method embodiments, and has similar implementation principles and beneficial effects, which will not be described here in detail.
[0089] Further, on the basis of the above embodiment, the second processing module 53 is specifically configured to determine that the forwarding instruction corresponding to the downlink data frame is to continue forwarding and continue the forwarding operation of the downlink data frame if the address comparison result of the downlink data frame is that the addresses are the same, or determine that the forwarding instruction corresponding to the downlink data frame is to stop forwarding and stop the forwarding operation of the downlink data frame if the address comparison result of the downlink data frame is that the addresses are not the same.
[0090] The data frame real-time forwarding device provided by the embodiment of the application can execute the technical solutions shown in the method embodiments, and has similar implementation principles and beneficial effects, which will not be described here in detail.
[0091] Referring to Figure 6 The figure is a structural schematic diagram of another embodiment of a data frame real-time forwarding device provided by the application. On the basis of the above-mentioned embodiment, the device 50 can further include a third processing module 54.
[0092] The third processing module 54 is configured to add the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame to the frame address comparison list; the frame address comparison list is configured to query the address comparison result; in response to an uplink data frame obtained from the sub-network, the address comparison result corresponding to the uplink data frame is determined from the frame address comparison list; the uplink data frame is a data frame forwarded to the main network through the sub-network; if the address comparison result corresponding to the uplink data frame is that the addresses are the same, the forwarding operation of the uplink data frame is continued; or, if the address comparison result corresponding to the uplink data frame is that the addresses are different, the forwarding operation of the uplink data frame is stopped.
[0093] The data frame real-time forwarding device provided by the embodiment of the application can execute the technical solutions shown in the above-mentioned method embodiments, and has similar implementation principles and beneficial effects, which will not be described here in detail.
[0094] Further, on the basis of the above-mentioned embodiment, the third processing module 54 is specifically configured to generate the sequence number identifier corresponding to the downlink data frame by using a counter while forwarding the downlink data frame to the sub-network, and add the sequence number identifier to the corresponding downlink data frame; and store the sequence number identifier corresponding to the downlink data frame and the address comparison result corresponding to the downlink data frame in the frame address comparison list.
[0095] The data frame real-time forwarding device provided by the embodiment of the application can execute the technical solutions shown in the above-mentioned method embodiments, and has similar implementation principles and beneficial effects, which will not be described here in detail.
[0096] Further, on the basis of the above-mentioned embodiment, the third processing module 54 is specifically configured to determine the second sequence number identifier of the uplink data frame according to the first sequence number identifier of the last obtained uplink data frame while obtaining the uplink data frame from the sub-network; and query the address comparison result corresponding to the second sequence number identifier from the frame address comparison list according to the second sequence number identifier, the address comparison result corresponding to the second sequence number identifier being the address comparison result corresponding to the uplink data frame.
[0097] The data frame real-time forwarding device provided by the embodiment of the application can execute the technical solutions shown in the above-mentioned method embodiments, and has similar implementation principles and beneficial effects, which will not be described here in detail.
[0098] Referring to Figure 7Fig. 1 is a structural schematic diagram of one embodiment of a hybrid network topology provided by the present application. The hybrid network topology includes a master network, a plurality of sub-networks, and a data frame real-time forwarding device corresponding to each of the plurality of sub-networks;
[0099] The master network adopts field bus technology, and the sub-networks adopt Ethercat networks.
[0100] The sub-networks communicate with the master network through the data frame real-time forwarding device corresponding to each of the sub-networks.
[0101] The data frame real-time forwarding device is configured to implement the data frame real-time forwarding method described in any of the above embodiments.
[0102] In the embodiment, the hybrid network topology is a two-level network topology. The first level network is the master network, which adopts field bus technology, and all the sub-networks are connected to the same bus. The second level network is at least one sub-network, which adopts an Ethercat network. The master network and the sub-networks communicate with each other through the data frame real-time forwarding device, so that each sub-network can be hot-plugged at any time without affecting other sub-networks, and the access to multiple Ethercat terminals in the sub-network is low-latency and high-speed. When the number of sub-networks needs to be expanded, the expansion can be performed on the sub-networks. Since the master network and the sub-networks have the same transmission speed, the entire network can achieve the transmission speed of an industrial Ethernet, thereby improving the transmission speed of the network topology.
[0103] It can be understood that the Ethercat network can be one Ethercat terminal or multiple Ethercat terminals, and the maximum number of Ethercat terminals is 65535. The data frame real-time forwarding device directly connected to the master network has a limited number, generally not more than 32 or 64, because it shares the bus and needs to achieve high-speed transmission.
[0104] The data frame real-time forwarding device provided by the embodiment of the present application can execute the technical solutions shown in the above method embodiments, and has similar implementation principles and beneficial effects, which will not be described here again.
[0105] Referring to Figure 8 Fig. 1 is a structural schematic diagram of one embodiment of a hybrid network topology provided by the present application. The hybrid network topology includes a master network, a plurality of sub-networks, and a data frame real-time forwarding device corresponding to each of the plurality of sub-networks;
[0106] The processor 81 is in communication connection with the memory 82, and the memory 82 is configured to store computer execution instructions. The processor 81 is configured to execute the technical solutions in any of the above method embodiments by executing the computer execution instructions stored in the memory 82.
[0107] Optionally, the memory 82 can be independent or integrated with the processor 81. Optionally, when the memory 82 is independent of the processor 81, the electronic device 80 can further include a bus for connecting the above-mentioned devices.
[0108] The electronic device is used for executing the technical solutions in any of the above method embodiments, and has similar implementation principles and technical effects, which are not described here again.
[0109] The embodiments of the present application further provide a computer readable storage medium, which stores computer execution instructions. The computer execution instructions are executed by a processor to implement the above method, and have similar implementation principles and technical effects, which are not described here again.
[0110] It should be noted that each of the embodiments in the present specification is described in a progressive manner, and the same and similar parts between each embodiment can be referred to each other. Each embodiment focuses on the difference from other embodiments. Especially, the device embodiment is basically similar to the method embodiment, so the description is relatively simple, and the relevant part can be referred to the part of the method embodiment. The device embodiment described above is only schematic, and the unit described as a separate component can be or can not be physically separated, and the component prompted as a unit can be or can not be a physical unit, that is, it can be located in one place, or it can be distributed on multiple network units. According to the actual needs, part or all of the modules can be selected to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement it without creative labor.
[0111] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for real-time forwarding of data frames, characterized in that, The method comprises: obtaining a downlink data frame from a master network; the downlink data frame is a data frame forwarded by the master network to a slave network; comparing a target address of the downlink data frame with a node address of the slave network while forwarding the downlink data frame to the slave network, and stopping the forwarding operation of the downlink data frame when it is determined that the target address is different from the node address; continuing the forwarding operation of the downlink data frame when it is determined that the target address is the same as the node address; adding a sequence number identifier of the downlink data frame and an address comparison result of the downlink data frame to a frame address comparison list; the frame address comparison list is used for querying the address comparison result; determining the address comparison result corresponding to the sequence number identifier of an uplink data frame from the frame address comparison list in response to the uplink data frame obtained from the slave network; the uplink data frame is a data frame forwarded by the slave network to the master network; the uplink data frame and the downlink data frame correspond to each other; the sequence number identifier of the uplink data frame is the same as that of the downlink data frame corresponding to the uplink data frame; if the address comparison result corresponding to the uplink data frame is the same address, continuing the forwarding operation of the uplink data frame; or if the address comparison result corresponding to the uplink data frame is a different address, stopping the forwarding operation of the uplink data frame.
2. The method of claim 1, wherein, The adding of the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame to the frame address comparison list comprises: generating the sequence number identifier corresponding to the downlink data frame by using a counter while forwarding the downlink data frame to the slave network, and adding the sequence number identifier to the corresponding downlink data frame; storing the sequence number identifier corresponding to the downlink data frame and the address comparison result corresponding to the downlink data frame in the frame address comparison list.
3. The method of claim 1, wherein, The determining of the address comparison result corresponding to the uplink data frame from the frame address comparison list in response to the uplink data frame obtained from the slave network comprises: determining a second sequence number identifier of the uplink data frame according to a first sequence number identifier of a last obtained uplink data frame while obtaining the uplink data frame from the slave network; querying the address comparison result corresponding to the second sequence number identifier from the frame address comparison list according to the second sequence number identifier; the address comparison result corresponding to the second sequence number identifier is the address comparison result corresponding to the uplink data frame.
4. The method of claim 1, wherein, The data frame format of the uplink data frame is the same as that of the downlink data frame.
5. A data frame real-time forwarding apparatus, characterized by comprising: It comprises: an obtaining module, configured to obtain a downlink data frame from a master network; the downlink data frame is a data frame forwarded by the master network to a slave network; a first processing module, configured to compare a target address of the downlink data frame with a node address of the slave network while forwarding the downlink data frame to the slave network; a second processing module, configured to stop the forwarding operation of the downlink data frame when it is determined that the target address is different from the node address; continue the forwarding operation of the downlink data frame when it is determined that the target address is the same as the node address; The third processing module is configured to add the sequence number identifier of the downlink data frame and the address comparison result of the downlink data frame to a frame address comparison list, the frame address comparison list is used for querying the address comparison result, and in response to an uplink data frame obtained from the sub-network, the frame address comparison list is used to determine the address comparison result corresponding to the sequence number identifier of the uplink data frame, and the uplink data frame is a data frame forwarded to the main network through the sub-network. The uplink data frame corresponds to the downlink data frame in a one-to-one manner, the sequence number identifier of the uplink data frame is the same as that of the downlink data frame corresponding to the uplink data frame, if the address comparison result corresponding to the uplink data frame is the same address, the forwarding operation of the uplink data frame is continued, or if the address comparison result corresponding to the uplink data frame is a different address, the forwarding operation of the uplink data frame is stopped. Or, if the address comparison result corresponding to the uplink data frame is a different address, the forwarding operation of the uplink data frame is stopped.
6. A hybrid network topology, characterized by The device comprises: a main network, a plurality of sub-networks, and a data frame real-time forwarding device corresponding to each of the plurality of sub-networks; the main network adopts field bus technology; the sub-network adopts Ethercat network; the sub-network communicates with the main network through the data frame real-time forwarding device corresponding to the sub-network; the data frame real-time forwarding device is configured to implement the method according to any one of claims 1 to 4.
7. An electronic device, comprising: The device comprises a processor and a memory connected to the processor in communication; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Multicasting procedure in wireless mesh network
KR1020090003582A