Data stream transmission method and device, medium, equipment and product

By implementing data frame replication and discarding strategies in the relay device and receiving agent of automotive network communication, network congestion and resource waste caused by data frame repetition in traditional technology are solved, and more efficient and reliable data streaming transmission is achieved.

CN119728581APending Publication Date: 2025-03-28CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411822398.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In automotive network communication, the traditional CAN/LIN/FlexRay bus causes the relay device to copy and transmit repeated data frames multiple times, resulting in network congestion, waste of resources and increased processing complexity of the receiver.

Method used

By implementing the copy and discarding strategy of data frames in the relay device and the receiving agent, only the first copy frame of the target original frame is copied and transmitted, and other copy frames are discarded to avoid unnecessary data copy and transmission.

Benefits of technology

It effectively reduces the processing load of the relay device, avoids resource waste and potential network congestion, reduces the data processing volume of the receiving agent, and improves the reliability of data stream transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728581A_ABST
    Figure CN119728581A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data stream transmission method and device, a medium, equipment and a product. The method comprises the following steps: receiving a first copy frame of a target original frame in a data stream to be transmitted, under the condition that the first copy frame is the first copy frame of the target original frame received by relay equipment, executing copy operation on the first copy frame to obtain a group of second copy frames, and transmitting the group of second copy frames to a receiving agent end; if the frame is not the first replicated frame, the first replicated frame is discarded. According to the data transmission method and device, the problems that network congestion and resource waste are possibly caused and the data processing amount of the receiving end is large in the prior art can be solved, and errors caused by data redundancy processing can be reduced by reducing redundant data frames generated by data stream transmission, so that the reliability of data stream transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data transmission, and specifically, to a data stream transmission method, apparatus, medium, equipment and product. Background Art

[0002] Automotive network communication is a network communication system with high reliability requirements. Judging from the evolution of the in-vehicle E / E architecture, in-vehicle Ethernet transmission has become an inevitable trend.

[0003] In the related art, through the CAN / LIN / FlexRay bus of the traditional vehicle network, when a relay device receives a copy frame of an original frame, it directly copies it and forwards it to the receiving end.

[0004] However, with this transmission method, the relay device may copy and transmit duplicate data frames multiple times, which may cause network congestion and resource waste in a high-bandwidth, high-concurrency network environment. In addition, since the relay device may copy and transmit duplicate data frames unnecessarily, data frames in the data stream may be transmitted repeatedly, increasing the processing complexity of the receiving end. Summary of the invention

[0005] The embodiments of the present application provide a data stream transmission method, apparatus, medium, equipment and product to at least solve the technical problems of network congestion, resource waste and increased processing complexity at the receiving end that may be encountered in data stream transmission in the related art.

[0006] According to one aspect of an embodiment of the present application, a data stream transmission method is provided, which is applied to a relay device, and the relay device is used to transmit data between a sending agent and a receiving agent. The method includes:

[0007] receiving a first duplicate frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream allowing frame duplication, and the first duplicate frame is a duplicate frame of the target original frame;

[0008] In the case where the first duplicate frame is the first duplicate frame of the target original frame received by the relay device, performing a duplication operation on the first duplicate frame to obtain a set of second duplicate frames, and transmitting the set of second duplicate frames to the receiving agent end;

[0009] In a case where the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device, the first duplicate frame is discarded.

[0010] According to another aspect of an embodiment of the present application, a data stream transmission method is provided, which is applied to a receiving agent, and the receiving agent is used to transmit data between a relay device and a receiving device, and the method includes:

[0011] receiving a second copy frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream allowing frame replication, and the second copy frame is a copy frame of the target original frame;

[0012] In the case where the second duplicate frame is a first duplicate frame of the target original frame received by the receiving agent, transmitting the second duplicate frame to the receiving device;

[0013] In the case that the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent, the second duplicate frame is discarded.

[0014] According to another aspect of an embodiment of the present application, a data stream transmission device is provided, which is applied to a relay device, and the relay device is used to transmit data between a sending agent and a receiving agent, and the device includes:

[0015] A first receiving module, configured to receive a first duplicate frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame duplication, and the first duplicate frame is a duplicate frame of the target original frame;

[0016] A replication module, configured to perform a replication operation on the first replication frame to obtain a set of second replication frames, and transmit the set of second replication frames to a receiving agent end when the first replication frame is the first replication frame of the target original frame received by the relay device;

[0017] The first discarding module is used to discard the first duplicate frame if the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device.

[0018] According to another aspect of an embodiment of the present application, a data stream transmission device is provided, which is applied to a receiving agent end, and the receiving agent end is used to transmit data between a relay device and a receiving device, and the device includes:

[0019] A second receiving module is used to receive a second copy frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame replication, and the second copy frame is a copy frame of the target original frame;

[0020] A transmission module, configured to transmit the second duplicate frame to a receiving device if the second duplicate frame is a first duplicate frame of a target original frame received by the receiving agent;

[0021] The second discarding module is used to discard the second duplicate frame when the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent.

[0022] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0023] According to another aspect of the embodiments of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in any one of the above method embodiments when executing the computer program.

[0024] According to another aspect of the embodiments of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any of the above method embodiments.

[0025] Through the present application, since the relay device only performs a copy operation on the first copy frame of the target original frame and discards other first copy frames, unnecessary data copying on the relay device can be avoided, thereby reducing the processing load of the relay device, avoiding resource waste and potential network congestion. Since the relay device only transmits and processes the copy frame of the first copy frame of the target original frame, the data processing amount of the receiving agent can be reduced. In addition, by reducing the redundant data frames generated by the data stream transmission, the errors caused by data redundant processing can be reduced, thereby improving the reliability of data stream transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a hardware structure block diagram of a mobile terminal according to an optional data stream transmission method of an embodiment of the present application;

[0027] Figure 2 is a flowchart of an optional data stream transmission method according to an embodiment of the present application;

[0028] Figure 3 is a schematic diagram of an optional network topology according to an embodiment of the present application;

[0029] Figure 4 is a schematic diagram of information stored in each field in an optional data frame according to an embodiment of the present application;

[0030] Figure 5 is a flowchart of an optional frame elimination operation according to an embodiment of the present application;

[0031] Figure 6is a flowchart of another optional data stream transmission method according to an embodiment of the present application;

[0032] Figure 7 is a schematic diagram of an optional data frame transmission process according to an embodiment of the present application;

[0033] Figure 8 is a flowchart of another optional data stream transmission method according to an embodiment of the present application;

[0034] Fig. 9 is a structural block diagram of an optional data stream transmission device according to an embodiment of the present application;

[0035] Fig.10 is a structural block diagram of another optional data stream transmission device according to an embodiment of the present application;

[0036] Fig.11 It is a block diagram of a computer system structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0037] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0039] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a data stream transmission method according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0040] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data stream transmission method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0042] In this embodiment, a data stream transmission method running on the above mobile terminal is provided. Figure 2 is a flow chart of an optional data stream transmission method according to an embodiment of the present application, the method is applied to a relay device, the relay device is used to transmit data between a sending agent and a receiving agent, such as Figure 2 As shown, the process includes the following steps:

[0043] Step S202, receiving a first duplicate frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame duplication, and the first duplicate frame is a duplicate frame of the target original frame;

[0044] It should be noted that the relay device mainly plays the role of a bridge in the data transmission process, which is used to help data packets reach the destination from the source. Relay devices can be routers, switches, bridges, repeaters, etc. The sending agent usually refers to the software or hardware device responsible for data transmission in network communication, and the receiving agent is the software or hardware device located at the data destination, which is used to receive and decapsulate data packets and pass the data to the final receiving device.

[0045] The relay device can be a switching device or a bridging device that supports TSN (Time-Sensitive Networking) to connect different network segments in the TSN network to ensure timely data transmission. Similarly, the switching device that supports TSN can also be between the sending agent and the receiving agent. Figure 3 , shows a schematic diagram of an optional network topology of an embodiment of the present application. Among them, the sending device communicates with the sending agent, and multiple relay devices can be directly or indirectly connected to the sending agent and the receiving agent; the receiving device communicates with the receiving agent. Multiple relay devices can be directly or indirectly connected to form a network topology. Specifically, as Figure 3 As shown, the multiple relay devices may be relay device A, relay device B, relay device C and relay device D. Figure 3 The above is only to show an example, and the present application can be applied to other network topologies including a sending agent, a relay device and a receiving agent.

[0046] Specifically, the data stream to be transmitted may be a data stream that allows frame duplication. The data stream to be transmitted generally consists of a plurality of data frames to be transmitted, and the data stream to be transmitted may include one or more target original frames. The target original frame may be identified by the sending agent. In specific practice, the sending agent may identify whether the data frame is a key data frame based on the header information corresponding to each data frame in the data stream sent by the sending device, and determine that the data stream to be transmitted needs to be duplicated if there is a key data frame. In the case where the data stream to be transmitted needs to be duplicated, the key data frame may be duplicated as the target original frame, or each data frame to be transmitted in the data stream may be duplicated as the target original frame. Among them, the header information corresponding to each data frame to be transmitted may include but is not limited to the source MAC address, VLAN, priority information and IP information. The header information (also called the frame header or leading information) contains a plurality of fields for indicating and controlling the transmission of data. In specific practice, which data frames to be transmitted are key data frames may be determined according to pre-set requirements. For example, in the case where the sending device is an important device, each data frame to be transmitted in the data stream sent from the sending device may be identified as a key data frame. Alternatively, based on the priority information of each data frame to be transmitted, the data frame to be transmitted with a higher priority can be determined as a key data frame. Alternatively, based on the IP information of the data frame to be transmitted, when the IP information is within a preset range, the data frame to be transmitted is determined to be a key data frame.

