Method and device for establishing a data connection and computer-readable medium
Claim Score by NHIP
Abstract
A method and a device for establishing a data connection and computer-readable medium are provided. The method includes receiving a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data; extracting the identifier of the target application; based on the identifier of the target application and a preset callback function mapping table, determining a target callback function corresponding to the target application, wherein the preset callback function mapping table comprises at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application; running the target callback function to transmit the transmission data to the target application.

Term
Projected expiry 9 November 2036.
- Priority
- Filed
- Published
- Today
- Projected expiry
15 claims: 3 independent, 12 dependent
- 1Broadest claimClaim Score 66, broad(NHIP)A method for establishing a data connection, comprising:receiving a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data;extracting the identifier of the target application;determining, based on the identifier of the target application and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table comprises at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application;andrunning the target callback function to transmit the transmission data to the target application.
- 6A device for establishing a data connection, comprising:a processor;a memory for storing instructions executable by the processor;wherein the processor is configured to:receive a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data;extract the identifier of the target application;determine, based on the identifier of the target application and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table comprises at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application;andrun the target callback function to transmit the transmission data to the target application.
- 11A non-transitory storage medium readable by a computer and having stored therein a computer program comprising instructions for executing the steps of a method for establishing a data connection, the method comprising:receiving a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data;extracting the identifier of the target application;determining, based on the identifier of the target application and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table comprises at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application;andrunning the target callback function to transmit the transmission data to the target application.
Independent claims3
108 paragraphs in 6 sections, as filed
CROSS-REFERENCE TO RELATED APPLICATION
This application is based on and claims priority to Chinese Patent Application No. 201510919039.8 filed on Dec. 11, 2015, which is incorporated herein by reference in its entirety.
FIELD
The present disclosure generally relates to the technical field of network, and more particularly to a method and a device for establishing a data connection and computer-readable medium.
BACKGROUND
With the development of the network technology, the data service of smart devices has been developed rapidly. Different smart devices may perform data transmission via establishing a data connection. For example, if a data connection is established between a smart phone and a smart television, the data could be transmitted from the smart phone to the smart television.
In related art, different applications may be installed on one smart device, and one device may perform data transmission with another device via the installed application, even one device may perform data transmission with another device via multiple applications. For example, when performing data transmission between an application A in a smart phone and an application A* in a smart television, the smart phone could establish a data connection with a Port A of the smart television, while performing data transmission between an application B in the smart phone and an application B* in the smart television, the smart phone could establish a data connection with a Port B of the smart television.
SUMMARY
According to a first aspect of the embodiments of the present disclosure, a method for establishing a data connection is provided. The method includes: receiving a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data; extracting the identifier of the target application; determining, based on the identifier of the target application and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table includes at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application; running the target callback function to transmit the transmission data to the target application.
According to a second aspect of the embodiments of the present disclosure, a device for establishing a data connection is provided. The device includes: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: receive a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data; extract the identifier of the target application; determine, based on the identifier of the target application and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table includes an at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application; run the target callback function to transmit the transmission data to the target application.
According to a third aspect of the embodiments of the present disclosure, a non-transitory storage medium is provided, the non-transitory storage medium being readable by a computer and having stored therein a computer program including instructions for executing the steps of a method for establishing a data connection, the method includes: receiving a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data; extracting the identifier of the target application; determining, based on the identifier of the target application and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table includes at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application; running the target callback function to transmit the transmission data to the target application.
It is to be understood that the forgoing general description and the following detailed description are illustrative only, and are not intended to limit the present disclosure.
BRIEF DESCRIPTION OF THE DRAWINGS
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
<figref idref="DRAWINGS">FIG. 1</figref> is a flow diagram illustrating a method for establishing a communication connection according to an exemplary embodiment.
<figref idref="DRAWINGS">FIG. 2A</figref> a flow diagram illustrating a method for establishing a communication connection according to another exemplary embodiment.
<figref idref="DRAWINGS">FIG. 2B</figref> is a schematic diagram for establishing a communication connection related to the embodiment of <figref idref="DRAWINGS">FIG. 2A</figref>.
<figref idref="DRAWINGS">FIG. 2C</figref> is another schematic diagram for establishing a communication connection related to the embodiment of <figref idref="DRAWINGS">FIG. 2A</figref>.
<figref idref="DRAWINGS">FIG. 2D</figref> is a schematic diagram of a data packet related to the embodiment of <figref idref="DRAWINGS">FIG. 2A</figref>.
<figref idref="DRAWINGS">FIG. 3</figref> is a block diagram illustrating a device for establishing a communication connection according to an exemplary embodiment.
<figref idref="DRAWINGS">FIG. 4</figref> is a block diagram illustrating a device for establishing a communication connection according to another exemplary embodiment.
<figref idref="DRAWINGS">FIG. 5</figref> is a block diagram illustrating a terminal <b>500</b> according to an exemplary embodiment.
DETAILED DESCRIPTION
Reference will now be made in detail to example embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which same numbers in different drawings represent same or similar elements unless otherwise described. The implementations set forth in the following description of example embodiments do not represent all implementations consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with aspects related to the present disclosure as recited in the appended claims.
The method disclosed in the embodiments of the present disclosure may be applied into an intelligent device with a variety of applications mounted thereon, the intelligent device may perform data transmission with other intelligent devices via the mounted applications. The aforementioned intelligent device may be an intelligent household such as an intelligent television, an intelligent speaker and the like, or may be a terminal such as a cellphone, a tablet, a computer and the like.
<figref idref="DRAWINGS">FIG. 1</figref> is a flow diagram illustrating a method for establishing a communication connection according to an exemplary embodiment. The method for establishing a data connection may include the following steps.
In step <b>101</b>, a data packet transmitted by a terminal may be received, and the data packet may carry an identifier of a target application and transmission data.
In step <b>102</b>, the identifier of the target application may be extracted.
In step <b>103</b>, a target callback function corresponding to the target application may be determined based on the identifier of the target application and a preset callback function mapping table. Wherein the preset callback function mapping table may include at least one identifier of at least one application and at least one corresponding callback function, and the target callback function may be configured to transmit the transmission data to a data memory address corresponding to the target application.
In step <b>104</b>, the target callback function may be performed to transmit the transmission data to the target application.
Through extracting the identifier of the target application carried in the data packet transmitted by a terminal, determining a target callback function based on the identifier of the target application and a preset callback function mapping table, and running the target callback function to transmit the transmission data to the target application, the method provided by the embodiments of the disclosure may uniformly manage and transmit the received data packets, thus, it is not necessary to establish too many connections between the terminal and ports, and port resources may be saved.
In some embodiments, before receiving a data packet transmitted by a terminal, the example method may further include: receiving a registration message transmitted by an application in a present end, wherein the registration message carries an identifier of the application and a callback function; storing the identifier of the application and the callback function in pairs into the preset callback function mapping table.
Accordingly, transmitting the received transmission data to the corresponding application may be implemented through receiving a registration message transmitted by an application on a present end and storing the identifier of the application and the callback function carried in the registration into the preset callback function mapping table, the callback function may be determined according to the identifier of the target application when the data packet is received.
In some embodiments, the example method may further include: receiving a request for establishing a connection and the request is transmitted by the terminal; establishing the data connection with the terminal.
Accordingly, performing data transmission with the terminal may be implemented through receiving a request for establishing a connection and establishing the data connection with the terminal.
In some embodiments, establishing the data connection with the terminal includes: detecting whether an idle port exists in the present end or not; establishing the data connection with the terminal via the idle port when the idle port exits in the present end.
Accordingly, when establishing different connections by the terminal, establishing different data connections may be implemented through establishing the data connection with the terminal via the detected idle port.
In some embodiments, receiving a data packet transmitted by a terminal includes: receiving different types of data packets transmitted by the terminal via different data connections established with the terminal, and the type of the data packet is determined by at least one of the transmission frequency of the data packet and the size of the data packet.
Through receiving different types of data packets via different data connections established with the terminal, the interference between the different types of data packets may be avoided, and the utilization efficiency of the ports may be improved.
Above optional technical solutions may be arbitrarily combined to form the optional embodiments of the present disclosure, which will not be elaborated herein.
<figref idref="DRAWINGS">FIG. 2A</figref> is a flow diagram illustrating a method for establishing a communication connection according to another exemplary embodiment, and the embodiment may be illustrated as the method for establishing a data connection being performed by an intelligent device. The method for establishing a data connection may include the following steps.
In step <b>201</b>, the intelligent device may receive a registration message transmitted by an application on the intelligent device, and the registration message may carry an identifier of the application and a callback function.
Referring to <figref idref="DRAWINGS">FIG. 2B</figref>, the method provided by the embodiments of the present application may establish an UDT (UDP-based Data Transfer Protocol, UDP is User Datagram Protocol) module, and the UDT module may be configured to uniformly receive and transmit data.
In order to enable the intelligent device to transmit the received transmission data to the corresponding application, the application on the intelligent device may automatically transmit the registration message to the UDT module when the starting of the intelligent device is detected. Wherein, the registration message may carry the identifier of the application and the callback function, the identifier of the application may be configured to uniquely identify the application, and the identifier of the application may be corresponding to the callback function. In other words, the intelligent device may uniquely determine the corresponding callback function according to the identifier of the application, and the identifier of the application may be an integer of 16 bits. Wherein, the callback function may be configured to transmit the transmission data to the data memory address corresponding to the application. The callback function may be generated by the application. Alternatively, the callback function may also be transmitted to an intermediary software and then be generated by the intermediary software.
In step <b>202</b>, the intelligent device may store the identifier of the application and the callback function in pairs into the preset callback function mapping table.
The intelligent device may establish the preset callback function mapping table via above step <b>201</b> and step <b>202</b> when the UDT module is established, and when the identifier of the application and the callback function transmitted by other applications are received, and the identifier of the application may be used as the index, so as to store the identifier of the application and the callback function into the preset callback function mapping table. Namely the preset callback function mapping table may include at least one identifier of at least one application and at least one corresponding callback function.
In some embodiments, storing the identifier of the application and the callback function in pairs into the preset callback function mapping table may be a newly added progress. In particular, the preset callback function mapping table may have stored some correspondence relations between the identifier of the application and the callback function, and the registration message received this time may be newly added, the intelligent device may store the identifier of the application and the callback function carried in the registration message received this time into the preset callback function mapping table. In some embodiments, if the registration message received this time is newly added, and if the intelligent device detects that the preset callback function mapping table in the database has already stored the identifier of the application and the callback function carried in the registration message, then the storage may not be repeated.
It is to be noted that there is no execution order between the storing progress in step <b>202</b> and the terminal transmitting a request for establishing a connection in step <b>203</b>. In other words, the storing progress in step <b>202</b> may be performed before the terminal transmitting a request for establishing a connection in step <b>203</b>, or may be performed after the terminal transmitting a request for establishing a connection in step <b>203</b>. The storing progress in step <b>202</b> also may be concurrently performed with the terminal transmitting a request for establishing a connection in step <b>203</b>.
In step <b>203</b>, the terminal may transmit a request for establishing a connection to the intelligent device.
Referring to <figref idref="DRAWINGS">FIG. 2B</figref>, the terminal may be configured with an UDTClient module and may transmit a request for establishing a connection to the intelligent device via the UDTClient module before transmitting data to the intelligent device. The UDTClient module may be configured to transmit a request for establishing a connection to the intelligent device.
In practice, the data packets may include various types. If the terminal only establishes a connection with one port of the intelligent device, then the intelligent device may only receive different types of data packets via the same port. Thus, if the terminal transmits different types of data packets, then a port congestion may occur. Therefore, in order to improve the validity of the transmission of the data packets, the terminal may establish a number of different data connections with the intelligent device according to the types of the data packets to be transmitted. Accordingly, in step <b>203</b>, the terminal may transmit a request for establishing a connection according to the type of the data packet, wherein the request for establishing a connection may be used to establish a data connection corresponding to the type of the data packet.
Wherein, the type of the data packet may be determined by at least one of the transmission frequency of the data packet and the size of the data packet. For example, a data connection with a higher priority may be established for the data packet which has a higher transmission frequency and a smaller size, while a data connection with a lower priority may be established for the data packet which has a lower transmission frequency and a greater size. The embodiments of the present disclosure may not define the specific priority of the established connection. Different requests for establishing a connection may be transmitted with respect to the aforementioned different types of data packets.
In the embodiments of the present disclosure, the data packet may be classified into three types according to the transmission frequency of the data packet and the size of the data packet.
In some embodiments, the data packet may be a first type of data packet. The transmission frequency of the first type of data packet is higher than a first preset frequency, and the size of the first type of data packet is smaller than a first preset threshold. Wherein, the first preset frequency may be set by a system by default, or may be set by a user according to actual needs. Similarly, the first preset threshold may be set by the system by default, or may be set by the user according to actual needs. The first type of data packet may be characterized in that it has a higher transmission frequency and a smaller size. For example, the first type of data packet may be chatting contents transmitted by an instant messaging application on the terminal.
In some embodiments, the data packet may be a second type of data packet. The transmission frequency of the second type of data packet is lower than a second preset frequency, and the size of the second type of data packet is greater than a second preset threshold. Wherein, the second preset frequency may be set by the system by default, or may be set by the user according to actual needs. Similarly, the second preset threshold may be set by the system by default, or may be set by the user according to actual needs. The second type of data packet may be characterized in that it has a lower transmission frequency and a greater size. For example, the second type of data packet may be an audio file transmitted by the terminal.
In some embodiments, the data packet may be a third type of data packet. The third type of data packet may be transmitted according to a preset period. Wherein, the preset period may be set by the system by default, or may be set by the user according to actual needs. The third type of data packet may be referred as a real-time data packet. For example, the third type of data packet may be a control instruction transmitted by the terminal.
For example, when transmitting a data packet A which is the first type of data packet, the terminal may transmit a first request for establishing a connection to the intelligent device. When transmitting a data packet B which is the second type of data packet, the terminal may transmit a second request for establishing a connection to the intelligent device. Three data connection may be established between one terminal and one intelligent device based on the foregoing three types of data packets. Referring to <figref idref="DRAWINGS">FIG. 2C</figref>, there may be three ports on the terminal, namely a first port A′, a second port B′ and a third port C′. The terminal may establish three connections with the intelligent device via the foregoing three ports by transmitting three requests for establishing a connection.
Additionally, in order to avoid waste, the terminal may detect whether itself has established a same type of data connection with the intelligent device before transmitting any request for establishing a connection. If the same type of data connection is established, the terminal may reuse the data connection. That is, the method further includes: the terminal may obtain the type of the data packet to be transmitted before transmitting a request for establishing a connection, and may detect whether the UDTClient module has established a data connection for transmitting this type of data packet with the intelligent device. If it is determined that the data connection is not established, the terminal may transmit a request for establishing a connection. Otherwise, the terminal may reuse the established data connection for transmitting this type of data packet.
For example, when transmitting a data packet A which is the first type of data packet by the terminal, if the terminal detects that the UDTClient module has established a data connection for transmitting the first type of data packet with the intelligent device, the terminal may reuse the data connection to transmit the data packet A to the intelligent device.
In step <b>204</b>, the intelligent device may receive a request for establishing a connection transmitted by the terminal.
Regardless of the number of the requests for establishing a connection transmitted by the terminal, the intelligent device may process the received requests for establishing a connection in a unique way. Particularly, a listening port may be set in the UDT module of the intelligent device, for example, the port number of the listening port may be 8080. The listening port may be configured to receive the request for establishing a connection transmitted by the terminal. When establishing a connection between the terminal and the intelligent device, the terminal may transmit the request for establishing a connection to the listening port, and the intelligent device may receive the request for establishing a connection transmitted by the terminal via the listening port.
In step <b>205</b>, the intelligent device may detect whether an idle port exists in the present end or not, and if so, step <b>206</b> may be performed.
The intelligent device may have multiple ports which may be in different active conditions such as occupied or idle. Therefore, whether an idle port is existed may be detected so as to determine whether the data connection may be established or not. Referring to <figref idref="DRAWINGS">FIG. 2C</figref>, there may be three ports on the intelligent device, namely a first port A, a second port B and a third port C. If the first port A of the intelligent device is in an idle condition, the subsequent step <b>206</b> may be performed, such that a first data connection may be established between the first port A and the terminal.
In step <b>206</b>, when an idle port is detected, the intelligent device may establish a first data connection with the terminal via the idle port.
As mentioned above, only one data connection is established between the terminal and the intelligent device. In some embodiments, a second data connection and a third data connection may be established between the terminal and the intelligent device. Particularly, when the terminal transmits multiple requests for establishing a connection, establishing the second data connection and the third data connection may include any embodiment as follows.
In some embodiments, the terminal has already established the first data connection with the intelligent device. When the terminal transmits another request for establishing a connection, the intelligent device may detect a port being in idle condition, and may establish the second data connection between the port and the terminal. Accordingly, the terminal may establish the connection with the intelligent device via another port.
For example, the terminal has already established the first data connection with the first port A of the intelligent device via the first port A′. When the intelligent device receives another request for establishing a connection transmitted by the terminal, if it is detected that the second port B is in idle condition, the second data connection may be established between the second port B and the second port B′ of the terminal. Of course, if the third port C is also in idle condition, the intelligent device may select any one of the two ports to establish the second data connection with the terminal.
In some embodiments, the terminal has already established the first data connection with the intelligent device and the second data connection with the intelligent device. When the terminal transmits another request for establishing a connection to the intelligent device, the intelligent device may detect a port being in idle condition, and may establish the third data connection between the port and the terminal. Accordingly, the terminal may establish the connection with the intelligent device via a different port.
For example, the terminal has already established the first data connection with the first port A of the intelligent device via the first port A′, and also has established the second data connection with the second port B of the intelligent device via the second port B′. When the intelligent device receives another request for establishing a connection transmitted by the terminal, if it is detected that the third port C is in idle condition, the third data connection may be established between the third port C and the third port C′ of the terminal.
In step <b>207</b>, the terminal may transmit a data packet to the intelligent device via the first data connection.
After the first data connection is established between the terminal and the intelligent device, the data packet may be transmitted to the intelligent device via the first data connection.
In some embodiments, the terminal may select different data connections to transmit different types of data packets according to the different types of the data packets to be transmitted. For example, the terminal may transmit the first type of data packet via the first data connection, transmit the second type of data packet via the second data connection, and transmit the third type of data packet via the third data connection. Of course, the terminal may select the specific data connection freely with respect to the different types of data packet to be transmitted. For example, the terminal may transmit the first type of data packet via the second data connection. However, in general, the same data connection may only be used to transmit the same type of data packet. That is, if the terminal selects to transmit the first type of data packet via the first data connection, the first data connection may only be used to transmit the first type of data packet.
In step <b>208</b>, the intelligent device may receive a data packet transmitted by the terminal, and the data packet may carry an identifier of a target application and transmission data.
The intelligent device may receive different types of data packets transmitted by the terminal via different data connections established with the terminal. Particularly, the intelligent device may receive different types of data packets via different ports according to the data connections selected by the terminal. For example, if the terminal selects to transmit the first type of data packet via the first data connection, the intelligent device may receive the first type of data packet via the port A.
Referring to <figref idref="DRAWINGS">FIG. 2D</figref>, the data packet may include a packet header and transmission data, and the packet header may carry an identifier of a target application. The identifier of a target application may indicate the intelligent device to transmit the transmission data to the corresponding application on the intelligent device, and the length of the identifier of a target application may be 2B. The transmission data may be the content actually to be transmitted, for example, multimedia data such as audio or video data, or a control instruction, for example, the transmission data may be used to control a virtual object in the game screen displayed on the intelligent device.
Additionally, referring to <figref idref="DRAWINGS">FIG. 2D</figref>, the packet header may also include an identifier of the packet header, a protocol version, an identifier of the start packet, a reserved bit, the length of the packet header, the length of the data and an identifier of the source application.
Wherein, the identifier of the packet header may be configured to locate the data packet, namely, the initial position of the data packet may be determined by the identifier of the packet header. For example, the identifier of the packet header may be set as M.
Wherein, the protocol version may be configured to represent the version of the UDT protocol used in transmitting the data packet, and the length of the protocol may be 4-bit which may occupy the bit <b>4</b> to bit <b>7</b> in the packet header.
Wherein, with respect to the identifier of the start packet, a complete resource may be determined according to the identifier of the start packet. Particularly, when a resource is a large resource, it needs to divide the resource into N data packet, therefore, the identifier of the start packet in the first packet may be set as 1 and the identifier of the start packet in the subsequent N−1 data packet may be set as 0. During the receiving progress, when receiving the data packet N+1 in which the identifier of the start packet is set as 1, the foregoing N data packet may be determined as belonging to one resource, so that a complete resource may be determined. The identifier of the start packet may only use the bit <b>3</b> in the packet header.
Wherein, the reserved bit may be configured to extend the data packet, and the length of the reserved bit may be 3-bit which may occupy the bit <b>0</b> to bit <b>2</b> in the packet header.
Wherein, the length of the packet header may be configured to represent the total length of the packet header, for example, in an exemplary embodiment, the length of the packet header may be 5-Byte, namely in the data packet, Byte <b>0</b> to Byte <b>4</b> may be the packet header.
Wherein, the length of the data may be configured to represent the total length of the transmission data, for example, in an exemplary embodiment, the length of the data may be 4-Byte.
Wherein, the identifier of the source application may be configured to identify the application on the terminal by which the data packet is transmitted, the identifier of the source application may be a 16-bit integer, and the length of the identifier of the source application may be 2-Byte.
Of course, the packet header may include other combinations, the present disclosure the present disclosure is not intended to limit in the context.
In step <b>209</b>, the intelligent device may extract the identifier of the target application.
Referring to <figref idref="DRAWINGS">FIG. 2D</figref>, when the data packet transmitted by the terminal is received, the intelligent device may extract the identifier of the target application from the packet header of the data packet.
In step <b>210</b>, the intelligent device may determine a target callback function corresponding to the target application according to the identifier of the target application and a preset callback function mapping table.
The intelligent device may use the identifier of the application as the index to determine the target callback function corresponding to the target application from the preset callback function mapping table stored in the database after the identifier of the target application is extracted. Wherein, the target callback function may be configured to transmit the transmission data to a data memory address corresponding to the target application.
In some embodiments, if the intelligent device does not find the target application corresponding to the target callback function, the received data packet may be discarded. The intelligent device may return an error message to the terminal, so that the terminal may perform a corresponding operation after receiving the error message, such as retransmit the data packet and the like. In this way, in the case that the data packet is not received successfully, the data packet may be discarded in time to avoid to impact the processing of the subsequent received data packet, and the terminal may be able to perform the corresponding operation with the returned error message.
In step <b>211</b>, the intelligent device may run the target callback function to transmit the transmission data to the target application.
After the target callback function is determined, the intelligent device may run the target callback function to transmit the obtained transmission data to the target application. Particularly, the target callback function may be a copy function, and the target callback function may carry a parameter for the memory address corresponding to the target application. When running the target callback function, the transmission data may be copy into the memory address corresponding to the target application.
Through extracting the identifier of the target application carried in the data packet transmitted by a terminal, determining a target callback function based on the identifier of the target application and a preset callback function mapping table, and running the target callback function to transmit the transmission data to the target application, the method provided by the embodiments of the disclosure may uniformly manage and transmit the received data packets, such that it is not necessary to establish too many connections between the terminal and ports, and port resources may be saved.
The following is the device in the embodiments of the present disclosure which may be used to perform the method in the embodiments of the present disclosure. The details which may not be disclosed in the device in the embodiments of the present disclosure can be referred to the method in the embodiments of the present disclosure.
<figref idref="DRAWINGS">FIG. 3</figref> is a block diagram illustrating a device for establishing a data connection according to an exemplary embodiment, the device for establishing a data connection may be implemented by software, hardware, or the combination thereof. The device for establishing a data connection may include: a receiving module <b>310</b> configured to receive a data packet transmitted by a terminal, the data packet carrying an identifier of a target application and transmission data; an extracting module <b>320</b> configured to extract the identifier of the target application; a determining module <b>330</b> configured to determine, based on the identifier of the target application extracted by the extracting module and a preset callback function mapping table, a target callback function corresponding to the target application, wherein the preset callback function mapping table includes at least one identifier of at least one application and at least one corresponding callback function, and the target callback function is configured to transmit the transmission data to a data memory address corresponding to the target application; a running module <b>340</b> configured to run the target callback function determined by the determining module <b>330</b> to transmit the transmission data to the target application.
Through extracting the identifier of the target application carried in the data packet transmitted by a terminal, determining a target callback function based on the identifier of the target application and a preset callback function mapping table, and running the target callback function to transmit the transmission data to the target application, the device provided by the embodiments of the disclosure may uniformly manage and transmit the received data packets, such that it is not necessary to establish too many connections between the terminal and ports, and port resources may be saved.
Referring to <figref idref="DRAWINGS">FIG. 4</figref>, based on the foregoing provided device, in some embodiments, the receiving module <b>310</b> may be further configured to receive a registration message transmitted by an application on a present end, the registration message may carry the identifier of the application and a callback function; the device may further include: a storing module <b>350</b> configured to store the identifier of the application and the callback function in pairs into the preset callback function mapping table.
In some embodiments, the receiving module <b>310</b> may be further configured to receive a request for establishing a connection and the request is transmitted by the terminal; the device may further include: an establishing module <b>360</b> configured to establish the data connection with the terminal.
In some embodiments, the device may further comprise: a detecting module <b>370</b> configured to detect whether an idle port exists in the present end or not; the establishing module <b>360</b> may be further configured to establish the data connection with the terminal via the idle port when the detecting module <b>370</b> determines that the idle port exists in the present end.
In some embodiments, the receiving module <b>310</b> may be further configured to receive different types of data packets transmitted by the terminal via different data connections established with the terminal, the type of the data packet may be determined by at least one of the transmission frequency of the data packet and the size of the data packet.
It is to be noted that, when implementing the method for establishing a data connection, the division of the above functional modules in the device for establishing a data connection provided by the above embodiments are illustrated by way of example. In practice, the above function may be implemented by different functional modules according to actual needs, namely the device may be divided into different functional modules to completely or partly implement the above functions. Additionally, with respect to the device in the above embodiments, the specific manners for performing operations for individual modules therein have been described in detail in the embodiments regarding the method, which will not be elaborated herein.
The embodiments provide a terminal which may be configured to perform the method for establishing a data connection provided in the above embodiments. Referring to <figref idref="DRAWINGS">FIG. 5</figref>, the terminal <b>500</b> may include the followings.
The terminal <b>500</b> may include a RF (Radio Frequency) circuitry <b>110</b>, a memory <b>120</b> including one or more computer readable storage media, an input unit <b>130</b>, a display unit <b>140</b>, a sensor <b>150</b>, an audio circuitry <b>160</b>, a WiFi (Wireless Fidelity) module <b>170</b>, a processor <b>180</b> including one or more processing cores, and a power supply <b>190</b>. A person skilled in the art may understand that the structure of the terminal illustrated by <figref idref="DRAWINGS">FIG. 5</figref> is not intended to limit the terminal, and the terminal may include more or less components, or may combine some components, or may include different arrangement of the components.
The RF circuitry <b>110</b> may be configured to send and receive messages, or receive or transmit signals during a communication progress. Particularly, after receiving the downlink information from the base station, the RF circuitry <b>110</b> may handover the downlink information to one or more processor <b>180</b> for processing; in addition, the RF circuitry <b>110</b> may transmit the uplink data to the base station. In general, the RF circuitry <b>110</b> may include, but not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, a LNA (Low Noise Amplifier), and a duplexer. Additionally, the RF circuitry <b>110</b> may also communicate with the network and other device via wireless communication. The wireless communication may use any communication standards and protocols, including but not limited to, GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service).
The memory <b>120</b> may be configured to stored software programs and modules. The processor <b>180</b> may perform multiple functional applications and data processing by running the software programs and modules stored in the memory <b>120</b>. The memory <b>120</b> may include an area for storing programs and an area for storing data, wherein, the area for storing programs may store operating system, at least one application required by the functions (such as a function for playing audio and a function for displaying images); the area for storing data may store data created by the terminal <b>500</b> (such as audio data and contacts). Additionally, the memory <b>120</b> may include a high speed random access memory, and may also include a nonvolatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid storage devices. Accordingly, the memory <b>120</b> may also include a memory controller so as to enable the processor <b>180</b> and the input unit <b>130</b> to access the memory <b>120</b>.
The input unit <b>130</b> may be configured to receive the input numeral or alphabet information, and to generate keyboard, mouse, lever, optical, or trackball signal inputs related to user settings and function control. Particularly, the input unit <b>130</b> may include a touch sensitive surface <b>131</b> and other input devices <b>132</b>. The touch sensitive surface <b>131</b> (also referred as a touch display screen or a touchpad) may collect the touch operations performed by the user thereon or thereby (such as the user may use an object or an accessory such as a finger, a touch pen to perform operations on the touch sensitive surface <b>131</b> or near the touch sensitive surface <b>131</b>), and may drive a corresponding connecting device based on a preset program. Alternatively, the touch sensitive surface <b>131</b> may include a touch detecting device and a touch controller. Wherein, the touch detecting device may detect a position touched by the user, detect a signal generated by the touch operation, and transmit the signal to the touch controller; the touch controller may receive the touch information from the touch detecting device and transfer the touch information into contact coordinates, the touch controller may transmit the contact coordinates to the processor <b>180</b>, receive a instruction transmitted by the processor <b>180</b>, and perform the instruction. Additionally, the touch sensitive surface <b>131</b> may be implemented with resistances, capacitances, infrared rays, and surface acoustic waves. In addition to the touch sensitive surface <b>131</b>, the input unit <b>130</b> may also include the other input devices <b>132</b>. Particularly, the other input devices <b>132</b> may include, but not limited to, one or more of a physical keyboard, a function key (such as a volume control button and a switch button), a trackball, a mouse, a lever.
The display unit <b>140</b> may be configured to display the information input by the user or to be provided to the user and a variety of graphical user interfaces of the terminal, these graphical user interfaces may be consist of a graph, a text, an icon, a video, an any combinations thereof. The display unit <b>140</b> may include a display panel <b>141</b>, alternatively, the display panel <b>141</b> may be configured as a LCD (Liquid Crystal Display) and a OLED (Organic Light-Emitting Diode). Further, the touch sensitive surface <b>131</b> may cover the display panel <b>141</b>. When the touch sensitive surface <b>131</b> detects a touch operation performed thereon or thereby, the touch operation may be transmitted to the processor <b>180</b> so that the type of the touch event may be determined. The processor <b>180</b> may provide a corresponding visual output to the display panel <b>141</b> according to the type of the touch event. Although the touch sensitive surface <b>131</b> and the display panel <b>141</b> are illustrated as individual components to implement the input function and the output function in <figref idref="DRAWINGS">FIG. 5</figref>, the touch sensitive surface <b>131</b> and the display panel <b>141</b> may be integrated to implement the input function and the output function in some embodiments.
The terminal <b>500</b> may also include at least one sensor <b>150</b>, such as an optical sensor, a motion sensor, and other sensors. Particularly, the optical sensor may include an ambient light sensor and a proximity sensor, wherein, the ambient light sensor may adjust the luminance of the display panel <b>141</b> according to the ambient light, the proximity sensor may close the display panel <b>141</b> and/or the backlight when the terminal <b>500</b> is moved to the ear. The gravity accelerometer which is a motion sensor may detect the acceleration of all directions (generally, three axises), and may detect the gravity and the direction thereof when it is static. the gravity and the direction thereof may be utilized by applications for identifying the attitude of the cellphone (such as horizontal-vertical switching of the screen, related games, and magnetometer calibration) and functions related to vibration identification (such as a pedometer and knock on). The terminal <b>500</b> may also include other sensors such as a gyroscope, a pressure meter, a moisture meter, a thermometer, a infrared sensor, which will not be elaborated herein.
The audio circuitry <b>160</b>, the speaker <b>161</b>, and the microphone <b>162</b> may provide an audio interface between the user and the terminal <b>500</b>. The audio circuitry <b>160</b> may transmit the electrical signal transformed from the received audio data to the speaker <b>161</b>, and the speaker <b>161</b> may transform the electrical signal to the acoustical signal so as to output it. On the other hand, the microphone <b>162</b> may transform the collected acoustical signal into the electrical signal, the audio circuitry <b>160</b> may receive the electrical signal and transform the electrical signal into the audio data, then the audio data may be output to the processor <b>180</b> for processing, and the RF circuitry may transmit the processed audio data to another terminal, alternatively, the audio data may be output to the memory <b>120</b>. The audio circuitry <b>160</b> may include an earplug jack which may enable the communication between the headset and the terminal <b>500</b>.
The WiFi belongs to the short distance wireless transmission technology. The terminal <b>500</b> may send and receive emails, browse webpage, and access to streaming media via the WiFi module <b>170</b>. The WiFi module <b>170</b> may provide wireless broadband Internet access. Although the WiFi module <b>170</b> is illustrated in <figref idref="DRAWINGS">FIG. 5</figref>, it is to be understood that the WiFi module <b>170</b> is not necessary for the terminal <b>500</b>, and the WiFi module <b>170</b> may be omitted without altering the scope of the invention.
The processor <b>180</b> may be the control center of the terminal <b>500</b>. The processor <b>180</b> may utilize a variety of interfaces and links to connect each part of the cellphone, and may perform a variety of functions of the terminal <b>500</b> and data processing by performing the software programs and/or modules stored in the memory <b>120</b> and invoking the data stored in the memory <b>120</b>, such that the cellphone may be monitored. Alternatively, the processor <b>180</b> may include one or more processing cores, for example, the processor <b>180</b> may integrate an application processor and a modem processor, wherein, the application processor may mainly process the operating system, the user interface and the applications, the modem processor may mainly process wireless communication. It is to be understood that the above modem processor may not be integrated in the processor <b>180</b>.
The terminal <b>500</b> may also include a power supply <b>190</b> (such as a battery) which may power up each components, for example, the power supply may logically connect with the processor <b>180</b> via a power management system, such that the power supply may manage charging, discharging, and power consumption via the power management system. The power supply <b>190</b> may also include one or more DC or AC power, a recharging system, a circuitry for detecting power failures, a power converter or inverter, and a power state indicator.
The terminal <b>500</b> may also include a camera and a Bluetooth module (not shown), which will not be elaborated herein. Particularly, in an exemplary embodiment, the display unit of the terminal may be a touch screen displayer. The terminal may also include a memory and one or more programs, wherein the one or more programs may be stored in the memory, and may be configured to be performed by one or more processor. The one or more programs may include the method for establishing a data connection provided by the embodiments as illustrated by <figref idref="DRAWINGS">FIG. 1</figref> and <figref idref="DRAWINGS">FIG. 2</figref>.
Although features and elements are described above in particular combinations, one of ordinary skill in the art will appreciate that each feature or element may be used alone, or in any combination with the other feature and elements if no contradiction exists. Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the disclosures herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following the general principles thereof and including such departures from the present disclosure as come within known or customary practice in the art. It is intended that the specification and embodiments be considered as illustrative only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be appreciated that the present disclosure is not limited to the exact construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. It is intended that the scope of the invention only be limited by the appended claims.
Contents6
7 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6 Sheet 7
Every citation, both ways
| Document | Relation | Office | Category | Cited during | Relevant claims |
|---|---|---|---|---|---|
| US2018213049A1 | Cited by | United States of America | – | Search report | – |
| US10911557B2 | Cited by | United States of America | – | Search report | – |
| US2018213049A1 | Cited by | United States of America | – | Search report | – |
| WO2023109366A1 | Cited by | World Intellectual Property Organization (WIPO) | – | International search | – |
| US2013097250A1 | Cites | United States of America | A | Pre-grant | – |
| US2013097250A1 | Cites | United States of America | A | Search report | – |
| US8423602B2 | Cites | United States of America | X | Search report | 1, 3-6, 8-11, 13-15 |
5 priority claims, no other members on record
Priority claims5
| Document | Office | Kind | Date |
|---|---|---|---|
| 201510919039 | China | A | |
| 201510919039 | China | A | |
| 2015109190398 | China | – | |
| 2015109190398 | – | – | – |
| CN20151919039 | – | – | – |
31 transactions on the USPTO file
1 non-final rejection on record.
- Non-final rejections
- 1
- Final rejections
- 0
- RCEs
- 0
- Appeals
- 0
Over time
Point at a mark for the transactionTransactions
| Event | Code | |
|---|---|---|
| Electronic ReviewELC_RVW | ELC_RVW | |
| Email NotificationEML_NTF | EML_NTF | |
| Mail Non-Final RejectionNon-final rejectionMCTNF | MCTNF | |
| Non-Final RejectionNon-final rejectionCTNF | CTNF | |
| Information Disclosure Statement consideredIDSC | IDSC | |
| Information Disclosure Statement (IDS) FiledWIDS | WIDS | |
| Information Disclosure Statement (IDS) FiledM844 | M844 | |
| Case Docketed to Examiner in GAUDOCK | DOCK | |
| Information Disclosure Statement consideredIDSC | IDSC | |
| Electronic Information Disclosure StatementEIDS. | EIDS. | |
| Information Disclosure Statement (IDS) FiledWIDS | WIDS | |
| Email NotificationEML_NTR | EML_NTR | |
| Application ready for PDX access by participating foreign officesCCRDY | CCRDY | |
| PG-Pub Issue NotificationPG-ISSUE | PG-ISSUE | |
| Priority document has successfully retrieved via PDX/DASPD.RECVD | PD.RECVD | |
| Case Docketed to Examiner in GAUDOCK | DOCK | |
| Email NotificationEML_NTR | EML_NTR | |
| Filing Receipt - ReplacementFLRCPT.R | FLRCPT.R | |
| Application Dispatched from OIPEOIPE | OIPE | |
| Email NotificationEML_NTR | EML_NTR | |
| Application Is Now CompleteCOMP | COMP | |
| Filing ReceiptFLRCPT.O | FLRCPT.O | |
| Sent to Classification ContractorPGPC | PGPC | |
| FITF set to YES - revise initial settingFTFS | FTFS | |
| Cleared by OIPE CSRL194 | L194 | |
| IFW Scan & PACR Auto Security ReviewSCAN | SCAN | |
| Patent Term Adjustment - Ready for ExaminationPTA.RFE | PTA.RFE | |
| Request from applicant for the USPTO to retrieve the Priority DocumentPDREQUST | PDREQUST | |
| Applicants have given acceptable permission for participating foreignAPPERMS | APPERMS | |
| Entity status set to undiscounted (initial default setting or status change)BIG. | BIG. | |
| Initial Exam Team nnIEXX | IEXX |
6 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Information on status: application discontinuationABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTIONSTCB | STCB | |
| Information on status: application discontinuationFINAL REJECTION MAILEDSTCB | STCB | |
| Information on status: patent application and granting procedure in generalFINAL REJECTION MAILEDSTPP | STPP | |
| Information on status: patent application and granting procedure in generalRESPONSE TO NON-FINAL OFFICE ACTION ENTERED AND FORWARDED TO EXAMINERSTPP | STPP | |
| Information on status: patent application and granting procedure in generalNON FINAL ACTION MAILEDSTPP | STPP | |
| AssignmentAS | AS |
Numbers
- Publication
- 20170171255
- Publication, DOCDB
- 2017171255
- Publication, EPODOC
- US2017171255
- Application
- 15347769
- Application, DOCDB
- 201615347769
- Application, EPODOC
- US201615347769
Titles
- English
- METHOD AND DEVICE FOR ESTABLISHING A DATA CONNECTION AND COMPUTER-READABLE MEDIUM
Classification
- CPC, 11
- H04L65/1069
- H04L67/141
- H04W12/08
- H04L65/1073
- H04L63/08
- H04L45/745
- H04L63/101
- H04L47/803
- H04L67/327
- H04W4/60
- H04L67/63
- IPC, 5
- H04L29 06
- H04L12 927
- H04L12 741
- H04L45 74
- H04L47 80
- USPC, 1
- 001001000