WO2016165584A1 - 一种终端之间的通信方法和装置 - Google Patents

一种终端之间的通信方法和装置 Download PDF

Info

Publication number
WO2016165584A1
WO2016165584A1 PCT/CN2016/078803 CN2016078803W WO2016165584A1 WO 2016165584 A1 WO2016165584 A1 WO 2016165584A1 CN 2016078803 W CN2016078803 W CN 2016078803W WO 2016165584 A1 WO2016165584 A1 WO 2016165584A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
application
identifier
processing object
target
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.)
Ceased
Application number
PCT/CN2016/078803
Other languages
English (en)
French (fr)
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.)
Le Holdings Beijing Co Ltd
LeTV Information Technology Beijing Co Ltd
Original Assignee
Le Holdings Beijing Co Ltd
LeTV Information Technology Beijing 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 Le Holdings Beijing Co Ltd, LeTV Information Technology Beijing Co Ltd filed Critical Le Holdings Beijing Co Ltd
Publication of WO2016165584A1 publication Critical patent/WO2016165584A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a communication method between terminals and a communication device between terminals.
  • a user can download a video that is desired to be viewed to a mobile phone (mobile terminal) in a scene with Wi-Fi (Wireless Fidelity), and then watch the video in a scene without Wi-Fi.
  • Wi-Fi Wireless Fidelity
  • the operation of the user on the terminal is cumbersome and may even damage the terminal.
  • the user may go to do housework such as cleaning and cooking. If the user still wants to continue watching the video on the mobile phone, he needs to carry the mobile phone anytime and anywhere, which is very inconvenient and may be The phone is broken.
  • embodiments of the present application have been made in order to provide a communication method between terminals and a corresponding communication device between terminals, which overcomes the above problems or at least partially solves the above problems.
  • the embodiment of the present application discloses a communication method between terminals, including:
  • the application call request includes a target terminal identifier selected from the one or more terminal identifiers, and a target selected from one or more application identifiers associated with the target terminal identifier Application identification, and message content;
  • the embodiment of the present application further discloses a communication device between terminals, including:
  • the querying module is configured to: when receiving the terminal query request sent by the first terminal, return one or more terminal identifiers and one or more application identifiers associated with each terminal identifier to the first terminal according to the terminal query request ;
  • the application call request receiving module is configured to receive an application call request sent by the first terminal, where the application call request includes a target terminal identifier selected from the one or more terminal identifiers, and an association associated with the target terminal identifier Target application identifier selected from multiple application identifiers, and message content;
  • the application call request sending module is configured to send the application call request to the second terminal corresponding to the target terminal identifier, to drive the second terminal to invoke the application corresponding to the target application identifier to process the message content.
  • the embodiment of the present application also discloses a computer readable recording medium recorded with a program for executing the above method.
  • the application of the first terminal calls the corresponding application in the second terminal to perform corresponding processing based on the application call request of the first terminal, and implements the inheritance of the processing content to adapt to different processing requirements, thereby greatly improving the simplicity of the operation.
  • the interaction between the first terminal and the second terminal is implemented by the intermediary, and the interaction between the first terminal and the second terminal is not limited to a specific protocol, and is not limited to specific content, and has strong scalability and various forms.
  • the embodiments of the present application process the registration, establish a long connection, and distribute messages through a unified interface, which greatly reduces the development cost of the application and improves the service efficiency.
  • Embodiment 1 is a flow chart showing the steps of Embodiment 1 of a method for communication between terminals according to the present application;
  • Embodiment 2 is a flow chart showing the steps of Embodiment 2 of a method for communication between terminals according to the present application;
  • FIG. 3 is a structural block diagram of an embodiment of a communication device between terminals of the present application.
  • FIG. 1 a flow chart of the steps of the first embodiment of the communication method between the terminals of the present application is shown, which may specifically include the following steps:
  • Step 101 When receiving the terminal query request sent by the first terminal, returning one or more terminal identifiers and one or more application identifiers associated with each terminal identifier to the first terminal according to the terminal query request;
  • Step 102 Receive an application call request sent by the first terminal, where the application call request includes a target terminal identifier selected from the one or more terminal identifiers, and one or more application identifiers associated with the target terminal identifier.
  • Step 103 Send the application call request to the second terminal corresponding to the target terminal identifier, to drive the second terminal to invoke the application corresponding to the target application identifier to process the message content.
  • the embodiment of the present application invokes the application in the second terminal to perform corresponding processing, and implements inheritance of the processing content to adapt to different processing requirements, thereby greatly improving the simplicity of the operation.
  • the interaction between the first terminal and the second terminal is implemented by the intermediary, and the interaction between the first terminal and the second terminal is not limited to a specific protocol, and is not limited to specific content, and has strong scalability and various forms.
  • FIG. 2 a flow chart of the steps of the second embodiment of the communication method between the terminals of the present application is shown, which may specifically include the following steps:
  • Step 201 Receive a registration request.
  • the embodiment of the present application can be applied to a service platform, and the essence of the service platform Can be a standalone server, or a server cluster.
  • the service platform can be connected to a plurality of terminals, such as a first terminal and a second terminal.
  • the terminal can include a mobile phone, a tablet computer, a television, a personal computer, a smart watch, and the like.
  • the service platform may provide a server registration interface, such as an HTTP (HyperText Transfer Protocol) interface, and the service platform is sent by the server registration interface receiving terminal (such as the first terminal and the second terminal). Registration request.
  • HTTP HyperText Transfer Protocol
  • a unified interface can be encapsulated by the SDK (Application Development Kit) and provided to the application, and the SDK completes the registration by defining a corresponding protocol with the service platform.
  • SDK Application Development Kit
  • the first terminal has a unified interface, and the unified interface sends a registration request to the service platform, that is, the first terminal can register through the unified interface.
  • the second terminal has a unified interface, and the unified interface sends a registration request to the service platform, that is, the second terminal can register through the unified interface.
  • Step 202 When the registration request includes the user identifier and the terminal identifier, establish an association relationship between the user identifier and the terminal identifier.
  • the service platform may register the terminal, indicating that the terminal can accept the pushed service message (such as an application call request).
  • the service platform may establish an association relationship between the user identifier and the terminal identifier, and complete the registration, and the service platform may store the registration information to bind different terminals under the same user, and construct a terminal ecosystem belonging to the user.
  • service extension can be supported. For example, if the user has his own sharing circle and friend circle, the user identifier corresponding to the known friend can be sent to send a message.
  • the user identifier may be information capable of representing a uniquely determined user, for example, a user ID (IDentity), a User_ID;
  • the terminal identifier may be information capable of representing a uniquely determined terminal, for example, a terminal ID, Device_ID.
  • Step 203 When the registration request includes the terminal identifier and the application identifier, establish an association relationship between the terminal identifier and the application identifier.
  • the service platform may register the application, indicating that the application can accept the pushed service message (such as an application call request).
  • the service platform may establish an association relationship between the terminal identifier and the identifier, and complete the registration, and the service platform stores the registration information to bind different applications under the same terminal.
  • the application identifier may be information capable of representing a uniquely determined application, for example, an application ID, APP_ID.
  • the application may be an application of the terminal system, or may be a third-party application (Application, APP), which is not limited in this embodiment of the present application.
  • Application Application, APP
  • the terminal (such as the first terminal and the second terminal) can also send an unbinding request (ie, anti-registration) to the service platform through the unified interface provided by the SDK, and the service platform can release the user according to the unbinding request.
  • an unbinding request ie, anti-registration
  • Step 204 Establish a first long connection with the first terminal.
  • Step 205 Establish a second long connection with the second terminal.
  • a long connection (such as a first long connection and a second long connection) may mean that multiple data packets may be continuously transmitted on one connection. During the connection hold period, if no data packet is sent, both parties need to send a link detection packet.
  • TCP Transmission Control Protocol
  • the unified interface can be encapsulated by the SDK and provided to the application, and the SDK completes the connection by defining a corresponding protocol with the service platform.
  • the first terminal has a unified interface, and the first terminal can establish a first long connection with the service platform by using the unified interface, where the first long connection can be used by the service platform to communicate with the first terminal.
  • the second terminal has a unified interface, and the second terminal can establish a second long connection with the service platform through the unified interface, where the second long connection can be used for the service platform to communicate with the second terminal.
  • the service platform may use the terminal identifier to calculate a long connection with the terminal (such as the first terminal and the second terminal) according to a preset allocation manner.
  • a long connection such as the first terminal and the second terminal
  • the service platform may use the terminal identifier to calculate a long connection with the terminal (such as the first terminal and the second terminal) according to a preset allocation manner.
  • the terminal such as the first terminal and the second terminal
  • the service platform may use the terminal identifier to calculate a long connection with the terminal (such as the first terminal and the second terminal) according to a preset allocation manner.
  • a preset allocation manner such as the first long connection, the second long connection server.
  • the service platform may send the information of the server, such as an IP (Internet Protocol, protocol) address, port, and the like, to the terminal (such as the first terminal and the second terminal) for buffering.
  • IP Internet Protocol, protocol
  • the terminal eg, the first terminal, the second terminal
  • the terminal may request information of the server from the service platform at a specific time (such as when booting).
  • the terminal (such as the first terminal and the second terminal) initiates a connection request to the corresponding server in the service platform according to the information of the server, and the server in the service platform detects the terminal (such as the first terminal,
  • the registration information of the second terminal (such as the terminal identifier registered at the time of registration) is established, a legal long connection (such as a first long connection and a second long connection) is established.
  • some service requirements are multi-screen interaction, and the technical feature is a long connection.
  • the use of long-connection communication can ensure high real-time communication and power consumption between terminals (such as the first terminal and the second terminal). Less, less traffic.
  • Step 206 When receiving the terminal query request sent by the first terminal, returning one or more terminal identifiers and one or more application identifiers associated with each terminal identifier to the first terminal according to the terminal query request;
  • the communication between the service platform and the first terminal may include a communication terminal query request, that is, the first terminal may send a terminal query request through the first long connection, and the service platform may receive the terminal query request through the first long connection.
  • the terminal query request may refer to an instruction sent by the first terminal to query other terminals.
  • the terminal can be triggered by clicking a certain control to find other terminals, and continue watching the video in other terminals.
  • the terminal can automatically trigger the terminal to query the other terminal to find the other terminal and prompt the short message in the other terminal.
  • the communication between the service platform and the first terminal may include a communication terminal identifier and an application identifier, that is, the service platform may return one or more terminal identifiers to the first terminal through the first long connection, and one or more application identifiers associated with each terminal identifier.
  • the first terminal may receive one or more terminal identifiers and one or more application identifiers associated with the respective terminal identifiers by using the first long connection.
  • step 206 can include the following sub-steps:
  • Sub-step S11 extracting a user identifier from the terminal query request
  • Sub-step S12 searching for one or more terminal identifiers associated with the user identifier, and one or more application identifiers associated with each terminal identifier;
  • Sub-step S13 returning the one or more terminal identifiers and one or more application identifiers associated with the respective terminal identifiers to the first terminal.
  • the service platform may search for the terminal bound to the same user according to the registration information, and the application that is bound to the terminal, that is, the terminal identifier associated with the same user identifier and the application identifier associated with the terminal identifier.
  • the method for searching for the terminal identifier is only used as an example.
  • the search mode of other terminal identifiers may be set according to the actual situation, which is not limited in this embodiment of the present application.
  • the terminal query request may include the address information of the first terminal, such as an IP address, a MAC (Media Access Control Address) address, and the like, and the service platform may query the information by establishing a long connection through the terminal.
  • the terminal identifier of the terminal that matches the address information of the first terminal such as the terminal identifier of other terminals located in the same local area network. If the local area network may be a home local area network, the other terminals may be other terminals in the home.
  • the returned one or more terminal identifiers may be terminal identifiers of the online terminals.
  • online as used in the embodiment of the present application may refer to that the terminal establishes a long connection with the service platform, and can directly communicate.
  • the service platform can query the online information or offline information to know whether the terminal is online or offline.
  • Step 207 Receive an application call request sent by the first terminal.
  • the application call request may include a target terminal identifier selected from the one or more terminal identifiers, a target application identifier selected from one or more application identifiers associated with the target terminal identifier, and message content.
  • the communication between the service platform and the first terminal may include an application call request.
  • the communication that is, the first terminal can send an application call request through the first long connection, and the service platform can receive the application call request through the first long connection.
  • the first terminal may display the UI (User Interface), and the user may The target terminal identifier is selected from the plurality of terminal identifiers, and the target application identifier is selected from one or more application identifiers associated with the target terminal identifier.
  • UI User Interface
  • the first terminal may also select the target terminal identifier and the target application identifier in other manners, which is not limited in this embodiment.
  • the adaptation relationship between the terminal and the application may be preset to indicate which applications of which terminals can process the same content, that is, an application of a certain terminal can support the content of other applications of other terminals, and an example thereof is as follows: Shown as follows:
  • Terminal identification Application identifier Terminal identification Application identifier Mobile phone Video application A TV Video player B
  • the above table may indicate that the video application A in the mobile phone and the video player B in the television can process the same content, that is, the video player B in the television can support playing the video in the video application A in the mobile phone.
  • the first terminal may search for the terminal identifier and the application identifier that are matched with the terminal identifier of the first terminal and the application identifier of the current application in the adaptation relationship, as the target terminal identifier and the target application identifier.
  • the message content can be generated based on the processing object of the application in the first terminal, ie the first terminal and the second terminal can process the same processing object synchronously.
  • the processing object may include at least one or more of the following:
  • the processing object may be directly used as a message content
  • the processing object identifier of the processing object may be used as the message content, and the second terminal may obtain the corresponding processing according to the processing object identifier.
  • the processing object identifier may be information capable of representing a uniquely determined terminal, for example, a processing object ID, a processing object name, and the like.
  • the processing state can be identified to indicate the state in which the application in the first terminal processes the processing object.
  • the processing status may include playing time information
  • the processing status may include the current number of pages.
  • the content of the message and the manner of generating the foregoing are only examples.
  • other message content and a generating manner may be set according to actual conditions, for example, directly processing a processing object with a large data stream as a message content, and the like.
  • This embodiment of the present application does not limit this.
  • the content of the message and the manner of generating the message may be used by those skilled in the art in addition to the content of the message and the manner of the foregoing, and the embodiment of the present application does not limit this.
  • target terminal identifier the target terminal identifier
  • target application identifier the target application identifier
  • message content other information may be written in the application call request for other purposes, which is not limited in this embodiment of the present application.
  • the terminal identifier of the first terminal and the application identifier of the currently processed application may be written in the application call request for counting the frequency at which the terminal and the application initiate the call.
  • Step 208 Send the application call request to the second terminal corresponding to the target terminal identifier, to drive the second terminal to invoke the application corresponding to the target application identifier to process the message content.
  • the communication between the service platform and the second terminal may include the communication of the application call request, that is, the service platform may send the application call request through the second long connection, and the second terminal may receive the application call request through the second long connection.
  • the service platform may directly transmit the request to the second terminal without performing any processing on the application call request.
  • the unified interface of the SDK may be encapsulated and provided to the application, and the SDK defines a corresponding protocol by the service platform to complete the application processing message content corresponding to the target application identifier.
  • the SDK may parse the target application identifier in the application call request, and if the application corresponding to the target application identifier is identified, the SDK may distribute the application call request to the application. Processing, the application can parse the message content for corresponding processing.
  • step 208 can include the following sub-steps:
  • Sub-step S21 in the first server, query whether the local second communication has a second long connection corresponding to the target terminal identifier; if yes, perform sub-step S22, and if not, perform sub-step S23;
  • Sub-step S22 sending the application call request to the second terminal by using the second long connection
  • Sub-step S23 writing the application call request to a preset message queue
  • Sub-step S24 forwarding, in the second server, the application call request in the message queue to a third server having the second long connection;
  • Sub-step S25 the application call request is sent to the second terminal by the second long connection in the third server.
  • the service platform has a message routing service, and the message routing service may be provided by an independent server or a server cluster.
  • the message routing service can be used for routing messages between devices across a network, and is generally not directly directed to users and terminals.
  • the message routing service performs message production by establishing a long-connected server, and then is consumed by the message routing service.
  • the message is distributed to the long-connected server where the target terminal is located, and is delivered to the target terminal through the available long connection.
  • each server can manage long connections of millions of terminals. Different terminals of the same user may be assigned due to different network types and the like. Different servers establish long connections.
  • the application call request may be first sent to the first server through the first long connection, and the first server finds that the second long connection of the second terminal is not local.
  • Application calls can be written to the message queue during maintenance.
  • the second server providing the message routing service is responsible for listening to the message queue.
  • the second server consumes the message (ie, the application call request) and parses the message ( That is, the application call request finds a third server having a second long connection, and the second server transmits a message (ie, an application call request) to the third server through a connection established with the third server.
  • the third server sends an application call request to the second terminal through the second long connection.
  • the message queue can be a public queue, that is, the server in the service platform can access, write a message (ie, an application call request) to the queue, and the server that provides the message routing service can consume the message in the message queue (ie, the application)
  • the request may be), which may be a storage space (such as a memory) of any server, which is not limited in this embodiment of the present application.
  • the second server that provides the second long connection with the second terminal is calculated by using the terminal identifier according to the preset allocation manner, and the second server that provides the message routing service may adopt the message (ie, the application call request)
  • the terminal identifier in the system calculates the server (ie, the third server) that establishes the second long connection according to the allocation manner.
  • the second terminal may process the message content in the following manner:
  • Sub-step S31 when the message content includes a processing object, calling an application corresponding to the target application identifier to process the processing object;
  • the processing object if the processing object is included in the message content, the corresponding application may be directly invoked to process the processing object.
  • the processing object is a short message (text)
  • the second terminal can call a text editor (application) to display the short message.
  • Sub-step S32 when the message content includes the processing object identifier, requesting, by the specified content server, the processing object corresponding to the processing object identifier;
  • Sub-step S33 the application corresponding to the target application identifier is invoked to process the processing object
  • the corresponding processing object may be requested by the content server, and the corresponding application is invoked to process the processing object.
  • processing object may be pre-stored in a content server, which is not necessarily a server in the service platform.
  • the processing object may be uploaded by the current user, or may be uploaded by another user, or may be stored by the content server itself, which is not limited in this embodiment of the present application.
  • the processing object is an image, which is uploaded by the current user to the content server, and the second terminal can call the image display (application) to display the image after requesting the image from the content server.
  • Sub-step S34 when the message content includes the processing object identifier and the processing state, requesting, by the preset content server, the processing object corresponding to the processing object identifier and in the processing state;
  • Sub-step S35 invoking an application corresponding to the target application identifier to process a processing object in the processing state.
  • the processing object includes the processing state, that is, the processing state
  • the processing object that is in the processing state may be requested from the content server, and the corresponding application is invoked to process the processing object.
  • the processing object is a video
  • the content server itself stores the video
  • the application of the first terminal plays the video to the time X (processing state)
  • the second terminal may request the video server after the video of the time X to call the video.
  • the player (app) plays the video at time X.
  • the second terminal may automatically request the content of the next episode to be played by the content server according to the processing object identifier of the current video.
  • the foregoing processing manner is only an example.
  • other processing manners may be set according to actual conditions.
  • the second terminal directly establishes a connection request corresponding to the first terminal, and then invokes the corresponding application.
  • the processing, and the like the embodiment of the present application does not limit this.
  • other processing methods may be used by those skilled in the art according to actual needs, and the embodiments of the present application do not limit this.
  • the SDK is used to encapsulate a unified interface, so that all applications that need to receive and push messages on the same terminal can share the service of the push platform, and the SDK implements registration, establishes a long connection, sends a message, and deregisters the application.
  • Interface, application integration SDK you can use these functions, the specific implementation is done by the SDK, the application itself does not need to care about the specific implementation, so that all implementations are defined by the SDK and the service platform to define the protocol, for the terminal
  • the application is transparent.
  • the traditional way is that each application needs to implement these functions by using these services.
  • the SDK is convenient to reduce the development cost of the services using the push platform, ensuring that all applications use a unified interface to ensure a long connection channel. This channel can be used for all application communications, greatly improving service efficiency.
  • the user can trigger the terminal to query the request by clicking on the control specified on the video application.
  • the service platform When the service platform detects the terminal query request, it can search for the terminal, such as the home TV, tablet, personal computer, other mobile phone, and its bound application.
  • the terminal such as the home TV, tablet, personal computer, other mobile phone, and its bound application.
  • the user can select the TV (target terminal identifier) and its video player (target application identifier) from the terminal and the application.
  • the mobile phone may generate an application call request according to the user's selection, and then send an application call request to the service platform, where the application call request includes the video name and its set number (processing object identifier) and play time (processing status).
  • the service platform can forward the application call request to the television (second terminal) through a message routing service.
  • the television requests the video website (content server) to be the video corresponding to the video name and its set number at the playing time, and calls the video player to play.
  • the response range of the TV is wider than that of the mobile phone, the user can continue to watch the video while doing housework, greatly improving the flexibility of the video playing, improving the user experience, and reducing the video viewing on the mobile phone while doing housework. Potential damage to the phone.
  • the video player calling the television continues to play the video.
  • the mobile phone can automatically trigger the terminal to query the request.
  • the service platform When the service platform detects the terminal query request, it can search for the terminal, such as the home TV, tablet, personal computer, other mobile phone, and its bound application.
  • the terminal such as the home TV, tablet, personal computer, other mobile phone, and its bound application.
  • the mobile phone can select a television (target terminal identifier) and its text editor from the terminal and the application. (target application identifier), and generate an application call request, and then send an application call request to the service platform, where the application call request includes a short message (processing object).
  • the service platform can forward the application call request to the television (second terminal) through a message routing service.
  • the television displays the text message according to the call text editor, which further improves the synchronization operation between the mobile phone and the television.
  • FIG. 3 a structural block diagram of an embodiment of a communication device between terminals of the present application is shown, which may specifically include the following modules:
  • the querying module 301 is configured to: when receiving the terminal query request sent by the first terminal, return one or more terminal identifiers and one or more applications associated with each terminal identifier to the first terminal according to the terminal query request Identification
  • the application call request receiving module 302 is configured to receive an application call request sent by the first terminal; the application call request includes a target terminal identifier selected from the one or more terminal identifiers, and one associated with the target terminal identifier Or target application identifier selected in multiple application identifiers, and message content;
  • the application call request sending module 303 is configured to send the application call request to the second terminal corresponding to the target terminal identifier, to drive the second terminal to invoke the application corresponding to the target application identifier to process the message content.
  • the apparatus may further include the following modules:
  • a registration request receiving module configured to receive a registration request
  • a terminal registration module configured to establish an association relationship between the user identifier and the terminal identifier when the registration request includes a user identifier and a terminal identifier;
  • the application registration module is configured to establish an association relationship between the terminal identifier and the application identifier when the registration request includes the terminal identifier and the application identifier.
  • the apparatus may further include the following modules:
  • a first long connection establishing module configured to establish a first long connection with the first terminal
  • a second long connection establishing module configured to establish a second long connection with the second terminal
  • the first long connection is used for communicating with the first terminal, including receiving a terminal query request, an application call request, returning one or more terminal identifiers, and one or more application identifiers associated with each terminal identifier;
  • the second long connection is for communicating with the second terminal, including sending an application call request.
  • the query module 301 can include the following modules:
  • An extraction module configured to extract a user identifier from the terminal query request
  • a search module configured to search for one or more terminal identifiers associated with the user identifier, and one or more application identifiers associated with each terminal identifier;
  • the returning module is configured to return the one or more terminal identifiers and one or more application identifiers associated with the respective terminal identifiers to the first terminal.
  • the application call request sending module 303 may include the following modules:
  • the long connection query module is configured to query, in the first server, whether the local second connection has communication with the second terminal corresponding to the target terminal identifier; if yes, the first sending module is invoked; if not, the call is written Queue module
  • a first sending module configured to send the application call request to the second terminal by using the second long connection
  • a write queue module configured to write the application call request to a preset message queue
  • a routing module configured to forward the application call request in the message queue to a third server having the second long connection in a second server;
  • the second sending module is configured to send the application call request to the second terminal by using the second long connection in the third server.
  • the message content may be generated based on a processing object of an application in the first terminal;
  • the second terminal may process the message content by calling the following module:
  • a first processing module configured to: when the message content includes a processing object, invoke an application corresponding to the target application identifier to process the processing object;
  • the first requesting module is configured to: when the message content includes the processing object identifier, request the processing object corresponding to the processing object identifier from the specified content server;
  • a second processing module configured to invoke an application corresponding to the target application identifier to process the processing object
  • a second requesting module configured to: when the content of the message includes a processing object identifier and a processing status, request, by the preset content server, a processing object that is in the processing state corresponding to the processing object identifier;
  • the third processing module is configured to invoke a processing object corresponding to the target application identifier to process the processing object in the processing state.
  • the processing object may include one or more of the following:
  • the processing state may include playing time information.
  • the first terminal may have a unified interface, and the first terminal registers by using the unified interface to establish a first long connection.
  • the second terminal has a unified interface, and the second terminal can register by using the unified interface, establish a second long connection, and invoke an application corresponding to the target application identifier to process the message content.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the present application also provides a computer readable recording medium on which a program for executing the above method is recorded.
  • the computer readable recording medium includes a form readable by a computer (eg, a computer) Any mechanism for storing or transmitting information.
  • a machine-readable medium includes read only memory (ROM), random access memory (RAM), magnetic disk storage media, optical storage media, flash storage media, electrical, optical, acoustic, or other forms of propagation signals (eg, carrier waves) , infrared signals, digital signals, etc.).
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种终端之间的通信方法和装置,该方法包括:当接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。本申请实施例实现处理内容的继承,以适应不同的处理要求,大大提高了操作的简便性。

Description

一种终端之间的通信方法和装置 技术领域
本申请涉及通信技术领域,特别是涉及一种终端之间的通信方法和一种终端之间的通信装置。
背景技术
随着网络通信技术的快速发展,各种类型的终端,尤其是移动终端,在用户的日常生活、学习、工作等各方面的应用越来越广泛。例如,用户可以在具有Wi-Fi(无线保真)的场景下将想要观看的视频下载到手机(移动终端)中,然后在不具有Wi-Fi的场景下观看视频。
但在某些情况下,用户在终端上的操作较为繁琐,甚至有可能损害终端。例如,当用户回到家的时候,可能会去做打扫、煮饭等家务,此时若用户仍然想继续观看手机上的视频,就需要随时随地带着手机,十分不方便,还有可能会将手机摔损。
发明内容
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种终端之间的通信方法和相应的一种终端之间的通信装置。
为了解决上述问题,本申请实施例公开了一种终端之间的通信方法,包括:
当接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
本申请实施例还公开了一种终端之间的通信装置,包括:
查询模块,用于在接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
应用调用请求接收模块,用于接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
应用调用请求发送模块,用于将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
本申请实施例还公开了一种记录有用于执行上述方法的程序的计算机可读记录介质。
本申请实施例包括以下优点:
本申请实施例基于第一终端的应用调用请求,调用第二终端中对应的应用进行相应的处理,实现处理内容的继承,以适应不同的处理要求,大大提高了操作的简便性。
本申请实施例通过中介进行应用调用请求的推送,实现第一终端与第二终端的交互,不受限于特定的协议,不受限于特定的内容,扩展性强,形式多样。
本申请实施例通过统一的接口进行注册、建立长连接、分发消息等处理,大大降低了应用的开发成本,提高了服务效率。
附图说明
图1是本申请的一种终端之间的通信方法实施例1的步骤流程图;
图2是本申请的一种终端之间的通信方法实施例2的步骤流程图;
图3是本申请的一种终端之间的通信装置实施例的结构框图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
参照图1,示出了本申请的一种终端之间的通信方法实施例1的步骤流程图,具体可以包括如下步骤:
步骤101,当接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
步骤102,接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
步骤103,将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
本申请实施例基于第一终端的应用调用请求,调用第二终端中的应用进行相应的处理,实现处理内容的继承,以适应不同的处理要求,大大提高了操作的简便性。
目前,有某些应用支持直接从第一终端调用第二终端的应用播放视频,但是,这些应用一般需要支持特定的协议,扩展性差,仅支持视频的播放,形式单一。
本申请实施例通过中介进行应用调用请求的推送,实现第一终端与第二终端的交互,不受限于特定的协议,不受限于特定的内容,扩展性强,形式多样。
参照图2,示出了本申请的一种终端之间的通信方法实施例2的步骤流程图,具体可以包括如下步骤:
步骤201,接收注册请求;
需要说明的是,本申请实施例可以应用于服务平台,该服务平台的实质 可以是独立的服务器,或者,服务器集群。
该服务平台可以连接多个终端,如第一终端、第二终端,该终端可以包括手机、平板电脑、电视、个人电脑、智能手表等等,本申请实施例对此不加以限制。
在本申请实施例中,服务平台可以提供一个服务器注册接口,如HTTP(HyperText Transfer Protocol,超文本传输协议)接口,服务平台由该服务器注册接口接收终端(如第一终端、第二终端)发送的注册请求。
在终端(如第一终端、第二终端)中,可以由SDK(Software Development Kit,应用开发工具包)封装统一的接口,提供给应用,SDK通过和服务平台定义相应的协议,完成注册。
具体而言,第一终端中具有统一的接口,由该统一的接口向服务平台发送注册请求,即第一终端可以通过该统一的接口进行注册。
第二终端中具有统一的接口,由该统一的接口向服务平台发送注册请求,即第二终端可以通过该统一的接口进行注册。
步骤202,当所述注册请求包括用户标识与终端标识时,建立所述用户标识与所述终端标识的关联关系;
在本申请实施例中,服务平台可以对终端进行注册,表示该终端可以接受推送的业务消息(如应用调用请求)。
在实际应用中,服务平台可以建立用户标识与终端标识的关联关系,完成注册,服务平台可以存储注册信息,以绑定同一用户下的不同的终端,构建的属于该用户的终端生态系统。
在该终端生态系统中可以支持业务扩展,如用户有自己的一个分享圈、好友圈,则可以给已知的好友对应的用户标识去发送消息。
其中,用户标识可以是能够代表一个唯一确定的用户的信息,例如,用户ID(IDentity,身份标识号码),User_ID;
终端标识可以是能够代表一个唯一确定的终端的信息,例如,终端ID,Device_ID。
步骤203,当所述注册请求包括终端标识与应用标识时,建立所述终端标识与所述应用标识的关联关系。
在本申请实施例中,服务平台可以对应用进行注册,表示该应用可以接受推送的业务消息(如应用调用请求)。
在实际应用中,服务平台可以建立终端标识与标识的关联关系,完成注册,服务平台会存储注册信息,以绑定同一终端下的不同的应用。
其中,应用标识可以是能够代表一个唯一确定的应用的信息,例如,应用ID,APP_ID。
该应用可以为终端系统的应用,也可以为第三方应用(Application,APP),本申请实施例对此不加以限制。
需要说明的是,终端(如第一终端、第二终端)还可以通过SDK提供的统一的接口向服务平台发送解除绑定请求(即反注册),服务平台可以依据该解除绑定请求解除用户标识与终端标识的关联关系,和/或,解除终端标识与应用标识的关联关系。
步骤204,与第一终端之间建立第一长连接;
步骤205,与第二终端之间建立第二长连接;
长连接(如第一长连接、第二长连接)可以指在一个连接上可以连续发送多个数据包,在连接保持期间,如果没有数据包发送,需要双方发链路检测包。
长连接,如TCP(Transmission Control Protocol,传输控制协议)连接,一般可以用于操作频繁、点对点的通信。
在终端(如第一终端、第二终端)中,可以由SDK封装统一的接口,提供给应用,SDK通过和服务平台定义相应的协议,完成连接。
具体而言,第一终端中具有统一的接口,第一终端可以通过该统一的接口与服务平台建立第一长连接,该第一长连接可以用于服务平台与第一终端进行通信。
第二终端中具有统一的接口,第二终端可以通过该统一的接口与服务平台建立第二长连接,该第二长连接可以用于服务平台与第二终端进行通信。
在具体实现中,终端(如第一终端、第二终端)在注册时,服务平台可以采用终端标识按照预设的分配方式计算与该终端(如第一终端、第二终端)建立长连接(如第一长连接、第二长连接)的服务器。
在完成注册后,服务平台可以将该服务器的信息,如IP(Internet Protocol,网络之间互连的协议)地址、端口等,发送至终端(如第一终端、第二终端)中缓存。
或者,终端(如第一终端、第二终端)可以在特定时间(如开机时)向服务平台请求该服务器的信息。
终端(如第一终端、第二终端)按照该服务器的信息,由SDK提供的统一的接口向服务平台中相应的服务器发起连接请求,服务平台中的服务器检测到该终端(如第一终端、第二终端)的注册信息(如注册时登记的终端标识)时,建立合法的长连接(如第一长连接、第二长连接)。
在本申请实施例中,某些业务需求是多屏互动,技术特点是长连接,使用长连接通信的可以保证终端(如第一终端、第二终端)间通信的高实时性和耗电更少、流量更小。
步骤206,当接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
在本申请实施例中,服务平台与第一终端的通信可以包括通信终端查询请求,即第一终端可以通过第一长连接发送终端查询请求,服务平台可以通过第一长连接接收终端查询请求。
其中,终端查询请求可以是指第一终端发出的查询其他终端的指示。
例如,用户在手机(第一终端)上观看视频时,可以通过点击某个控件来触发终端查询请求,以查找其他终端,在其他终端中继续观看该视频。
又例如,当手机(第一终端)接收到短信时,则可以自动触发终端查询请求,以查找其他终端,在其他终端中提示该短信。
服务平台与第一终端的通信可以包括通信终端标识、应用标识,即服务平台可以通过第一长连接向第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识,第一终端可以通过第一长连接接收一个或多个终端标识、及各个终端标识关联的一个或多个应用标识。
在本申请的一种优选实施例中,步骤206可以包括如下子步骤:
子步骤S11,从所述终端查询请求中提取用户标识;
子步骤S12,查找所述用户标识关联的一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
子步骤S13,将所述一个或多个终端标识、及各个终端标识关联的一个或多个应用标识返回所述第一终端。
在本申请实施例中,服务平台可以按照注册信息查找同一用户下绑定的终端,及在该终端中绑定的应用,即返回同一用户标识关联的终端标识、该终端标识关联的应用标识。
当然,上述终端标识的查找方式只是作为示例,在实施本申请实施例时,可以根据实际情况设置其他终端标识的查找方式,本申请实施例对此不加以限制。
例如,终端查询请求中可以包括第一终端的地址信息,如IP地址、路由的MAC(Media Access Control Address,媒体访问控制地址)地址等,服务平台可以通过终端在建立长连接的信息查询与该第一终端的地址信息匹配的终端的终端标识,如位于同一局域网的其他终端的终端标识,若局域网可以是家庭局域网,则其他终端可以为家庭中的其他终端。
进一步而言,返回的该一个或多个终端标识,可以为在线终端的终端标识。
本申请实施例所指“在线”,可以指终端与服务平台建立了长连接,可以直接进行通信。
在服务平台中,可以在与某终端建立长连接后,对该终端的终端标识配置在线信息,可以在与某终端建立取消长连接后,对该终端的终端标识配置离线信息。
服务平台可以查询该在线信息或离线信息获知该终端处于在线状态或是处于离线状态。
步骤207,接收第一终端发送的应用调用请求;
其中,所述应用调用请求可以包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
在本申请实施例中,服务平台与第一终端的通信可以包括应用调用请求 的通信,即第一终端可以通过第一长连接发送应用调用请求,服务平台可以通过第一长连接接收应用调用请求。
在具体实现中,第一终端接收到一个或多个终端标识、及各个终端标识关联的一个或多个应用标识后,可以在UI(User Interface,用户界面)进行显示,用户可以从该一个或多个终端标识中选取目标终端标识,从该目标终端标识关联的一个或多个应用标识中选取目标应用标识。
当然,除了用户选取目标终端标识及目标应用标识之外,第一终端还可以采用其他方式选取目标终端标识及目标应用标识,本申请实施例对此不加以限制。
例如,可以预先设置终端及应用的适配关系,表示哪些终端的哪些应用之间可以处理相同的内容,即某个终端的某个应用可以支持处理其他终端的其他应用的内容,其示例如下表所示:
终端标识 应用标识 终端标识 应用标识
手机 视频应用A 电视 视频播放器B
上表可以表示在手机中的视频应用A与在电视中的视频播放器B可以处理相同的内容,即电视中的视频播放器B可以支持播放手机中的视频应用A中的视频。
第一终端可以在该适配关系中查找与第一终端的终端标识及当前应用的应用标识适配的终端标识及应用标识,作为目标终端标识及目标应用标识。
此外,消息内容可以基于第一终端中的应用的处理对象生成,即第一终端和第二终端可以同步处理相同的处理对象。
在本申请实施例的一种优选示例中,所述处理对象至少可以包括以下的一种或多种:
视频、音频、图像、文本、文档;
在本申请实施例中,针对文本等数据量较少的处理对象,可以直接将该处理对象作为消息内容;
针对图像、文档、视频、音频等数据量较大的处理对象,为减少流量消耗及加快响应速度,可以将处理对象的处理对象标识作为消息内容,第二终端可以依据处理对象标识获取相应的处理对象。
其中,处理对象标识可以是能够代表一个唯一确定的终端的信息,例如,处理对象ID,处理对象名称等等。
对于文档、视频、音频等处理过程较长的处理对象,则可以对其标识处理状态,以表示第一终端中的应用处理该处理对象时所处的状态。
例如,当处理对象为视频或音频时,该处理状态可以包括播放时间信息;
又例如,当处理对象为文档时,该处理状态可以包括当前的页数。
当然,上述消息内容及生成方式只是作为示例,在实施本申请实施例时,可以根据实际情况设置其他消息内容及生成方式,例如,直接将数据流较大的处理对象作为消息内容,等等,本申请实施例对此不加以限制。另外,除了上述消息内容及生成方式外,本领域技术人员还可以根据实际需要采用其它消息内容及生成方式,本申请实施例对此也不加以限制。
需要说明的是,在应用调用请求中除了目标终端标识、目标应用标识及消息内容之外,还可以写入其他信息,以用于其他用途,本申请实施例对此不加以限制。
例如,可以在应用调用请求中写入第一终端的终端标识及当前处理的应用的应用标识,以用于统计终端及应用发起调用的频率。
步骤208,将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
在本申请实施例中,服务平台与第二终端的通信可以包括应用调用请求的通信,即服务平台可以通过第二长连接发送应用调用请求,第二终端可以通过第二长连接接收应用调用请求。
需要说明的是,服务平台可以不对应用调用请求不进行任何处理,直接透传给第二终端。
在第二终端中,可以由SDK封装统一的接口,提供给应用,SDK通过和服务平台定义相应的协议,完成调用目标应用标识对应的应用处理消息内容。
具体而言,SDK可以将应用调用请求中解析出目标应用标识,如果识别出目标应用标识对应的应用,则SDK可以将应用调用请求分发给该应用进行 处理,该应用可以会解析消息内容进行相应的处理。
在本申请的一种优选实施例中,步骤208可以包括如下子步骤:
子步骤S21,在第一服务器中查询本地是否具有与所述目标终端标识对应的第二终端进行通信的第二长连接;若是,则执行子步骤S22,若否,则执行子步骤S23;
子步骤S22,通过所述第二长连接将所述应用调用请求发送至所述第二终端;
子步骤S23,将所述应用调用请求写入预设的消息队列;
子步骤S24,在第二服务器中将所述消息队列中的所述应用调用请求转发至具有所述第二长连接的第三服务器;
子步骤S25,在第三服务器中通过所述第二长连接将所述应用调用请求发送至所述第二终端。
在本申请实施例中,服务平台具有消息路由服务,该消息路由服务可以由独立的服务器或者服务器集群提供。
该消息路由服务可以用于跨网络的设备间消息的路由,一般不直接面向用户和终端,该消息路由服务通过建立长连接的服务器进行消息的生产,再由消息路由服务进行消费,最后将该消息分发到目标终端所在的长连接的服务器,通过可用的长连接下发到目标终端。
由于服务平台可能同时支持千万级甚至上亿级的终端在线,每台服务器大概能够管理百万级终端的长连接,同一个用户的不同终端由于网络类型等的不同,有可能会被分配到不同的服务器建立长连接。
当第一终端的应用预期把应用调用请求推送到第二终端的应用,可以先将应用调用请求通过第一长连接发送到第一服务器,第一服务器发现第二终端的第二长连接不在本地维护时,可以将应用调用请求写入消息队列。
提供消息路由服务的第二服务器负责监听消息队列,当监听到新的消息(即应用调用请求)进入消息队列时,第二服务器会消费该消息(即应用调用请求),并通过解析该消息(即应用调用请求)找到具有第二长连接的第三服务器,第二服务器通过和第三服务器建立的连接将消息(即应用调用请求)发送给第三服务器。
第三服务器通过第二长连接将应用调用请求发送给第二终端。
其中,消息队列可以为公共的队列,即服务平台中的服务器可以进行访问,将消息(即应用调用请求)写入该队列,提供消息路由服务的服务器可以消费该消息队列中的消息(即应用调用请求),其可以为任一服务器的存储空间(如内存),本申请实施例对此不加以限制。
此外,若第二终端在注册时,采用其终端标识按照预设的分配方式计算与第二终端建立第二长连接的服务器,则提供消息路由服务的第二服务器可以采用消息(即应用调用请求)中的终端标识按照该分配方式计算建立第二长连接的服务器(即第三服务器)。
在本申请的一种优选实施例中,所述第二终端可以通过以下方式处理消息内容:
子步骤S31,当所述消息内容包括处理对象时,调用所述目标应用标识对应的应用处理所述处理对象;
在本申请实施例中,若消息内容中包括处理对象,则可以直接调用相应的应用处理该处理对象。
例如,该处理对象为短信(文本),第二终端可以调用文本编辑器(应用)显示该短息。
或者,
子步骤S32,当所述消息内容包括处理对象标识时,向指定的内容服务器请求所述处理对象标识对应的处理对象;
子步骤S33,调用所述目标应用标识对应的应用处理所述处理对象;
在本申请实施例中,若消息内容中包括处理对象标识,则可以向内容服务器请求相应的处理对象后,调用相应的应用处理该处理对象。
需要说明的是,该处理对象可以预先存储在内容服务器中,该内容服务器不一定为服务平台中的服务器。
该处理对象可以是当前用户上传的,也可以是其他用户上传,还可以是内容服务器本身存储的,本申请实施例对此不加以限制。
例如,该处理对象为图像,由当前用户上传至内容服务器,第二终端可以向内容服务器请求该图像之后,调用图像显示器(应用)显示该图像。
或者,
子步骤S34,当所述消息内容包括处理对象标识和处理状态时,向预置的内容服务器请求所述处理对象标识对应的、处于所述处理状态的处理对象;
子步骤S35,调用所述目标应用标识对应的应用处理处于所述处理状态的处理对象。
在本申请实施例中,若消息内容中包括处理对象标识即处理状态,则可以向内容服务器请求处于该处理状态的处理对象后,调用相应的应用处理该处理对象。
例如,该处理对象为视频,内容服务器本身存储有该视频,第一终端的应用播放该视频至时间X(处理状态),则第二终端可以向内容服务器请求处于时间X的视频之后,调用视频播放器(应用)播放处于时间X的视频。
需要说明的是,若该处理对象为电视剧等视频,则第二终端可以根据当前视频的处理对象标识自动向内容服务器请求下一集的视频进行播放。
当然,上述处理方式只是作为示例,在实施本申请实施例时,可以根据实际情况设置其他处理方式,例如,第二终端与第一终端直接建立连接请求相应的处理对象,再调用相应的应用进行处理,等等,本申请实施例对此不加以限制。另外,除了上述处理方式外,本领域技术人员还可以根据实际需要采用其它处理方式,本申请实施例对此也不加以限制。
在本申请实施例中,采用SDK封装统一的接口,可以让同一终端上所有需要接收、推送消息的应用共享推送平台的服务,SDK对应用实现了注册、建立长连接、发消息、反注册等接口,应用集成了SDK,则可以使用这些功能,具体实现都是由SDK完成,应用本身不需要关心具体实现,这样能让所有的实现由SDK与服务平台之间来定义协议完成,对于终端上的应用是透明的。
传统的途径是,每个应用要使用这些服务,就需要自己实现一套这些功能,SDK便于降低应用使用推送平台的服务的开发成本,保证所有应用使用统一的接口,保证一套长连接通道,所有应用的通信都可以使用这个通道,大大提高了服务效率。
为使本领域技术人员更好地理解本申请实施例,以下通过几种应用场景的示例对本申请实施例作进一步说明:
应用场景一:
用户在手机(第一终端)的视频应用上观看视频,在回到家后,可能去做打扫、煮饭等家务,但是用户想一边做家务,一边观看该视频。
此时,用户可以通过点击视频应用上指定的控件等方式,触发终端查询请求。
服务平台检测到该终端查询请求,则可以查找该用户绑定的,家里的电视、平板电脑、个人电脑、其他手机等终端及其绑定的应用。
用户可以从该终端及应用中选取电视(目标终端标识)及其视频播放器(目标应用标识)。
手机可以按照用户的选择生成应用调用请求,进而向服务平台发送应用调用请求,该应用调用请求中包括视频名称及其集数(处理对象标识)、播放时间(处理状态)。
服务平台可以通过消息路由服务将该应用调用请求转发至该电视(第二终端)。
电视向视频网站(内容服务器)请求处于该播放时间的、该视频名称及其集数对应视频,调用视频播放器进行播放。
由于电视的响应范围比手机广,用户可以在一边做家务的同时,一边继续观看该视频,大大提高了视频播放的灵活性,提高了用户体验,并减少了在做家务时用手机观看视频所潜在的对手机造成的损伤。
应用场景二:
用户在手机(第一终端)的视频应用上观看视频时,调用电视(第二终端)的视频播放器继续播放该视频。
若此时手机接收到了短信,则手机可以自动触发终端查询请求。
服务平台检测到该终端查询请求,则可以查找该用户绑定的,家里的电视、平板电脑、个人电脑、其他手机等终端及其绑定的应用。
手机可以从该终端及应用中选取电视(目标终端标识)及其文本编辑器 (目标应用标识),并生成应用调用请求,进而向服务平台发送应用调用请求,该应用调用请求中包括短信(处理对象)。
服务平台可以通过消息路由服务将该应用调用请求转发至该电视(第二终端)。
电视依据该调用文本编辑器显示该短信,进一步提高了手机与电视之间的同步操作。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图3,示出了本申请的一种终端之间的通信装置实施例的结构框图,具体可以包括如下模块:
查询模块301,配置为在接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
应用调用请求接收模块302,配置为接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
应用调用请求发送模块303,配置为将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
在本申请的一种优选实施例中,该装置还可以包括如下模块:
注册请求接收模块,配置为接收注册请求;
终端注册模块,配置为在所述注册请求包括用户标识与终端标识时,建立所述用户标识与所述终端标识的关联关系;
应用注册模块,配置为在所述注册请求包括终端标识与应用标识时,建立所述终端标识与所述应用标识的关联关系。
在本申请的一种优选实施例中,该装置还可以包括如下模块:
第一长连接建立模块,配置为与第一终端之间建立第一长连接;
第二长连接建立模块,配置为与第二终端之间建立第二长连接;
其中,所述第一长连接用于与所述第一终端进行通信,包括接收终端查询请求、应用调用请求、返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
所述第二长连接用于与所述第二终端进行通信,包括发送应用调用请求。
在本申请的一种优选实施例中,所述查询模块301可以包括如下模块:
提取模块,配置为从所述终端查询请求中提取用户标识;
查找模块,配置为查找所述用户标识关联的一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
返回模块,配置为将所述一个或多个终端标识、及各个终端标识关联的一个或多个应用标识返回所述第一终端。
在本申请的一种优选实施例中,所述应用调用请求发送模块303可以包括如下模块:
长连接查询模块,配置为在第一服务器中查询本地是否具有与所述目标终端标识对应的第二终端进行通信的第二长连接;若是,则调用第一发送模块;若否,则调用写队列模块;
第一发送模块,配置为通过所述第二长连接将所述应用调用请求发送至所述第二终端;
写队列模块,配置为将所述应用调用请求写入预设的消息队列;
路由模块,配置为在第二服务器中将所述消息队列中的所述应用调用请求转发至具有所述第二长连接的第三服务器;
第二发送模块,配置为在第三服务器中通过所述第二长连接将所述应用调用请求发送至所述第二终端。
在本申请的一种优选实施例中,所述消息内容可以基于所述第一终端中的应用的处理对象生成;
所述第二终端可以通过调用如下模块处理消息内容:
第一处理模块,配置为在所述消息内容包括处理对象时,调用所述目标应用标识对应的应用处理所述处理对象;
或者,
第一请求模块,配置为在所述消息内容包括处理对象标识时,向指定的内容服务器请求所述处理对象标识对应的处理对象;
第二处理模块,配置为调用所述目标应用标识对应的应用处理所述处理对象;
或者,
第二请求模块,配置为在所述消息内容包括处理对象标识和处理状态时,向预置的内容服务器请求所述处理对象标识对应的、处于所述处理状态的处理对象;
第三处理模块,配置为调用所述目标应用标识对应的应用处理处于所述处理状态的处理对象。
在本申请实施例的一种优选示例中,所述处理对象可以包括以下的一种或多种:
视频、音频、图像、文本、文档;
其中,当所述处理对象为视频时,所述处理状态可以包括播放时间信息。
在本申请的一种优选实施例中,所述第一终端中可以具有统一的接口,所述第一终端通过所述统一的接口进行注册、建立第一长连接;
所述第二终端中具有统一的接口,所述第二终端可以通过所述统一的接口进行注册、建立第二长连接、调用所述目标应用标识对应的应用处理所述消息内容。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请还提供了一种在其上记录有用于执行上述方法的程序的计算机可读记录介质。
所述计算机可读记录介质包括用于以计算机(例如计算机)可读的形式 存储或传送信息的任何机制。例如,机器可读介质包括只读存储器(ROM)、随机存取存储器(RAM)、磁盘存储介质、光存储介质、闪速存储介质、电、光、声或其他形式的传播信号(例如,载波、红外信号、数字信号等)等。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (17)

  1. 一种终端之间的通信方法,其特征在于,包括:
    当接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
    接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
    将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
  2. 根据权利要求1所述的方法,其特征在于,在所述依据所述终端查询请求查找一个或多个终端标识、及各个终端标识关联的一个或多个应用标识的步骤之前,所述方法还包括:
    接收注册请求;
    当所述注册请求包括用户标识与终端标识时,建立所述用户标识与所述终端标识的关联关系;
    当所述注册请求包括终端标识与应用标识时,建立所述终端标识与所述应用标识的关联关系。
  3. 根据权利要求1所述的方法,其特征在于,在所述依据所述终端查询请求查找一个或多个终端标识、及各个终端标识关联的一个或多个应用标识的步骤之前,所述方法还包括:
    与第一终端之间建立第一长连接;
    与第二终端之间建立第二长连接;
    其中,所述第一长连接用于与所述第一终端进行通信,包括接收终端查询请求、应用调用请求、返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
    所述第二长连接用于与所述第二终端进行通信,包括发送应用调用请求。
  4. 根据权利要求1或2或3所述的方法,其特征在于,所述依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识的步骤包括:
    从所述终端查询请求中提取用户标识;
    查找所述用户标识关联的一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
    将所述一个或多个终端标识、及各个终端标识关联的一个或多个应用标识返回所述第一终端。
  5. 根据权利要求1或2或3所述的方法,其特征在于,所述将所述应用调用请求发送至所述目标终端标识对应的第二终端的步骤包括:
    在第一服务器中查询本地是否具有与所述目标终端标识对应的第二终端进行通信的第二长连接;
    若本地具有与所述目标终端标识对应的第二终端进行通信的第二长连接,则通过所述第二长连接将所述应用调用请求发送至所述第二终端;
    若本地没有与所述目标终端标识对应的第二终端进行通信的第二长连接,则将所述应用调用请求写入预设的消息队列;
    在第二服务器中将所述消息队列中的所述应用调用请求转发至具有所述第二长连接的第三服务器;
    在第三服务器中通过所述第二长连接将所述应用调用请求发送至所述第二终端。
  6. 根据权利要求1或2或3所述的方法,其特征在于,所述消息内容基于所述第一终端中的应用的处理对象生成;
    所述第二终端通过以下方式处理消息内容:
    当所述消息内容包括处理对象时,调用所述目标应用标识对应的应用处理所述处理对象;
    或者,
    当所述消息内容包括处理对象标识时,向指定的内容服务器请求所述处理对象标识对应的处理对象;
    调用所述目标应用标识对应的应用处理所述处理对象;
    或者,
    当所述消息内容包括处理对象标识和处理状态时,向预置的内容服务器请求所述处理对象标识对应的、处于所述处理状态的处理对象;
    调用所述目标应用标识对应的应用处理处于所述处理状态的处理对象。
  7. 根据权利要求6所述的方法,其特征在于,所述处理对象包括以下的一种或多种:
    视频、音频、图像、文本、文档;
    其中,当所述处理对象为视频时,所述处理状态包括播放时间信息。
  8. 根据权利要求1或2或3或7所述的方法,其特征在于,所述第一终端中具有统一的接口,所述第一终端通过所述统一的接口进行注册、建立第一长连接;
    所述第二终端中具有统一的接口,所述第二终端通过所述统一的接口进行注册、建立第二长连接、调用所述目标应用标识对应的应用处理所述消息内容。
  9. 一种终端之间的通信装置,其特征在于,包括:
    查询模块,配置为在接收到第一终端发送的终端查询请求时,依据所述终端查询请求向所述第一终端返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
    应用调用请求接收模块,配置为接收第一终端发送的应用调用请求;所述应用调用请求包括从所述一个或多个终端标识中选取的目标终端标识、从所述目标终端标识关联的一个或多个应用标识中选取的目标应用标识、及消息内容;
    应用调用请求发送模块,配置为将所述应用调用请求发送至所述目标终端标识对应的第二终端,以驱动所述第二终端调用所述目标应用标识对应的应用处理所述消息内容。
  10. 根据权利要求9所述的装置,其特征在于,还包括:
    注册请求接收模块,配置为接收注册请求;
    终端注册模块,配置为在所述注册请求包括用户标识与终端标识时,建立所述用户标识与所述终端标识的关联关系;
    应用注册模块,配置为在所述注册请求包括终端标识与应用标识时,建立所述终端标识与所述应用标识的关联关系。
  11. 根据权利要求9所述的装置,其特征在于,还包括:
    第一长连接建立模块,配置为与第一终端之间建立第一长连接;
    第二长连接建立模块,配置为与第二终端之间建立第二长连接;
    其中,所述第一长连接用于与所述第一终端进行通信,包括接收终端查询请求、应用调用请求、返回一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
    所述第二长连接用于与所述第二终端进行通信,包括发送应用调用请求。
  12. 根据权利要求9或10或11所述的装置,其特征在于,所述查询模块包括:
    提取模块,配置为从所述终端查询请求中提取用户标识;
    查找模块,配置为查找所述用户标识关联的一个或多个终端标识、及各个终端标识关联的一个或多个应用标识;
    返回模块,配置为将所述一个或多个终端标识、及各个终端标识关联的一个或多个应用标识返回所述第一终端。
  13. 根据权利要求9或10或11所述的装置,其特征在于,所述应用调用请求发送模块包括:
    长连接查询模块,配置为在第一服务器中查询本地是否具有与所述目标终端标识对应的第二终端进行通信的第二长连接;若是,则调用第一发送模块;若否,则调用写队列模块;
    第一发送模块,配置为通过所述第二长连接将所述应用调用请求发送至所述第二终端;
    写队列模块,配置为将所述应用调用请求写入预设的消息队列;
    路由模块,配置为在第二服务器中将所述消息队列中的所述应用调用请求转发至具有所述第二长连接的第三服务器;
    第二发送模块,配置为在第三服务器中通过所述第二长连接将所述应用调用请求发送至所述第二终端。
  14. 根据权利要求9或10或11所述的装置,其特征在于,所述消息内容基于所述第一终端中的应用的处理对象生成;
    所述第二终端通过调用如下模块处理消息内容:
    第一处理模块,配置为在所述消息内容包括处理对象时,调用所述目标应用标识对应的应用处理所述处理对象;
    或者,
    第一请求模块,配置为在所述消息内容包括处理对象标识时,向指定的内容服务器请求所述处理对象标识对应的处理对象;
    第二处理模块,配置为调用所述目标应用标识对应的应用处理所述处理对象;
    或者,
    第二请求模块,配置为在所述消息内容包括处理对象标识和处理状态时,向预置的内容服务器请求所述处理对象标识对应的、处于所述处理状态的处理对象;
    第三处理模块,配置为调用所述目标应用标识对应的应用处理处于所述处理状态的处理对象。
  15. 根据权利要求14所述的装置,其特征在于,所述处理对象包括以下的一种或多种:
    视频、音频、图像、文本、文档;
    其中,当所述处理对象为视频时,所述处理状态包括播放时间信息。
  16. 根据权利要求9或10或11或15所述的装置,其特征在于,所述第一终端中具有统一的接口,所述第一终端通过所述统一的接口进行注册、建立第一长连接;
    所述第二终端中具有统一的接口,所述第二终端通过所述统一的接口进行注册、建立第二长连接、调用所述目标应用标识对应的应用处理所述消息内容。
  17. 一种记录有用于执行权利要求1所述方法的程序的计算机可读记录介质。