[0047] In specific practice, the relay device may receive multiple different data frames to be transmitted from different ports, wherein the data frame to be transmitted may be a copy frame of the target original frame of the data stream to be transmitted, or may be an original frame or a copy frame of other data streams, and the relay device may determine whether the received data frame to be transmitted is a copy frame of the target original frame. The relay device may receive the first copy frame of the target original frame in the data stream to be transmitted from the sending agent or another relay device connected thereto, and the first copy frame may be a copy frame of the target original frame.

[0048] Step S204, when the first duplicate frame is the first duplicate frame of the target original frame received by the relay device, performing a duplication operation on the first duplicate frame to obtain a set of second duplicate frames, and transmitting the set of second duplicate frames to the receiving agent;

[0049] Exemplarily, a group of second copy frames includes at least one second copy frame. The relay device has a flow identification function, and can perform frame identification on the received first copy frame to identify whether the first copy frame is the first copy frame of the target original frame received by the relay device. In the case where the first copy frame is the first copy frame of the target original frame received by the relay device, a copy operation is performed on the first copy frame to obtain a group of second copy frames. The copy operation can be to directly copy the first copy frame, or to copy by changing the relevant information carried in the first copy frame. The number of second copy frames in a group of second copy frames can be determined based on the device to which the relay device is connected. How the relay device identifies whether the first copy frame is the first copy frame of the target original frame received by the relay device can be based on the packet header information carried by the first copy frame.

[0050] like Figure 3 As shown, if the current relay device is relay device A, the number of second copy frames obtained by the copy operation may be based on the number of ports between other devices connected to relay device A, that is, 2.

[0051] It should be noted that if the relay device is connected to other relay devices, the second duplicate frame will be transmitted to the receiving agent and other relay devices connected thereto respectively, and then other relay devices connected thereto will perform related operations so that the receiving agent receives at least one second duplicate frame. If the relay device is not directly connected to the corresponding receiving agent, the frame elimination operation and frame duplication operation of the duplicate frame will be repeatedly performed during the transmission of the duplicate frame until it is transmitted to the corresponding receiving agent.

[0052] Step S206: If the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device, discard the first duplicate frame.

[0053] Exemplarily, when the relay device identifies through the flow identification function that the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device, the first duplicate frame will be discarded. By performing a frame elimination operation on the duplicate frames of the same flow, only one duplicate frame is retained. The relay device performs a duplication operation on the currently retained first duplicate frame to obtain a set of second duplicate frames, and directly or indirectly transmits the second duplicate frames to the receiving agent.

[0054] Through the above steps, the relay device identifies and only copies and forwards the first copy frame of the target original frame, which can avoid unnecessary data copying on the relay device, thereby reducing the processing load of the relay device, avoiding resource waste and potential network congestion. Since the relay device only transmits the copy frame of the first copy frame of the target original frame, the data processing amount of the receiving agent can be reduced. In addition, by reducing the redundant data frames generated by the data stream transmission, the errors caused by data redundancy processing can be reduced, thereby improving the reliability of data stream transmission.

[0055] In an exemplary embodiment, after receiving the first copy frame of the target original frame in the data stream to be transmitted, it also includes: extracting the label information carried by the first copy frame to obtain the target label information, wherein the target label information includes the first serial number of the target original frame and the first timestamp of the target original frame; based on the target label information and the label information carried by the copy frame received by the relay device, determining whether the first copy frame is the first copy frame of the target original frame received by the relay device.

[0056] It should be noted that the tag information carried by the duplicate frame corresponding to the target original frame is consistent with the tag information carried by the target original frame. For each target original frame in the data stream to be transmitted, the corresponding packet header information includes the destination MAC, source MAC, protocol standard (which can be 802.1QTag), tag information, length / type, data, and FCS (Frame Check Sequece). The tag information includes Ethernet category, timestamp, and sequence number.

[0057] Specifically, refer to Figure 4 , a schematic diagram showing information stored in each field in an optional data frame of an embodiment of the present application.

[0058] The destination MAC is the physical address of the device to which the data is sent. In Ethernet, it is used to ensure that the data packet can be identified by the correct receiving device.

[0059] The source MAC is the physical address of the device that sends the data, and is used by the receiving device to know the sending device of the data.

[0060] Protocol standards refer to the network protocols followed by data packets, such as Ethernet, IP, TCP, UDP, etc., which are used to define the structure of data packets, how to parse data packets, and how to process data packets.

[0061] Tag information usually refers to VLAN (Virtual Local Area Network) tags, which are used to create multiple logical networks on a physical network.

[0062] Ethernet category, used to distinguish different types of Ethernet frames, such as common Ethernet frames and VLAN frames.

[0063] Timestamp, used to record the time when the data packet is created, to facilitate network management and fault diagnosis.

[0064] Sequence numbers are used to ensure the order and integrity of data packets.

[0065] Length / Type: used in Ethernet frames to indicate the length of the data field or the type of the upper layer protocol.

[0066] Data is the actual information transmitted in the data packet and can be any form of data, such as files, messages, pictures, etc.

[0067] FCS is a field used for error detection and for the receiving device to verify whether errors occurred during data transmission.

[0068] The sequence number identifies the frame sequence number of each data frame in the same data stream, and the same duplicate frame has the same sequence number and timestamp. The timestamp can be a message timestamp. The relay device has the functions of stream identification and sequence decoding, and can identify the label information carried by the received duplicate frame, so as to identify whether the duplicate frame is the first duplicate frame of the target original frame received by the relay device based on the label information.

[0069] Exemplarily, the basis for determining whether the first duplicate frame is the first duplicate frame of the target original frame received by the relay device can be by comparing the target tag information with the tag information carried by the duplicate frame received by the relay device. Specifically, the first serial number in the target tag information can be compared with the serial number in the tag information carried by the duplicate frame received by the relay device, or the first timestamp in the target tag information can be compared with the timestamp in the tag information carried by the duplicate frame received by the relay device, or the first serial number can be compared with the serial number in the tag information carried by the duplicate frame received by the relay device, and the first timestamp can be compared with the timestamp in the tag information carried by the duplicate frame received by the relay device.

[0070] Through this embodiment, after receiving the first copy frame of the target original frame in the data stream to be transmitted, the target label information is obtained by extracting the label information carried by the first copy frame, and based on the target label information and the label information carried by the copy frame received by the relay device, it is determined whether the first copy frame is the first copy frame of the target original frame received by the relay device, thereby realizing frame elimination operation on duplicate frames of the same data stream, so that only one duplicate frame is retained, reducing redundant data frames generated by data stream transmission, and can reduce errors caused by data redundancy processing, thereby improving the reliability of data stream transmission.

[0071] In an exemplary embodiment, judging whether the first duplicate frame is the first duplicate frame of the target original frame received by the relay device based on the target tag information and the tag information carried by the duplicate frame received by the relay device includes:

[0072] When the first sequence number is within a preset value range, determining whether the first sequence number is within a specified sliding value range, wherein the preset value range is a value range allowed by the sequence number of the original frame, and the specified sliding value range is determined based on the sequence number carried by the duplicate frame received by the relay device and a preset sliding window size;

[0073] When the first sequence number is within the specified sliding value range, determining whether the relay device has received a duplicate frame carrying the first sequence number;

[0074] In the case where the relay device receives the duplicate frame carrying the first sequence number, determine the time difference between the first timestamp and the first specified timestamp to obtain the target time difference, wherein the first specified timestamp is the timestamp when the relay device receives the duplicate frame carrying the first sequence number;

[0075] When the target time difference is greater than or equal to a preset time difference threshold, it is determined that the first duplicate frame is the first duplicate frame of the target original frame received by the relay device.

[0076] It should be noted that the first sequence number is the sequence number of the first duplicate frame received by the current relay device. The first timestamp is the timestamp of the first duplicate frame received by the current relay device. The duplicate frame corresponding to the target original frame may have the same sequence number and timestamp as the target original frame. The preset value range may be the value range allowed by the sequence number of the original frame. The specified sliding value range may be determined based on the sequence number carried by the duplicate frame received by the relay device and the preset sliding window size. Among them, the sequence number carried by the duplicate frame received by the relay device may use the maximum value of the sequence numbers received by the relay device in the preset time period, or may be the sequence number of a duplicate frame received most recently. The size of the preset sliding window may be determined based on an empirical value. The first specified timestamp is the timestamp of the duplicate frame received by the relay device carrying the first sequence number, that is, the timestamp corresponding to the duplicate frame received by the relay device with the same first sequence number. The target time difference may be the time difference between the first timestamp and the first specified timestamp. The size of the preset time difference threshold may be configured and adjusted based on the required duration of the data frames that can be continuously sent within the preset value range. For example, when the preset value range is 0-65535, the size of the preset time difference threshold is adjusted and configured based on the time required for the relay device to continuously send 65535 data frames. Generally, the preset time difference threshold can be determined based on empirical values, and the general value can be 200 microseconds.

[0077] When the sending agent terminal identifies the existence of the target original frame in the data stream to be transmitted, it can generate a sequence number corresponding to each data frame in the data stream through the sequence generation function, and encapsulate the sequence number into the packet header information of the original frame for transmission to the relay device connected to the sending agent terminal. Among them, the sequence number is set with a corresponding preset value range. The preset value range can be the value range allowed by the sequence number of the original frame. Generally, the preset value range can be 0-65535. In specific practice, since the number of different data frames in different data streams to be transmitted is different, the value of the sequence number is incremented in sequence and used cyclically.

