CN116055009A - Data transmission method and related device - Google Patents

Data transmission method and related device Download PDF

Info

Publication number
CN116055009A
CN116055009A CN202111263130.0A CN202111263130A CN116055009A CN 116055009 A CN116055009 A CN 116055009A CN 202111263130 A CN202111263130 A CN 202111263130A CN 116055009 A CN116055009 A CN 116055009A
Authority
CN
China
Prior art keywords
frame
data
target
transmission
data frames
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.)
Pending
Application number
CN202111263130.0A
Other languages
Chinese (zh)
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.)
Zeku Technology Shanghai Corp Ltd
Original Assignee
Zeku Technology Shanghai Corp 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 Zeku Technology Shanghai Corp Ltd filed Critical Zeku Technology Shanghai Corp Ltd
Priority to CN202111263130.0A priority Critical patent/CN116055009A/en
Publication of CN116055009A publication Critical patent/CN116055009A/en
Pending legal-status Critical Current

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/08Arrangements for detecting or preventing errors in the information received by repeating transmission, e.g. Verdan system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)
  • Communication Control (AREA)

Abstract

The application provides a data transmission method and a related device, which are applied to first equipment, wherein first, a frame transmission sequence is determined according to frame numbers of N data frames in target data, the frame transmission sequence is used for indicating the transmission time of each data frame, and N is an integer greater than 0; then, transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence; then, receiving a retransmission instruction from the second device in a preset period, wherein the retransmission instruction is used for indicating a target frame number, and the target frame number is a target data frame which is not successfully transmitted in the frame transmission sequence; and finally, retransmitting the target data frame to the second equipment in response to the retransmission instruction. The high efficiency of data transmission can be ensured in the communication process, and the stability of data transmission is improved.

Description

Data transmission method and related device
Technical Field
The present disclosure relates to the field of communication protocols, and in particular, to a data transmission method and related device.
Background
With the development of communication technology, the mechanism of data transmission is also gradually changed, and synchronous transmission is generally applied to business scenes such as voice, video and the like as a transmission mechanism with higher transmission speed, but the existing synchronous transmission cannot determine whether the communication process is in error or not, and the communication quality cannot be ensured.
Disclosure of Invention
In view of this, the present application provides a data transmission method and related device, which can transmit data frames according to frame number sequence during synchronous transmission, so that a receiving party can identify missed data frames and inform a transmitting party to retransmit, and can improve stability of data transmission while ensuring high-speed data transmission.
In a first aspect, an embodiment of the present application provides a data transmission method, applied to a first device, where the method includes:
determining a frame transmission sequence according to the frame numbers of N data frames in the target data, wherein the frame transmission sequence is used for indicating the transmission time of each data frame, and N is an integer greater than 0;
transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence;
receiving a retransmission instruction from the second device in a preset period, wherein the retransmission instruction is used for indicating a target frame number, and the target frame number is a target data frame which is not successfully transmitted in the frame transmission sequence;
and responding to the retransmission instruction, and retransmitting the target data frame to the second equipment.
In a second aspect, an embodiment of the present application provides a data transmission method, applied to a second device, where the method includes:
Identifying frame numbers of any two continuous data frames to determine a continuity state of the data frames when receiving target data from first equipment, wherein the target data comprises N data frames, the frame numbers of the N data frames are continuously arranged from small to large, N is a natural number larger than 0, and the continuity state comprises continuous frame numbers or discontinuous frame numbers;
when the continuity state is that the frame numbers are discontinuous, determining a target frame number according to the frame numbers of any two continuous data frames;
transmitting a retransmission instruction to the first device, where the retransmission instruction is used to request the first device to retransmit a target data frame corresponding to the target frame number;
the target data frame from the first device is received to complete transmission of the target data.
In a third aspect, an embodiment of the present application provides a data processing apparatus, applied to a first device, where the apparatus includes:
a sequence determining unit, configured to determine a frame transmission sequence according to frame numbers of N data frames in the target data, where the frame transmission sequence is used to indicate a transmission time of each data frame, and N is an integer greater than 0;
a first transmission unit, configured to transmit the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence;
A first receiving unit, configured to receive a retransmission instruction from the second device within a preset period, where the retransmission instruction is used to indicate a target frame number, where the target frame number is a target data frame that is not successfully transmitted in the frame transmission sequence;
and the first retransmission unit is used for retransmitting the target data frame to the second equipment in response to the retransmission instruction.
In a fourth aspect, an embodiment of the present application provides a data transmission apparatus, applied to a second device, where the apparatus includes:
a second receiving unit configured to identify frame numbers of any two consecutive data frames to determine a continuity state of the data frames when receiving target data from a first device, the target data including N data frames, the frame numbers of the N data frames being arranged continuously from small to large, N being a natural number greater than 0, the continuity state including a frame number continuity or a frame number discontinuity;
a frame number determining unit, configured to determine a target frame number according to the frame numbers of the arbitrary two consecutive data frames when the continuity state is that the frame numbers are discontinuous;
a retransmission sending unit, configured to send a retransmission instruction to the first device, where the retransmission instruction is used to request the first device to retransmit a target data frame corresponding to the target frame number;
And the retransmission receiving unit is used for receiving the target data frame from the first equipment so as to finish the transmission of the target data.
In a fifth aspect, embodiments of the present application provide a first device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the application processor, the programs comprising instructions for performing the steps in the method according to any of the first aspects of the embodiments of the present application.
In a sixth aspect, embodiments of the present application provide a second device comprising a processor, a memory, and one or more programs stored in the memory and configured for execution by the application processor, the programs comprising instructions for performing the steps in the method according to any of the second aspects of embodiments of the present application.
In a seventh aspect, embodiments of the present application provide a computer storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform a method according to any one of the first aspects of embodiments of the present application.
In an eighth aspect, embodiments of the present application provide a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
It can be seen that the data transmission method and related apparatus are applied to a first device, and first, a frame transmission sequence is determined according to frame numbers of N data frames in target data, where N is an integer greater than 0 and is used to indicate a transmission time of each data frame; then, transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence; then, receiving a retransmission instruction from the second device in a preset period, wherein the retransmission instruction is used for indicating a target frame number, and the target frame number is a target data frame which is not successfully transmitted in the frame transmission sequence; and finally, retransmitting the target data frame to the second equipment in response to the retransmission instruction. The high efficiency of data transmission can be ensured in the communication process, and the stability of data transmission is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1A is a schematic diagram of a conventional synchronous transmission mechanism according to an embodiment of the present application;
FIG. 1B is a schematic diagram of another conventional bulk transfer mechanism provided by an embodiment of the present application;
fig. 2 is a system architecture diagram of a data transmission method according to an embodiment of the present application;
fig. 3 is a flow chart of a data transmission method according to an embodiment of the present application;
fig. 4 is a flow chart of another data transmission method according to an embodiment of the present application;
fig. 5 is a flow chart of another data transmission method according to an embodiment of the present application;
fig. 6 is a flowchart of another data transmission method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a functional unit block diagram of a data transmission device according to an embodiment of the present application;
Fig. 9 is a block diagram of functional units of another data transmission device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It should be understood that the term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, the character "/" indicates that the front and rear associated objects are an "or" relationship. The term "plurality" as used in the embodiments herein refers to two or more.
The "connection" in the embodiments of the present application refers to various connection manners such as direct connection or indirect connection, so as to implement communication between devices, which is not limited in any way in the embodiments of the present application.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
First, the background art and related terms in the embodiments of the present application will be described.
In communication protocols, the transmission means comprises synchronous transmission, and the bit packets of synchronous transmission are much larger. Instead of transmitting each character independently, each character may be transmitted in combination as each character has its own start and stop bits. These combinations are referred to as data frames, or simply frames. As shown in fig. 1A, fig. 1A is a schematic diagram of an existing synchronous transmission mechanism provided in the embodiment of the present application, it can be seen that a sender and a receiver may be a master and a slave, or may be a slave and a master, where the data includes N data frames, and the sender may sequentially transmit data frame 1 and data frame 2 until data frame N, but the sender cannot determine whether the receiver of the data frame successfully receives the data frame, and when the data frame is wrong, there is no retransmission mechanism. The stability of data transmission in the communication process cannot be ensured. The existing synchronous transmission is generally suitable for service scenes such as voice, video and the like which need to transmit data at high speed but the data transmission does not need to be too fine.
In the communication protocol, the transmission mode includes batch transmission, the sending of the batch transmission identifies whether the data is correctly transmitted through the response frame, the response frame may include acknowledgement character (Acknowledge character, ACK) or non-acknowledgement character (NACK), as shown in fig. 1B, fig. 1B is a schematic diagram of an existing batch transmission mechanism provided in the embodiment of the present application, the sender and the receiver may be a master and a slave, or may be a slave and a master, where the method is not specifically limited, under the condition that the data frame is normally transmitted, after the sender sends the data frame 1, the receiver feeds back an ACK response frame 1, after the sender receives the ACK response frame 1, the sender sends the data frame 2, and after the sender receives the ACK response frame 2, the sender sends the data frame 3 until the sender sends the last data frame N, and the receiver feeds back an ACK response frame N; in the case of error-retransmission of the data frame, the sender sends the data frame 1, and the receiver does not receive the data frame 1 at this time, then a NACK response frame 1 is fed back to inform the sender to retransmit the data frame 1, and the rest of the procedures are the same and will not be described in detail herein. It can be seen that since batch transmission waits for an acknowledgement frame each time data is sent, a part of the data transmission speed is sacrificed for data reliability. The method is suitable for the business scene of file transmission.
Therefore, the existing transmission mode has certain defects, and in order to provide a transmission mechanism with high efficiency and reliability, the embodiment of the application provides a data transmission method and a related device.
The following describes a system architecture of a data transmission method in an embodiment of the present application with reference to fig. 2, and fig. 2 is a system architecture diagram of a data transmission method provided in an embodiment of the present application, including a first device 210 and a second device 220.
The first device 210 and the second device 220 may include a smart Phone (such as an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a palm computer, a notebook computer, a video matrix, a monitoring platform, a mobile internet device (MID, mobile Internet Devices), a wearable device, etc., which are merely examples, but not exhaustive, including but not limited to the above devices, which are not specifically limited herein.
The first device 210 is connected to the second device 220, where the first device 210 may be a master device or a slave device, and the first device 210 is a master device, and the second device 220 is a slave device, and the first device 210 is a slave device, and the second device 220 is a master device, and the master device may send a data frame to the slave device, and the slave device may also send a data frame to the master device, which is not limited herein. In the embodiment of the present application, the first device 210 is a sender, and the second device 220 is a receiver.
The first device 210 is configured to determine a frame transmission sequence according to a frame number of each data frame in the target data, then send N data frames included in the target data to the second device 220 in the frame transmission sequence, where N is an integer greater than 0, and the second device 220 may sequentially receive the N data frames and identify a frame number of each data frame, and when frame numbers of any two consecutive data frames are discontinuous, may send a retransmission instruction to the first device 210, where the retransmission instruction may carry the target frame number of the target data frame, and the first device 210 may respond to the retransmission instruction to send the target data frame to the second device 220, so as to ensure integrity of data transmission.
It should be noted that the type of the transmission protocol between the first device 210 and the second device 220 may include universal serial interface transmission, network port communication, serial port communication, and the like, which are not limited herein.
Therefore, through the system architecture, the following data transmission method can be executed, and the data frames can be transmitted according to the frame number sequence during synchronous transmission, so that a receiving party can identify the data frames which are not transmitted and inform a transmitting party to retransmit, and the stability of data transmission can be improved while high-speed data transmission is ensured.
A data transmission method in the embodiment of the present application is described below with reference to fig. 3, and fig. 3 is a schematic flow chart of a data transmission method provided in the embodiment of the present application, where the method is applied to a first device, and specifically includes the following steps:
step 301, determining a frame transmission sequence according to the frame numbers of the N data frames in the target data.
The frame transmission sequence is used for indicating the transmission time of each data frame, N is an integer greater than 0, the frame numbers of the N data frames can be determined, then the frame transmission sequence can be determined according to the arrangement sequence of the frame numbers of the N data frames, and the frame transmission sequence corresponds to the arrangement sequence from small to large.
Specifically, the format composition of the data frame may be as shown in table 1:
TABLE 1
Figure BDA0003326186750000061
The frame header is started by a start byte and ended by a frame header check code, and usually comprises a frame number and a data content length, and can also comprise other custom information such as a command code. The order of frame number, command code and data content length may be adjusted. The start byte, frame number, command code, data content length, check code, data content, and byte length are not limited. It may occupy 1 byte, 2 bytes, or more than one byte.
The frame numbers generally begin to accumulate and count from 0, and return to 0 for a round after the frame number reaches a maximum value, where the maximum value is N, for example, a first transmitted data frame in the frame transmission sequence is a data frame with a frame number of 0, a second transmitted data frame is a data frame with a frame number of 1, and so on, which are not described herein again.
Therefore, the frame sending sequence is determined according to the frame numbers of N data frames in the target data, so that reliable identification references can be established for a subsequent retransmission mechanism, and the reliability of data transmission is improved.
Step 302, transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence.
The N data frames may be sequentially transmitted to the second device according to the frame transmission sequence, and the time interval for transmitting each data frame is the same, and the synchronous transmission mechanism may refer to the existing synchronous transmission mechanism, which is not described herein.
It can be seen that the N data frames are transmitted to the second device in a synchronous transmission mechanism according to the frame transmission sequence.
And step 303, receiving a retransmission instruction from the second device within a preset period.
The retransmission instruction is configured to instruct a target frame number, where the target frame number is a target data frame that is not successfully transmitted in the frame transmission sequence.
The preset period may take a time point when the transmission of the first data frame is completed as a time start point, and a time point when a reserved time length after the transmission of the last data frame is completed as a time end point, and determine that the normal transmission of the data frame is completed when a retransmission instruction from the second device is not received in the preset period. And when receiving the retransmission instruction from the second device in the preset period, executing step 304.
It can be seen that receiving the retransmission command from the second device within the preset period of time can provide time for the receiver to confirm whether to receive the data frame, thereby improving the reliability of data transmission while ensuring the high efficiency of data transmission.
And step 304, retransmitting the target data frame to the second device in response to the retransmission instruction.
The target data frame may be determined according to the target frame number, and then the target data frame is called from a first data buffer area and transmitted to the second device, where the first data buffer area includes M first memory addresses for buffering M data frames that have been sent, where M is an integer less than or equal to N.
It will be appreciated that the first data buffer may store the data frames that have been transmitted, and when the second device sends a retransmission instruction requesting retransmission of the target data frame, the first device may quickly find the corresponding target data frame from the first data buffer. The first data buffer is not infinite, and a capacity of 10kb to 20kb may be set, so long as it can store several data frames that have been transmitted recently.
For example, after the first device sends the first data frame, the first device may store the first data frame in the first memory address, after the first device sends the second data frame, the first device may store the second data frame in the second first memory address, and so on, until M first memory addresses all store the data frame, if M < N, the (m+1) th data frame may be stored in the first memory address in an overlapping manner, the (m+2) th data frame may be stored in the second memory address in an overlapping manner, and so on until the transmission of N data frames is completed. Generally, the size of the first data buffer is not set too small, and is not limited herein.
It should be noted that after retransmitting the target data frame, the remaining data frames may still be normally transmitted, for example, the first data frame is normally transmitted, the second data frame is failed to be transmitted, at this time, the first device may still normally transmit the third data frame, the second device may determine that the second data frame is the target data frame after receiving the third data frame, feedback the retransmission command, the first device normally transmits the fourth data frame before receiving the retransmission command, and after receiving the retransmission command, retransmits the second data frame, and then transmits the fifth data frame.
Therefore, the target data frame is retransmitted to the second equipment in response to the retransmission instruction, incomplete data transmission can be prevented, and the data transmission efficiency and the data transmission stability are ensured.
It can be seen that, by the above data transmission method, applied to the first device, first, a frame transmission sequence is determined according to frame numbers of N data frames in the target data, where the frame transmission sequence is used to indicate a transmission time of each data frame, and N is an integer greater than 0; then, transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence; then, receiving a retransmission instruction from the second device in a preset period, wherein the retransmission instruction is used for indicating a target frame number, and the target frame number is a target data frame which is not successfully transmitted in the frame transmission sequence; and finally, retransmitting the target data frame to the second equipment in response to the retransmission instruction. The high efficiency of data transmission can be ensured in the communication process, and the stability of data transmission is improved.
The following describes another data transmission method in the embodiment of the present application with reference to fig. 4, and fig. 4 is a schematic flow chart of another data transmission method provided in the embodiment of the present application, applied to a first device, where the method specifically includes the following steps:
Step 401, determining a frame transmission sequence according to the frame numbers of the N data frames in the target data.
Step 402, determining a data transceiving interval corresponding to the current transport protocol type.
The transmission protocol types may include universal serial interface communication, network port communication, serial port communication, etc., and different transmission protocol types have different transmission speeds, and the different transmission speeds correspond to different data receiving and transmitting intervals.
Therefore, by determining the data receiving and transmitting interval corresponding to the current transmission protocol type, different data transmission protocols can be applied, and the universality of the embodiment of the application is improved.
Step 403, determining the number of unit data frames transmitted in each data transceiving interval.
Wherein the number of unit data frames represents the number of data frames transmitted in each data transceiving interval.
Step 404, determining a first capacity of the first data buffer according to the number of unit data frames.
Wherein the first capacity includes a number of the first memory addresses, the number of the first memory addresses corresponding to the number of unit data frames.
It can be seen that determining the first capacity of the first data buffer according to the number of unit data frames can avoid the situation that the first device cannot find the data frame 1 in the first buffer when the first device wants to retransmit the data frame 1 after the data frame 1 is covered by the following (m+1) th data frame, and can set appropriate first capacities for different transmission protocol types, thereby further improving the transmission stability.
Step 405, transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence.
And step 406, receiving a retransmission instruction from the second device in a preset period.
Step 407, retransmitting the target data frame to the second device in response to the retransmission instruction.
It can be seen that the above data transmission method is applied to the first device, and first, a frame transmission sequence is determined according to frame numbers of N data frames in the target data, where the frame transmission sequence is used to indicate a transmission time of each data frame, and N is an integer greater than 0; then, transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence; then, receiving a retransmission instruction from the second device in a preset period, wherein the retransmission instruction is used for indicating a target frame number, and the target frame number is a target data frame which is not successfully transmitted in the frame transmission sequence; and finally, retransmitting the target data frame to the second equipment in response to the retransmission instruction. The high efficiency of data transmission can be ensured in the communication process, and the stability of data transmission is improved.
The steps not described in detail above may refer to the description of all or part of the steps of the method in fig. 3, and are not described herein.
The following describes another data transmission method in the embodiment of the present application with reference to fig. 5, and fig. 5 is a schematic flow chart of another data transmission method provided in the embodiment of the present application, where the method specifically includes the following steps:
step 501, upon receiving target data from a first device, identifies a frame number of any two consecutive data frames to determine a continuity state of the data frames.
The target data includes N data frames, where the frame numbers of the N data frames are continuously arranged from small to large, N is a natural number greater than 0, and the continuity state includes continuous frame numbers or discontinuous frame numbers, for example, when the second device receives a first data frame, the frame number of the first data frame may be determined to be 0, when the second device receives a normal second data frame, the frame number of the second data frame may be determined to be 1, and at this time, the continuity state may be determined to be continuous frame numbers; and the second device may determine that the continuity state is a frame number discontinuity when the frame number of the second data frame is received as 2.
And continuing to receive the subsequent data frames when the frame numbers are continuous, and executing the method of the step 502 when the frame numbers are discontinuous.
When receiving the target data from the first device, the frame numbers of any two continuous data frames are identified to determine the continuity state of the data frames, so that abnormal sending conditions of the data frames can be identified, and the data stability is improved.
Step 502, determining a target frame number according to the frame numbers of the arbitrary two continuous data frames when the continuity state is that the frame numbers are discontinuous.
The frame number missing between two data frames with discontinuous frame numbers can be used as a target frame number, and the target frame number can be one or a plurality of target frame numbers.
Since the frame numbers are continuously arranged and the transmission order is also to be transmitted in the arrangement order of the frame numbers, the target frame numbers can be easily determined.
And step 503, sending a retransmission instruction to the first device.
The retransmission instruction is configured to request the first device to retransmit a target data frame corresponding to the target frame number, where the retransmission instruction may carry the target frame number.
Therefore, by sending the retransmission instruction to the first device, the high-speed data transmission can be ensured, and the data transmission stability can be improved.
Step 504 receives the target data frame from the first device to complete transmission of the target data.
It should be noted that the second device also has a second data buffer, where the second data buffer includes N second memory addresses, each second memory address is used to store a corresponding data frame, the second device stores the received data frame into the second data buffer before completing all the data frames, for example, the second device may store the data frame 1 with the received frame number 0 into the second memory address 1, store the data frame 2 with the frame number 1 into the second memory address 2, and so on until the data frame N is stored into the second memory address N, if there is no transmission abnormality, complete data transmission, and when the data frame X is not received, send a retransmission instruction for the data frame X to the first device and skip the second memory address X first, and store the data frame x+1 into the second memory address x+1.
Therefore, the data transmission method is applied to the second equipment, establishes a retransmission identification mechanism under a synchronous transmission mechanism, and improves the stability of data transmission while ensuring the high efficiency of the data transmission.
For easy understanding, another data transmission method in the embodiment of the present application is described below with reference to fig. 6, and fig. 6 is a schematic flow chart of another data transmission method provided in the embodiment of the present application, where the method is applied to a first device and a second device, and specifically includes the following steps:
In step 601, the first device determines a frame transmission sequence according to frame numbers of N data frames in the target data.
In step 602, the first device transmits the N data frames to the second device in a synchronous transmission mechanism according to the frame transmission sequence.
In step 603, the second device, upon receiving the target data from the first device, identifies the frame numbers of any two consecutive data frames to determine the continuity status of the data frames.
In step 604, the second device determines a target frame number according to the frame numbers of the arbitrary two consecutive data frames when the continuity state is that the frame numbers are discontinuous.
Step 605, the second device sends a retransmission instruction to the first device.
In step 606, the first device receives a retransmission instruction from the second device within a preset period.
Step 607, in response to the retransmission instruction, retransmitting the target data frame to the second device.
Step 608, receiving the target data frame from the first device to complete transmission of the target data.
Therefore, the data transmission method is applied to the first equipment and the second equipment, establishes a retransmission identification mechanism under a synchronous transmission mechanism, and improves the stability of data transmission while ensuring the high efficiency of the data transmission.
The parts of the steps not described in detail are referred to in fig. 3, fig. 4, and fig. 5, and the description of all or part of the steps of the method is omitted here.
An electronic device in the embodiments of the present application will be described below with reference to fig. 7, fig. 7 is a schematic structural diagram of an electronic device provided in the embodiments of the present application, where the electronic device may be a first device or a second device, and as shown in fig. 7, the electronic device 700 includes a processor 701, a communication interface 702, and a memory 703, where the processor, the communication interface, and the memory are connected to each other, where the electronic device 700 may further include a bus 704, where the processor 701, the communication interface 702, and the memory 703 may be connected to each other through the bus 704, and the bus 704 may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus. The bus 704 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus. The memory 703 is used for storing a computer program comprising program instructions, the processor being configured to invoke the program instructions for performing all or part of the methods described in the above figures 3, 4, 5, 6.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that, in order to implement the above-mentioned functions, the cloud server includes corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application may divide the functional units of the first device and the second device according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
In the case of dividing each functional module by using a corresponding function, a data transmission device in the embodiment of the present application will be described in detail with reference to fig. 8, and fig. 8 is a block diagram of functional units of a data transmission device provided in the embodiment of the present application, where the block diagram is applied to a first device, and the data transmission device 800 includes:
a sequence determining unit 810, configured to determine a frame transmission sequence according to frame numbers of N data frames in the target data, where the frame transmission sequence is used to indicate a transmission time of each data frame, and N is an integer greater than 0;
a first transmission unit 820 for transmitting the N data frames to the second device in a synchronous transmission mechanism according to the frame transmission sequence;
a first receiving unit 830, configured to receive a retransmission instruction from the second device within a preset period, where the retransmission instruction is used to indicate a target frame number, where the target frame number is a target data frame that is not successfully transmitted in the frame sending sequence;
a first retransmission unit 840, configured to retransmit the target data frame to the second device in response to the retransmission instruction.
In the case of dividing each functional module by using a corresponding function, another data transmission device in the embodiment of the present application will be described in detail below with reference to fig. 9, where fig. 9 is a block diagram of functional units of a data transmission device provided in the embodiment of the present application, and the data transmission device 900 is applied to a second apparatus, and includes:
A second receiving unit 910, configured to identify frame numbers of any two consecutive data frames to determine a continuity state of the data frames when receiving target data from the first device, where the target data includes N data frames, the frame numbers of the N data frames are arranged continuously from small to large, N is a natural number greater than 0, and the continuity state includes a frame number continuity or a frame number discontinuity;
a frame number determining unit 920, configured to determine a target frame number according to the frame numbers of the arbitrary two consecutive data frames when the continuity state is that the frame numbers are discontinuous;
a retransmission sending unit 930, configured to send a retransmission instruction to the first device, where the retransmission instruction is configured to request the first device to retransmit a target data frame corresponding to the target frame number;
a retransmission receiving unit 940, configured to receive the target data frame from the first device to complete transmission of the target data.
By the data transmission method and the related device, the data frames can be transmitted according to the frame number sequence during synchronous transmission, so that a receiving party can identify the data frames which are not transmitted and inform a transmitting party to retransmit, and the stability of data transmission can be improved while high-speed data transmission is ensured.
It can be understood that, since the method embodiment and the apparatus embodiment are in different presentation forms of the same technical concept, the content of the method embodiment portion in the present application should be adapted to the apparatus embodiment portion synchronously, which is not described herein. The data transmission apparatus 800 and the data transmission apparatus 900 may perform the corresponding data transmission method included in the above-described embodiment.
The present application also provides a computer storage medium storing a computer program for electronic data exchange, the computer program causing a computer to execute some or all of the steps of any one of the methods described in the method embodiments above.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the methods described in the method embodiments above. The computer program product may be a software installation package, said computer comprising an electronic device.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of embodiments of the present application, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, the above examples being provided solely to assist in the understanding of the methods of the present application and the core ideas thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of data transmission, for use with a first device, the method comprising:
determining a frame transmission sequence according to the frame numbers of N data frames in the target data, wherein the frame transmission sequence is used for indicating the transmission time of each data frame, and N is an integer greater than 0;
Transmitting the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence;
receiving a retransmission instruction from the second device in a preset period, wherein the retransmission instruction is used for indicating a target frame number, and the target frame number is a target data frame which is not successfully transmitted in the frame transmission sequence;
and responding to the retransmission instruction, and retransmitting the target data frame to the second equipment.
2. The method of claim 1, wherein the determining the frame transmission sequence based on the frame numbers of the N data frames in the target data comprises:
determining the frame numbers of the N data frames;
and determining the frame transmission sequence according to the arrangement sequence of the frame numbers of the N data frames, wherein the frame transmission sequence corresponds to the arrangement sequence from small to large of the frame numbers.
3. The method of claim 2, wherein retransmitting the target data frame to the second device in response to the retransmission instruction comprises:
determining the target data frame according to the target frame number;
and calling the target data frame from a first data buffer zone and transmitting the target data frame to the second device, wherein the first data buffer zone comprises M first memory addresses used for buffering the transmitted M data frames, and M is an integer less than or equal to N.
4. A method according to claim 3, wherein before said transmitting said N data frames to a second device in a synchronous transmission mechanism according to said frame transmission sequence, the method further comprises:
determining a data receiving and transmitting interval corresponding to the current transmission protocol type;
determining the number of unit data frames transmitted in each data receiving and transmitting interval;
and determining a first capacity of the first data buffer area according to the number of unit data frames, wherein the first capacity comprises the number of first memory addresses, and the number of the first memory addresses corresponds to the number of the unit data frames.
5. A data transmission method, applied to a second device, the method comprising:
identifying frame numbers of any two continuous data frames to determine a continuity state of the data frames when receiving target data from first equipment, wherein the target data comprises N data frames, the frame numbers of the N data frames are continuously arranged from small to large, N is a natural number larger than 0, and the continuity state comprises continuous frame numbers or discontinuous frame numbers;
when the continuity state is that the frame numbers are discontinuous, determining a target frame number according to the frame numbers of any two continuous data frames;
Transmitting a retransmission instruction to the first device, where the retransmission instruction is used to request the first device to retransmit a target data frame corresponding to the target frame number;
the target data frame from the first device is received to complete transmission of the target data.
6. A data transmission apparatus for use with a first device, the apparatus comprising:
a sequence determining unit, configured to determine a frame transmission sequence according to frame numbers of N data frames in the target data, where the frame transmission sequence is used to indicate a transmission time of each data frame, and N is an integer greater than 0;
a first transmission unit, configured to transmit the N data frames to a second device in a synchronous transmission mechanism according to the frame transmission sequence;
a first receiving unit, configured to receive a retransmission instruction from the second device within a preset period, where the retransmission instruction is used to indicate a target frame number, where the target frame number is a target data frame that is not successfully transmitted in the frame transmission sequence;
and the first retransmission unit is used for retransmitting the target data frame to the second equipment in response to the retransmission instruction.
7. A data transmission apparatus for use with a second device, the apparatus comprising:
A second receiving unit configured to identify frame numbers of any two consecutive data frames to determine a continuity state of the data frames when receiving target data from a first device, the target data including N data frames, the frame numbers of the N data frames being arranged continuously from small to large, N being a natural number greater than 0, the continuity state including a frame number continuity or a frame number discontinuity;
a frame number determining unit, configured to determine a target frame number according to the frame numbers of the arbitrary two consecutive data frames when the continuity state is that the frame numbers are discontinuous;
a retransmission sending unit, configured to send a retransmission instruction to the first device, where the retransmission instruction is used to request the first device to retransmit a target data frame corresponding to the target frame number;
and the retransmission receiving unit is used for receiving the target data frame from the first equipment so as to finish the transmission of the target data.
8. A first device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-4.
9. A second device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of claim 5.
10. A computer storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 5.
CN202111263130.0A 2021-10-28 2021-10-28 Data transmission method and related device Pending CN116055009A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111263130.0A CN116055009A (en) 2021-10-28 2021-10-28 Data transmission method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111263130.0A CN116055009A (en) 2021-10-28 2021-10-28 Data transmission method and related device

Publications (1)

Publication Number Publication Date
CN116055009A true CN116055009A (en) 2023-05-02

Family

ID=86131824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111263130.0A Pending CN116055009A (en) 2021-10-28 2021-10-28 Data transmission method and related device

Country Status (1)

Country Link
CN (1) CN116055009A (en)

Similar Documents

Publication Publication Date Title
CN106330414B (en) Message transmission method and device
US8675472B2 (en) Method and apparatus for network management system
US8976814B2 (en) Method of transporting data from sending node to destination node
US9197373B2 (en) Method, apparatus, and system for retransmitting data packet in quick path interconnect system
CN105162706B (en) Multicast transmission method, apparatus and system
CN115994048B (en) Chip, communication method, system and storage medium
CN111769915B (en) Data transmission method and related equipment
CN103973414B (en) A kind of data transmission method and device
CN113992654A (en) High-speed file transmission method, system, equipment and medium
US7995517B2 (en) System and method for transmitting units of messages in a mobile communication system
CN103650401A (en) Internal communication method for mobile terminal
CN101605128A (en) The method that the LINUX master-slave equipment communicates by Ethernet interface
CN112395237A (en) Method and system for communication between at least two controllers
CN114500528A (en) Data transmission method and device based on cloud platform
CN116055009A (en) Data transmission method and related device
CN111741013B (en) Data transmission method and device
JPH1070523A (en) Method and equipment for packet transmission
JP2004187099A (en) Communication control method, communication system and communication equipment
JP3148733B2 (en) Signal processing device and signal processing system
KR20090043724A (en) A method for serial transmitting/receiving high volume data
EP4280495A1 (en) Block acknowledgment method, apparatus, and storage medium
JP3131455B2 (en) Communication data guarantee method
CN117294400A (en) Data transmission method and device and electronic equipment
JPS63246055A (en) Packet transmitter-receiver
CN117149678A (en) RS485 bus arbitration system and method with multiple masters and multiple slaves

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