CN113691354B - Data transmission method and device, electronic equipment and readable storage medium - Google Patents

Data transmission method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113691354B
CN113691354B CN202111007203.XA CN202111007203A CN113691354B CN 113691354 B CN113691354 B CN 113691354B CN 202111007203 A CN202111007203 A CN 202111007203A CN 113691354 B CN113691354 B CN 113691354B
Authority
CN
China
Prior art keywords
fec
equipment
state
message
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111007203.XA
Other languages
Chinese (zh)
Other versions
CN113691354A (en
Inventor
孙启铭
于星杰
范雪俭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111007203.XA priority Critical patent/CN113691354B/en
Publication of CN113691354A publication Critical patent/CN113691354A/en
Application granted granted Critical
Publication of CN113691354B publication Critical patent/CN113691354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at the receiver end
    • H04L1/0047Decoding adapted to other signal detection operation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0009Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the channel coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a data transmission method, and relates to the technical field of communication. The method is applied to first equipment, and when the FEC function of the first equipment is started, whether the FEC function of second equipment is started is detected; if the FEC function of the second equipment is determined to be started, encoding the original message to generate a redundant message, and sending a message comprising the original message and the redundant message to the second equipment; and if the FEC function of the second equipment is not started, sending the information of the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after the first preset time length. By adopting the method, the problem of communication resource waste caused by bandwidth occupation caused by sending the FEC detection message to the receiving end at regular time can be solved.

Description

Data transmission method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method and apparatus, an electronic device, and a readable storage medium.
Background
With the continuous development of communication technology, the requirements of users on communication quality are higher and higher. There are many communication services that are very sensitive to delay and packet loss, for example: instant messaging type services.
In the prior art, a Forward Error Correction (FEC) -based packet loss prevention method is generally used to solve the problem of poor service quality caused by packet loss in an information transmission process. The FEC mainly solves the problem of packet loss of an original message, and recovers the lost message in the transmission process through a redundant message generated in the FEC encoding process without data retransmission, thereby improving the transmission rate. In the existing scheme, whether the FEC function of the receiving end is normal is judged by regularly sending the FEC detection message to the receiving end device, however, regularly sending the FEC detection message to the receiving end device occupies a large bandwidth, thereby causing waste of communication resources.
Disclosure of Invention
In order to solve the above technical problem or at least partially solve the above technical problem, the present application provides a data transmission method, which solves the problem of communication resource waste caused by occupying bandwidth when determining whether an FEC function of a receiving end is turned on.
In order to achieve the above object, the embodiments of the present application provide the following technical solutions:
in a first aspect, an embodiment of the present application provides a data transmission method, where the method includes:
when the Forward Error Correction (FEC) function of the first equipment is started, detecting whether the FEC function of second equipment is started;
if the FEC function of the second equipment is determined to be started, FEC encoding is carried out on an original message to generate a redundant message, and a message comprising the original message and the redundant message is sent to the second equipment;
if the FEC function of the second equipment is not started, sending a message including the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after a first preset time length.
As an optional implementation manner of this embodiment, the detecting whether the FEC function of the second device is started includes:
sending the FEC detection message to the second equipment for N times; n is an integer greater than 1;
if an FEC detection response message sent by the second equipment is received, determining that the FEC function of the second equipment is started, and stopping sending the FEC detection message to the second equipment;
and if the FEC detection messages sent to the second equipment for N times continuously do not receive the FEC detection response messages, determining that the FEC function of the second equipment is not started.
As an optional implementation manner of the embodiment of the present application, the method further includes:
receiving an FEC detection message sent by third equipment;
if the FEC function of the first equipment is in an opening state, sending an FEC detection response message to the third equipment;
and if the FEC function of the first equipment is in a closed state, discarding the detection message.
As an optional implementation manner of this embodiment of the present application, after determining that the FEC function of the second device is turned on, the method further includes:
when the FEC functional state of the first equipment is switched from an open state to a closed state, detecting whether the second equipment acquires the FEC functional state of the first equipment and switches from the open state to the closed state;
if not, sending a message including the original message to the second device, and detecting whether the second device has acquired the FEC function state of the first device again after a second preset time length, wherein the FEC function state is switched from an open state to a closed state;
and if so, stopping decoding the message sent by the second equipment, and continuously sending the message including the original message to the second equipment.
As an optional implementation manner of this embodiment of the present application, the detecting whether the second device has acquired the FEC function state of the first device and switched from the on state to the off state includes:
sending an FEC state message to the second equipment for M times; m is an integer greater than 1;
if an FEC state response message sent by the second equipment is received, determining that the second equipment has acquired the FEC function state of the first equipment, switching from an on state to an off state, and stopping sending the FEC state message to the second equipment;
and if the FEC state response messages are not received in all the FEC state messages sent to the second equipment for M times continuously, determining that the second equipment does not acquire the FEC function state of the first equipment and switching the FEC function state from the open state to the closed state.
As an optional implementation manner of the embodiment of the present application, the method further includes:
receiving a state message sent by third equipment;
if the first device has acquired the FEC function state of the third device and switched from the open state to the closed state, sending a state response message to the third device;
and if the first device does not acquire the FEC functional state of the third device, switching the FEC functional state from the open state to the closed state, discarding the state message.
As an optional implementation manner of the embodiment of the present application, the method further includes:
the first preset time period is 20-40 minutes, and the second preset time period is 20-40 minutes.
In a second aspect, an embodiment of the present application provides a data transmission apparatus, including:
a detection module, configured to detect whether a forward error correction, FEC, function of a second device is turned on when the FEC function of the first device is turned on;
a first function module, configured to perform FEC coding on an original packet to generate a redundant packet and send a message including the original packet and the redundant packet to the second device if it is determined that the FEC function of the second device is started;
and a second function module, configured to send a message including the original packet to the second device if it is determined that the FEC function of the second device is not started, and detect whether the FEC function of the second device is started again after a first preset time duration.
As an optional implementation manner of the embodiment of the present application, the detection module is configured to:
sending the FEC detection message to the second equipment for N times; n is an integer greater than 1;
if an FEC detection response message sent by the second equipment is received, determining that the FEC function of the second equipment is started, and stopping sending the FEC detection message to the second equipment;
and if the FEC detection messages sent to the second equipment for N times continuously do not receive the FEC detection response messages, determining that the FEC function of the second equipment is not started.
As an optional implementation manner of the embodiment of the present application, the data transmission apparatus further includes a first receiving module, where the first receiving module is configured to:
receiving an FEC detection message sent by third equipment;
if the FEC function of the first equipment is in an open state, sending an FEC detection response message to the third equipment;
and if the FEC function of the first equipment is in a closed state, discarding the detection message.
As an optional implementation manner of the embodiment of the present application, the data transmission apparatus further includes a second detection module, where the second detection module is configured to:
when the FEC functional state of the first equipment is switched from an open state to a closed state, detecting whether the second equipment acquires the FEC functional state of the first equipment and switches from the open state to the closed state;
if not, sending a message including the original message to the second device, and detecting whether the second device has acquired the FEC function state of the first device again after a second preset time length, wherein the FEC function state is switched from an open state to a closed state;
and if so, stopping decoding the message sent by the second equipment, and continuously sending the message including the original message to the second equipment.
As an optional implementation manner of the embodiment of the present application, the second detection module is specifically configured to:
sending an FEC state message to the second equipment for M times; m is an integer greater than 1;
if an FEC state response message sent by the second equipment is received, determining that the second equipment has acquired the FEC function state of the first equipment and is switched from an open state to a closed state, and stopping sending the FEC state message to the second equipment;
and if the FEC state response message is not received by all the FEC state messages sent to the second equipment for M times continuously, determining that the second equipment does not acquire the FEC functional state of the first equipment and switching the FEC functional state from the open state to the closed state.
As an optional implementation manner of the embodiment of the present application, the data transmission apparatus further includes a second receiving module, where the second receiving module is configured to:
receiving a state message sent by third equipment;
if the first device has acquired the FEC functional state of the third device and is switched from the open state to the closed state, sending a state response message to the third device;
and if the first device does not acquire that the FEC function state of the third device is switched from the open state to the closed state, discarding the state message.
As an optional implementation manner of this embodiment, the first preset time period is 20 to 40 minutes, and the second preset time period is 20 to 40 minutes.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the data transmission method according to the first aspect or any implementation manner of the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the data transmission method described in the first aspect or any implementation manner of the first aspect.
The data transmission method is applied to first equipment, and when the FEC function of the first equipment is started, whether the FEC function of second equipment is started is detected; if the FEC function of the second equipment is determined to be started, encoding the original message to generate a redundant message, and sending a message comprising the original message and the redundant message to the second equipment; and if the FEC function of the second equipment is not started, sending the information of the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after the first preset time length. When the FEC function of the first equipment is switched from the closed state to the open state, detecting whether the FEC function of the second equipment is open; when the FEC function of the second equipment is detected to be in the opening state, the FEC sending detection message does not need to be sent to the second equipment at regular time to detect whether the FEC function of the second equipment is opened, and only the message containing the original message and the redundant message needs to be sent, so that the bandwidth occupation in the message communication process is reduced, and the communication resource is saved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
FIG. 1 is a flow diagram illustrating a data transmission method according to one embodiment;
FIG. 2 is a flow chart illustrating a data transmission method according to another embodiment;
FIG. 3 is a schematic diagram of an embodiment of a data transmission apparatus;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order that the above-mentioned objects, features and advantages of the present application may be more clearly understood, the solution of the present application will be further described below. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present application may be practiced otherwise than as specifically described herein; it is to be understood that the embodiments described in this specification are only some embodiments of the present application and not all embodiments.
Relational terms such as "first" and "second," and the like, may be used throughout the description and claims of the present application to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. For example, the first device, the second device, the third device, and the like are used to distinguish the devices as the sending device or the receiving device, and are not ordering between the devices.
In the embodiments of the present application, the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present relevant concepts in a concrete fashion.
The overall concept of the embodiment of the application is as follows: when the FEC function status of the sending end device changes, the receiving end device is notified. Firstly, detecting whether the FEC function of a receiving end is started or not; when the FEC function of the receiving end is detected to be in an open state, the FEC detection message does not need to be sent to the receiving end equipment at regular time to detect whether the FEC function of the receiving end equipment is opened or not, and only the message containing the original message and the redundant message needs to be sent, so that the bandwidth occupation in the message communication process is reduced, and the communication resource is saved.
In one embodiment, as shown in fig. 1, a data transmission method is provided, which includes the following steps:
s11, when the Forward Error Correction (FEC) function of the first equipment is started, detecting whether the FEC function of the second equipment is started.
For example, when the first device is used as a transmitting end, the second device may be used as a receiving end. When the FEC function of the sending end is started, whether the FEC function of the receiving end is started or not is detected.
S12, if the FEC function of the second equipment is determined to be started, FEC encoding is carried out on the original message to generate a redundant message, and a message comprising the original message and the redundant message is sent to the second equipment.
Specifically, if it is determined that the FEC function of the second device is turned on, the second device may perform FEC encoding and decoding operations. It can be understood that, when the FEC functions of the first device and the second device are both turned on, both the sending end and the receiving end can perform FEC encoding and decoding operations. The sending end equipment encodes the original message to generate a redundant message, and then sends a message containing a message header, the original message and the redundant message to the receiving end equipment.
It should be noted that, since FEC is implemented by adding redundant information to the transmitted data information based on an algorithm, the value of one redundant bit may be a complex function of many information bits in the original information. After encoding, the original information may or may not exist as such.
S13, if the FEC function of the second equipment is not started, sending a message including the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after a first preset time length.
Illustratively, if the FEC function of the receiving end device is not turned on, the original packet is not encoded at the sending end, the original packet is directly sent to the receiving end, and it is detected again whether the FEC function of the receiving end is turned on after a first preset time period. The first preset time period may be any time interval in the range of 20 to 40 minutes, or other reasonable values, and is not limited in particular.
As an optional implementation manner of this embodiment of the application, as shown in fig. 2, an implementation manner of the step S11 of detecting whether the FEC function of the second device is turned on may include:
s111, sending the FEC detection message for N times to the second equipment.
Wherein N is an integer greater than 1. Illustratively, N generally ranges from: n is more than or equal to 3 and less than or equal to 5, and other reasonable numerical values can be taken according to the actual situation of message communication.
Specifically, the first device sends an FEC detection packet to the second device. The FEC detection message is used to detect whether an FEC function of the second device is started.
S112, if an FEC detection response packet sent by the second device is received, determining that an FEC function of the second device is started, and stopping sending the FEC detection packet to the second device.
Correspondingly, the first device detects whether the FEC detection response message sent by the second device is received. Exemplarily, if the first device receives an FEC detection response packet sent by the second device, it determines that the FEC function of the second device is in an on state, and stops sending the FEC detection packet to the second device.
S113, if none of the detection messages sent to the second device for N consecutive times receive an FEC detection response message, determining that the FEC function of the second device is not turned on.
For example, if the receiving end device does not turn on the FEC function, the receiving end device will not send the probe response message. If the sending end does not receive the FEC detection response message sent by the receiving end equipment after 5 seconds, the sending end sends the FEC detection message to the receiving end equipment again, if the sending end does not receive the FEC detection response message for three times, the FEC function of the receiving end equipment is determined not to be started, and the sending end equipment stops sending the FEC detection message to the receiving end equipment.
As an optional implementation manner in this embodiment of the present application, after S112, it is determined that the FEC function of the second device is turned on, the following steps are further performed:
s112-a, when the FEC functional state of the first device is switched from the on state to the off state, detecting whether the second device has acquired the FEC functional state of the first device, and switching from the on state to the off state.
For example, when the FEC functional state of the transmitting end is switched from an on state to an off state, in a case where the first device serves as the transmitting end and the second device serves as the receiving end, whether the receiving end acquires that the FEC functional state of the transmitting end is switched from the on state to the off state is detected.
And S112-b, if not, sending a message including the original message to the second equipment, and detecting whether the second equipment has acquired the FEC function state of the first equipment again after a second preset time length, wherein the FEC function state is switched from an open state to a closed state.
The second preset time period may be any time period from 20 to 40 minutes, or may be other reasonable time intervals. For example, after 30 minutes, the first device resends the status message to the second device.
Specifically, the FEC functions of the sending end device and the receiving end device can both perform encoding and decoding operations in an open state, for example, the second device receives a message encoded by the first device and decodes the message sent by the first device; similarly, the first device receives the encoded message sent by the second device, and decodes the message sent by the second device. If the FEC function of a certain device is switched from the on state to the off state, the encoding operation is not performed any more, for example, when the FEC function of the first device is in the off state, the first device cannot encode the original message at this time, and only can send a message including the original message to the second device.
Exemplarily, if the first device does not acquire the FEC function state of the second device, the FEC function state is switched from the on state to the off state, a message including only an original message is sent, and the first device is only a function of forwarding data at this time; and then re-detecting whether the second device has acquired the FEC function status of the first device after 30 minutes to switch from the on status to the off status.
And S112-c, if so, stopping decoding the message sent by the second equipment, and continuing to send the message including the original message to the second equipment.
Exemplarily, if the receiving end acquires that the FEC functional state of the sending end is switched from the on state to the off state, since the FEC functional state of the sending end device is the off state, the sending end device only has a function of forwarding data, and thus the sending end device sends a message only including an original message; at this time, the receiving end decodes the message sent by the sending end, after the message sent by the sending end is processed, the FEC function state obtained by the receiving end is fed back to the sending end, and the FEC function state is switched from the on state to the off state, and the decoding is stopped.
In this embodiment, through the FEC status detection mechanism, the opposite device is only notified when the FEC functional status of the sending end or the receiving end device changes, so as to avoid sending the probe packet at regular time, reduce the bandwidth occupation, and save the communication resources.
As an optional implementation manner of this embodiment of the present application, the implementation manner of S112-a, detecting whether the second device has acquired that the FEC functional state of the first device is switched from the on state to the off state, may include:
(1) And sending the FEC state message to the second equipment for M times.
Wherein M is an integer greater than 1. Illustratively, M generally takes the value range: m is more than or equal to 3 and less than or equal to 5, and other reasonable values can be taken according to the actual situation of message communication.
Specifically, the first device sends a status message to the second device, where the status message is used to indicate the FEC functional status of the sending end.
(2) And if an FEC state response message sent by the second equipment is received, determining that the second equipment has acquired the FEC function state of the first equipment and is switched from an open state to a closed state, and stopping sending the FEC state message to the second equipment.
Correspondingly, the status response message is a message responded by the second device in response to the status message sent by the first device. Whether the first equipment receives a state response message sent by the second equipment is detected, and whether the second equipment acquires the FEC function state of the first equipment is detected to be switched from an open state to a closed state.
For example, if the first device receives a status response message sent by the second device, it is determined that the second device has acquired the FEC function status of the first device, and the FEC function status is switched from the on status to the off status.
(3) And if the FEC state response messages are not received in all the FEC state messages sent to the second equipment for M times continuously, determining that the second equipment does not acquire the FEC function state of the first equipment and switching the FEC function state from the open state to the closed state.
For example, assuming that the sending end does not receive the FEC status response message of the receiving end after 5 seconds, the sending end sends the FEC status message to the receiving end again, and if the sending end does not receive the FEC status response message for three consecutive times, it is determined that the second device does not acquire the FEC functional status of the first device, and the sending end switches from the on status to the off status, and stops sending the FEC detection message to the receiving end.
It can be understood that, if the first device does not receive the status response message sent by the second device, the status message is sent to the second device at an interval of a second preset duration.
As an optional implementation manner in this embodiment of the present application, when the first device serves as a receiving end, the following steps are performed:
a. and receiving an FEC detection message sent by the third equipment.
In an embodiment, the first device may also serve as a receiving end, and in this case, the third device may serve as a sending end, and the first device receives the FEC detection packet sent by the third device.
b. And if the FEC function of the first equipment is in an open state, sending an FEC detection response message to the third equipment.
Similarly, if the FEC function of the first device is in the on state, the FEC detection response message is sent to the third device.
c. And if the FEC function of the first equipment is in a closed state, discarding the detection message.
It can be understood that, if the FEC function of the first device is in the off state, the FEC detection message sent by the third device cannot be responded to, and meanwhile, the FEC coding and decoding cannot be performed, and at this time, the FEC detection message may be discarded.
As an optional implementation manner of this embodiment, when the first device serves as a receiving end, the following steps are further performed:
d. and receiving a state message sent by the third equipment.
In one example, the first device serves as a receiving end, and the third device serves as a sending end at this time, and the first device receives the status packet sent by the third device.
e. And if the first equipment has acquired the FEC function state of the third equipment and is switched from the open state to the closed state, sending a state response message to the third equipment.
Correspondingly, if the first device has acquired the FEC function status of the third device and switched from the on status to the off status, a status response message is sent to the third device.
f. And if the first device does not acquire that the FEC function state of the third device is switched from the open state to the closed state, discarding the state message.
It can be understood that, if the first device does not acquire that the FEC functional state of the third device is switched from the on state to the off state, the first device cannot respond to the status packet sent by the third device, at this time, the step of performing FEC decoding on the message including the original packet and the redundant packet may be continuously performed, and the receiving end device does not process the received status packet or discards the status packet.
As an optional implementation manner of this embodiment of the present application, the first preset time period is 20 to 40 minutes, and the second preset time period is 20 to 40 minutes.
In any of the above embodiments, the first preset time period may be any time interval in a range of 20 to 40 minutes, and the second preset time period may be any time interval in a range of 20 to 40 minutes, or other reasonable values according to an application scenario, which is not limited in this respect.
The data transmission method is applied to first equipment, and when the FEC function of the first equipment is started, whether the FEC function of second equipment is started is detected; if the FEC function of the second equipment is determined to be started, the original message is encoded to generate a redundant message, and a message comprising the original message and the redundant message is sent to the second equipment; and if the FEC function of the second equipment is not started, sending the information of the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after the first preset time length. When the FEC function of the first equipment is switched from the closed state to the open state, detecting whether the FEC function of the second equipment is open; when the FEC function of the second equipment is detected to be in the opening state, the FEC sending detection message does not need to be sent to the second equipment at regular time to detect whether the FEC function of the second equipment is opened, and only the message containing the original message and the redundant message needs to be sent, so that the bandwidth occupation in the message communication process is reduced, and the communication resource is saved.
In one embodiment, as shown in fig. 3, there is provided a data transmission apparatus 300, including:
a detecting module 301, configured to detect whether a forward error correction FEC function of a second device is turned on when the FEC function of the first device is turned on;
a first function module 302, configured to perform FEC encoding on an original packet to generate a redundant packet and send a message including the original packet and the redundant packet to the second device if it is determined that the FEC function of the second device is started;
a second function module 303, configured to send a message including the original packet to the second device if it is determined that the FEC function of the second device is not started, and detect whether the FEC function of the second device is started again after a first preset time duration.
As an optional implementation manner of the embodiment of the present application, the detection module 301 is configured to:
sending the FEC detection message to the second equipment for N times; n is an integer greater than 1;
if an FEC detection response message sent by the second equipment is received, determining that the FEC function of the second equipment is started, and stopping sending the FEC detection message to the second equipment;
and if the FEC detection messages sent to the second equipment for N times continuously do not receive the FEC detection response messages, determining that the FEC function of the second equipment is not started.
As an optional implementation manner of the embodiment of the present application, the data transmission apparatus further includes a first receiving module, where the first receiving module is configured to:
receiving an FEC detection message sent by third equipment;
if the FEC function of the first equipment is in an opening state, sending an FEC detection response message to the third equipment;
and if the FEC function of the first equipment is in a closed state, discarding the detection message.
As an optional implementation manner of the embodiment of the present application, the data transmission device further includes a second detection module, where the second detection module is configured to:
when the FEC functional state of the first equipment is switched from an open state to a closed state, detecting whether the second equipment acquires the FEC functional state of the first equipment and switches from the open state to the closed state;
if not, sending a message including the original message to the second device, and detecting whether the second device has acquired the FEC functional state of the first device again after a second preset time length, wherein the FEC functional state is switched from an on state to an off state;
and if so, stopping decoding the message sent by the second equipment, and continuously sending the message including the original message to the second equipment.
As an optional implementation manner of the embodiment of the present application, the second detection module is specifically configured to:
sending an FEC state message to the second equipment for M times; m is an integer greater than 1;
if an FEC state response message sent by the second equipment is received, determining that the second equipment has acquired the FEC function state of the first equipment and is switched from an open state to a closed state, and stopping sending the FEC state message to the second equipment;
and if the FEC state response message is not received by all the FEC state messages sent to the second equipment for M times continuously, determining that the second equipment does not acquire the FEC functional state of the first equipment and switching the FEC functional state from the open state to the closed state.
As an optional implementation manner of the embodiment of the present application, the data transmission apparatus further includes a second receiving module, where the second receiving module is configured to:
receiving a state message sent by third equipment;
if the first device has acquired the FEC function state of the third device and switched from the open state to the closed state, sending a state response message to the third device;
and if the first device does not acquire that the FEC function state of the third device is switched from the open state to the closed state, discarding the state message.
As an optional implementation manner of this embodiment of the present application, the first preset time period is 20 to 40 minutes, and the second preset time period is 20 to 40 minutes.
The data transmission method is applied to first equipment, and when the FEC function of the first equipment is started, whether the FEC function of second equipment is started is detected; if the FEC function of the second equipment is determined to be started, the original message is encoded to generate a redundant message, and a message comprising the original message and the redundant message is sent to the second equipment; and if the FEC function of the second equipment is not started, sending the information of the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after the first preset time length. When the FEC function of the first equipment is switched from a closed state to an open state, detecting whether the FEC function of the second equipment is open or not; when the FEC function of the second equipment is detected to be in the opening state, the FEC sending detection message does not need to be sent to the second equipment at regular time to detect whether the FEC function of the second equipment is opened, and only the message containing the original message and the redundant message needs to be sent, so that the bandwidth occupation in the message communication process is reduced, and the communication resource is saved.
For specific limitations of the data transmission device, reference may be made to the above limitations on the data transmission method, which is not described in detail herein. The modules in the data transmission device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor of the electronic device, and can also be stored in the processor of the electronic device in a software form, so that the processor can call and execute operations corresponding to the modules.
An embodiment of the present application further provides an electronic device, and fig. 4 is a schematic structural diagram of the electronic device provided in the embodiment of the present application. As shown in fig. 4, the electronic device provided in this embodiment includes: a memory 41 and a processor 42, the memory 41 being for storing computer programs; the processor 42 is configured to execute the steps performed by any of the embodiments of the data transmission method provided by the above-mentioned method embodiments when calling the computer program. The electronic equipment comprises a processor, a memory, a communication interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The computer program is executed by a processor to implement a data transmission method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular electronic devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the data transmission apparatus provided in the present application may be implemented in the form of a computer, and the computer program may be executed on an electronic device as shown in fig. 4. The memory of the electronic device may store various program modules constituting the data transmission means of the electronic device, such as the detection module 301, the first function module 302, and the second function module 303 shown in fig. 3. The computer program constituted by the respective program modules causes the processor to execute the steps in the data transmission method of the electronic device of the respective embodiments of the present application described in the present specification.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the data transmission method provided by the foregoing method embodiment is implemented.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied in the medium.
The processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media may implement information storage by any method or technology, and the information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transmyedia) such as modulated data signals and carrier waves.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The previous description is only for the purpose of describing particular embodiments of the present disclosure, so as to enable those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A data transmission method, applied to a first device, the method comprising:
when the Forward Error Correction (FEC) function of the first equipment is started, sending an FEC detection message to second equipment for N times; n is an integer greater than 1;
if an FEC detection response message sent by the second equipment is received, determining that the FEC function of the second equipment is started, and stopping sending the FEC detection message to the second equipment;
if the FEC detection messages sent to the second equipment for N times continuously do not receive FEC detection response messages, determining that the FEC function of the second equipment is not started;
if the FEC function of the second equipment is determined to be started, FEC encoding is carried out on an original message to generate a redundant message, and a message comprising the original message and the redundant message is sent to the second equipment;
when the FEC function state of the first equipment is switched from an open state to a closed state, sending an FEC state message to the second equipment for M times; m is an integer greater than 1;
if an FEC state response message sent by the second equipment is received, determining that the second equipment has acquired the FEC function state of the first equipment and is switched from an open state to a closed state, and stopping sending the FEC state message to the second equipment;
if the FEC state response messages are not received by the FEC state messages sent to the second equipment for M times continuously, determining that the second equipment does not acquire the FEC function state of the first equipment and switching the FEC function state from an open state to a closed state;
if the FEC function of the second equipment is not started, sending a message including the original message to the second equipment, and detecting whether the FEC function of the second equipment is started again after a first preset time length.
2. The method of claim 1, further comprising:
receiving an FEC detection message sent by third equipment;
if the FEC function of the first equipment is in an open state, sending an FEC detection response message to the third equipment;
and if the FEC function of the first equipment is in a closed state, discarding the detection message.
3. The method of claim 1, further comprising:
if the second device does not acquire that the FEC functional state of the first device is switched from the open state to the closed state, sending a message including the original message to the second device, and detecting whether the second device acquires the FEC functional state of the first device again after a second preset time length, wherein the second device is switched from the open state to the closed state;
if so, stopping decoding the message sent by the second device, and continuing to send the message including the original message to the second device.
4. The method of claim 3, further comprising:
receiving a state message sent by third equipment;
if the first device has acquired the FEC functional state of the third device and is switched from the open state to the closed state, sending a state response message to the third device;
and if the first device does not acquire the FEC functional state of the third device, switching the FEC functional state from the open state to the closed state, discarding the state message.
5. The method of claim 3 or 4, further comprising:
the first preset time period is 20-40 minutes, and the second preset time period is 20-40 minutes.
6. A data transmission device, applied to a first device, includes:
a detection module, configured to send an FEC detection packet to a second device N times when a forward error correction FEC function of the first device is turned on; n is an integer greater than 1;
if an FEC detection response message sent by the second equipment is received, determining that the FEC function of the second equipment is started, and stopping sending the FEC detection message to the second equipment;
if the FEC detection messages sent to the second equipment for N times continuously do not receive FEC detection response messages, determining that the FEC function of the second equipment is not started;
a first function module, configured to perform FEC encoding on an original packet to generate a redundant packet and send a message including the original packet and the redundant packet to the second device if it is determined that the FEC function of the second device is started;
when the FEC function state of the first equipment is switched from an open state to a closed state, sending an FEC state message to the second equipment for M times; m is an integer greater than 1;
if an FEC state response message sent by the second equipment is received, determining that the second equipment has acquired the FEC function state of the first equipment, switching from an on state to an off state, and stopping sending the FEC state message to the second equipment;
if the FEC state response messages are not received by the FEC state messages sent to the second equipment for M times continuously, determining that the second equipment does not acquire the FEC function state of the first equipment and switching the FEC function state from an open state to a closed state;
and a second function module, configured to send a message including the original packet to the second device if it is determined that the FEC function of the second device is not started, and detect whether the FEC function of the second device is started again after a first preset time duration.
7. An electronic device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the data transmission method of any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that a computer program is stored thereon which, when being executed by a processor, carries out the data transmission method of any one of claims 1 to 5.
CN202111007203.XA 2021-08-30 2021-08-30 Data transmission method and device, electronic equipment and readable storage medium Active CN113691354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111007203.XA CN113691354B (en) 2021-08-30 2021-08-30 Data transmission method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111007203.XA CN113691354B (en) 2021-08-30 2021-08-30 Data transmission method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113691354A CN113691354A (en) 2021-11-23
CN113691354B true CN113691354B (en) 2022-11-29