[0078] In practice, the relay device extracts the content of the received duplicate frame tag information, including the sequence number and timestamp, through the flow identification function. The relay device receives the duplicate frame through one or more ports, and performs a single-stream frame elimination operation on the received duplicate frame, that is, if the same sequence number and timestamp of the same data stream are received multiple times, it is determined that there are duplicate frames, and only the first duplicate frame received is retained, and the subsequent duplicate frames received are discarded. The single-stream frame elimination operation can solve the abnormal situation of repeatedly sending the same duplicate frame when the upstream device in the network topology is stuck, and can also solve the problem of data duplication when the relay device receives the same duplicate frame through different ports.

[0079] In order to better understand that in this embodiment, only the first received duplicate frame is retained and subsequent received duplicate frames are discarded, an example is used for explanation. Figure 5 FIG. 1 is a flow chart showing an optional frame elimination operation of an embodiment of the present application. Specifically, the following steps are included:

[0080] Step S502: Obtain a first sequence number and a first timestamp of a first duplicate frame, and obtain label information carried by the received duplicate frame.

[0081] Step S504, determining whether the first serial number is within a preset value range.

[0082] When the first serial number is within the preset value range, jump to step S506; when the first serial number is not within the preset value range, jump to step S516.

[0083] Step S506, determining whether the first serial number is within a specified sliding value range.

[0084] When the first serial number is within the specified sliding value range, jump to step S508; when the first serial number is not within the specified sliding value range, jump to step S516.

[0085] Step S508: determine whether a duplicate frame carrying the first sequence number has been received.

[0086] When the relay device receives the duplicate frame carrying the first sequence number, the process jumps to step S510 ; when the relay device does not receive the duplicate frame carrying the first sequence number, the process jumps to step S512 .

[0087] Step S510, determining whether the target time difference is greater than or equal to a preset time difference threshold.

[0088] The target time difference is the time difference between the first timestamp and the first specified timestamp; the first specified timestamp is the timestamp when the relay device receives the duplicate frame carrying the first sequence number, that is, the timestamp corresponding to the duplicate frame with the same first sequence number received by the relay device. If the target time difference is greater than or equal to the preset time difference threshold, jump to step S514; if the target time difference is less than the preset time difference threshold, jump to step S516.

[0089] Step S512: Do not discard the duplicate frame.

[0090] Step S514, discarding the previous duplicate frame;

[0091] Step S516: discard the duplicate frame.

[0092] Specifically, the previous duplicate frame is a duplicate frame having the same sequence number as the first duplicate frame and a target time difference with the first duplicate frame greater than a preset time difference threshold. The previous duplicate frame is discarded and the duplicate frame, ie, the first duplicate frame, is retained.

[0093] It should be noted that in the event of a network anomaly, data frames with sequence numbers belonging to the previous data stream are still sent. In the process of forwarding data frames in this data stream, data frames with the same sequence number but not the same data frame may appear. In this case, the previous copy frame (i.e., the abnormal copy frame) is discarded and the first copy frame is retained.

[0094] Through this embodiment, it is judged in turn whether the first sequence number is within the preset value range, whether it is within the specified sliding value range, and whether the relay device has received the copy frame carrying the first sequence number. The sequence number of the copy frame is used to identify whether there is a copy frame with the same sequence number. In the case of the existence of copy frames with the same sequence number, the timestamp of the copy frame is used to further determine whether there is a copy frame of the same data stream, thereby realizing single-stream frame elimination and solving the problem of data duplication when the relay device receives the same copy frame through different ports.

[0095] In an exemplary embodiment, before determining whether the first serial number is within a specified sliding value range, the method further includes:

[0096] Determine a sliding value range with a second sequence number carried by a second designated copy frame received by the relay device as an intermediate value and a preset sliding window size as a window size as a designated sliding value range, wherein the second designated copy frame is the last copy frame that has not been discarded among the copy frames received by the relay device;

[0097] After receiving the first copy frame of the target original frame of the data stream to be transmitted, the method also includes: when the first copy frame is the first copy frame of the target original frame received by the relay device, updating the specified sliding value range to a sliding value range with the first sequence number as the intermediate value and a preset sliding window size as the window size.

[0098] It should be noted that the label information carried by the second designated duplicate frame includes a second sequence number and a second timestamp. The second designated duplicate frame is the last duplicate frame that has not been discarded among the duplicate frames received by the relay device. Specifically, when determining whether different duplicate frames need to be discarded or retained, the selected first designated duplicate frame and the second designated duplicate frame are different.

[0099] The designated sliding value range is determined based on a sliding value range with the second sequence number carried by the second designated copy frame as the middle value and a preset sliding window size as the window size.

[0100] In specific practice, the preset sliding window is set to SW, and the second sequence number of the current second designated copy frame is set to ID, then the corresponding determined designated sliding value range is The specified sliding value range is included in the preset value range. Since the sequence number is used cyclically within the preset value range, the sequence number increases to 65535 and then becomes 0, and the corresponding specified sliding value range is also changed accordingly as above. Every time the first duplicate frame arrives, the sequence number of the last duplicate frame that has not been discarded among the duplicate frames received by the relay device is used as the sliding window range of the intermediate value for judgment, and when the first duplicate frame is the first duplicate frame of the target original frame received by the relay device, the specified sliding value range is updated.

[0101] Through this embodiment, before determining whether the first sequence number is within the specified sliding value range, the specified sliding value range is determined through the second specified copy frame received by the relay device, and when the first copy frame is the first copy frame of the target original frame received by the relay device, the specified sliding value range is updated, thereby achieving flexible update of the specified sliding value range to better perform single-stream frame elimination, and solving the problem of data duplication when the relay device receives the same copy frame through different ports.

[0102] In an exemplary embodiment, different data frames to be transmitted in the data stream to be transmitted are identified by different sequence numbers, wherein the sequence number corresponding to the target original frame is the first sequence number; the above method further includes:

[0103] In response to the received data frame to be transmitted, performing a sequence number extraction operation on the sequence number field of the data frame to be transmitted to obtain a sequence number extraction result;

[0104] When the sequence number extraction result indicates that the first sequence number is extracted from the sequence number field of the data frame to be transmitted, it is determined that the data frame to be transmitted is a duplicate frame of the target original frame.

[0105] It should be noted that the data frame to be transmitted may be an original frame of the data stream to be transmitted or a copy frame corresponding to the original frame. There is at least one original frame in the data stream to be transmitted, and different data frames to be transmitted in the data stream to be transmitted are identified by different sequence numbers. There is at least one target original frame in the data stream to be transmitted, and the sequence number corresponding to the target original frame is the first sequence number.

[0106] Specifically, when the sending agent determines that the data stream to be transmitted is a key data stream, the sending agent configures a sequence number for each original frame in the data stream to be transmitted through the sequence number generation function, and performs a copy operation on the target original frame therein to obtain a group of first copy frames of the target original frame, and transmits each first copy frame to the relay device connected thereto. Of course, the sending agent can also transmit data frames that have not been copied to the relay device connected thereto.

[0107] For each data frame to be transmitted received by the relay device, the data frame to be transmitted will carry the corresponding sequence number field. Of course, the copy frame can also include other information. For details, refer to Figure 4 shown.

[0108] When the relay device receives a data frame to be transmitted, in response to the received data frame to be transmitted, it performs a sequence number extraction operation on the sequence number field of the data frame to be transmitted to obtain a sequence number extraction result. When the sequence number extraction result indicates that the first sequence number is extracted from the data frame to be transmitted, it is determined that the data frame to be transmitted is a copy frame of the target original frame represented by the first sequence number, which can also be said to be the first copy frame. When the sequence number extraction result indicates that the first sequence number cannot be extracted from the data frame to be transmitted, it means that the data frame to be transmitted is not a copy frame of the target original frame. Among them, the sequence number of the data frame to be transmitted can be configured by the sending agent. Specifically, the sending agent receives the data stream to be transmitted sent by the sending end, generates a sequence number through a sequence generation function, and encapsulates it into the field of the data frame to be transmitted, so as to configure the corresponding sequence number for each data frame to be transmitted in the data stream to be transmitted. Generally, the configuration order of the sequence number is ascending in sequence.

[0109] Through this embodiment, when the relay device receives a data frame to be transmitted, it performs a sequence number extraction operation, and when the first sequence number is extracted from the sequence number field of the data frame to be transmitted, it determines that the data frame to be transmitted is a copy frame of the target original frame, thereby filtering out the copy frame of the target original frame, and performing a frame elimination operation on the filter-out copy frame of the target original frame, so that only the first duplicate frame is retained in the relay device, reducing redundant data frames generated by data stream transmission, and can reduce errors caused by data redundancy processing, thereby improving the reliability of data stream transmission.

[0110] In an exemplary embodiment, performing a replication operation on a first replicated frame to obtain a set of second replicated frames, and transmitting the set of second replicated frames to a receiving agent end includes:

[0111] Changing the transmission port information of the first duplicate frame to obtain a set of second duplicate frames, wherein the transmission port information includes at least one of the following: target MAC, VLAN information;

[0112] Different second replicated frames in the group of second replicated frames are transmitted through different transmission paths based on the transmission port information of each second replicated frame in the group of second replicated frames.

[0113] It should be noted that transmission port information is usually used in network communication to ensure that data can be correctly transmitted from the source device to the target device. Port is an important concept in network communication, which is used to distinguish different services or applications on the same IP address. The target MAC address is a unique identifier of a network device (such as a network card, switch, router, etc.), usually consisting of 12 hexadecimal digits. In Ethernet communication, the transmission of data depends on the MAC address. When sending data, the source device will look up the MAC address of the target device and send the data packet to the address to be correctly transmitted to the target device in the network. VLAN information has a unique identifier. When transmitting data packets, VLAN information is used to ensure that data packets can only be transmitted between devices in the same VLAN to prevent data leakage between different VLANs and improve network security. The transmission port information carried in each second copy frame is different, while the other information carried is the same.

[0114] In specific practice, when the relay device completes the frame elimination operation of the first duplicate frame, the label information carried in the first duplicate frame will be encapsulated again, and the label information is consistent with the label information of the previous target original frame.

[0115] A relay device may have multiple ports, and each port may be connected to a different device. The relay device may change the transmission port information of the first copy frame according to the interface information of the device connected to it, thereby obtaining a group of second copy frames. Among them, the number of second copy frames included in a group of second copy frames may be determined based on the number of devices directly connected to the relay device. After changing the transmission port information of the first copy frame to copy a group of second copy frames, based on the transmission port information of each second copy frame in a group of second copy frames, different second copy frames in a group of second copy frames may be transmitted through different paths. Moreover, the number of copied second copy frames may be more in line with actual needs. The relay device may transmit the second copy frame directly or indirectly to the receiving agent. Specifically, the relay device may transmit the second copy frame through a path formed by one or more ports.

[0116] It should be noted that if the relay device is not directly connected to the corresponding receiving agent, the frame elimination operation and frame copying operation of the copied frame will be repeatedly performed during the transmission of the copied frame until it is transmitted to the corresponding receiving agent.

[0117] Through this embodiment, the second copy frame is obtained by changing the transmission port information of the first copy frame, and the transmission path is determined by the changed transmission port information, so that the second copy frame can be transmitted more accurately to improve the reliability of data stream transmission.

[0118] In this embodiment, another data stream transmission method running on the above mobile terminal is provided. Figure 6 FIG. 1 is a flow chart of another optional data stream transmission method according to an embodiment of the present application, which is applied to a receiving agent end, and the receiving agent end is used to transmit data between a relay device and a receiving device, such as Figure 6 As shown, the process of the method may include the following steps:

[0119] Step S602, receiving a second copy frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame replication, and the second copy frame is a copy frame of the target original frame;

[0120] It should be noted that the receiving agent is the agent terminal of the receiving device. A receiving agent can be connected to one or more receiving devices. The receiving agent can be used to transmit data between a relay device and a receiving device. The relay device can be a switching device or a bridging device that supports TSN (Time-Sensitive Networking) to connect different network segments in the TSN network to ensure timely transmission of data. Similarly, the sending agent and the receiving agent can also be a switching device that supports TSN. Specifically, refer to Figure 3 .

[0121] The data stream to be transmitted may be a data stream that allows frame duplication. The data stream to be transmitted may include one or more data frames to be transmitted, and the data stream to be transmitted may include one or more target original frames. The target original frame may be identified by the sending agent. In specific practice, the sending agent may identify whether the data frame to be transmitted is a key data frame based on the packet header information corresponding to each data frame to be transmitted in the data stream to be transmitted sent by the sending device, and in the case of the presence of a key data frame, determine that the data stream to be transmitted needs to be copied. In the case that the data stream to be transmitted needs to be copied, the key data frame may be copied as the target original frame, or each data frame to be transmitted in the data stream may be copied as the target original frame to obtain a group of first copy frames of the target original frame, and send them to the relay device connected to the sending agent respectively.

[0122] In the relay device, the intermediate device performs a sequence number extraction operation on the sequence number field of the data frame to be transmitted in response to the received data frame to be transmitted, and obtains a sequence number extraction result; when the sequence number extraction result indicates that the first sequence number is extracted from the sequence number field of the data frame to be transmitted, it is determined that the data frame to be transmitted is a copy frame of the target original frame. It can also be said that the data frame to be transmitted is the first copy frame. According to the label information of the currently received first copy frame, the target label information of the target original frame is obtained, so that according to the target label information and the label information carried by the copy frame received by the relay device, a frame elimination operation is performed on the first copy frame. Specifically, the frame elimination operation for the first duplicate frame can be to sequentially determine whether the first serial number is within a preset value range, whether it is within a specified sliding value range, and whether the relay device has received a duplicate frame carrying the first serial number, and identify whether there are duplicate frames with the same serial number through the serial number of the duplicate frame. In the case of duplicate frames with the same serial number, further determine whether they are duplicate frames of the same data stream through the timestamp of the duplicate frame, thereby achieving single-stream frame elimination. Specifically, the frame elimination operation for the first duplicate frame can refer to the embodiments corresponding to steps S502 to S516.

[0123] If the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device, the first duplicate frame is discarded. If the first duplicate frame is the first duplicate frame of the target original frame received by the relay device, a group of second duplicate frames are obtained by duplicating the first duplicate frame by changing the transmission port information of the first duplicate frame, and the transmission path of the second duplicate frame is determined according to the transmission port information of each second duplicate frame, so as to transmit the second duplicate frame to the receiving agent.

[0124] The second duplicate frame may be a duplicate frame of the target original frame, or in other words, the second duplicate frame may be a duplicate frame of the first duplicate frame when the first duplicate frame is the first duplicate frame of the target original frame received by the relay device. Specifically, the target original frame, the first duplicate frame, and the second duplicate frame carry the same label information and the same data, but the corresponding transmission port information is different.

[0125] For each second duplicate frame, the corresponding header information includes the destination MAC, source MAC, protocol standard, tag information, length / type, data, and FCS (Frame Check Sequece). The tag information includes Ethernet category, timestamp, and sequence number. For details, please refer to Figure 4 .

[0126] Exemplarily, after receiving the data frame to be transmitted, the receiving agent will perform a sequence number extraction operation on the sequence number field of the data frame to be transmitted in response to the received data frame to be transmitted, and obtain a sequence number extraction result to determine that the data frame to be transmitted is a copy frame of the target original frame, thereby determining that the data frame to be transmitted is a second copy frame of the target original frame.

[0127] Step S604, when the second duplicate frame is the first duplicate frame of the target original frame received by the receiving agent, the second duplicate frame is transmitted to the receiving device;

[0128] Exemplarily, when the receiving agent receives the second copy frame of the target original frame in the data stream to be transmitted, it determines whether the second copy frame is the first copy frame of the target original frame. Specifically, the receiving agent can receive a group of second copy frames of the target original frame in the data stream to be transmitted. This group of second copy frames can be obtained by transmitting by one relay device or multiple relay devices. When it is determined that the second copy frame of the target original frame in the data stream to be transmitted is received, it is determined whether the second copy frame is the first copy frame of the target original frame based on the label information of the second copy frame and the label information of the data frame received by the receiving agent, so as to perform a frame elimination operation on the second copy frame. Specifically, the frame elimination operation on the second copy frame can refer to the embodiments corresponding to steps S502 to S516.

[0129] The receiving agent can be connected to one or more receiving devices. In the case where the second copy frame is the first copy frame of the target original frame received by the receiving agent, the second copy frame can be transmitted to the corresponding receiving device according to the header information of the second copy frame. The fields included in the header information of the second copy frame can be referred to Figure 4 .

[0130] Step S606: If the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent, discard the second duplicate frame.

[0131] Exemplarily, when the receiving agent recognizes through the stream identification function that the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent, the second duplicate frame will be discarded. The receiving agent performs frame elimination operation on duplicate frames of the same stream so that only one duplicate frame is retained.

[0132] Through the above steps, the receiving agent determines whether the second copy frame is the first copy frame of the target original frame received by the relay device, so as to perform frame elimination operation on the duplicate frames of the same data stream, so that only one duplicate frame is retained, and the second copy frame which is the first copy frame of the target original frame is transmitted to the receiving device. By reducing the redundant data frames generated by the data stream transmission, the errors caused by data redundancy processing can be reduced, thereby improving the reliability of data stream transmission.

[0133] In an exemplary embodiment, the duplicate frame received by the receiving agent carries a sequence number of an original frame corresponding to the duplicate frame received by the receiving agent, and the sequence number carried by the second duplicate frame is the first sequence number; step S604 includes: storing the second duplicate frame in a first buffer queue, wherein the first buffer queue is used to store the duplicate frame to be transmitted to the receiving device;

[0134] When the number of duplicate frames stored in the first buffer queue is less than a first number threshold, waiting for the number of duplicate frames stored in the first buffer queue to reach the first number threshold;

[0135] When the number of duplicate frames stored in the first buffer queue is greater than or equal to the first number threshold and the sequence numbers carried by the duplicate frames stored in the first buffer queue do not increase in sequence, wait for the sequence numbers carried by the duplicate frames stored in the first buffer queue to increase in sequence until the number of duplicate frames stored in the first buffer queue reaches a second number threshold, wherein the second number threshold is greater than the first number threshold;

[0136] In a case where the sequence numbers carried by the duplicate frames stored in the first buffer queue are incremented sequentially, the duplicate frames stored in the first buffer queue are transmitted to the receiving device, so as to transmit the second duplicate frame to the receiving device;

[0137] When the number of duplicate frames stored in the first buffer queue reaches a second number threshold, the duplicate frames stored in the first buffer queue are transmitted to the receiving device, so as to transmit the second duplicate frame to the receiving device.

[0138] It should be noted that the second duplicate frame received by the receiving agent and the first duplicate frame received by the relay device both carry the serial number corresponding to the target original frame corresponding to the duplicate frame received by the receiving agent. In other words, for a target original frame, the serial numbers carried by its corresponding first duplicate frame and second duplicate frame are consistent. The serial number carried by the second duplicate frame can be the first serial number. The serial number carried by the first duplicate frame can be the first serial number.

[0139] In actual practice, since the corresponding duplicate frames in the data stream to be transmitted are transmitted on redundant paths, the arrival time of the duplicate frames may be different due to different paths, so that the first-sent data frame may arrive later, resulting in the data frames received by the receiving device being out of order.

[0140] In order to reduce the situation of frame disorder and improve the reliability of data stream transmission, frame sorting is achieved by establishing a first buffer queue. The first buffer queue can be used to store duplicate frames to be transmitted to a receiving device. Specifically, the process of reducing frame disorder through the first buffer queue may include: when the second duplicate frame is the first duplicate frame of the target original frame received by the receiving agent, the second duplicate frame is stored in the first buffer queue, and the number of duplicate frames stored in the first buffer queue is waited for to reach the first number threshold, and when the number of duplicate frames stored in the first buffer queue is greater than or equal to the first number threshold and the serial numbers carried by the duplicate frames stored in the first buffer queue are increased in sequence, the duplicate frames stored in the first buffer queue are transmitted to the receiving device to transmit the second duplicate frame to the receiving device; when the serial numbers carried by the duplicate frames stored in the first buffer queue are not increased in sequence, the serial numbers carried by the duplicate frames stored in the first buffer queue are waited for to increase in sequence until the number of duplicate frames stored in the first buffer queue reaches the second number threshold, and the duplicate frames stored in the first buffer queue are transmitted to the receiving device to transmit the second duplicate frame to the receiving device.

[0141] Among them, the second quantity threshold is greater than the first quantity threshold; the sizes of the first quantity threshold and the second quantity threshold can be set according to actual needs, and this application does not limit it here.

[0142] The first buffer queue may also have a self-sorting function. For example, when the first quantity threshold is set to 3 and the second quantity threshold is set to 6, if the serial numbers of the second copy frames in the first buffer queue are 1, 2, and 4, respectively, and the serial number of the fourth second copy frame is 3, the second copy frame with serial number 3 may be stored in a position between serial numbers 2 and 4 for sorting, and the second copy frames with serial numbers 1, 2, 3, and 4 obtained after sorting may be transmitted to the corresponding receiving device.

[0143] To better understand the above frame sorting process, an example is used to illustrate. Figure 7 , is a flow chart of an optional data frame transmission according to an embodiment of the present application.

[0144] Step S702: store the second duplicate frame into the first buffer queue.

[0145] Step S704: determine whether the number of duplicate frames stored in the first buffer queue is less than a first number threshold.

[0146] Specifically, when the number of duplicate frames stored in the first buffer queue is less than the first number threshold, jump to step S702; when the number of duplicate frames stored in the first buffer queue is greater than or equal to the first number threshold, jump to step S706.

[0147] Step S706, determining whether the sequence numbers carried by the duplicate frames stored in the first buffer queue are increasing in sequence.

[0148] Specifically, when the serial numbers carried by the duplicate frames stored in the first buffer queue do not increase sequentially, jump to step S708; when the serial numbers carried by the duplicate frames stored in the first buffer queue increase sequentially, jump to step S710.

[0149] Step S708: Transmit the duplicate frame stored in the first buffer queue to the receiving device, so as to transmit the second duplicate frame to the receiving device.

[0150] Step S710, wait for the serial number carried by the duplicate frames stored in the first buffer queue to increase successively until the number of duplicate frames stored in the first buffer queue reaches a second quantity threshold, and transmit the duplicate frames stored in the first buffer queue to the receiving device to transmit the second duplicate frame to the receiving device.

[0151] Through this embodiment, a first buffer queue is provided to store the second duplicate frame through the first buffer queue, and a first quantity threshold and a second quantity threshold are set, so that batch transmission is achieved, the number of network transmissions is reduced, and thus the transmission efficiency is improved. At the same time, the sequential transmission method enables the data frames to be transmitted in the correct order, avoiding confusion and loss of the data frames.

[0152] In an exemplary embodiment, after storing the second duplicate frame in the first buffer queue, the method further includes:

[0153] When the duplicate frames stored in the first buffer queue include duplicate frames whose storage duration in the first buffer queue reaches a first duration threshold, the duplicate frames stored in the first buffer queue are transmitted to the receiving device to transmit the second duplicate frame to the receiving device.

[0154] It should be noted that a timer may be provided in the first buffer queue, and the timer is used to record the storage duration of the duplicate frame in the first buffer queue. Specifically, multiple timers may be provided, and whenever a duplicate frame is stored in the first buffer queue, a timing operation is started to record the storage duration of the duplicate frame in the first buffer queue. In the case where there are duplicate frames in the first buffer queue whose storage duration reaches the first duration threshold, the duplicate frames whose storage duration reaches the first duration threshold are transmitted to the receiving device, and the duplicate frames stored in the first buffer queue may include the second duplicate frame. Specifically, the size of the first duration threshold may be set based on actual needs, and this application does not limit this.

[0155] Through this embodiment, by transmitting the duplicate frames whose storage time in the first buffer queue reaches the first time threshold to the receiving device, it is avoided that the duplicate frames are retained for a long time, thereby improving the data transmission efficiency.

[0156] In an exemplary embodiment, the duplicate frame received by the receiving agent carries the sequence number of the original frame corresponding to the duplicate frame received by the receiving agent, and the sequence number carried by the second duplicate frame is the first sequence number; the receiving agent transmits the received duplicate frames to the receiving device in the ascending order of the sequence numbers carried in the received duplicate frames, and the sequence number carried in the last duplicate frame transmitted by the receiving agent to the receiving agent is the designated sequence number;

[0157] Step S604 includes:

[0158] In the case where the first sequence number is a sequence number next to the designated sequence number, directly transmitting the second duplicate frame to the receiving device and updating the designated sequence number;

[0159] If the first sequence number is not a next sequence number of the specified sequence number, storing the second duplicate frame in a second buffer queue, wherein the second buffer queue is used to store the duplicate frame to be transmitted to the receiving device;

[0160] Based on the sequence number carried by the duplicate frame stored in the second buffer queue, the duplicate frame stored in the second buffer queue is transmitted to the receiving device, so as to transmit the second duplicate frame to the receiving device.

[0161] It should be noted that the second duplicate frame received by the receiving agent and the first duplicate frame received by the relay device both carry the serial number corresponding to the target original frame corresponding to the duplicate frame received by the receiving agent. In other words, for a target original frame, the serial numbers carried by its corresponding first duplicate frame and second duplicate frame are consistent. The serial number carried by the second duplicate frame can be the first serial number. The serial number carried by the first duplicate frame can be the first serial number.

[0162] The receiving agent can transmit the received duplicate frames to the receiving device in the ascending order of the sequence numbers carried in the received duplicate frames to prevent the omission of frames in the transmission of duplicate frames. Similarly, the receiving device does not need to perform sorting operations. In order to make it unnecessary for several devices to re-sort the received data frames, a designated sequence number is set. The designated sequence number can be the sequence number carried in the last duplicate frame transmitted by the receiving agent to the receiving agent, and the designated sequence number is updated each time the duplicate frame is transmitted to the receiving device. Specifically, when the first sequence number carried by the second duplicate frame is the next sequence number of the designated sequence number, the second duplicate frame is directly transmitted to the receiving device, and the designated sequence number is updated. When the first sequence number is not the next sequence number of the designated sequence number, the second duplicate frame is stored in the second buffer queue, and the designated sequence number is not updated at this time.

[0163] The second buffer queue can be used to store the duplicate frame to be transmitted to the receiving device. In specific practice, the duplicate frame stored in the second buffer queue can be transmitted to the receiving device according to the sequence number of the duplicate frame stored in the second buffer queue, so as to transmit the second duplicate frame to the receiving device.

[0164] Through this embodiment, by using the second buffer queue and the designated sequence number, the duplicate frames stored in the second buffer queue can be transmitted in an orderly manner, thereby improving the reliability of data stream transmission.

[0165] In an exemplary embodiment, based on the sequence number carried by the duplicate frame stored in the second buffer queue, transmitting the duplicate frame stored in the second buffer queue to the receiving device includes:

[0166] In a case where the minimum sequence number carried by the duplicate frames stored in the second buffer queue is the next sequence number of the specified sequence number, the duplicate frames stored in the second buffer queue are transmitted to the receiving device in the ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, the transmitted duplicate frames in the second buffer queue are deleted, and the specified sequence number is updated until the minimum sequence number carried by the duplicate frames stored in the second buffer queue is not the next sequence number of the specified sequence number;

[0167] When the duplicate frames stored in the second buffer queue include a timed-out duplicate frame whose storage duration in the second buffer queue reaches a second duration threshold, the timed-out duplicate frame and a duplicate frame whose sequence number carried in the second buffer queue is before the sequence number carried by the timed-out duplicate frame are transmitted to the receiving device.

[0168] It should be noted that the duplicate frames stored in the second cache queue carry serial numbers. For different periods, there are differences in the duplicate frames stored in the second cache queue, so the serial numbers carried by the duplicate frames are also different. The next serial number of the specified serial number can be a serial number obtained by incrementing. For example, if the specified serial number is 7, the next serial number of the corresponding specified serial number is generally 8. Of course, this is related to the serial number rule set by the sending agent for each data frame to be transmitted in the data stream to be transmitted. If the set serial number rule is to submit in sequence and the increment step is 1, then when the specified serial number is 7, the next serial number of the corresponding specified serial number is 8.

[0169] Exemplarily, by obtaining the minimum sequence number carried by the duplicate frames in the current second buffer queue, it is determined whether the current minimum sequence number is the next sequence number of the specified sequence number. In the case where the current minimum sequence number is the next sequence number of the specified sequence number, the duplicate frames stored in the second buffer queue are transmitted to the receiving device in the ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, the transmitted duplicate frames in the second buffer queue are deleted, and the specified sequence number is updated.

[0170] The second buffer queue may also be provided with a timer, through which the duration of storage of the duplicate frame in the second buffer queue is recorded. Specifically, a plurality of timers may be provided, and whenever a duplicate frame is stored in the second buffer queue, a timing operation is started, thereby recording the storage duration of the duplicate frame in the second buffer queue. In the case where there are duplicate frames whose storage duration reaches the second duration threshold in the second buffer queue, the duplicate frames whose storage duration reaches the second duration threshold are transmitted to the receiving device, and the duplicate frames stored in the second buffer queue may include the second duplicate frames. Specifically, the size of the second duration threshold may also be set based on actual needs, and this application does not limit this.