PCT/CN2016/078803 2015-04-13 2016-04-08 一种终端之间的通信方法和装置 Ceased WO2016165584A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510174136.9A CN105743958A (zh) 2015-04-13 2015-04-13 一种终端之间的通信方法和装置
CN201510174136.9 2015-04-13

Publications (1)

Publication Number Publication Date
WO2016165584A1 true WO2016165584A1 (zh) 2016-10-20

Family

ID=56295899

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/078803 Ceased WO2016165584A1 (zh) 2015-04-13 2016-04-08 一种终端之间的通信方法和装置

Country Status (2)

Country Link
CN (1) CN105743958A (zh)
WO (1) WO2016165584A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111786963A (zh) * 2020-06-12 2020-10-16 青岛海尔科技有限公司 通信过程的实现方法和装置、存储介质及电子装置
CN116647468A (zh) * 2023-03-24 2023-08-25 中国工商银行股份有限公司 注册中心配置方法、装置、计算机设备和存储介质

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA3031531A1 (en) 2016-09-15 2018-03-22 Nuts Holdings, Llc Encrypted userdata transit and storage
CN107395686B (zh) * 2017-06-28 2018-06-05 甘棠软件系统(上海)有限公司 切换长连接的方法、设备和系统
CN107172211A (zh) * 2017-07-07 2017-09-15 北京奇艺世纪科技有限公司 通信连接请求建立方法及服务器
CN108391242B (zh) * 2018-02-26 2021-10-19 青岛海信移动通信技术股份有限公司 一种远程控制方法和远程控制装置
CN108933838B (zh) * 2018-08-08 2022-07-29 网易(杭州)网络有限公司 应用数据处理方法及装置
CN109672738A (zh) * 2018-12-24 2019-04-23 成都四方伟业软件股份有限公司 一种基于多屏互动跨终端服务的方法与系统
WO2021206934A1 (en) 2020-04-09 2021-10-14 Nuts Holdings, Llc Nuts: flexible hierarchy object graphs
CN111740887B (zh) * 2020-06-22 2022-09-23 广州三星通信技术研究有限公司 分发电子终端的未完任务的方法及设备
CN114296948B (zh) * 2020-09-21 2025-09-30 荣耀终端股份有限公司 一种跨设备调用应用的方法及电子设备
CN113590248B (zh) * 2021-07-22 2024-07-23 上汽通用五菱汽车股份有限公司 车载终端的投屏方法、装置和可读存储介质
CN114428691A (zh) * 2022-01-20 2022-05-03 惠州Tcl移动通信有限公司 应用调用方法、装置、电子设备和计算机可读存储介质
CN114501449B (zh) * 2022-01-28 2024-02-09 Oppo广东移动通信有限公司 信息查询的方法、装置、电子设备及存储介质
CN114610356A (zh) * 2022-03-25 2022-06-10 广联达科技股份有限公司 对桌面端应用的升级管理方法、系统、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050034159A1 (en) * 2002-12-20 2005-02-10 Texas Instruments Incorporated Implementing a hybrid wireless and coaxial cable network
CN101594594A (zh) * 2009-06-30 2009-12-02 中兴通讯股份有限公司 一种实现对等设备间切换流媒体的局域网络系统及其实现方法
CN101668182A (zh) * 2009-10-20 2010-03-10 中国电信股份有限公司 在多类型终端间实现视频节目的位移方法及系统
CN104468494A (zh) * 2013-09-25 2015-03-25 华为终端有限公司 一种切换媒体播放设备的方法及设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101437050A (zh) * 2008-11-27 2009-05-20 四川长虹电器股份有限公司 播放机远程控制系统及播放机远程控制方法
CN101729553B (zh) * 2009-11-19 2013-03-27 中兴通讯股份有限公司 实现终端远程控制的方法及终端服务器、控制和受控终端
CN104424244B (zh) * 2013-08-27 2019-09-27 卓易畅想(北京)科技有限公司 一种获取搜索结果的方法、装置与设备
CN103491179B (zh) * 2013-09-27 2017-01-18 百视通网络电视技术发展有限责任公司 基于Web的多屏互动方法及系统
CN103617285A (zh) * 2013-12-11 2014-03-05 百度在线网络技术(北京)有限公司 在移动终端中展现搜索结果的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050034159A1 (en) * 2002-12-20 2005-02-10 Texas Instruments Incorporated Implementing a hybrid wireless and coaxial cable network
CN101594594A (zh) * 2009-06-30 2009-12-02 中兴通讯股份有限公司 一种实现对等设备间切换流媒体的局域网络系统及其实现方法
CN101668182A (zh) * 2009-10-20 2010-03-10 中国电信股份有限公司 在多类型终端间实现视频节目的位移方法及系统
CN104468494A (zh) * 2013-09-25 2015-03-25 华为终端有限公司 一种切换媒体播放设备的方法及设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111786963A (zh) * 2020-06-12 2020-10-16 青岛海尔科技有限公司 通信过程的实现方法和装置、存储介质及电子装置
CN116647468A (zh) * 2023-03-24 2023-08-25 中国工商银行股份有限公司 注册中心配置方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN105743958A (zh) 2016-07-06

Similar Documents

Publication Publication Date Title
WO2016165584A1 (zh) 一种终端之间的通信方法和装置
CN103581699B (zh) 视频播放方法、流媒体服务器及流媒体播放系统
EP2640099B1 (en) Method, system and apparatus for providing stream media service
CN101335586B (zh) 在多媒体播放设备上播放手机电视业务的方法及手机终端
EP2974159B1 (en) Method, device and system for voice communication
US9065666B2 (en) System and method of multi-media conferencing between universal plug and play (UPnP) enabled telephony devices and wireless area network (WAN) devices
CN110536028A (zh) 视频彩铃的实现方法、彩铃平台和终端
WO2019090902A1 (zh) 屏幕共享的方法、装置、电子设备及存储介质
CN109586929B (zh) 会议内容的传输方法及装置、电子设备、存储介质
CN102958107A (zh) 一种能力查询的方法、通信终端及应用服务器
US10412123B2 (en) Session initiation for multimedia services
CN103888488A (zh) 一种基于wifi进行数据共享的方法
WO2018090978A1 (zh) 自适应播放、控制方法、机顶盒及电子节目服务器
EP3526972A1 (en) Enabling a media orchestration
US8908853B2 (en) Method and device for displaying information
CN103648056A (zh) 一种智能电视的点对点传输方法和装置
CN105227469A (zh) 一种设备能力发现方法、装置及终端
CN109413120B (zh) 一种通信方法及装置、电子设备及服务器
WO2016197955A1 (zh) 多媒体流组播方法和装置
CN105657527A (zh) 多媒体文件推送的方法、移动终端及系统
EP3160101B1 (en) Multi-media resource management method, cloud server and electronic device
WO2015077983A1 (zh) 在家庭网络中播放媒体的装置和方法
CN103841142B (zh) 一种会话迁移的方法、装置及系统
CN106028469B (zh) 一种通信连接建立方法、装置及移动终端
EP3461135A1 (fr) Procédé de gestion du droit d'accès à un contenu numérique

Legal Events

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

Ref document number: 16779559

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16779559

Country of ref document: EP

Kind code of ref document: A1