CN117793223A - Data transmission method, device and equipment - Google Patents

Data transmission method, device and equipment Download PDF

Info

Publication number
CN117793223A
CN117793223A CN202211142442.0A CN202211142442A CN117793223A CN 117793223 A CN117793223 A CN 117793223A CN 202211142442 A CN202211142442 A CN 202211142442A CN 117793223 A CN117793223 A CN 117793223A
Authority
CN
China
Prior art keywords
data transmission
indication information
session
equipment
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211142442.0A
Other languages
Chinese (zh)
Inventor
蒋启平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile IoT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202211142442.0A priority Critical patent/CN117793223A/en
Publication of CN117793223A publication Critical patent/CN117793223A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a data transmission method, a data transmission device and data transmission equipment, and relates to the technical field of Internet of things protocols. The method comprises the following steps: establishing a first session with a second device; sending a capability call request to the second device through the first session; receiving protocol specification information fed back by the second device according to the capability calling request through the first session; establishing a data flow channel with the second equipment according to the protocol specification information; and carrying out data transmission with the second equipment through the data flow channel. The scheme of the invention solves the problem that the equipment expansion capability is poor because the equipment needs to be standardized for realizing the data flow among different equipment in the prior art.

Description

Data transmission method, device and equipment
Technical Field
The present invention relates to the field of internet of things protocols, and in particular, to a data transmission method, apparatus and device.
Background
With the development of the internet of things, intelligent devices are more and more, cross-device operation becomes more complicated, and demands of people on device coordination and usability are more and more strong.
However, since the intelligent devices are various, the same device may have multiple capabilities, and the same capability may have multiple attributes, and the same attribute may also have different parameters and transmission modes, so that the process of specifying the data transmission mode and specification is quite troublesome when the data is circulated between the devices.
At present, a mode of forcedly standardizing the capability and the attribute of the device is generally adopted, so that the device transmits data according to a specified protocol and specification during data flow, and the device expansion capability is poor and is unfavorable for device optimization.
Disclosure of Invention
The invention aims to provide a data transmission method, a data transmission device and data transmission equipment, which solve the problem that the equipment expansion capability is poor because the equipment needs to be standardized for realizing the data flow among different equipment in the prior art.
To achieve the above object, an embodiment of the present invention provides a data transmission method, applied to a first device, including:
establishing a first session with a second device;
sending a capability call request to the second device through the first session;
receiving protocol specification information fed back by the second device according to the capability calling request through the first session;
establishing a data flow channel with the second equipment according to the protocol specification information;
and carrying out data transmission with the second equipment through the data flow channel.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
Role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the establishing a data flow channel with the second device according to the protocol specification information includes:
according to the protocol specification information, first indication information is sent to the second equipment through a first session, wherein the first indication information is used for indicating that the first equipment is ready;
receiving second indication information fed back by the second device according to the first indication information, wherein the second indication information is used for indicating that the second device is ready;
and sending third indication information to the second device according to the second indication information, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the method further comprises:
transmitting fourth indication information to the second device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
receiving fifth indication information sent by the first device through the first session, wherein the fifth indication information is used for indicating that the second device finishes data transmission;
and ending data transmission according to the fifth indication information, and closing the first session.
To achieve the above object, an embodiment of the present invention provides a data transmission method, applied to a second device, including:
establishing a first session with a first device;
receiving a capability calling request sent by the first equipment through the first session;
according to the capability calling request, protocol specification information is sent to the first equipment through the first session;
establishing a data flow channel with the first equipment;
and carrying out data transmission with the first equipment through the data flow channel.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
Data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the establishing a data flow channel with the first device includes:
receiving first indication information sent by the first equipment, wherein the first indication information is used for indicating that the first equipment is ready;
according to the first indication information and the capability call request, sending second indication information to the first device through a first session, wherein the second indication information is used for indicating that the second device is ready;
and receiving third indication information sent by the first equipment, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the method further comprises:
receiving fourth indication information sent by the first device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
And ending data transmission according to the fourth indication information, and sending fifth indication information to the first device through the first session, wherein the fifth indication information is used for indicating that the second device has ended data transmission.
To achieve the above object, an embodiment of the present invention provides a data transmission device, applied to a first apparatus, including:
a first processing module for establishing a first session with a second device;
a request sending module, configured to send, through the first session, a capability call request to the second device;
a protocol receiving module, configured to receive, through the first session, protocol specification information fed back by the second device according to the capability call request;
the first establishing module is used for establishing a data flow channel with the second equipment according to the protocol specification information;
and the first transmission module is used for carrying out data transmission with the second equipment through the data flow channel.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
Data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the first establishing module includes:
a first sending unit, configured to send, according to the protocol specification information, first indication information to the second device through a first session, where the first indication information is used to indicate that the first device is ready;
the first receiving unit is used for receiving second indicating information fed back by the second equipment according to the first indicating information, wherein the second indicating information is used for indicating that the second equipment is ready;
and the second sending unit is used for sending third indication information to the second equipment according to the second indication information, wherein the third indication information is used for indicating that the data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the apparatus further comprises:
the first sending module is used for sending fourth indication information to the second equipment through the first session, wherein the fourth indication information is used for indicating the second equipment to end data transmission;
a first receiving module, configured to receive, through the first session, fifth indication information sent by the first device, where the fifth indication information is used to indicate that the second device has ended data transmission;
and the third processing module is used for ending data transmission according to the fifth indication information and closing the first session.
To achieve the above object, an embodiment of the present invention provides a data transmission device, applied to a second apparatus, including:
a second processing module for establishing a first session with the first device;
the request receiving module is used for receiving a capability calling request sent by the first equipment through the first session;
a protocol sending module, configured to send protocol specification information to the first device through the first session according to the capability call request;
the second establishing module is used for establishing a data flow channel with the first equipment;
and the second transmission module is used for carrying out data transmission with the first equipment through the data flow channel.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the second establishing module includes:
a second receiving unit, configured to receive first indication information sent by the first device, where the first indication information is used to indicate that the first device is ready;
a third sending unit, configured to send, according to the first indication information and the capability call request, second indication information to the first device through a first session, where the second indication information is used to indicate that the second device is ready;
the third receiving unit is used for receiving third indication information sent by the first device, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving fourth indication information sent by the first device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
and the second sending module is used for ending data transmission according to the fourth indication information, sending fifth indication information to the first equipment through the first session, and the fifth indication information is used for indicating that the second equipment has ended data transmission.
To achieve the above object, an embodiment of the present invention provides an apparatus, which is a first apparatus, including a processor and a transceiver, where the processor is configured to:
establishing a first session with a second device;
sending a capability call request to the second device through the first session;
receiving protocol specification information fed back by the second device according to the capability calling request through the first session;
establishing a data flow channel with the second equipment according to the protocol specification information;
And carrying out data transmission with the second equipment through the data flow channel.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the processor is specifically configured to, when establishing a data flow channel with the second device according to the protocol specification information:
according to the protocol specification information, first indication information is sent to the second equipment through a first session, wherein the first indication information is used for indicating that the first equipment is ready;
receiving second indication information fed back by the second device according to the first indication information, wherein the second indication information is used for indicating that the second device is ready;
and sending third indication information to the second device according to the second indication information, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the processor is further configured to:
transmitting fourth indication information to the second device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
receiving fifth indication information sent by the first device through the first session, wherein the fifth indication information is used for indicating that the second device finishes data transmission;
and ending data transmission according to the fifth indication information, and closing the first session.
To achieve the above object, an embodiment of the present invention provides an apparatus, which is a second apparatus, including a processor and a transceiver, where the processor is configured to:
establishing a first session with a first device;
receiving a capability calling request sent by the first equipment through the first session;
according to the capability calling request, protocol specification information is sent to the first equipment through the first session;
establishing a data flow channel with the first equipment;
And carrying out data transmission with the first equipment through the data flow channel.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, when the processor establishes a data flow channel with the first device, the processor is specifically configured to:
receiving first indication information sent by the first equipment, wherein the first indication information is used for indicating that the first equipment is ready;
according to the first indication information and the capability call request, sending second indication information to the first device through a first session, wherein the second indication information is used for indicating that the second device is ready;
and receiving third indication information sent by the first equipment, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the processor is further configured to:
receiving fourth indication information sent by the first device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
and ending data transmission according to the fourth indication information, and sending fifth indication information to the first device through the first session, wherein the fifth indication information is used for indicating that the second device has ended data transmission.
To achieve the above object, an embodiment of the present invention provides an apparatus including a transceiver, a processor, a memory, and a program or instructions stored on the memory and executable on the processor; the processor, when executing the program or instructions, implements a data transmission method as applied to a first device as described above, or a data transmission method as applied to a second device as described above.
To achieve the above object, an embodiment of the present invention provides a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement steps as in a data transmission method applied to a first device or steps as in a data transmission method applied to a second device.
The technical scheme of the invention has the following beneficial effects:
according to the method provided by the embodiment of the invention, the protocol specification in data transmission is negotiated through the first session before the data flow of the first equipment and the second equipment, so that the capability and the attribute of the equipment are not required to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the equipment is simpler and more flexible, and the expansion and the optimization of the equipment are facilitated.
Drawings
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present invention;
fig. 2 is a communication flow chart of a data transmission method according to an embodiment of the present invention;
FIG. 3 is a diagram of a distributed communication network in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart of a data transmission method according to another embodiment of the invention;
fig. 5 is a block diagram of a data transmission device according to an embodiment of the present invention;
fig. 6 is a block diagram of a data transmission device according to another embodiment of the present invention;
FIG. 7 is a block diagram of a first device according to an embodiment of the present invention;
fig. 8 is a block diagram of a first apparatus according to another embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages to be solved more apparent, the following detailed description will be given with reference to the accompanying drawings and specific embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
In addition, the terms "system" and "network" are often used interchangeably herein.
In the examples provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B may be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information.
As shown in fig. 1 to 2, a data transmission method according to an embodiment of the present invention is applied to a first device, and includes:
Step 101, a first session is established with a second device.
In this step, the capability calling end (e.g. the first device) may establish a transmission control protocol (Transmission Control Protocol, TCP) connection with the capability called end (e.g. the second device), and perform security authentication, and after the connection and authentication are successful, it means that the capability calling end and the capability called end successfully establish a session.
Step 102, sending a capability call request to the second device through the first session.
In this step, the first device sends a capability call request to the second device through the first session to notify the second device of the content to be called. Wherein the capability call request may include: an Identity (ID) of the second device, a called capability ID, a called capability attribute ID, etc.
Step 103, receiving, by the second device, protocol specification information fed back according to the capability call request through the first session.
It should be noted that, after receiving the capability call request, the second device may feed back protocol specification information to the first device, so as to notify the first device of the protocol specification that the capability call end (i.e., the first device) needs to follow when the capability is called.
And 104, establishing a data flow channel with the second equipment according to the protocol specification information.
It should be noted that, before the data stream is performed, the first device and the second device need to be subjected to a specification negotiation, that is, a data transmission protocol negotiation, so as to negotiate a transmission protocol used for transmitting data, a data coding format during transmission, and the like. After negotiation, a data flow channel can be established so as to carry out data transmission through the data flow channel, and the method is applicable to distributed communication. In this way, the first device does not need to know how to transfer data when invoking the capability before proceeding with the negotiation flow (i.e. specification negotiation), and therefore the procedure of the invoking end (first device) is more simplified and flexible, without frequent updating in order to adapt to the new device. The specification negotiation may specifically include a series of negotiation procedures.
And step 105, performing data transmission with the second device through the data flow channel.
In this way, the data flow channel may be isolated from the session between the first device and the second device (first session), wherein the session may be used to control the data flow (i.e. data transfer) such that the data flow is more flexible.
In this embodiment, before the data flow, the first device and the second device negotiate the protocol specification in the data transmission through the first session, so that the capability and the attribute of the devices do not need to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the devices is simpler and more flexible, and the expansion and optimization of the devices are facilitated.
Optionally, the protocol specification information includes at least one of:
the transmission protocol used in the data transmission, here, may be TCP, user datagram protocol (User Datagram Protocol, UDP), or other protocol;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
It should be noted that, the capability callee (e.g., the second device) may pre-configure a "preset protocol specification" (i.e., a protocol specification that the capability caller needs to follow when the capability is called) in its own program, so after receiving the capability call request sent by the first device, the second device may encode the "preset protocol specification" into protocol specification information, and then send the encoded "preset protocol specification" to the first device, so as to notify the first device of the protocol specification that the capability caller (first device) needs to follow when the capability is called, where the capability caller does not need to pre-configure the "preset protocol specification".
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
That is, if the first device needs to be a client in data transmission, that is, if the second device is a server, when the second device sends protocol specification information to the first device, the port number bound when the second device is a server needs to be encoded into the protocol specification information, so as to inform the first device of which port number is used for data transmission subsequently; if the first device needs to act as a server in data transmission, i.e. the second device acts as a client, then no information about the port number need to be added to the protocol specification information. Wherein the port number may be used when setting up the data flow channel.
Optionally, the establishing a data flow channel with the second device according to the protocol specification information includes:
step 1041, according to the protocol specification information, sending first indication information to the second device through a first session, where the first indication information is used to indicate that the first device is ready.
In this step, after receiving the protocol specification information, the first device may establish a first task and send first indication information to the second device to inform the second device: the first device is ready. It should be noted that, if the first device is used as a server in data transmission, the first task is a corresponding server task established by the first device according to the requirement of protocol specification information; if the first device is used as a client in data transmission, the first task is a corresponding client task started by the first device.
As an optional embodiment, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds. That is, if the first device is acting as a server in data transmission, the first device needs to encode the port number into the first indication information, so that the second device knows the port for data transmission through the first indication information.
Step 1042, receiving second indication information fed back by the second device according to the first indication information, where the second indication information is used to indicate that the second device is ready.
It should be noted that, after the second device receives the first indication information, the second device may start the second task and send the second indication information to the first device, so as to inform the first device: the second device is ready. It can be understood that when the second device is used as a server, the second task is started to be a server task, and when the second device is used as a client, the second task is started to be a client task.
Step 1043, according to the second indication information, sending third indication information to the second device, where the third indication information is used to indicate that a data flow channel is established.
In this step, after receiving the second indication information sent by the second device, the first device may learn that the second device is ready, and at this time, the first device may send third indication information to the second device to notify the second device: the data flow channel is established, and the data flow can be started. Thus, the second device can start data transmission with the first device after receiving the third indication information.
In the line data transmission process, the device as the client needs to perform data encoding according to the protocol specification information, and the device as the server needs to decode according to the protocol specification information, so as to ensure that the data transmission process is performed smoothly.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
In this embodiment, the first indication information carries a port number, so as to inform the second device which port number is used for data transmission subsequently.
Optionally, the method further comprises:
and (I) sending fourth indication information to the second device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission.
In the step, when the circulation task needs to be ended, the first device may send fourth indication information to the second device through the first session to inform the second device: the streaming task (i.e., ending the data transfer) may be ended.
And (II) receiving fifth indicating information sent by the first device through the first session, wherein the fifth indicating information is used for indicating that the second device finishes data transmission.
In the step, after receiving the fourth instruction information, the second device may end its own circulation task and send fifth instruction information to the first device through the first session, so as to inform the first device: the second device has finished the data transmission.
And (III) ending data transmission according to the fifth indication information and closing the first session.
In this step, after receiving the fifth instruction information, the first device may end its own circulation task and close the first session.
It should be noted that, in the first device and the second device in the embodiment of the present invention, the following modules may be included: the device networking module can be used for completing device networking and constructing intelligent devices into an internal private network; a capability publishing module, which may be configured to publish a capability of a device to a network (e.g., package its capability information and send it out in a broadcast or multicast form through a corresponding UDP port); the capability discovery module can be used for monitoring the corresponding UDP port, discovering the device capability issued by other devices, and caching the device capability and delivering the device capability to the capability management module for unified management after receiving the capability issued by other devices; a capability management module operable to manage discovered capabilities; the capability calling module can be used for calling the capabilities of other discovered devices; a session module that may be used to establish a secure session (e.g., a first session) with a target device prior to invoking the target device capabilities; the negotiation module can be used for negotiating how to transmit data with the target equipment after establishing a session with the target equipment before invoking the capability of the target equipment; and the data flow module can be used for transmitting data with the target equipment after negotiating the number transmission protocol, the specification and the like with the target equipment.
As shown in fig. 3, after the device networking module is started, the WiFi device and the Ethernet (ETH) device may access the router and obtain an Internet Protocol (IP) address, and the non-WiFi device and the non-ETH device may establish a connection with the WiFi device or the ETH device having a corresponding protocol gateway, and if the device supports a dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP), further obtain an IP address.
According to the data transmission method, the first equipment and the second equipment negotiate the protocol specification in data transmission through the first session before data flow, so that the capacity and the attribute of the equipment are not required to be standardized, a large amount of workload for standardized formulation and adaptation of product development is saved, the program of the equipment is simpler and more flexible, and the expansion and the optimization of the equipment are facilitated.
As shown in fig. 4, a data transmission method according to an embodiment of the present invention is applied to a second device, and includes:
step 401, a first session is established with a first device.
In this step, the capability callee (e.g., the second device) may establish a TCP connection with the capability callee (e.g., the first device) and perform security authentication, and after the connection and authentication are successful, it indicates that the capability callee successfully establishes a session with the capability caller.
Step 402, receiving, through the first session, a capability call request sent by the first device.
In the step, the second device receives the capability calling request sent by the second device through the first session, and can learn the content required to be called by the first device. Wherein the capability call request may include: an ID of the second device, a called capability ID, a called capability attribute ID, etc.
Step 403, according to the capability call request, sending protocol specification information to the first device through the first session.
It should be noted that, after receiving the capability call request, the second device may feed back protocol specification information to the first device, so as to notify the first device of the protocol specification that the capability call end (i.e., the first device) needs to follow when the capability is called.
Step 404, establishing a data flow channel with the first device.
It should be noted that, before the data stream is performed, the first device and the second device need to be subjected to a specification negotiation, that is, a data transmission protocol negotiation, so as to negotiate a transmission protocol used for transmitting data, a data coding format during transmission, and the like. After negotiation, a data flow channel can be established so as to carry out data transmission through the data flow channel, and the method is applicable to distributed communication.
And step 405, performing data transmission with the first device through the data flow channel.
In this way, the data flow channel may be isolated from the session between the first device and the second device (first session), wherein the session may be used to control the data flow (i.e. data transfer) such that the data flow is more flexible.
In this embodiment, before the data flow, the first device and the second device negotiate the protocol specification in the data transmission through the first session, so that the capability and the attribute of the devices do not need to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the devices is simpler and more flexible, and the expansion and optimization of the devices are facilitated.
Optionally, the protocol specification information includes at least one of:
the transmission protocol used in the data transmission can be TCP, UDP, or other protocols;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
It should be noted that, the capability callee (e.g., the second device) may pre-configure a "preset protocol specification" (i.e., a protocol specification that the capability caller needs to follow when the capability is called) in its own program, so after receiving the capability call request sent by the first device, the second device may encode the "preset protocol specification" into protocol specification information, and then send the encoded "preset protocol specification" to the first device, so as to notify the first device of the protocol specification that the capability caller (first device) needs to follow when the capability is called, where the capability caller does not need to pre-configure the "preset protocol specification".
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
That is, if the first device needs to be a client in data transmission, that is, if the second device is a server, when the second device sends protocol specification information to the first device, the port number bound when the second device is a server needs to be encoded into the protocol specification information, so as to inform the first device of which port number is used for data transmission subsequently; if the first device needs to act as a server in data transmission, i.e. the second device acts as a client, then no information about the port number need to be added to the protocol specification information. Wherein the port number may be used when setting up the data flow channel.
Optionally, the establishing a data flow channel with the first device includes:
step 4041, the first device is received to send first indication information, where the first indication information is used to indicate that the first device is ready.
Step 4042, according to the first indication information and the capability call request, sending second indication information to the first device through a first session, where the second indication information is used to indicate that the second device is ready;
In this step, after receiving the first indication information, the second device may start the second task and send the second indication information to the first device, so as to inform the first device: the second device is ready. It can be understood that when the second device is used as a server, the second task started is a server task, and when the second device is used as a client, the second task started is a client task.
Step 4043, receiving the third indication information sent by the first device, where the third indication information is used to indicate that the data flow channel is established.
It should be noted that after receiving the third indication information sent by the first device, it may be known that the data flow channel is established, and the data flow may be started. Thus, the second device can start data transmission with the first device.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
In this embodiment, the first indication information carries a port number, so as to inform the second device which port number is used for data transmission subsequently.
Optionally, the method further comprises:
and (I) receiving fourth indication information sent by the first equipment through the first session, wherein the fourth indication information is used for indicating the second equipment to end data transmission.
In the step, when the circulation task needs to be ended, the first device may send fourth indication information to the second device through the first session to inform the second device: the streaming task (i.e., ending the data transfer) may be ended.
And (II) ending data transmission according to the fourth indication information, and sending fifth indication information to the first device through the first session, wherein the fifth indication information is used for indicating that the second device has ended data transmission.
In the step, after receiving the fourth instruction information, the second device may end its own circulation task and send fifth instruction information to the first device through the first session, so as to inform the first device: the second device has finished the data transmission.
According to the data transmission method, the first equipment and the second equipment negotiate the protocol specification in data transmission through the first session before data flow, so that the capacity and the attribute of the equipment are not required to be standardized, a large amount of workload for standardized formulation and adaptation of product development is saved, the program of the equipment is simpler and more flexible, and the expansion and the optimization of the equipment are facilitated.
As shown in fig. 5, a data transmission apparatus according to an embodiment of the present invention is applied to a first device, and includes:
a first processing module 510 for establishing a first session with a second device;
a request sending module 520, configured to send, through the first session, a capability call request to the second device;
a protocol receiving module 530, configured to receive, through the first session, protocol specification information fed back by the second device according to the capability call request;
a first establishing module 540, configured to establish a data flow channel with the second device according to the protocol specification information;
and the first transmission module 550 is configured to perform data transmission with the second device through the data flow channel.
In this embodiment, before the data flow, the first device and the second device negotiate the protocol specification in the data transmission through the first session, so that the capability and the attribute of the devices do not need to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the devices is simpler and more flexible, and the expansion and optimization of the devices are facilitated.
Optionally, the protocol specification information includes at least one of:
A transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the first establishing module includes:
a first sending unit, configured to send, according to the protocol specification information, first indication information to the second device through a first session, where the first indication information is used to indicate that the first device is ready;
the first receiving unit is used for receiving second indicating information fed back by the second equipment according to the first indicating information, wherein the second indicating information is used for indicating that the second equipment is ready;
and the second sending unit is used for sending third indication information to the second equipment according to the second indication information, wherein the third indication information is used for indicating that the data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the apparatus further comprises:
the first sending module is used for sending fourth indication information to the second equipment through the first session, wherein the fourth indication information is used for indicating the second equipment to end data transmission;
a first receiving module, configured to receive, through the first session, fifth indication information sent by the first device, where the fifth indication information is used to indicate that the second device has ended data transmission;
and the third processing module is used for ending data transmission according to the fifth indication information and closing the first session.
It should be noted that, the data transmission device provided in this embodiment of the present invention can implement all the method steps implemented in the data transmission method embodiment applied to the first device, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those in the method embodiment in this embodiment are omitted.
As shown in fig. 6, a data transmission apparatus according to an embodiment of the present invention is applied to a second device, and includes:
A second processing module 610, configured to establish a first session with a first device;
a request receiving module 620, configured to receive, through the first session, a capability call request sent by the first device;
a protocol sending module 630, configured to send protocol specification information to the first device through the first session according to the capability call request;
a second establishing module 640, configured to establish a data flow channel with the first device;
and the second transmission module 650 is configured to perform data transmission with the first device through the data flow channel.
In this embodiment, before the data flow, the first device and the second device negotiate the protocol specification in the data transmission through the first session, so that the capability and the attribute of the devices do not need to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the devices is simpler and more flexible, and the expansion and optimization of the devices are facilitated.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
Data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the second establishing module includes:
a second receiving unit, configured to receive first indication information sent by the first device, where the first indication information is used to indicate that the first device is ready;
a third sending unit, configured to send, according to the first indication information and the capability call request, second indication information to the first device through a first session, where the second indication information is used to indicate that the second device is ready;
the third receiving unit is used for receiving third indication information sent by the first device, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the apparatus further comprises:
The second receiving module is used for receiving fourth indication information sent by the first device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
and the second sending module is used for ending data transmission according to the fourth indication information, sending fifth indication information to the first equipment through the first session, and the fifth indication information is used for indicating that the second equipment has ended data transmission.
It should be noted that, the data transmission device provided in this embodiment of the present invention can implement all the method steps implemented in the data transmission method embodiment applied to the second device, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those in the method embodiment in this embodiment are omitted.
As shown in fig. 7, an apparatus 700 according to an embodiment of the present invention is a first apparatus, and includes a processor 710 and a transceiver 720, where the processor 710 is configured to:
establishing a first session with a second device;
sending a capability call request to the second device through the first session;
receiving protocol specification information fed back by the second device according to the capability calling request through the first session;
Establishing a data flow channel with the second equipment according to the protocol specification information;
and carrying out data transmission with the second equipment through the data flow channel.
In this embodiment, before the data flow, the first device and the second device negotiate the protocol specification in the data transmission through the first session, so that the capability and the attribute of the devices do not need to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the devices is simpler and more flexible, and the expansion and optimization of the devices are facilitated.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, the processor 710 is specifically configured to, when establishing a data flow channel with the second device according to the protocol specification information:
According to the protocol specification information, first indication information is sent to the second equipment through a first session, wherein the first indication information is used for indicating that the first equipment is ready;
receiving second indication information fed back by the second device according to the first indication information, wherein the second indication information is used for indicating that the second device is ready;
and sending third indication information to the second device according to the second indication information, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the processor 710 is further configured to:
transmitting fourth indication information to the second device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
receiving fifth indication information sent by the first device through the first session, wherein the fifth indication information is used for indicating that the second device finishes data transmission;
and ending data transmission according to the fifth indication information, and closing the first session.
It should be noted that, the above device provided in this embodiment of the present invention can implement all the method steps implemented in the data transmission method embodiment applied to the first device, and achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those in the method embodiment in this embodiment are omitted.
The device in the embodiment of the present invention is a second device, and the structure of the device may be the same as that of the first device as shown in fig. 7, and the device includes a processor and a transceiver, where the processor is configured to:
establishing a first session with a first device;
receiving a capability calling request sent by the first equipment through the first session;
according to the capability calling request, protocol specification information is sent to the first equipment through the first session;
establishing a data flow channel with the first equipment;
and carrying out data transmission with the first equipment through the data flow channel.
In this embodiment, before the data flow, the first device and the second device negotiate the protocol specification in the data transmission through the first session, so that the capability and the attribute of the devices do not need to be standardized, a great amount of workload for standardized formulation and adaptation of product development is saved, the program of the devices is simpler and more flexible, and the expansion and optimization of the devices are facilitated.
Optionally, the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
Optionally, in the case where the role information indicates that the first device acts as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
Optionally, when the processor establishes a data flow channel with the first device, the processor is specifically configured to:
receiving first indication information sent by the first equipment, wherein the first indication information is used for indicating that the first equipment is ready;
according to the first indication information and the capability call request, sending second indication information to the first device through a first session, wherein the second indication information is used for indicating that the second device is ready;
and receiving third indication information sent by the first equipment, wherein the third indication information is used for indicating that a data flow channel is established.
Optionally, in a case where the first device acts as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
Optionally, the processor is further configured to:
receiving fourth indication information sent by the first device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
and ending data transmission according to the fourth indication information, and sending fifth indication information to the first device through the first session, wherein the fifth indication information is used for indicating that the second device has ended data transmission.
It should be noted that, the above device provided in this embodiment of the present invention can implement all the method steps implemented in the data transmission method embodiment applied to the second device, and achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those in the method embodiment in this embodiment are omitted.
An apparatus according to another embodiment of the present invention, as shown in fig. 8, includes a transceiver 810, a processor 800, a memory 820, and a program or instructions stored on the memory 820 and executable on the processor 800; the processor 800 implements the data transmission method applied to the first device or implements the data transmission method applied to the second device when executing the program or instructions.
The transceiver 810 is configured to receive and transmit data under the control of the processor 800.
Wherein in fig. 8, a bus architecture may comprise any number of interconnected buses and bridges, and in particular, one or more processors represented by processor 800 and various circuits of memory represented by memory 820, linked together. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein. The bus interface provides an interface. The transceiver 810 may be a number of elements, i.e., including a transmitter and a receiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 800 is responsible for managing the bus architecture and general processing, and the memory 820 may store data used by the processor 800 in performing operations.
The readable storage medium of the embodiment of the present invention stores a program or an instruction, which when executed by a processor, implements the steps in the data transmission method described above, and can achieve the same technical effects, and is not described herein again for avoiding repetition. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
It is further noted that the terminals described in this specification include, but are not limited to, smartphones, tablets, etc., and that many of the functional components described are referred to as modules in order to more particularly emphasize their implementation independence.
In an embodiment of the invention, the modules may be implemented in software for execution by various types of processors. An identified module of executable code may, for instance, comprise one or more physical or logical blocks of computer instructions which may, for instance, be organized as an object, procedure, or function. Nevertheless, the executables of an identified module need not be physically located together, but may comprise disparate instructions stored in different bits which, when joined logically together, comprise the module and achieve the stated purpose for the module.
Indeed, a module of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs, and across several memory devices. Likewise, operational data may be identified within modules and may be embodied in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed over different locations including over different storage devices.
Where a module may be implemented in software, taking into account the level of existing hardware technology, a module may be implemented in software, and one skilled in the art may, without regard to cost, build corresponding hardware circuitry, including conventional Very Large Scale Integration (VLSI) circuits or gate arrays, and existing semiconductors such as logic chips, transistors, or other discrete components, to achieve the corresponding functions. A module may also be implemented in programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices or the like.
The exemplary embodiments described above are described with reference to the drawings, many different forms and embodiments are possible without departing from the spirit and teachings of the present invention, and therefore, the present invention should not be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will convey the scope of the invention to those skilled in the art. In the drawings, the size of the elements and relative sizes may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Unless otherwise indicated, a range of values includes the upper and lower limits of the range and any subranges therebetween.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (19)

1. A data transmission method applied to a first device, comprising:
establishing a first session with a second device;
sending a capability call request to the second device through the first session;
receiving protocol specification information fed back by the second device according to the capability calling request through the first session;
establishing a data flow channel with the second equipment according to the protocol specification information;
and carrying out data transmission with the second equipment through the data flow channel.
2. The data transmission method according to claim 1, wherein the protocol specification information includes at least one of:
a transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
Data encoding scheme used in data transmission.
3. The data transmission method according to claim 2, wherein in the case where the role information indicates that the first device functions as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
4. The method according to claim 1, wherein the establishing a data flow channel with the second device according to the protocol specification information includes:
according to the protocol specification information, first indication information is sent to the second equipment through a first session, wherein the first indication information is used for indicating that the first equipment is ready;
receiving second indication information fed back by the second device according to the first indication information, wherein the second indication information is used for indicating that the second device is ready;
and sending third indication information to the second device according to the second indication information, wherein the third indication information is used for indicating that a data flow channel is established.
5. The data transmission method according to claim 4, wherein in a case where the first device functions as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
6. The data transmission method according to claim 1, further comprising:
transmitting fourth indication information to the second device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
receiving fifth indication information sent by the first device through the first session, wherein the fifth indication information is used for indicating that the second device finishes data transmission;
and ending data transmission according to the fifth indication information, and closing the first session.
7. A data transmission method applied to a second device, comprising:
establishing a first session with a first device;
receiving a capability calling request sent by the first equipment through the first session;
according to the capability calling request, protocol specification information is sent to the first equipment through the first session;
establishing a data flow channel with the first equipment;
and carrying out data transmission with the first equipment through the data flow channel.
8. The data transmission method according to claim 7, wherein the protocol specification information includes at least one of:
A transmission protocol used in data transmission;
role information, wherein the role information is used for indicating a role played by the first device in data transmission, and the role is a server or a client;
data encoding scheme used in data transmission.
9. The data transmission method according to claim 8, wherein in the case where the role information indicates that the first device functions as a client in data transmission, the protocol specification information further includes: the second device acts as a port number to which the server binds.
10. The method of claim 7, wherein the establishing a data flow channel with the first device comprises:
receiving first indication information sent by the first equipment, wherein the first indication information is used for indicating that the first equipment is ready;
according to the first indication information and the capability call request, sending second indication information to the first device through a first session, wherein the second indication information is used for indicating that the second device is ready;
and receiving third indication information sent by the first equipment, wherein the third indication information is used for indicating that a data flow channel is established.
11. The data transmission method according to claim 10, wherein in a case where the first device functions as a server in data transmission, the first indication information carries: the first device acts as a port number to which the server binds.
12. The data transmission method according to claim 7, further comprising:
receiving fourth indication information sent by the first device through the first session, wherein the fourth indication information is used for indicating the second device to end data transmission;
and ending data transmission according to the fourth indication information, and sending fifth indication information to the first device through the first session, wherein the fifth indication information is used for indicating that the second device has ended data transmission.
13. A data transmission apparatus for use with a first device, comprising:
a first processing module for establishing a first session with a second device;
a request sending module, configured to send, through the first session, a capability call request to the second device;
a protocol receiving module, configured to receive, through the first session, protocol specification information fed back by the second device according to the capability call request;
The first establishing module is used for establishing a data flow channel with the second equipment according to the protocol specification information;
and the first transmission module is used for carrying out data transmission with the second equipment through the data flow channel.
14. A data transmission apparatus for use with a second device, comprising:
a second processing module for establishing a first session with the first device;
the request receiving module is used for receiving a capability calling request sent by the first equipment through the first session;
a protocol sending module, configured to send protocol specification information to the first device through the first session according to the capability call request;
the second establishing module is used for establishing a data flow channel with the first equipment;
and the second transmission module is used for carrying out data transmission with the first equipment through the data flow channel.
15. An apparatus, the apparatus being a first apparatus, comprising: a transceiver and a processor; the processor is configured to:
establishing a first session with a second device;
sending a capability call request to the second device through the first session;
receiving protocol specification information fed back by the second device according to the capability calling request through the first session;
Establishing a data flow channel with the second equipment according to the protocol specification information;
and carrying out data transmission with the second equipment through the data flow channel.
16. An apparatus, the apparatus being a second apparatus, comprising: a transceiver and a processor; the processor is configured to:
establishing a first session with a first device;
receiving a capability calling request sent by the first equipment through the first session;
according to the capability calling request, protocol specification information is sent to the first equipment through the first session;
establishing a data flow channel with the first equipment;
and carrying out data transmission with the first equipment through the data flow channel.
17. An apparatus, the apparatus being a first apparatus, comprising: a transceiver, a processor, a memory, and a program or instructions stored on the memory and executable on the processor; a data transmission method according to any one of claims 1 to 6 when said program or instructions are executed by said processor.
18. An apparatus, the apparatus being a second apparatus, comprising: a transceiver, a processor, a memory, and a program or instructions stored on the memory and executable on the processor; a data transmission method according to any one of claims 7 to 12 when said program or instructions are executed by said processor.
19. A readable storage medium having stored thereon a program or instructions which when executed by a processor performs the steps of the data transmission method according to any one of claims 1 to 6 or the steps of the data transmission method according to any one of claims 7 to 12.
CN202211142442.0A 2022-09-20 2022-09-20 Data transmission method, device and equipment Pending CN117793223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211142442.0A CN117793223A (en) 2022-09-20 2022-09-20 Data transmission method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211142442.0A CN117793223A (en) 2022-09-20 2022-09-20 Data transmission method, device and equipment

Publications (1)

Publication Number Publication Date
CN117793223A true CN117793223A (en) 2024-03-29

Family

ID=90400439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211142442.0A Pending CN117793223A (en) 2022-09-20 2022-09-20 Data transmission method, device and equipment

Country Status (1)

Country Link
CN (1) CN117793223A (en)

Similar Documents

Publication Publication Date Title
CN105230029B (en) Establish and control Wi-Fi shows the audio connected and voice backward channel
US20070217430A1 (en) Method and system for initiating communications
CN110808948B (en) Remote procedure calling method, device and system
CN111294399A (en) Data transmission method and device
CN115426391A (en) Remote procedure call protocol self-adaption method, related device and server
CN113630439B (en) Real-time communication RTC connection method, server and storage medium
CN112202877A (en) Gateway linkage method, gateway, cloud server and user terminal
CN113726581B (en) Method and device for restoring factory configuration of network equipment and network equipment
CN110417876A (en) Node server and main control device in session method, distributed system
CN112491951B (en) Request processing method, server and storage medium in peer-to-peer network
CN108337241B (en) Multimedia data transmission method and system
JP5311460B2 (en) Connection control device
CN117793223A (en) Data transmission method, device and equipment
CN112118594A (en) Data uploading method, data downloading method, electronic equipment and storage medium
CN109981725A (en) A kind of communication means across security domain, server and readable storage medium storing program for executing
US20040103201A1 (en) Method and apparatus of exchanging transfer parameters in a mobile communication system
CN114363204A (en) Request monitoring method, network device and storage medium
CN111338747A (en) Data communication method, device, terminal equipment and storage medium
WO2018018897A1 (en) Apparatus communication method, device and system
CN112118284A (en) Gateway device-oriented http data request method, device and medium
EP1726139B1 (en) Compression scheme negotiation
US20240048990A1 (en) Bluetooth connection method and system, intelligent terminal, and computer storage medium
CN112995569B (en) Conference creation method, terminal, server side and storage medium
US11937279B2 (en) Systems, devices, and methods related to configuring a multi-stream network with a messaging schedule
CN105245827B (en) Video data transmission method, device and system

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