[0171] Exemplarily, the timed-out duplicate frame may be a duplicate frame whose storage time in the second buffer queue reaches a second time threshold. Specifically, the storage time of the duplicate frame stored in the second buffer queue is obtained, and when the time for storing the timed-out duplicate frame in the second buffer queue reaches the second time threshold, the timed-out duplicate frame is transmitted to the receiving device.

[0172] Through this embodiment, when the minimum sequence number of the duplicate frames in the second buffer queue is the next sequence number of the specified sequence number, these duplicate frames can be transmitted in the order of increasing sequence numbers, thereby avoiding data disorder and loss. When there are duplicate frames that have timed out in the second buffer queue, not only these duplicate frames that have timed out are transmitted, but also duplicate frames whose sequence numbers are located before the duplicate frames that have timed out are transmitted, which can effectively reduce the waiting time, avoid long waiting times, reduce data transmission delays, and improve overall data transmission efficiency.

[0173] In an exemplary embodiment, after directly transmitting the second duplicate frame to the receiving device and updating the designated sequence number, the method further includes:

[0174] In a case where the minimum sequence number carried by the duplicate frames stored in the second buffer queue is the next sequence number of the specified sequence number, the duplicate frames stored in the second buffer queue are transmitted to the receiving device in ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, the transmitted duplicate frames in the second buffer queue are deleted, and the specified sequence number is updated until the minimum sequence number carried by the duplicate frames stored in the second buffer queue is not the next sequence number of the specified sequence number.

[0175] It should be noted that, after directly transmitting the second duplicate frame to the receiving device and updating the designated sequence number, the receiving agent can delete the second duplicate frame that has been transmitted to the receiving device, and again determine whether the minimum sequence number carried by the duplicate frame stored in the second buffer queue is the next sequence number of the designated sequence number. In the case where the minimum sequence number carried by the duplicate frame stored in the second buffer queue is the next sequence number of the designated sequence number, the duplicate frames stored in the second buffer queue are transmitted to the receiving device in the ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, the duplicate frames that have been transmitted in the second buffer queue are deleted, and the designated sequence number is updated until the minimum sequence number carried by the duplicate frame stored in the second buffer queue is not the next sequence number of the designated sequence number.

[0176] In practice, the receiving agent can transmit multiple duplicate frames with increasing sequence numbers at one time. Specifically, multiple duplicate frames with increasing sequence numbers can be encapsulated and transmitted to the receiving device together, and then the designated sequence number is updated.

[0177] Through this embodiment, when the minimum sequence number of the duplicate frames in the second buffer queue is the next sequence number of the specified sequence number, these duplicate frames can be transmitted in ascending order of the sequence numbers, so that the duplicate frames can be sorted one by one, thereby avoiding data disorder and loss.

[0178] In an exemplary embodiment, after storing the second duplicate frame in the second buffer queue, the method further includes:

[0179] When the number of duplicate frames stored in the second buffer queue reaches a preset number threshold, the duplicate frames stored in the second buffer queue are transmitted to the receiving device, so as to transmit the second duplicate frames to the receiving device.

[0180] Exemplarily, after the second duplicate frame is stored in the second buffer queue, if the sequence number of the duplicate frame in the second buffer queue does not increase in sequence, and the number of duplicate frames stored in the second buffer queue reaches a preset number threshold at this time, the duplicate frame stored in the second buffer queue is transmitted to the receiving device to transmit the second duplicate frame to the receiving device. Specifically, the size of the preset number threshold setting can be set according to actual needs, and this application does not limit it here.

[0181] Through this embodiment, by setting a preset quantity threshold, batch transmission is achieved, the number of network transmissions is reduced, which helps to avoid network congestion, thereby improving the efficiency and reliability of data transmission.

[0182] In an exemplary embodiment, transmitting the second duplicate frame to a receiving device includes:

[0183] The transmission port information of the second copy frame is changed to restore the second copy frame to the target original frame, and the restored target original frame is transmitted to the receiving device.

[0184] It should be noted that the only difference between the information carried by the second copy frame and the information carried by its corresponding target original frame is the transmission port information. The second copy frame is restored to the target original frame according to the unchanged information carried by the second copy frame. The transmission port information may include at least one of the following: target MAC, VLAN information.

[0185] In specific practice, the receiving agent may have a passive stream identification function and an active stream identification function. The passive stream identification function can be used to identify the data stream to which the data frame received by the receiving agent belongs. Specifically, a parameter stream handle can be used to identify the data stream to which the data frame received by the receiving agent belongs, so as to determine whether the data frame is the same stream. The active stream identification function restores the transmission port information configured in the copy frame to the transmission port information of the target original frame. Specifically, the second copy frame can be decapsulated, decompressed, decoded, etc. according to the unchanged information in the header information carried by the second copy frame to restore the second copy frame to the target original frame.

[0186] Through this embodiment, the transmission port information of the second copy frame is changed to restore the target original frame, thereby realizing the restoration of the data frame and improving the reliability of data stream transmission.

[0187] In order to better understand the process of data stream transmission in this application, an example is used for illustration. Figure 8 , shows a flow chart of another optional data stream transmission method according to an embodiment of the present application.

[0188] Step S802: performing flow identification on the data flow to be transmitted, and generating label information for each data frame to be transmitted in the data flow to be transmitted.

[0189] Specifically, the sending agent performs flow identification on the data flow to be transmitted, generates a sequence number of the data frame to be transmitted through a sequence generation function, and sets a timestamp for the data frame to be transmitted. The tag information includes the sequence number and the timestamp.

[0190] Step S804: encapsulate the tag information into the corresponding data frame to be transmitted.

[0191] Specifically, the sending agent encapsulates the tag information through a sequence encoding function.

[0192] Step S806: Generate a set of first copy frames of the target original frame by changing the transmission port information of the target original frame.

[0193] Specifically, the target original frame may be each data frame to be transmitted in the data stream to be transmitted, or may be some key data frames to be transmitted in the data stream to be transmitted. The sending agent generates a set of first copy frames of the target original frame by changing the transmission port information of the target original frame.

[0194] Step S808, receiving a first copy frame.

[0195] Step S810, parsing the label information of the first copy frame.

[0196] Step S812: performing frame elimination on the first duplicate frame.

[0197] Specifically, the relay device parses the label information of the first copied frame, and performs a frame elimination operation on the first copied frame based on the label information of the first copied frame and the label information carried by the copied frame previously received by the relay device, and only retains the first copied frame of the first copied frame of the target original frame received by the relay device.

[0198] Step S814: When the first copied frame is the first copied frame of the target original frame, a copy operation is performed on the first copied frame to obtain a set of second copied frames.

[0199] Specifically, the relay device generates a set of second duplicate frames of the target original frame by changing the transmission port information of the first duplicate frame.

[0200] Step S816, receiving a set of second duplicate frames.

[0201] Step S818: Identify the second duplicate frame, and discard the second duplicate frame if the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent.

[0202] Specifically, the receiving agent directly or indirectly receives a group of second duplicate frames, and performs a frame elimination operation on the group of second duplicate frames, and only retains the second duplicate frame as the first duplicate frame of the target original frame received by the receiving agent.

[0203] Step S820 , when the second duplicate frame is the first duplicate frame of the target original frame received by the receiving agent, the second duplicate frame is stored and sorted by using a cache queue.

[0204] Specifically, the receiving agent uses the cache queue to store and sort the second duplicate frames, which can be referred to the above embodiment, and the present application will not elaborate on it here.

[0205] Step S822: restore the second replicated frame after frame sorting to the corresponding target original frame and send it to the receiving device.

[0206] It should be noted that the execution subject of steps S802 to S806 may be a sending agent; the execution subject of steps S808 to S814 may be a relay device; and the execution subject of steps S816 to S822 may be a receiving agent.

[0207] In actual practice, the sending agent, the relay device, and the receiving agent can all perform stream identification and sequence number extraction on the received data frames, and encapsulate the label information in the data frames when the data frames need to be transmitted to the next device.

[0208] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0209] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0210] According to another aspect of the embodiment of the present application, a data stream transmission device is also provided, and the device is used to implement the data stream transmission method provided in the above-mentioned embodiment, and the description has been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0211] Fig. 9 is a structural block diagram of an optional data stream transmission device according to an embodiment of the present application, the device is applied to a relay device, and the relay device is used to transmit data between a sending agent and a receiving agent, such as Fig. 9 As shown, the device may include:

[0212] A first receiving module 902 is used to receive a first duplicate frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame duplication, and the first duplicate frame is a duplicate frame of the target original frame;

[0213] A duplication module 904 is configured to perform a duplication operation on the first duplicate frame to obtain a set of second duplicate frames, and transmit the set of second duplicate frames to the receiving agent end when the first duplicate frame is the first duplicate frame of the target original frame received by the relay device;

[0214] The first discarding module 906 is configured to discard the first duplicate frame if the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device.

[0215] In an exemplary embodiment, after receiving the first duplicate frame of the target original frame in the data stream to be transmitted, the data stream transmission device further includes:

[0216] An information extraction module, used to extract the label information carried by the first copy frame to obtain target label information, wherein the target label information includes a first sequence number of the target original frame and a first timestamp of the target original frame;

[0217] The judgment module is used to judge whether the first duplicate frame is the first duplicate frame of the target original frame received by the relay device based on the target label information and the label information carried by the duplicate frame received by the relay device.

[0218] In an exemplary embodiment, the determination module includes:

[0219] a first judging unit, configured to judge whether the first sequence number is within a specified sliding value range when the first sequence number is within a preset value range, wherein the preset value range is a value range allowed by the sequence number of the original frame, and the specified sliding value range is determined based on the sequence number carried by the duplicate frame received by the relay device and a preset sliding window size;

[0220] A second judgment unit is used to judge whether the relay device has received a duplicate frame carrying the first sequence number when the first sequence number is within a specified sliding value range;

[0221] a time difference determining unit, configured to determine a time difference between a first timestamp and a first specified timestamp when the relay device receives a duplicate frame carrying a first sequence number, to obtain a target time difference, wherein the first specified timestamp is a timestamp when the relay device receives the duplicate frame carrying the first sequence number;

[0222] The duplicate frame determining unit is used to determine that the first duplicate frame is the first duplicate frame of the target original frame received by the relay device when the target time difference is greater than or equal to a preset time difference threshold.

[0223] In an exemplary embodiment, before determining whether the first sequence number is within the specified sliding value range, the determination module further includes: a specified range determination unit, configured to determine a sliding value range having a second sequence number carried by a second specified duplicate frame received by the relay device as an intermediate value and a preset sliding window size as a window size as the specified sliding value range, wherein the second specified duplicate frame is the last duplicate frame that has not been discarded among the duplicate frames received by the relay device;

[0224] After receiving the first copy frame of the target original frame of the data stream to be transmitted, the judgment module also includes: a designated range update unit, which is used to update the designated sliding value range to a sliding value range with the first sequence number as the intermediate value and a preset sliding window size as the window size when the first copy frame is the first copy frame of the target original frame received by the relay device.

[0225] In an exemplary embodiment, different data frames to be transmitted in a data stream to be transmitted are identified by different sequence numbers, wherein the sequence number corresponding to the target original frame is the first sequence number; the first receiving module is further used to: in response to the received data frame to be transmitted, perform a sequence number extraction operation on the sequence number field of the data frame to be transmitted to obtain a sequence number extraction result; when the sequence number extraction result indicates that the first sequence number is extracted from the sequence number field of the data frame to be transmitted, determine that the data frame to be transmitted is a copy frame of the target original frame.

[0226] In an exemplary embodiment, the replication module is also used to: change the transmission port information of the first replication frame to obtain a group of second replication frames, wherein the transmission port information includes at least one of the following: target MAC, VLAN information; based on the transmission port information of each second replication frame in a group of second replication frames, transmit different second replication frames in a group of second replication frames through different transmission paths.

[0227] According to another aspect of the embodiment of the present application, a data stream transmission device is also provided, and the device is used to implement the data stream transmission method provided in the above-mentioned embodiment, and the description has been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0228] Fig.10 is a structural block diagram of another optional data stream transmission device according to an embodiment of the present application, which is applied to a receiving agent end, and the receiving agent end is used to transmit data between a relay device and a receiving device, such as Fig.10 As shown, the device may include:

[0229] The second receiving module 1002 is used to receive a second copy frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame replication, and the second copy frame is a copy frame of the target original frame;

[0230] A transmission module 1004, configured to transmit the second duplicate frame to a receiving device if the second duplicate frame is a first duplicate frame of a target original frame received by the receiving agent;

[0231] The second discarding module 1006 is configured to discard the second duplicate frame if the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent.

[0232] In an exemplary embodiment, the duplicate frame received by the receiving agent carries the sequence number of the original frame corresponding to the duplicate frame received by the receiving agent, and the sequence number carried by the second duplicate frame is the first sequence number; the transmission module 1004 includes:

[0233] A storage unit, used for storing the second duplicate frame in a first buffer queue, wherein the first buffer queue is used for storing the duplicate frame to be transmitted to a receiving device;

[0234] A first waiting unit, configured to wait for the number of duplicate frames stored in the first buffer queue to reach a first number threshold when the number of duplicate frames stored in the first buffer queue is less than a first number threshold;

[0235] A second waiting unit is used to wait for the sequence numbers carried by the duplicate frames stored in the first buffer queue to increase in sequence when the number of duplicate frames stored in the first buffer queue is greater than or equal to the first number threshold and the sequence numbers carried by the duplicate frames stored in the first buffer queue do not increase in sequence until the number of duplicate frames stored in the first buffer queue reaches a second number threshold, wherein the second number threshold is greater than the first number threshold;

[0236] A first transmission unit, configured to transmit the duplicate frames stored in the first buffer queue to the receiving device, in a case where the sequence numbers carried by the duplicate frames stored in the first buffer queue are sequentially increased, so as to transmit the second duplicate frame to the receiving device;

[0237] The second transmission unit is used to transmit the duplicate frames stored in the first buffer queue to the receiving device when the number of duplicate frames stored in the first buffer queue reaches a second number threshold, so as to transmit the second duplicate frame to the receiving device.

[0238] In an exemplary embodiment, after storing the second duplicate frame in the first buffer queue, the transmission module 1004 further includes:

[0239] The third transmission unit is used to transmit the duplicate frames stored in the first buffer queue to the receiving device when the duplicate frames stored in the first buffer queue include duplicate frames whose storage duration in the first buffer queue reaches a first duration threshold, so as to transmit the second duplicate frame to the receiving device.

[0240] In an exemplary embodiment, the duplicate frame received by the receiving agent carries the sequence number of the original frame corresponding to the duplicate frame received by the receiving agent, and the sequence number carried by the second duplicate frame is the first sequence number; the receiving agent transmits the received duplicate frames to the receiving device in the ascending order of the sequence numbers carried in the received duplicate frames, and the sequence number carried in the last duplicate frame transmitted by the receiving agent to the receiving agent is the designated sequence number;

[0241] The transmission module 1004 includes:

[0242] A sequence number updating unit, configured to directly transmit the second duplicate frame to the receiving device and update the designated sequence number when the first sequence number is the next sequence number of the designated sequence number;

[0243] a first storage unit, configured to store the second duplicate frame in a second buffer queue when the first sequence number is not a sequence number next to the specified sequence number, wherein the second buffer queue is used to store the duplicate frame to be transmitted to the receiving device;

[0244] The fourth transmission unit is used to transmit the duplicate frame stored in the second buffer queue to the receiving device based on the sequence number carried by the duplicate frame stored in the second buffer queue, so as to transmit the second duplicate frame to the receiving device.

[0245] In an exemplary embodiment, the fourth transmission unit is also used to: when the minimum sequence number carried by the duplicate frames stored in the second buffer queue is the next sequence number of the specified sequence number, transmit the duplicate frames stored in the second buffer queue to the receiving device in ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, delete the transmitted duplicate frames in the second buffer queue, and update the specified sequence number until the minimum sequence number carried by the duplicate frames stored in the second buffer queue is not the next sequence number of the specified sequence number; when the duplicate frames stored in the second buffer queue include timed duplicate frames whose storage duration in the second buffer queue reaches a second duration threshold, transmit the timed duplicate frames and the duplicate frames whose sequence numbers carried in the second buffer queue are before the sequence numbers carried by the timed duplicate frames to the receiving device.

[0246] In an exemplary embodiment, after directly transmitting the second duplicate frame to the receiving device and updating the designated sequence number, the transmission module 1004 further includes:

[0247] A fifth transmission unit is used to transmit the duplicate frames stored in the second buffer queue to the receiving device in the ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, delete the transmitted duplicate frames in the second buffer queue, and update the designated sequence number when the minimum sequence number carried by the duplicate frames stored in the second buffer queue is the next sequence number of the designated sequence number, until the minimum sequence number carried by the duplicate frames stored in the second buffer queue is not the next sequence number of the designated sequence number.

[0248] In an exemplary embodiment, after storing the second duplicate frame in the second buffer queue, the transmission module 1004 further includes:

[0249] The sixth transmission unit is used to transmit the duplicate frames stored in the second buffer queue to the receiving device when the number of duplicate frames stored in the second buffer queue reaches a preset number threshold, so as to transmit the second duplicate frame to the receiving device.

[0250] In an exemplary embodiment, the transmission module 1004 includes:

[0251] The seventh transmission unit is used to change the transmission port information of the second copy frame to restore the second copy frame to the target original frame, and transmit the restored target original frame to the receiving device.

[0252] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0253] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein the program executes the steps of any of the above method embodiments when it is run.

[0254] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0255] According to another aspect of the embodiments of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the steps in any of the above method embodiments through the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0256] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0257] According to another aspect of the embodiment of the present application, a computer program product is also provided, which includes a computer program / instruction, and the computer program / instruction contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit 1101, various functions provided by the embodiment of the present application are executed. The above-mentioned serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0258] Fig.11 The following schematically shows a computer system structure block diagram of an optional electronic device for implementing an embodiment of the present application. Fig.11As shown, the computer system 1100 includes a CPU (Central Processing Unit) 1101, which can perform various appropriate actions and processes according to the program stored in the ROM 1102 or the program loaded from the storage part 1108 to the RAM 1103. Various programs and data required for system operation are also stored in the random access memory 1103. The central processing unit 1101, the read-only memory 1102 and the random access memory 1103 are connected to each other through a bus 1104. An I / O (Input / Output) interface 1105 is also connected to the bus 1104.

[0259] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a CRT (Cathode Ray Tube), an LCD (Liquid Crystal Display), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0260] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processor 1101, various functions defined in the system of the present application are executed.

[0261] It should be noted that Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0262] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0263] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data stream transmission method, characterized in that: Applied to a relay device, the relay device is used to transmit data between a sending agent and a receiving agent, the method comprising: Receiving a first duplicate frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame duplication, and the first duplicate frame is a duplicate frame of the target original frame; In a case where the first duplicate frame is the first duplicate frame of the target original frame received by the relay device, performing a duplication operation on the first duplicate frame to obtain a set of second duplicate frames, and transmitting the set of second duplicate frames to the receiving agent; In a case where the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device, the first duplicate frame is discarded.

