CN118413580A - Communication method, device and system - Google Patents
Communication method, device and system Download PDFInfo
- Publication number
- CN118413580A CN118413580A CN202310117051.1A CN202310117051A CN118413580A CN 118413580 A CN118413580 A CN 118413580A CN 202310117051 A CN202310117051 A CN 202310117051A CN 118413580 A CN118413580 A CN 118413580A
- Authority
- CN
- China
- Prior art keywords
- data
- message
- udp
- tcp
- channel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000006854 communication Effects 0.000 title claims abstract description 128
- 238000004891 communication Methods 0.000 title claims abstract description 127
- 238000000034 method Methods 0.000 title claims abstract description 92
- 230000005540 biological transmission Effects 0.000 claims abstract description 102
- 230000004044 response Effects 0.000 claims description 21
- 238000004806 packaging method and process Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 25
- 230000008569 process Effects 0.000 description 13
- 230000009977 dual effect Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 8
- 230000003287 optical effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000010267 cellular communication Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/165—Combined use of TCP and UDP protocols; selection criteria therefor
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/436—Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
- H04N21/43615—Interfacing a Home Network, e.g. for connecting the client to a plurality of peripherals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/643—Communication protocols
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Small-Scale Networks (AREA)
Abstract
A communication method, device and system relate to the technical field of terminals, can improve the communication performance in a communication scene, and can be applied to first equipment, wherein the method comprises the following steps: acquiring data to be transmitted; the data is sent using the transmission control protocol TCP and the data is sent using the user datagram protocol UDP.
Description
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a communication method, device, and system.
Background
Currently, users can surf the internet by means of devices. For example, a user may use a cell phone to make a video or voice call with a counterpart. In the communication process, the device needs to transmit the data message of the corresponding video stream or voice stream by means of the communication network, so that the communication performance of the device is closely related to the transmission performance of the data message.
Disclosure of Invention
The communication method, the device and the system provided by the application can be suitable for different network environment scenes, and the communication performance under the corresponding network environment scenes is improved.
In order to achieve the above object, the embodiment of the present application provides the following technical solutions:
in a first aspect, a communication method is provided, the method being applicable to a first device or a component supporting a first device functionality (such as a chip system), the method comprising: the method comprises the steps of obtaining data to be transmitted, sending the data by using a Transmission Control Protocol (TCP), and sending the data by using a User Datagram Protocol (UDP).
Therefore, under the scenes of stable network environment, better network quality and the like, the data transmitted by the first equipment through the UDP channel can be more quickly transmitted to the second equipment, and the communication time delay is lower. Under the scenes of network environment fluctuation, poor network quality and the like, the reliability and stability of data transmitted through the TCP channel are higher, and the packet loss probability can be reduced. Therefore, the scheme of synchronously transmitting data through the two channels, namely the TCP channel and the DCP channel, can be suitable for different network environment scenes, and ensures the communication performance under the corresponding network environment as far as possible.
In one possible design, before the transmitting the data using transmission control protocol TCP and the transmitting the data using user datagram protocol UDP, the method further comprises:
Judging whether a first condition is met, wherein the first condition comprises at least one of the following: the data are data of a first service, and the communication quality of a current network is lower than a threshold value;
transmitting the data using a transmission control protocol, TCP, and transmitting the data using a user datagram protocol, UDP, comprising:
Transmitting the data using TCP and transmitting the data using UDP when the first condition is satisfied;
Wherein the first service includes any one of the following: game, net lesson, instant communication, live broadcast, red packet, screen throwing, internet of things service, industrial internet of things service and streaming media service.
It can be seen that in some scenarios, the first device may communicate via the above-described TCP and UDP dual channel transmission schemes when it determines that the communication quality of the current network is poor. Therefore, the data is transmitted through the UDP channel and the TCP channel, so that the redundancy of the data can be improved when the network communication quality is poor. Therefore, the probability of retransmitting the data can be reduced, the transmission delay of the data is reduced, and meanwhile, the transmission reliability of the data is improved, so that the overall performance of communication is improved.
Similarly, in some scenarios, the first device may communicate via the dual channel transmission scheme described above when it determines that the message to be transmitted is data of a low latency service. Therefore, the redundancy of the data can be improved, the probability of retransmitting the data is further reduced, the transmission delay of the data is reduced, and the low-delay transmission requirement of the service is met. Meanwhile, as the data redundancy is improved, the reliability of data transmission can be improved, so that the low-delay transmission requirement of the service is met on the basis of ensuring the reliability as much as possible.
In one possible design, the first device may also initiate different transmission mechanisms when different conditions are met. For example, in a scenario where the network environment fluctuates greatly, data is transmitted through a TCP channel, so as to improve the reliability of communication. In a scene of stable network environment, data is transmitted through a UDP channel so as to reduce communication delay.
In one possible design, after the transmitting the data using transmission control protocol TCP and the transmitting the data using user datagram protocol UDP, the method further comprises:
Detecting that the communication quality of the current network is higher than or equal to a threshold value;
The data is transmitted using TCP or UDP.
The first device detects that the communication quality of the network is higher, which means that the packet loss probability in the transmission process is lower, the reliability of the transmission is higher, and the transmission can be switched to a single channel for transmission. In this way, transmission overhead can be reduced while ensuring transmission performance as much as possible.
In one possible design, the data may be sent using a transmission control protocol, TCP, comprising:
transmitting at least one real-time transmission protocol RTP message obtained by packaging the data through a TCP channel;
transmitting the data using a user datagram protocol UDP, comprising:
and sending the at least one RTP message through a UDP channel.
Therefore, RTP messages can be transmitted through double channels, so that the low-delay transmission requirement of the service is met on the basis of ensuring reliability as much as possible.
In one possible design, the first device stores first identification information of the second device, and the method further includes:
Transmitting a first message using the first identification information;
acquiring second identification information of the second device through scanning;
Determining to retransmit the first message when the first identification information is different from the second identification information;
retransmitting the first message using the second identification information;
A response message to the retransmitted first message is received from the second device, the response message being used to instruct the first device to transmit data.
Taking the intelligent door lock as a first device and the television as a second device as an example, if the television IP address (one example of second identification information) obtained by scanning the intelligent door lock is inconsistent with the stored television IP address (one example of first identification information), which indicates that the television IP address stored by the intelligent door lock is not the current correct IP address of the television, the intelligent door lock retransmits the message 2 (one example of the first message) by using the television IP address obtained by scanning in real time, namely, retransmits the message 2 to the device corresponding to the scanned television IP address. Because the television IP address obtained by real-time scanning is the real IP address of the television, the message 2 is sent by using the scanned television IP address, so that the probability of the television successfully receiving the message 2 can be improved, and the success rate of the communication flow is further improved.
In one possible design, after attempting to obtain the second identification information of the second device by scanning, the method further includes:
Determining not to retransmit the first message when the first identification information is the same as the second identification information;
and receiving a response message of the first message sent by the second equipment.
In this way, in the scenario that the IP address of the television (one example of the second device) is unchanged, the intelligent door lock (one example of the first device) can quickly communicate with the television through the stored television IP address (one example of the first identification information), so that the communication efficiency and the communication success rate are improved. In the scene that the television IP address changes, the intelligent door lock can timely acquire the television IP address through the COAP scanning flow, and the scanned television IP address is used for communication, so that the reliability of communication is improved.
In one possible design, the method further comprises:
Storing the second identification information and deleting the first identification information; this saving and deleting process can be understood as replacing the first identification information with the second identification information or updating the first identification information to the second identification information. Thus, subsequently, the first device may send the first message using the saved second identification information, so as to improve the sending success probability of the first message.
In one possible design, the second device (e.g., a television) may also actively send updated identification information (e.g., an IP address) to the first device (e.g., a smart door lock) after updating the identification information, and the first device stores the updated identification information of the second device. Thus, the first device can communicate with the second device by using the updated identification information of the second device, so as to improve the probability of successful communication.
In one possible design, the identification information of the second device includes address information of the second device.
In a second aspect, a communication method is provided, applicable to a second device or a component supporting a function of the second device, the method comprising:
receiving first data through a Transmission Control Protocol (TCP) channel and receiving second data through a User Datagram Protocol (UDP) channel;
processing non-duplicate data in the first data and the second data;
Discarding repeated data in the first data and the second data.
Illustratively, the smart door lock sends RTP messages 1-6 to the television over a UDP channel and RTP messages 1-6 to the television over a TCP channel, as in fig. 6, because of the nature of UDP and TCP, the time for the television to receive the same RTP message over different channels may be different. The receiving order of the RTP message is assumed to be: RTP messages 1-4 (examples of second data) received over a UDP channel, RTP messages 1, 2 (examples of first data) received over a TCP channel, RTP messages 5, 6 (examples of second data) received over a UDP channel. The television may parse RTP messages 1-4 received over the UDP channel. For the repeated RTP messages 1 and 2 received through the TCP channel, the television can discard the repeated RTP messages 1 and 2 without analyzing the two RTP messages so as to reduce the processing consumption. The television may parse the RTP messages 5, 6 received over the UDP channel. The television can play the video according to the analysis result of the RTP messages 1-6.
In one possible design, the receiving the first data via a transmission control protocol, TCP, channel includes: receiving at least one real-time transmission protocol RTP message obtained by packaging the first data through a TCP channel;
receiving second data through a user datagram protocol, UDP, channel, comprising: and receiving at least one RTP message obtained by encapsulating the second data through a UDP channel.
In a third aspect, there is provided an apparatus for inclusion in a first device, the apparatus having functionality to implement the first device behaviour in any one of the methods of the above aspects and possible implementations. Or the apparatus is comprised in a second device, the apparatus having the functionality to implement the second device behaviour in any of the above aspects and possible implementations. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes at least one module or unit corresponding to the functions described above.
In a fourth aspect, a first device is provided that includes a memory and a processor. The memory is configured to store a program that, when executed by the processor, causes the first device to perform any of the methods of the first aspect and possible implementations.
In a fifth aspect, a second device is provided that includes a memory and a processor. The memory is for storing a program which, when executed by the processor, causes the second device to perform any of the methods of the second aspect and possible implementations described above.
A sixth aspect provides a readable storage medium comprising a program which when run on a first device causes the first device to perform the method as described in the above aspects and any one of the possible implementations.
A seventh aspect provides a readable storage medium comprising a program which when run on a second device causes the second device to perform the method as described in the above aspects and any one of the possible implementations.
An eighth aspect provides a program product which, when run on a device, causes the device to perform the method as described in any one of the possible implementations of the aspects described above.
A ninth aspect provides a communication system comprising a first device as described in any of the above aspects and in any of the possible implementations thereof, and a second device as described in any of the above aspects and in any of the possible implementations thereof.
It will be appreciated that the advantages achieved by the methods, apparatuses, readable storage media and program products provided in the second to ninth aspects may refer to the advantages provided in the first aspect and any possible implementation manner, and are not described here again.
Drawings
Fig. 1 is a diagram illustrating an architecture of a communication system according to an embodiment of the present application;
fig. 2 is a diagram illustrating a configuration of a communication device according to an embodiment of the present application;
FIG. 3A is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 3B is an exemplary diagram of interaction between an intelligent door lock and a television according to an embodiment of the present application;
fig. 4 to fig. 7 are diagrams illustrating a scenario of a dual channel transmission method according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating a communication method according to an embodiment of the present application;
Fig. 9A and fig. 9B are flowcharts illustrating a communication method according to an embodiment of the present application;
FIGS. 10 and 11 are exemplary diagrams of interfaces provided by embodiments of the present application;
Fig. 12 is a schematic structural diagram of a communication device according to the present application;
fig. 13 is a schematic diagram of a chip system according to the present application.
Detailed Description
The terms "first" and "second" and the like in the description and in the drawings are used for distinguishing between different objects or between different processes of the same object and not for describing a particular order of objects.
"At least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context associated object is an "or" relationship, e.g., a/B may represent a or B.
Furthermore, references to the terms "comprising" and "having" and any variations thereof in the description of the present application are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed but may optionally include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The system architecture and the service scenario described in the present application are for more clearly describing the technical solution of the present application, and do not constitute a limitation to the technical solution provided by the present application, and those skilled in the art can know that the technical solution provided by the present application is equally applicable to similar technical problems with the evolution of the system architecture and the occurrence of new service scenarios.
First, terms related to the embodiments of the present application will be described:
1. transmission control protocol (transmission control protocol, TCP)
TCP is a connection-oriented communication protocol, and has the characteristics of reliability, stability and the like. When the devices communicate by adopting TCP, the probability of packet loss is generally smaller, and the reliability of communication can be improved.
In some aspects, if transmission is based on TCP between devices, the message may be transmitted over a TCP channel. For example, video data is transmitted through the corresponding port.
2. User datagram protocol (user datagram protocol, UDP)
UDP is a non-connection oriented communication protocol. When the devices communicate by adopting UDP, the time delay is generally lower, and the communication efficiency can be improved.
In some aspects, if the devices are transmitting over UDP, the message may be transmitted over a UDP channel. For example, video data is transmitted through the corresponding port.
3. Real time streaming protocol (REAL TIME STREAMING protocol, RTSP)
RTSP is a protocol for pulling a data stream (abbreviated as a streaming protocol). Through RTSP, a client (client) can acquire multimedia data from a server (server). The multimedia data includes, but is not limited to, audio-visual data. The audio-video data includes audio data and/or video data.
4. Real-time transport protocol (real-time transport protocol, RTP)
In some schemes, when audio and video data is transmitted between the server and the client, the audio and video data may be packaged in an RTP packet (or RTP packet) and transmitted.
Currently, in RTSP protocol, the use of UDP to transport RTP messages is supported. In the transmission mode, under the network fluctuation state, RTP message transmission is unstable, and packet loss can occur at higher probability, so that images played by a playing end are abnormal, and screen display occurs.
5. Restricted application protocol (constrained application protocol, COAP)
In some related schemes, considering that compared with devices with higher processing capacity such as mobile phones, the internet of things devices such as intelligent door locks can use limited resources, the industry provides COAP for the internet of things devices. And running the COAP is beneficial to reducing the resource consumption of the equipment of the Internet of things.
Internet of things equipment such as intelligent door locks can acquire the IP address of the communication equipment in a COAP scanning mode, and then the Internet of things equipment can communicate with the communication equipment.
However, in some scenarios requiring low latency, such as when a visitor presses a doorbell, the smart door lock sends a video of the visitor to a television in the home of the host, the smart door lock finds that the television is used longer (e.g., about 500ms is needed) through COAP scanning, which results in the host viewing the video of the visitor after a longer period of time. Or in some scenes, if the intelligent door lock COAP fails to scan, large-screen equipment such as a television cannot be found, and the visitor video cannot be sent to the corresponding large-screen equipment. Therefore, the COAP scanning discovers that the large-screen equipment has high probability that the video picture is delayed to be sent or the video picture is failed to be sent, so that the host cannot quickly view the video picture of the visitor, and the user experience is poor.
In order to solve the technical problems, an embodiment of the present application provides a communication method. Fig. 1 shows one possible architecture of a communication system to which embodiments of the present application are applicable. As in fig. 1, the system may include a device 101 and a device 102. Device 101 may establish a communication connection with device 102 and interact with device 102 through the communication connection. Alternatively, device 101 may establish a communication connection with device 102 via, for example, a wireless fidelity (WIRELESS FIDELITY, wi-Fi) communication protocol. Device 101 may also establish a connection with device 102 via other communication protocols, as embodiments of the application are not limited in this regard.
Alternatively, the device 101 may be a smart door lock, a smart doorbell, a smart cat eye, or the like. The embodiment of the present application does not limit the specific form of the apparatus 101.
In the embodiment of the present application, the device 101 may also be referred to as a first device.
In some embodiments, device 102 may be a screen device (a device with a screen). For example, the device 102 may be a cell phone, a television, a screened speaker, a tablet, a screened refrigerator, etc. The embodiment of the present application is not limited to the specific form of the device 102. Device 101 may send a video stream to device 102 and a user may view the corresponding video through device 102.
In embodiments of the present application, device 102 may also be referred to as a second device.
Taking the device 101 as an intelligent door lock and the device 102 as a television as an example, after the intelligent door lock detects that a visitor presses a doorbell, a picture of the visitor can be transmitted to the television. For example, the intelligent door lock may initiate a video call that a user may answer through a television at home. Therefore, the user can know the identity of the visitor through the picture played by the television in the video call process, and whether the door is opened or not is judged according to the identity.
Fig. 1 illustrates only one possible example of a system architecture to which embodiments of the present application are applicable. The system architecture to which the embodiments of the present application are applicable is not limited thereto. For example, the system may include more or fewer devices.
Fig. 2 is a schematic diagram illustrating a hardware structure of the device 102 according to an embodiment of the present application. As shown in fig. 2, taking the device 102 as an example of a television, the device 102 may include at least one processor 201, a memory 202, at least one transceiver 203, and a display 204.
The processor 201 may be a general purpose central processing unit (central processing unit, CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
In an embodiment of the present application, the processor 201 may be used to process data. For example, when the television receives a UDP message and a TCP message with the same index from the smart door lock, meaning that the UDP message and the TCP message are duplicate messages, the processor of the television may discard the duplicate messages (e.g., TCP messages) received later.
Communication lines may be included between the components for communicating information between the components.
A transceiver 203 for communicating with other devices. In the embodiment of the present application, the transceiver may be a module, a circuit, a bus, an interface, or other devices capable of implementing a communication function, for communicating with other apparatuses. Alternatively, the transceiver may be a separately provided transmitter that is operable to transmit information to other devices, or a separately provided receiver that is operable to receive information from other devices. The transceiver may also be a component that integrates the functions of transmitting and receiving information, and embodiments of the present application are not limited to the specific implementation of the transceiver.
In an embodiment of the present application, the television may receive UDP messages and TCP messages from the device 101 (e.g., a smart door lock) through the transceiver 203.
The memory 202 may be, but is not limited to, read-only memory (ROM) or other type of static storage device that can store static information and instructions, random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, but may also be electrically erasable programmable read-only memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-only memory, EEPROM), compact disc read-only memory (compact disc read-only memory) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a device or computer. The memory may be stand alone and be coupled to the processor via a communication line. The memory may also be integrated with the processor.
The memory 202 is used for storing programs or codes or instructions for implementing the present application, and is controlled by the processor 201 to execute the program or codes or instructions. The processor 201 is configured to execute programs or codes or instructions stored in the memory 202, thereby implementing the methods provided by the embodiments of the present application.
In a particular implementation, the processor 201 may include one or more CPUs, as one embodiment.
In a particular implementation, as one embodiment, the communication device 200 may include a plurality of processors. Each of these processors may be a single-core (single-CPU) processor or may be a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., programs or code or instructions).
The display 204 is used to display images, videos, and the like. The display 204 may include a display panel. In some embodiments, the electronic device may include 1 or N displays, N being a positive integer greater than 1.
In the embodiment of the present application, the display screen 204 may be used to display the image or video of the visitor sent by the intelligent door lock. Thus, the user can know the information of the visitor through the visitor image or the visitor video displayed in the television display screen.
By way of example, the structure of the device 101 (such as a smart door lock) may refer to the structure shown in fig. 2. The device 101 may include a processor 201, a memory 202, and a transceiver 203. The specific implementation of the processor 201, the memory 202, and the transceiver 203 may be referred to the above description of the corresponding embodiment of fig. 2, which is not repeated here.
In the embodiment of the application, the transceiver 203 of the intelligent door lock can transmit data in a double-channel mode, so that the low-time delay transmission requirement of the service can be met on the basis of ensuring the reliability as much as possible.
The present application will present various aspects, embodiments, or features about a system that may include a plurality of devices, components, modules, etc. It is to be understood and appreciated that the various systems may include additional devices, components, modules, etc. and/or may not include all of the devices, components, modules etc. discussed in connection with the figures. Furthermore, combinations of these schemes may also be used.
Some of the scenarios in the embodiments of the present application will be described by taking the scenario in the communication system shown in fig. 1 as an example. It should be noted that the solution in the embodiment of the present application may also be applied to other communication systems, and the corresponding names may also be replaced by names of corresponding functions in other communication systems.
For easy understanding, the communication method provided by the embodiment of the application is specifically described below with reference to the accompanying drawings. The following embodiments mainly describe the case where the device 101 is an intelligent door lock and the device 102 is a television, but this does not limit the implementation forms of the device 101 and the device 102.
As shown in fig. 3A, an embodiment of the present application provides a communication method, including:
s101, the intelligent door lock acquires a stored television address.
Alternatively, the smart door lock and the television may be within the same local area network. When a certain condition is satisfied, the smart door lock may acquire stored television identification information (an example of the first identification information) and communicate with the television using the stored television identification information. Alternatively, the identification information of the television may include, but is not limited to, internet protocol (internet protocol, IP) address of the television, media access Control (MEDIA ACCESS Control, MAC) address, device identification. In the embodiment of the present application, the identification information is mainly described by taking an IP address as an example, and is described in detail herein, and the details are not repeated here.
For example, when detecting that a visitor presses a doorbell, the intelligent door lock may acquire a stored television IP address and perform the following procedure to send a visitor-related video picture to the television.
In some embodiments, the smart door lock may also start and initialize (REAL TIME STREAMING protocol, RTSP) the service end in preparation for subsequent video data transmission. Subsequently, the intelligent door lock can transmit video data to the on-screen device through the RTSP server.
Alternatively, the server may use a policy to allocate a communication port for transmitting video data. For example, a communication port for transmitting video data is randomly generated.
S102, the intelligent door lock sends a message according to the stored television address.
Wherein the message may be message 2 (msg 2).
As a possible implementation manner, before this procedure, the intelligent door lock has acquired the IP address of the television, and may store the IP address of the television in its own storage space. For example, before, the intelligent door lock detects that a visitor presses a doorbell, acquires an IP address of a television through a COAP scanning mode, and sends a video picture of the visitor to the television. And the intelligent door lock can store the scanned television IP address.
In this flow, the intelligent door lock can inquire whether the IP address of the television is stored. If the intelligent door lock stores the IP address of the television (which may be referred to as IP address 1), the intelligent door lock may use the IP address 1 (one example of the first identification information) to send message 2 (one example of the first message) to the device corresponding to the IP address 1. In one case, after the intelligent door lock stores the IP address of the television, if the IP address of the television is not changed, the IP address (IP address 1) of the television stored in the intelligent door lock is the current IP address of the television. The intelligent door lock sends the message 2 according to the stored television IP address 1, which means that the intelligent door lock sends the message 2 to the television according to the current IP address of the television, so that the probability of the television successfully receiving the message 2 can be improved. In addition, the intelligent door lock can acquire the IP address of the television only through COAP scanning and television interaction, so that the communication efficiency is low.
Optionally, as shown in fig. 4, the intelligent door lock sends message 2, including: message 2 is sent using UDP and message 2 is sent using TCP. Therefore, under the condition that the network environment is stable, based on the characteristics of UDP, the message 2 can be timely transmitted to the television, and the communication efficiency is improved. Under the condition of network environment fluctuation, based on the characteristic of TCP, the message 2 can be reliably transmitted to the television, and the packet loss of the message 2 is avoided.
Optionally, message 2 includes a device identification (device id) of the smart door lock, an encrypted uniform resource location system (uniform resource locator, URL) address of the smart door lock.
S103, the intelligent door lock starts a COAP scanning flow.
The COAP scanning flow is used for acquiring the IP address of the television.
As one possible implementation, considering that the IP address of the tv may change, the tv IP address stored by the smart door lock may not be accurate, in order to increase the success probability of communication, the smart door lock may send the message 2 using the tv IP address stored by the internal memory, and start the COAP scanning procedure, so that the accurate tv IP address (an example of the second identification information) may be attempted to be obtained through the COAP scanning procedure.
That is, the intelligent door lock can respectively acquire the television IP address in two ways so as to improve the success rate and the accuracy of acquiring the television IP address.
And S104, if the scanned television address is consistent with the stored television address, the intelligent door lock determines that the message is not retransmitted.
Through the COAP scanning flow, the intelligent door lock can acquire the IP address of the television. Under the circumstance, if the intelligent door lock does not receive the response message for the message 2 after obtaining the television IP address through the COAP scanning flow, it means that the intelligent door lock cannot determine whether the stored television IP address is the correct television IP address. In this case, the intelligent door lock needs to compare the scanned tv IP address with the stored tv IP address, and determine whether to retransmit the message 2 according to the comparison result. In the example corresponding to fig. 3A, if the scanned tv IP address (one example of the second identification information) is consistent with the stored tv IP address (one example of the first identification information), it is indicated that the tv IP address stored in the intelligent door lock is the correct tv IP address, and the message 2 sent by the intelligent door lock using the tv IP address can be received successfully by the tv, and the intelligent door lock does not need to retransmit the message 2.
In one case, step S104 is optional.
For example, before the intelligent door lock obtains the scanning result of the television IP address, if the response message for the message 2 is received from the television, it is indicated that the television IP address stored in the intelligent door lock is the correct television IP address, and the intelligent door lock does not need to obtain the television IP address through COAP scanning. In this case, the smart door lock may terminate the COAP scanning procedure, and step S104 is not performed any more. Thus, the processing cost of the intelligent door lock can be reduced.
For another example, after the intelligent door lock scans to obtain the television IP address, before comparing the scanned television IP address with the stored television IP address, if a response message for the message 2 has been received from the television, it also indicates that the television IP address stored by the intelligent door lock is the correct television IP address, and the intelligent door lock does not need to obtain the television IP address through COAP scanning. In this case, the intelligent door lock may not perform step S104 any more, that is, the scanned tv IP address is not compared with the stored tv IP address. Thus, the processing cost of the intelligent door lock can be reduced.
Therefore, in the scene that the IP address of the television is unchanged, the intelligent door lock can rapidly communicate with the television through the stored IP address of the television, and the communication efficiency and the communication success rate are improved. In the scene that the television IP address changes, the intelligent door lock can timely acquire the television IP address through the COAP scanning flow, and the scanned television IP address is used for communication, so that the reliability of communication is improved.
Optionally, after determining that the scanned tv IP address is consistent with the stored tv IP address, the intelligent door lock may wait for the tv to return a response message for the message 2 for a period of time. In one case, if the intelligent door lock receives a response message to the message 2 from the television for a period of time, the intelligent door lock may not retransmit the message 2. In another case, if the intelligent door lock does not receive a response message for the message 2 from the television within a period of time, the intelligent door lock may retransmit the message 2.
S105, the television returns a response message for the message 2 to the intelligent door lock.
Accordingly, the smart door lock receives a response message for message 2 from the television. The response message is used to indicate transmission of video data.
It should be appreciated that if the smart door lock is able to receive a response message for message 2 from the television, it is stated that the television has received message 2 from the smart door lock and the television requests to play a video picture. In this case, the smart door lock may perform the following steps S106 and S107 to transmit the video stream corresponding to the video picture to the television.
S106, the intelligent door lock sends video data by using TCP.
As one possible implementation manner, the intelligent door lock may split the video data into one or more RTP packets (or RTP packets), and send the one or more RTP packets corresponding to the video data to the television through the TCP channel.
S107, the intelligent door lock sends video data by using UDP.
Accordingly, the television receives video data (one example of first data) through a TCP channel and video data (one example of second data) through a UDP channel, and processes non-duplicate data of the first data and the second data, discarding duplicate data of the first data and the second data.
As one possible implementation, the smart door lock may send one or more RTP messages corresponding to video data to the television using UDP.
In the embodiment of the application, the current RTP message transmission mechanism is improved, and a synchronous double-channel RTP message transmission scheme is provided. Specifically, the dual channel transmission refers to: for at least one RTP message, the intelligent door lock transmits the at least one RTP message through a TCP channel and transmits the at least one RTP message through a UDP channel. Illustratively, as shown in FIG. 5, the smart door lock sends RTP messages 1-6 over the TCP channel and RTP messages 1-6 over the UDP channel.
Therefore, under the scenes of stable network environment or better network quality and the like, the RTP message transmitted through the UDP channel can be more quickly transmitted to the television, the communication time delay is lower, and the time delay of video playing of the television can be further reduced. Under the scenes of network environment fluctuation or poor network quality and the like, the reliability and stability of the RTP message transmitted through the TCP channel are higher, and the packet loss probability can be reduced so as to improve the effect of television video playing (such as avoiding the problem of video picture screen display caused by packet loss). Therefore, the scheme for transmitting the RTP message through the double channels can be suitable for different network environment scenes, and the communication performance under the corresponding network environment is ensured as much as possible.
S108, the television plays according to the video data.
As one possible implementation, a television has a client installed therein. After the television receives the video data, the video may be played through the client.
Optionally, after the television receives the video data, deduplication may be performed with respect to the received video data.
Illustratively, the door lock sends RTP messages 1-6 to the television over the UDP channel and RTP messages 1-6 to the television over the TCP channel, as shown in FIG. 6, the time that the television receives the same RTP message over different channels may be different due to the characteristics of UDP and TCP. The receiving order of the RTP message is assumed to be: RTP messages 1-4 received through the UDP channel, RTP messages 1, 2 received through the TCP channel, and RTP messages 5, 6 received through the UDP channel. The television may parse RTP messages 1-4 received over the UDP channel. For the repeated RTP messages 1 and 2 received through the TCP channel, the television can discard the repeated RTP messages 1 and 2 without analyzing the two RTP messages so as to reduce the processing consumption. The television may parse the RTP messages 5, 6 received over the UDP channel. The television can play the video according to the analysis result of the RTP messages 1-6.
Further exemplary, the smart door lock sends RTP messages 1-6 to the television over the UDP channel and RTP messages 1-6 to the television over the TCP channel, as shown in fig. 7, the television receives RTP messages 1, 3,4, 6 from the smart door lock over the UDP channel (RTP messages 2, 5 are dropped), and receives RTP messages 1-5 from the smart door lock over the TCP channel. Assume that the receiving order of each RTP packet is as follows: RTP messages 1, 3 and 4 received through the UDP channel, RTP messages 1-4 received through the TCP channel, RTP message 6 received through the UDP channel, and RTP message 5 received through the TCP channel. After receiving the RTP messages 1, 3 and 4 through the UDP channel, the television may analyze the RTP messages 1, 3 and 4. After receiving the RTP message 2 through the TCP channel, the tv can parse the RTP message 2. After receiving the RTP message 6 through the UDP channel, the tv may parse the RTP message 6. After receiving the RTP message 5 through the TCP channel, the tv may parse the RTP message 5. The television can play the video according to the analysis result of each RTP message.
Fig. 3B shows the protocol stack of the smart door lock and the television, and the flow of the dual channel transmission through the protocol stack. As shown in fig. 3B, the intelligent door lock may split video data into at least one RTP message through an application program of an application layer. Taking the processing and transmission of the RTP message 1 in at least one RTP message as an example, the application program transmits the RTP message 1 to the UDP entity and the TCP entity of the transport layer. The UDP entity processes (e.g., encapsulates) the RTP packet 1 to obtain a UDP packet 1. The UDP message 1 may include a header and a payload. The payload of the UDP packet 1 may include video data in the RTP packet 1. The header of the UDP message may include an index of the UDP message (e.g., index 1). And then, the UDP entity transmits the obtained UDP message 1 to a lower entity, and the lower entity processes the UDP message 1.
Similarly, the TCP entity processes the RTP message 1 to obtain the TCP message 1. The TCP packet 1 may include a header and a payload. The payload of the TCP packet 1 may include video data in the RTP packet 1. The header of the TCP packet may include an index of the TCP packet (the same as the index of UDP packet 1, and the index is 1). And then, the TCP entity transmits the obtained TCP message 1 to a lower-layer entity, and the lower-layer entity processes the TCP message 1. For example, table 1-1 shows examples of TCP packet 1 and UDP packet 1, respectively:
TABLE 1-1 TCP message 1
TABLE 1-2 UDP message 1
After being processed layer by layer, the UDP message 1 and the TCP message 1 reach a physical layer entity of a physical layer, and the physical layer entity transmits the UDP message 1 and the TCP message 1 to the physical layer entity of the television.
After receiving UDP message 1 and TCP message 1, the physical layer entity of the tv may transmit UDP message 1 and TCP message 1 to the entity above. Udp packet 1 arrives at the transport layer faster after layer-by-layer processing than TCP packet 1. The UDP entity of the transport layer may process (e.g., decapsulate) the UDP packet to obtain RTP packet 1, and transmit the RTP packet 1 to an application program of the application layer. And the application program plays the corresponding video according to the RTP message 1.
Tcp message 1 arrives at the transport layer slower after layer-by-layer processing than UDP message 1. After the TCP entity of the transmission layer decapsulates the TCP message 1, the index of the TCP message is found to be 1, which means that the TCP message 1 is identical to the video data carried by the UDP message 1. The TCP entity then discards TCP message 1 and no longer reports to the upper layer application.
In the above-mentioned scenario where the IP address of the tv is unchanged, in other embodiments, the IP address of the tv may be changed. In this case, the method flow of the embodiment of the present application may include steps such as those shown in fig. 8:
s101, the intelligent door lock acquires a stored television address.
S102, the intelligent door lock sends a message 2 by using the stored television address.
S103, the intelligent door lock starts a COAP scanning flow.
The specific implementation of steps S101 to S103 may be referred to the description of the corresponding steps in the above embodiment.
S201, if the scanned television address is inconsistent with the stored television address, the intelligent door lock determines to retransmit the message 2.
It should be understood that if the scanned tv IP address is inconsistent with the stored tv IP address, which indicates that the tv IP address stored in the intelligent door lock is not the correct current tv IP address, the intelligent door lock retransmits the message 2 using the tv IP address obtained by real-time scanning, that is, retransmits the message 2 to the device corresponding to the scanned tv IP address. Because the television IP address obtained by real-time scanning is the real IP address of the television, the message 2 is sent by using the scanned television IP address, so that the probability of the television successfully receiving the message 2 can be improved, and the success rate of the communication flow is further improved.
Optionally, the smart door lock stores the scanned tv IP address (an example of the second identification information) in the memory, and deletes the previously stored tv IP address (an example of the first identification information) so as to facilitate subsequent quick communication with the tv using the stored tv IP address.
S202, the intelligent door lock retransmits the message 2 by using the scanned television address.
S105, the television sends a response message for the message 2 to the intelligent door lock.
Accordingly, the smart door lock receives a response message from the television for the retransmitted message 2.
The specific implementation of steps S105 to S107 may be referred to the relevant implementation of the corresponding steps of the above embodiment.
S106, the intelligent door lock sends video data by using TCP.
S107, the intelligent door lock sends video data by using UDP.
The embodiment of the application also provides a communication method, when the first equipment meets the first condition, the first equipment communicates with the second equipment through the two-channel transmission scheme. When the first condition is not satisfied, the related art may be used to communicate with the second device. As shown in fig. 9A, the method may include steps S101-S105, and the method further includes steps S301, S302, and S303. The specific implementation of steps S101-S105 may be referred to above in connection with fig. 3A or fig. 8. Steps S301, S302, and S303 are described as follows:
S301, the first device determines that a first condition that allows transmission of traffic data using TCP and UDP is satisfied.
Alternatively, the first device includes, but is not limited to, device 101 as shown in FIG. 1. The second device includes, but is not limited to, device 102 as shown in fig. 1.
Optionally, the first condition may include at least one of: the data to be transmitted is the data of the first service, and the communication quality of the current network is lower than a threshold value.
Optionally, the first service includes any one of the following: game, net lesson, instant communication, live broadcast, red packet, screen throwing, internet of things service, industrial internet of things service and streaming media service. The streaming media service includes a real-time streaming media service. The first traffic is low latency traffic. The first service may also be other low-latency services, and the embodiment of the present application does not limit the specific type of the first service.
As one possible implementation, the first device may obtain one or more communication parameters, and determine a communication quality of the network according to the one or more communication parameters.
Optionally, the communication parameters include, but are not limited to, any one or more of the following: received signal strength indicator (RECEIVED SIGNAL STRENGTH indicator, RSSI), throughput, packet loss rate, retransmission rate.
As a possible implementation manner, the first device may configure a certain weight for each communication parameter, and calculate a communication quality score of the network according to each communication parameter and the corresponding weight, where the communication quality score is used to characterize the communication quality of the network.
It should be understood that the first condition may be other conditions, and any condition may be used as the first condition as long as it is suitable for transmission using the two-channel system.
S302, the first device sends service data by using TCP.
S303, the first device sends service data using UDP.
The specific implementation manner of steps S302 and S303 may refer to the relevant content of S106 and S107, which are not described herein.
It can be seen that in some scenarios, when the first device determines that the communication quality of the current network is poor, the first device may communicate through the above dual-channel transmission scheme, that is, transmit the message in parallel through the TCP channel and the UDP channel. Therefore, the message is transmitted through the UDP channel and the TCP channel, so that the redundancy of the message can be improved when the network communication quality is poor. Therefore, the probability of retransmitting the message can be reduced, the transmission delay of the message is reduced, and meanwhile, the transmission reliability of the message is improved, so that the overall performance of communication is improved.
Similarly, in some scenarios, the first device may communicate via the dual channel transmission scheme described above when it determines that the message to be transmitted is a message of a low latency service. Therefore, the redundancy of the message can be improved, the probability of retransmitting the message is further reduced, the transmission delay of the message is reduced, and the low-delay transmission requirement of the service is met. Meanwhile, as the message redundancy is improved, the reliability of message transmission can be improved, so that the low-delay transmission requirement of the service is met on the basis of ensuring the reliability as much as possible.
The embodiment of the application also provides a communication method, and the equipment can dynamically switch the transmission channel. For example, when data transmission starts, the device uses a single channel (UDP or TCP channel) for transmission, and subsequently, detects that the first condition (such as poor network quality) is met, the device can switch to a dual-channel mode for transmission, so that the low-delay transmission requirement of the service can be met on the basis of ensuring reliability as much as possible. For another example, the device uses a dual-channel mode to perform transmission initially, and subsequently, if it is detected that the network quality is better, the device can switch to a single channel (such as a UDP channel) to perform transmission, so that transmission overhead is reduced under the condition that transmission performance is ensured as much as possible. An example of the flow of the method is shown in fig. 9B, and as in fig. 9B, the method includes:
S401, the first device determines that a first condition is met.
S402, the first device sends service data using a transmission control protocol.
S403, the first device sends service data by using the user datagram protocol.
The specific implementation of S401 to S403 may be referred to steps S301 to S303 of the above embodiment. When the first equipment meets the first condition, the service data can be transmitted in a double-channel mode.
S404, the first device determines that the communication quality of the network is higher than or equal to a threshold.
S405, the first device sends service data using a user datagram protocol.
The first device detects that the communication quality of the network is higher, which means that the packet loss probability in the transmission process is lower, the reliability of the transmission is higher, and the transmission can be switched to a single channel for transmission. In this way, transmission overhead can be reduced while ensuring transmission performance as much as possible.
In this case, the service data is sent from the dual-channel switch to the UDP channel, and in other embodiments, the service data may be transferred from the dual-channel switch to the TCP channel.
In some embodiments of the present application, the first device, the second device may default to always turn on the first function. The first function is the function of the dual channel transmission. The first device and the second device can always adopt the method provided by the embodiment of the application by default. In this way, the transmission performance can be improved without perception by the user.
Or in other embodiments, a corresponding switch may be provided in a corresponding device (such as a third device), through which a user may manually turn on or off the dual channel transmission function of the first device and the second device. For example, as shown in fig. 10, a switch control 1002 may be provided in an intelligent door lock setting interface 1001 of a mobile phone, so that a user may turn on or off a dual channel transmission function provided by an embodiment of the present application. When the switch is opened, the intelligent door lock has the function of dual-channel transmission, and can transmit data in a dual-channel mode, so that the low-delay transmission requirement of the service can be met on the basis of ensuring reliability as much as possible.
In other embodiments, the user may set, through the third device, a service type for starting the dual-channel transmission function, and for a service for starting the dual-channel transmission function, the corresponding device (e.g., the first device and the second device) may improve the transmission performance of the service through the dual-channel transmission method provided by the embodiment of the present application.
Optionally, the first device and the second device default on the dual-channel transmission function of some service types.
Or alternatively, the third device provides a setting entry for the user, and the user sets and selects the service type for starting the dual-channel transmission function. Illustratively, referring to FIG. 10, a user can unlock the dual channel transmission function of the smart door lock by, for example, opening a switch 1002 and trigger the handset to display a rights settings interface 1101 as shown in FIG. 11 by, for example, clicking on a control 1003 as shown in FIG. 10. The user can unlock the dual channel transmission function of the intelligent door lock to the corresponding service through the interface 1101. For example, if the user selects the video call service, the mobile phone can unlock the dual-channel transmission function of the intelligent door lock for the video call service. Subsequently, when the intelligent door lock initiates a video call to a home screen device (such as a sound box), the intelligent door lock can send video data through the UDP channel and the TCP channel, so that the transmission delay is reduced on the premise of ensuring the communication reliability as much as possible, and the fluency of the video call is improved.
It should be noted that the above setting entry provided by the third device to the user for setting the dual channel transmission function is merely an example, and the setting entry (including but not limited to setting through an interface) may be other.
The above description mainly uses two channels as UDP channel and TCP channel as an example, and in other embodiments, the two channels may be other two channels, where different channels correspond to different transmission characteristics. For example, different channels correspond to different latency, reliability characteristics.
Illustratively, the device may transmit at least one RTP message using a cellular network channel and transmit the at least one RTP message using TCP. Thus, the transmission performance can be improved by utilizing the transmission characteristics of the cellular network channel and the TCP channel.
The above embodiments may be combined and the combined solution may be implemented. Optionally, some operations in the flow of method embodiments are optionally combined, and/or the order of some operations is optionally changed. The order of execution of the steps in each flow is merely exemplary, and is not limited to the order of execution of the steps, and other orders of execution may be used between the steps. And is not intended to suggest that the order of execution is the only order in which the operations may be performed. Those of ordinary skill in the art will recognize a variety of ways to reorder the operations described herein. In addition, it should be noted that details of processes involved in a certain embodiment herein are equally applicable to other embodiments in a similar manner, or may be used in combination between different embodiments.
Moreover, some steps in method embodiments may be equivalently replaced with other possible steps. Or some steps in method embodiments may be optional and may be deleted in some usage scenarios. Or other possible steps may be added to the method embodiments.
Moreover, the method embodiments described above may be implemented alone or in combination.
Further embodiments of the present application provide an apparatus, which may be the first device or the second device or a component supporting the functionality of the first device or a component supporting the functionality of the second device, etc. The apparatus may include: a display screen, a memory, and one or more processors. The display, memory, and processor are coupled. The memory is for storing a program, the program including instructions. The apparatus may perform the respective functions or steps performed by the first device or the second device in the above-described method embodiments when the processor executes the instructions. The structure of the device can be referred to as an electronic apparatus (device) shown in fig. 2.
The core structure of the device may be represented as the structure shown in fig. 12, where the device includes: a processing module 1701, an input module 1702, a storage module 1703, and a display module 1704.
The processing module 1701 may include at least one of a Central Processing Unit (CPU), an application processor (Application Processor, AP), or a communication processor (Communication Processor, CP). The processing module 1701 may perform operations or data processing related to control and/or communication of at least one of the other elements of the consumer electronic device.
Taking the device as a first device as an example, a processing module is used for acquiring data to be transmitted.
In one possible design, the processing module is further configured to:
Before the data is sent by using a Transmission Control Protocol (TCP) and the data is sent by using a User Datagram Protocol (UDP), judging whether a first condition is met or not; the first condition includes at least one of: the data are data of a first service, and the communication quality of a current network is lower than a threshold value;
In a possible design, the processing module is further configured to detect that the communication quality of the current network is higher than or equal to a threshold value after the data is sent using transmission control protocol TCP and the data is sent using user datagram protocol UDP.
In one possible design, the first device stores first identification information of the second device;
The processing module is further used for: acquiring second identification information of the second device through scanning while the communication module transmits a first message by using the first identification information; determining to retransmit the first message when the first identification information is different from the second identification information;
In one possible design, the processing module is further configured to determine not to retransmit the first message when the first identification information is the same as the second identification information after attempting to acquire the second identification information of the second device by scanning.
In one possible design, the processing module is further configured to store the second identification information in a storage module, and delete the first identification information.
In one possible design, the identification information of the second device includes address information of the second device.
Taking the device as a second device for example, a processing module is used for processing non-repeated data in the first data and the second data and discarding repeated data in the first data and the second data.
Wherein the first data is data received through a TCP channel and the second data is data received through a UDP channel.
The input module 1702 is configured to obtain an instruction or data input by a user, and transmit the obtained instruction or data to other modules of the electronic device. Specifically, the input mode of the input module 1702 may include touch, gesture, proximity screen, or voice input. For example, the input module may be a screen of the electronic device, acquire an input operation of the user, generate an input signal according to the acquired input operation, and transmit the input signal to the processing module 1701.
The memory module 1703 may include volatile memory and/or nonvolatile memory. The storage module is used for storing at least one relevant instruction or data in other modules of the user equipment device.
The display module 1704 may include, for example, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, an Organic Light Emitting Diode (OLED) display, a microelectromechanical system (MEMS) display, or an electronic paper display. For displaying user viewable content (e.g., text, images, video, icons, symbols, etc.).
Optionally, a communication module 1705 is also included for supporting the device to communicate with other devices (via a communication network). For example, the communication module may be connected to a network via wireless communication or wired communication to communicate with other personal devices or web servers. The wireless communication may employ at least one of cellular communication protocols such as Long Term Evolution (LTE), long term evolution-advanced (LTE-a), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), universal Mobile Telecommunications System (UMTS), wireless broadband (WiBro), or global system for mobile communications (GSM) or 5G. The wireless communication may include, for example, short-range communication. The short-range communication may include at least one of wireless fidelity (Wi-Fi), bluetooth, near Field Communication (NFC), magnetic Stripe Transmission (MST), or GNSS.
Taking the apparatus as the first device as an example, in one possible design, the communication module is configured to send the data using TCP and send the data using UDP.
In one possible design, the communication module for transmitting the data using TCP and the data using UDP includes:
Transmitting the data using TCP and transmitting the data using UDP when the first condition is satisfied;
wherein the first service comprises any one of the following: game, net lesson, instant communication, live broadcast, red packet, screen throwing, internet of things service, industrial internet of things service and streaming media service.
In one possible design, the communication module is further configured to send the data using TCP or send the data using UDP in a scenario where the communication quality of the current network is higher than or equal to the threshold.
In one possible design, the communication module is configured to send the data using TCP, and includes: at least one RTP message obtained by packaging the data is sent through a TCP channel;
a communication module for transmitting the data using UDP, comprising: and sending the at least one RTP message through a UDP channel.
In one possible design, the communication module is further configured to send a first message using the first identification information.
In one possible design, the communication module is further configured to: retransmitting the first message using the second identification information; a response message to the retransmitted first message is received from the second device, the response message being used to instruct the first device to transmit data.
And the communication module is also used for receiving a response message of the first message sent by the second equipment.
Taking the device as a second device for example, the communication module is configured to receive the first data through a TCP channel and receive the second data through a UDP channel.
In one possible design, the communication module is configured to receive first data through a TCP channel, including: receiving at least one real-time transmission protocol RTP message obtained by packaging the first data through a TCP channel;
a communication module for receiving second data through a UDP channel, comprising: and receiving at least one RTP message obtained by encapsulating the second data through a UDP channel.
It should be noted that each functional module of the apparatus may perform one or more steps of the above-described method embodiments.
Embodiments of the present application also provide a chip system, as shown in fig. 13, which includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 may be interconnected by wires. For example, interface circuit 1402 may be used to receive signals from other devices (e.g., a memory of an electronic apparatus). For another example, interface circuit 1402 may be used to send signals to other devices (e.g., processor 1401). Illustratively, the interface circuit 1402 may read instructions stored in the memory and send the instructions to the processor 1401. The instructions, when executed by the processor 1401, may cause the electronic device to perform the various steps of the embodiments described above. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
The embodiment of the application also provides a storage medium, which includes a program or instructions that when executed on a first device or a second device, cause the first device or the second device to perform the functions or steps performed by the first device or the second device in the above-described method embodiment.
The embodiment of the application also provides a program product, when the program product runs on the first device or the second device, the first device or the second device is caused to execute the functions or steps executed by the first device or the second device in the embodiment of the method.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and the division of modules or units, for example, is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (13)
1. A method of communication, applied to a first device, the method comprising:
Acquiring data to be transmitted;
The data is sent using the transmission control protocol TCP and the data is sent using the user datagram protocol UDP.
2. The method of claim 1, wherein prior to said transmitting said data using transmission control protocol, TCP, and said transmitting said data using user datagram protocol, UDP, said method further comprises:
Judging whether a first condition is met, wherein the first condition comprises at least one of the following: the data are data of a first service, and the communication quality of a current network is lower than a threshold value;
transmitting the data using a transmission control protocol, TCP, and transmitting the data using a user datagram protocol, UDP, comprising:
Transmitting the data using TCP and transmitting the data using UDP when the first condition is satisfied;
The first service includes any one of the following: game, net lesson, instant communication, live broadcast, red packet, screen throwing, internet of things service, industrial internet of things service and streaming media service.
3. The method according to claim 1 or 2, characterized in that after said sending said data using transmission control protocol TCP and said sending said data using user datagram protocol UDP, the method further comprises:
Detecting that the communication quality of the current network is higher than or equal to a threshold value;
The data is transmitted using TCP or UDP.
4. A method according to any one of claim 1 to 3, wherein,
Transmitting the data using a transmission control protocol TCP, comprising: transmitting at least one real-time transmission protocol RTP message obtained by packaging the data through a TCP channel;
transmitting the data using a user datagram protocol UDP, comprising: and sending the at least one RTP message through a UDP channel.
5. The method of any of claims 1-4, wherein the first device stores first identification information for the second device, the method further comprising:
Transmitting a first message using the first identification information;
acquiring second identification information of the second device through scanning;
Determining to retransmit the first message when the first identification information is different from the second identification information;
retransmitting the first message using the second identification information;
A response message to the retransmitted first message is received from the second device, the response message being used to instruct the first device to transmit data.
6. The method of claim 5, wherein after attempting to obtain the second identification information of the second device by scanning, the method further comprises:
Determining not to retransmit the first message when the first identification information is the same as the second identification information;
and receiving a response message of the first message sent by the second equipment.
7. The method according to claim 5 or 6, characterized in that the method further comprises:
And storing the second identification information and deleting the first identification information.
8. A method of communication, for application to a second device, the method comprising:
receiving first data through a Transmission Control Protocol (TCP) channel and receiving second data through a User Datagram Protocol (UDP) channel;
processing non-duplicate data in the first data and the second data;
Discarding repeated data in the first data and the second data.
9. The method of claim 8, wherein the step of determining the position of the first electrode is performed,
The receiving the first data through a transmission control protocol TCP channel includes: receiving at least one real-time transmission protocol RTP message obtained by packaging the first data through a TCP channel;
receiving second data through a user datagram protocol, UDP, channel, comprising: and receiving at least one RTP message obtained by encapsulating the second data through a UDP channel.
10. A first device comprising a memory and a processor; the memory is configured to store a program which, when executed by the processor, causes the first device to perform the method of any of claims 1-7.
11. A second device comprising a memory and a processor; the memory is configured to store a program which, when executed by the processor, causes the second device to perform the method of claim 8 or 9.
12. A readable storage medium comprising a program which, when run on a device, causes the device to perform the method of any one of claims 1-7 or causes the device to perform the method of claim 8 or 9.
13. A communication system comprising a first device according to any of claims 1-7 and a second device according to claim 8 or 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310117051.1A CN118413580A (en) | 2023-01-30 | 2023-01-30 | Communication method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310117051.1A CN118413580A (en) | 2023-01-30 | 2023-01-30 | Communication method, device and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118413580A true CN118413580A (en) | 2024-07-30 |
Family
ID=92031316
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310117051.1A Pending CN118413580A (en) | 2023-01-30 | 2023-01-30 | Communication method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118413580A (en) |
-
2023
- 2023-01-30 CN CN202310117051.1A patent/CN118413580A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7580005B1 (en) | Display change between mobile terminal display and external device display | |
CN102461143B (en) | Portable terminal device, communication device, control method for each of the devices, and communication system | |
US20070286121A1 (en) | Systems and techniques for selective point-to-multipoint retransmission of multicast frames in a wireless network | |
US9813890B2 (en) | Method and apparatus for receiving contents in mobile communication system | |
US20180091581A1 (en) | Method of switching download mode, control method thereof and control system thereof | |
US20130346562A1 (en) | Data transmission method and apparatus for mobile terminal | |
US20100172335A1 (en) | Data transmission method and apparatus based on Wi-Fi multimedia | |
WO2022089088A1 (en) | Display device, mobile terminal, screen-casting data transmission method, and transmission system | |
US9781579B2 (en) | Method and device for realizing terminal WIFI talkback | |
CN106210598B (en) | Video call method, device and system | |
US9661493B2 (en) | Apparatus and method for providing a wireless communication in a portable terminal | |
CN112291366A (en) | Data transmission method, device, storage medium and electronic equipment | |
US20160338015A1 (en) | Data processing method, apparatus and system | |
US20160248807A1 (en) | Detection and mitigation of denial-of-service attacks in wireless communication networks | |
EP4287591A1 (en) | Data transmission method and apparatus, and server, storage medium and program product | |
EP2916569B1 (en) | User terminal apparatus and driving method | |
CN114630300A (en) | Method and communication device for transmitting data | |
US9729867B2 (en) | Wireless communication terminal and communication control method | |
CN118413580A (en) | Communication method, device and system | |
CN112383801B (en) | Media stream distribution method, device, distribution server and storage medium | |
CN115811510A (en) | Method and device for realizing talkback service and talkback service system | |
US9967190B2 (en) | Session link control method and apparatus, and computer storage medium | |
US20170085623A1 (en) | Content downloading and network provisioning | |
EP2922338A1 (en) | Method and apparatus for providing content according to type of communication network | |
CN106792130B (en) | Mobile terminal and control method of mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |