WO2017161769A1 - 一种弹幕的传输方法及装置 - Google Patents

一种弹幕的传输方法及装置 Download PDF

Info

Publication number
WO2017161769A1
WO2017161769A1 PCT/CN2016/089265 CN2016089265W WO2017161769A1 WO 2017161769 A1 WO2017161769 A1 WO 2017161769A1 CN 2016089265 W CN2016089265 W CN 2016089265W WO 2017161769 A1 WO2017161769 A1 WO 2017161769A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection
local area
data
area network
barrage
Prior art date
Application number
PCT/CN2016/089265
Other languages
English (en)
French (fr)
Inventor
张仕奇
Original Assignee
乐视控股(北京)有限公司
乐视网信息技术(北京)股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视网信息技术(北京)股份有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2017161769A1 publication Critical patent/WO2017161769A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4126The peripheral being portable, e.g. PDAs or mobile phones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43637Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/475End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data
    • H04N21/4756End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data for rating content, e.g. scoring a recommended movie
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a method and an apparatus for transmitting a barrage.
  • a user can post a video to a video program being watched while watching a video program.
  • Barrage is a comment that appears directly on the video. It can be scrolled, paused, or even more action-specific effects appear on the video. Users can watch the video while simultaneously posting comments. Users can also watch other videos' comments while watching the video, creating an instant interactive experience.
  • the mobile phone can be used to post a video comment on the video program in the smart TV.
  • the specific steps can be as follows: First, the mobile phone scans the QR code of the current video program in the smart TV to make the mobile phone and the smart TV play the same simultaneously.
  • the video program can upload the barrage comment to the server by posting a bullet comment on the video program played in the mobile phone; then, the smart TV obtains the corresponding barrage comment from the server and displays it in the current video program.
  • the smart TV needs to generate a new two-dimensional code for the replaced video program.
  • the mobile phone needs to scan the new two-dimensional code to release the barrage of the replaced video program. comment.
  • the embodiment of the invention provides a method and a device for transmitting a barrage, which are used to solve the problem that the two-dimensional code in the video program needs to be frequently scanned in order to release the barrage comment for different video programs, which leads to the efficiency of publishing the barrage comment. Lower question.
  • An embodiment of the present invention provides a method for transmitting a barrage, which is applied to a first device, and includes:
  • the network data packet is sent to the second device by establishing a first connection with the second device.
  • a method for transmitting a barrage for use in a second device, including:
  • the network data packet is parsed to obtain encapsulated barrage data; wherein the preset protocol includes: a protocol identifier, a data type, and a data content.
  • a transport device for a barrage for use in a first device, comprising:
  • a data encapsulating module configured to encapsulate the barrographic data into a network data packet conforming to a preset protocol, where the preset protocol includes: a protocol identifier, a data type, and a data content;
  • a data sending module configured to send the network data packet to the second device by using a first connection established with the second device.
  • a transmission device for a barrage for use in a second device, including:
  • a data receiving module configured to receive a network data packet from the first device by using the first connection established with the first device
  • a data parsing module configured to parse the network data packet according to a preset protocol, to obtain encapsulated barrage data; wherein the preset protocol includes: a protocol identifier, a data type, and a number According to the content.
  • An embodiment of the present invention provides a computer program comprising computer readable code, when the computer readable code is run on an electronic device, causing the electronic device to perform the above-described method of transmitting a barrage.
  • Embodiments of the present invention provide a computer readable medium in which the above computer program is stored.
  • the embodiment of the invention provides a method and a device for transmitting a barrage.
  • the first device can encapsulate the barrage data into a network data packet conforming to a preset protocol, and after establishing a first connection with the second device, the first device can pass the first The connecting the network data packet to the second device, so that after receiving the network data packet, the second device may parse the network data packet according to the preset protocol, and obtain and display the barrage data.
  • the embodiment of the present invention can scan the two-dimensional code in the smart television, thereby simplifying the user operation and improving the efficiency of publishing the bullet review. .
  • the first device can transmit the barrage data through the first connection according to the preset protocol, and the first device does not need to play the same video synchronously with the second device. program. That is, the first device and the second device play different video programs, or in the case that the first device does not play the video program, the first device can send the barrage data to the second device, thereby further improving the release.
  • the flexibility of the barrage comment is not limited to
  • FIG. 1 is a flow chart showing the steps of a first embodiment of a method for transmitting a barrage of the present invention
  • FIG. 2 is a flow chart showing the steps of a second embodiment of a method for transmitting a barrage of the present invention
  • FIG. 3 is a flow chart showing the steps of a third embodiment of a method for transmitting a barrage of the present invention.
  • FIG. 4 is a flow chart showing the steps of a fourth embodiment of a method for transmitting a barrage of the present invention.
  • Figure 5 is a structural view showing a first embodiment of a transport device for a barrage of the present invention.
  • FIG. 6 is a structural block diagram of a second embodiment of a transmission device for a barrage of the present invention.
  • Figure 7 shows schematically a block diagram of an electronic device for performing the method according to the invention.
  • Fig. 8 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • One of the core concepts of the embodiment of the present invention is that, by establishing a first connection between the first device and the second device, the first device can send the barrage data to the second device through the first connection, specifically, the first The device sends the barrage data to the second device through the first connection according to the preset protocol.
  • the two-dimensional code in the smart TV is frequently scanned.
  • the embodiment of the present invention can simplify the user operation without scanning the two-dimensional code, thereby improving the efficiency of publishing the bullet review.
  • the first device and the second device play different video programs, or in the case that the first device does not play the video program, the first device may send the barrage data to the second device, further Increased flexibility in publishing barrage reviews.
  • FIG. 1 a flow chart of a first embodiment of a method for transmitting a barrage of the present invention is shown.
  • Step 101 Encapsulating the barrographic data into a network data packet conforming to a preset protocol, where Preset protocols include: protocol identification, data type, and data content;
  • Step 102 Send the network data packet to the second device by using a first connection established with the second device.
  • the embodiment of the present invention may be used for the scenario where the first device sends the barrage data to the second device, where the first device and the second device may be specifically smart terminals, and the smart terminals include but are not limited to: smart television, cellular phone, and smart Mobile phones, laptops, PCs (personal computers), tablets, e-book terminals, digital broadcast terminals, PDAs (Personal Digital Assistants), portable multimedia players or navigation systems, etc., understand, The embodiment of the present invention does not limit a specific intelligent terminal.
  • the first device is used as a device for transmitting the barrage data (such as a smart phone), and the second device is used as a device for receiving the barrage data (such as a smart TV) as an example for description, and other application scenarios.
  • Cross-reference can be.
  • the barrage data may be encapsulated according to a preset protocol to obtain a network data packet that can be transmitted in the network, thereby, after the first device establishes the first connection with the second device, The device may send the network data packet to the second device by using the first connection, so that after receiving the network data packet, the second device may parse the network data packet according to the preset protocol. , get and display the barrage data.
  • the barrage data may be encapsulated into a network data packet conforming to a preset protocol by the following steps:
  • Step S11 setting the data type to a barrage data type, and the data content is a barrage data content
  • Step S12 Encapsulating the protocol identifier, the barrage data type, and the barrage data content in a network data packet.
  • the preset protocol that the first device and the second device can be commonly followed may be preset. Specifically, different preset protocols may be distinguished by using the protocol identifier, and the data type corresponding to the preset protocol is set. To identify whether the current packaged data is barrage data.
  • the data format encapsulated according to the preset protocol may be:
  • the msgType is used to store the protocol identifier of the preset protocol; the ⁇ field after the msg field is the encapsulated data content; the type field is used to store the data type, and when the data type is the barrage data type, it indicates the msg: ⁇
  • the package has the barrage data.
  • the data type is video data type, it means that the video data is encapsulated in msg: ⁇ .
  • the content field is used to store the specific barrage data
  • the display information corresponding to the barrage data is encapsulated in the network data packet, and other related information such as user information corresponding to the user who sends the barrage data; for example, the postion field may be used to indicate the display position of the barrage data on the screen. For example, top is the top of the screen, bottom is the lower part of the screen, scroll is scrolling, etc.
  • the color field can be used to indicate the display color of the barrage data
  • the size field can be used to indicate the display size of the barrage data
  • isVip can be used to indicate whether the current user is a member.
  • the userid can be used to identify the user ID
  • the usertoken can be used to represent the user's token.
  • the type of the first connection may be any, for example, the first connection may be a TCP (Transmission Control Protocol) based network connection, or a UDP (User Datagram Protocol). Reporting protocol) network connection, etc.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • Reporting protocol Reporting protocol
  • the embodiment of the present invention does not limit the specific type of the first connection. It can be understood that, in the embodiment of the present invention, the first connection can be established between the first device and the second device by using a wired or wireless manner, and the specific connection manner for establishing the first connection is not limited by the present invention.
  • the first device may encapsulate the barrage data into a network data packet conforming to the preset protocol, and after establishing the first connection with the second device, the first device may be connected to the second device through the first connection. And sending the network data packet, so that after receiving the network data packet, the second device may parse the network data packet according to the preset protocol, and obtain and display the barrage data.
  • the embodiment of the present invention can scan the two-dimensional code in the smart television, thereby simplifying the user operation and improving the efficiency of publishing the bullet review. .
  • the first device can transmit the barrage data through the first connection according to the preset protocol, and the first device does not need to play the same video synchronously with the second device. program. That is, the first device and the second device play different video programs, or in the case that the first device does not play the video program, the first device can send the barrage data to the second device, thereby further improving the release.
  • the flexibility of the barrage comment is not limited to
  • the preset protocol may specifically include: a protocol identifier, a data type, and a data content, and the barrage data is encapsulated into a network data packet by using the preset protocol, so that the first device and the second device can be unified according to the unified
  • the private protocol transmits the barrage data, wherein the private protocol has the advantages of being closed and high in security, thereby improving the security of the data transmission of the barrage.
  • the barrage edited by the mobile phone is first sent to the server, and then the smart screen is obtained from the server and displayed, and the process is easily affected by the network state between the mobile phone or the smart TV and the server. Impact, in the case of poor network conditions, can cause the barrage display delay or display failure.
  • the first connection between the first device and the second device is established, so that the first device can send the barrage data to the second device through the first connection, and may not perform the transit through the server, thereby improving The transmission speed of the barrage data, thereby improving the timeliness of the display of the barrage.
  • the first device and the second device may be in the same local area network.
  • FIG. 2 a flow chart of the steps of the second embodiment of the method for transmitting the barrage of the present invention is shown.
  • Step 201 Encapsulating the barrage data into a network data packet conforming to a preset protocol, where the preset protocol includes: a protocol identifier, a data type, and a data content;
  • Step 202 Search for the second device by using the registered first local area network discovery service.
  • Step 203 Establish a first connection with the second device according to the first local area network discovery service.
  • Step 204 Send, by using the first connection, the network data packet to the second device.
  • the first device and the second device may be in the same local area network, and the first device may establish a first connection with the second device by using a registered NSD (Network Service Discovery).
  • NSD Network Service Discovery
  • the transmission speed of the network data packet can be made faster and the security is higher.
  • the local area network discovery service registered by the first device is referred to as a first local area network discovery service
  • the local area network discovery service registered by the second device is referred to as a second local area network discovery service, only to distinguish the first device from the second device.
  • the LAN discovery service established by the device should not be used as a limitation on the LAN discovery service.
  • the embodiment of the present invention does not limit the execution timing of the registered local area network discovery service, for example, may be registered when the first device or the second device is started, or may be used when the user is received for the first device or the second device. You can register when you start the application of the barrage application.
  • the Android (Android) 4.1 operating system includes a new API (Application Programming Interface), which can be used to register NSD services on the LAN, broadcast registered NSD services, discover devices, and connect devices. .
  • the API in the smart phone can search according to the NSD service of the smart television broadcast. Go to the smart TV device to establish a TCP connection with the smart TV.
  • the operating system used by the first device and the second device is not limited in the embodiment of the present invention, for example, Use iOS (Apple's mobile operating system), Windows (Microsoft's operating system), and so on.
  • the first local area network discovery service may be registered by the following steps:
  • the first connection information may specifically include a network identifier and/or a device identifier.
  • the network identifier may be specifically used to identify a network address of the first device.
  • the network identifier may include an IP (Internet Protocol) protocol and/or a port number, and the like.
  • the device identifier may be used to uniquely identify the device, for example, the device identifier may include a device name and/or a MAC (Media Access Control) address of the first device. It is to be understood that the specific content of the network identifier and/or device identifier is not limited in the embodiment of the present invention.
  • the first device may register its own IP address, port number, and device name of the first device in the local area network.
  • the IP address, the port number, and the device name of the second device of the second device may also be registered in the local area network, so that the first device can search for the second device in the local area network.
  • an NsdServiceInfo object when registering an NSD service in a local area network, firstly, an NsdServiceInfo object needs to be created, and the object can be used to provide connection information of the registered NSD service to other devices in the network.
  • an NsdServiceInfo object For a specific application, when registering an NSD service in a local area network, firstly, an NsdServiceInfo object needs to be created, and the object can be used to provide connection information of the registered NSD service to other devices in the network.
  • NsdServiceInfo serviceInfo new NsdServiceInfo()
  • the first parameter “NsdBarraget” may be a service identifier of the NSD service, and the service identifier may be a service name, which may be used to find and use the NSD service in the network.
  • the device therefore, the name is unique on the network.
  • the embodiment of the present invention may further include the following steps:
  • the service identifiers are modified so that the service identifiers in the same local area network are different.
  • NsdBarraget For example, if two devices in the same LAN are registered with a service named NsdBarraget, you can change the name of one of the services automatically, for example, you can change to "NsdBarraget(1)".
  • the second parameter "_http._tcp.” can be used to set the type of NSD service to determine which port and transport layer the application uses. "_http._tcp.” means to use the HTTP protocol on TCP.
  • the step of establishing a first connection with the second device according to the first local area network discovery service may specifically include:
  • Step S21 Obtain second connection information of the second device by using the first local area network discovery service.
  • Step S22 Establish a first connection with the second device according to the second connection information of the second device.
  • the first device when receiving an application for processing a barrage in the first device, the first device may be triggered to search for operations of other devices in the same local area network, specifically, the first device receives the same local area network.
  • the broadcast of the NSD service sent by other devices acquires the device name of the other device, and displays the obtained device name in the form of a list for the user to select. It is determined that the user selects a second device to perform a selection operation, and the user may determine that the user wants to send a barrage to the second device, and may acquire the second connection information of the second device according to the NSD service registered by the second device, where the second device
  • the connection information may specifically include a network identifier of the second device, such as an IP address and/or a port number.
  • the first device may establish a first connection with the second device according to the second connection information of the second device, and send a barrage through the first connection.
  • the NSD service registered by the application may be logged off to prevent other
  • the related application tries to connect to the NSD service to threaten the security of the first device, and Logging out of the NSD service when it is not used can save the resource occupation of the NSD service.
  • the first device may search for the corresponding second device according to the first local area network discovery service, and establish a first connection with the second device, so that The second device sends the barrage data. Since the first device and the second device are in the same local area network, the transmission speed of the barrage data can be made faster and the security is higher.
  • the first device and the second device may also be in different local area networks.
  • FIG. 3 a flow chart of the steps of the third embodiment of the method for transmitting a barrage of the present invention is shown.
  • Step 301 Encapsulating the barrage data into a network data packet conforming to a preset protocol, where the preset protocol includes: a protocol identifier, a data type, and a data content;
  • Step 302 Establish a second connection with the push engine by using the registered first push engine service.
  • Step 303 Establish a first connection with the second device by using the second connection established with the push engine.
  • Step 304 Send, by using the first connection, the network data packet to the second device.
  • the first device and the second device may also be in different local area networks, so that the barrage data can be transmitted between the first device and the second device in different network environments to improve the barrage.
  • the flexibility of data transmission may be Specifically, the first device and the second device may respectively establish a push engine service in the push engine.
  • the embodiment of the present invention refers to the push engine service corresponding to the first device as the first push engine service.
  • the push engine service corresponding to the second device is called the second push engine service.
  • the first device establishes a second connection with the push engine by using the first push engine service
  • the second device establishes a third connection with the push engine by using the second push engine service, where the first device and the second device can pass the second connection and the second
  • the third connection establishes the first connection.
  • the push engine can be used to forward messages or data between the first device and the second device.
  • the push engine can be any type of server.
  • the embodiment of the present invention does not limit the execution timing of the registration push engine service, for example, may be registered when the first device or the second device is started, or when the user is received for the first device or the second device. You can register when you start the operation of the application that handles the barrage.
  • the first push engine service may be registered by the following steps:
  • the international mobile device identifier may be an IMEI (International Mobile Equipment Identity), and the physical address may be a MAC address.
  • IMEI International Mobile Equipment Identity
  • the IMEI identifier of the first device and the MAC address may be spliced together, and optionally, the spliced data may be encrypted, such as base64 encryption; and then, the encrypted The data is sent to the push engine for registration.
  • receiving the first registration identifier of the push engine according to the encrypted data distribution indicates that the first push engine service is successfully registered.
  • the step of sending a network data packet to the second device by using the first connection may specifically include:
  • Step S31 Obtain a second registration identifier corresponding to the second device by using the second connection established with the push engine.
  • Step S32 Send the network data packet to the push engine by using the second connection, where the source address of the network data packet corresponds to the first registration identifier, and the destination address corresponds to the second registration identifier.
  • the smart phone and the smart TV are in different local area networks, for example, the smart TV is at home, and the smart phone is outdoors, and the user can use the smart phone to send the barrage data to the smart TV in the home.
  • the second connection identifier corresponding to the smart TV can be obtained through the second connection established by the smart phone and the push engine, and the second connection is The push engine sends the network data packet, where the source address of the network data packet corresponds to the first registration identifier, and the destination address corresponds to the second registration identifier. After receiving the network data packet, the push engine sends the data packet to the smart TV corresponding to the second registration identifier, so that the barrage data can be sent to the devices of different local area networks.
  • the first device can pass the logged in The user account searches for the second device, for example, when receiving the user launching the application for processing the barrage in the first device, the first device may be triggered to search for the operation of other devices that are the same as the user account that is logged in, and The device names that are searched for other devices are displayed in a list for the user to select.
  • the first device and the second device are in different local area networks, so that the barrage data is transmitted, so that the first device and the first device are in different network environments.
  • the barrage data can be transmitted between the two devices, thereby improving the flexibility of the barrage data transmission.
  • the first embodiment to the third embodiment described above describe the barrage processing method of the present invention from the perspective of the first device.
  • the implementation process of the present invention will be described in detail below from the perspective of the second device.
  • FIG. 4 a flow chart of the steps of the fourth embodiment of the method for transmitting the barrage of the present invention is shown.
  • Step 401 Receive, by using a first connection established with the first device, a network data packet from the first device.
  • Step 402 Parse the network data packet according to a preset protocol to obtain encapsulated barrage data.
  • the preset protocol includes: a protocol identifier, a data type, and data content.
  • the step of parsing the network data packet according to the preset protocol to obtain the encapsulated barrage data may specifically include:
  • the second device parses the network data packet according to a preset protocol, and when the data type is a barrage data type, if the current second device is playing a video program, the current device may be playing.
  • the video program publishes the content of the barrage data in the network packet. Therefore, as long as the second device is playing the video program, the received barrage data content can be released.
  • the smart TV can only publish the barrage comment of the same video program that is synchronously played in the mobile phone.
  • the embodiment of the present invention can improve the flexibility of publishing a bullet review.
  • the preset protocol may further include: display information corresponding to the content of the data of the barrage; the method may further include:
  • the type field is 1, indicating that the data type is the data type of the barrage, and the data content of the barrage is "this program is very exciting”
  • the display information corresponding to the data content of the barrage includes: the display position is the top of the screen, and the color is displayed. For red red, the size size is large for large fonts. Then, according to the above display information, the corresponding barrage data content "This program is very exciting" is displayed on the screen of the smart TV.
  • the first device and the second device are in the same local area network, and the first connection may be established with the first device by using the following steps:
  • the second device may register a second local area network discovery service in the local area network, and broadcast the second local area network discovery service in a local area network to enable the same local area network.
  • the first device can discover the second device.
  • the step of registering the second local area network discovery service in the local area network may include: registering the second connection information of the second device in the local area network, and acquiring the location And a second service identifier corresponding to the second connection information, so that the first device in the same local area network can obtain the second connection information of the second device in the local area network to establish the first connection by using the first local area network discovery service.
  • the second connection information may specifically include a network identifier and/or a device identifier.
  • the first device and the second device may also be in different local area networks, and the first connection may be established with the first device by using the following steps:
  • the second push engine service may be registered by the following steps:
  • the step of receiving the network data packet from the first device by using the first connection may specifically include:
  • the network packet may be sent from the first device by using the first connection, where the network data packet may carry a preset according to the preset Barrage data encapsulated by the protocol.
  • the embodiment of the present invention can not generate the two-dimensional code, thereby simplifying the operation process of receiving the barrage, thereby improving the efficiency of issuing the bullet review.
  • the transmission method of the barrage of the present invention may specifically Including the following steps:
  • Step S41 The smart phone registers the first local area network discovery service in the local area network, and the smart television registers the second local area network discovery service in the local area network;
  • Step S42 The smartphone registers the first push engine service in the push engine to obtain the first registration identifier, and establishes a second connection with the push engine; and the smart TV registers the second push engine service in the push engine to obtain the second Register the identity and establish a third connection with the push engine;
  • Step S43 when the smart phone and the smart TV are in the same local area network, step S44 is performed; when the smart phone and the smart TV are in different local area networks, step S46 is performed;
  • Step S44 The smart phone searches for the smart TV through the second local area network discovery service of the smart television broadcast, and establishes a first connection with the smart television;
  • Step S45 the smart phone sends a network data packet to the smart TV through the first connection; wherein the network data packet carries the barrage data encapsulated according to the preset protocol; and step S50 is performed;
  • Step S46 The smart phone searches for the smart TV through the same user account that has been logged in;
  • Step S47 The smart phone acquires a second registration identifier corresponding to the smart TV from the push engine by using the second connection.
  • Step S48 The smart phone sends the network data packet to the push engine through the second connection, where the network data packet carries the barrage data encapsulated according to the preset protocol; the source address of the network data packet Corresponding to the first registration identifier, the destination address corresponds to the second registration identifier;
  • Step S49 The smart TV receives the network data packet from the push engine through the third connection;
  • Step S50 The smart TV parses the network data packet to obtain the barrage data therein. If the smart TV is currently playing a video program, and the video program supports the release of the barrage, then the The barrage data is displayed in the video program.
  • the method may further include the following steps:
  • Step S51 Send the barrage data to the barrage server.
  • the barrage server can be used to store the barrage data released by the user, so that when the user watches the video again, the smart TV can obtain the barrage data from the barrage server for display, so that the user can view the previously released bullet.
  • the curtains released by the screen or other users can increase the interaction between users and improve the user experience.
  • FIG. 5 a structural block diagram of a first embodiment of a transmission of a barrage of the present invention is shown.
  • a data encapsulating module 510 configured to encapsulate the barrographic data into a network data packet conforming to a preset protocol, where the preset protocol includes: a protocol identifier, a data type, and data content;
  • the data sending module 520 is configured to send the network data packet to the second device by using a first connection established with the second device.
  • the data encapsulating module 510 may specifically include:
  • a setting submodule configured to set the data type to a barrage data type, and the data content is a barrage data content
  • the package submodule is configured to encapsulate the protocol identifier, the barrage data type, and the barrage data content in a network data packet.
  • the preset protocol may further include: display information corresponding to the content of the barrage data.
  • the device may further include: a sending connection establishing module, configured to establish a first connection with the second device; the first device and the second device are in the same local area network,
  • the sending connection establishing module may specifically include:
  • a sending connection establishing submodule configured to establish a first connection with the second device according to the first local area network discovery service.
  • the apparatus may further include: a first local area network registration module, configured to register the first local area network discovery service;
  • the first local area network registration module may specifically include:
  • a first local area network registration sub-module configured to register first connection information of the first device in the local area network, and acquire a first service identifier corresponding to the first connection information
  • the sending connection establishment sub-module may specifically include:
  • connection information obtaining unit configured to acquire second connection information of the second device by using the first local area network discovery service
  • a sending connection establishing unit configured to establish a first connection with the second device according to the second connection information of the second device.
  • the apparatus may further include:
  • the conflict processing module is configured to modify the service identifier when two or more identical service identifiers exist in the same local area network, so that the service identifiers in the same local area network are different.
  • the first device and the second device are in different local area networks
  • the sending connection establishing module may specifically include:
  • a first establishing submodule configured to establish a second connection with the push engine by using the registered first push engine service
  • a second establishing submodule configured to use the second connection established with the push engine, and the second device Prepare to establish the first connection.
  • the apparatus may further include: a first push engine service registration module, configured to register the first push engine service; the first push engine service registration module, including :
  • a first push engine service registration sub-module configured to register an international mobile device identifier and/or a physical address of the first device in the push engine, to obtain a first registration identifier corresponding to the first device;
  • the data sending module may specifically include:
  • a registration identifier obtaining submodule configured to acquire a second registration identifier corresponding to the second device by using the second connection established with the push engine
  • the data sending submodule is configured to send the network data packet to the push engine by using the second connection, where the source address of the network data packet corresponds to the first registration identifier, and the destination address corresponds to the second registration identifier.
  • FIG. 6 a structural block diagram of a second embodiment of a transmission of a barrage of the present invention is shown, which is applied to a second device, and specifically includes:
  • the data receiving module 610 is configured to receive, by using the first connection established with the first device, a network data packet from the first device;
  • the data parsing module 620 is configured to parse the network data packet according to a preset protocol to obtain encapsulated barrage data.
  • the preset protocol includes: a protocol identifier, a data type, and data content.
  • the data parsing module may specifically include:
  • a parsing sub-module configured to parse the network data packet according to the preset protocol, and acquire the content of the barrographic data in the data content when the data type is a barrage data type.
  • the preset protocol may further include: the barrage The display information corresponding to the data content; the device may further include:
  • a display module configured to display the barrographic data content according to the display information.
  • the apparatus may further include: a receiving connection establishing module, configured to establish a first connection with the first device; the first device and the second device are in the same local area network,
  • the receiving connection establishing module may specifically include:
  • a second local area network registration submodule configured to register a second local area network discovery service in the local area network
  • a receiving connection establishing submodule configured to establish a first connection with the first device according to the second local area network discovery service.
  • the second local area network registration sub-module may specifically include:
  • a second local area network registration unit configured to register second connection information of the second device in the local area network, and acquire a second service identifier corresponding to the second connection information.
  • the first device and the second device are in different local area networks, and the receiving connection establishing module may specifically include:
  • a third establishing submodule configured to establish a third connection with the push engine by using the registered second push engine service
  • a fourth establishing submodule configured to establish a first connection with the first device by using the third connection established with the push engine.
  • the apparatus may further include: a second push engine service registration module, configured to register the second push engine service; and the second push engine service registration module, including :
  • a second push engine service registration sub-module configured to register an international mobile device identifier and/or a physical address of the second device in the push engine to obtain a second registration identifier corresponding to the second device;
  • the data receiving module may specifically include:
  • a data receiving submodule configured to receive from the third connection established with the push engine The network data packet of the push engine; wherein the source address of the network data packet corresponds to the first registration identifier, and the destination address corresponds to the second registration identifier.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
  • Figure 7 illustrates an electronic device, such as the first device or the second device described above, that can be implemented in accordance with the present invention.
  • the electronic device conventionally includes a processor 710 and a computer program product or computer readable medium in the form of a memory 720.
  • Memory 720 can be an electronic memory such as a flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • Memory 720 has a memory space 730 for program code 731 for performing any of the method steps described above.
  • storage space 730 for program code may include various program code 731 for implementing various steps in the above methods, respectively.
  • These program codes can be from one or The plurality of computer program products are read or written into the one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 720 in the electronic device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 731', ie, code readable by a processor, such as 710, that when executed by an electronic device causes the electronic device to perform each of the methods described above step.

Landscapes

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

Abstract

提供一种弹幕的传输方法及装置。其中的方法包括:将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;通过与第二设备建立第一连接,向所述第二设备发送所述网络数据包。本申请实施例可以不需要扫描智能电视中的二维码,从而简化了用户操作,提高了发布弹幕评论的效率;此外,第一设备不用和第二设备同步播放相同的视频节目,进一步提高了发布弹幕评论的灵活性。

Description

一种弹幕的传输方法及装置
本申请要求在2016年3月21日提交中国专利局、申请号为201610161952.0、发明名称为“一种弹幕的传输方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及通信技术领域,尤其涉及一种弹幕的传输方法及装置。
背景技术
随着智能电视的普及和智能电视用户群的增加,用户对节目的娱乐性和参与感的需求日益突显。例如,用户可以在观看视频节目时,对正在观看的视频节目发布弹幕。弹幕是指直接显现在视频上的评论,可以以滚动、停留甚至更多动作特效方式出现在视频上,用户可以一边观看视频,一边同步发表评论。用户还可以在观看视频的同时,观看到其他用户的评论,从而形成一种即时互动的体验。
在实际应用中,可以通过手机对智能电视中的视频节目发布弹幕评论,具体步骤可以如下:首先,通过手机扫描智能电视中当前视频节目的二维码,以使手机和智能电视同步播放相同的视频节目,通过对手机中播放的视频节目发布弹幕评论,可以将该弹幕评论上传至服务器;然后,智能电视从服务器获取对应的弹幕评论并显示在当前视频节目中。然而,如果用户更换了当前观看的视频节目,智能电视需要对更换后的视频节目生成新的二维码,此时,需要使用手机扫描新的二维码才能对更换后的视频节目发布弹幕评论。
可以看出,现有的通过手机对智能电视中的视频节目发布弹幕评论的过程,需要手机和智能电视同时播放相同的节目,用户要频繁扫描视频节目中的二维码才能针对正在观看的不同视频节目发布弹幕评论,操作较为繁琐,导致发布弹幕评论的效率较低。
发明内容
本发明实施例提供了一种弹幕的传输方法及装置,用以解决现有技术中需要频繁扫描视频节目中的二维码才能针对不同视频节目发布弹幕评论,导致发布弹幕评论的效率较低的问题。
本发明实施例提供一种弹幕的传输方法,应用于第一设备,包括:
将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;
通过与第二设备建立第一连接,向所述第二设备发送所述网络数据包。
依据本发明的另一个方面,提供一种弹幕的传输方法,应用于第二设备,包括:
通过与第一设备建立的第一连接,接收来自第一设备的网络数据包;
据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据;其中,所述预置协议包括:协议标识、数据类型以及数据内容。
依据本发明的又一个方面,提供一种弹幕的传输装置,应用于第一设备,包括:
数据封装模块,用于将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;以及
数据发送模块,用于通过与第二设备建立的第一连接,向所述第二设备发送所述网络数据包。
依据本发明的再一个方面,提供一种弹幕的传输装置,应用于第二设备,包括:
数据接收模块,用于通过与第一设备建立的第一连接,接收来自第一设备的网络数据包;以及
数据解析模块,用于依据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据;其中,所述预置协议包括:协议标识、数据类型以及数 据内容。
本发明实施例提供一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在电子设备上运行时,导致所述电子设备执行上述的弹幕的传输方法。
本发明实施例提供一种计算机可读介质,其中存储了上述的计算机程序。
本发明实施例提供一种弹幕的传输方法和装置,第一设备可以将弹幕数据封装为符合预置协议的网络数据包,在与第二设备建立第一连接后,即可通过第一连接向第二设备发送所述网络数据包,以使第二设备在接收到所述网络数据包后,可以依据所述预置协议对所述网络数据包进行解析,得到并显示所述弹幕数据。相对于现有方案中使用手机频繁扫描智能电视中的二维码的方式,本发明实施例可以不需要扫描智能电视中的二维码,从而简化了用户操作,提高了发布弹幕评论的效率。
此外,通过本发明实施例,第一设备在与第二设备建立第一连接后,即可按照预置协议通过第一连接传输弹幕数据,第一设备不用和第二设备同步播放相同的视频节目。也即,在第一设备和第二设备播放不同的视频节目,或者,在第一设备不播放视频节目的情况下,都可以通过第一设备向第二设备发送弹幕数据,进一步提高了发布弹幕评论的灵活性。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本发明的一种弹幕的传输方法实施例一的步骤流程图;
图2示出了本发明的一种弹幕的传输方法实施例二的步骤流程图;
图3示出了本发明的一种弹幕的传输方法实施例三的步骤流程图;
图4示出了本发明的一种弹幕的传输方法实施例四的步骤流程图;
图5示出了本发明的一种弹幕的传输装置实施例一的结构程图;及
图6示出了本发明的一种弹幕的传输装置实施例二的结构框图;
图7示意性地示出了用于执行根据本发明的方法的电子设备的框图;以及
图8示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例的核心构思之一在于,通过在第一设备与第二设备之间建立第一连接,使得第一设备可以通过第一连接向第二设备发送弹幕数据,具体地,第一设备依据预置协议通过第一连接向第二设备发送弹幕数据。相对于现有技术需要频繁扫描智能电视中的二维码,本发明实施例可以不用扫描二维码,简化了用户操作,进而可以提高发布弹幕评论的效率。此外,本发明实施例在第一设备和第二设备播放不同的视频节目,或者,在第一设备不播放视频节目的情况下,都可以通过第一设备向第二设备发送弹幕数据,进一步提高了发布弹幕评论的灵活性。
方法实施例一
参照图1,示出了本发明的一种弹幕的传输方法实施例一的步骤流程图,具体可以包括:
步骤101、将弹幕数据封装为符合预置协议的网络数据包;其中,所述 预置协议包括:协议标识、数据类型以及数据内容;
步骤102、通过与第二设备建立的第一连接,向所述第二设备发送所述网络数据包。
本发明实施例可用于第一设备向第二设备发送弹幕数据的场景,其中,第一设备和第二设备具体可以为智能终端,上述智能终端包括但不限于:智能电视、蜂窝电话、智能手机、膝上型计算机、PC(personal computer,个人电脑)、平板电脑、电子书终端、数字广播终端、PDA(Personal Digital Assistant,个人电子助理)、便携式多媒体播放器或导航系统等,可以理解,本发明实施例对于具体的智能终端不加以限制。为了便于说明,本发明实施例中均以第一设备作为发送弹幕数据的设备(如智能手机),第二设备作为接收弹幕数据的设备(如智能电视)为例进行说明,其它应用场景相互参照即可。
在本发明实施例中,可以依据预置协议对弹幕数据进行封装,以得到可以在网络中进行传输的网络数据包,由此,在第一设备与第二设备建立第一连接之后,第一设备可以通过所述第一连接向第二设备发送所述网络数据包,以使第二设备在接收到所述网络数据包后,可以依据所述预置协议对所述网络数据包进行解析,得到并显示所述弹幕数据。
在本发明的一种可选实施例中,可以通过如下步骤将弹幕数据封装为符合预置协议的网络数据包:
步骤S11、设置所述数据类型为弹幕数据类型,以及所述数据内容为弹幕数据内容;
步骤S12、将所述协议标识、弹幕数据类型、以及弹幕数据内容封装在网络数据包中。
在本发明实施例中,可以预先设置第一设备与第二设备共同遵循的预置协议,具体地,可以通过协议标识来区分不同的预置协议,并且设置所述预置协议对应的数据类型,以标识当前封装的数据是否为弹幕数据。在本发明的一种应用示例中,按照预置协议封装后的数据格式的可以为:
{msgType:1,msg:{type:1,body:{content:″这个节目很精彩″,position:top,color:red,size:large,isVip:true,userid:11111,usertoken:222222″}}}
其中,msgType用于存放预置协议的协议标识;msg字段后的{}内为封装的数据内容;type字段用于存放数据类型,在数据类型为弹幕数据类型时,表示msg:{}中封装有弹幕数据,在数据类型为视频数据类型时,表示msg:{}中封装有视频数据。例如,可以设置type=1表示数据类型为弹幕数据类型,设置type=2表示数据类型为视频数据类型等;content字段用于存放具体的弹幕数据;可选地,本发明实施例还可以在网络数据包中封装所述弹幕数据对应的显示信息,以及发送所述弹幕数据的用户对应的用户信息等其它相关信息;例如,postion字段可用于表示弹幕数据在屏幕上的显示位置,如top为屏幕顶部,bottom为屏幕下部,scroll为滚动等,color字段可用于表示弹幕数据的显示颜色,size字段可用于表示弹幕数据的显示大小,isVip可用于表示当前用户是否为会员,userid可用于标识用户标识,usertoken可用于表示用户的token等。
可以理解,上述将弹幕数据封装为网络数据包的具体数据格式仅作为本发明的一种应用示例,在实际应用中,本领域技术人员可以根据需要对所述数据格式灵活设置,本发明实施例对此不加以限制。
在实际应用中,所述第一连接的类型可以为任意,例如所述第一连接可以为基于TCP(Transmission Control Protocol,传输控制协议)的网络连接、或者为基于UDP(User Datagram Protocol,用户数据报协议)的网络连接等。本发明实施例对于第一连接的具体类型不加以限制。可以理解,在本发明实施例中,所述第一设备和第二设备之间可以通过有线或者无线的方式建立第一连接,本发明对于建立第一连接的具体连接方式也不加以限制。
综上,本发明实施例中,第一设备可以将弹幕数据封装为符合预置协议的网络数据包,在与第二设备建立第一连接后,即可通过第一连接向第二设 备发送所述网络数据包,以使第二设备在接收到所述网络数据包后,可以依据所述预置协议对所述网络数据包进行解析,得到并显示所述弹幕数据。相对于现有方案中使用手机频繁扫描智能电视中的二维码的方式,本发明实施例可以不需要扫描智能电视中的二维码,从而简化了用户操作,提高了发布弹幕评论的效率。
此外,通过本发明实施例,第一设备在与第二设备建立第一连接后,即可按照预置协议通过第一连接传输弹幕数据,第一设备不用和第二设备同步播放相同的视频节目。也即,在第一设备和第二设备播放不同的视频节目,或者,在第一设备不播放视频节目的情况下,都可以通过第一设备向第二设备发送弹幕数据,进一步提高了发布弹幕评论的灵活性。
再者,所述预置协议具体可以包括:协议标识、数据类型以及数据内容,通过上述预置协议将弹幕数据封装为网络数据包,使得第一设备和第二设备之间可以依据统一的私有协议传输弹幕数据,其中,私有协议具有封闭性和安全性高的优点,从而可以提高弹幕数据传输的安全性。
进一步地,在现有技术中,通过手机编辑的弹幕首先被发送至服务器,然后由智能电视从服务器获取所述弹幕并显示,该过程容易受到手机或者智能电视与服务器之间网络状态的影响,在网络状态较差的情况下,会导致弹幕显示延迟或者显示失败。而本发明实施例通过建立第一设备与第二设备之间的第一连接,使得第一设备可以通过第一连接向第二设备发送弹幕数据,可以不进行通过服务器的中转,从而可以提高弹幕数据的传输速度,进而提高弹幕显示的及时性。
方法实施例二
本实施例在上述实施例一的基础上,所述第一设备与第二设备可以处于同一局域网内。参照图2,示出了本发明的一种弹幕的传输方法实施例二的步骤流程图,具体可以包括:
步骤201、将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;
步骤202、通过已注册的第一局域网发现服务搜索所述第二设备;
步骤203、依据所述第一局域网发现服务,与所述第二设备建立第一连接;
步骤204、通过所述第一连接,向所述第二设备发送所述网络数据包。
在本发明实施例中,所述第一设备和第二设备可以处于同一局域网内,第一设备可以通过已注册的NSD(Network Service Discovery,局域网发现服务)与第二设备建立第一连接,由于在同一局域网内,可以使得所述网络数据包的传输速度较快且安全性较高。可以理解,本发明实施例将第一设备注册的局域网发现服务称为第一局域网发现服务,将第二设备注册的局域网发现服务称为第二局域网发现服务,仅仅为了区分第一设备和第二设备建立的局域网发现服务,而不应作为对局域网发现服务的限制。当然,本发明实施例对于注册局域网发现服务的执行时机也不加以限制,例如,可以在第一设备或者第二设备启动时进行注册,或者在接收到用户针对第一设备或者第二设备中用于处理弹幕的应用程序的启动操作时进行注册均可。
在具体应用中,Android(安卓)4.1操作系统中包含了新的API(Application Programming Interface,应用程序编程接口),可用于在局域网中注册NSD服务、广播已注册的NSD服务、发现设备以及连接设备。例如在同一房间里有智能手机和智能电视,且智能手机和智能电视通过各自系统中的API在局域网中分别注册了对应的NSD服务,则智能手机中的API可以根据智能电视广播的NSD服务搜索到智能电视设备,从而与智能电视建立TCP连接。当然,上述通过Android系统中的API注册并连接NSD服务仅作为本发明的一种应用示例,本发明实施例对于所述第一设备以及第二设备所使用的操作系统不加以限制,例如还可以使用iOS(苹果公司的移动操作系统)、Windows(微软公司的操作系统)等。
在本发明的一种可选实施例中,可以通过如下步骤注册所述第一局域网发现服务:
在所述局域网中注册所述第一设备的第一连接信息,以及获取所述第一连接信息对应的第一服务标识;
其中,所述第一连接信息具体可以包括网络标识和/或设备标识。所述网络标识具体可用于标识所述第一设备的网络地址,例如所述网络标识具体可以包括IP(Internet Protocol,网络之间互连的协议)地址和/或端口号等,所述设备标识可用于唯一标识所述第一设备,例如所述设备标识具体可以包括所述第一设备的设备名称和/或MAC(Media Access Control,媒体访问控制)地址等。可以理解,本发明实施例对于所述网络标识和/或设备标识的具体内容不加以限制。在本发明的一种应用示例中,所述第一设备可以在局域网中注册自身的IP地址、端口号、以及第一设备的设备名称。同样地,所述局域网中也可以注册有第二设备的IP地址、端口号、以及第二设备的设备名称,以使第一设备可以在该局域网中搜索到第二设备。
在具体应用中,在局域网中注册一个NSD服务时,首先需要创建一个NsdServiceInfo对象,这个对象可用于向网络中的其他设备提供所注册的NSD服务的连接信息。下面给出创建NsdServiceInfo对象的具体应用示例:
public void registerService(int port){
NsdServiceInfo serviceInfo=new NsdServiceInfo();
serviceInfo.setServiceName(″NsdBarraget″);
serviceInfo.setServiceType(″_http._tcp.″);
serviceInfo.setPort(port);
}
其中,第一个参数“NsdBarraget”具体可以为NSD服务的服务标识,该服务标识具体可以为服务的名称,该名称可用于在网络中查找使用该NSD服 务的设备,因此,该名称在网络上是唯一的。可选地,为了可以自动解决NSD服务名称的冲突问题,本发明实施例还可以包括如下步骤:
在同一局域网中内存在两个或两个以上相同的服务标识时,对所述服务标识进行修改,以使同一局域网内的各服务标识均不相同。
例如,如果在同一局域网内的两个设备都注册了名称为NsdBarraget的服务,则可以对其中一个服务的名称进行自动更改,如可以改成“NsdBarraget(1)”。第二个参数“_http._tcp.”可用于设置NSD服务的类型,以决定应用程序使用哪一个端口和传输层,“_http._tcp.”表示在TCP上使用HTTP协议。
在本发明的一种可选实施例中,所述依据所述第一局域网发现服务,与所述第二设备建立第一连接的步骤,具体可以包括:
步骤S21、通过所述第一局域网发现服务,获取所述第二设备的第二连接信息;
步骤S22、根据所述第二设备的第二连接信息,与所述第二设备建立第一连接。
在具体应用中,在接收到用户启动第一设备中的用于处理弹幕的应用程序时,可以触发第一设备搜索同一局域网内其它设备的操作,具体地,第一设备通过接收同一局域网内其它设备发送的NSD服务的广播,获取其它设备的设备名称,并且将获取的设备名称以列表的形式进行显示,以供用户选择。假设接收到用户针对第二设备的选择操作,则可以确定用户想要对第二设备发送弹幕,可以根据第二设备注册的NSD服务,获取第二设备的第二连接信息,所述第二连接信息具体可以包括所述第二设备的网络标识,如IP地址和/或端口号。所述第一设备即可根据所述第二设备的第二连接信息,与所述第二设备建立第一连接,以及通过第一连接发送弹幕。
在本发明的一种可选实施例中,在第一设备接收到所述用于处理弹幕的应用程序的关闭操作时,可以将所述应用程序注册的NSD服务进行注销,以防止其它不相关的应用程序试图连接NSD服务威胁到第一设备的安全,并且 在不使用NSD服务时将其注销可以节省NSD服务对资源的占用。
本发明实施例根据第一设备注册的第一局域网发现服务,使得第一设备可以依据所述第一局域网发现服务搜索到对应的第二设备,并且与第二设备建立第一连接,从而可以向第二设备发送弹幕数据。由于第一设备与第二设备处于同一局域网内,因此,可以使得弹幕数据的传输速度较快且安全性较高。
方法实施例三
本实施例在上述实施例一的基础上,所述第一设备与第二设备还可以处于不同局域网内。参照图3,示出了本发明的一种弹幕的传输方法实施例三的步骤流程图,具体可以包括:
步骤301、将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;
步骤302、通过已注册的第一推送引擎服务,与推送引擎建立第二连接;
步骤303、通过所述与推送引擎建立的第二连接,与第二设备建立第一连接;
步骤304、通过所述第一连接,向所述第二设备发送所述网络数据包。
在本发明实施例中,所述第一设备和第二设备还可以处于不同局域网内,以使得处于不同网络环境中的第一设备和第二设备之间可以传输弹幕数据,以提高弹幕数据传输的灵活性。具体地,所述第一设备和第二设备可以分别在推送引擎中建立推送引擎服务,为了便于区分,本发明实施例将第一设备对应的推送引擎服务称为第一推送引擎服务,将第二设备对应的推送引擎服务称为第二推送引擎服务。第一设备通过第一推送引擎服务与推送引擎建立第二连接,第二设备通过第二推送引擎服务与推送引擎建立第三连接,第一设备和第二设备可以通过所述第二连接以及第三连接建立第一连接。其中,所述推送引擎可用于在第一设备和第二设备之间进行消息或者数据的转发, 在具体应用中,所述推送引擎可以为任意类型的服务器。
可以理解,本发明实施例对于注册推送引擎服务的执行时机也不加以限制,例如,可以在第一设备或者第二设备启动时进行注册,或者在接收到用户针对第一设备或者第二设备中用于处理弹幕的应用程序的启动操作时进行注册均可。
在本发明的一种可选实施例中,可以通过如下步骤注册所述第一推送引擎服务:
在所述推送引擎中注册所述第一设备的国际移动设备标识和/或物理地址,以得到所述第一设备对应的第一注册标识;
其中,所述国际移动设备标识具体可以为IMEI(International Mobile Equipment Identity,国际移动设备标识),所述物理地址具体可以为MAC地址。在本发明的一种应用示例中,首先,可以将第一设备的IMEI标识和MAC地址拼接起来,可选地,可以对拼接后的数据进行加密,如base64加密等;然后,将加密后的数据发送给推送引擎进行注册;最后,接收到推送引擎依据所述加密后的数据分配的第一注册标识,则表示第一推送引擎服务注册成功。
在本发明的一种可选实施例中,所述通过所述第一连接,向所述第二设备发送网络数据包的步骤,具体可以包括:
步骤S31、通过所述与推送引擎建立的第二连接,获取所述第二设备对应的第二注册标识;
步骤S32、通过所述第二连接,向推送引擎发送所述网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
在本发明的一种应用示例中,智能手机与智能电视在不同局域网内,例如,智能电视在家中,而智能手机在户外,用户可以使用智能手机对家中的智能电视发送弹幕数据。具体地,可以通过智能手机与推送引擎建立的第二连接,获取所述智能电视对应的第二注册标识,以及通过所述第二连接,向 推送引擎发送所述网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。推送引擎接收到该网络数据包后,将其发送至所述第二注册标识对应的智能电视,从而实现了可以对不同局域网的设备发送弹幕数据。
由于第一设备与第二设备处于不同的局域网内,第一设备不能通过局域网发现服务搜索到第二设备,因此,在本发明的一种可选实施例中,第一设备可以通过已登录的用户账号搜索到第二设备,例如,在接收到用户启动第一设备中的用于处理弹幕的应用程序时,可以触发第一设备搜索与自身登录的用户账号相同的其它设备的操作,并且将搜索到其它设备的设备名称以列表的形式进行显示,以供用户选择。
本发明实施例根据已注册的第一推送引擎服务,可以在所述第一设备与第二设备处于不同局域网时,实现弹幕数据的传输,以使得处于不同网络环境中的第一设备和第二设备之间可以传输弹幕数据,从而提高弹幕数据传输的灵活性。
上述实施例一至实施例三均以第一设备的角度描述本发明的弹幕处理方法,下面以第二设备的角度详细说明本发明的实现过程。
方法实施例四
参照图4,示出了本发明的一种弹幕的传输方法实施例四的步骤流程图,具体可以包括:
步骤401、通过与第一设备建立的第一连接,接收来自第一设备的网络数据包;
步骤402、依据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据;其中,所述预置协议包括:协议标识、数据类型以及数据内容。
在本发明的一种可选实施例中,所述依据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据的步骤,具体可以包括:
依据所述预置协议解析所述网络数据包,在所述数据类型为弹幕数据类型时,获取所述数据内容中的弹幕数据内容。
在具体应用中,在第二设备依据预置协议解析所述网络数据包,得到所述所述数据类型为弹幕数据类型时,若当前第二设备正在播放视频节目,则可以对当前正在播放的视频节目发布所述网络数据包中的弹幕数据内容。由此,只要第二设备正在播放视频节目,就可以对接收到的弹幕数据内容进行发布,相对于现有技术中,智能电视只能发布与手机中同步播放的相同视频节目的弹幕评论,本发明实施例可以提高发布弹幕评论的灵活性。
在本发明的一种可选实施例中,所述预置协议还可以包括:所述弹幕数据内容对应的显示信息;所述方法还可以包括:
依据所述显示信息,展示所述弹幕数据内容。
在本发明的一种应用示例中,假设通过解析所述网络数据包,得到如下数据信息:
{msgType:1,msg:{type:1,body:{content:″这个节目很精彩″,position:top,color:red,size:large,isVip:true,userid:11111,usertoken:222222″}}}
其中,type字段为1,表示数据类型为弹幕数据类型,弹幕数据内容为“这个节目很精彩”,弹幕数据内容对应的显示信息包括:显示位置position为屏幕顶部top,显示显色color为红色red,显示大小size为大字体large。则可以依据上述显示信息在智能电视的屏幕上显示对应的弹幕数据内容“这个节目很精彩”。
在本发明的一种可选实施例中,所述第一设备与第二设备处于同一局域网内,则可以通过如下步骤与第一设备建立第一连接:
在所述局域网中注册第二局域网发现服务;
依据所述第二局域网发现服务,与所述第一设备建立第一连接。
在具体应用中,所述第二设备可以在所述局域网中注册第二局域网发现服务,并且在局域网中广播所述第二局域网发现服务,以使在同一局域网内 的第一设备可以发现所述第二设备。
在本发明的一种可选实施例中,所述在局域网中注册所述第二局域网发现服务的步骤,具体可以包括:在局域网中注册所述第二设备的第二连接信息,以及获取所述第二连接信息对应的第二服务标识;以使同一局域网内的第一设备可以通过第一局域网发现服务,在局域网中获取所述第二设备的第二连接信息,以建立第一连接。其中,所述第二连接信具体可以包括网络标识和/或设备标识。
在本发明的一种可选实施例中,所述第一设备与第二设备还可以处于不同局域网中,则可以通过如下步骤与第一设备建立第一连接:
通过已注册的第二推送引擎服务,与推送引擎建立第三连接;
通过所述与推送引擎建立的第三连接,与第一设备建立第一连接。
在本发明的一种可选实施例中,可以通过如下步骤注册所述第二推送引擎服务:
在所述推送引擎中注册所述第二设备的国际移动设备标识和/或物理地址,以得到所述第二设备对应的第二注册标识;
所述通过所述第一连接,接收来自第一设备的网络数据包的步骤,具体可以包括:
通过所述与推送引擎建立的第三连接,接收来自推送引擎的网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
综上,本发明实施例中,第二设备与第一设备建立第一连接后,可通过第一连接接收来自第一设备发送网络数据包,其中,该网络数据包中可以携带有依据预置协议封装的弹幕数据。相对于现有技术中智能电视需要频繁生成二维码的方式,本发明实施例可以不生成二维码,从而简化了接收弹幕的操作过程,进而提高了发布弹幕评论的效率。
应用示例
为使本领域技术人员更好地理解本发明实施例,以下给出本发明的一种弹幕的传输方法的具体应用示例。在本应用示例中,以智能手机作为发送弹幕的设备,智能电视作为接收弹幕的设备,且所述智能手机和智能电视都支持预置协议,则本发明的弹幕的传输方法具体可以包括如下步骤:
步骤S41、智能手机在所处的局域网中注册第一局域网发现服务,以及智能电视在所处的局域网中注册第二局域网发现服务;
步骤S42、智能手机在推送引擎中注册第一推送引擎服务,以得到第一注册标识,并且与推送引擎建立第二连接;以及智能电视在推送引擎中注册第二推送引擎服务,以得到第二注册标识,并且与推送引擎建立第三连接;
步骤S43、在智能手机与智能电视处于同一局域网内时,执行步骤S44;在智能手机与智能电视处于不同局域网内时,执行步骤S46;
步骤S44、智能手机通过智能电视广播的第二局域网发现服务,搜索到智能电视,并且与智能电视建立第一连接;
步骤S45、智能手机通过所述第一连接向智能电视发送网络数据包;其中,所述网络数据包中携带有依据预置协议封装的弹幕数据;执行步骤S50;
步骤S46、智能手机通过已登录的同一用户账号,搜索到智能电视;
步骤S47、智能手机通过所述第二连接,从所述推送引擎获取智能电视对应的第二注册标识;
步骤S48、智能手机通过所述第二连接,向推送引擎发送所述网络数据包;其中,所述网络数据包中携带有依据预置协议封装的弹幕数据;所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识;
步骤S49、智能电视通过所述第三连接,接收来自推送引擎的网络数据包;
步骤S50、智能电视解析所述网络数据包,得到其中的弹幕数据,如果智能电视当前正在播放视频节目,并且该视频节目支持弹幕的发布,则在该 视频节目中显示所述弹幕数据。
在本发明的一种可选实施例中,所述方法还可以包括如下步骤:
步骤S51、将所述弹幕数据发送至弹幕服务器。
在本发明实施例中,可以使用弹幕服务器存储用户发布的弹幕数据,以使用户再次观看视频时,智能电视可以从弹幕服务器获取弹幕数据进行显示,使得用户可以观看之前发布的弹幕或者其他用户发布的弹幕,从而可以增加用户之间的交互,提高用户体验。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。
装置实施例一
参照图5,示出了本发明的一种弹幕的传输置实施例一的结构框图,应用于第一设备,具体可以包括:
数据封装模块510,用于将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;以及
数据发送模块520,用于通过与第二设备建立的第一连接,向所述第二设备发送所述网络数据包。
在本发明的一种可选实施例中,所述数据封装模块510,具体可以包括:
设置子模块,用于设置所述数据类型为弹幕数据类型,以及所述数据内容为弹幕数据内容;
封装子模块,用于将所述协议标识、弹幕数据类型、以及弹幕数据内容封装在网络数据包中。
在本发明的另一种可选实施例中,所述预置协议还可以包括:所述弹幕数据内容对应的显示信息。
在本发明的又一种可选实施例中,所述装置还可以包括:发送连接建立模块,用于与第二设备建立第一连接;所述第一设备与第二设备处于同一局域网内,则所述发送连接建立模块,具体可以包括:
搜索子模块,用于通过已注册的第一局域网发现服务搜索所述第二设备;
发送连接建立子模块,用于依据所述第一局域网发现服务,与所述第二设备建立第一连接。
在本发明的再一种可选实施例中,所述装置还可以包括:第一局域网注册模块,用于注册所述第一局域网发现服务;
所述第一局域网注册模块,具体可以包括:
第一局域网注册子模块,用于在所述局域网中注册所述第一设备的第一连接信息,以及获取所述第一连接信息对应的第一服务标识;
所述发送连接建立子模块,具体可以包括:
连接信息获取单元,用于通过所述第一局域网发现服务,获取所述第二设备的第二连接信息;
发送连接建立单元,用于根据所述第二设备的第二连接信息,与所述第二设备建立第一连接。
在本发明的再一种可选实施例中,所述装置还可以包括:
冲突处理模块,用于在同一局域网内存在两个或两个以上相同的服务标识时,对所述服务标识进行修改,以使同一局域网内的各服务标识均不相同。
在本发明的再一种可选实施例中,所述第一设备与第二设备处于不同局域网内,则所述发送连接建立模块,具体可以包括:
第一建立子模块,用于通过已注册的第一推送引擎服务,与推送引擎建立第二连接;
第二建立子模块,用于通过所述与推送引擎建立的第二连接,与第二设 备建立第一连接。
在本发明的再一种可选实施例中,所述装置还可以包括:第一推送引擎服务注册模块,用于注册所述第一推送引擎服务;所述第一推送引擎服务注册模块,包括:
第一推送引擎服务注册子模块,用于在所述推送引擎中注册所述第一设备的国际移动设备标识和/或物理地址,以得到所述第一设备对应的第一注册标识;
所述数据发送模块,具体可以包括:
注册标识获取子模块,用于通过所述与推送引擎建立的第二连接,获取所述第二设备对应的第二注册标识;
数据发送子模块,用于通过所述第二连接,向推送引擎发送所述网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
装置实施例二
参照图6,示出了本发明的一种弹幕的传输置实施例二的结构框图,应用于第二设备,具体可以包括:
数据接收模块610,用于通过与第一设备建立的第一连接,接收来自第一设备的网络数据包;以及
数据解析模块620,用于依据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据;其中,所述预置协议包括:协议标识、数据类型以及数据内容。
在本发明的一种可选实施例中,所述数据解析模块,具体可以包括:
解析子模块,用于依据所述预置协议解析所述网络数据包,在所述数据类型为弹幕数据类型时,获取所述数据内容中的弹幕数据内容。
在本发明的另一种可选实施例中,所述预置协议还可以包括:所述弹幕 数据内容对应的显示信息;所述装置还可以包括:
展示模块,用于依据所述显示信息,展示所述弹幕数据内容。
在本发明的又一种可选实施例中,所述装置还可以包括:接收连接建立模块,用于与第一设备建立第一连接;所述第一设备与第二设备处于同一局域网内,则所述接收连接建立模块,具体可以包括:
第二局域网注册子模块,用于在所述局域网中注册第二局域网发现服务;
接收连接建立子模块,用于依据所述第二局域网发现服务,与所述第一设备建立第一连接。
在本发明的再一种可选实施例中,所述第二局域网注册子模块,具体可以包括:
第二局域网注册单元,用于在局域网中注册所述第二设备的第二连接信息,以及获取所述第二连接信息对应的第二服务标识。
在本发明的再一种可选实施例中,所述第一设备与第二设备处于不同局域网内,则所述接收连接建立模块,具体可以包括:
第三建立子模块,用于通过已注册的第二推送引擎服务,与推送引擎建立第三连接;
第四建立子模块,用于通过所述与推送引擎建立的第三连接,与第一设备建立第一连接。
在本发明的再一种可选实施例中,所述装置还可以包括:第二推送引擎服务注册模块,用于注册所述第二推送引擎服务;所述第二推送引擎服务注册模块,包括:
第二推送引擎服务注册子模块,用于在所述推送引擎中注册所述第二设备的国际移动设备标识和/或物理地址,以得到所述第二设备对应的第二注册标识;
所述数据接收模块,具体可以包括:
数据接收子模块,用于通过所述与推送引擎建立的第三连接,接收来自 推送引擎的网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
例如,图7示出了可以实现根据本发明的电子设备,例如上述的第一设备或第二设备。该电子设备传统上包括处理器710和以存储器720形式的计算机程序产品或者计算机可读介质。存储器720可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器720具有用于执行上述方法中的任何方法步骤的程序代码731的存储空间730。例如,用于程序代码的存储空间730可以包括分别用于实现上面的方法中的各种步骤的各个程序代码731。这些程序代码可以从一个或 者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图8所述的便携式或者固定存储单元。该存储单元可以具有与图7的电子设备中的存储器720类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码731’,即可以由例如诸如710之类的处理器读取的代码,这些代码当由电子设备运行时,导致该电子设备执行上面所描述的方法中的各个步骤。最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (32)

  1. 一种弹幕的传输方法,其特征在于,应用于第一设备,包括:
    将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;
    通过与第二设备建立第一连接,向所述第二设备发送所述网络数据包。
  2. 根据权利要求1所述的方法,其特征在于,所述将弹幕数据封装为符合预置协议的网络数据包的步骤,包括:
    设置所述数据类型为弹幕数据类型,以及所述数据内容为弹幕数据内容;
    将所述协议标识、弹幕数据类型、以及弹幕数据内容封装在网络数据包中。
  3. 根据权利要求2所述的方法,其特征在于,所述预置协议还包括:所述弹幕数据内容对应在第二设备的显示信息。
  4. 根据权利要求1所述的方法,其特征在于,所述第一设备与第二设备处于同一局域网内,则通过如下步骤与第二设备建立第一连接:
    通过已注册的第一局域网发现服务搜索所述第二设备;
    依据所述第一局域网发现服务,与所述第二设备建立第一连接。
  5. 根据权利要求4所述的方法,其特征在于,通过如下步骤注册所述第一局域网发现服务:
    在所述局域网中注册所述第一设备的第一连接信息,以及获取所述第一连接信息对应的第一服务标识;
    所述依据所述第一局域网发现服务,与所述第二设备建立第一连接的步骤,包括:
    通过所述第一局域网发现服务,获取所述第二设备的第二连接信息;
    根据所述第二设备的第二连接信息,与所述第二设备建立第一连接。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    在同一局域网内存在两个或两个以上相同的服务标识时,对所述服务标识进行修改,以使同一局域网内的各服务标识均不相同。
  7. 根据权利要求1所述的方法,其特征在于,所述第一设备与第二设备处于不同局域网内,则通过如下步骤与第二设备建立第一连接:
    通过已注册的第一推送引擎服务,与推送引擎建立第二连接;
    通过所述与推送引擎建立的第二连接,与第二设备建立第一连接。
  8. 根据权利要求7所述的方法,其特征在于,通过如下步骤注册所述第一推送引擎服务:
    在所述推送引擎中注册所述第一设备的国际移动设备标识和/或物理地址,以得到所述第一设备对应的第一注册标识;
    所述通过所述第一连接,向所述第二设备发送网络数据包的步骤,包括:
    通过所述与推送引擎建立的第二连接,获取所述第二设备对应的第二注册标识;
    通过所述第二连接,向推送引擎发送所述网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
  9. 一种弹幕的传输方法,其特征在于,应用于第二设备,包括:
    通过与第一设备建立的第一连接,接收来自第一设备的网络数据包;
    据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据;其中,所述预置协议包括:协议标识、数据类型以及数据内容。
  10. 根据权利要求9所述的方法,其特征在于,所述依据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据的步骤,包括:
    依据所述预置协议解析所述网络数据包,在所述数据类型为弹幕数据类型时,获取所述数据内容中的弹幕数据内容。
  11. 根据权利要求10所述的方法,其特征在于,所述预置协议还包括: 所述弹幕数据内容对应在第二设备的显示信息;所述方法还包括:
    依据所述显示信息,展示所述弹幕数据内容。
  12. 根据权利要求9所述的方法,其特征在于,所述第一设备与第二设备处于同一局域网内,则通过如下步骤与第一设备建立第一连接:
    在所述局域网中注册第二局域网发现服务;
    依据所述第二局域网发现服务,与所述第一设备建立第一连接。
  13. 根据权利要求9所述的方法,其特征在于,所述在所述局域网中注册第二局域网发现服务的步骤,包括:
    在所述局域网中注册所述第二设备的第二连接信息,以及获取所述第二连接信息对应的第二服务标识。
  14. 根据权利要求9所述的方法,其特征在于,所述第一设备与第二设备处于不同局域网内,则通过如下步骤与第一设备建立第一连接:
    通过已注册的第二推送引擎服务,与推送引擎建立第三连接;
    通过所述与推送引擎建立的第三连接,与第一设备建立第一连接。
  15. 根据权利要求14所述的方法,其特征在于,通过如下步骤注册所述第二推送引擎服务:
    在所述推送引擎中注册所述第二设备的国际移动设备标识和/或物理地址,以得到所述第二设备对应的第二注册标识;
    所述通过所述第一连接,接收来自第一设备的网络数据包的步骤,包括:
    通过所述与推送引擎建立的第三连接,接收来自推送引擎的网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
  16. 一种弹幕的传输装置,其特征在于,应用于第一设备,包括:
    数据封装模块,用于将弹幕数据封装为符合预置协议的网络数据包;其中,所述预置协议包括:协议标识、数据类型以及数据内容;以及
    数据发送模块,用于通过与第二设备建立的第一连接,向所述第二设备发送所述网络数据包。
  17. 根据权利要求16所述的装置,其特征在于,所述数据封装模块,包括:
    设置子模块,用于设置所述数据类型为弹幕数据类型,以及所述数据内容为弹幕数据内容;
    封装子模块,用于将所述协议标识、弹幕数据类型、以及弹幕数据内容封装在网络数据包中。
  18. 根据权利要求17所述的装置,其特征在于,所述预置协议还包括:所述弹幕数据内容对应在第二设备的显示信息。
  19. 根据权利要求16所述的装置,其特征在于,所述装置还包括:发送连接建立模块,用于与第二设备建立第一连接;所述第一设备与第二设备处于同一局域网内,则所述发送连接建立模块,包括:
    搜索子模块,用于通过已注册的第一局域网发现服务搜索所述第二设备;
    发送连接建立子模块,用于依据所述第一局域网发现服务,与所述第二设备建立第一连接。
  20. 根据权利要求19所述的装置,其特征在于,所述装置还包括:第一局域网注册模块,用于注册所述第一局域网发现服务;
    所述第一局域网注册模块,包括:
    第一局域网注册子模块,用于在所述局域网中注册所述第一设备的第一连接信息,以及获取所述第一连接信息对应的第一服务标识;
    所述发送连接建立子模块,包括:
    连接信息获取单元,用于通过所述第一局域网发现服务,获取所述第二设备的第二连接信息;
    发送连接建立单元,用于根据所述第二设备的第二连接信息,与所述第二设备建立第一连接。
  21. 根据权利要求20所述的装置,其特征在于,所述装置还包括:
    冲突处理模块,用于在同一局域网内存在两个或两个以上相同的服务标识时,对所述服务标识进行修改,以使同一局域网内的各服务标识均不相同。
  22. 根据权利要求16所述的装置,其特征在于,所述装置还包括:发送连接建立模块,用于与第二设备建立第一连接;所述第一设备与第二设备处于不同局域网内,则所述发送连接建立模块,包括:
    第一建立子模块,用于通过已注册的第一推送引擎服务,与推送引擎建立第二连接;
    第二建立子模块,用于通过所述与推送引擎建立的第二连接,与第二设备建立第一连接。
  23. 根据权利要求22所述的装置,其特征在于,所述装置还包括:第一推送引擎服务注册模块,用于注册所述第一推送引擎服务;所述第一推送引擎服务注册模块,包括:
    第一推送引擎服务注册子模块,用于在所述推送引擎中注册所述第一设备的国际移动设备标识和/或物理地址,以得到所述第一设备对应的第一注册标识;
    所述数据发送模块,包括:
    注册标识获取子模块,用于通过所述与推送引擎建立的第二连接,获取所述第二设备对应的第二注册标识;
    数据发送子模块,用于通过所述第二连接,向推送引擎发送所述网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
  24. 一种弹幕的传输装置,其特征在于,应用于第二设备,包括:
    数据接收模块,用于通过与第一设备建立的第一连接,接收来自第一设备的网络数据包;以及
    数据解析模块,用于依据预置协议,对所述网络数据包进行解析,以得到封装的弹幕数据;其中,所述预置协议包括:协议标识、数据类型以及数据内容。
  25. 根据权利要求24所述的装置,其特征在于,所述数据解析模块,包括:
    解析子模块,用于依据所述预置协议解析所述网络数据包,在所述数据类型为弹幕数据类型时,获取所述数据内容中的弹幕数据内容。
  26. 根据权利要求25所述的装置,其特征在于,所述预置协议还包括:所述弹幕数据内容对应在第二设备的显示信息;所述装置还包括:
    展示模块,用于依据所述显示信息,展示所述弹幕数据内容。
  27. 根据权利要求24所述的装置,其特征在于,所述装置还包括:接收连接建立模块,用于与第一设备建立第一连接;所述第一设备与第二设备处于同一局域网内,则所述接收连接建立模块,包括:
    第二局域网注册子模块,用于在所述局域网中注册第二局域网发现服务;
    接收连接建立子模块,用于依据所述第二局域网发现服务,与所述第一设备建立第一连接。
  28. 根据权利要求24所述的装置,其特征在于,所述第二局域网注册子模块,包括:
    第二局域网注册单元,用于在局域网中注册所述第二设备的第二连接信息,以及获取所述第二连接信息对应的第二服务标识。
  29. 根据权利要求24所述的装置,其特征在于,所述装置还包括:接收连接建立模块,用于与第一设备建立第一连接;所述第一设备与第二设备处于不同局域网内,则所述接收连接建立模块,包括:
    第三建立子模块,用于通过已注册的第二推送引擎服务,与推送引擎建立第三连接;
    第四建立子模块,用于通过所述与推送引擎建立的第三连接,与第一设 备建立第一连接。
  30. 根据权利要求29所述的装置,其特征在于,所述装置还包括:第二推送引擎服务注册模块,用于注册所述第二推送引擎服务;所述第二推送引擎服务注册模块,包括:
    第二推送引擎服务注册子模块,用于在所述推送引擎中注册所述第二设备的国际移动设备标识和/或物理地址,以得到所述第二设备对应的第二注册标识;
    所述数据接收模块,包括:
    数据接收子模块,用于通过所述与推送引擎建立的第三连接,接收来自推送引擎的网络数据包;其中,所述网络数据包的源地址对应第一注册标识,目的地址对应第二注册标识。
  31. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备上运行时,导致所述电子设备执行根据权利要求1-8、9-15中的任一个所述的弹幕的传输方法。
  32. 一种计算机可读介质,其中存储了如权利要求31所述的计算机程序。
PCT/CN2016/089265 2016-03-21 2016-07-07 一种弹幕的传输方法及装置 WO2017161769A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610161952.0A CN105872653A (zh) 2016-03-21 2016-03-21 一种弹幕的传输方法及装置
CN201610161952.0 2016-03-21

Publications (1)

Publication Number Publication Date
WO2017161769A1 true WO2017161769A1 (zh) 2017-09-28

Family

ID=56625342

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/089265 WO2017161769A1 (zh) 2016-03-21 2016-07-07 一种弹幕的传输方法及装置

Country Status (2)

Country Link
CN (1) CN105872653A (zh)
WO (1) WO2017161769A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866193A (zh) * 2019-11-20 2020-03-06 北京字节跳动网络技术有限公司 基于在线文档评论的反馈方法、装置、设备及存储介质
CN110958480A (zh) * 2019-11-28 2020-04-03 湖南快乐阳光互动娱乐传媒有限公司 一种弹幕显示方法
CN112118228A (zh) * 2020-08-17 2020-12-22 湖南快乐阳光互动娱乐传媒有限公司 一种弹幕数据处理方法、用户端和弹幕服务器
CN113765900A (zh) * 2021-08-24 2021-12-07 深圳融安网络科技有限公司 协议交互信息输出传输方法、适配器装置及存储介质
CN114422574A (zh) * 2022-02-10 2022-04-29 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备和计算机可读存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547934A (zh) * 2016-10-12 2018-01-05 腾讯科技(北京)有限公司 基于视频的信息传输方法和装置
CN106507138A (zh) * 2016-11-15 2017-03-15 深圳前海茂佳软件科技有限公司 基于电子节目菜单的弹幕系统、方法及电视机
CN106954094B (zh) * 2017-03-21 2019-09-10 武汉斗鱼网络科技有限公司 弹幕信息的处理方法、装置及服务终端
CN107291492A (zh) * 2017-05-18 2017-10-24 广州视源电子科技股份有限公司 按需安装应用的方法及设备
CN107911708B (zh) * 2017-11-09 2022-04-05 腾讯数码(天津)有限公司 弹幕显示方法、直播方法、及相关装置
CN108966035B (zh) * 2018-09-03 2021-02-02 武汉斗鱼网络科技有限公司 弹幕消息传输方法、装置、设备与存储介质
CN110448892B (zh) * 2019-07-18 2023-08-22 江西中业光文化科技有限公司 基于增强现实的游戏实现方法及系统
CN111309279B (zh) * 2020-05-06 2020-11-24 上海幻电信息科技有限公司 多屏互动显示方法及装置
CN114257876A (zh) * 2020-09-25 2022-03-29 武汉斗鱼鱼乐网络科技有限公司 一种弹幕显示处理方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102905170A (zh) * 2012-10-08 2013-01-30 北京导视互动网络技术有限公司 视频的弹幕方法及系统
CN104010222A (zh) * 2014-04-28 2014-08-27 小米科技有限责任公司 评论信息展示方法、装置及系统
CN104463643A (zh) * 2015-01-14 2015-03-25 成都智元汇数码科技有限公司 一种在广告上呈现用户评论的方法
US20150382077A1 (en) * 2014-06-26 2015-12-31 Xiaomi Inc. Method and terminal device for acquiring information

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101482094B1 (ko) * 2011-06-27 2015-01-13 주식회사 케이티 영상 관련 정보 제공 방법 및 시스템
CN104113786A (zh) * 2014-06-26 2014-10-22 小米科技有限责任公司 信息获取方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102905170A (zh) * 2012-10-08 2013-01-30 北京导视互动网络技术有限公司 视频的弹幕方法及系统
CN104010222A (zh) * 2014-04-28 2014-08-27 小米科技有限责任公司 评论信息展示方法、装置及系统
US20150382077A1 (en) * 2014-06-26 2015-12-31 Xiaomi Inc. Method and terminal device for acquiring information
CN104463643A (zh) * 2015-01-14 2015-03-25 成都智元汇数码科技有限公司 一种在广告上呈现用户评论的方法

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866193A (zh) * 2019-11-20 2020-03-06 北京字节跳动网络技术有限公司 基于在线文档评论的反馈方法、装置、设备及存储介质
CN110866193B (zh) * 2019-11-20 2023-05-02 北京字节跳动网络技术有限公司 基于在线文档评论的反馈方法、装置、设备及存储介质
US11762931B2 (en) 2019-11-20 2023-09-19 Beijing Bytedance Network Technology Co., Ltd. Feedback method and apparatus based on online document comment, and non-transitory computer-readable storage medium
CN110958480A (zh) * 2019-11-28 2020-04-03 湖南快乐阳光互动娱乐传媒有限公司 一种弹幕显示方法
CN112118228A (zh) * 2020-08-17 2020-12-22 湖南快乐阳光互动娱乐传媒有限公司 一种弹幕数据处理方法、用户端和弹幕服务器
CN112118228B (zh) * 2020-08-17 2023-04-28 湖南快乐阳光互动娱乐传媒有限公司 一种弹幕数据处理方法、用户端和弹幕服务器
CN113765900A (zh) * 2021-08-24 2021-12-07 深圳融安网络科技有限公司 协议交互信息输出传输方法、适配器装置及存储介质
CN113765900B (zh) * 2021-08-24 2023-09-26 深圳融安网络科技有限公司 协议交互信息输出传输方法、适配器装置及存储介质
CN114422574A (zh) * 2022-02-10 2022-04-29 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备和计算机可读存储介质
CN114422574B (zh) * 2022-02-10 2024-05-03 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN105872653A (zh) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2017161769A1 (zh) 一种弹幕的传输方法及装置
US9762665B2 (en) Information processing and content transmission for multi-display
EP3640849B1 (en) Electronic device and method of registering personal cloud apparatus in user portal server thereof
US10931735B2 (en) Application discovery
US9774642B2 (en) Method and device for pushing multimedia resource and display terminal
US11924298B2 (en) Message pushing method for a virtual gift and electronic device
WO2017206398A1 (zh) 一种视频共享方法及装置
US10034057B2 (en) Message processing method, device, gateway, STB and IPTV
CN103702238A (zh) 一种多屏视频共享方法及终端、服务器
WO2021223453A1 (zh) 多屏互动显示方法及装置
CN104918105B (zh) 媒体文件的多屏播放方法、设备及系统
JP6580132B2 (ja) メディアコンテンツに関連付けられた情報を提供する方法および装置
US10165229B2 (en) Network communication system and method thereof
CN105208434A (zh) 媒体投影方法、媒体投影设备、控制终端以及云端服务器
CN104539977A (zh) 直播预览方法及装置
CN102523492A (zh) 一种互动评论系统的评论方法、电视机及移动终端
CN105847880A (zh) 音视频共享方法、服务器及终端
US20170171496A1 (en) Method and Electronic Device for Screen Projection
CN104902295A (zh) 智能电视业务实现方法、终端设备和系统
KR20150113804A (ko) 디지털 사이니지 시스템 및 모바일 연동 방법
CN111131891B (zh) 一种音视频播放方法、装置、播放设备及系统
WO2015180446A1 (zh) 一种多设备联动服务中的连接通道维护系统及方法
CN103561063A (zh) 一种登录机顶盒的方法及终端
CN114205664A (zh) 投屏方法、投屏装置、投屏显示装置、投屏系统及介质
US20170171339A1 (en) Advertisement data transmission method, electrnoic device and system

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16895119

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16895119

Country of ref document: EP

Kind code of ref document: A1