2. The method according to claim 1, characterized in that After receiving the first duplicate frame of the target original frame in the data stream to be transmitted, the method further includes: Extracting label information carried by the first duplicate frame to obtain target label information, wherein the target label information includes a first sequence number of the target original frame and a first timestamp of the target original frame; Based on the target label information and the label information carried by the duplicate frame received by the relay device, it is determined whether the first duplicate frame is the first duplicate frame of the target original frame received by the relay device.

3. The method according to claim 2, characterized in that The determining, based on the target label information and the label information carried by the duplicate frame received by the relay device, whether the first duplicate frame is the first duplicate frame of the target original frame received by the relay device includes: In a case where the first sequence number is within a preset value range, determining whether the first sequence number is within a specified sliding value range, wherein the preset value range is a value range allowed by the sequence number of the original frame, and the specified sliding value range is determined based on the sequence number carried by the duplicate frame received by the relay device and a preset sliding window size; When the first sequence number is within the specified sliding value range, determining whether the relay device has received a duplicate frame carrying the first sequence number; In the case where the relay device receives the duplicate frame carrying the first sequence number, determining a time difference between the first timestamp and a first specified timestamp to obtain a target time difference, wherein the first specified timestamp is a timestamp when the relay device receives the duplicate frame carrying the first sequence number; When the target time difference is greater than or equal to a preset time difference threshold, it is determined that the first duplicate frame is the first duplicate frame of the target original frame received by the relay device.

4. The method according to claim 3, characterized in that Before determining whether the first sequence number is within a specified sliding value range, the method further includes: Determine a sliding value range with a second sequence number carried by a second designated copy frame received by the relay device as an intermediate value and the preset sliding window size as a window size as the designated sliding value range, wherein the second designated copy frame is the last copy frame that has not been discarded among the copy frames received by the relay device; After receiving the first copy frame of the target original frame of the data stream to be transmitted, the method also includes: when the first copy frame is the first copy frame of the target original frame received by the relay device, updating the specified sliding value range to a sliding value range with the first sequence number as the intermediate value and the preset sliding window size as the window size.

5. The method according to claim 1, characterized in that Different data frames to be transmitted in the data stream to be transmitted are identified by different sequence numbers, wherein the sequence number corresponding to the target original frame is a first sequence number; the method further includes: In response to the received data frame to be transmitted, performing a sequence number extraction operation on the sequence number field of the data frame to be transmitted to obtain a sequence number extraction result; In a case where the sequence number extraction result indicates that the first sequence number is extracted from the sequence number field of the data frame to be transmitted, it is determined that the data frame to be transmitted is a duplicate frame of the target original frame.

6. The method according to any one of claims 1 to 5, characterized in that The performing a copy operation on the first copy frame to obtain a set of second copy frames, and transmitting the set of second copy frames to the receiving agent end includes: Changing the transmission port information of the first duplicate frame to obtain the set of second duplicate frames, wherein the transmission port information includes at least one of the following: target MAC, VLAN information; Different second replicated frames in the group of second replicated frames are transmitted through different transmission paths based on the transmission port information of each second replicated frame in the group of second replicated frames.

7. A data stream transmission method, characterized in that: Applied to a receiving agent, the receiving agent is used to transmit data between a relay device and a receiving device, the method comprising: receiving a second copy frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame replication, and the second copy frame is a copy frame of the target original frame; In a case where the second duplicate frame is a first duplicate frame of the target original frame received by the receiving agent, transmitting the second duplicate frame to the receiving device; In a case where the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent, the second duplicate frame is discarded.

8. The method according to claim 7, characterized in that The duplicate frame received by the receiving agent carries a sequence number of an original frame corresponding to the duplicate frame received by the receiving agent, and the sequence number carried by the second duplicate frame is the first sequence number; The transmitting the second duplicate frame to the receiving device comprises: storing the second duplicate frame in a first buffer queue, wherein the first buffer queue is used to store the duplicate frame to be transmitted to the receiving device; When the number of duplicate frames stored in the first buffer queue is less than a first number threshold, waiting for the number of duplicate frames stored in the first buffer queue to reach the first number threshold; When the number of duplicate frames stored in the first buffer queue is greater than or equal to the first number threshold and the sequence numbers carried by the duplicate frames stored in the first buffer queue do not increase sequentially, wait for the sequence numbers carried by the duplicate frames stored in the first buffer queue to increase sequentially until the number of duplicate frames stored in the first buffer queue reaches a second number threshold, wherein the second number threshold is greater than the first number threshold; In a case where the sequence numbers carried by the duplicate frames stored in the first buffer queue are increased in sequence, the duplicate frames stored in the first buffer queue are transmitted to the receiving device, so as to transmit the second duplicate frames to the receiving device; When the number of duplicate frames stored in the first buffer queue reaches the second number threshold, the duplicate frames stored in the first buffer queue are transmitted to the receiving device, so as to transmit the second duplicate frames to the receiving device.

9. The method according to claim 8, characterized in that After storing the second duplicate frame in the first buffer queue, the method further includes: When the duplicate frames stored in the first buffer queue include duplicate frames whose storage duration in the first buffer queue reaches a first duration threshold, the duplicate frames stored in the first buffer queue are transmitted to the receiving device to transmit the second duplicate frames to the receiving device.

10. The method according to claim 7, characterized in that The duplicate frame received by the receiving agent carries the sequence number of the original frame corresponding to the duplicate frame received by the receiving agent, and the sequence number carried by the second duplicate frame is the first sequence number; the receiving agent transmits the received duplicate frames to the receiving device in the ascending order of the sequence numbers carried in the received duplicate frames, and the sequence number carried in the last duplicate frame transmitted by the receiving agent to the receiving agent is the designated sequence number; The transmitting the second duplicate frame to the receiving device comprises: When the first sequence number is the next sequence number of the designated sequence number, directly transmitting the second duplicate frame to the receiving device and updating the designated sequence number; If the first sequence number is not a sequence number next to the specified sequence number, storing the second duplicate frame in a second buffer queue, wherein the second buffer queue is used to store the duplicate frame to be transmitted to the receiving device; Based on the sequence number carried by the duplicate frame stored in the second buffer queue, the duplicate frame stored in the second buffer queue is transmitted to the receiving device, so as to transmit the second duplicate frame to the receiving device.

11. The method according to claim 10, characterized in that The transmitting, based on the sequence number carried by the duplicate frame stored in the second buffer queue, to the receiving device, the duplicate frame stored in the second buffer queue includes: In a case where the minimum sequence number carried by the duplicate frames stored in the second buffer queue is the next sequence number of the specified sequence number, the duplicate frames stored in the second buffer queue are transmitted to the receiving device in the ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, the transmitted duplicate frames in the second buffer queue are deleted, and the specified sequence number is updated until the minimum sequence number carried by the duplicate frames stored in the second buffer queue is not the next sequence number of the specified sequence number; When the duplicate frames stored in the second buffer queue include a timed-out duplicate frame whose storage duration in the second buffer queue reaches a second duration threshold, the timed-out duplicate frame and a duplicate frame whose serial number carried in the second buffer queue is before the serial number carried by the timed-out duplicate frame are transmitted to the receiving device.

12. The method according to claim 10, characterized in that After directly transmitting the second duplicate frame to the receiving device and updating the designated sequence number, the method further includes: In a case where the minimum sequence number carried by the duplicate frames stored in the second buffer queue is the next sequence number of the specified sequence number, the duplicate frames stored in the second buffer queue are transmitted to the receiving device in ascending order of the sequence numbers carried by the duplicate frames stored in the second buffer queue, the transmitted duplicate frames in the second buffer queue are deleted, and the specified sequence number is updated until the minimum sequence number carried by the duplicate frames stored in the second buffer queue is not the next sequence number of the specified sequence number.

13. The method according to claim 10, characterized in that After storing the second duplicate frame in the second buffer queue, the method further includes: When the number of duplicate frames stored in the second buffer queue reaches a preset number threshold, the duplicate frames stored in the second buffer queue are transmitted to the receiving device, so as to transmit the second duplicate frames to the receiving device.

14. The method according to any one of claims 7 to 13, characterized in that The transmitting the second duplicate frame to the receiving device comprises: The transmission port information of the second copy frame is changed to restore the second copy frame to the target original frame, and the restored target original frame is transmitted to the receiving device.

15. A data stream transmission device, characterized in that: Applied to a relay device, the relay device is used to transmit data between a sending agent and a receiving agent, the device comprises: A first receiving module, configured to receive a first duplicate frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame duplication, and the first duplicate frame is a duplicate frame of the target original frame; a duplication module, configured to, when the first duplicate frame is the first duplicate frame of the target original frame received by the relay device, perform a duplication operation on the first duplicate frame to obtain a set of second duplicate frames, and transmit the set of second duplicate frames to the receiving agent; The first discarding module is used to discard the first duplicate frame if the first duplicate frame is not the first duplicate frame of the target original frame received by the relay device.

16. A data stream transmission device, characterized in that: Applied to a receiving agent, the receiving agent is used to transmit data between a relay device and a receiving device, and the device includes: A second receiving module is used to receive a second copy frame of a target original frame in a data stream to be transmitted, wherein the data stream to be transmitted is a data stream that allows frame replication, and the second copy frame is a copy frame of the target original frame; a transmission module, configured to transmit the second duplicate frame to the receiving device if the second duplicate frame is the first duplicate frame of the target original frame received by the receiving agent; The second discarding module is used to discard the second duplicate frame if the second duplicate frame is not the first duplicate frame of the target original frame received by the receiving agent.

17. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 6, or implements the steps of the method described in any one of claims 7 to 14.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented, or the steps of the method described in any one of claims 7 to 14 are implemented.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of the method described in any one of claims 1 to 6, or implements the steps of the method described in any one of claims 7 to 14.