Family

ID=78584056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111007203.XA Active CN113691354B (en) 2021-08-30 2021-08-30 Data transmission method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113691354B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039224A (en) * 2007-04-26 2007-09-19 华为技术有限公司 Method and equipment for detecting periodically link state
CN101594308A (en) * 2009-07-03 2009-12-02 华为技术有限公司 Message transmitting method and system
CN102781017A (en) * 2012-07-03 2012-11-14 北京小米科技有限责任公司 Method, device and communication equipment for detecting online state of opposite communication terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039224A (en) * 2007-04-26 2007-09-19 华为技术有限公司 Method and equipment for detecting periodically link state
CN101594308A (en) * 2009-07-03 2009-12-02 华为技术有限公司 Message transmitting method and system
CN102781017A (en) * 2012-07-03 2012-11-14 北京小米科技有限责任公司 Method, device and communication equipment for detecting online state of opposite communication terminal

Also Published As

Publication number Publication date
CN113691354A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
US9160687B2 (en) Method and apparatus for performing finite memory network coding in an arbitrary network
RU2507716C2 (en) Method, apparatus and system for controlling access
CN101873616B (en) Mobile terminal self-check method and system and mobile terminal
JP2020514865A (en) Blockchain based consensus method and device
WO2006066186A1 (en) Methods and apparatus for operating transceiver systems of a wireless platform
US11147049B2 (en) Uplink control channel resource determining method, terminal, and network side device
EP3652901A1 (en) Techniques for multi-agent messaging
US8010103B2 (en) Passive and active scanning in wireless network
CN110519388B (en) Processing method and device for block chain request, electronic equipment and readable storage medium
CN113691354B (en) Data transmission method and device, electronic equipment and readable storage medium
TW200803321A (en) Forward error correction in a distribution system
CN111181698A (en) Data processing method, device, equipment and medium
CN116668535B (en) Service execution method, device and equipment based on enhanced service architecture
WO2019180395A1 (en) Omamrc transmission method and system with reduced signalling
WO2019119269A1 (en) Network fault detection method and control center device
CN110856213B (en) Method and device for switching data transmission modes, storage medium and electronic equipment
JP2023126982A (en) Protocol data unit session processing method, device, and electronic equipment
CN113709776A (en) Communication method, device and system
US7899033B2 (en) Method and system for conditionally invoking an IMS service
JP5276673B2 (en) System and method for providing heterogeneous message protection
CN113676894B (en) Service processing method and equipment
US7457635B2 (en) Modem sharing device of PDA phone and method thereof
US9201722B1 (en) System-on-chip and method for sending data in a system-on-chip
CN113630282B (en) Method and device for detecting server state
US20240163145A1 (en) Advertising Method and Communication Device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant