WO2024037254A1 - 一种通信方法及装置 - Google Patents

一种通信方法及装置 Download PDF

Info

Publication number
WO2024037254A1
WO2024037254A1 PCT/CN2023/106766 CN2023106766W WO2024037254A1 WO 2024037254 A1 WO2024037254 A1 WO 2024037254A1 CN 2023106766 W CN2023106766 W CN 2023106766W WO 2024037254 A1 WO2024037254 A1 WO 2024037254A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
message
transmission
control message
option information
Prior art date
Application number
PCT/CN2023/106766
Other languages
English (en)
French (fr)
Inventor
张旭东
唐维平
刘国权
王雅莉
王键
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024037254A1 publication Critical patent/WO2024037254A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC

Definitions

  • the present application relates to communication technology, and in particular, to a communication method and device.
  • Connection oriented is a network protocol that relies on explicit communication and blocking between the sender and receiver to manage the data transmission of both parties.
  • Connection-oriented service means that both communicating parties need to establish a communication connection before communicating.
  • Transmission control protocol is a transport layer protocol that provides connection-oriented services. Although TCP can achieve reliable transmission between communicating parties, the data transmission efficiency between communicating parties is low.
  • This application discloses a communication method and device, which can independently control a one-way communication connection and is beneficial to improving data transmission efficiency.
  • this application provides a communication method, which method is applied to a first device.
  • the method includes: sending a first control message to a second device, where the first control message includes a first transmission control option. information, the first transmission control option information is used to request to start data transmission from the first device to the second device; receiving a second control message from the second device, the second control message including second transmission control option information, the second transmission control option information is used to confirm the initiation of data transmission from the first device to the second device; when the second control is not sent to the second device In the case of a response message of the message, the first data is sent to the second device.
  • the first device may be, for example, a handheld terminal, a vehicle, a vehicle-mounted device, or a network side device, a user equipment, an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a wireless communication device,
  • Equipment such as user agents or user devices can also be any possible intelligent terminal equipment (such as mobile phones), intelligent transportation equipment (such as vehicles, drones, etc.), intelligent manufacturing equipment, smart home equipment (such as large screens, speakers, etc.) ), etc., may also be components (such as chips or integrated circuits) within the above-mentioned electronic equipment.
  • the first transmission control option information is carried by the transmission control option field in the header of the first control message.
  • the transmission control option field may carry the first transmission control option information through bit mapping, binary value or other methods.
  • the second transmission control option information is carried by the transmission control option field in the header of the second control message.
  • the first device can independently control the initiation of unidirectional data transmission by sending a request to the second device to initiate data transmission from the first device to the second device. Moreover, the first device can transmit data to the second device without sending a confirmation response of the confirmation reply to the second device, which is beneficial to improving data transmission efficiency.
  • the data transmission from the first device to the second device is performed based on a one-way communication connection.
  • Implementing the above implementation method also realizes the establishment of a one-way communication connection.
  • this application can realize independent control of the one-way communication connection, that is, the first device serves as the sending end of data and does not need to send data before sending data to the second device.
  • Local resources are reserved for receiving data from the second device, so that data transmission from the first device to the second device can be realized quickly and efficiently.
  • sending the first data to the second device without sending a response message of the second control message to the second device includes any of the following situations: through the The first control message carries the first data; after sending the first control message and before receiving the second control message, sending a first control message carrying the first data to the second device. data message; or after receiving the second control message, sending a first data message carrying the first data to the second device.
  • the first data is carried through the first control, which means that the control message in this application can carry data.
  • Handshake can also start data transmission as early as possible, for example, by carrying data through a message requesting to start data transmission, or after sending a message requesting startup data transmission, or after receiving a confirmation start sent by the second device.
  • the data transmission is followed by a reply, etc., which effectively reduces the transmission delay of the first service data of the first device and improves the data transmission efficiency.
  • the first control message also includes source port information and/or destination port information, where the source port information is used to carry The identity of the first application on the first device for sending data, and the destination port information is used to carry the identity of the second application on the second device for receiving the data.
  • the first application and the second application may be the same application or different applications.
  • the source port information is carried by the source port field in the header of the first control message
  • the destination port information is carried by the destination port field in the header of the first control message.
  • the receiving end of the first control message can know the source application on the first device for sending data through the source port information in the first control message, and through the destination port in the first control message.
  • the information may inform the intended application on the second device for receiving the data.
  • the first control message also includes sequence number information and/or confirmation sequence number information, wherein the sequence number information is used to carry the sending sequence number of the first control message, and the confirmation sequence The number information is used to carry the confirmation sequence number of the first control message.
  • sequence number information is carried by the sequence number field in the header of the first control message
  • confirmation sequence number information is carried by the confirmation sequence number field in the header of the first control message
  • the sending sequence number is the number used by the sending end to sort the sent messages. Generally, every time the sending end sends a message, it carries the instructions start (used to request to start the data transmission from the sending end to the receiving end), end (used to request the termination) Data transmission from the sending end to the receiving end) or reset (used to reset one-way data transmission or reset two-way data transmission) control primitive message or message carrying new data, the sending sequence number will occur Variety. When the sender retransmits the message, the sending sequence number carried in the message remains unchanged.
  • the confirmation sequence number is generally obtained by the receiving end based on the sending sequence number carried in the message sent by the sending end.
  • the sending end can determine whether the message sent by the sending end has been successfully received by the receiving end based on the confirmation sequence number carried in the received message. And which message was successfully received by the receiving end.
  • the filling rule for the sequence number field may be: if the first device sends a message carrying the instruction start or start ack (used to confirm the start of data transmission from the receiving end to the sending end) for the first time, the sending sequence number may be from a Starting with a random positive integer or the maximum value of the sending sequence number of the message sent in the previous transmission cycle, each time a message carrying a start, end or reset control primitive is sent or a message carrying new data is sent, The sending sequence number is incremented by 1, otherwise the sending sequence number remains unchanged. For example, when the first device retransmits the message, the sending sequence number remains unchanged. It can be understood that the sequence number field is mainly used to determine the transmission sequence. In addition to the change in the incremental form of the above example, the change in the sequence number of the message can also be changed in the decreasing form, which is not specifically limited here.
  • the filling rules for the confirmation sequence number field may be: when the first device has never received a message from the second device, fill in the confirmation sequence number field with 0; when the first device has received a message from the second device in history, Then the confirmation sequence number field is filled with the maximum value among multiple consecutive sending sequence numbers of the packets received by the first device from the second device. It can be understood that when no packet loss occurs in the packets sent by the second device to the first device in history, the confirmation sequence number filled in the confirmation sequence number field by the first device can also be the latest packet received by the first device from the second device. The sending sequence number of the message.
  • the rules for filling in the serial number can also be confirmed in other feasible ways, which are not specifically limited here.
  • the sequence number information can ensure the orderly transmission of data on the transport layer, and the second device can determine whether it is itself through the confirmation sequence number information in the first control message. Packet loss occurs.
  • the first transmission control option information is carried in an option field of the first control message, and the first control message also includes option length information, and the option length information is used to carry the The length of the option field.
  • the option length information is carried by the option length field in the message header of the first control message.
  • the option field is also used to carry at least one of the following information:
  • Checksum option information the checksum option information is used to carry the message header of the first control message and the checksum of the data to be sent;
  • Payload length option information is used to carry the length of the payload field in the first control message, and the payload field is used to carry the data sent by the first device;
  • Window size option information the window size option information is used to carry the cache space available for receiving data from the first device in the resources configured by the second device;
  • Option mapping information the option mapping information is used to indicate whether the optional information such as the first transmission control option information, the checksum option information, the payload length option information or the window size option information is carried in the options field.
  • the checksum option information is carried by the checksum option field in the option field
  • the payload length option information is carried by the payload length option field in the option field
  • the window size option information is carried by the option field.
  • the window size option field in the field is carried
  • the option mapping information is carried by the option mapping field in the option field.
  • the window size option information is generally set by the receiving end of the data.
  • the receiving end can reversely affect the data sending rate of the sending end and/or the size of the data to be sent through the window size option information.
  • the option mapping information indicates which optional information is carried in the option field in the form of a bitmap, where multiple bits correspond to multiple types of option information one-to-one.
  • the transmission control option field corresponds to the first bit in the option mapping field. When the first bit is set, it indicates that the option field includes the transmission control option field.
  • the method further includes: when a response message of the first data message is not received within a preset time period, re- Send the first data message.
  • the reliability of the transmission can be improved by retransmitting the first data message.
  • the method further includes: receiving a first response message from the second device; according to the first A confirmation sequence number carried in the response message and a transmission sequence number carried in the first data message are used to determine whether to resend the first data message.
  • the first device can determine whether the first data packet sent by the first device is successfully received by the second device by comparing the sequence number carried by the first data packet and the confirmation sequence number carried by the first response packet. When the first data packet is not successfully received by the second device, retransmitting the first data packet can improve transmission reliability.
  • the first response message further includes first window size option information, which is used to carry resources configured by the second device that can be used to receive data from the first device.
  • the first cache space the method further includes: adjusting the data sending rate and/or the size of the data to be sent according to the first window size option information.
  • the first window size option information is carried by the window size option field in the message header of the first response message.
  • the first device can adaptively adjust the data transmission rate and/or the size of the data to be sent according to the window size option information in the message sent by the second device, which is beneficial to improving the data transmission efficiency. and transmission reliability.
  • adjusting the data sending rate and/or the size of the data to be sent according to the first window size option information includes: when the first cache space is less than a first preset threshold, reducing the data sending rate. The sending rate and/or the size of the data to be sent is reduced; or, when the first cache space is greater than the second preset threshold, the sending rate of the data is increased and/or the size of the data to be sent is increased, so The second preset threshold is greater than or equal to the first preset threshold.
  • the first device when the first cache space is small, can reduce the data sending rate and/or reduce the size of data sent each time, so that the second device can process the data received in the storage resource within a certain period of time. Data is cleared to increase the cache space available for receiving data in storage resources, which is beneficial to improving transmission reliability and reducing packet loss. When the first cache space is sufficient, the first device can increase its own data sending rate and/or the size of data sent each time, thereby improving data transmission efficiency.
  • adjusting the data sending rate according to the first window size option information includes: suspending data sending to the second device when the first cache space is less than a third preset threshold; The method further includes: receiving a second response message from the second device, the second response message including second window size option information, the second window size option information carrying all configuration parameters of the second device.
  • the second cache space in the resource that can be used to receive data from the first device; when the sending sequence number carried by the second response message is greater than or equal to the sending sequence number of the first response message, and the When the second cache space is not less than the third preset threshold, continue sending data to the second device.
  • the third preset threshold is smaller than the first preset threshold.
  • the sending sequence number carried in the second response message is greater than or equal to the sending sequence number carried in the first response message, indicating that the second response message carries a control primitive or carries any one of start, end and reset. data on the second device side.
  • the second response message may be sent multiple times by the second device.
  • the first device receives the second response message, if the sending sequence number carried by the second response message is greater than or equal to the sending sequence number of the first response message, the first device needs to process the second response message accordingly. , it cannot be considered as a duplicate message and discarded.
  • the response message of the data message may be sent multiple times by the second device.
  • the first device receives the response message, if the sending sequence number carried in the response message is greater than or equal to the maximum sending sequence number of the message received from the second device in this transmission cycle, and the response message carries the above option field, The first device needs to process the response message accordingly and cannot discard it as a duplicate message.
  • the option field includes at least one item of the above-mentioned option information.
  • the first cache space when the first cache space is less than the third preset threshold, it means that the cache space available for receiving data from the first device in the resources configured by the second device is seriously insufficient.
  • the first device can actively The data transmission to the second device is suspended, and when the resources configured by the second device have sufficient cache space for receiving data from the first device, the first device continues to transmit data to the second device. In this way, packet loss can be reduced.
  • the method further includes: sending a third control message to the second device, the third control message including third transmission control option information, and the third transmission control option information is used to request termination. Data transmission from the first device to the second device; receiving a fourth control message from the second device, the fourth control message including fourth transmission control option information, the fourth transmission control The option information is used to confirm the termination of data transmission from the first device to the second device.
  • the first device determines that the data transmission from the first device to the second device is completed.
  • the first device is configured with a first state machine, and the first state machine is configured to: when the first device is in the initial state, in response to starting to send a data event, the first device is switched from the initial state to the waiting-to-be-responsed state, and the first device performs the action of sending the first control message to the second device.
  • the initial state indicates that data transmission from the first device to the second device has not been initiated, that is, the first device has not requested from the second device to initiate data transmission from the first device to the second device.
  • the waiting to start response state indicates that the first device is waiting for a reply from the second device to confirm starting the data transmission from the first device to the second device.
  • the event of starting to send data means that the first device has a need to transmit data to the second device.
  • the first device when initiating unidirectional data transmission, can use the first state machine to manage the communication connection state when the first device serves as the sender of data.
  • the first state machine is further configured to: when the first device is in the waiting to start response state, in response to an event of receiving the second control message, the first device is The waiting start response state is switched to the data sending state.
  • the sending data status means that the first device knows that the data transmission from the first device to the second device has been successfully started. In this state, the first device can transmit data to the second device in sequence.
  • the first state machine is further configured to: when the first device is in the sending data state, in response to an end sending data event, the first device is switched from the sending data state to waiting. Ending the response state, and the first device performs the action of sending a third control message to the second device, wherein the third control message includes third transmission control option information, and the third transmission control option Information for requesting termination of data transmission from the first device to the second device.
  • the end of sending data event means that the first device has completed the transmission of the last data and the first device will no longer send data to the second device in this transmission cycle.
  • the waiting end response state indicates that the first device is waiting for a reply from the second device to confirm the termination of data transmission from the first device to the second device.
  • the first state machine is further configured to: when the first device is in the waiting end response state, in response to an event of receiving a fourth control message, the first device is configured by the The waiting end response state is switched to the initial state, wherein the fourth control message includes fourth transmission control option information, and the fourth transmission control option information is used to confirm the termination from the first device to the third device. Data transmission between two devices.
  • the first state machine is further configured to: when the first device is in any one of the waiting start response state, the sending data state and the waiting end response state, respond to A local fault event or an event of receiving the fifth control message sent by the second device, the first device is switched to the reset state, and the first device performs a reset operation and the The first device also performs the action of sending a sixth control message to the second device; wherein the fifth control message includes fifth transmission control option information, and the fifth transmission control option information is used to reset the slave Data transmission from the first device to the second device; the sixth control message includes sixth transmission control option information, and the sixth transmission control option information is used to reset the data from the first device to the second device. data transmission from the second device.
  • the local fault event includes at least one of a lower layer protocol (for example, a network layer protocol or a data link layer protocol) disconnection event, a data transmission failure event, and the like.
  • a lower layer protocol for example, a network layer protocol or a data link layer protocol
  • disconnection event for example, a data transmission failure event, and the like.
  • the reset state means that the first device resets data transmission from the first device to the second device.
  • the second device also needs to reset the data transmission from the first device to the second device.
  • the first state machine is further configured to: when the first device is in the reset state, in response to completing a reset event, the first device is switched from the reset state to the reset state. Describe the initial state.
  • the completion of reset event means that the first device has completed the reset operation locally.
  • the second transmission control option information of the second control message is also used to request to start data transmission from the second device to the first device; the data received from the second device After the second control message, the method further includes: the first device is configured to resources for receiving data from the second device; the first device sends a seventh control message to the second device, the seventh control message includes seventh transmission control option information, and the seventh transmission control message
  • the option information is used to confirm the initiation of data transmission from the second device to the first device.
  • the data transmission from the second device to the first device is performed based on the one-way second communication connection.
  • the second communication connection is a communication connection for transmitting data from the second device to the first device.
  • the second control message not only implements a confirmation reply to the first device's request to start data transmission, but also implements a request to the first device to start data transmission from the second device to the first device. In this way, the first device and Based on two independent one-way connections, two-way data transmission is initiated between the second devices, which is beneficial to improving the efficiency of data transmission.
  • the second device's confirmation reply to the first device's request to start data transmission and the second device's request to start data transmission from the second device to the first device may not be combined and sent in one message. That is, sent through two messages respectively.
  • the first device first receives a request from the second device to start the process.
  • the first device receives a message sent by the second device requesting to start data transmission from the second device to the first device.
  • the method further includes: receiving a second data message from the second device, the second data message carrying second data. ;Send a third data message to the second device, the third data message carries third data, and the confirmation sequence number carried in the third data message is the confirmation sequence number carried in the second data message. Send serial number.
  • the timing at which the first device receives the second data from the second device is not limited to the timing at which the first device receives the second data from the second device after the first device sends the seventh control message to the second device. It may be earlier, for example, the second data is carried in the second control message, or the first device receives the second data message from the second device before the first device sends the seventh control message to the second device, in This is not specifically limited.
  • the third data message is not only a confirmation reply to the second data message, but also carries new data. In this way, bandwidth consumption can be saved.
  • the method further includes: receiving an eighth control message from the second device, the eighth control message including eighth transmission control option information, and the eighth transmission control option information is used to request termination.
  • the device sends a ninth control message.
  • the ninth control message includes ninth transmission control option information.
  • the ninth transmission control option information is used to confirm the termination of data transmission from the second device to the first device. .
  • the first device after the first device receives a message sent by the second device requesting to terminate data transmission from the second device to the first device, the first device releases the resources locally allocated for receiving data from the second device, and A confirmation reply to the request to terminate the data transmission is sent to the second device, thus ending the data transmission from the second device to the first device.
  • the first device is configured with a second state machine
  • the second state machine is configured to: when the first device is in the initial state, in response to receiving the second control message event, the first device is switched from the initial state to the data receiving state, and the first device performs the action of sending the seventh control message to the second device.
  • the initial state indicates that data transmission from the second device to the first device is not initiated.
  • the receiving data state indicates that the first device has completed configuring resources for receiving data from the second device and is waiting to receive data transmitted by the second device.
  • the management of the connection state and the connection state when the same device serves as the sender when the device serves as the receiving end, the management of the connection status is independently decoupled.
  • the first device when the first device serves as the sending end of data, it maintains the communication connection state through the first state machine.
  • the first device When the first device serves as the receiving end of data, it maintains the communication connection state through the second state.
  • the machine maintains the communication connection status, which can effectively simplify the device's management of the communication connection status.
  • the second state machine is further configured to: when the first device is in the receiving data state, in response to an event of receiving an eighth control message, the first device is The data state is switched to the pending state, and the first device performs the action of releasing the local storage resource and sending a ninth control message to the second device, wherein the eighth control message includes an eighth Transmission control option information, the eighth transmission control option information is used to request the termination of data transmission from the second device to the first device; the ninth control message includes ninth transmission control option information, the The ninth transmission control option information is used to confirm the termination of data transmission from the second device to the first device.
  • the pending state indicates that the first device releases the resources configured in the first device for receiving data from the second device, that is, ends receiving data from the second device.
  • the second state machine is further configured to: when the first device is in the to-be-ended state, in response to a completion event, the first device is switched from the to-be-ended state to the to-be-ended state. initial state.
  • the completion event refers to the end of the first device releasing resources configured for receiving data from the second device.
  • the second state machine is further configured to: when the first device is in the receiving data state or the pending end state, respond to a local fault event or receive a message sent by the second device.
  • the first device In the event of the tenth control message, the first device is switched to the reset state, and the first device performs a reset operation and when a local fault occurs, the first device also performs a third transmission to the second device.
  • Actions of eleven control messages wherein the tenth control message includes tenth transmission control option information, and the tenth transmission control option information is used to reset the transmission from the second device to the first device.
  • Data transmission; the eleventh control message includes eleventh transmission control option information, and the eleventh transmission control option information is used to reset data transmission from the second device to the first device.
  • the local fault event includes at least one of a lower layer protocol (for example, a network layer protocol or a data link layer protocol) disconnection event, a message transmission failure event, and the like.
  • a lower layer protocol for example, a network layer protocol or a data link layer protocol
  • the reset state indicates that the first device resets data transmission from the second device to the first device.
  • the second device also needs to reset the data transmission from the second device to the first device.
  • the eleventh transmission control option information is also used to reset data transmission from the first device to the second device.
  • the first device can realize the resetting of bidirectional data transmission through the eleventh transmission control option information.
  • the second state machine is further configured to: when the first device is in the reset state, in response to completing a reset event, the first device is switched from the reset state to the reset state. Describe the initial state.
  • the completed reset event means that the first device has completed the reset operation locally.
  • the present application provides a communication method, which method is applied to a second device.
  • the method includes: receiving a first control message from the first device, where the first control message includes first transmission control option information.
  • the first transmission control option information is used to request to start data transmission from the first device to the second device; configure resources for receiving data from the first device, and send data to the first device.
  • the response message of the second control message is not received from the first device, the first data is received from the first device.
  • the second device may be, for example, a handheld terminal, a vehicle, a vehicle-mounted device, or a network side device, a user equipment, an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a wireless communication device,
  • Equipment such as user agents or user devices can also be any possible intelligent terminal equipment (such as mobile phones), intelligent transportation equipment (such as vehicles, drones, etc.), intelligent manufacturing equipment, smart home equipment (such as large screens, speakers, etc.) ), etc., may also be components (such as chips or integrated circuits) within the above-mentioned electronic equipment.
  • the first transmission control option information is carried by the transmission control option field in the header of the first control message.
  • the transmission control option field may carry the first transmission control option information through bit mapping, binary value or other methods.
  • the second transmission control option information is carried by the transmission control option field in the header of the second control message.
  • the second device allocates storage resources to the first device based on the request sent by the first device to initiate data transmission from the first device to the second device, and sends a confirmation reply to the request to the first device, that is, to achieve Initiates one-way data transfer.
  • data can be received from the first device without receiving the confirmation response sent by the first device, which is beneficial to improving data transmission efficiency.
  • the data transmission from the first device to the second device is performed based on a one-way communication connection.
  • a one-way communication connection For the technical effect of this feature, reference can be made to the description of the technical effect of the corresponding feature in the first aspect, and will not be described again here.
  • receiving the first data from the first device without receiving a response message of the second control message from the first device includes any of the following situations: through the The first control message carries the first data; after receiving the first control message and before sending the second control message, receiving a first control message carrying the first data from the first device. data message; or after sending the second control message, receiving a first data message carrying the first data from the first device.
  • the second device not only does not need to perform the third handshake in the existing technology, Data can also be received from the first device earlier, improving data transmission efficiency.
  • the first control message also includes source port information and/or destination port information, where the source port information is used to carry The identity of the first application on the first device for sending data, and the destination port information is used to carry the identity of the second application on the second device for receiving data.
  • the first control message also includes sequence number information and/or confirmation sequence number information, wherein the sequence number information is used to carry the sending sequence number of the first control message, and the confirmation sequence The number information is used to carry the confirmation sequence number of the first control message.
  • the first transmission control option information is carried in an option field of the first control message, and the first control message also includes option length information, and the option length information is used to carry the The length of the option field.
  • the option field is also used to carry at least one of the following information:
  • Checksum option information the checksum option information is used to carry the message header of the first control message and the checksum of the data to be sent;
  • Payload length option information is used to carry the length of the payload field in the first control message, and the payload field is used to carry the data sent by the first device;
  • Window size option information the window size option information is used to carry resources that can be used to receive data from the first device among the resources configured by the second device;
  • Option mapping information the option mapping information is used to indicate whether the optional information such as the first transmission control option information, the checksum option information, the payload length option information or the window size option information is carried in the options field.
  • the method further includes: sending a first response message to the first device, the first response message
  • the acknowledgment sequence number carried in the text is the sending sequence number carried in the first data message.
  • the second device after receiving the data packet from the first device, the second device sends a confirmation reply of the data packet to the first device, so that the first device can determine that the second device successfully received the data based on the confirmation reply. message.
  • the first response message further includes first window size option information, the first window size option information is used to carry the resources configured by the second device that are available from the first device.
  • the first buffer space for receiving data, the first window size option information is used by the second device to reversely adjust the rate at which the first device sends data and/or adjust the size of data to be sent.
  • the second device can enable the first device to adaptively adjust the data transmission rate and/or the size of the data to be sent by carrying window size option information in the message.
  • the first response message when it is detected that the first cache space is less than a first warning value, the first response message further includes the first window size option information.
  • the second device when the second device detects that the cache space available for receiving data from the first device in the locally configured resources is insufficient, it can prompt the first device to make corresponding adjustments by carrying window size option information in the message.
  • the method further includes: clearing the received data in the storage resource; when detecting that the second device in the resource configured by the second device can be used to receive data from the first device.
  • the cache space is greater than the second warning value, send at least one second response message to the first device.
  • the second response message includes second window size option information, and the second window size option information is used to carry In the second cache space, the second warning value is greater than or equal to the first warning value.
  • the second device when the second device detects that the cache space available for receiving data from the first device in the locally configured resources is sufficient, it can also prompt the first device to respond accordingly by carrying window size option information in the message. Adjustment. In order to improve the reliability of transmission, the message carrying the window size option information can be sent multiple times by the second device.
  • the method further includes: receiving a third control message from the first device, the third control message including third transmission control option information, and the third transmission control option information is used to request the termination of the slave device.
  • Data transmission from the first device to the second device releasing resources in the second device for receiving data configuration from the first device based on the third control message; sending data to the first device A fourth control message is sent, where the fourth control message includes fourth transmission control option information, where the fourth transmission control option information is used to confirm the termination of data transmission from the first device to the second device.
  • the second device releases the locally configured resources for receiving data from the first device based on the request received from the first device to terminate the data transmission from the first device to the second device, and sends the request to the first device.
  • the device sends a confirmation reply to inform the first device.
  • the first device is configured with a first state machine, and the first state machine is configured to: when the first device is in an initial state, in response to receiving the first control message event, the first device is switched from the initial state to the data receiving state, and the second device performs an action of sending the second control message to the first device.
  • the initial state indicates that the second device has not initiated data transmission from the first device to the second device.
  • the receiving data state indicates that the second device has completed configuring resources for receiving data from the first device and is waiting to receive data transmitted by the first device.
  • the second device when initiating unidirectional data transmission, can use the first state machine to manage the communication connection state when the second device serves as the receiving end of data.
  • the first state machine is further configured to: when the second device is in the receiving data state, in response to an event of receiving a third control message, the second device is The data state is switched to the pending state, and the second device performs the actions of releasing resources in the second device for receiving data configuration from the first device and sending a fourth control message to the first device.
  • the third control message includes third transmission control option information, and the third transmission control option information is used to request the termination of data transmission from the first device to the second device;
  • the fourth control The message includes fourth transmission control option information, and the fourth transmission control option information is used to confirm the termination of data transmission from the first device to the second device.
  • the pending state indicates that the second device releases resources configured in the second device for receiving data from the first device, that is, ends receiving data from the first device.
  • the first state machine is further configured to: when the second device is in the to-be-ended state, in response to a completion event, the second device is switched from the to-be-ended state to the to-be-ended state. initial state.
  • the completion event refers to the end of the second device releasing the resources configured for receiving data from the first device.
  • the first state machine is further configured to: when the second device is in the receiving data state or the pending end state, respond to a local fault event or receive a message sent by the second device.
  • the second device In the event of the fifth control message, the second device is switched to the reset state, and the second device performs a reset operation and when a local fault occurs, the second device also performs a third transmission to the first device.
  • Six control message actions wherein the fifth control message includes fifth transmission control option information, and the fifth transmission control option information is used to reset data from the first device to the second device Transmission; the sixth control message includes sixth transmission control option information, and the sixth transmission control option information is used to reset data transmission from the first device to the second device.
  • the reset state means that the second device resets data transmission from the first device to the second device.
  • the local fault event includes at least one of a lower layer protocol (for example, a network layer protocol or a data link layer protocol) disconnection event, a message transmission failure event, and the like.
  • a lower layer protocol for example, a network layer protocol or a data link layer protocol
  • disconnection event for example, a message transmission failure event, and the like.
  • the first state machine is further configured to: when the second device is in the reset state, in response to completing a reset event, the second device is switched from the reset state to the reset state. Describe the initial state.
  • the completed reset event means that the second device has completed the reset operation locally.
  • the second transmission control option information of the second control message is also used to request to start data transmission from the second device to the first device; the sending to the first device After the second control message, the method further includes: receiving a seventh control message from the first device, the seventh control message including seventh transmission control option information, the seventh transmission control option information being Upon confirmation, data transmission from the second device to the first device is initiated.
  • the second control message not only implements a confirmation reply to the first device's request to start data transmission, but also implements a request to the first device to start data transmission from the second device to the first device. In this way, the first device and Based on two independent one-way connections, two-way data transmission is initiated between the second devices, which is beneficial to improving the efficiency of data transmission.
  • the second device's confirmation reply to the first device's request to start data transmission and the second device's request to start data transmission from the second device to the first device may not be combined and sent in one message. That is, sent through two messages respectively.
  • the second device can first send a request to the first device to start the slave. Confirmation reply for data transfer from first device to second device.
  • the second device sends a message to the first device requesting to start data transmission from the second device to the first device.
  • the method further includes: sending a second data packet to the first device, the second data packet carrying the second data; receiving a third data packet from the first device, The third data packet carries third data, and the confirmation sequence number carried in the third data packet is the transmission sequence number carried in the second data packet.
  • the third data message is not only a confirmation reply to the second data message, but also carries new data. In this way, bandwidth consumption can be saved.
  • the timing when the second device sends the second data to the first device may be: carrying the second data through the second control message, or the second device sends the second data to the first device before receiving the seventh control message from the first device.
  • the device sends the second data packet, or the second device sends the second data packet to the first device after receiving the seventh packet from the first device.
  • the method further includes: sending an eighth control message to the first device, the eighth control message including eighth transmission control option information, and the eighth transmission control option information is used to request termination.
  • Data transmission from the second device to the first device ; receiving a ninth control message from the first device, the ninth control message including ninth transmission control option information, the ninth transmission control The option information is used to confirm the termination of data transmission from the second device to the first device.
  • the second device after the second device receives the first device's confirmation reply to the request to terminate the data transmission from the second device to the first device, the second device can know that the data transmission from the second device to the first device is completed.
  • the second device is configured with a second state machine, and the second state machine is configured to: when the second device is in the initial state, in response to starting to send a data event, the second device is switched from the initial state to the waiting-to-be-response state, and the second device performs the action of sending the second control message to the second device.
  • the initial state indicates that data transmission from the second device to the first device is not initiated.
  • the wait-to-start response status indicates and the second device waits for the first device to reply with a confirmation to initiate data transmission from the second device to the first device.
  • the event of starting to send data means that the second device has a need to transmit data to the first device.
  • the management of the connection state and the connection state when the same device serves as the sender when the device serves as the receiving end, the management of the connection status is independently decoupled. For example, when the second device serves as the receiving end of data, it maintains the communication connection state through the first state machine, and when the second device serves as the sending end of data, it maintains the communication connection state through the second state machine. Maintaining the communication connection status can effectively simplify the device's management of the communication connection status.
  • the second state machine is further configured to: when the second device is in the waiting to start response state, in response to an event of receiving the seventh control message, the second device is configured by The waiting start response state is switched to the data sending state.
  • the sending data status means that the second device knows that the data transmission from the second device to the first device has been successfully started. In this state, the second device can transmit data to the first device in sequence.
  • the second state machine is further configured to: when the second device is in the sending data state, in response to an end sending data event, the second device is switched from the sending data state to waiting.
  • the response state is ended, and the second device performs the action of sending an eighth control message to the first device, wherein the eighth control message includes eighth transmission control option information, and the eighth transmission control option Information for requesting termination of data transmission from the second device to the first device.
  • the end of sending data event means that the second device has completed the transmission of the last data and the second device will no longer send data to the first device in this transmission cycle.
  • the waiting for end response state indicates that the second device is waiting for a reply confirmation from the first device to terminate the data transmission from the second device to the first device.
  • the second state machine is further configured to: when the second device is in the waiting end response state, in response to an event of receiving a ninth control message, the second device is configured by the The waiting end response state is switched to the initial state, wherein the ninth control message includes ninth transmission control option information, and the ninth transmission control option information is used to confirm the termination from the second device to the third device. Data transmission from one device.
  • the second state machine is further configured to: when the second device is in any one of the waiting start response state, the sending data state and the waiting end response state, respond to A local fault event or an event of receiving the tenth control message sent by the first device, the second device is switched to a reset state, and the second device performs a reset operation and the The second device also performs the action of sending an eleventh control message to the first device; wherein the tenth control message includes tenth transmission control option information, and the tenth transmission control option information is used to reset Data transmission from the second device to the first device; the eleventh control message includes eleventh transmission control option information, and the eleventh transmission control option information is used to reset the data from the first device. Data transmission from the second device to the first device.
  • the local fault event includes at least one of a lower layer protocol (for example, a network layer protocol or a data link layer protocol) disconnection event, a data transmission failure event, and the like.
  • a lower layer protocol for example, a network layer protocol or a data link layer protocol
  • disconnection event for example, a data transmission failure event, and the like.
  • the reset state means that the second device resets data transmission from the second device to the first device.
  • the first device also needs to reset the data transmission from the second device to the first device.
  • the eleventh transmission control option information is also used to reset the data transmission from the first device to the second device.
  • the second device can realize the resetting of bidirectional data transmission through the eleventh transmission control option information.
  • the second state machine is further configured to: when the second device is in the reset state, in response to completing a reset event, the second device is switched from the reset state to the reset state. Describe the initial state.
  • the completed reset event means that the second device has completed the reset operation locally.
  • the present application provides a communication device.
  • the device is a first device or the device is included in the first device.
  • the device includes: a sending unit configured to send a first control report to a second device.
  • the first control message includes first transmission control option information, and the first transmission control option information is used to request to start data transmission from the first device to the second device;
  • the receiving unit is configured to A second control message is received from the second device, the second control message includes second transmission control option information, and the second transmission control option information is used to confirm the startup from the first device to the third device.
  • Data transmission between two devices; the sending unit is further configured to send the first data to the second device without sending a response message of the second control message to the second device.
  • the data transmission from the first device to the second device is performed based on a one-way communication connection.
  • the sending unit is specifically configured to: carry the first data through the first control message; after sending the first control message and before receiving the second control message, send the The second device sends a first data message carrying the first data; or after receiving the second control message, sends a first data message carrying the first data to the second device.
  • the first control message also includes source port information and/or destination port information, where the source port information is used to carry the identity of the first application on the first device for sending data, The destination port information is used to carry the identity of the second application on the second device for receiving data.
  • the first control message also includes sequence number information and/or confirmation sequence number information, wherein the sequence number information is used to carry the sending sequence number of the first control message, and the confirmation sequence The number information is used to carry the confirmation sequence number of the first control message.
  • the first transmission control option information is carried in an option field of the first control message, and the first control message also includes option length information, and the option length information is used to carry the The length of the option field.
  • the option field is also used to carry at least one of the following information:
  • Checksum option information the checksum option information is used to carry the message header of the first control message and the checksum of the data to be sent;
  • Payload length option information is used to carry the length of the payload field in the first control message, and the payload field is used to carry the data sent by the first device;
  • Window size option information the window size option information is used to carry resources available for receiving data from the first device among the resources configured by the second device;
  • Option mapping information the option mapping information is used to indicate whether the optional information such as the first transmission control option information, the checksum option information, the payload length option information or the window size option information is carried in the options field.
  • the sending unit is further configured to: resend the first data message when the response message of the first data message is not received within a preset time period.
  • the receiving unit is further configured to: receive a first response message from the second device; the device further includes a processing unit configured to: The sending sequence number carried in the first data message determines whether to resend the first data message.
  • the first response message further includes first window size option information, which is used to carry resources configured by the second device that can be used to receive data from the first device.
  • the processing unit is also configured to: adjust the data sending rate and/or the size of the data to be sent according to the first window size option information.
  • the processing unit is specifically configured to: when the first cache space is less than a first preset threshold, reduce the data sending rate and/or reduce the size of the data to be sent; or, when the first cache space is smaller than a first preset threshold, When a buffer space is greater than a second preset threshold, the data sending rate is increased and/or the size of data to be sent is increased.
  • the second preset threshold is greater than or equal to the first preset threshold.
  • the sending unit is further configured to: when the first buffer space is less than a third preset threshold, suspend sending data to the second device; the receiving unit is further configured to: obtain data from the second device.
  • the device receives a second response message, the second response message includes second window size option information, the second window size option information carries the resources configured by the second device that can be used to obtain data from the first a second cache space for the device to receive data; the sending unit is also configured to: when the sending sequence number carried in the second response message is greater than or equal to the sending sequence number carried in the first response message, and the sending sequence number is When the second cache space is not less than the third preset threshold, continue to send data to the second device.
  • the sending unit is further configured to: send a third control message to the second device, the third control message including third transmission control option information, and the third transmission control option information is used to Requesting to terminate data transmission from the first device to the second device; the receiving unit is also configured to receive a fourth control message from the second device, the fourth control message including fourth transmission control Option information, the fourth transmission control option information is used to confirm the termination of data transmission from the second device to the first device.
  • the first device is configured with a first state machine, and the first state machine is configured to: when the first device is in the initial state, in response to starting to send a data event, the first device is switched from the initial state to the waiting-to-be-responsed state, and the first device performs the action of sending the first control message to the second device.
  • the first state machine is further configured to: when the first device is in the waiting to start response state, in response to an event of receiving the second control message, the first device is The waiting start response state is switched to the data sending state.
  • the first state machine is further configured to: when the first device is in the sending data state, in response to an end sending data event, the first device is switched from the sending data state to waiting. Ending the response state, and the first device performs the action of sending a third control message to the second device, wherein the third control message includes third transmission control option information, and the third transmission control option Information for requesting termination of data transmission from the first device to the second device.
  • the first state machine is further configured to: when the first device is in the waiting end response state, in response to an event of receiving a fourth control message, the first device is configured by the The waiting end response state is switched to the initial state, wherein the fourth control message includes fourth transmission control option information, and the fourth transmission control option information is used to confirm the termination from the first device to the third device. Data transmission between two devices.
  • the first state machine is further configured to: when the first device is in any one of the waiting start response state, the sending data state and the waiting end response state, respond to A local fault event or an event of receiving the fifth control message sent by the second device, the first device is switched to the reset state, and the first device performs a reset operation and the The first device also performs the action of sending a sixth control message to the second device; wherein the fifth control message includes fifth transmission control option information, and the fifth transmission control option information is used to reset the slave Data transmission from the first device to the second device; the sixth control message includes sixth transmission control option information, and the sixth transmission control option information is used to reset the data from the first device to the second device. data transmission from the second device.
  • the first state machine is further configured to: when the first device is in the reset state, in response to completing a reset event, the first device is switched from the reset state to the reset state. Describe the initial state.
  • the second transmission control option information of the second control message is also used to request to start data transmission from the second device to the first device; the processing unit is also used to: configure Resources for receiving data from the second device; the sending unit is also used to: send a seventh control message to the second device, where the seventh control message includes seventh transmission control option information, so The seventh transmission control option information is used to confirm the initiation of data transmission from the second device to the first device.
  • the receiving unit is further configured to: receive a second data packet from the second device, where the second data packet carries second data; and the sending unit is further configured to send a message to the second device.
  • Send a third data packet the third data packet carries third data, and the confirmation sequence number carried in the third data packet is the transmission sequence number carried in the second data packet.
  • the receiving unit is further configured to: receive an eighth control message from the second device, the eighth control message including eighth transmission control option information, and the eighth transmission control option information is used to Requesting to terminate data transmission from the second device to the first device; the sending unit is further configured to: release the first device for receiving data from the second device based on the eighth control message Data configured resources; sending a ninth control message to the second device, the ninth control message including ninth transmission control option information, the ninth transmission control option information being used to confirm the termination of the transmission from the second device. Data transmission from the device to the first device.
  • the first device is configured with a second state machine
  • the second state machine is configured to: when the first device is in the initial state, in response to receiving the second control message event, the first device is switched from the initial state to the data receiving state, and the first device performs the action of sending the seventh control message to the second device.
  • the second state machine is further configured to: when the first device is in the receiving data state, in response to an event of receiving an eighth control message, the first device is The data state is switched to the pending state, and the first device performs the actions of releasing resources in the first device for receiving data configuration from the second device and sending a ninth control message to the second device.
  • the eighth control message includes eighth transmission control option information, and the eighth transmission control option information is used to request the termination of data transmission from the second device to the first device;
  • the ninth The control message includes ninth transmission control option information, and the ninth transmission control option information is used to confirm the termination of data transmission from the second device to the first device.
  • the second state machine is further configured to: when the first device is in the to-be-ended state, in response to a completion event, the first device is switched from the to-be-ended state to the to-be-ended state. initial state.
  • the second state machine is further configured to: when the first device is in the receiving data state or the pending end state, respond to a local fault event or receive a message sent by the second device.
  • the first device In the event of the tenth control message, the first device is switched to the reset state, And the first device performs a reset operation and when a local fault occurs, the first device also performs the action of sending an eleventh control message to the second device; wherein the tenth control message includes a tenth Transmission control option information, the tenth transmission control option information is used to reset data transmission from the second device to the first device; the eleventh control message includes eleventh transmission control option information, The eleventh transmission control option information is used to reset data transmission from the second device to the first device.
  • the eleventh transmission control option information is also used to reset data transmission from the first device to the second device.
  • the second state machine is further configured to: when the first device is in the reset state, in response to completing a reset event, the first device is switched from the reset state to the reset state. Describe the initial state.
  • the present application provides a communication device, the device is a second device or the device is included in the second device, the device includes: a receiving unit configured to receive a first control report from the first device.
  • the first control message includes first transmission control option information, and the first transmission control option information is used to request to start data transmission from the first device to the second device; a processing unit, configured to Resources configured for receiving data from the first device; and a sending unit configured to send a second control message to the first device, the second control message including second transmission control option information, the The second transmission control option information is used to confirm the initiation of data transmission from the first device to the second device; the sending unit is also used to send the second control message when the second control message is not received from the first device. In the case of a response message, first data is received from the first device.
  • the data transmission from the first device to the second device is performed based on a one-way communication connection.
  • the receiving unit is specifically configured to: carry the first data through the first control message; after receiving the first control message and before sending the second control message, from all The first device receives a first data message carrying the first data; or after sending the second control message, receives a first data message carrying the first data from the first device.
  • the first control message also includes source port information and/or destination port information, where the source port information is used to carry the identity of the first application on the first device for sending data, The destination port information is used to carry the identity of the second application on the second device for receiving data.
  • the first control message also includes sequence number information and/or confirmation sequence number information, wherein the sequence number information is used to carry the sending sequence number of the first control message, and the confirmation sequence The number information is used to carry the confirmation sequence number of the first control message.
  • the first transmission control option information is carried in an option field of the first control message, and the first control message also includes option length information, and the option length information is used to carry the The length of the option field.
  • the option field is also used to carry at least one of the following information:
  • Checksum option information the checksum option information is used to carry the message header of the first control message and the checksum of the data to be sent;
  • Payload length option information is used to carry the length of the payload field in the first control message, and the payload field is used to carry the data sent by the first device;
  • Window size option information the window size option information is used to carry resources available for receiving data from the first device among the resources configured by the second device;
  • Option mapping information the option mapping information is used to indicate whether the optional information such as the first transmission control option information, the checksum option information, the payload length option information or the window size option information is carried in the options field.
  • the sending unit is also configured to send a first response message to the first device, where the confirmation sequence number carried in the first response message is the sending sequence carried in the first data message. Number.
  • the first response message further includes first window size option information, the first window size option information is used to carry the resources configured by the second device that are available from the first device.
  • the first buffer space for receiving data, the first window size option information is used by the second device to reversely adjust the rate at which the first device sends data and/or adjust the size of data to be sent.
  • the first response message when it is detected that the first cache space is less than a first warning value, the first response message further includes the first window size option information.
  • the processing unit is also configured to clear the received data in the resource configured by the second device; the sending unit is also configured to: when detecting the resource configured by the second device, When the second cache space in the resource that can be used to receive data from the first device is greater than the second warning value, send at least one second response message to the first device, and the second response message includes a second window Size option information, the second window size option information is used to carry the second cache space, and the second warning value is greater than or equal to the first warning value.
  • the receiving unit is further configured to receive a third control message from the first device, the third control message includes third transmission control option information, and the third transmission control option information is used to request termination.
  • the processing unit is further configured to release, based on the third control message, the configuration in the second device for receiving data configuration from the first device. resources; described
  • the sending unit is further configured to send a fourth control message to the first device, the fourth control message including fourth transmission control option information, and the fourth transmission control option information is used to confirm the termination of the transmission from the first device. Data transmission from the device to the second device.
  • the first device is configured with a first state machine, and the first state machine is configured to: when the first device is in an initial state, in response to receiving the first control message event, the first device is switched from the initial state to the data receiving state, and the second device performs an action of sending the second control message to the first device.
  • the first state machine is further configured to: when the second device is in the receiving data state, in response to an event of receiving a third control message, the second device is The data state is switched to the pending state, and the second device performs the actions of releasing resources in the second device for receiving data configuration from the first device and sending a fourth control message to the first device.
  • the third control message includes third transmission control option information, and the third transmission control option information is used to request the termination of data transmission from the first device to the second device;
  • the fourth control The message includes fourth transmission control option information, and the fourth transmission control option information is used to confirm the termination of data transmission from the first device to the second device.
  • the first state machine is further configured to: when the second device is in the to-be-ended state, in response to a completion event, the second device is switched from the to-be-ended state to the to-be-ended state. initial state.
  • the first state machine is further configured to: when the second device is in the receiving data state or the pending end state, respond to a local fault event or receive a message sent by the second device.
  • the second device In the event of the fifth control message, the second device is switched to the reset state, and the second device performs a reset operation and when a local fault occurs, the second device also performs a third transmission to the first device.
  • Six control message actions wherein the fifth control message includes fifth transmission control option information, and the fifth transmission control option information is used to reset data from the first device to the second device Transmission; the sixth control message includes sixth transmission control option information, and the sixth transmission control option information is used to reset data transmission from the first device to the second device.
  • the first state machine is further configured to: when the second device is in the reset state, in response to completing a reset event, the second device is switched from the reset state to the reset state. Describe the initial state.
  • the second transmission control option information of the second control message is also used to request to start data transmission from the second device to the first device; the receiving unit is also used to: The first device receives a seventh control message, the seventh control message includes seventh transmission control option information, and the seventh transmission control option information is used to confirm startup from the second device to the first Device data transmission.
  • the sending unit is also configured to send a second data message to the first device, where the second data message carries the second data; the receiving unit is also configured to receive the data from the first device.
  • the device receives a third data packet, the third data packet carries third data, and the acknowledgment sequence number carried in the third data packet is the transmission sequence number carried in the second data packet.
  • the sending unit is further configured to send an eighth control message to the first device, where the eighth control message includes eighth transmission control option information, and the eighth transmission control option information is used to request Terminate data transmission from the second device to the first device;
  • the receiving unit is further configured to receive a ninth control message from the first device, the ninth control message including a ninth transmission control option Information, the ninth transmission control option information is used to confirm the termination of data transmission from the second device to the first device.
  • the second device is configured with a second state machine, and the second state machine is configured to: when the second device is in the initial state, in response to starting to send a data event, the second device is switched from the initial state to the waiting-to-be-response state, and the second device performs the action of sending the second control message to the second device.
  • the second state machine is further configured to: when the second device is in the waiting to start response state, in response to an event of receiving the seventh control message, the second device is configured by The waiting start response state is switched to the data sending state.
  • the second state machine is further configured to: when the second device is in the sending data state, in response to an end sending data event, the second device is switched from the sending data state to waiting.
  • the response state is ended, and the second device performs the action of sending an eighth control message to the first device, wherein the eighth control message includes eighth transmission control option information, and the eighth transmission control option Information for requesting termination of data transmission from the second device to the first device.
  • the second state machine is further configured to: when the second device is in the waiting end response state, in response to an event of receiving a ninth control message, the second device is configured by the The waiting end response state is switched to the initial state, wherein the ninth control message includes ninth transmission control option information, and the ninth transmission control option information is used to confirm the termination from the second device to the third device. Data transmission from one device.
  • the second state machine is further configured to: when the second device is in any one of the waiting start response state, the sending data state and the waiting end response state, respond to A local fault event or an event of receiving the tenth control message sent by the first device, the second device is switched to a reset state, and the second device performs a reset operation and the second The device also performs the action of sending an eleventh control message to the first device; wherein the tenth control message includes tenth transmission control option information, and the tenth transmission control option information is used to reset all slaves. Data transmission from the second device to the first device; the eleventh control message includes eleventh transmission control option information, and the eleventh transmission control option information is used to reset the data from the second device. Data transmission to the first device.
  • the eleventh transmission control option information is also used to reset data transmission from the first device to the second device.
  • the second state machine is further configured to: when the second device is in the reset state, in response to completing a reset event, the second device is switched from the reset state to the reset state. Describe the initial state.
  • the present application provides a communication device, which includes a processor and a memory, wherein the memory is used to store program instructions; the processor calls the program instructions in the memory, causing the device to execute the first aspect or The method in any possible implementation of the first aspect, or causing the device to perform the second aspect or the method in any possible implementation of the second aspect.
  • the present application provides a computer-readable storage medium, including computer instructions.
  • the computer instructions When the computer instructions are executed by a processor, the above-mentioned first aspect or any possible implementation of the first aspect is implemented. method, or the method in implementing the above second aspect or any possible implementation of the second aspect.
  • the present application provides a computer program product.
  • the computer program product is executed by a processor, the possibility of realizing the above first aspect or any of the first aspects is to implement the method in the manner, or to implement The above second aspect or any one of the second aspects may be the method in the implementation manner.
  • the computer program product may be a software installation package.
  • the present application provides a vehicle, which includes a first device or a second device, wherein the first device is the above-mentioned third aspect or any possible implementation of the third aspect, or is the above-mentioned device.
  • the device of the fifth aspect; the second device is the device of the above-mentioned fourth aspect or any possible implementation of the fourth aspect, or the device of the above-mentioned fifth aspect.
  • the present application provides a terminal, which includes a first device or a second device, wherein the first device is the above-mentioned third aspect or any possible implementation of the third aspect, or is the above-mentioned device.
  • the device of the fifth aspect; the second device is the device of the above-mentioned fourth aspect or any possible implementation of the fourth aspect, or the device of the above-mentioned fifth aspect.
  • Examples of the terminal include but are not limited to: smart home equipment (such as televisions, sweeping robots, smart desk lamps, audio systems, smart lighting systems, electrical appliance control systems, home background music, home theater systems, intercom systems, video surveillance, etc. ), intelligent transportation equipment (such as cars, ships, drones, trains, trucks, trucks, etc.), intelligent manufacturing equipment (such as robots, industrial equipment, intelligent logistics, smart factories, etc.), intelligent terminals (mobile phones, computers, tablets, etc.) , handheld computers, desktops, headsets, speakers, wearable devices, vehicle-mounted devices, virtual reality devices, augmented reality devices, etc.).
  • smart home equipment such as televisions, sweeping robots, smart desk lamps, audio systems, smart lighting systems, electrical appliance control systems, home background music, home theater systems, intercom systems, video surveillance, etc.
  • intelligent transportation equipment such as cars, ships, drones, trains, trucks, trucks, etc.
  • intelligent manufacturing equipment such as robots, industrial equipment, intelligent logistics, smart factories, etc.
  • intelligent terminals mobile phones, computers, tablets,
  • Figure 1 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of the format of a message header provided by an embodiment of the present application.
  • Figure 3A is a schematic diagram of the format of an option field provided by an embodiment of the present application.
  • Figure 3B is a schematic diagram of the format of an option field provided by an embodiment of the present application.
  • Figure 4 is a flow chart of a communication method provided by an embodiment of the present application.
  • Figure 5A is a state schematic diagram of a state machine configured on the sending end provided by an embodiment of the present application
  • Figure 5B is a state schematic diagram of a state machine configured on a receiving end provided by an embodiment of the present application
  • Figure 6 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • Figure 7 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • Figure 8 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • Figure 9A is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Figure 9B is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the ordinal word does not limit the priority between "levels".
  • the number of described objects is not limited by the prefix word. It can be one or more. Take “first equipment” as an example, where “equipment”” can be one or more.
  • the objects modified by different prefix words can be the same or different. For example, if the described object is "device”, then the “first device” and “second device” can be the same device , the same type of equipment or different types of equipment; for another example, if the described object is "information”, then the "first information” and the “second information” can be information with the same content or information with different contents.
  • this application The use of prefixes used to distinguish the described objects in the embodiments does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the claims or the context description in the embodiments. The use of such prefixes should not constitute a limitation. Unnecessary restrictions.
  • references such as "at least one (or at least one) of a1, a2, ... and an” are used, including any one of a1, a2, ... and an.
  • the situation that exists alone also includes any combination of any number of a1, a2,... and an.
  • Each situation can exist alone.
  • the description of "at least one of a, b, and c" includes a alone, b alone, c alone, a combination of a and b, a combination of a and c, a combination of b and c, or a combination of abc. Condition.
  • Figure 1 exemplifies a system architecture diagram. This system is used to achieve communication. As shown in Figure 1, the system includes a first device and a second device, wherein the first device and the second device can communicate in a wired or wireless manner.
  • the first device or the second device may be an electronic device with communication capabilities, such as a handheld terminal, a vehicle, a vehicle-mounted device, or a network side device, a user equipment, an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote Stations, remote terminals, wireless communication equipment, user agents or user devices, or any possible intelligent terminal equipment (such as mobile phones), intelligent transportation equipment (such as vehicles, drones, etc.), intelligent manufacturing equipment, intelligent Home equipment (such as large screens, speakers, etc.), etc., can also be components (such as chips or integrated circuits, etc.) in the above-mentioned electronic equipment.
  • a handheld terminal such as a vehicle, a vehicle-mounted device, or a network side device
  • a user equipment an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote Stations, remote terminals, wireless communication equipment, user agents or user devices, or any possible intelligent terminal equipment (such as mobile phones), intelligent transportation equipment
  • the first device when the first device is a vehicle-mounted device, it can be a car cockpit (cockpit domain) device, or a module in the car cockpit device, such as a cockpit domain controller (cockpit domain controller, CDC), camera, One or more modules such as screen, microphone, audio, electronic key, keyless entry or starting system controller.
  • the first device can also be a battery management system (battery management system, BMS), a battery control unit (battery control unit, BCU) in the BMS, a battery monitoring unit (battery monitoring unit, BMU) in the BMS, or a battery. Batteries in the bag.
  • BMS battery management system
  • BCU battery control unit
  • BMU battery monitoring unit
  • the first device when it is a handheld terminal, it may be a mobile phone, a wearable device, a tablet, or a computer with data transceiver functions (such as a notebook computer, a handheld computer, etc.).
  • the first device may request the second device to initiate data transmission from the first device to the second device. After the first device receives the second After the device sends a confirmation reply confirming that the data transmission is initiated, the first device determines that the data transmission from the first device to the second device has been initiated. In order to improve data transmission efficiency, for example, the first device may transmit data to the second device during the process of requesting to start data transmission. It can be understood that this is only a brief description of a one-way communication connection between the first device and the second device. For the specific process, please refer to the relevant descriptions of the following method embodiments.
  • the application embodiments do not limit data transmission to only The transmission direction is from the first device to the second device, or it may also be the transmission direction from the second device to the first device.
  • the communication between the first device and the second device may also be two-way communication.
  • the communication system shown in Figure 1 can be used in a variety of application scenarios, such as the following application scenarios: mobile Internet (MI), industrial control (industrial control), self-driving (self driving), transportation safety (transportation safety) ), Internet of things (IoT), smart city (smart city), or smart home (smart home), etc.
  • MI mobile Internet
  • industrial control industrial control
  • self-driving self driving
  • transportation safety transportation safety
  • IoT Internet of things
  • smart city smart city
  • smart home smart home
  • the communication system shown in Figure 1 can be applied to a variety of network types, such as one or more of the following network types: SparkLink, long term evolution (LTE) network, fifth-generation mobile Communication technology (5th generation mobile communication technology, 5G), wireless local area network (for example, Wi-Fi), Bluetooth (bluetooth, BT), Zigbee, or vehicle short-range wireless communication network, etc.
  • SparkLink long term evolution (LTE) network
  • 5G fifth-generation mobile Communication technology
  • 5th generation mobile communication technology for example, Wi-Fi
  • Bluetooth bluetooth, BT
  • Zigbee Zigbee
  • vehicle short-range wireless communication network etc.
  • the above-mentioned device is a name for an electronic device with communication capabilities.
  • the names of devices with similar communication capabilities may not be called devices.
  • they may be called network devices or nodes, which are not specifically limited here.
  • Figure 1 is only an exemplary architecture diagram, but does not limit the number of network elements included in the system shown in Figure 1 .
  • FIG. 1 may also include other functional entities.
  • the method provided by the embodiment of the present application can be applied to the communication system shown in Figure 1.
  • the method provided by the embodiment of the present application can also be applied to other communication systems, and the embodiment of the present application is not limited to this. system.
  • the message header may also be called a transport layer message header, or a lightweight connection mode transport protocol (light weightconnection mode transport protocol, LWCTP) header.
  • LWCTP lightweight connection mode transport protocol
  • the LWCTP header can support running on the network layer or data link layer of the communication network.
  • the communication network may be, for example, a Starlight network, an Internet Protocol (IP) network, or other types of networks, which are not specifically limited here.
  • IP Internet Protocol
  • the address used in the StarLight Network is the StarLine Network Address.
  • the StarLine Network Address is a network layer short address. Its length can be 2 bytes (i.e. 16 bits) and can be used in the StarLan Network. internal addressing. It can be understood that the Starlight network address is another type of address that is different from the IP address.
  • the LWCTP header can support running on the StarLight network layer, that is, the LWCTP header is encapsulated in the StarLight network layer frame header; the LWCTP header can also support running on the StarLight basic service layer, that is, LWCTP The header is encapsulated in the StarLight basic service layer frame header.
  • the communication network may be an IP network
  • the LWCTP header may be supported to run on the network layer of the IP network, that is, the LWCTP header is encapsulated in the IP header.
  • the IP header may be an IPv4 header or an IPv6 header, for example.
  • FIG. 2 is a schematic diagram of the format of an LWCTP header provided by the embodiment of the present application:
  • the LWCTP header can be used to establish a communication connection between two devices, and can also be used to transmit information between two devices.
  • control primitives defined by LWCTP for establishing a communication connection are carried in the transport control option field (transport control option) of the LWCTP header.
  • the transmission control option field is included in the option field shown in Figure 2, and the option field is used to carry optional fields in the LWCTP header.
  • the transmission control option field is equivalent to a sub-option field in the option field.
  • control primitives based on the process of establishing a communication connection, which are:
  • Start response start ack Instructs the receiving end to confirm the start of data transmission from the sending end to the receiving end;
  • End response end ack Instructs the receiving end to confirm the termination of data transmission from the sending end to the receiving end;
  • Reset reset Instructs to reset the data transmission from the sending end to the receiving end, or can reset the two-way data transmission between the sending end and the receiving end.
  • the sending end sends a message carrying the start control primitive indicating that it means starting a transmission cycle of data transmission in one transmission direction; the sending end receives a message carrying the start ack control primitive indicating one-way
  • the successful start of data transmission can also be understood as the successful establishment of a communication connection to transmit data from the sending end to the receiving end.
  • the sending end can transmit data to the receiving end in sequence; after the sending end completes the data transmission , you can request the receiving end to terminate the data transmission from the sending end to the receiving end by sending a message carrying the indicating end control primitive to the receiving end; the sending end receives the message carrying the indicating end ack control primitive sent by the receiving end, That is to say, it is determined that the data transmission from the sending end to the receiving end has ended, and this transmission cycle ends.
  • the transmission cycle of data transmission includes three stages: transmission start, data transmission and transmission end. In some possible embodiments, the three stages in the transmission cycle may also overlap. For example, data transmission may begin during the transmission start stage. In this case, the interaction process between devices may refer to the following method embodiments. The relevant descriptions will not be repeated here.
  • a bit mapping method or a binary value method can be used to represent the corresponding control primitive in the communication connection establishment process.
  • the transmission control option field represents the control primitive in the form of a binary value: when the transmission control option field takes the first value, it represents the control primitive "start”; when the transmission control option field takes the first value, it represents the control primitive "start”; when the transmission control option field takes the first value, When it is the second value, it represents the control primitive "start ack"; when the transmission control option field is the third value, it represents the control primitive "end”; when the transmission control option field is the fourth value , represents the control primitive "end ack”; when the transmission control option field takes the fifth value, it represents the control primitive "reset”.
  • the transmission control option field can also represent multiple control primitives. For example, when the transmission control option field takes the sixth value, it represents the "start ack" and “start” control primitives, and for example When the transmission control option field takes a value of seven, it represents the "end ack" and "end” control primitives.
  • the transmission control option field represents the control primitive in a bit mapping manner: the transmission control option field includes multiple Bits, each bit can also be called an identification bit.
  • flag bit 1 in the transmission control option field it represents the control primitive "start”; when flag bit 2 in the transmission control option field is set, it represents the control primitive "start ack”; when When the flag bit 3 in the transmission control option field is set, it represents the control primitive "end”; when the flag bit 4 in the transmission control option field is set, it represents the control primitive "end ack"; when the transmission control option
  • flag 5 in the field is set, it indicates the control primitive "reset”.
  • the transmission control option field can also represent two control primitives at the same time.
  • the transmission control option field represents the two control primitives "start” and "start ack", indicating that the second device confirms to start data transmission from the first device to the second device and the second device requests the first device to start data transmission from the first device to the second device. Data transmission from the second device to the first device. It can be understood that here we only take the two control primitives "start” and “start ack” as examples, but it does not limit the two control primitives that can be represented by the transmission control option field at the same time to only this situation.
  • the LWCTP header includes a source port field and/or a destination port field, where the source port field is used to carry the identity of the source application on the sending end that needs to send data.
  • the purpose The port field is used to carry the identity of the destination application on the receiving end for receiving data.
  • the identification of an application is used to uniquely identify an application locally, and may be a combination of one or more characters, where the characters may be one of numbers, letters, and other symbols. Or multiple, such as a combination of one or more numbers, or a combination of one or more data and letters.
  • the LWCTP header includes a sequence number field and/or an ack sequence number field, where the sequence number field is used to carry the sending sequence number of the message sent by the sending end.
  • the sequence number field is used to carry the confirmation sequence number of the message sent by the sender.
  • the sequence number field can ensure the orderly transmission of data on the transport layer, and the receiver can determine whether packet loss has occurred by using the acknowledgment sequence number field in the message sent by the sender.
  • the filling rule for the sequence number field can be: if the sending end sends a message carrying a start or start ack indication for the first time in this transmission cycle, the sending sequence number can start from a random positive integer.
  • the maximum sending sequence number of the messages sent in the previous transmission cycle can be used. Every time a message carrying a start, end or reset control primitive is sent or a message carrying new data is sent, the sending sequence number is incremented. 1, otherwise the sending sequence number remains unchanged. For example, when the sending end retransmits the message, the sending sequence number remains unchanged.
  • the sequence number field is mainly used to determine the transmission sequence.
  • the change in the sequence number of the message can also be changed in the decreasing form in other embodiments. Here No specific limitation is made.
  • the filling rule of the confirmation sequence number field can be: when the sending end has not received a message from the receiving end in this transmission cycle, fill in the confirmation sequence number field with 0; when the sending end has never received a message from the receiving end in the history; If the receiving end has received the message, the confirmation sequence number field fills in the maximum value among the multiple consecutive sending sequence numbers of the message received by the sending end from the receiving end. It can be understood that when there is no packet loss in the messages sent by the receiving end to the sending end in the past, the confirmation sequence number filled in by the sending end in the confirmation sequence number field can also be the sending sequence number of the last message received by the sending end from the receiving end. .
  • the LWCTP header also includes a version number (version) field, where the version number field is used to carry the version number of the transport layer protocol;
  • the message sent by the sending end also carries a payload field, where the payload field is used to carry data of the source application on the sending end.
  • data may also be called service data or service data unit (service data unit, SDU).
  • the LWCTP header also includes an option length field, where the option length field is used to carry the length of the option field. Whether the option field is empty can be determined by the value of the option length field.
  • the option field shown in Figure 2 is used to carry optional fields in the LWCTP header, for example, the above-mentioned transmission control option field.
  • the option field may also include the following sub-option fields.
  • Checksum option (checksumoption) field This field is used to carry the checksum of the LWCTP header and the data to be sent; here, the data to be sent is carried by the payload field of the message;
  • Window size option window size option field: This field is used to carry the buffer space in the resources configured by the receiving end that can be used to receive data from the sending end;
  • Payload length option field This field is used to carry the length of the above payload field.
  • the option field may include a payload length option field, where the payload length option field is used to carry the length of the payload field.
  • the length of the payload field can be determined by the frame length of the outer layer. For example, if the outer layer is the network layer, it can be determined by the payload length field in the network layer header. If the outer layer is the data link layer, it can be determined by the data link layer. Determined by the payload length field in the layer header.
  • checksum option field (or referred to as the checksum field) may be defaulted.
  • the value of the window size option field is generally set by the receiving end.
  • the sending end can adjust the rate at which it sends data and/or the data to be sent according to the window size option field in the LWCTP header of the message sent by the receiving end.
  • the size of the window that is to say, the receiving end can reversely affect the sending rate of the sending end's data and/or the size of the data to be sent through the window size option field.
  • the option field when the option field includes at least one sub-option field, in order to avoid adding a length field to indicate the length of each sub-option field in the option field, the length of each sub-option field can be set to be fixed.
  • the option field may also include an option mapping field, and the option mapping field is used to indicate whether the above-mentioned at least one option field and other optional sub-option fields are carried in the option field.
  • the content in the option field can be seen in Figure 3A.
  • the option field includes an option mapping field and at least one sub-option field (for example, sub-option 1,..., sub-option k, where k is a positive integer).
  • sub-option 1 for example, sub-option 1,..., sub-option k, where k is a positive integer.
  • the option field since the length of the option field is specified by the option length field, when the length of each field in the option field is less than the length indicated by the option length field, the option field also includes a padding data field, and the padding data field can make the option The length of the field meets the length indicated by the option length field.
  • the option mapping field may indicate which optional sub-option fields are included in the option field in the form of a bit map (or bitmap), where multiple bits correspond to multiple sub-option fields one-to-one.
  • the multiple sub-option fields include at least one of the above-mentioned transmission control option field, checksum option field, window size option field and payload length option field.
  • the multiple sub-option fields also include other possible Selected sub-option fields, for example, option fields for authentication, fields for encryption, etc.
  • the length of the option mapping field is 1 byte, that is, 8 bits, where each bit corresponds to a sub-option field. It can be understood that when the option field includes the first sub-option field, the bit corresponding to the first sub-option field in the option mapping field is set. That is to say, the number of sub-option fields in the option field can be obtained according to the number of bits set in the option mapping field.
  • the length of the option mapping field is not limited to only 1 byte. For example, it can also be 2 bytes. The length of the option mapping field can be based on the maximum number of sub-option fields to be carried in the option field. Sure.
  • the above-mentioned at least one sub-option field is arranged based on the order in which each bit position in the option mapping field is set.
  • FIG. 3B is a schematic diagram of the format of an option field provided by an embodiment of the present application.
  • the length of the option mapping field is 1 byte, of which four bits are set to 1, which means that the option field includes four sub-option fields, and these four sub-option fields are corresponding to each other.
  • the setting sequence of bit bits is arranged from top to bottom.
  • the first bit position "1" indicates that the transmission control option field is included; the second bit position "1" indicates that the correction is included.
  • Checksum option field, and the checksum option field is located after the transmission control option field;
  • the third bit position is "1", indicating that the window size field is included, and the window size option field is located after the checksum option field;
  • the fourth bit Position "1" means that the payload length field is included, and the payload length field is located after the window size option field.
  • the four sub-option fields shown in FIG. 3B can also be arranged from bottom to top in the setting order of their corresponding bits, which is not specifically limited here.
  • the option field shown in Figure 3B is only an example and does not limit the content of the option field in the LWCTP header.
  • the number of fields in the option field may be less than the number of fields shown in FIG. 3B , for example, in the transmission control option field, the checksum option field, the window size option field, the payload length option field, etc.
  • One or more items can be left out by default.
  • the number of fields in the option field may be more than the number of fields shown in Figure 3B.
  • a padding data field may also be added to the option field shown in Figure 3B.
  • At least one of the payload field and the option field is optional.
  • the option field and the load field can be selectively set according to transmission control requirements, which can reduce unnecessary
  • the necessary byte overhead is beneficial to improving the payload ratio of the message header.
  • the following introduces a communication method provided by the embodiment of the present application based on the message header of the transport layer defined above.
  • This method can be applied to a communication system composed of a first device and a second device.
  • the first device can be the first device in Figure 1 and the second device can be the second device in Figure 1 .
  • Figure 4 is a flow chart of a communication method provided by an embodiment of the present application. As can be seen from Figure 4, this method can be divided into three stages, namely the transmission start stage, the data transmission stage and the transmission end stage. It should be noted that the message header in the embodiment of Figure 4 is the message header of the transport layer defined above, for example, the LWCTP header. The method includes but is not limited to the following steps:
  • the first device sends a control message 1 to the second device.
  • the control message 1 includes transmission control option information 1.
  • the transmission control option information 1 is used to request to start data transmission from the first device to the second device.
  • the second device receives the data packet 1 sent by the first device.
  • the data transmission from the first device to the second device is performed based on the one-way first communication connection.
  • the first communication connection is a communication connection for transmitting data from the first device to the second device.
  • the transmission control option information 1 is carried in the transmission control option field in the header of the control message 1.
  • the transmission control option information 1 may be represented by bits in the transmission control option field or represented by a binary value of the transmission control option field, which is not specifically limited here. It can be understood that the transmission control option information 1 is equivalent to representing the above-mentioned "start" control primitive.
  • control message 1 also includes source port information and destination port information. If the first application on the first device needs to send data to the second application on the second device, the source port information can carry the first The identity of the application and the destination port information can carry the identity of the second application. It can be understood that the source port information can be carried in the source port field in the packet header of the control packet 1, and the destination port information can be carried in the destination port field in the packet header of the control packet 1.
  • first application and the second application may be the same application or different applications.
  • the first device can carry the sending sequence number of the control message 1 through the sequence number field in the header of the control message 1, and the confirmation sequence number field carries the confirmation sequence number of the control message 1.
  • the sending serial number field and the confirming serial number field please refer to the description of the corresponding contents in the embodiment of Figure 2, and will not be described again here.
  • the transmission control option information 1 can also be understood as being used to request the establishment of a first communication connection for transmitting data from the first device to the second device. It can be understood that the first communication connection is a one-way communication connection.
  • the second device configures resources for receiving data from the first device according to the control message 1.
  • the resources configured locally by the second device include storage resources such as cache area and status management area.
  • the cache area can be used to store data subsequently obtained from the first device, and the status management area can be used to store local connection status information.
  • the second device sends a control message 2 to the first device.
  • the control message 2 includes transmission control option information 2.
  • the transmission control option information 2 is used to confirm the initiation of data transmission from the first device to the second device.
  • the second device locally completes preparations for receiving data from the first device.
  • the first device receives the control message 2 from the second device, and the first device can determine that the data transmission from the first device to the second device has been successfully started based on the transmission control option information 2 in the control message 2, or it can It is understood that the above-mentioned first communication connection has been successfully established, and the first device can transmit data in sequence.
  • the transmission control option information 2 is carried in the transmission control option field in the header of the control message 2 .
  • the transmission control option information 2 may be represented by bits in the transmission control option field or represented by a binary value of the transmission control option field, which is not specifically limited here. It can be understood that the transmission control option information 2 is equivalent to the "start ack" control primitive mentioned above.
  • the sequence number field in the control message 1 carries "100" and the confirmation sequence number field carries "0"
  • the sequence number field in the control message 2 may, for example, carry "200" (which is the second device A locally generated random positive integer), confirming that the sequence number field carries "100".
  • the source port field in the control message 1 is used to carry the identity of the first application and the destination port field is used to carry the identity of the second application, then in the control message 2, the source port field is used to carry the identity of the first application. The identity of the second application is carried and the destination port field is used to carry the identity of the first application.
  • the transmission control option information 3 can also be understood as being used to confirm the establishment of the first communication connection.
  • the data transmitted by the first device to the second device is exemplified by taking the service data unit SDU as an example.
  • S404 The first device sends data packet 1 to the second device, and data packet 1 carries SDU1.
  • SDU1 is the first service data sent by the first device.
  • sequence number field in the control packet 2 is used to carry "200" and the confirmation sequence number field is used to carry "100"
  • the sequence number field is used to carry "101”
  • the confirmation sequence number field is used to carry "101”.
  • the serial number field is used to carry "200”.
  • the source port field is used to carry the identity of the first application
  • the destination port field is used to carry the identity of the second application.
  • S405 The second device sends a response message 1 to the first device, and the acknowledgment sequence number carried in the response message 1 is the sending sequence number carried in the data message 1.
  • the confirmation sequence number carried in the response message 1 is the sending sequence number carried in the data message 1, which means that the second device has received the data message 1, and the response message 1 is a confirmation reply to the data message 1.
  • the first device receives the response message 1 from the second device, and the first device can determine according to the response message 1 that the SDU1 has been successfully transmitted to the second device.
  • sequence number field in data message 1 is used to carry "101" and the confirmation sequence number field is used to carry "200"
  • sequence number field is used to carry "200”
  • confirmation sequence number field is used to carry "200”.
  • serial number field is used to carry "101”.
  • the source port field is used to carry the identity of the second application
  • the destination port field is used to carry the identity of the first application.
  • the first device may initiate multiple data transmissions to the second device and transmit one SDU each time.
  • the embodiment of Figure 4 only lists one transmission between the first device and the second device during the data transmission phase, but the embodiment of the present application does not limit the number of times the first device initiates data transmission to the second device. It can be understood that the number of times the first device initiates data transmission to the second device is related to the number of SDUs to be sent by the first device.
  • each time the first device sends a data packet to the second device the second packet can confirm and reply to the received data packet. For example, based on S404 and S405, it can be seen that the first device sends data message 1 to the second device, and the second device sends a response message 1 to the first device, and the confirmation sequence number carried in the response message 1 is data.
  • the sending sequence number carried in message 1, that is, response message 1 is a confirmation reply to data message 1.
  • the first device in order to improve the efficiency of sending data messages on the first device side, does not need to wait for confirmation from the second device for each data transmission. That is, the first device can continuously send multiple data packets to the second device. A message carrying data, and after the second device receives the data message from the first device, it does not need to reply immediately with a confirmation, but uses the storage resources locally allocated to the first device to cache the received multiple data messages in sequence. , the second device confirms the received multiple data packets only after delaying the first preset time period or when the cache space of the storage resource available for receiving data reaches the preset cache value. In this way, not only can the efficiency of the first device in sending data packets be improved, but the second device can also reduce the number of times of sending acknowledgment replies, thereby reducing bandwidth consumption.
  • the first device sends a control message 3 to the second device.
  • the control message 3 includes transmission control option information 3.
  • the transmission control option information 3 is used to request the termination of data transmission from the first device to the second device.
  • the first device can send a control message 3 to the second device to request to terminate the data transmission from the first device to the second device, which also means The first device terminates data transmission to the second device.
  • the transmission control option information 3 is carried in the transmission control option field in the header of the control message 3 .
  • the transmission control option information 3 may be represented by bits in the transmission control option field or represented by a binary value of the transmission control option field, which is not specifically limited here. It can be understood that the transmission control option information 3 is equivalent to representing the above-mentioned "end" control primitive.
  • control message 3 assume that the sending sequence number field is used to carry "111", and the confirmation sequence number field is still used to carry "200". If the sending sequence number carried in the above data message 1 is "101" , which means that the first device has transmitted 10 SDUs to the second device.
  • the source port field is used to carry the identity of the first application
  • the destination port field is used to carry the identity of the second application.
  • the transmission control option information 3 can also be understood as being used to request to disconnect the above-mentioned first communication connection.
  • S407 The second device releases the configured resources for receiving data from the first device according to the control message 3.
  • the resources configured for receiving data from the first device after the resources configured for receiving data from the first device are released, the resources will be recycled. Therefore, when the first device subsequently sends the above control message 1 to the second device again, the second device needs to re- Configuring resources for receiving data from the first device can improve resource utilization efficiency.
  • releasing the resource configured for receiving data from the first device can be understood as deleting the corresponding relationship between the resource and the first device locally, and then the first device sends the above control message to the second device again. 1, the second device can directly associate the resource with the first device. In this case, the resource is equivalent to the resource reserved by the second device for the first device.
  • the second device sends a control message 4 to the first device.
  • the control message 4 includes transmission control option information 4.
  • the transmission control option information 4 is used to confirm the termination of data transmission from the first device to the second device.
  • the first device receives the control message 4 from the second device.
  • the first device can determine that the data transmission from the first device to the second device has been terminated according to the transmission control option information 4 in the control message 4.
  • the first device The transmission cycle of the current data transmission ends.
  • the transmission control option information 4 is carried in the transmission control option field in the header of the control message 4 .
  • the transmission control option information 4 may be represented by bits in the transmission control option field or represented by a binary value of the transmission control option field, which is not specifically limited here. It can be understood that the transmission control option information 4 is equivalent to representing the "end ack" control primitive mentioned above.
  • sequence number field in control packet 3 is used to carry "111" and the confirmation sequence number field is used to carry "200"
  • sequence number field is used to carry "200” and the confirmation sequence number field is used to carry "200”.
  • sequence number field is used to carry "111”.
  • the source port field is used to carry the identity of the second application
  • the destination port field is used to carry the identity of the first application.
  • the transmission control option information 4 can also be understood as being used to confirm the disconnection of the above-mentioned first communication connection.
  • the first device can start a transmission cycle of data transmission by sending a message carrying the "start” control primitive.
  • the first device can send a message carrying the "end” control primitive.
  • the message of the primitive ends the transmission cycle.
  • the communication connection established through the "start" control primitive is always kept alive. Compared with the existing technology, which requires periodically sending detection messages to keep the established communication connection alive, it can effectively save bandwidth consumption. , and can also save the local power consumption of the device.
  • the device A control message 5 can be sent to the opposite end to cause the opposite end to perform a reset operation. At the same time, the device also performs a local reset operation on the data transmission corresponding to the current transmission cycle.
  • the control message 5 includes transmission control option information 5, and the transmission control option information 5 is used to reset data transmission from the first device to the second device. It can be understood that the transmission control option information 5 is equivalent to representing the above-mentioned "reset" control primitive.
  • the local failure event includes at least one of events such as disconnection of a lower layer protocol (eg, network layer protocol or data link layer protocol), failure of data transmission, and the like.
  • a lower layer protocol eg, network layer protocol or data link layer protocol
  • the first device After the first device sends a data message, it does not receive a response message for the data message and the number of times it retransmits the data message reaches a preset number of times, this situation can be regarded as a local fault event of the first device.
  • the first device After the first device receives the above-mentioned control message 2 (or after the first communication connection is successfully established), the first device does not send data within the first preset time period. This situation can be regarded as a local fault event of the first device.
  • the second device does not receive data from the first device within a first preset time period.
  • This situation may be a local fault event of the second device.
  • the above embodiment shows a communication process in one direction (ie, from the first device to the second device), indicating that the control of one-way data transmission can be achieved through the LWCTP header defined in the embodiment of the present application.
  • the embodiment of the present application only requires the second device to configure or preset the data locally when performing one-way data transmission. Corresponding resources are reserved, and the first device does not need to reserve resources locally for receiving data from the second device, which saves resource consumption on the sending end.
  • the second device can start another transmission cycle in the opposite transmission direction (from the second device to the first device).
  • the specific process can be referred to Figure 4 above.
  • the first device and the second device can locally manage and maintain the local connection of the device through the state machine. status information.
  • the following describes the state machines configured on the first device and the second device respectively.
  • Type 1 The first device is configured with a state machine 1 corresponding to the first communication connection.
  • State machine 1 is used to manage the connection status of the first device as the sending end on the first communication connection.
  • Figure 5A is a state schematic diagram of a state machine configured on a sending end provided by an embodiment of the present application.
  • the following five states are shown:
  • Initial state indicates that data transmission from the first device to the second device has not been initiated, that is, the first device has not requested from the second device to initiate data transmission from the first device to the second device.
  • the initial state may also indicate that the first communication connection is not established.
  • Waiting start ack status Indicates that the first device is waiting for the second device to reply to confirm the start of data transmission from the first device to the second device.
  • the first device may also be allowed to transmit data to the second device in the waiting to start response state.
  • the waiting to start response state may also mean that the first device is waiting for a reply from the second device to confirm the establishment of the above-mentioned first communication connection.
  • Sending data status indicates that the first device knows that the data transmission from the first device to the second device has been successfully started. In this state, the first device can transmit data to the second device in sequence.
  • Waitingend ack status indicates that the first device is waiting for the second device to reply and confirm to terminate the data transmission from the first device to the second device.
  • the waiting for end response state may also indicate that the first device is waiting for a reply from the second device to confirm the disconnection of the first communication connection.
  • Resetting state indicates that the first device resets the data transmission from the first device to the second device.
  • the reset state may also indicate that the first device resets the above-mentioned first communication connection.
  • state machine 1 is configured as:
  • the event of starting to send data means that the first device has a need to transmit data to the second device.
  • the first device is in the waiting start response state, in response to receiving an event carrying a message indicating the "start ack" control primitive (for example, control message 2 in Figure 4), the first device is started by waiting.
  • the response state switches to the sending data state;
  • the end of sending data event means that the first device has completed the transmission of the last data and the first device will no longer send data to the second device in this transmission cycle.
  • the first device When the first device is in the wait-end response state, in response to receiving an event carrying a message indicating the "end ack" control primitive (for example, control message 4 in Figure 4), the first device is stopped by the wait-end response state.
  • the response state switches to the initial state.
  • the first device When the first device is in any of the waiting start response state, sending data state and waiting end response state shown in Figure 5A, it responds to a local fault event or receives the carrying instruction "reset" control sent by the second device. In the event of a primitive message, the first device is switched to the reset state, and the first device performs a reset operation, and in the event of a local failure, the first device also performs sending a control primitive carrying the instruction "reset" to the second device. message action.
  • the local fault event includes at least one of a lower layer protocol (for example, a network layer protocol or a data link layer protocol) disconnection event, a data transmission failure event, and the like.
  • a lower layer protocol for example, a network layer protocol or a data link layer protocol
  • disconnection event for example, a data transmission failure event, and the like.
  • the completed reset event means that the first device has completed the reset operation locally.
  • the second device is configured with a state machine 2 corresponding to the first communication connection.
  • State machine 2 is used to manage the connection status of the second device as the receiving end on the first communication connection.
  • Figure 5B is a state schematic diagram of a state machine configured on a receiving end provided by an embodiment of the present application.
  • the following four states are shown:
  • the initial state may also indicate that the second device has not established the above-mentioned first communication connection.
  • Receiving data status Indicates that the second device has completed configuring resources for receiving data from the first device and is waiting to receive data transmitted by the first device.
  • Pending end state indicates that the second device releases the resources configured in the second device for receiving data from the first device, that is, it ends receiving data from the first device.
  • Resetting state indicates that the second device resets the data transmission from the first device to the second device.
  • the reset state may also indicate that the second device resets the above-mentioned first communication connection.
  • state machine 2 is configured as:
  • the second device In response to an event of receiving a message carrying the "start" control primitive (for example, control message 1 in Figure 4), the second device is switched from the initial state to the receiving state. data status, and the second device performs the action of sending a message carrying the "start ack" control primitive (for example, control message 2 in Figure 4).
  • the second device When the second device is in the receiving data state, the second device is switched from the receiving data state in response to an event of receiving a message carrying an "end" control primitive (for example, control message 3 in Figure 4). For the pending end state, and the second device performs sending a message carrying the control primitive indicating "end ack" (for example, control message 4 in Figure 4) and releasing the configuration in the second device for receiving data from the first device resource actions.
  • the completion event refers to the end of the second device releasing the resources configured for receiving data from the first device.
  • the second device When the second device is in the receiving data state or the pending end state shown in Figure 5B, in response to a local fault event or an event that receives a message carrying an instruction "reset" control primitive sent by the first device, the second device is switched to the reset state and the second device performs a reset operation and also performs an action of sending a message carrying a control primitive indicating a "reset" to the first device in the event of a local failure.
  • the local fault event please refer to the description of the corresponding content in S408 of Figure 4, which will not be described again here.
  • the completed reset event means that the second device has completed the reset operation locally.
  • the above-mentioned state machine 1 and state machine 2 are state machines corresponding to the first communication connection.
  • the state machine 3 also needs to be maintained on the second device, where the state machine 3 is The second device is generated as the data sending end.
  • the first device also needs to maintain the state machine 4, where the state machine 4 is generated by the first device as the receiving end of the data.
  • the configuration of the state machine 4 please refer to the relevant description of the above-mentioned state machine 2.
  • the communicating parties only need to maintain their respective connection statuses during the transmission cycle.
  • the device when initiating one-way data transmission, the device only needs to manage the connection status information when it is the sender or receiver of data.
  • the device When initiating bidirectional data transmission, by configuring two independent state machines in the first device (the state machine when acting as the sender of data and the state machine when acting as the receiver of data), the same device is connected when acting as the sender.
  • the management of status and the management of connection status when the device serves as a receiver are independently decoupled, which can effectively simplify the management of communication connection status by the device.
  • the first device can transmit data without sending a response message of control message 2 to the second device, the first device is also receiving the control message 2 sent by the second device. Then start the data transmission.
  • the first device in order to improve data transmission efficiency, can transmit data to the second device as early as possible without waiting for the control message 2 to be received.
  • the first device may start transmitting data to the second device in the connection establishment phase shown in FIG. 4 .
  • the first device after the first device sends the control message 1 and before receiving the control message 2 from the second device, the first device can send the data message 1, that is, in Figure 4 S404 can be executed after S401 and before S403.
  • the first device can also directly carry the data to be sent through the control message 1. That is to say, in this embodiment of the present application, in addition to carrying transmission control option information (for example, transmission control option information 1), the control packet can also carry data.
  • transmission control option information for example, transmission control option information 1
  • the control packet can also carry data.
  • Figure 6 is another communication method provided by an embodiment of the present application. Compared with the embodiment shown in FIG. 4 , the difference is that the timing of the first device transmitting data in FIG. 6 is earlier than the timing of the first device transmitting data in FIG. 4 .
  • the data transmitted by the first device to the second device takes SDU as an example. The method includes but is not limited to the following steps:
  • the first device sends a control message 1 to the second device.
  • the control message 1 includes transmission control option information 1 and SDU0.
  • the transmission control option information 1 is used to request to start data transmission from the first device to the second device.
  • SDU0 is the first service data of the first device.
  • SDU0 is carried in the payload field in the header of control message 1.
  • the second device configures resources for receiving data from the first device according to the control message 1.
  • S603 The second device sends a control message 2 to the first device, where the control message 2 includes transmission control option information 2.
  • the control message 2 includes transmission control option information 2.
  • the transmission control option information 2 is used to confirm the initiation of data transmission from the first device to the second device.
  • control message 2 is not only a confirmation reply to the transmission control option information 1 in the control message 1, but also a confirmation reply to the SDU0 in the control message 1.
  • S604 The first device sends data packet 1 to the second device, and data packet 1 carries SDU1.
  • S605 The first device sends data packet 2 to the second device, and data packet 2 carries SDU2.
  • S606 The second device sends response message 1 to the first device, and the acknowledgment sequence number carried in response message 1 is the sending sequence number carried in data message 2.
  • the first device can continuously send data packets carrying SDUs to the second device, which can improve the throughput of the sending end when sending data in batches.
  • S604-S606 is just an example of a data transmission scenario between the first device and the second device. It is not limited to the second device having to send a confirmation reply every time it receives two SDUs, nor is it limited to the data transmission stage. The first device sends only two SDUs to the second device.
  • a transmission failure may occur when the first device sends data packet 2 to the second device in S605.
  • the first device receives the response message 1 from the second device. If the confirmation sequence number carried in the response message 1 is the transmission sequence number carried in the data message 1, the first device determines that the data message 2 has not been received by the second device. The device receives it successfully. In this case, the first device needs to resend data message 2. It can be understood that when the message is retransmitted, the sending sequence number carried in the message remains unchanged.
  • the time interval for the first device to retransmit the data message 2 satisfies the exponential backoff principle.
  • the first device carries the response message received from the second device twice.
  • the first device determines that the transmission of data message 2 failed only when the acknowledgment sequence numbers are all the sending sequence numbers carried in data message 1.
  • the first device after the first device continuously sends the above-mentioned data message 1 and data message 2 to the second device, if the above-mentioned response message 1 is not received from the second device within a preset time period, then The first device can resend the data packet 1 and data packet 2 to the second device.
  • the second device's confirmation reply method to the data packet sent by the first device may also be that each time the second device receives a data packet sent by the first device, the second device performs a check on the packet. Confirm reply. For example, after the first device sends the above data message 1 to the second device, the second device sends a response message of data message 1 to the first device; after the first device sends data message 2 to the second device, the second device The device sends a response message of data message 2 to the first device.
  • the second device after the second device receives the data message 2, the response message of the data message 2 sent by the second device to the first device may not be successfully received by the first device, causing the first device to re- Data message 2 is sent.
  • the second device receives data message 2 for the second time, that is, a duplicate message is received. Then the second device can discard the data message 2 received for the second time, and Resend the response message of data message 2 to the first device.
  • the first device sends a control message 3 to the second device.
  • the control message 3 includes transmission control option information 3 and SDUn.
  • the transmission control option information 3 is used to request the termination of data transmission from the first device to the second device.
  • SDUn is the last service data to be sent by the first device. It can be known that in the embodiment of Figure 6, the first device transmits (n+1) SDUs to the second device.
  • the second device releases the resources in the second device used for receiving data configuration from the first device according to the control message 3.
  • S609 The second device sends a control message 4 to the first device, where the control message 4 includes transmission control option information 4.
  • the control message 4 includes transmission control option information 4.
  • the first device in addition to the data transmission phase, can also send a message during the transmission start phase and the transmission end phase.
  • the text carries data, so during the entire transmission cycle, if the first device needs to send (n+1) data to the second device, the first device only needs to send (n+1) messages to the second device, and Each message carries a piece of data.
  • data can only be sent after a connection is established. Therefore, in the existing technology, if the first device needs to send (n+1) data to the second device, the first device needs to send a total of (n+1) data to the second device.
  • Figure 7 is a flow chart of yet another communication method provided by an embodiment of the present application. Compared with the embodiment of Fig. 6, the difference is that the embodiment of Fig. 7 can realize bidirectional data transmission between the first device and the second device.
  • the data transmitted between the first device and the second device takes SDU as an example.
  • the message header in the embodiment of Figure 7 is the message header of the transport layer defined above, for example, the LWCTP header. The method includes but is not limited to the following steps:
  • the first device sends a control message 1 to the second device.
  • the control message 1 includes transmission control option information 1 and SDU0.
  • the transmission control option information 1 is used to request to start data transmission from the first device to the second device.
  • the transmission control option information 1 is carried in the transmission control option field in the header of the control message 1.
  • the transmission control option information 1 is equivalent to representing the above-mentioned "start" control primitive.
  • start control primitive
  • SDU0 is the first service data sent by the first device.
  • SDU0 is carried by the payload field in the header of control message 1.
  • the second device receives the control message 1 from the first device, and the second device can configure resources for receiving data from the first device according to the transmission control option information 1 in the control message 1 .
  • the second device sends a control message 2 to the first device.
  • the control message 2 includes transmission control option information 2 and SDU1.
  • the transmission control option information 2 in Figure 7 is not only used to confirm the initiation of data transmission from the first device to the second device, the transmission control option information 2 is also used Initiating data transfer from the second device to the first device upon request.
  • the transmission control option information 2 can also be understood as being also used to request the establishment of a second communication connection for transmitting data from the second device to the first device.
  • the second communication connection is a one-way communication connection. It can be understood that the data transmission from the second device to the first device is performed based on the second communication connection.
  • the transmission control option information 2 is carried in the transmission control option field in the header of the control message 2.
  • Transmission control option information 2 is equivalent to representing the above-mentioned "start ack" and "start” control primitives.
  • SDU1 is the first service data sent by the second device.
  • SDU1 is carried by the payload field in the header of control message 2.
  • the first device receives the control message 2 from the second device, and the first device configures resources for receiving data from the second device according to the transmission control option information 2 in the control message 2 .
  • S703 The first device sends data packet 1 to the second device, and data packet 1 carries SDU2.
  • the transmission sequence number carried in control message 1 is i and the confirmation sequence number is j
  • the transmission sequence number carried in control message 2 is The sending sequence number is j+1 and the confirmation sequence number is i.
  • the sending sequence number carried in data message 1 is i+1 and the confirmation sequence number is j+1.
  • S704 The second device sends data packet 2 to the first device, and data packet 2 carries SDU3.
  • the sending sequence number carried in data packet 1 is i+1 and the confirmation sequence number is j+1
  • the sending sequence number carried in data packet 2 is j+2 and the confirmation sequence number is i+ 1.
  • data message 2 carries data SDU3, and data message 2 merges the confirmation reply of data message 1 and the message used to transmit data. In this way, the communication between the first device and the second device can be improved. data transmission efficiency between.
  • the second device may not combine the acknowledgment reply to data message 1 with the message used to transmit data. For example, after the second device receives data packet 1 from the first device, the second device first sends a response message of data packet 1 to the first device. When the second device needs to transmit data to the first device, the second device then Send a data packet carrying data to the first device based on the established second communication connection.
  • the second device can also delay the confirmation reply to the data packet sent by the first device. For example, when the second device meets any of the following conditions, the second device can respond to the data packet sent by the first device. Confirmation reply to multiple data packets received at: Delay first preset Assume that the cache space available for receiving data from the first device in the locally configured resources reaches a preset cache value or the second device needs to transmit data to the first device.
  • Delay first preset Assume that the cache space available for receiving data from the first device in the locally configured resources reaches a preset cache value or the second device needs to transmit data to the first device.
  • delayed confirmation of the data packet from the second device to the first device please refer to the description of the corresponding content in S405 in the embodiment of FIG. 4, which will not be described again here.
  • S703 and S704 are an example of a communication scenario in which bidirectional data transmission is enabled between the first device and the second device.
  • the embodiment of the present application does not limit only one data transmission between the first device and the second device. interaction.
  • only the first device can transmit data to the second device, or only the second device can transmit data to the first device.
  • the following S705-S707 may also be performed:
  • the first device sends a control message 3 to the second device.
  • the data message 3 includes transmission control option information 3 and SDUn.
  • the transmission control option information 3 is used to request the termination of data transmission from the first device to the second device.
  • the transmission control option information 3 is carried in the transmission control option field in the header of the control message 3.
  • Transmission control option information 3 is equivalent to representing the above-mentioned "end" control primitive.
  • SDUn is the last service data sent by the first device. SDUn is carried by the payload field in the header of control message 3.
  • the second device receives the control message 3 from the first device, and the second device releases resources in the second device for receiving data configuration from the first device according to the transmission control option information 3 in the control message 3.
  • the second device sends a control message 4 to the first device.
  • the control message 4 includes transmission control option information 4 and SDUm.
  • the transmission control option information 4 in Figure 7 is not only used to confirm the termination of data transmission from the first device to the second device, the transmission control option information 4 is also used to confirm the termination of data transmission from the first device to the second device. Terminating data transmission from the second device to the first device upon request.
  • the transmission control option information 4 can also be understood as being also used to request to disconnect the above-mentioned second communication connection.
  • the transmission control option information 4 is carried in the transmission control option field in the header of the control message 4 .
  • Transmission control option information 4 is equivalent to representing the above-mentioned "end ack" and "end” control primitives.
  • SDUm is the last service data sent by the second device.
  • SDUm is carried by the payload field in the header of control message 2.
  • the first device receives the control message 4 from the second device, the first device releases resources in the first device for receiving data configuration from the second device according to the transmission control option information 4 in the control message 4, and the first device A device also determines that data transmission from the first device to the second device has ended based on the transmission control option information 4.
  • the first device sends a control message 5 to the second device.
  • the control message 5 includes the transmission control option information 5.
  • the transmission control option information 5 is used to confirm the termination of data transmission from the second device to the first device.
  • the transmission control option information 5 can also be understood as being also used to confirm the disconnection of the above-mentioned second communication connection.
  • the transmission control option information 5 is carried in the transmission control option field in the header of the control message 5 .
  • Transmission control option information 5 is equivalent to representing the above-mentioned "end ack" control primitive.
  • the second device determines that the data transmission from the second device to the first device has been terminated.
  • the data transmission on the first device side may end but the data transmission on the second device side has not.
  • the first device may first request the second device to terminate the transfer from the first device to the second device.
  • the second device continues to transmit data to the first device based on the second communication connection.
  • the second device can first request the first device to terminate the transfer from the second device to the second device.
  • the first device continues to transmit data to the second device based on the first communication connection.
  • two-way communication between the first device and the second device can be realized, and the control in the two transmission directions corresponding to the two-way communication is independently decoupled, which is conducive to ensuring the reliability of the transmission. sex.
  • the first device side or the second device side transmits data at the beginning of the transmission, which can effectively reduce the transmission delay of the first local service data and improve the data transmission efficiency.
  • Figure 8 is a flow chart of yet another communication method provided by an embodiment of the present application.
  • the embodiment of Figure 8 mainly introduces that in the data transmission stage (that is, by default, both communicating parties have established a connection or bidirectional data transmission is started), the receiving end (for example, the second device in Figure 1) can carry the above Figure 3B in the message.
  • the window size option information in allows the sending end (for example, the first device in FIG. 1) to adaptively adjust the data transmission rate and/or the size of the data to be sent.
  • the message header in the embodiment of Figure 8 is the message header of the transport layer defined above, for example, the LWCTP header.
  • the method includes but is not limited to the following steps:
  • S801 The first device sends data packet 1 to the second device.
  • the payload field carries the data SDUc
  • the sequence number field carries the sending sequence number i
  • the acknowledgment sequence number field carries the acknowledgment sequence number j.
  • the payload field, sequence number field and confirmation sequence number field are all included in the message header of data message 1.
  • the second device detects that the first cache space in the configured resources that can be used to receive data from the first device is less than the first warning value, and generates response message 1.
  • the first warning value may be preset by the user on the second device.
  • the response message 1 includes first window size option information, and the first window size option information is used to carry the above-mentioned first cache space.
  • the first window size option information is carried by the window size option field in the message header of response message 1.
  • response message 1 may also carry data on the second device side, and the transmission sequence number carried in response message 1 is j+1.
  • S803 The second device sends response message 1 to the first device.
  • response message 1 in order to improve the reliability of transmission, can be retransmitted multiple times by the second device. During the retransmission process, the transmission sequence number carried by response message 1 remains unchanged.
  • the first device detects that the first cache space is less than the first preset value based on the response message 1, and suspends sending data to the second device.
  • the first preset value may be preset by the user on the first device.
  • the first preset value is smaller than the first warning value.
  • the first cache space may be 0.
  • the first device obtains the first cache space from the first window size option information in the response message 1.
  • the first cache space is less than the first preset value, it means that the second device locally allocates storage for the first device.
  • the available cache space in the resource is insufficient, so the first device can first suspend data transmission to the second device.
  • the second device clears the received data in the configured resources, detects that the second cache space in the configured resources that can be used to receive data from the first device is greater than the second warning value, and generates response message 2.
  • the second warning value may be preset by the user on the second device.
  • the second warning value is greater than or equal to the first warning value.
  • the second device can perform at least one clearing operation on the received data in the configured resource, then the cache space in the resource that can be used to receive data from the first device is increased from the first cache space to the second cache space, When the second cache space is greater than the second warning value, the second device may inform the first device of its current cache space for receiving data from the first device through response message 2.
  • the response message 2 includes second window size option information, and the second window size option information is used to carry the above-mentioned second cache space.
  • the second window size option information is carried by the window size option field in the message header of response message 2.
  • the sending sequence number carried in response message 1 is j and the confirmation sequence number is i
  • the sending sequence number carried in response message 2 is j
  • the confirmation sequence number carried in response message 2 is i
  • the response message 2 may also carry data on the second device side, and the transmission sequence number carried in the response message 2 is j+1.
  • S806 The second device sends response message 2 to the first device.
  • the second device may send response message 2 to the first device multiple times.
  • the second cache space carried by the second window size option information in the response message 2 may change.
  • the second device may transmit to the first device although the data transmission from the first device to the second device has been suspended.
  • Data that is, the response message 2 sent by the second device to the first device can also carry data on the second device side, then the sending sequence number carried in the response message 2 is greater than or equal to the sending sequence number carried in the response message 1 .
  • the first device receives the response message 2 from the second device.
  • the sending sequence number carried in the response message 2 is greater than or equal to the sending sequence number carried in the response message 1, based on the third sequence number in the response message 2 If the second window size option information determines that the second buffer space is greater than the first preset value, the first device continues to send data to the second device.
  • S807 The first device adjusts the data sending rate and/or the size of the data to be sent according to the second window size option information in the response message 2.
  • the data sending rate is reduced and/or the size of the data to be sent is reduced.
  • the second preset value may be preset by the user on the first device.
  • the second preset value is greater than the first preset value, and the second preset value is less than or equal to the first warning value set locally on the second device.
  • the first device can reduce the data sending rate and/or reduce the size of data sent each time, so that the second device can use the configured resources within a certain period of time.
  • the received data is cleared to increase the buffer space available in the resource for receiving data from the first device, which is beneficial to improving transmission reliability and reducing packet loss.
  • the data sending rate is increased and/or the size of the data to be sent is increased.
  • the third preset value may be preset by the user on the first device.
  • the third preset value is greater than or equal to the second preset value, and the third preset value is equal to or equal to the second early warning value set locally on the second device.
  • the first device can increase its own data sending rate and/or the size of the data sent each time, thereby improving data transmission efficiency.
  • the embodiment of Figure 8 shows that the second device can enable the first device as the data sending end to adaptively adjust the data transmission rate and/or the size of the data to be sent by carrying window size option information in the message.
  • the first device when the data transmission from the second device to the first device has been started, can also carry the window size option information in the message so that the second device as the data sender can The data transfer rate and/or the size of the data to be sent are adapted.
  • the receiving end of the data can carry the above window size option information in the message so that the sending end of the data can adjust the data transmission rate and/or the size of the data to be sent. Adaptive adjustment will help improve data transmission efficiency and transmission reliability.
  • FIG. 9A is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device 30 includes a sending unit 310 and a receiving unit 312 .
  • the device 30 can be implemented by hardware, software, or a combination of software and hardware.
  • the communication device 30 may be the above-mentioned first device or the communication device 30 may be included in the first device.
  • the sending unit 310 is used to send a first control message to the second device.
  • the first control message includes first transmission control option information.
  • the first transmission control option information is used to request the startup from the first device to the second device.
  • the receiving unit 312 is used to receive a second control message from the second device, the second control message includes second transmission control option information, and the second transmission control option information is used to confirm the startup from the first device to the second device.
  • Data transmission between two devices; the sending unit 310 is also configured to send the first data to the second device without sending a response message of the second control message to the second device.
  • the communication device 30 may be used to implement the method on the first device side described in the embodiment of FIG. 4 .
  • the sending unit 310 can be used to perform S401, S404 and S406, and the receiving unit 312 can be used to perform S403, S405 and S408.
  • the communication device 30 can also be used to implement the first device-side method described in FIG. 6, FIG. 7, and FIG. 8. For the sake of simplicity of the description, details will not be described again here.
  • Figure 9B is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device 40 includes a receiving unit 410, a sending unit 412 and a processing unit 414.
  • the communication device 40 can be implemented by hardware, software, or a combination of software and hardware.
  • the communication device 40 may be the above-mentioned second device or the communication device 40 may be included in the second device.
  • the receiving unit 410 is used to send a first control message from the first device, the first control message includes first transmission control option information, and the first transmission control option information is used to request to start data from the first device to the second device.
  • the communication device 40 may also include a processing unit (not shown), which may be used to locally allocate storage resources for receiving data to the first device, etc.
  • the communication device 40 can be used to implement the method on the second device side described in the embodiment of FIG. 4 .
  • the receiving unit 410 can be used to perform S401, S404 and S406, the processing unit can be used to perform S402 and S407, and the sending unit 412 can be used to perform S403, S405 and S408.
  • the communication device 40 can also be used to implement the second device-side method described in FIG. 6, FIG. 7, and FIG. 8. For the sake of simplicity of the description, details will not be described again here.
  • the communication device shown in FIG. 9A or 9B above may be an independent device, such as a node, or may be a component of an independent device (such as a node), such as a chip or an integrated circuit.
  • each unit in the embodiment shown in FIG. 9A or 9B is only a division of logical functions. In actual implementation, it may be fully or partially integrated into a physical entity, or it may be physically separated.
  • the unit in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, instructions are stored in the memory, and the processor calls the instructions stored in the memory to implement any of the above methods.
  • the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor
  • the memory is a memory within the device or a memory outside the device.
  • the units in the device can be implemented in the form of hardware circuits, and some or all of the functions of the units can be implemented through the design of the hardware circuits, which can be understood as one or more processors; for example, in one implementation,
  • the hardware circuit is an application-specific integrated circuit (ASIC), which realizes the functions of some or all of the above units through the design of the logical relationships of the components in the circuit; for another example, in another implementation, the hardware circuit is It can be realized by programmable logic device (PLD), taking field programmable gate array (FPGA) as an example, which can include a large number of logic gate circuits, and the logic gate circuits are configured through configuration files. connection relationships, thereby realizing the functions of some or all of the above units. All units of the above device may be fully realized by the processor calling software, or may be fully realized by hardware circuits, or part of the units may be realized by the processor calling software, and the remaining part may be realized by hardware circuits.
  • PLD programmable logic device
  • FPGA field programmable gate
  • the processor is a circuit with signal processing capabilities.
  • the processor may be a circuit with the ability to read and run instructions, such as a central processing unit (CPU). ), microprocessor, graphics processing unit (GPU) (can be understood as a microprocessor), or digital signal processor (DSP), etc.; in another implementation, the processor Certain functions can be realized through the logical relationships of hardware circuits. The logical relationships of the hardware circuits are fixed or can be reconstructed.
  • the processor is an application-specific integrated circuit (ASIC) or a programmable logic device (programmable logic). device, PLD) implemented hardware circuit, such as FPGA.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the process of the processor loading the configuration file and realizing the hardware circuit configuration can be understood as the process of the processor loading instructions to realize the functions of some or all of the above units.
  • it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), and a deep learning processing unit. (deep learning processing unit, DPU), etc.
  • NPU neural network processing unit
  • TPU tensor processing unit
  • DPU deep learning processing unit
  • each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA , or a combination of at least two of these processor forms.
  • processors or processing circuits
  • each unit in the above device may be integrated together in whole or in part, or may be implemented independently. In one implementation, these units are integrated together and implemented as a system-on-a-chip (SOC).
  • SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device.
  • the at least one processor may be of different types, including, for example, CPU and FPGA, CPU and NPU, etc.
  • Figure 10 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device 50 includes: a processor 501 , a communication interface 502 , a memory 503 and a bus 504 .
  • the processor 501, the memory 503 and the communication interface 502 communicate through the bus 504.
  • the communication device 50 may be an electronic device with communication capabilities, such as a handheld terminal, a vehicle, a vehicle-mounted device, or a network side device, a user equipment, an access terminal, a user unit, a user station, a mobile station, Equipment such as mobile stations, remote stations, remote terminals, wireless communication equipment, user agents or user devices can also be any possible intelligent terminal equipment (such as mobile phones), intelligent transportation equipment (such as vehicles, drones, etc.), intelligent Manufacturing equipment, smart home equipment (such as large screens, speakers, etc.), etc., may also be components used in the above-mentioned electronic equipment that can implement the above-mentioned methods.
  • the components may be, for example, integrated circuits, line cards, chips, etc.
  • the communication device 50 may be the first device or the second device in FIG. 1 .
  • the bus 504 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 8, but it does not mean that there is only one bus or one type of bus.
  • Bus 504 may include a path that carries information between various components of communication device 50 (eg, memory 503, processor 501, communication interface 502).
  • processor 501 For the processor 501, reference may be made to the relevant description of the processor in the above embodiments, which will not be described again here.
  • the memory 503 is used to provide storage space, and data such as operating systems and computer programs can be stored in the storage space.
  • the memory 503 may be a random access memory (RAM), an erasable programmable read only memory (EPROM), a read-only memory (ROM), or a portable read-only memory.
  • RAM random access memory
  • EPROM erasable programmable read only memory
  • ROM read-only memory
  • portable read-only memory One or a combination of multiple types of memory (compact disc read memory, CD-ROM), etc.
  • the memory 503 can exist alone or be integrated inside the processor 501 .
  • Communication interface 502 may be used to provide information input or output to processor 501. Or alternatively, the communication interface 502 may be used to receive data sent from the outside and/or send data to the outside.
  • Communication interface 502 may be a wireless link interface, such as an air interface, a cellular network interface, or a wireless LAN interface, or may include a wired link interface such as an Ethernet cable, or may include a transmitter coupled to the interface (such as a radio frequency transmitter, antenna, etc.), or receiver, etc.
  • communication interface 502 when communication interface 502 is a wireless link interface, communication interface 502 may be configured to receive and send information in accordance with one or more other types of wireless communications (eg, protocols), such as Bluetooth, IEEE 802.11 communication protocol, cellular technology, worldwide interoperability for microwave access (WiMAX) or Long Term Evolution (LTE), ZigBee protocol, dedicated short range communications (DSRC) and radio frequency identification (radio frequency identification, RFID) communication, etc.
  • protocols eg, protocols
  • Bluetooth IEEE 802.11 communication protocol
  • cellular technology worldwide interoperability for microwave access (WiMAX) or Long Term Evolution (LTE), ZigBee protocol, dedicated short range communications (DSRC) and radio frequency identification (radio frequency identification, RFID) communication, etc.
  • WiMAX worldwide interoperability for microwave access
  • LTE Long Term Evolution
  • DSRC dedicated short range communications
  • RFID radio frequency identification
  • the processor 501 in the communication device 50 is used to read the computer program stored in the memory 503, and is used to execute the aforementioned method, such as the method described in Figure 4.
  • the communication device 50 may be one or more modules in the execution subject (first device) that executes the method shown in Figure 4, and the processor 501 may be used to read one or more files stored in the memory.
  • the processor 501 may be used to read one or more files stored in the memory.
  • a second control message is received from the second device through the receiving unit 312.
  • the second control message includes second transmission control option information.
  • the second transmission control option information is used to confirm the startup from the first device to the second device. data transmission;
  • the communication device 50 can be one or more modules in the execution subject (second device) that executes the method shown in Figure 4, and the processor 501 can be used to read one or more files stored in the memory.
  • the first control message is received from the first device through the receiving unit 410.
  • the first control message includes first transmission control option information, and the first transmission control option information is used to request to start data transmission from the first device to the second device;
  • the second control message includes second transmission control option information, and the second transmission control option information is used to confirm the initiation of data transmission from the first device to the second device;
  • An embodiment of the present application also provides a communication system.
  • the communication system includes a first device and a second device, wherein the first device may be the communication device 30 shown in Figure 9A or the communication device 50 shown in Figure 10.
  • the second device may be the communication device 40 shown in FIG. 9B or the communication device 50 shown in FIG. 10 .
  • the first device can be used to perform the method on the first device side described in any of the embodiments in Figure 4, Figure 6, Figure 7 and Figure 8.
  • the second device can be used to perform the method in any of the above embodiments in Figure 4, Figure 6, Figure 7 and Figure 8.
  • storage media include read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (erasable programmable read only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory, CD-ROM) or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
  • ROM read-only memory
  • RAM random access memory
  • PROM programmable read-only memory
  • EPROM erasable programmable read only memory
  • OTPROM one-time programmable read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • CD-ROM compact disc read-only memory
  • the technical solution of the present application is essentially or contributes part or all or part of the technical solution can be embodied in the form of a software product.
  • the computer program product is stored in a storage medium and includes a number of instructions to enable a device. (It can be a personal computer, a server, or a network device, a robot, a microcontroller, a chip, a robot, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

一种通信方法及装置,该方法包括:第一设备向第二设备发起启动从第一设备至第二设备的数据传输的请求,第二设备对该请求进行确认回复,第一设备未向第二设备发送该确认回复的确认应答的情况下,第一设备可以向第二设备传输数据。实施本申请,不仅能够独立控制单向上的数据传输,还能提高数据的传输效率。

Description

一种通信方法及装置
本申请要求于2022年8月17日提交中国知识产权局、申请号为202210987559.2、申请名称为“一种通信方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术,尤其涉及一种通信方法及装置。
背景技术
面向连接(connectionoriented)是一种依赖发送端和接收端之间的显示通信和阻塞以管理双方的数据传输的网络协议。面向连接服务是指通信双方在通信之前需先建立通信连接。
传输控制协议(transmission control protocol,TCP)是一种可提供面向连接服务的传输层协议。尽管TCP可以实现通信双方之间的可靠性传输,但通信双方之间的数据传输效率低。
发明内容
本申请公开了一种通信方法及装置,能够独立控制单向上的通信连接,有利于提高数据的传输效率。
第一方面,本申请提供了一种通信方法,该方法应用于第一设备,所述方法包括:向第二设备发送第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;从所述第二设备接收第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;在未向所述第二设备发送所述第二控制报文的响应报文的情况下,向所述第二设备发送第一数据。
其中,第一设备例如可以是手持终端、车辆、车载设备、或网络侧设备、用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、无线通信设备、用户代理或用户装置等设备,也可以为任一可能的智能终端设备(如手机)、智能运输设备(如车辆、无人机等)、智能制造设备、智能家居设备(例如大屏、音箱等)等,还可以是上述电子设备内的组件(例如芯片或集成电路等)。
示例性地,第一传输控制选项信息由第一控制报文的报文头中的传输控制选项字段承载。该传输控制选项字段可以通过比特映射、二进制取值或其他方式来承载第一传输控制选项信息。相应地,第二传输控制选项信息由第二控制报文的报文头中的传输控制选项字段承载。
上述方法中,第一设备通过向第二设备发送启动从第一设备至第二设备的数据传输的请求,可实现独立控制单向上的数据传输的启动。且第一设备无需向第二设备发送该确认回复的确认应答,就能向第二设备传输数据,有利于提高数据的传输效率。
可选地,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。
实施上述实现方式,也实现了单向的通信连接的建立。相较于现有技术中通信双方通过三次握手建立双向的通信连接,本申请可以实现单向上通信连接的独立控制,即第一设备作为数据的发送端,在向第二设备发送数据之前无需在本地为接收来自第二设备的数据预留资源,从而能够快速高效地实现第一设备到第二设备的数据传输。
可选地,所述在未向所述第二设备发送所述第二控制报文的响应报文的情况下,向所述第二设备发送第一数据,包括下述任一情况:通过所述第一控制报文承载所述第一数据;在发送所述第一控制报文之后且接收所述第二控制报文之前,向所述第二设备发送承载所述第一数据的第一数据报文;或在接收所述第二控制报文之后,向所述第二设备发送承载所述第一数据的第一数据报文。
这里,通过第一控制承载第一数据,即说明本申请中的控制报文可以携带数据。
相较于现有技术要求通信双方通过三次握手建立了通信连接后发送端才可以向对端传输数据,本申请中,作为数据的发送端的第一设备不仅无需执行现有技术中的第三次握手,还可以尽可能早地开启数据传输,例如,通过用于请求启动数据传输的报文携带数据、或者发送用于请求启动数据传输的报文后,或者接收到第二设备发送的确认启动数据传输的回复后等,有效降低了第一设备的首个业务数据的传输延迟,提高了数据的传输效率。
可选地,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载 所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载第二设备上用于接收所述数据的第二应用的标识。这里,所述第一应用与所述第二应用可以是相同的应用,也可以是不同的应用。
示例性地,源端口信息由第一控制报文的报文头中的源端口字段承载,目的端口信息由第一控制报文的报文头中的目的端口字段承载。
实施上述实现方式,第一控制报文的接收端可以通过第一控制报文中的源端口信息可知晓第一设备上用于发送数据的源应用,以及通过第一控制报文中的目的端口信息可知晓第二设备上用于接收数据的目的应用。
可选地,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
示例性地,序列号信息由第一控制报文的报文头中的序列号字段承载,确认序列号信息由第一控制报文的报文头中的确认序列号字段承载。
其中,发送序列号为发送端对发送的报文进行排序的编号,一般地,发送端每发送一个携带指示start(用于请求启动从发送端至接收端的数据传输)、end(用于请求终止从发送端至接收端的数据传输)或reset(用于重置单向的数据传输或重置双向的数据传输)控制原语的报文或携带新的数据的报文时,发送序列号会发生变化。当发送端对报文进行重传时,报文中承载的发送序列号保持不变。
确认序列号一般由接收端根据发送端发送的报文中承载的发送序列号获得,发送端基于接收到的报文中承载的确认序列号可以判断发送端发送的报文是否被接收端成功接收以及接收端成功接收了哪个报文。
示例性地,序列号字段的填写规则可以是:若第一设备是首次发送携带指示start或start ack(用于确认启动从接收端至发送端的数据传输)的报文,发送序列号可以从一个随机正整数开始或者也可以采用上一传输周期内发送的报文的发送序列号的最大值,每发送一个携带指示start、end或reset控制原语的报文或携带新的数据的报文,发送序列号递增1,否则发送序列号保持不变。例如,第一设备对报文进行重传时,发送序列号保持不变。可以理解,序列号字段主要是用于确定传输顺序,报文的发送序列号的变化除了可以是上述例举的以递增形式变化外,也可以是以递减形式变化,在此不作具体限定。
示例性地,确认序列号字段的填写规则可以是:当第一设备未曾从第二设备处接收过报文,确认序列号字段填写0;当第一设备历史从第二设备接收过报文,则确认序列号字段填写第一设备从第二设备接收的报文的多个连续的发送序列号中的最大值。可以理解,当第二设备历史向第一设备发送的报文未发生丢包时,第一设备在确认序列号字段填写的确认序列号也可以是第一设备最近一次从第二设备接收的报文的发送序列号。确认序列号的填写规则也可以其他可行的方式,在此不作具体限定。
实施上述实现方式,由于第一设备按序传输数据,通过序列号信息可以保证传输层上数据的有序传输,且第二设备可以通过第一控制报文中的确认序列号信息可以判断自身是否发生丢包。
一种实现方式中,所述第一传输控制选项信息承载于所述第一控制报文的选项字段,所述第一控制报文还包括选项长度信息,所述选项长度信息用于承载所述选项字段的长度。
示例性地,选项长度信息由第一控制报文的报文头中的选项长度字段承载。
实施上述实现方式,通过选项长度字段的取值可以判断选项字段是否为空。
一种实现方式中,所述选项字段还用于承载下述信息中的至少一项:
校验和选项信息,所述校验和选项信息用于承载所述第一控制报文的报文头和待发送的数据的校验和;
负载长度选项信息,所述负载长度选项信息用于承载所述第一控制报文中负载字段的长度,所述负载字段用于承载所述第一设备发送的数据;
窗口大小选项信息,所述窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的缓存空间;和
选项映射信息,所述选项映射信息用于指示所述第一传输控制选项信息、所述校验和选项信息、所述负载长度选项信息或者所述窗口大小选项信息等属于可选项的信息是否被承载于所述选项字段。
示例性地,在第一控制报文中,校验和选项信息由选项字段中的校验和选项字段承载,负载长度选项信息由选项字段中的负载长度选项字段承载,窗口大小选项信息由选项字段中的窗口大小选项字段承载,选项映射信息由选项字段中的选项映射字段承载。
示例性地,窗口大小选项信息一般由数据的接收端设置。如此,接收端可以通过窗口大小选项信息反向影响发送端数据的发送速率和/或待发送的数据的大小。
示例性地,所述选项映射信息通过比特位图的形式指示所述选项字段中承载了哪些可选项信息,其中多个比特位与多种选项信息一一对应。以传输控制选项字段为例,传输控制选项字段与选项映射字段中的第一比特位对应,当第一比特位被置位时,表示选项字段包括该传输控制选项字段。
一种实现方式中,所述向所述第二设备发送第一数据报文后,所述方法还包括:在预设时长内未接收到所述第一数据报文的响应报文时,重新发送所述第一数据报文。
实施上述实现方式,在第一设备未接收到第一数据报文的响应报文的情况下,通过重传第一数据报文,可以提高传输的可靠性。
可选地,所述向所述第二设备发送承载所述第一数据的第一数据报文后,所述方法还包括:从所述第二设备接收第一响应报文;根据所述第一响应报文中承载的确认序列号和所述第一数据报文中承载的发送序列号,确定是否重新发送所述第一数据报文。
实施上述实现方式,第一设备可以通过比较第一数据报文承载的序列号和第一响应报文承载的确认序列号判断第一设备发送的第一数据报文是否被第二设备成功接收,在第一数据报文未被第二设备成功接收的情况下,重传第一数据报文,可以提高传输的可靠性。
可选地,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的第一缓存空间;所述方法还包括:根据所述第一窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小。
示例性地,第一窗口大小选项信息由第一响应报文的报文头中的窗口大小选项字段承载。
实施上述实现方式,第一设备可以根据第二设备发送的报文中的窗口大小选项信息,对数据的传输速率和/或待发送的数据的大小进行适应性调整,有利于提高数据的传输效率以及传输的可靠性。
可选地,所述根据所述第一窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小,包括:在所述第一缓存空间小于第一预设阈值时,降低数据的发送速率和/或减小待发送的数据的大小;或者,在所述第一缓存空间大于第二预设阈值时,提高数据的发送速率和/或增大待发送的数据的大小,所述第二预设阈值大于或等于所述第一预设阈值。
实施上述实现方式,在第一缓存空间较小时,第一设备可以降低数据的发送速率和/或减少每次发送的数据的大小,使得第二设备能在一定时长内对存储资源中已接收的数据进行清除以增加存储资源中可用于接收数据的缓存空间,有利于提高传输的可靠性,减少丢包。在第一缓存空间充足时,第一设备可以提高自身数据的发送速率和/或每次发送的数据的大小,如此,提高了数据的传输效率。
可选地,所述根据所述第一窗口大小选项信息,调整数据的发送速率,包括:在所述第一缓存空间小于第三预设阈值时,暂停向所述第二设备发送数据;所述方法还包括:从所述第二设备接收第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间;当所述第二响应报文承载的发送序列号大于或等于所述第一响应报文的发送序列号,且所述第二缓存空间不小于所述第三预设阈值时,继续向所述第二设备发送数据。
其中,第三预设阈值小于第一预设阈值。
这里,第二响应报文中承载的发送序列号大于或等于第一响应报文中承载的发送序列号说明第二响应报文携带了指示start、end和reset中任一项控制原语或携带了第二设备侧的数据。
示例性地,为了提高传输的可靠性,第二响应报文可以被第二设备发送多次。第一设备接收到第二响应报文时,若第二响应报文承载的发送序列号大于或等于第一响应报文的发送序列号,则第一设备需对第二响应报文进行相应处理,不可认为是重复报文而丢弃。
示例性地,为了提高传输的可靠性,数据报文的响应报文可以被第二设备发送多次。第一设备接收到响应报文时,若响应报文承载的发送序列号大于或等于本传输周期内从第二设备接收到报文的最大发送序列号,且响应报文携带上述选项字段时,第一设备需对该响应报文进行相应处理,不可认为是重复报文而丢弃。这里,选项字段包括上述各选项信息中的至少一项。
实施上述实现方式,当第一缓存空间小于第三预设阈值时,说明第二设备配置的资源中可用于从第一设备接收数据的缓存空间严重不足,在此情况下,第一设备可以主动暂停向第二设备传输数据,待第二设备配置的资源中可用于从第一设备接收数据的缓存空间充足时,第一设备再继续向第二设备传输数据。如此,可以减少丢包。
可选地,所述方法还包括:向所述第二设备发送第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输;从所述第二设备接收第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
实施上述实现方式,第一设备接收到第二设备对请求终止从第一设备至第二设备的数据传输的确认回复后,第一设备确定从第一设备至第二设备的数据传输结束。
可选地,所述第一设备被配置有第一状态机,所述第一状态机被配置为:当所述第一设备处于初始状态时,响应于开始发送数据事件,所述第一设备被由所述初始状态切换为等待开始应答状态,以及所述第一设备执行向所述第二设备发送所述第一控制报文的动作。
这里,初始状态表示未启动从第一设备至第二设备的数据传输,即第一设备未向第二设备请求启动从第一设备至第二设备的数据传输。
等待开始应答状态表示第一设备等待第二设备回复确认启动从第一设备至第二设备的数据传输。
这里,开始发送数据事件是指第一设备有向第二设备传输数据的需求。
实施上述实现方式,在启动单向的数据传输时,第一设备可以通过第一状态机管理第一设备作为数据的发送端时的通信连接状态。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述等待开始应答状态,响应于接收到所述第二控制报文的事件,所述第一设备被由所述等待开始应答状态切换为发送数据状态。
这里,发送数据状态表示第一设备知晓从第一设备至第二设备的数据传输已成功启动。在此状态下,第一设备可以按序向第二设备传输数据。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述发送数据状态,响应于结束发送数据事件,所述第一设备被由所述发送数据状态切换为等待结束应答状态,以及所述第一设备执行向所述第二设备发送第三控制报文的动作,其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输。
这里,结束发送数据事件是指第一设备完成了最后一个数据的传输且第一设备在本传输周期内不再向第二设备发送数据。
等待结束应答状态表示第一设备等待第二设备回复确认终止从第一设备至第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述等待结束应答状态,响应于接收到第四控制报文的事件,所述第一设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第六控制报文的动作;其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
示例性地,本地故障事件包括下层协议(例如,网络层协议或者数据链路层协议)断开事件、数据传输失败事件等中的至少一项。
这里,重置状态表示第一设备重置从第一设备至第二设备的数据传输。
可以看出,当第一设备需要重置从第一设备至第二设备的数据传输时,第二设备也需要重置从第一设备至第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
完成重置事件是指第一设备本地已完成重置操作。
可选地,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;所述从所述第二设备接收第二控制报文之后,所述方法还包括:所述第一设备配置用于 从所述第二设备接收数据的资源;所述第一设备向所述第二设备发送第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
其中,从第二设备至第一设备的数据传输是基于单向的第二通信连接执行的。这里,第二通信连接为从第二设备向第一设备传输数据的通信连接。
实施上述实现方式,第二控制报文不仅实现对第一设备请求启动数据传输的确认回复,也实现向第一设备请求启动从第二设备至第一设备的数据传输,如此,第一设备与第二设备之间基于两个独立的单向连接,启动了双向的数据传输,有利于提高数据传输的效率。
示例性地,第二设备对第一设备请求启动数据传输的确认回复,和第二设备提出的启动从第二设备至第一设备的数据传输的请求,也可以不通过一个报文合并发送,即通过两个报文分别发送。例如,若第一设备有向第二设备传输数据的需求,但第二设备当前没有向第一设备传输数据的需求,在此情况下,第一设备先接收到第二设备对请求启动从第一设备至第二设备的数据传输的确认回复。待第二设备有向第一设备传输数据的需求时,第一设备再接收到第二设备发送的请求启动从第二设备至第一设备的数据传输的报文。
可选地,所述向所述第二设备发送第七控制报文后,所述方法还包括:从所述第二设备接收第二数据报文,所述第二数据报文承载第二数据;向所述第二设备发送第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
示例性地,第一设备从第二设备接收第二数据的时机不限制于在第一设备向第二设备发送第七控制报文之后,第一设备从第二设备接收第二数据的时机也可以更早,例如,第二数据携带于第二控制报文中,或者,在第一设备向第二设备发送第七控制报文之前第一设备从第二设备接收第二数据报文,在此不作具体限定。
可以看出,第三数据报文不仅是对第二数据报文的确认回复,第三数据报文还携带了新的数据,如此,可以节省带宽的消耗。
可选地,所述方法还包括:从所述第二设备接收第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;基于所述第八控制报文释放所述第一设备中用于从所述第二设备接收数据配置的资源;向所述第二设备发送第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
实施上述实现方式,第一设备接收到第二设备发出的请求终止从第二设备至第一设备的数据传输的报文后,第一设备释放本地为从第二设备接收数据分配的资源,以及向第二设备发送对该请求终止数据传输的确认回复,如此,结束了从第二设备至第一设备的数据传输。
可选地,所述第一设备被配置有第二状态机,所述第二状态机被配置为:当所述第一设备处于初始状态时,响应于接收到所述第二控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第一设备执行向所述第二设备发送所述第七控制报文的动作。
这里,初始状态表示未启动从第二设备至第一设备的数据传输。
接收数据状态表示第一设备完成配置用于从第二设备接收数据的资源并等待接收第二设备传输的数据。
实施上述实现方式,在启动双向的数据传输时,通过在第一设备内配置两个独立的状态机(第一状态机和第二状态机),同一设备作为发送端时连接状态的管理和该设备作为接收端时连接状态的管理是独立解耦的,例如,第一设备作为数据的发送端时通过上述第一状态机维护通信连接状态,第一设备作为数据的接收端时通过第二状态机维护通信连接状态,能够有效简化设备对通信连接状态的管理。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述接收数据状态,响应于接收到第八控制报文的事件,所述第一设备被由所述接收数据状态切换为待结束状态,以及所述第一设备执行释放本地的所述存储资源以及向所述第二设备发送第九控制报文的动作,其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
这里,待结束状态表示第一设备释放第一设备中用于从第二设备接收数据配置的资源,即结束从第二设备接收数据。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述待结束状态,响应于完成结束事件,所述第一设备被由所述待结束状态切换为所述初始状态。
这里,完成结束事件是指第一设备释放配置的用于从第二设备接收数据的资源结束。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第十控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第十一控制报文的动作;其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
这里,本地故障事件包括下层协议(例如,网络层协议或者数据链路层协议)断开事件、报文发送失败事件等中的至少一项。
重置状态表示第一设备重置从第二设备至第一设备的数据传输。
可以看出,当第一设备需要重置从第二设备至第一设备的数据传输时,第二设备也需要重置从第二设备至第一设备的数据传输。
可选地,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
实施上述实现方式,第一设备可以通过第十一传输控制选项信息实现双向的数据传输的重置。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
这里,完成重置事件是指第一设备本地已完成重置操作。
第二方面,本申请提供了一种通信方法,该方法应用于第二设备,该方法包括:从第一设备接收第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;配置用于从所述第一设备接收数据的资源,以及向所述第一设备发送第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;在未从所述第一设备接收所述第二控制报文的响应报文的情况下,从所述第一设备接收第一数据。
其中,第二设备例如可以是手持终端、车辆、车载设备、或网络侧设备、用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、无线通信设备、用户代理或用户装置等设备,也可以为任一可能的智能终端设备(如手机)、智能运输设备(如车辆、无人机等)、智能制造设备、智能家居设备(例如大屏、音箱等)等,还可以是上述电子设备内的组件(例如芯片或集成电路等)。
示例性地,第一传输控制选项信息由第一控制报文的报文头中的传输控制选项字段承载。该传输控制选项字段可以通过比特映射、二进制取值或其他方式来承载第一传输控制选项信息。相应地,第二传输控制选项信息由第二控制报文的报文头中的传输控制选项字段承载。
上述方法中,第二设备基于第一设备发送的启动从第一设备至第二设备的数据传输的请求为第一设备分配存储资源,并向第一设备发送对该请求的确认回复,即实现了单向的数据传输的启动。另外,未接收第一设备发送的对该确认回复的确认应答,就能从第一设备接收数据,有利于提高数据的传输效率。
可选地,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。此特征的技术效果可参考上述第一方面相应特征的技术效果的叙述,在此不再赘述。
可选地,所述在未从所述第一设备接收所述第二控制报文的响应报文的情况下,从所述第一设备接收第一数据,包括下述任一情况:通过所述第一控制报文承载所述第一数据;在接收所述第一控制报文之后且发送所述第二控制报文之前,从所述第一设备接收承载所述第一数据的第一数据报文;或在发送所述第二控制报文之后,从所述第一设备接收承载所述第一数据的第一数据报文。
相较于现有技术要求通信双方通过三次握手建立了通信连接后接收端才可接收到对端传输的数据,在本申请中,第二设备不仅无需执行现有技术中的第三次握手,还能更早地从第一设备接收数据,提高了数据的传输效率。
可选地,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载 所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
可选地,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
一种实现方式中,所述第一传输控制选项信息承载于所述第一控制报文的选项字段,所述第一控制报文还包括选项长度信息,所述选项长度信息用于承载所述选项字段的长度。
一种实现方式中,所述选项字段还用于承载下述信息中的至少一项:
校验和选项信息,所述校验和选项信息用于承载所述第一控制报文的报文头和待发送的数据的校验和;
负载长度选项信息,所述负载长度选项信息用于承载所述第一控制报文中负载字段的长度,所述负载字段用于承载所述第一设备发送的数据;
窗口大小选项信息,所述窗口大小选项信息用于承载所述第二设备配置的资源中可用于从第一设备接收数据的资源;和
选项映射信息,所述选项映射信息用于指示所述第一传输控制选项信息、所述校验和选项信息、所述负载长度选项信息或者所述窗口大小选项信息等属于可选项的信息是否被承载于所述选项字段。
上述第一控制报文中各字段的技术效果具体可参考第一方面中第一控制报文中相应字段的描述,在此不再赘述。
可选地,从所述第一设备接收承载所述第一数据的第一数据报文后,所述方法还包括:向所述第一设备发送第一响应报文,所述第一响应报文中承载的确认序列号为所述第一数据报文中承载的发送序列号。
实施上述实现方式,第二设备从第一设备接收到数据报文后,向第一设备发送该数据报文的确认回复,如此第一设备可以基于该确认回复确定第二设备成功接收到该数据报文。
可选地,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第一缓存空间,所述第一窗口大小选项信息用于所述第二设备反向调整所述第一设备发送数据的速率和/或调整待发送的数据的大小。
实施上述实现方式,第二设备可以通过在报文中携带窗口大小选项信息使得第一设备对数据的传输速率和/或待发送的数据的大小进行适应性调整。
可选地,当检测到所述第一缓存空间小于第一预警值时,所述第一响应报文还包括所述第一窗口大小选项信息。
实施上述实现方式,第二设备检测到本地配置的资源中可用于从第一设备接收数据的缓存空间不足时,可以通过在报文中携带窗口大小选项信息以提示第一设备进行相应调整。
可选地,所述方法还包括:对所述存储资源内已接收的数据进行清除;当检测到所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间大于第二预警值时,向所述第一设备发送至少一次第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息用于承载所述第二缓存空间,所述第二预警值大于或等于所述第一预警值。
实施上述实现方式,第二设备检测到为本地配置的资源中可用于从第一设备接收数据的缓存空间恢复充足时,也可以通过在报文中携带窗口大小选项信息以提示第一设备进行相应调整。为了提高传输的可靠性,携带窗口大小选项信息的报文可以被第二设备发送多次。
可选地,所述方法还包括:从所述第一设备接收第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;基于所述第三控制报文释放所述第二设备中用于从所述第一设备接收数据配置的资源;向所述第一设备发送第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
实施上述实现方式,第二设备基于从第一设备接收到的终止从第一设备至第二设备的数据传输的请求,释放本地配置的用于从第一设备接收数据的资源,并向第一设备发送确认回复以告知第一设备。
可选地,所述第一设备被配置有第一状态机,所述第一状态机被配置为:当所述第一设备处于初始状态时,响应于接收到所述第一控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第二设备执行向所述第一设备发送所述第二控制报文的动作。
这里,初始状态表示第二设备未启动从第一设备至第二设备的数据传输。
接收数据状态表示第二设备完成配置用于从第一设备接收数据的资源并等待接收第一设备传输的数据。
实施上述实现方式,在启动单向的数据传输时,第二设备可以通过第一状态机管理第二设备作为数据的接收端时的通信连接状态。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述接收数据状态,响应于接收到第三控制报文的事件,所述第二设备被由所述接收数据状态切换为待结束状态,以及所述第二设备执行释放所述第二设备中用于从所述第一设备接收数据配置的资源以及向所述第一设备发送第四控制报文的动作,其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
这里,待结束状态表示第二设备释放为第二设备中用于从第一设备接收数据配置的资源,即结束从第一设备接收数据。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述待结束状态,响应于完成结束事件,所述第二设备被由所述待结束状态切换为所述初始状态。
这里,完成结束事件是指第二设备释放配置的用于从第一设备接收数据的资源结束。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第六控制报文的动作;其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
这里,重置状态表示第二设备重置从第一设备至第二设备的数据传输。
本地故障事件包括下层协议(例如,网络层协议或者数据链路层协议)断开事件、报文发送失败事件等中的至少一项。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
这里,完成重置事件是指第二设备本地已完成重置操作。
可选地,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;所述向所述第一设备发送第二控制报文之后,所述方法还包括:从所述第一设备接收第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
实施上述实现方式,第二控制报文不仅实现对第一设备请求启动数据传输的确认回复,也实现向第一设备请求启动从第二设备至第一设备的数据传输,如此,第一设备与第二设备之间基于两个独立的单向连接,启动了双向的数据传输,有利于提高数据传输的效率。
示例性地,第二设备对第一设备请求启动数据传输的确认回复,和第二设备提出的启动从第二设备至第一设备的数据传输的请求,也可以不通过一个报文合并发送,即通过两个报文分别发送。例如,若第一设备有向第二设备传输数据的需求,但第二设备当前没有向第一设备传输数据的需求,在此情况下,第二设备可以先向第一设备发送对请求启动从第一设备至第二设备的数据传输的确认回复。待第二设备有向第一设备传输数据的需求时,第二设备再向第一设备发送请求启动从第二设备至第一设备的数据传输的报文。
可选地,所述方法还包括:向所述第一设备发送第二数据报文,所述第二数据报文承载所述第二数据;从所述第一设备接收第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
可以看出,第三数据报文不仅是对第二数据报文的确认回复,第三数据报文还携带了新的数据,如此,可以节省带宽的消耗。
示例性地,第二设备向第一设备发送第二数据的时机可以是:通过第二控制报文承载第二数据,或者在从第一设备接收第七控制报文之前第二设备向第一设备发送第二数据报文,或者在从第一设备接收第七报文之后第二设备向第一设备发送第二数据报文。
可选地,所述方法还包括:向所述第一设备发送第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;从所述第一设备接收第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
实施上述实现方式,第二设备接收到第一设备对请求终止从第二设备至第一设备的数据传输的确认回复后,第二设备可知晓从第二设备至第一设备的数据传输结束。
可选地,所述第二设备被配置有第二状态机,所述第二状态机被配置为:当所述第二设备处于初始状态时,响应于开始发送数据事件,所述第二设备被由所述初始状态切换为等待开始应答状态,以及所述第二设备执行向所述第二设备发送所述第二控制报文的动作。
这里,初始状态表示未启动从第二设备至第一设备的数据传输。
等待开始应答状态表示及第二设备等待第一设备回复确认启动从第二设备至第一设备的数据传输。
这里,开始发送数据事件是指第二设备有向第一设备传输数据的需求。
实施上述实现方式,在启动双向的数据传输时,通过在第二设备内配置两个独立的状态机(第一状态机和第二状态机),同一设备作为发送端时连接状态的管理和该设备作为接收端时连接状态的管理是独立解耦的,例如,第二设备作为数据的接收端时通过第一状态机维护通信连接状态,第二设备作为数据的发送端时通过第二状态机维护通信连接状态,能够有效简化设备对通信连接状态的管理。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述等待开始应答状态,响应于接收到所述第七控制报文的事件,所述第二设备被由所述等待开始应答状态切换为发送数据状态。
这里,发送数据状态表示第二设备知晓从第二设备至第一设备的数据传输已成功启动。在此状态下,第二设备可以按序向第一设备传输数据。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述发送数据状态,响应于结束发送数据事件,所述第二设备被由所述发送数据状态切换为等待结束应答状态,以及所述第二设备执行向所述第一设备发送第八控制报文的动作,其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输。
这里,结束发送数据事件是指第二设备完成了最后一个数据的传输且第二设备在本传输周期内不再向第一设备发送数据。
等待结束应答状态表示第二设备等待第一设备回复确认终止从第二设备至第一设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述等待结束应答状态,响应于接收到第九控制报文的事件,所述第二设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第一设备发送的第十控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第十一控制报文的动作;其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
示例性地,本地故障事件包括下层协议(例如,网络层协议或者数据链路层协议)断开事件、数据传输失败事件等中的至少一项。
这里,重置状态表示第二设备重置从第二设备至第一设备的数据传输。
可以看出,当第二设备需要重置从第二设备至第一设备的数据传输时,第一设备也需要重置从第二设备至第一设备的数据传输。
可选地,所述第十一传输控制选项信息还用于重置所述从第一设备至第二设备的数据传输。
实施上述实现方式,第二设备可以通过第十一传输控制选项信息实现双向的数据传输的重置。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
这里,完成重置事件是指第二设备本地已完成重置操作。
第三方面,本申请提供了一种通信装置,所述装置为第一设备或者所述装置包含于第一设备中,所述装置包括:发送单元,用于向第二设备发送第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;接收单元,用于从所述第二设备接收第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;所述发送单元,还用于在未向所述第二设备发送所述第二控制报文的响应报文的情况下,向所述第二设备发送第一数据。
可选地,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。
可选地,所述发送单元具体用于:通过所述第一控制报文承载所述第一数据;在发送所述第一控制报文之后且接收所述第二控制报文之前,向所述第二设备发送承载所述第一数据的第一数据报文;或在接收所述第二控制报文之后,向所述第二设备发送承载所述第一数据的第一数据报文。
可选地,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
可选地,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
一种实现方式中,所述第一传输控制选项信息承载于所述第一控制报文的选项字段,所述第一控制报文还包括选项长度信息,所述选项长度信息用于承载所述选项字段的长度。
一种实现方式中,所述选项字段还用于承载下述信息中的至少一项:
校验和选项信息,所述校验和选项信息用于承载所述第一控制报文的报文头和待发送的数据的校验和;
负载长度选项信息,所述负载长度选项信息用于承载所述第一控制报文中负载字段的长度,所述负载字段用于承载所述第一设备发送的数据;
窗口大小选项信息,所述窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的资源;和
选项映射信息,所述选项映射信息用于指示所述第一传输控制选项信息、所述校验和选项信息、所述负载长度选项信息或者所述窗口大小选项信息等属于可选项的信息是否被承载于所述选项字段。
一种实现方式中,所述发送单元还用于:在预设时长内未接收到所述第一数据报文的响应报文时,重新发送所述第一数据报文。
可选地,所述接收单元还用于:从所述第二设备接收第一响应报文;所述装置还包括处理单元,用于根据所述第一响应报文中承载的确认序列号和所述第一数据报文中承载的发送序列号,确定是否重新发送所述第一数据报文。
可选地,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的第一缓存空间;所述处理单元还用于:根据所述第一窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小。
可选地,所述处理单元具体用于:在所述第一缓存空间小于第一预设阈值时,降低数据的发送速率和/或减小待发送的数据的大小;或者,在所述第一缓存空间大于第二预设阈值时,提高数据的发送速率和/或增大待发送的数据的大小,所述第二预设阈值大于或等于所述第一预设阈值。
可选地,所述发送单元还用于:在所述第一缓存空间小于第三预设阈值时,暂停向所述第二设备发送数据;所述接收单元还用于:从所述第二设备接收第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间;所述发送单元还用于:当所述第二响应报文中承载的发送序列号大于或等于所述第一响应报文中承载的发送序列号,且所述第二缓存空间不小于所述第三预设阈值时,继续向所述第二设备发送数据。
可选地,所述发送单元还用于:向所述第二设备发送第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输;所述接收单元还用于从所述第二设备接收第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第二设备向所述第一设备的数据传输。
可选地,所述第一设备被配置有第一状态机,所述第一状态机被配置为:当所述第一设备处于初始状态时,响应于开始发送数据事件,所述第一设备被由所述初始状态切换为等待开始应答状态,以及所述第一设备执行向所述第二设备发送所述第一控制报文的动作。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述等待开始应答状态,响应于接收到所述第二控制报文的事件,所述第一设备被由所述等待开始应答状态切换为发送数据状态。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述发送数据状态,响应于结束发送数据事件,所述第一设备被由所述发送数据状态切换为等待结束应答状态,以及所述第一设备执行向所述第二设备发送第三控制报文的动作,其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述等待结束应答状态,响应于接收到第四控制报文的事件,所述第一设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第六控制报文的动作;其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
可选地,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;所述处理单元还用于:配置用于从所述第二设备接收数据的资源;所述发送单元还用于:向所述第二设备发送第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
可选地,所述接收单元还用于:从所述第二设备接收第二数据报文,所述第二数据报文承载第二数据;所述发送单元还用于向所述第二设备发送第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
可选地,所述接收单元还用于:从所述第二设备接收第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;所述发送单元还用于:基于所述第八控制报文释放所述第一设备中用于从所述第二设备接收数据配置的资源;向所述第二设备发送第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
可选地,所述第一设备被配置有第二状态机,所述第二状态机被配置为:当所述第一设备处于初始状态时,响应于接收到所述第二控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第一设备执行向所述第二设备发送所述第七控制报文的动作。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述接收数据状态,响应于接收到第八控制报文的事件,所述第一设备被由所述接收数据状态切换为待结束状态,以及所述第一设备执行释放所述第一设备中用于从所述第二设备接收数据配置的资源以及向所述第二设备发送第九控制报文的动作,其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述待结束状态,响应于完成结束事件,所述第一设备被由所述待结束状态切换为所述初始状态。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第十控制报文的事件,所述第一设备被切换为重置状态, 以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第十一控制报文的动作;其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
可选地,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
第四方面,本申请提供了一种通信装置,所述装置为第二设备或者所述装置包含于第二设备中,所述装置包括:接收单元,用于从第一设备接收第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;处理单元,用于配置用于从所述第一设备接收数据的资源;以及发送单元,用于向所述第一设备发送第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;所述发送单元还用于在未从所述第一设备接收所述第二控制报文的响应报文的情况下,从所述第一设备接收第一数据。
可选地,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。
可选地,所述接收单元具体用于:通过所述第一控制报文承载所述第一数据;在接收所述第一控制报文之后且发送所述第二控制报文之前,从所述第一设备接收承载所述第一数据的第一数据报文;或在发送所述第二控制报文之后,从所述第一设备接收承载所述第一数据的第一数据报文。
可选地,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
可选地,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
一种实现方式中,所述第一传输控制选项信息承载于所述第一控制报文的选项字段,所述第一控制报文还包括选项长度信息,所述选项长度信息用于承载所述选项字段的长度。
一种实现方式中,所述选项字段还用于承载下述信息中的至少一项:
校验和选项信息,所述校验和选项信息用于承载所述第一控制报文的报文头和待发送的数据的校验和;
负载长度选项信息,所述负载长度选项信息用于承载所述第一控制报文中负载字段的长度,所述负载字段用于承载所述第一设备发送的数据;
窗口大小选项信息,所述窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的资源;和
选项映射信息,所述选项映射信息用于指示所述第一传输控制选项信息、所述校验和选项信息、所述负载长度选项信息或者所述窗口大小选项信息等属于可选项的信息是否被承载于所述选项字段。
可选地,所述发送单元还用于向所述第一设备发送第一响应报文,所述第一响应报文中承载的确认序列号为所述第一数据报文中承载的发送序列号。
可选地,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第一缓存空间,所述第一窗口大小选项信息用于所述第二设备反向调整所述第一设备发送数据的速率和/或调整待发送的数据的大小。
可选地,当检测到所述第一缓存空间小于第一预警值时,所述第一响应报文还包括所述第一窗口大小选项信息。
可选地,所述处理单元还用于对所述第二设备配置的所述资源中已接收的数据进行清除;所述发送单元还用于:当检测到所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间大于第二预警值时,向所述第一设备发送至少一次第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息用于承载所述第二缓存空间,所述第二预警值大于或等于所述第一预警值。
可选地,所述接收单元还用于从所述第一设备接收第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;所述处理单元还用于基于所述第三控制报文释放所述第二设备中用于从所述第一设备接收数据配置的资源;所述 发送单元还用于向所述第一设备发送第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
可选地,所述第一设备被配置有第一状态机,所述第一状态机被配置为:当所述第一设备处于初始状态时,响应于接收到所述第一控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第二设备执行向所述第一设备发送所述第二控制报文的动作。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述接收数据状态,响应于接收到第三控制报文的事件,所述第二设备被由所述接收数据状态切换为待结束状态,以及所述第二设备执行释放所述第二设备中用于从所述第一设备接收数据配置的资源以及向所述第一设备发送第四控制报文的动作,其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述待结束状态,响应于完成结束事件,所述第二设备被由所述待结束状态切换为所述初始状态。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第六控制报文的动作;其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
可选地,所述第一状态机还被配置为:当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
可选地,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;所述接收单元还用于:从所述第一设备接收第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
可选地,所述发送单元还用于向所述第一设备发送第二数据报文,所述第二数据报文承载所述第二数据;所述接收单元还用于从所述第一设备接收第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
可选地,所述发送单元还用于向所述第一设备发送第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;所述接收单元还用于从所述第一设备接收第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
可选地,所述第二设备被配置有第二状态机,所述第二状态机被配置为:当所述第二设备处于初始状态时,响应于开始发送数据事件,所述第二设备被由所述初始状态切换为等待开始应答状态,以及所述第二设备执行向所述第二设备发送所述第二控制报文的动作。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述等待开始应答状态,响应于接收到所述第七控制报文的事件,所述第二设备被由所述等待开始应答状态切换为发送数据状态。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述发送数据状态,响应于结束发送数据事件,所述第二设备被由所述发送数据状态切换为等待结束应答状态,以及所述第二设备执行向所述第一设备发送第八控制报文的动作,其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述等待结束应答状态,响应于接收到第九控制报文的事件,所述第二设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第一设备发送的第十控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二 设备还执行向所述第一设备发送第十一控制报文的动作;其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
可选地,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
可选地,所述第二状态机还被配置为:当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
第五方面,本申请提供了一种通信装置,该装置包括处理器和存储器,其中,存储器用于存储程序指令;所述处理器调用所述存储器中的程序指令,使得装置执行第一方面或者第一方面的任一可能的实现方式中的方法,或者使得装置执行第二方面或者第二方面的任一可能的实现方式中的方法。
第六方面,本申请提供了一种计算机可读存储介质,包括计算机指令,当所述计算机指令在被处理器运行时,实现上述第一方面或者第一方面的任一可能的实现方式中的方法,或者实现上述第二方面或者第二方面的任一可能的实现方式中的方法。
第七方面,本申请提供了一种计算机程序产品,当该计算机程序产品被处理器执行时,实现上述第一方面或者第一方面的任一可能的是实现方式中的所述方法,或者实现上述第二方面或者第二方面的任一可能的是实现方式中的所述方法。
示例性地,该计算机程序产品可以为一个软件安装包。
第八方面,本申请提供了一种车辆,该车辆包括第一装置或第二装置,其中,第一装置为上述第三方面或第三方面的任一可能的实现方式的装置,或者为上述第五方面的装置;第二装置为上述第四方面或第四方面的任一可能的实现方式的装置,或者为上述第五方面的装置。
第九方面,本申请提供了一种终端,该终端包括第一装置或第二装置,其中,第一装置为上述第三方面或第三方面的任一可能的实现方式的装置,或者为上述第五方面的装置;第二装置为上述第四方面或第四方面的任一可能的实现方式的装置,或者为上述第五方面的装置。
其中,该终端的举例包括但不限于:智能家居设备(诸如电视、扫地机器人、智能台灯、音响系统、智能照明系统、电器控制系统、家庭背景音乐、家庭影院系统、对讲系统、视频监控等)、智能运输设备(诸如汽车、轮船、无人机、火车、货车、卡车等)、智能制造设备(诸如机器人、工业设备、智能物流、智能工厂等)、智能终端(手机、计算机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备、虚拟现实设备、增强现实设备等)。
附图说明
图1是本申请实施例提供的一种系统架构的示意图;
图2是本申请实施例提供的一种报文头的格式示意图;
图3A是本申请实施例提供的一种选项字段的格式示意图;
图3B是本申请实施例提供的一种选项字段的格式示意图;
图4是本申请实施例提供的一种通信方法的流程图;
图5A是本申请实施例提供的一种发送端上配置的状态机的状态示意图;
图5B是本申请实施例提供的一种接收端上配置的状态机的状态示意图;
图6是本申请实施例提供的又一种通信方法的流程图;
图7是本申请实施例提供的又一种通信方法的流程图;
图8是本申请实施例提供的又一种通信方法的流程图;
图9A是本申请实施例提供的一种通信装置的结构示意图;
图9B是本申请实施例提供的一种通信装置的结构示意图;
图10是本申请实施例提供的一种通信设备的结构示意图。
具体实施方式
需要说明的是,本申请中采用诸如“第一”、“第二”的前缀词,仅仅为了区分不同的描述对象,对被描述对象的位置、顺序、优先级、数量或内容等没有任何限定作用。例如,被描述对象为“字段”,则“第一字 段”和“第二字段”中“字段”之前的序数词并不限制“字段”之间的位置或顺序,“第一”和“第二”并不限制其修饰的“字段”是否在同一个消息中,也不限制“第一字段”和“第二字段”的先后顺序。再如,被描述对象为“等级”,则“第一等级”和“第二等级”中“等级”之前的序数词并不限制“等级”之间的优先级。再如,被描述对象的数量并不受前缀词的限制,可以是一个或者多个,以“第一设备”为例,其中“设备”的数量可以是一个或者多个。此外,不同前缀词修饰的对象可以相同或不同,例如,被描述对象为“设备”,则“第一设备”和“第二设备”可以是同一个设备、相同类型的设备或者不同类型的设备;再如,被描述对象为“信息”,则“第一信息”和“第二信息”可以是相同内容的信息或者不同内容的信息。总之,本申请实施例中对用于区分描述对象的前缀词的使用不构成对所描述对象的限制,对所描述对象的陈述参见权利要求或实施例中上下文的描述,不应因为使用这种前缀词而构成多余的限制。
需要说明的是,本申请实施例中采用诸如“a1、a2、……和an中的至少一项(或至少一个)”等的描述方式,包括了a1、a2、……和an中任意一个单独存在的情况,也包括了a1、a2、……和an中任意多个的任意组合情况,每种情况可以单独存在。例如,“a、b和c中的至少一项”的描述方式,包括了单独a、单独b、单独c、a和b组合、a和c组合、b和c组合,或abc三者组合的情况。
下面将结合附图,对本申请实施例中的技术方案进行描述。
参见图1,图1示例性地给出了一种系统架构图。该系统用于实现通信。如图1所示,该系统包括第一设备和第二设备,其中,第一设备与第二设备可以通过有线或无线的方式进行通信。
第一设备或第二设备可以是具有通信能力的电子设备,例如手持终端、车辆、车载设备、或网络侧设备、用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、无线通信设备、用户代理或用户装置等设备,也可以为任一可能的智能终端设备(如手机)、智能运输设备(如车辆、无人机等)、智能制造设备、智能家居设备(例如大屏、音箱等)等,还可以是上述电子设备内的组件(例如芯片或集成电路等)。
以第一设备为例,当第一设备为车载设备时,可以是汽车座舱(cockpit domain)设备,或者汽车座舱设备中的一个模块,例如座舱域控制器(cockpit domain controller,CDC)、摄像头、屏幕、麦克风、音响、电子钥匙、无钥匙进入或启动系统控制器等模块中的一个或者多个。在车辆内,第一设备还可以为电池管理系统(battery management system,BMS)、BMS中的电池控制单元(battery control unit,BCU)、BMS中的电池监控单元(battery monitoring unit,BMU)或电池包中的电池。
例如,当第一设备为手持终端时,其可以是手机(mobile phone)、可穿戴设备、平板电脑(pad)、或带数据收发功能的电脑(如笔记本电脑、掌上电脑等)等。
示例性地,当第一设备有向第二设备发送业务数据的需求时,第一设备可以向第二设备请求启动从第一设备至第二设备的数据传输,在第一设备接收到第二设备发送的确认启动该数据传输的确认回复后,第一设备确定从第一设备至第二设备的数据传输已启动。为了提高数据的传输效率,例如第一设备可以在请求启动数据传输的过程中向第二设备传输数据。可以理解,这里只是对第一设备与第二设备之间一种单向的通信连接的简要说明,具体过程可参考下述方法实施例的相关叙述,但并申请实施例并不限定数据传输仅为从第一设备至第二设备这一传输方向,也可以是从第二设备至第一设备这一传输方向。另外,第一设备与第二设备之间的通信也可以是双向的通信,具体可参考下述方法实施例的相关叙述,在此不再赘述。
图1所示的通信系统可以应用于多种应用场景中,例如以下应用场景:移动互联网(mobile internet,MI)、工业控制(industrial control)、无人驾驶(self driving)、运输安全(transportation safety)、物联网(internet of things,IoT)、智慧城市(smart city)、或智慧家庭(smart home)等。
图1所示的通信系统可以应用于多种网络类型中,例如应用于以下一种或者多种网络类型中:星闪(SparkLink)、长期演进(long term evolution,LTE)网络、第五代移动通信技术(5th generation mobile communication technology,5G)、无线局域网(例如,Wi-Fi)、蓝牙(bluetooth,BT)、紫峰(Zigbee)、或车载短距无线通信网络等。
可以理解,上述设备是对具有通信能力的电子设备的一种称呼。在某些应用场景、或某些网络类型中,具备类似通信能力的设备的名称也可能不称为设备,例如,称作网络设备或节点,在此不作具体限定。
需要说明的是,图1仅为示例性架构图,但不限定图1所示系统包括的网元的数量。虽然图1未示出,但除图1所示的功能实体外,图1还可以包括其他功能实体。另外,本申请实施例提供的方法可以应用于图1所示的通信系统,当然本申请实施例提供的方法也可以适用其他通信系统,本申请实施例对此不予限 制。
为了实现第一设备与第二设备之间的信息传输能够满足高效、低开销、低延迟和高可靠中的至少一项,本申请实施例定义了一种用于传输层的报文头。示例性地,该报文头也可以称作传输层报文头,或者轻量连接模式传输协议(light weightconnection mode transport protocol,LWCTP)头。
在本申请实施例中,LWCTP头可支持运行在通信网络的网络层或数据链路层之上。这里,通信网络例如可以是星闪网络、网络互联协议(Internet Protocol,IP)网络或其他类型的网络,在此不作具体限定。
示例性地,星闪网络中使用的地址是星闪网络地址,星闪网络地址是一种网络层短地址,其长度可以是2个字节(即16比特),可以用于在星闪网络内寻址。可以理解,星闪网络地址是区别于IP地址的另一种地址类型。
例如,通信网络为星闪网络,LWCTP头可支持运行在星闪网络层上,即LWCTP头封装于星闪网络层帧头中;LWCTP头也可支持运行在星闪基础服务层上,即LWCTP头封装于星闪基础服务层帧头中。
又例如,通信网络可以是IP网络,LWCTP头可支持运行在IP网络的网络层上,即LWCTP头封装于IP头中。其中,IP头例如可以是IPv4头或者IPv6头。
下面基于图2具体介绍本申请实施例提供的LWCTP头,图2是本申请实施例提供的一种LWCTP头的格式示意图:
在本申请实施例中,LWCTP头既可以应用于两个设备间建立通信连接,也可以用于两个设备间信息的传输。
在本申请实施例中,LWCTP定义的用于建立通信连接的控制原语承载于LWCTP头的传输控制选项字段(transport control option)。其中,传输控制选项字段包含于图2所示的选项(option)字段中,选项字段用于承载LWCTP头中可选的字段。这里,传输控制选项字段相当于选项字段中的一个子选项字段。
例如,本申请实施例基于建立通信连接的过程定义了五个控制原语,分别为:
(1)开始start:指示发送端请求启动从发送端至接收端的数据传输(一个传输方向);
(2)开始应答start ack:指示接收端确认启动从发送端至接收端的数据传输;
(3)结束end:指示发送端请求终止从发送端至接收端的数据传输;
(4)结束应答end ack:指示接收端确认终止从发送端至接收端的数据传输;
(5)重置reset:指示重置从发送端至接收端的数据传输,或者可以重置发送端和接收端之间双向的数据传输。
可以理解,发送端发送携带指示start控制原语的报文,即意味着开启数据传输在一个传输方向上的传输周期;该发送端接收到携带指示start ack控制原语的报文,表示单向(从发送端至接收端)的数据传输启动成功,也可以理解为成功建立了从发送端向接收端传输数据的通信连接,发送端可以按序向接收端传输数据;发送端完成数据传输后,可以通过向接收端发送携带指示end控制原语的报文,以请求接收端终止从发送端至接收端的数据传输;发送端接收到接收端发送的携带指示end ack控制原语的报文,即确定从发送端至接收端的数据传输已结束,本传输周期结束。可以看出,数据传输的传输周期包括传输开始、传输数据和传输结束三个阶段。在一些可能的实施例中,传输周期内的三个阶段也可以有重合,例如,传输开始阶段中就可以开始传输数据等,在此情况下设备间的交互过程具体可参考下述方法实施例的相关叙述,在此不再赘述。
对于上述传输控制选项字段的表示方式,可以采用比特映射的方式或者二进制取值的方式来表示通信连接建立过程中对应的控制原语。
示例性地,传输控制选项字段以二进制取值的方式来表示控制原语可以是:当传输控制选项字段取值第一值时,表示“start”这一控制原语;当传输控制选项字段取值第二值时,表示“start ack”这一控制原语;当传输控制选项字段取值第三值时,表示“end”这一控制原语;当传输控制选项字段取值第四值时,表示“end ack”这一控制原语;当传输控制选项字段取值第五值时,表示“reset”这一控制原语。在一些可能的实施例中,传输控制选项字段还可以表示多个控制原语,例如,当传输控制选项字段取值第六值时,表示“start ack”和“start”控制原语,又例如当传输控制选项字段取值七值时,表示“end ack”和“end”控制原语。
示例性地,传输控制选项字段以比特映射的方式来表示控制原语可以是:传输控制选项字段包括多个 比特位,每个比特位也可以称作一个标识位。当传输控制选项字段中的标识位1置位时,表示“start”这一控制原语;当传输控制选项字段中的标识位2置位时,表示“start ack”这一控制原语;当传输控制选项字段中的标识位3置位时,表示“end”这一控制原语;当传输控制选项字段中的标识位4时,表示“end ack”这一控制原语;当传输控制选项字段中的标识5置位时,表示“reset”这一控制原语。
在一些可能的实施例中,传输控制选项字段也可以同时表示两种控制原语。以比特映射这种方式为例,假设第二设备向第一设备发送的报文中报文头包括传输控制选项字段,且传输控制选项字段中的标识位1和标识位2均置位,则该传输控制选项字段表示了“start”和“start ack”这两种控制原语,说明第二设备确认启动从第一设备至第二设备的数据传输且第二设备向第一设备请求启动从第二设备至第一设备的数据传输。可以理解,此处只是以“start”和“start ack”这两种控制原语为例,但并不限定传输控制选项字段能同时表示的两种控制原语仅为这一种情形。
在本申请实施例中,LWCTP头包括源端口(source port)字段和/或目的端口(destination port)字段,其中,源端口字段用于承载发送端上的需要发送数据的源应用的标识,目的端口字段用于承载接收端上用于接收数据的目的应用的标识。
示例性地,应用(例如,源应用或目的应用)的标识用于在本地唯一标识一个应用,可以是一个或多个字符的组合,其中,字符可以是数字,字母以及其他符号中的一种或多种,例如一个或多个数字的组合,或者一个或多个数据和字母的组合。
在本申请实施例中,LWCTP头包括序列号(sequence number)字段和/或确认序列号(ack sequence number)字段,其中,序列号字段用于承载发送端发送的报文的发送序列号,确认序列号字段用于承载发送端发送的报文的确认序列号。
这里,由于发送端按序传输数据,通过序列号字段可以保证传输层上数据的有序传输,且接收端可以通过发送端发送的报文中的确认序列号字段可以判断自身是否发生丢包。
示例性地,对于发送端来说,序列号字段的填写规则可以是:若发送端在本传输周期内是首次发送携带指示start或start ack的报文,发送序列号可以从一个随机正整数开始或者也可以采用上一传输周期内发送的报文的发送序列号的最大值,每发送一个携带指示start、end或reset控制原语的报文或携带新的数据的报文,发送序列号递增1,否则发送序列号保持不变。例如,发送端对报文进行重传时,发送序列号保持不变。可以理解,序列号字段主要是用于确定传输顺序,报文的发送序列号的变化除了可以是上述例举的以递增形式变化外,在其他实施例中也可以是以递减形式变化,在此不作具体限定。
示例性地,对于发送端来说,确认序列号字段的填写规则可以是:当发送端在本传输周期内未曾从接收端处接收过报文,确认序列号字段填写0;当发送端历史从接收端接收过报文,则确认序列号字段填写发送端从接收端接收的报文的多个连续的发送序列号中的最大值。可以理解,当接收端历史向发送端发送的报文未发生丢包时,发送端在确认序列号字段填写的确认序列号也可以是发送端最近一次从接收端接收的报文的发送序列号。
在一些可能的实施例中,LWCTP头还包括版本号(version)字段,其中,版本号字段用于承载传输层协议的版本号;和
这里,当发送端向接收端传输数据时,发送端发送的报文还携带负载字段,其中,负载字段用于承载发送端上源应用的数据。示例性地,数据也可以称作业务数据或业务数据单元(service data unit,SDU)。
在本申请实施例中,LWCTP头还包括选项长度(option length)字段,其中,选项长度字段用于承载选项字段的长度。通过选项长度字段的取值可以判断选项字段是否为空。
在一些可能的实施例中,参见图2所示的选项字段用于承载LWCTP头中可选的字段,例如,上述传输控制选项字段,除此之外,选项字段还可以包括下述子选项字段中的一项或多项:
校验和选项(checksumoption)字段:该字段用于承载LWCTP头和待发送的数据的校验和;这里,待发送的数据由报文的负载字段承载;
窗口大小选项(window size option)字段:该字段用于承载接收端配置的资源中可用于从发送端接收数据的缓存空间;和
负载长度选项(payload length option)字段:该字段用于承载上述负载字段的长度。
这里,当报文包括上述负载字段时,选项字段可以包括负载长度选项字段,其中,负载长度选项字段用于承载负载字段的长度。当报文包括上述负载字段时,若选项字段不包括负载长度选项字段,在此情况 下,负载字段的长度可以由外层的帧长度确定,例如,若外层为网络层即可由网络层报文头中的负载长度字段确定,若外层为数据链路层即可由数据链路层报文头中的负载长度字段确定。
示例性地,对于具有消息编码能力和纠错能力、或者允许报错的应用,例如,处理音视频信息的应用,校验和选项字段(或称为校验和字段)可以缺省。
示例性地,窗口大小选项字段的值一般由接收端设置,如此,发送端可以根据接收端发送的报文的LWCTP头中的窗口大小选项字段调整自身发送数据的速率和/或待发送的数据的大小,也就是说,接收端可以通过窗口大小选项字段反向影响发送端数据的发送速率和/或待发送的数据的大小。
在一些可能的实施例中,当选项字段包括至少一个子选项字段时,为了避免新增长度字段来指示选项字段中各子选项字段的长度,可以设置各子选项字段的长度固定,在此情况下,选项字段还可以包括选项映射字段,选项映射字段用于指示上述至少一个选项字段等可选的子选项字段是否被承载于选项字段中。
例如,选项字段中的内容可参见图3A,由图3A可知,选项字段包括选项映射字段和至少一个子选项字段(例如,子选项1、….、子选项k,k为正整数)。在一些可能的实施例中,由于选项字段的长度由选项长度字段指定,当选项字段中各字段的长度小于选项长度字段指示的长度时,选项字段还包括填充数据字段,填充数据字段可使得选项字段的长度满足选项长度字段指示的长度。
示例性地选项映射字段可以以比特映射(或比特位图)的方式指示选项字段中包括哪些可选的子选项字段,其中,多个比特位与多个子选项字段一一对应。这里,多个子选项字段包括上述传输控制选项字段、校验和选项字段、窗口大小选项字段和负载长度选项字段中的至少一项,在一些可能的实施例中,多个子选项字段还包括其他可选的子选项字段,例如,用于认证的选项字段、用于加密的字段等。
例如,选项映射字段的长度为1个字节,即8个比特位,其中,每个比特位对应一个子选项字段。可以理解,当选项字段包括第一子选项字段时,则选项映射字段中第一子选项字段对应的比特位被置位。也就是说,根据选项映射字段中被置位的比特位的数量可获得选项字段中子选项字段的数量。在一些可能的实施例中,并不限定选项映射字段的长度仅为1个字节,例如也可以为2个字节,选项映射字段长度可以根据选项字段中要携带的子选项字段的最大数量确定。
在一些可能的实施例中,在选项字段中,上述至少一个子选项字段是基于选项映射字段中各比特位置位的顺序排列的。例如,参见图3B,图3B是本申请实施例提供的一种选项字段的格式示意图。在图3B中,选项映射字段的长度为1个字节,其中,有四个比特位置位为1,即说明该选项字段中包括四个子选项字段,且这四个子选项字段是按照各自对应的比特位的置位顺序从上至下依次排列。具体地,在图3B中所示的选项映射字段中,例如从右至左看,第一个比特位置“1”,表示包括传输控制选项字段;第二个比特位置“1”,表示包括校验和选项字段,且校验和选项字段位于传输控制选项字段后面;第三个比特位置“1”,表示包括窗口大小字段,且窗口大小选项字段位于校验和选项字段后面;第四个比特位置“1”,表示包括负载长度字段,且负载长度字段位于窗口大小选项字段后面。在一些可能的实施例中,图3B所示的四个子选项字段也可以按照各自对应的比特位的置位顺序从下至上依次排列,在此不作具体限定。
需要说明的是,图3B所示的选项字段只是一种示例,并不对LWCTP头中的选项字段中的内容进行限制。在一些可能的实施例中,选项字段中字段的数量可以少于图3B所示的字段的数量,例如,传输控制选项字段、校验和选项字段、窗口大小选项字段和负载长度选项字段等中的一项或多项可以缺省。在一些可能的实施例中,选项字段中字段的数量可以多于图3B所示的字段的数量,例如,还可以在图3B所示的选项字段中增加填充数据字段。
可以看出,本申请实施例提供的传输层的报文头,负载字段和选项字段中的至少一项是可选的,可以根据传输控制需求选择性地设置选项字段和负载字段,能够减少不必要的字节开销,有利于提高报文头的有效载荷比。
下面基于上述定义的传输层的报文头介绍本申请实施例提供的一种通信方法。该方法可以应用于第一设备和第二设备组成的通信系统,例如,第一设备可以是图1中的第一设备,第二设备可以是图1中的第二设备。
参见图4,图4是本申请实施例提供的一种通信方法的流程图。由图4可以看出,该方法可分为三个阶段,分别为传输开始阶段、传输数据阶段和传输结束阶段。需要说明的是,图4实施例中的报文头为上述定义的传输层的报文头,例如,LWCTP头。该方法包括但不限于以下步骤:
第一阶段:传输开始
S401:第一设备向第二设备发送控制报文1,控制报文1包括传输控制选项信息1,传输控制选项信息1用于请求启动从第一设备至第二设备的数据传输。
相应地,第二设备接收第一设备发送的数据报文1。
其中,从第一设备至第二设备的数据传输是基于单向的第一通信连接执行的。这里,第一通信连接为从第一设备向第二设备传输数据的通信连接。
其中,传输控制选项信息1承载于控制报文1的报文头中的传输控制选项字段。示例性地,传输控制选项信息1可以通过该传输控制选项字段中的比特位表示或者通过传输控制选项字段的二进制取值来表示,在此不作具体限定。可以理解,传输控制选项信息1相当于表示上述中的“start”控制原语。
示例性地,控制报文1还包括源端口信息和目的端口信息,若第一设备上的第一应用有向第二设备上的第二应用发送数据的需求,则源端口信息可以承载第一应用的标识,目的端口信息可以承载第二应用的标识。可以理解,源端口信息可以承载于控制报文1的报文头中的源端口字段,目的端口信息可以承载于控制报文1的报文头中的目的端口字段。
这里,第一应用和第二应用可以是同一个应用,也可以是不同的应用。
在本申请实施例中,第一设备可以通过控制报文1的报文头中的序列号字段承载控制报文1的发送序列号,以及确认序列号字段承载控制报文1的确认序列号。有关发送序列号字段以及确认序列号字段的填写可参考图2实施例中相应内容的叙述,在此不再赘述。
在一些可能的实施例中,传输控制选项信息1也可以理解为用于请求建立从第一设备向第二设备传输数据的第一通信连接。可以理解,第一通信连接为单向的通信连接。
S402:第二设备根据控制报文1配置用于从第一设备接收数据的资源。
其中,第二设备在本地配置的资源包括缓存区、状态管理区等存储资源。
示例性地,缓存区可用于存储后续从第一设备获取的数据,状态管理区可用于存储本地的连接状态信息。
S403:第二设备向第一设备发送控制报文2,控制报文2包括传输控制选项信息2,传输控制选项信息2用于确认启动从第一设备至第二设备的数据传输。
如此,第二设备在本地完成了从第一设备处接收数据的准备工作。
相应地,第一设备从第二设备接收控制报文2,第一设备根据控制报文2中的传输控制选项信息2可以确定从第一设备至第二设备的数据传输已成功启动,也可以理解为上述第一通信连接已成功建立,第一设备可以按序传输数据。
其中,传输控制选项信息2承载于控制报文2的报文头中的传输控制选项字段。示例性地,传输控制选项信息2可以通过该传输控制选项字段中的比特位表示或者通过传输控制选项字段的二进制取值来表示,在此不作具体限定。可以理解,传输控制选项信息2相当于表示上述中的“start ack”控制原语。
示例性地,若控制报文1中序列号字段承载“100”以及确认序列号字段承载“0”,则在控制报文2中,序列号字段例如可以承载“200”(其为第二设备在本地生成的一个随机正整数),确认序列号字段承载“100”。
在本申请实施例中,若控制报文1中源端口字段用于承载第一应用的标识以及目的端口字段用于承载第二应用的标识,则在控制报文2中,源端口字段用于承载第二应用的标识且目的端口字段用于承载第一应用的标识。
在一些可能的实施例中,传输控制选项信息3也可以理解为用于确认建立第一通信连接。
第二阶段:传输数据
在传输数据阶段,第一设备向第二设备传输的数据以业务数据单元SDU为例进行示例性阐述。
S404:第一设备向第二设备发送数据报文1,数据报文1承载SDU1。
可以理解,在本申请实施例中,SDU1为第一设备发送的首个业务数据。
示例性地,若控制报文2中序列号字段用于承载“200”以及确认序列号字段用于承载“100”,则在数据报文1中,序列号字段用于承载“101”,确认序列号字段用于承载“200”。
示例性地,在数据报文1中,源端口字段用于承载第一应用的标识,目的端口字段用于承载第二应用的标识。
S405:第二设备向第一设备发送响应报文1,响应报文1中承载的确认序列号为数据报文1中承载的发送序列号。
这里,响应报文1中承载的确认序列号为数据报文1中承载的发送序列号,即说明第二设备接收到数据报文1,且响应报文1是对数据报文1的确认回复。相应地,第一设备从第二设备接收响应报文1,第一设备可以根据响应报文1确定SDU1已成功传输至第二设备。
可以理解,由于图4实施例中仅建立了单向的通信连接,故第二设备在发送针对数据报文的响应报文时,响应报文的发送序列号保持不变。故响应报文1中承载的发送序列号与数据报文1中承载的确认序列号可以相同。
示例性地,若数据报文1中序列号字段用于承载“101”以及确认序列号字段用于承载“200”,则在响应报文1中,序列号字段用于承载“200”,确认序列号字段用于承载“101”。
示例性地,在响应报文1中,源端口字段用于承载第二应用的标识,目的端口字段用于承载第一应用的标识。
上述S404和S405说明第一设备完成了一次数据传输。
示例性地,传输数据阶段中,第一设备可以向第二设备发起多次数据传输,且每次传输一个SDU。图4实施例在传输数据阶段只列举了第一设备与第二设备之间的一次传输,但本申请实施例并不限定第一设备向第二设备发起数据传输的次数。可以理解,第一设备向第二设备发起数据传输的次数与第一设备待发送的SDU的数量有关。
一种实现方式中,第一设备向第二设备每发送一个数据报文,第二报文可以对接收到的该数据报文进行确认回复。例如,基于S404和S405可以看出,第一设备向第二设备发送数据报文1,第二设备会向第一设备发送响应报文1,且响应报文1中承载的确认序列号为数据报文1中承载的发送序列号,即响应报文1是对数据报文1的确认回复。
在一些可能的实施例中,为了提高第一设备侧数据报文的发送效率,第一设备无需每次数据传输都得等待第二设备确认,即第一设备可以连续向第二设备发送多个携带数据的报文,而第二设备从第一设备接收到数据报文后,可以不立即回复确认,利用本地为第一设备分配的存储资源按顺序对接收到的多个数据报文进行缓存,在延迟第一预设时长或者当存储资源可用于接收数据的缓存空间达到预设缓存值时,第二设备才对接收到的多个数据报文进行确认。如此,不仅可以提高第一设备发送数据报文的效率,第二设备也可以减少发送确认回复的次数,减少了带宽的消耗。
以一个具体的例子说明第二设备对接收到的多个数据报文进行延迟确认:假设第一设备连续地向第二设备发送三个数据报文,依次为数据报文1、数据报文2和数据报文3,其中,数据报文1携带SDU1、序列号字段用于承载“101”且确认序列号字段用于承载“200”,数据报文2携带SDU2、序列号字段用于承载“102”且确认序列号字段用于承载“200”,数据报文3携带SDU3、序列号字段用于承载“103”且确认序列号字段用于承载“200”,则第二设备在连续接收了这三个数据报文后,第二设备才向第一设备发送一个响应报文,其中,该响应报文的序列号字段用于承载“200”且确认序列号字段用于承载“103”,如此,第一设备根据该响应报文中承载的确认序列号为数据报文3中承载的发送序列号,确定第二设备成功接收了数据报文1、数据报文2和数据报文3。
第三阶段:传输结束
S406:第一设备向第二设备发送控制报文3,控制报文3包括传输控制选项信息3,传输控制选项信息3用于请求终止从第一设备至第二设备的数据传输。
在本申请实施例中,第一设备完成最后一个SDU的传输后,第一设备可以向第二设备发送控制报文3,以请求终止从第一设备至第二设备的数据传输,也意味着第一设备终止向第二设备传输数据。
其中,传输控制选项信息3承载于控制报文3的报文头中的传输控制选项字段。示例性地,传输控制选项信息3可以通过该传输控制选项字段中的比特位表示或者通过该传输控制选项字段的二进制取值来表示,在此不作具体限定。可以理解,传输控制选项信息3相当于表示上述中的“end”控制原语。
示例性地,在控制报文3中,假设发送序列号字段用于承载“111”,确认序列号字段仍用于承载“200”,若上述数据报文1承载的发送序列号为“101”,即说明第一设备已向第二设备传输了10个SDU。
示例性地,在控制报文3中,源端口字段用于承载第一应用的标识,目的端口字段用于承载第二应用的标识。
在一些可能的实施例中,传输控制选项信息3也可以理解为用于请求断开上述第一通信连接。
S407:第二设备根据控制报文3释放配置的用于从第一设备接收数据的资源。
一种实现方式中,释放配置的用于从第一设备接收数据的资源后,该资源会被回收,故后续第一设备再次向第二设备发送上述控制报文1时,第二设备需重新配置用于从第一设备接收数据的资源,如此可以提高资源的利用效率。
另一种实现方式中,释放配置的用于从第一设备接收数据的资源可以理解为从本地删除该资源与第一设备的对应关系,待后续第一设备再次向第二设备发送上述控制报文1时,第二设备可以将该资源直接与第一设备关联,在此情况下,该资源相当于第二设备为第一设备预留的资源。
S408:第二设备向第一设备发送控制报文4,控制报文4包括传输控制选项信息4,传输控制选项信息4用于确认终止从第一设备至第二设备的数据传输。
相应地,第一设备从第二设备接收控制报文4,第一设备根据控制报文4中的传输控制选项信息4可以确定从第一设备至第二设备的数据传输已终止,第一设备当前数据传输的传输周期结束。
其中,传输控制选项信息4承载于控制报文4的报文头中的传输控制选项字段。示例性地,传输控制选项信息4可以通过该传输控制选项字段中的比特位表示或者通过该传输控制选项字段的二进制取值来表示,在此不作具体限定。可以理解,传输控制选项信息4相当于表示上述中的“end ack”控制原语。
示例性地,若控制报文3中序列号字段用于承载“111”以及确认序列号字段用于承载“200”,则在控制报文4中,序列号字段用于承载“200”,确认序列号字段用于承载“111”。
示例性地,在控制报文4中,源端口字段用于承载第二应用的标识,目的端口字段用于承载第一应用的标识。
在一些可能的实施例中,传输控制选项信息4也可以理解为用于确认断开上述第一通信连接。
也就是说,第一设备可以通过发送携带指示“start”控制原语的报文开启一个数据传输的传输周期,在第一设备数据传输结束时,第一设备可以通过发送携带指示“end”控制原语的报文结束该传输周期。在传输周期内,通过“start”控制原语建立的通信连接始终保活,相较于现有技术需要通过定期地发送探测报文实现已建立的通信连接的保活,能有效节省带宽的消耗,也能节省设备本地电能的消耗。
在一些可能的实施例中,在上述传输开始、传输数据和传输结束这三个阶段中的任一个阶段内,若第一设备和第二设备中的任一设备检测到本地故障事件,该设备可以向对端发送控制报文5以使对端执行重置操作,同时设备本地也对当前传输周期对应的数据传输执行重置操作。其中,控制报文5包括传输控制选项信息5,传输控制选项信息5用于重置从第一设备至第二设备的数据传输。可以理解,传输控制选项信息5相当于表示上述“reset”控制原语。
这里,本地故障事件包括下层协议(例如,网络层协议或者数据链路层协议)断开、数据传输失败等事件中的至少一项。
例如,第一设备发送数据报文后,未收到该数据报文的响应报文且重传该数据报文的次数达到预设次数,此情况可视作为第一设备的本地故障事件。
例如,第一设备接收到上述控制报文2(或第一通信连接成功建立后),在第一预设时长内第一设备未发送数据,此情况可视作第一设备的本地故障事件。
例如,第二设备发送上述控制报文2后,在第一预设时长内第二设备未从第一设备接收数据,此情况可以是做第二设备的本地故障事件。
可以看到,上述实施例示出了在单向(即第一设备至第二设备)上的通信过程,说明可以通过本申请实施例定义的LWCTP头实现单向上的数据传输的控制。此外,相较于现有技术中在单向上进行数据传输时需要通信两端分别在本地配置相应地资源,本申请实施例在进行单向上的数据传输时仅需第二设备在本地配置或预留相应地资源,第一设备无需在本地为接收来自第二设备的数据预留资源,节省了发送端的资源的消耗。
可以理解,若第二设备有向第一设备发送数据的需求,第二设备可以在相反的传输方向(从第二设备至第一设备)上开启另一个传输周期,具体过程可以参考上述图4实施例的相关叙述,也可以参考下述实施例图7的相关叙述,在此不再赘述。
基于图4所述的通信过程,第一设备以及第二设备可以通过状态机在本地管理和维护设备本地的连接 状态信息。下面分别介绍第一设备以及第二设备上配置的状态机。
第一种:第一设备上配置有与第一通信连接对应的状态机1
状态机1用于管理第一设备在第一通信连接上作为发送端的连接状态。
参见图5A,图5A是本申请实施例提供的一种发送端上配置的状态机的状态示意图。在图5A中,示出了以下五种状态:
(1)初始(initial)状态:表示未启动从第一设备至第二设备的数据传输,即第一设备未向第二设备请求启动从第一设备至第二设备的数据传输。
在一些可能的实施例中,初始状态也可以表示上述第一通信连接未建立。
(2)等待开始应答(waiting start ack)状态:表示第一设备等待第二设备回复确认启动从第一设备至第二设备的数据传输。在一些可能的实施例中,等待开始应答状态下也可以允许第一设备向第二设备传输数据。
在一些可能的实施例中,等待开始应答状态也可以表示第一设备等待第二设备回复确认建立上述第一通信连接。
(3)发送数据(sending data)状态:表示第一设备知晓从第一设备至第二设备的数据传输已成功启动。在此状态下,第一设备可以按序向第二设备传输数据。
(4)等待结束应答(waitingend ack)状态:表示第一设备等待第二设备回复确认终止从第一设备至第二设备的数据传输。
在一些可能的实施例中,等待结束应答状态也可以表示第一设备等待第二设备回复确认断开上述第一通信连接。
(5)重置(resetting)状态:表示第一设备重置从第一设备至第二设备的数据传输。
在一些可能的实施例中,重置状态也可以表示第一设备重置上述第一通信连接。
基于图5A,状态机1被配置为:
1、当第一设备处于初始状态时,响应于开始发送数据事件,第一设备被由初始状态切换为等待开始应答状态,以及第一设备执行发送携带指示“start”控制原语的报文(例如,图4中的控制报文1)的动作。
这里,开始发送数据事件是指第一设备有向第二设备传输数据的需求。
2、当第一设备处于等待开始应答状态时,响应于接收携带指示“start ack”控制原语的报文(例如,图4中的控制报文2)的事件,第一设备被由等待开始应答状态切换为发送数据状态;
3、当第一设备处于发送数据状态时,响应于结束发送数据事件,第一设备被由发送数据状态切换为等待结束应答状态,以及第一设备执行发送携带指示“end”控制原语的报文(例如,图4中的控制报文3)的动作。
这里,结束发送数据事件是指第一设备完成了最后一个数据的传输且第一设备在本传输周期内不再向第二设备发送数据。
4、当第一设备处于等待结束应答状态时,响应于接收携带指示“end ack”控制原语的报文(例如,图4中的控制报文4)的事件,第一设备被由等待结束应答状态切换为初始状态。
5、当第一设备处于图5A所示的等待开始应答状态、发送数据状态和等待结束应答状态中的任一状态时,响应于本地故障事件或接收第二设备发送的携带指示“reset”控制原语的报文的事件,第一设备被切换为重置状态,以及第一设备执行重置操作且在本地故障时第一设备还执行向第二设备发送携带指示“reset”控制原语的报文的动作。
这里,本地故障事件包括下层协议(例如,网络层协议或者数据链路层协议)断开事件、数据传输失败事件等中的至少一项。本地故障事件可参考图4的S408中相应内容的叙述,在此不再赘述。
6、当第一设备处于重置状态时,响应于完成重置事件,第一设备被由重置状态切换为初始状态。
这里,完成重置事件是指第一设备本地已完成重置操作。
第二种:第二设备上配置有与第一通信连接对应的状态机2
状态机2用于管理第二设备在第一通信连接上作为接收端的连接状态。
参见图5B,图5B是本申请实施例提供的一种接收端上配置的状态机的状态示意图。在图5B中,示出了以下四种状态:
(1)初始(initial)状态:表示第二设备未启动从第一设备至第二设备的数据传输。
在一些可能的实施例中,初始状态也可以表示第二设备未建立上述第一通信连接。
(2)接收数据(receiving data)状态:表示第二设备完成配置用于从第一设备接收数据的资源并等待接收第一设备传输的数据。
(3)待结束(pending end)状态:表示第二设备释放第二设备中用于从第一设备接收数据配置的资源,即结束从第一设备接收数据。
(4)重置(resetting)状态:表示第二设备重置从第一设备至第二设备的数据传输。
在一些可能的实施例中,重置状态也可以表示第二设备重置上述第一通信连接。
基于图5B,状态机2被配置为:
1、当第二设备处于初始状态时,响应于接收携带指示“start”控制原语的报文(例如,图4中的控制报文1)的事件,第二设备被由初始状态切换为接收数据状态,以及第二设备执行发送携带指示“start ack”控制原语的报文(例如,图4中的控制报文2)的动作。
2、当第二设备处于接收数据状态时,响应于接收携带指示“end”控制原语的报文(例如,图4中的控制报文3)的事件,第二设备被由接收数据状态切换为待结束状态,以及第二设备执行发送携带指示“end ack”控制原语的报文(例如,图4中的控制报文4)以及释放第二设备中用于从第一设备接收数据配置的资源的动作。
3、当第二设备处于待结束状态时,响应于完成结束事件,第二设备被由待结束状态切换为初始状态。
这里,完成结束事件是指第二设备释放配置的用于从第一设备接收数据的资源结束。
4、当第二设备处于图5B所示的接收数据状态或待结束状态时,响应于本地故障事件或接收第一设备发送的携带指示“reset”控制原语的报文的事件,第二设备被切换为重置状态且第二设备执行重置操作以及在本地故障时还执行向第一设备发送携带指示“reset”控制原语的报文的动作。这里,本地故障事件可参考图4的S408中相应内容的叙述,在此不再赘述。
5、当第二设备处于重置状态时,响应于完成重置事件,第二设备被由重置状态切换为初始状态。
这里,完成重置事件是指第二设备本地已完成重置操作。
可以理解,上述状态机1和状态机2为与第一通信连接对应的状态机。在一些可能的实施例中,在第二设备向第一设备请求启动从第二设备至第一设备的数据传输的过程中,第二设备上还需维护状态机3,其中,状态机3为第二设备作为数据的发送端生成的,有关状态机3的配置可参考上述状态机1的相关描述。相应地,第一设备还需维护状态机4,其中,状态机4为第一设备作为数据的接收端生成的,有关状态机4的配置可参考上述状态机2的相关描述。
可以看出,通信双方仅需在传输周期内分别维护各自的连接状态。例如,在启动单向的数据传输时,设备只需管理自身作为数据的发送端或接收端时的连接状态信息。在启动双向的数据传输时,通过在第一设备内配置两个独立的状态机(作为数据的发送端时的状态机和作为数据的接收端时的状态机),同一设备作为发送端时连接状态的管理和该设备作为接收端时连接状态的管理是独立解耦的,能够有效简化设备对通信连接状态的管理。
基于上述图4实施例可以看出,尽管第一设备未向第二设备发送控制报文2的响应报文就能传输数据,但第一设备也是在接收到第二设备发送的控制报文2后才开启数据的传输。在一些可能的实施例中,为了提高数据的传输效率,第一设备可以尽可能早地向第二设备传输数据,而无需等待接收到控制报文2之后。
具体地,第一设备可以在图4所示的建立连接阶段中开启向第二设备传输数据。
示例性地,在图4中,第一设备在发送控制报文1之后且在从第二设备接收控制报文2之前,第一设备即可发送数据报文1,也就是说,图4的S404可以在S401之后以及S403之前执行。
示例性地,在图4中,第一设备也可以直接通过控制报文1承载待发送的数据。也就是说,在本申请实施例中,控制报文除了可以携带传输控制选项信息(例如,传输控制选项信息1)外,还可以携带数据。此实施例具体可参考图6实施例的相关叙述。
参见图6,图6是本申请实施例提供的又一种通信方法。相较于图4所示的实施例,区别在于,图6中第一设备传输数据的时机早于图4中第一设备传输数据的时机。在图6实施例中,第一设备向第二设备传输的数据以SDU为例。该方法包括但不限于以下步骤:
S601:第一设备向第二设备发送控制报文1,控制报文1包括传输控制选项信息1和SDU0。
其中,传输控制选项信息1用于请求启动从第一设备至第二设备的数据传输。传输控制选项信息1的说明可参考图4中S401中传输控制选项信息1的相关叙述。
这里,SDU0为第一设备的首个业务数据。SDU0承载于控制报文1的报文头中的负载字段。
S602:第二设备根据控制报文1配置用于从第一设备接收数据的资源。
S603:第二设备向第一设备发送控制报文2,控制报文2包括传输控制选项信息2。此步骤具体可参考图4中S403的相关叙述。
其中,传输控制选项信息2用于确认启动从第一设备至第二设备的数据传输。
可以理解,控制报文2既是对控制报文1中传输控制选项信息1的确认回复,也是对控制报文1中SDU0的确认回复。
S604:第一设备向第二设备发送数据报文1,数据报文1承载SDU1。
S605:第一设备向第二设备发送数据报文2,数据报文2承载SDU2。
S606:第二设备向第一设备发送响应报文1,响应报文1中承载的确认序列号为数据报文2中承载的发送序列号。
由S604-S606可以看出,第一设备可以连续地向第二设备发送携带SDU的数据报文,如此可以提高发送端批量发送数据时的吞吐量。可以理解,S604-S606只是第一设备与第二设备之间数据传输场景的一种举例,并不限定第二设备每接收到两个SDU就得发送确认回复,也不限定在传输数据阶段中第一设备仅向第二设备发送两个SDU。
在一些可能的实施例中,S605中第一设备向第二设备发送数据报文2可能发生传输失败,例如,第一设备向第二设备连续地发送上述数据报文1和数据报文2后,第一设备从第二设备接收响应报文1,若响应报文1中承载的确认序列号为数据报文1中承载的发送序列号,则第一设备确定数据报文2未被第二设备成功接收到,在此情况下,第一设备需重新发送数据报文2。可以理解,报文重传时,报文中承载的发送序列号保持不变。
示例性地,为了减少无效重传的次数,节省带宽的消耗,第一设备重传数据报文2的时间间隔满足指数退避原则。
进一步地,考虑到传输的可靠性,第一设备向第二设备连续地发送上述数据报文1和数据报文2后,第一设备从第二设备连接两次接收到的响应报文中承载的确认序列号均为数据报文1中承载的发送序列号时,第一设备才确定数据报文2传输失败。
在一些可能的实施例中,第一设备向第二设备连续地发送上述数据报文1和数据报文2后,若在预设时长内未从第二设备接收到上述响应报文1,则第一设备可以向第二设备重新发送该数据报文1和数据报文2。
在一些可能的实施例中,第二设备对第一设备发送的数据报文的确认回复方式也可以是第二设备每接收一个第一设备发送的数据报文,第二设备对该报文进行确认回复。例如,第一设备向第二设备发送上述数据报文1后,第二设备向第一设备发送数据报文1的响应报文;第一设备向第二设备发送数据报文2后,第二设备向第一设备发送数据报文2的响应报文。
进一步地,在上述场景中,第二设备接收数据报文2后,第二设备向第一设备发送的数据报文2的响应报文可能未被第一设备成功接收到,导致第一设备重新发送了数据报文2,在此情况下,第二设备第二次接收到数据报文2,即接收到重复报文,则第二设备可以丢弃第二次接收到的数据报文2,并重新向第一设备发送数据报文2的响应报文。
S607:第一设备向第二设备发送控制报文3,控制报文3包括传输控制选项信息3和SDUn。
其中,传输控制选项信息3用于请求终止从第一设备至第二设备的数据传输。
SDUn为第一设备的最后一个要发送的业务数据。可以知晓,在图6实施例中,第一设备向第二设备传输了(n+1)个SDU。
S608:第二设备根据控制报文3释放第二设备中用于从第一设备接收数据配置的资源。
S609:第二设备向第一设备发送控制报文4,控制报文4包括传输控制选项信息4。此步骤具体可参考图4中S408的相关叙述,在此不再赘述。
由图6可知,由于除了传输数据阶段外,传输开始阶段和传输结束阶段中第一设备也可以在发送的报 文中携带数据,故在整个传输周期内,若第一设备需向第二设备发送(n+1)个数据,则第一设备仅需向第二设备发送(n+1)个报文,且每个报文携带一个数据。相较于现有技术要求在建立连接后才可发送数据,故现有技术中若第一设备需向第二设备发送(n+1)个数据,则第一设备共需向第二设备发送(n+5)个报文,其中,前2个报文用于建立连接,中间(n+1)报文中每个报文用于携带一个数据,最后2个报文用于断开连接。由此可以看出,本申请实施例可以实现在建立连接阶段中就开启数据的传输,不仅能降低首个业务数据的延迟,还能有效节省带宽的消耗,提高数据的传输效率。尤其在短连接过程中,节省带宽的消耗这一优势更加明显。
参见图7,图7是本申请实施例提供的又一种通信方法的流程图。相较于图6实施例,区别在于,图7实施例可以实现第一设备与第二设备之间双向的数据传输。在图7实施例中,第一设备与第二设备之间传输的数据以SDU为例。需要说明的是,图7实施例中的报文头为上述定义的传输层的报文头,例如,LWCTP头。该方法包括但不限于下述步骤:
S701:第一设备向第二设备发送控制报文1,控制报文1包括传输控制选项信息1和SDU0。
其中,传输控制选项信息1用于请求启动从第一设备至第二设备的数据传输。
传输控制选项信息1承载于控制报文1的报文头中的传输控制选项字段。传输控制选项信息1相当于表示上述“start”控制原语,传输控制选项信息1的叙述可参考图4中S401中传输控制选项信息1的相关叙述。
这里,SDU0为第一设备发送的首个业务数据。SDU0由控制报文1的报文头中的负载字段承载。
相应地,第二设备从第一设备接收控制报文1,第二设备可以根据控制报文1中的传输控制选项信息1配置用于从第一设备接收数据的资源。
S702:第二设备向第一设备发送控制报文2,控制报文2包括传输控制选项信息2和SDU1。
与图4和图6中的传输控制选项信息2不同的是,图7中的传输控制选项信息2不仅用于确认启动从第一设备至第二设备的数据传输,传输控制选项信息2还用于请求启动从第二设备至第一设备的数据传输。在一些可能的实施例中,传输控制选项信息2也可以理解为还用于请求建立从第二设备向第一设备传输数据的第二通信连接。可以理解,第二通信连接为单向的通信连接。可以理解,从第二设备至第一设备的数据传输是基于第二通信连接执行。
传输控制选项信息2承载于控制报文2的报文头中的传输控制选项字段。传输控制选项信息2相当于表示上述“start ack”和“start”控制原语。
这里,SDU1为第二设备发送的首个业务数据。SDU1由控制报文2的报文头中的负载字段承载。
相应地,第一设备从第二设备接收控制报文2,第一设备根据控制报文2中的传输控制选项信息2配置用于从第二设备接收数据的资源。
S703:第一设备向第二设备发送数据报文1,数据报文1承载SDU2。
示例性地,假设控制报文1中承载的发送序列号为i以及确认序列号为j,则基于上述图2所述的发送序列号和确认序列号的变化规律,可知控制报文2中承载的发送序列号为j+1以及确认序列号为i,数据报文1中承载的发送序列号为i+1以及确认序列号为j+1,基于数据报文1中承载的确认序列号可以知晓第一设备成功接收到控制报文2。
S704:第二设备向第一设备发送数据报文2,数据报文2承载SDU3。
示例性地,若数据报文1中承载的发送序列号为i+1以及确认序列号为j+1,则数据报文2中承载的发送序列号为j+2以及确认序列号为i+1。可以看出,数据报文2携带了数据SDU3,数据报文2将对数据报文1的确认回复和用于传输数据的报文进行了合并,如此,可以提高第一设备与第二设备之间的数据传输效率。
在一些可能的实施例中,第二设备也可以不将对数据报文1的确认回复和用于传输数据的报文进行合并。例如,第二设备从第一设备接收数据报文1后,第二设备先向第一设备发送数据报文1的响应报文,第二设备需要向第一设备传输数据时,第二设备再基于已建立的第二通信连接向第一设备发送承载了数据的数据报文。
在一些可能的实施例中,第二设备也可以延迟对第一设备发送的数据报文的确认回复,例如,第二设备在满足下述任一条件时,第二设备可以对从第一设备处接收的多个数据报文进行确认回复:延迟第一预 设时长、本地配置的资源中可用于从第一设备接收数据的缓存空间达到预设缓存值或第二设备需要向第一设备传输数据。有关第二设备对第一设备的数据报文延迟确认的例子可参考图4实施例S405中相应内容的叙述,在此不再赘述。
这里,S703和S704为第一设备和第二设备之间开启了双向的数据传输的一种通信场景的示例,本申请实施例并不限定第一设备和第二设备之间仅进行一次数据传输的交互。在一些可能的实施例中,第一设备与第二设备之间开启双向的数据传输后,可以是只有第一设备向第二设备传输数据,也可以是只有第二设备向第一设备传输数据,还可以是第一设备与第二设备交替式地向对端传输数据,在此不作具体限定。
在一些可能的实施例中,在第一设备完成了数据传输以及第二设备也完成了数据传输的情况下,还可以执行下述S705-S707:
S705:第一设备向第二设备发送控制报文3,数据报文3包括传输控制选项信息3和SDUn。
其中,传输控制选项信息3用于请求终止从第一设备至第二设备的数据传输。
传输控制选项信息3承载于控制报文3的报文头中的传输控制选项字段。传输控制选项信息3相当于表示上述“end”控制原语。
这里,SDUn为第一设备发送的最后一个业务数据。SDUn由控制报文3的报文头中的负载字段承载。
相应地,第二设备从第一设备接收控制报文3,第二设备根据控制报文3中的传输控制选项信息3释放第二设备中用于从第一设备接收数据配置的资源。
S706:第二设备向第一设备发送控制报文4,控制报文4包括传输控制选项信息4和SDUm。
与图4和图6中的传输控制选项信息4不同的是,图7中的传输控制选项信息4不仅用于确认终止从第一设备至第二设备的数据传输,传输控制选项信息4还用于请求终止从第二设备至第一设备的数据传输。在一些可能的实施例中,传输控制选项信息4也可以理解为还用于请求断开上述第二通信连接。
传输控制选项信息4承载于控制报文4的报文头中的传输控制选项字段。传输控制选项信息4相当于表示上述“end ack”和“end”控制原语。
这里,SDUm为第二设备发送的最后一个业务数据。SDUm由控制报文2的报文头中的负载字段承载。
相应地,第一设备从第二设备接收控制报文4,第一设备根据控制报文4中的传输控制选项信息4释放第一设备中用于从第二设备接收数据配置的资源,并且第一设备还根据传输控制选项信息4确定从第一设备至第二设备的数据传输已结束。
S707:第一设备向第二设备发送控制报文5,控制报文5包括传输控制选项信息5。
其中,传输控制选项信息5用于确认终止从第二设备至第一设备的数据传输。在一些可能的实施例中,传输控制选项信息5也可以理解为还用于确认断开上述第二通信连接。
传输控制选项信息5承载于控制报文5的报文头中的传输控制选项字段。传输控制选项信息5相当于表示上述“end ack”控制原语。
相应地,第二设备从第一设备接收控制报文5后,第二设备确定从第二设备至第一设备的数据传输已终止。
在一些可能的实施例中,也可能第一设备侧的数据传输结束但第二设备侧的数据传输未结束,在此情况下,可以先由第一设备请求第二设备终止从第一设备至第二设备的数据传输,第二设备继续基于第二通信连接向第一设备传输数据。在一些可能的实施例中,也可能第一设备侧的数据传输未结束但第二设备侧的数据传输结束,在此情况下,可以先由第二设备请求第一设备终止从第二设备至第一设备的数据传输,第一设备继续基于第一通信连接向第二设备传输数据。
可以看到,实施本申请实施例,可以实现第一设备与第二设备之间的双向通信,且这双向通信对应的两个传输方向上的控制是独立解耦的,有利于保证传输的可靠性。另外,第一设备侧或第二设备侧均在传输开始阶段中就传输数据,能有效降低本地首个业务数据的传输延迟,提高了数据的传输效率。
参见图8,图8是本申请实施例提供的又一种通信方法的流程图。图8实施例主要介绍在传输数据阶段(即默认通信双方已建立连接或者双向的数据传输均启动),接收端(例如,图1中的第二设备)可以通过在报文中携带上述图3B中的窗口大小选项信息使得发送端(例如,图1中的第一设备)对数据的传输速率和/或待发送的数据的大小进行适应性调整。需要说明的是,图8实施例中的报文头为上述定义的传输层的报文头,例如,LWCTP头。该方法包括但不限于下述步骤:
S801:第一设备向第二设备发送数据报文1。
示例性地,在数据报文1中,由负载字段承载数据SDUc,由序列号字段承载发送序列号为i,由确认序列号字段承载确认序列号j。这里,负载字段、序列号字段和确认序列号字段均包含于数据报文1的报文头中。
S802:第二设备检测到配置的资源中可用于从第一设备接收数据的第一缓存空间小于第一预警值,生成响应报文1。
这里,第一预警值可以是用户在第二设备上预设的。
其中,响应报文1包括第一窗口大小选项信息,第一窗口大小选项信息用于承载上述第一缓存空间。第一窗口大小选项信息由响应报文1的报文头中的窗口大小选项字段承载。
示例性地,若数据报文1中承载的发送序列号为i以及确认序列号为j,则响应报文1中承载的发送序列号为j,响应报文1中承载的确认序列号为i。在一些可能的实施例中,响应报文1也可以携带第二设备侧的数据,则响应报文1中承载的发送序列号为j+1。
S803:第二设备向第一设备发送响应报文1。
在一些可能的实施例中,为了提高传输的可靠性,响应报文1可以被第二设备重传多次,在重传过程中,响应报文1承载的发送序列号保持不变。
S804:第一设备基于响应报文1检测到第一缓存空间小于第一预设值,暂停向第二设备发送数据。
这里,第一预设值可以是用户在第一设备上预先设置的。第一预设值小于第一预警值。
示例性地,第一缓存空间可以为0。
如此,第一设备从响应报文1中的第一窗口大小选项信息中获取第一缓存空间,当第一缓存空间小于第一预设值时,说明第二设备本地为第一设备分配的存储资源中的可用缓存空间不足,故第一设备可以先暂停向第二设备传输数据。
S805:第二设备对配置的资源中已接收的数据进行清除,检测到配置的资源中可用于从第一设备接收数据的第二缓存空间大于第二预警值,生成响应报文2。
这里,第二预警值可以是用户在第二设备上预设的。第二预警值大于或等于第一预警值。
也就是说,第二设备可以对配置的资源中已接收的数据进行至少一次清除操作,则该资源中可用于从第一设备接收数据的缓存空间由第一缓存空间增加为第二缓存空间,当第二缓存空间大于第二预警值时,第二设备可以通过响应报文2告知第一设备自身当前用于从第一设备接收数据的缓存空间。
其中,响应报文2包括第二窗口大小选项信息,第二窗口大小选项信息用于承载上述第二缓存空间。第二窗口大小选项信息由响应报文2的报文头中的窗口大小选项字段承载。
示例性地,若响应报文1中承载的发送序列号为j以及确认序列号为i,则响应报文2中承载的发送序列号为j,响应报文2中承载的确认序列号为i。在一些可能的实施例中,响应报文2也可以携带第二设备侧的数据,则响应报文2中承载的发送序列号为j+1。
S806:第二设备向第一设备发送响应报文2。
在一些可能的实施例中,为了提高传输的可靠性,第二设备可以向第一设备多次发送响应报文2。
在一些可能的实施例中,第二设备向第一设备发送多次响应报文2的过程中,响应报文2中的第二窗口大小选项信息承载的第二缓存空间可以发生变化。
在一些可能的实施例中,在从第二设备至第一设备的数据传输启动的情况下,尽管从第一设备至第二设备的数据传输已暂停,但第二设备可以向第一设备传输数据,即第二设备向第一设备发送的响应报文2还可以携带第二设备侧的数据,则响应报文2中承载的发送序列号大于或等于响应报文1中承载的发送序列号。
相应地,第一设备从第二设备接收响应报文2,在响应报文2中承载的发送序列号大于或等于响应报文1中承载的发送序列号时,基于响应报文2中的第二窗口大小选项信息确定第二缓存空间大于第一预设值,则第一设备继续向第二设备发送数据。
S807:第一设备根据响应报文2中的第二窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小。
一种实现方式中,当第二窗口大小选项信息承载的第二缓存空间小于第二预设值,降低数据的发送速率和/或减少待发送的数据的大小。
这里,第二预设值可以是用户在第一设备上预设的。其中,第二预设值大于第一预设值,第二预设值小于或等于第二设备本地设置的第一预警值。
可以看出,在第二缓存空间较小的情况下,第一设备可以降低数据的发送速率和/或减少每次发送的数据的大小,使得第二设备能在一定时长内对配置的资源中已接收的数据进行清除以增加该资源中可用于从第一设备接收数据的缓存空间,有利于提高传输的可靠性,减少丢包。
另一种实现方式中,当第二窗口大小选项信息承载的第二缓存空间大于第三预设值,提高数据的发送速率和/或增加待发送的数据的大小。
这里,第三预设值可以是用户在第一设备上预设的。其中,第三预设值大于或等于第二预设值,第三预设值于等于第二设备本地设置的第二预警值。
也就是说,在第二缓存空间充足或有余量的情况下,第一设备可以提高自身数据的发送速率和/或每次发送的数据的大小,如此,提高了数据的传输效率。
可以看出,图8实施例示出了第二设备可以通过在报文中携带窗口大小选项信息使得作为数据发送端的第一设备对数据的传输速率和/或待发送的数据的大小进行适应性调整。在一些可能的实施例中,在从第二设备至第一设备的数据传输已启动的情况下,第一设备也可以通过在报文中携带窗口大小选项信息使得作为数据发送端的第二设备对数据的传输速率和/或待发送的数据的大小进行适应性调整。
可以看到,实施本申请实施例,在数据传输阶段,数据的接收端可以通过在报文中携带上述窗口大小选项信息使得数据的发送端对数据的传输速率和/或待发送的数据的大小进行适应性调整,有利于提高数据的传输效率以及传输的可靠性。
参见图9A,图9A是本申请实施例提供的一种通信装置的结构示意图,通信装置30包括发送单元310和接收单元312。该装置30可以通过硬件、软件或者软硬件结合的方式来实现。
示例性地,通信装置30可以是上述第一设备或者通信装置30包含于第一设备中。
其中,发送单元310,用于向第二设备发送第一控制报文,第一控制报文包括第一传输控制选项信息,第一传输控制选项信息用于请求启动从第一设备至第二设备的数据传输;接收单元312,用于从第二设备接收第二控制报文,第二控制报文包括第二传输控制选项信息,第二传输控制选项信息用于确认启动从第一设备至第二设备的数据传输;发送单元310还用于在未向第二设备发送第二控制报文的响应报文的情况下,向第二设备发送第一数据。
该通信装置30可用于实现图4实施例所描述的第一设备侧的方法。在图4实施例中,发送单元310可用于执行S401、S404和S406,接收单元312可用于执行S403、S405和S408。
在一些可能的实施例中,该通信装置30还可用于实现图6、图7和图8所描述的第一设备侧的方法,为了说明书的简洁,在此不再赘述。
参见图9B,图9B是本申请实施例提供的一种通信装置的结构示意图,通信装置40包括接收单元410、发送单元412和处理单元414。该通信装置40可以通过硬件、软件或者软硬件结合的方式来实现。
示例性地,通信装置40可以是上述第二设备或者通信装置40包含于第二设备中。
其中,接收单元410用于从第一设备第一控制报文,第一控制报文包括第一传输控制选项信息,第一传输控制选项信息用于请求启动从第一设备至第二设备的数据传输;处理单元414用于配置用于从第一设备接收数据的资源;发送单元412用于向第一设备发送第二控制报文,第二控制报文包括第二传输控制选项信息,第二传输控制选项信息用于确认启动从第一设备至第二设备的数据传输;接收单元410还用于在未从第一设备接收第二控制报文的响应报文的情况下,从第一设备接收第一数据。
在一些可能的实施例中,通信装置40还可以包括处理单元(图未示),处理单元可用于在本地为第一设备分配用于接收数据的存储资源等。该通信装置40可用于实现图4实施例所描述的第二设备侧的方法。在图4实施例中,接收单元410可用于执行S401、S404和S406,处理单元可用于执行S402和S407,发送单元412可用于执行S403、S405和S408。
在一些可能的实施例中,该通信装置40还可用于实现图6、图7和图8所描述的第二设备侧的方法,为了说明书的简洁,在此不再赘述。
可选地,以上图9A或图9B所示的通信装置可以为独立设备,例如节点,或者也可以独立设备(如节点)中的一个器件,例如芯片或者集成电路等。
应理解,以上图9A或图9B所示实施例中各单元的划分仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。此外,装置中的单元可以以处理器调用软件的形式实现;例如装置包括处理器,处理器与存储器连接,存储器中存储有指令,处理器调用存储器中存储的指令,以实现以上任一种方法或实现该装置各单元的功能,其中处理器例如为通用处理器,例如中央处理单元(central processing unit,CPU)或微处理器,存储器为装置内的存储器或装置外的存储器。或者,装置中的单元可以以硬件电路的形式实现,可以通过对硬件电路的设计实现部分或全部单元的功能,该硬件电路可以理解为一个或多个处理器;例如,在一种实现中,该硬件电路为专用集成电路(application-specific integrated circuit,ASIC),通过对电路内元件逻辑关系的设计,实现以上部分或全部单元的功能;再如,在另一种实现中,该硬件电路为可以通过可编程逻辑器件(programmable logic device,PLD)实现,以现场可编程门阵列(field programmable gate array,FPGA)为例,其可以包括大量逻辑门电路,通过配置文件来配置逻辑门电路之间的连接关系,从而实现以上部分或全部单元的功能。以上装置的所有单元可以全部通过处理器调用软件的形式实现,或全部通过硬件电路的形式实现,或部分通过处理器调用软件的形式实现,剩余部分通过硬件电路的形式实现。
在本申请实施例中,处理器是一种具有信号的处理能力的电路,在一种实现中,处理器可以是具有指令读取与运行能力的电路,例如中央处理单元(central processing unit,CPU)、微处理器、图形处理器(graphics processing unit,GPU)(可以理解为一种微处理器)、或数字信号处理器(digital signal processor,DSP)等;在另一种实现中,处理器可以通过硬件电路的逻辑关系实现一定功能,该硬件电路的逻辑关系是固定的或可以重构的,例如处理器为专用集成电路(application-specific integrated circuit,ASIC)或可编程逻辑器件(programmable logic device,PLD)实现的硬件电路,例如FPGA。在可重构的硬件电路中,处理器加载配置文档,实现硬件电路配置的过程,可以理解为处理器加载指令,以实现以上部分或全部单元的功能的过程。此外,还可以是针对人工智能设计的硬件电路,其可以理解为一种ASIC,例如神经网络处理单元(neural network processing unit,NPU)张量处理单元(tensor processing unit,TPU)、深度学习处理单元(deep learning processing unit,DPU)等。
可见,以上装置中的各单元可以是被配置成实施以上方法的一个或多个处理器(或处理电路),例如:CPU、GPU、NPU、TPU、DPU、微处理器、DSP、ASIC、FPGA,或这些处理器形式中至少两种的组合。
此外,以上装置中的各单元可以全部或部分可以集成在一起,或者可以独立实现。在一种实现中,这些单元集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。该SOC中可以包括至少一个处理器,用于实现以上任一种方法或实现该装置各单元的功能,该至少一个处理器的种类可以不同,例如包括CPU和FPGA,CPU和NPU等。
参见图10,图10是本申请实施例提供的一种通信设备的结构示意图。如图10所示,通信设备50包括:处理器501、通信接口502、存储器503和总线504。处理器501、存储器503和通信接口502之间通过总线504通信。
应理解,本申请不限定通信设备50中的处理器、存储器的个数。
一种实现方式中,通信设备50可以是具有通信能力的电子设备,例如可以是手持终端、车辆、车载设备、或网络侧设备、用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、无线通信设备、用户代理或用户装置等设备,还可以为任一可能的智能终端设备(如手机)、智能运输设备(如车辆、无人机等)、智能制造设备、智能家居设备(例如大屏、音箱等)等,也可以是用于上述电子设备的能够实现上述方法的组件,组件例如可以是集成电路、线卡、芯片等。示例性地,通信设备50可以是图1中的第一设备或第二设备。
总线504可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线504可包括在通信设备50各个部件(例如,存储器503、处理器501、通信接口502)之间传送信息的通路。
处理器501可参考上述实施例中对处理器的相关描述,在此不再赘述。
存储器503用于提供存储空间,存储空间中可以存储操作系统和计算机程序等数据。存储器503可以是随机存取存储器(random access memory,RAM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、只读存储器(read-only memory,ROM),或便携式只读存储器(compact disc read memory,CD-ROM)等中的一种或者多种的组合。存储器503可以单独存在,也可以集成于处理器501内部。
通信接口502可用于为处理器501提供信息输入或输出。或者可替换的,该通信接口502可用于接收外部发送的数据和/或向外部发送数据。通信接口502可以是无线链路接口,例如空中接口、蜂窝网络接口或无线局域网接口等,也可以为包括诸如以太网电缆等的有线链路接口,或者可以包括与接口耦合的发射器(如射频发射器、天线等),或者接收器等。示例性地,在通信接口502为无线链路接口时,通信接口502可被配置为根据一个或多个其它类型的无线通信(例如,协议)来接收和发送信息,所述无线通信诸如蓝牙、IEEE 802.11通信协议、蜂窝技术、全球微波互联接入(worldwide interoperability for microwave access,WiMAX)或长期演进(Long Term Evolution,LTE)、ZigBee协议、专用短程通信(dedicated short range communications,DSRC)以及射频识别(radio frequency identification,RFID)通信,等等。
该通信设备50中的处理器501用于读取存储器503中存储的计算机程序,用于执行前述的方法,例如图4所描述的方法。
在一种可能的设计方式中,通信设备50可为执行图4所示方法的执行主体(第一设备)中的一个或多个模块,该处理器501可用于读取存储器中存储的一个或多个计算机程序,用于执行以下操作:
通过发送单元310向第二设备发送第一控制报文,第一控制报文包括第一传输控制选项信息,第一传输控制选项信息用于请求启动从第一设备至第二设备的数据传输;
通过接收单元312从第二设备接收第二控制报文,第二控制报文包括第二传输控制选项信息,第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;
以及通过发送单元310在未向第二设备发送第二控制报文的响应报文的情况下,向第二设备发送第一数据。
在一种可能的设计方式中,通信设备50可为执行图4所示方法的执行主体(第二设备)中的一个或多个模块,该处理器501可用于读取存储器中存储的一个或多个计算机程序,用于执行以下操作:
通过接收单元410从第一设备第一控制报文,第一控制报文包括第一传输控制选项信息,第一传输控制选项信息用于请求启动从第一设备至第二设备的数据传输;
配置用于从第一设备接收数据的资源;
通过发送单元412向第一设备发送第二控制报文,第二控制报文包括第二传输控制选项信息,第二传输控制选项信息用于确认启动从第一设备至第二设备的数据传输;
以及通过接收单元410在未从第一设备接收第二控制报文的响应报文的情况下,从第一设备接收第一数据。
本申请实施例还提供了一种通信系统,该通信系统包括第一装置和第二装置,其中,第一装置可以是图9A所示的通信装置30或者图10所示的通信设备50,第二装置可以是图9B所示的通信装置40或图10所示的通信设备50。第一装置可用于执行上述图4、图6、图7和图8中任一实施例所描述的第一设备侧的方法,第二装置可用于执行上述图4、图6、图7和图8中任一实施例所描述的第二设备侧的方法。
在本文上述的实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。另外,在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,各个实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。
需要说明的是,本领域普通技术人员可以看到上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质包括只读存储器(read-only memory,ROM)、随机存储器(random access memory,RAM)、可编程只读存储器(programmable read-only memory,PROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、一次可编程只读存储器(one-time programmable read-only memory,OTPROM)、电子抹除式可复写只读存储(electrically-erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only  memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。
本申请的技术方案本质上或者说做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机程序产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是个人计算机,服务器,或者网络设备、机器人、单片机、芯片、机器人等)执行本申请各个实施例所述方法的全部或部分步骤。

Claims (104)

  1. 一种通信方法,其特征在于,所述方法应用于第一设备,所述方法包括:
    向第二设备发送第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;
    从所述第二设备接收第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;
    在未向所述第二设备发送所述第二控制报文的响应报文的情况下,向所述第二设备发送第一数据。
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。
  3. 根据权利要求1或2所述的方法,其特征在于,
    所述在未向所述第二设备发送所述第二控制报文的响应报文的情况下,向所述第二设备发送第一数据,包括下述任一情况:
    通过所述第一控制报文承载所述第一数据;
    在发送所述第一控制报文之后且接收所述第二控制报文之前,向所述第二设备发送承载所述第一数据的第一数据报文;或
    在接收所述第二控制报文之后,向所述第二设备发送承载所述第一数据的第一数据报文。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
  6. 根据权利要求3-5任一项所述的方法,其特征在于,所述向所述第二设备发送承载所述第一数据的第一数据报文后,所述方法还包括:
    从所述第二设备接收第一响应报文;
    根据所述第一响应报文中承载的确认序列号和所述第一数据报文中承载的发送序列号,确定是否重新发送所述第一数据报文。
  7. 根据权利要求6所述的方法,其特征在于,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的第一缓存空间;所述方法还包括:
    根据所述第一窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小。
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述第一窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小,包括:
    在所述第一缓存空间小于第一预设阈值时,降低数据的发送速率和/或减小待发送的数据的大小;或者
    在所述第一缓存空间大于第二预设阈值时,提高数据的发送速率和/或增大待发送的数据的大小,所述第二预设阈值大于或等于所述第一预设阈值。
  9. 根据权利要求7所述的方法,其特征在于,所述根据所述第一窗口大小选项信息,调整数据的发送速率,包括:
    在所述第一缓存空间小于第三预设阈值时,暂停向所述第二设备发送数据;
    所述方法还包括:
    从所述第二设备接收第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间;
    当所述第二响应报文中承载的发送序列号大于或等于所述第一响应报文中承载的发送序列号,且所述第二缓存空间不小于所述第三预设阈值时,继续向所述第二设备发送数据。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:
    向所述第二设备发送第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控 制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输;
    从所述第二设备接收第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,
    所述第一设备被配置有第一状态机,所述第一状态机被配置为:
    当所述第一设备处于初始状态时,响应于开始发送数据事件,所述第一设备被由所述初始状态切换为等待开始应答状态,以及所述第一设备执行向所述第二设备发送所述第一控制报文的动作。
  12. 根据权利要求11所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述等待开始应答状态,响应于接收到所述第二控制报文的事件,所述第一设备被由所述等待开始应答状态切换为发送数据状态。
  13. 根据权利要求12所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述发送数据状态,响应于结束发送数据事件,所述第一设备被由所述发送数据状态切换为等待结束应答状态,以及所述第一设备执行向所述第二设备发送第三控制报文的动作,其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输。
  14. 根据权利要求13所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述等待结束应答状态,响应于接收到第四控制报文的事件,所述第一设备被由所述等待结束应答状态切换为所述初始状态,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  15. 根据权利要求11-14任一项所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第六控制报文的动作;
    其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
  16. 根据权利要求15所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
  17. 根据权利要求1-16任一项所述的方法,其特征在于,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;
    所述从所述第二设备接收第二控制报文之后,所述方法还包括:
    所述第一设备配置用于从所述第二设备接收数据的资源;和
    所述第一设备向所述第二设备发送第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
  18. 根据权利要求17所述的方法,其特征在于,所述向所述第二设备发送第七控制报文后,所述方法还包括:
    从所述第二设备接收第二数据报文,所述第二数据报文承载第二数据;
    向所述第二设备发送第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
  19. 根据权利要求17或18所述的方法,其特征在于,所述方法还包括:
    从所述第二设备接收第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;
    基于所述第八控制报文释放所述第一设备中用于从所述第二设备接收数据配置的资源;
    向所述第二设备发送第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  20. 根据权利要求17-19任一项所述的方法,其特征在于,
    所述第一设备被配置有第二状态机,所述第二状态机被配置为:
    当所述第一设备处于初始状态时,响应于接收到所述第二控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第一设备执行向所述第二设备发送所述第七控制报文的动作。
  21. 根据权利要求20所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述接收数据状态,响应于接收到第八控制报文的事件,所述第一设备被由所述接收数据状态切换为待结束状态,以及所述第一设备执行释放所述第一设备中用于从所述第二设备接收数据配置的资源以及向所述第二设备发送第九控制报文的动作,
    其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  22. 根据权利要求21所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述待结束状态,响应于完成结束事件,所述第一设备被由所述待结束状态切换为所述初始状态。
  23. 根据权利要求20-22任一项所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第十控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第十一控制报文的动作;
    其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
  24. 根据权利要求23所述的方法,其特征在于,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
  25. 根据权利要求23或24所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
  26. 一种通信方法,其特征在于,所述方法应用于第二设备,所述方法包括:
    从第一设备接收第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;
    配置用于从所述第一设备接收数据的资源,以及向所述第一设备发送第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;
    在未从所述第一设备接收所述第二控制报文的响应报文的情况下,从所述第一设备接收第一数据。
  27. 根据权利要求26所述的方法,其特征在于,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。
  28. 根据权利要求26或27所述的方法,其特征在于,
    所述在未从所述第一设备接收所述第二控制报文的响应报文的情况下,从所述第一设备接收第一数据,包括下述任一情况:
    通过所述第一控制报文承载所述第一数据;
    在接收所述第一控制报文之后且发送所述第二控制报文之前,从所述第一设备接收承载所述第一数据的第一数据报文;或
    在发送所述第二控制报文之后,从所述第一设备接收承载所述第一数据的第一数据报文。
  29. 根据权利要求26-28任一项所述的方法,其特征在于,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
  30. 根据权利要求26-29任一项所述的方法,其特征在于,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息 用于承载所述第一控制报文的确认序列号。
  31. 根据权利要求28-30任一项所述的方法,其特征在于,从所述第一设备接收承载所述第一数据的第一数据报文后,所述方法还包括:
    向所述第一设备发送第一响应报文,所述第一响应报文中承载的确认序列号为所述第一数据报文中承载的发送序列号。
  32. 根据权利要求31所述的方法,其特征在于,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第一缓存空间,所述第一窗口大小选项信息用于所述第二设备反向调整所述第一设备发送数据的速率和/或调整待发送的数据的大小。
  33. 根据权利要求32所述的方法,其特征在于,
    当检测到所述第一缓存空间小于第一预警值时,所述第一响应报文还包括所述第一窗口大小选项信息。
  34. 根据权利要求33所述的方法,其特征在于,所述方法还包括:
    对所述第二设备配置的所述资源中已接收的数据进行清除;
    当检测到所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间大于第二预警值时,向所述第一设备发送至少一次第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息用于承载所述第二缓存空间,所述第二预警值大于或等于所述第一预警值。
  35. 根据权利要求26-34任一项所述的方法,其特征在于,所述方法还包括:
    从所述第一设备接收第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;
    基于所述第三控制报文释放所述第二设备中用于从所述第一设备接收数据配置的资源;向所述第一设备发送第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  36. 根据权利要求26-35任一项所述的方法,其特征在于,
    所述第一设备被配置有第一状态机,所述第一状态机被配置为:
    当所述第一设备处于初始状态时,响应于接收到所述第一控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第二设备执行向所述第一设备发送所述第二控制报文的动作。
  37. 根据权利要求36所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述接收数据状态,响应于接收到第三控制报文的事件,所述第二设备被由所述接收数据状态切换为待结束状态,以及所述第二设备执行释放所述第二设备中用于从所述第一设备接收数据配置的资源以及向所述第一设备发送第四控制报文的动作,
    其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  38. 根据权利要求37所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述待结束状态,响应于完成结束事件,所述第二设备被由所述待结束状态切换为所述初始状态。
  39. 根据权利要求36-38任一项所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第六控制报文的动作;
    其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
  40. 根据权利要求39所述的方法,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
  41. 根据权利要求26-40任一项所述的方法,其特征在于,所述第二控制报文的所述第二传输控制选 项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;
    所述向所述第一设备发送第二控制报文之后,所述方法还包括:
    从所述第一设备接收第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
  42. 根据权利要求41所述的方法,其特征在于,所述方法还包括:
    向所述第一设备发送第二数据报文,所述第二数据报文承载第二数据;
    从所述第一设备接收第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
  43. 根据权利要求41或42所述的方法,其特征在于,所述方法还包括:
    向所述第一设备发送第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;
    从所述第一设备接收第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  44. 根据权利要求41-43任一项所述的方法,其特征在于,
    所述第二设备被配置有第二状态机,所述第二状态机被配置为:
    当所述第二设备处于初始状态时,响应于开始发送数据事件,所述第二设备被由所述初始状态切换为等待开始应答状态,以及所述第二设备执行向所述第二设备发送所述第二控制报文的动作。
  45. 根据权利要求44所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述等待开始应答状态,响应于接收到所述第七控制报文的事件,所述第二设备被由所述等待开始应答状态切换为发送数据状态。
  46. 根据权利要求45所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述发送数据状态,响应于结束发送数据事件,所述第二设备被由所述发送数据状态切换为等待结束应答状态,以及所述第二设备执行向所述第一设备发送第八控制报文的动作,其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输。
  47. 根据权利要求46所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述等待结束应答状态,响应于接收到第九控制报文的事件,所述第二设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  48. 根据权利要求44-47任一项所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第一设备发送的第十控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第十一控制报文的动作;
    其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
  49. 根据权利要求48所述的方法,其特征在于,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
  50. 根据权利要求48或49所述的方法,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
  51. 一种通信装置,其特征在于,所述装置为第一设备或者所述装置包含于第一设备中,所述装置包括:
    发送单元,用于向第二设备发送第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;
    接收单元,用于从所述第二设备接收第二控制报文,所述第二控制报文包括第二传输控制选项信息, 所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;
    所述发送单元还用于在未向所述第二设备发送所述第二控制报文的响应报文的情况下,向所述第二设备发送第一数据。
  52. 根据权利要求51所述的装置,其特征在于,所述第一设备至所述第二设备的数据传输是基于单向的通信连接执行。
  53. 根据权利要求51或52所述的装置,其特征在于,所述发送单元具体用于:
    通过所述第一控制报文承载所述第一数据;
    在发送所述第一控制报文之后且接收所述第二控制报文之前,向所述第二设备发送承载所述第一数据的第一数据报文;或
    在接收所述第二控制报文之后,向所述第二设备发送承载所述第一数据的第一数据报文。
  54. 根据权利要求51-53任一项所述的装置,其特征在于,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
  55. 根据权利要求51-54任一项所述的装置,其特征在于,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
  56. 根据权利要求53-55任一项所述的装置,其特征在于,
    所述接收单元还用于从所述第二设备接收第一响应报文;
    所述装置还包括处理单元,所述处理单元用于根据所述第一响应报文中承载的确认序列号和所述第一数据报文中承载的发送序列号,确定是否重新发送所述第一数据报文。
  57. 根据权利要求56所述的装置,其特征在于,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的资源中可用于从所述第一设备接收数据的第一缓存空间;所述处理单元具体用于:
    根据所述第一窗口大小选项信息,调整数据的发送速率和/或待发送的数据的大小。
  58. 根据权利要求57所述的装置,其特征在于,所述处理单元具体用于:
    在所述第一缓存空间小于第一预设阈值时,降低数据的发送速率和/或减小待发送的数据的大小;或者
    在所述第一缓存空间大于第二预设阈值时,提高数据的发送速率和/或增大待发送的数据的大小,所述第二预设阈值大于或等于所述第一预设阈值。
  59. 根据权利要求57所述的装置,其特征在于,所述发送单元还用于:
    在所述第一缓存空间小于第三预设阈值时,暂停向所述第二设备发送数据;
    所述接收单元还用于:从所述第二设备接收第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间;
    所述发送单元还用于当所述第二响应报文中承载的发送序列号大于或等于所述第一响应报文中承载的发送序列号,且所述第二缓存空间不小于所述第三预设阈值时,继续向所述第二设备发送数据。
  60. 根据权利要求51-59任一项所述的装置,其特征在于,
    所述发送单元还用于:向所述第二设备发送第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输;
    所述接收单元还用于从所述第二设备接收第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  61. 根据权利要求51-60任一项所述的装置,其特征在于,
    所述第一设备被配置有第一状态机,所述第一状态机被配置为:
    当所述第一设备处于初始状态时,响应于开始发送数据事件,所述第一设备被由所述初始状态切换为等待开始应答状态,以及所述第一设备执行向所述第二设备发送所述第一控制报文的动作。
  62. 根据权利要求61所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述等待开始应答状态,响应于接收到所述第二控制报文的事件,所述第一设备 被由所述等待开始应答状态切换为发送数据状态。
  63. 根据权利要求62所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述发送数据状态,响应于结束发送数据事件,所述第一设备被由所述发送数据状态切换为等待结束应答状态,以及所述第一设备执行向所述第二设备发送第三控制报文的动作,其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信息用于请求终止从所述第一设备至所述第二设备的数据传输。
  64. 根据权利要求63所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述等待结束应答状态,响应于接收到第四控制报文的事件,所述第一设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  65. 根据权利要求61-64任一项所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第六控制报文的动作;
    其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
  66. 根据权利要求65所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
  67. 根据权利要求51-66任一项所述的装置,其特征在于,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;
    所述发送单元还用于:
    配置用于从所述第二设备接收数据的资源;和
    向所述第二设备发送第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
  68. 根据权利要求67所述的装置,其特征在于,
    所述接收单元还用于:从所述第二设备接收第二数据报文,所述第二数据报文承载所述第二数据;
    所述发送单元还用于向所述第二设备发送第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
  69. 根据权利要求67或68所述的装置,其特征在于,
    所述接收单元还用于从所述第二设备接收第八控制报文,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;
    所述发送单元还用于基于所述第八控制报文释放所述第一设备中用于从所述第二设备接收数据配置的资源;向所述第二设备发送第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  70. 根据权利要求67-69任一项所述的装置,其特征在于,
    所述第一设备被配置有第二状态机,所述第二状态机被配置为:
    当所述第一设备处于初始状态时,响应于接收到所述第二控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第一设备执行向所述第二设备发送所述第七控制报文的动作。
  71. 根据权利要求70所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述接收数据状态,响应于接收到第八控制报文的事件,所述第一设备被由所述接收数据状态切换为待结束状态,以及所述第一设备执行释放所述第一设备中用于从所述第二设备接收数据配置的资源以及向所述第二设备发送第九控制报文的动作,
    其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;所述第九控制报文包括第九传输控制选项信息,所述第九传输控 制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  72. 根据权利要求71所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述待结束状态,响应于完成结束事件,所述第一设备被由所述待结束状态切换为所述初始状态。
  73. 根据权利要求70-72任一项所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第十控制报文的事件,所述第一设备被切换为重置状态,以及所述第一设备执行重置操作且在本地故障时所述第一设备还执行向所述第二设备发送第十一控制报文的动作;
    其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
  74. 根据权利要求73所述的装置,其特征在于,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
  75. 根据权利要求73或74所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第一设备处于所述重置状态,响应于完成重置事件,所述第一设备被由所述重置状态切换为所述初始状态。
  76. 一种通信装置,其特征在于,所述装置为第二设备或者所述装置包含于所述第二设备中,所述装置包括:
    接收单元,用于从第一设备接收第一控制报文,所述第一控制报文包括第一传输控制选项信息,所述第一传输控制选项信息用于请求启动从所述第一设备至所述第二设备的数据传输;
    处理单元,用于配置用于从所述第一设备接收数据的资源;以及
    发送单元,用于向所述第一设备发送第二控制报文,所述第二控制报文包括第二传输控制选项信息,所述第二传输控制选项信息用于确认启动从所述第一设备至所述第二设备的数据传输;
    所述接收单元还用于在未从所述第一设备接收所述第二控制报文的响应报文的情况下,从所述第一设备接收第一数据。
  77. 根据权利要求76所述的装置,其特征在于,所述第一设备是基于单向的通信连接向所述第二设备传输数据。
  78. 根据权利要求76或77所述的装置,其特征在于,所述接收单元具体用于:
    通过所述第一控制报文承载所述第一数据;
    在接收所述第一控制报文之后且发送所述第二控制报文之前,从所述第一设备接收承载所述第一数据的第一数据报文;或
    在发送所述第二控制报文之后,从所述第一设备接收承载所述第一数据的第一数据报文。
  79. 根据权利要求76-78任一项所述的装置,其特征在于,所述第一控制报文还包括源端口信息和/或目的端口信息,其中,所述源端口信息用于承载所述第一设备上用于发送数据的第一应用的标识,所述目的端口信息用于承载所述第二设备上用于接收数据的第二应用的标识。
  80. 根据权利要求76-79任一项所述的装置,其特征在于,所述第一控制报文还包括序列号信息和/或确认序列号信息,其中,所述序列号信息用于承载所述第一控制报文的发送序列号,所述确认序列号信息用于承载所述第一控制报文的确认序列号。
  81. 根据权利要求78-80任一项所述的装置,其特征在于,
    所述发送单元还用于向所述第一设备发送第一响应报文,所述第一响应报文中承载的确认序列号为所述第一数据报文中承载的发送序列号。
  82. 根据权利要求81所述的装置,其特征在于,所述第一响应报文还包括第一窗口大小选项信息,所述第一窗口大小选项信息用于承载所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第一缓存空间,所述第一窗口大小选项信息用于所述第二设备反向调整所述第一设备发送数据的速率和/或调整待发送的数据的大小。
  83. 根据权利要求82所述的装置,其特征在于,
    当检测到所述第一缓存空间小于第一预警值时,所述第一响应报文还包括所述第一窗口大小选项信息。
  84. 根据权利要求83所述的装置,其特征在于,
    所述处理单元还用于对所述第二设备配置的所述资源中已接收的数据进行清除;
    所述发送单元还用于:当检测到所述第二设备配置的所述资源中可用于从所述第一设备接收数据的第二缓存空间大于第二预警值时,向所述第一设备发送至少一次第二响应报文,所述第二响应报文包括第二窗口大小选项信息,所述第二窗口大小选项信息用于承载所述第二缓存空间,所述第二预警值大于或等于所述第一预警值。
  85. 根据权利要求76-84任一项所述的装置,其特征在于,
    所述接收单元还用于:从所述第一设备接收第三控制报文,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;
    所述处理单元还用于基于所述第三控制报文释放所述第二设备中用于从所述第一设备接收数据配置的资源;
    所述发送单元还用于向所述第一设备发送第四控制报文,所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  86. 根据权利要求76-85任一项所述的装置,其特征在于,
    所述第一设备被配置有第一状态机,所述第一状态机被配置为:
    当所述第一设备处于初始状态时,响应于接收到所述第一控制报文的事件,所述第一设备被由所述初始状态切换为接收数据状态,以及所述第二设备执行向所述第一设备发送所述第二控制报文的动作。
  87. 根据权利要求86所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述接收数据状态,响应于接收到第三控制报文的事件,所述第二设备被由所述接收数据状态切换为待结束状态,以及所述第二设备执行释放所述第二设备中用于从所述第一设备接收数据配置的资源以及向所述第一设备发送第四控制报文的动作,
    其中,所述第三控制报文包括第三传输控制选项信息,所述第三传输控制选项信用于请求终止从所述第一设备至所述第二设备的数据传输;所述第四控制报文包括第四传输控制选项信息,所述第四传输控制选项信息用于确认终止从所述第一设备至所述第二设备的数据传输。
  88. 根据权利要求87所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述待结束状态,响应于完成结束事件,所述第二设备被由所述待结束状态切换为所述初始状态。
  89. 根据权利要求86-88任一项所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述接收数据状态或所述待结束状态时,响应于本地故障事件或接收到所述第二设备发送的第五控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第六控制报文的动作;
    其中,所述第五控制报文包括第五传输控制选项信息,所述第五传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输;所述第六控制报文包括第六传输控制选项信息,所述第六传输控制选项信息用于重置从所述第一设备至所述第二设备的数据传输。
  90. 根据权利要求89所述的装置,其特征在于,所述第一状态机还被配置为:
    当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
  91. 根据权利要求76-90任一项所述的装置,其特征在于,所述第二控制报文的所述第二传输控制选项信息还用于请求启动从所述第二设备至所述第一设备的数据传输;
    所述接收单元还用于:从所述第一设备接收第七控制报文,所述第七控制报文包括第七传输控制选项信息,所述第七传输控制选项信息用于确认启动从所述第二设备至所述第一设备的数据传输。
  92. 根据权利要求91所述的装置,其特征在于,
    所述发送单元还用于向所述第一设备发送第二数据报文,所述第二数据报文承载所述第二数据;
    所述接收单元还用于从所述第一设备接收第三数据报文,所述第三数据报文承载第三数据,所述第三数据报文中承载的确认序列号为所述第二数据报文中承载的发送序列号。
  93. 根据权利要求91或92所述的装置,其特征在于,
    所述发送单元还用于向所述第一设备发送第八控制报文,所述第八控制报文包括第八传输控制选项信 息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输;
    所述接收单元还用于从所述第一设备接收第九控制报文,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  94. 根据权利要求91-93任一项所述的装置,其特征在于,
    所述第二设备被配置有第二状态机,所述第二状态机被配置为:
    当所述第二设备处于初始状态时,响应于开始发送数据事件,所述第二设备被由所述初始状态切换为等待开始应答状态,以及所述第二设备执行向所述第二设备发送所述第二控制报文的动作。
  95. 根据权利要求94所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述等待开始应答状态,响应于接收到所述第七控制报文的事件,所述第二设备被由所述等待开始应答状态切换为发送数据状态。
  96. 根据权利要求95所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述发送数据状态,响应于结束发送数据事件,所述第二设备被由所述发送数据状态切换为等待结束应答状态,以及所述第二设备执行向所述第一设备发送第八控制报文的动作,其中,所述第八控制报文包括第八传输控制选项信息,所述第八传输控制选项信息用于请求终止从所述第二设备至所述第一设备的数据传输。
  97. 根据权利要求96所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述等待结束应答状态,响应于接收到第九控制报文的事件,所述第二设备被由所述等待结束应答状态切换为所述初始状态,其中,所述第九控制报文包括第九传输控制选项信息,所述第九传输控制选项信息用于确认终止从所述第二设备至所述第一设备的数据传输。
  98. 根据权利要求94-97任一项所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述等待开始应答状态、所述发送数据状态和所述等待结束应答状态中的任意一种时,响应于本地故障事件或接收到所述第一设备发送的第十控制报文的事件,所述第二设备被切换为重置状态,以及所述第二设备执行重置操作且在本地故障时所述第二设备还执行向所述第一设备发送第十一控制报文的动作;
    其中,所述第十控制报文包括第十传输控制选项信息,所述第十传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输;所述第十一控制报文包括第十一传输控制选项信息,所述第十一传输控制选项信息用于重置从所述第二设备至所述第一设备的数据传输。
  99. 根据权利要求98所述的装置,其特征在于,所述第十一传输控制选项信息还用于重置从所述第一设备至所述第二设备的数据传输。
  100. 根据权利要求98或99所述的装置,其特征在于,所述第二状态机还被配置为:
    当所述第二设备处于所述重置状态,响应于完成重置事件,所述第二设备被由所述重置状态切换为所述初始状态。
  101. 一种通信装置,其特征在于,所述装置包括存储器和处理器,所述存储器存储计算机程序指令,所述处理器运行所述计算机程序指令以使所述装置执行如权利要求1-25或26-50任一项所述的方法。
  102. 一种通信系统,其特征在于,所述通信系统包括第一装置和第二装置,所述第一装置用于执行如权利要求1-25中任一项所述的方法,所述第二装置用于执行如权利要求26-50中任一项所述的方法。
  103. 一种车辆,其特征在于,所述车辆包括第一装置或第二装置,所述第一装置用于执行如权利要求1-25中任一项所述的方法,所述第二装置用于执行如权利要求26-50中任一项所述的方法。
  104. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有程序指令,所述程序指令用于实现权利要求1-25或者如权利要求26-50中任一项所述的方法。
PCT/CN2023/106766 2022-08-17 2023-07-11 一种通信方法及装置 WO2024037254A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210987559.2A CN117640716A (zh) 2022-08-17 2022-08-17 一种通信方法及装置
CN202210987559.2 2022-08-17

Publications (1)

Publication Number Publication Date
WO2024037254A1 true WO2024037254A1 (zh) 2024-02-22

Family

ID=89940657

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/106766 WO2024037254A1 (zh) 2022-08-17 2023-07-11 一种通信方法及装置

Country Status (2)

Country Link
CN (1) CN117640716A (zh)
WO (1) WO2024037254A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011057556A1 (zh) * 2009-11-13 2011-05-19 中兴通讯股份有限公司 一种减少ip地址需求的方法和移动网络系统
US20160261722A1 (en) * 2015-03-06 2016-09-08 Apple Inc. Robust Multipath TCP Stateless Connection Establishment
CN109450912A (zh) * 2018-11-26 2019-03-08 北京旷视科技有限公司 数据传输方法、装置和设备
WO2022022530A1 (zh) * 2020-07-31 2022-02-03 华为技术有限公司 确定mptcp服务器公网地址的方法和通信装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011057556A1 (zh) * 2009-11-13 2011-05-19 中兴通讯股份有限公司 一种减少ip地址需求的方法和移动网络系统
US20160261722A1 (en) * 2015-03-06 2016-09-08 Apple Inc. Robust Multipath TCP Stateless Connection Establishment
CN109450912A (zh) * 2018-11-26 2019-03-08 北京旷视科技有限公司 数据传输方法、装置和设备
WO2022022530A1 (zh) * 2020-07-31 2022-02-03 华为技术有限公司 确定mptcp服务器公网地址的方法和通信装置

Also Published As

Publication number Publication date
CN117640716A (zh) 2024-03-01

Similar Documents

Publication Publication Date Title
US10826654B2 (en) Method and system for improving wireless link efficiency
CN110603803B (zh) 用于云局域网环境中网络实体之间通信的方法和设备
US11381514B2 (en) Methods and apparatus for early delivery of data link layer packets
EP2248309B1 (en) Buffer control for multi-transport architectures
WO2020063108A1 (zh) 数据传输的方法和装置
JP7464564B2 (ja) マルチコネクティビティにおける信頼性のある通信のための装置及び方法
US9081905B2 (en) Low latency interconnect bus protocol
WO2012098442A1 (en) Application layer communication via an intermediate node
WO2018112327A1 (en) Methods of concurrency control for block transfer in coap publish-subscribe architecture
WO2021204091A1 (zh) 一种清空缓存的方法及装置
WO2022205234A1 (zh) 一种通信方法及装置
WO2021027853A1 (zh) 一种通信方法及装置
CN107786464B (zh) 一种实现节点间通信的方法及装置
JP2020507963A (ja) データ送信方法および装置、ならびに顧客宅内機器
CN113938431A (zh) 突发数据包传输方法、装置和电子设备
WO2024037254A1 (zh) 一种通信方法及装置
WO2023109891A1 (zh) 组播传输方法、装置和系统
JP7227510B2 (ja) 無線通信装置、無線通信方法、及び無線通信システム
WO2021238318A1 (zh) 一种通信方法及装置
WO2021249425A1 (zh) 一种通信方法及相关装置
WO2021233192A1 (zh) 一种无线链路控制状态报告的方法及对应装置
WO2023029013A1 (en) Communication devices and methods for concatenating service data units
WO2024022011A1 (zh) 一种资源预留路径建立、通信方法及装置
CN115499932B (zh) 通信方法及装置
WO2024130615A1 (zh) 一种数据传输方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23854159

Country of ref document: EP

Kind code of ref document: A1