CN110139163A - A kind of method and relevant apparatus obtaining barrage - Google Patents
A kind of method and relevant apparatus obtaining barrage Download PDFInfo
- Publication number
- CN110139163A CN110139163A CN201910431255.6A CN201910431255A CN110139163A CN 110139163 A CN110139163 A CN 110139163A CN 201910431255 A CN201910431255 A CN 201910431255A CN 110139163 A CN110139163 A CN 110139163A
- Authority
- CN
- China
- Prior art keywords
- client
- server
- barrage
- key
- http
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/083—Network architectures or network communication protocols for network security for authentication of entities using passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/163—In-band adaptation of TCP data exchange; In-band control procedures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/478—Supplemental services, e.g. displaying phone caller identification, shopping application
- H04N21/4788—Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/488—Data services, e.g. news ticker
- H04N21/4884—Data services, e.g. news ticker for displaying subtitles
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/637—Control signals issued by the client directed to the server or network components
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the present application discloses a kind of method and relevant apparatus for obtaining barrage, for protecting the barrage privacy and barrage resource of live streaming platform, to improve the difficulty that barrage is crawled.The embodiment of the present application method includes: client according to the room number of present system time, equipment identification information and direct broadcasting room the first validation value of calculating;Client sends http connection request to live streaming Platform Server;When the information being broadcast live in Platform Server verifying http connection request is legal, client receives the http connection response that live streaming Platform Server is sent;Client is according to gateway server IP list and key http_secret, TCP connection is established with gateway server, and the tcp connection response of gateway server transmission is received, tcp connection response includes the IP list of barrage server and the key tcp_key that gateway server generates at random;Client connects barrage server with key tcp_key according to the list of barrage server ip, and receives the corresponding barrage of direct broadcasting room of barrage server transmission.
Description
Technical field
This application involves live streaming platform field more particularly to a kind of methods and relevant apparatus for obtaining barrage.
Background technique
With the continuous universal and development of network, live streaming becomes more and more popular with users on line.While viewing live streaming
Watching barrage is also that very important a part is broadcast live.It can see the direct broadcasting room after spectators enter a direct broadcasting room
All barrage contents.And as live streaming platform, it is desirable to which it is straight that all barrage contents in live streaming only have the user that platform is broadcast live to pass through
The viewing live streaming APP for broadcasting platform offer just can be carried out viewing.
However, in the prior art, hacker can crawl all straight by some illegal scripts rather than by live streaming APP
All barrage contents between broadcasting, to steal all barrages of direct broadcasting room.Therefore, how more effectively to prevent hacker from stealing live streaming flat
The barrage content of platform is carried out the protection of safety with the barrage content to live streaming platform, becomes the major issue for currently needing to solve.
Summary of the invention
The embodiment of the present application provides a kind of method and relevant apparatus for obtaining barrage, for protecting the barrage of live streaming platform
Privacy and barrage resource, to improve the difficulty that barrage is crawled.
The first aspect of the embodiment of the present application provides a kind of method for obtaining barrage, comprising: client is according to current system
The room number of system time, equipment identification information and direct broadcasting room calculate the first validation value;The client to live streaming Platform Server
Http connection request is sent, the http connection request is connect for requesting with live streaming Platform Server creation http, institute
Stating http connection request includes first validation value, the present system time, the equipment identification information and the live streaming
Between room number;When the live streaming Platform Server verify the information in the http connection request it is legal when, the client
The http connection response that the live streaming Platform Server is sent is received, the http connection response includes the IP column of gateway server
The key http_secret that table and the live streaming Platform Server generate at random;The client is according to the gateway server
IP list and the key http_secret, establish TCP connection with gateway server, and receive the gateway server and send
Tcp connection response, the tcp connection response includes that the IP list of barrage server and the gateway server generate at random
Key tcp_key;The client connects the barrage clothes according to the barrage server ip list with the key tcp_key
Business device, and receive the corresponding barrage of the direct broadcasting room that the barrage server is sent.
In a kind of possible embodiment, the client is according to present system time, equipment identification information and direct broadcasting room
Room number calculate the first validation value to include: the client obtain present system time by calling interface Time ();It is described
Client encrypts the present system time by calling interface Md4.Create () to export time_md4, is connect by calling
Mouth sha1-256.Create () encrypts the equipment identification information to export Deviceid_sha, passes through calling interface
RIPEMD-256.Create () encrypts the room number to export Roomid_ripemd, wherein the interface Md4.Create
() is the encryption interface of informative abstract MD4 algorithm, and the interface sha1-256.Create () is adding for secure hash sha algorithm
Touch mouth, the interface RIPEMD-256.Create () is the encryption interface of RIPEMD algorithm;The client is according to following
Mode calculates first validation value: sign=Md5.Create (time_md4 [Time_no-Time_length]+
Deviceid_sha[Deviceid_no-Deviceid_length]+Roomid_ripemd[Roomid_no-Roomid_
length);Wherein, the sign is falling for the present system time for indicating first validation value, the Time_no
First parameter of number, the Time_length are the penultimate parameter of the present system time, the Deviceid_
No is first parameter of the equipment identification information, and the Deviceid_length is the inverse of the equipment identification information
Second parameter, the Roomid_no are the third parameter of the room number, and the Roomid_length is the room
Number fourth from the last parameter, the Md5.Create () be the MD5 algorithm encryption interface.
In a kind of possible embodiment, the client sends http connection request to live streaming Platform Server and includes:
The client is by following Encryption Algorithm to first validation value, the present system time, the equipment identification information
It is encrypted with the room number of the direct broadcasting room: Encryptdata=Rc4.encrypt (current_time+Deviceid+
Roomid+sign,key);Base64_data=Base64.encrypt (Encryptdata);The Rc4.encrypt ()
For the encryption interface of stream cipher algorithm RC4, the Base64.encrypt () is that the encryption of coded format Base64 algorithm connects
Mouthful, the current_time is the present system time, and the Deviceid is the equipment identification information, described
Roomid be the direct broadcasting room room number, the sign be first validation value, the key be the client with it is described
The shared key of Platform Server is broadcast live;The client will carry the http connection request of the Base64_data
It is sent to the live streaming Platform Server.
In a kind of possible embodiment, the client is according to the gateway server IP list and the key
Http_secret, establishing TCP connection with gateway server includes: that the client is current by calling interface Time () acquisition
System time;The client encrypts the present system time by calling interface sha1-256.Create () to export
Time_sha1 encrypts the equipment identification information by calling interface md4.Create () to export Deviceid_md4;Institute
It states client and calculates the second validation value: Tcp_sign=Md5.Create (time_sha1+Deviceid_ in the following manner
md4+http_secret);Wherein, the Tcp_sign indicates second validation value, and the Md5.Create () is MD5 calculation
The encryption interface of method;Gateway server of the client into the gateway server IP list sends tcp connection request, institute
Stating TCP connection request includes second validation value, the room number and the equipment identification information;When the gateway server
Verify information in the tcp connection request it is legal when, the client and gateway server establish the TCP connection.
In a kind of possible embodiment, gateway server hair of the client into the gateway server IP list
Before sending tcp connection request, the method also includes: the client is specified the header data of the tcp connection request
Field is revised as non-zero value, wherein when the specific field is non-zero value, being used to indicate the client is legitimate client;
When the specific field is full 0 value, being used to indicate the client is illegitimate client.
In a kind of possible embodiment, the client is according to the barrage server ip list and the key tcp_
The key connection barrage server includes: that the client passes through calling interface Time () acquisition present system time;It is described
Client encrypts the present system time by calling interface sha1-256.Create () to export time_sha2;It is described
Client calculates third validation value: Tcp_verify2=sha1-256.Create (time_sha2+tcp_ in the following manner
key);Wherein, the Tcp_verify2 indicates the third validation value;The third validation value is sent to by the client
Barrage server in the barrage server ip list;When the third validation value described in the barrage server authentication is legal,
The client and the barrage server establish connection, to obtain the barrage of the direct broadcasting room from the barrage server.
In a kind of possible embodiment, the client is according to the barrage server ip list and the key tcp_
The key connection barrage server includes: that the client adds agreement field in a connection request, and the agreement field is used for
Indicate that the client is legitimate client;The connection request is sent to by the client according to the key tcp_key
Barrage server in the barrage server ip list receives the true direct broadcasting room to connect the barrage server
Corresponding barrage.
The second aspect of the embodiment of the present application provides the method for obtaining barrage, comprising: live streaming Platform Server receives visitor
The http connection request that family end is sent, the http connection request connect for requesting with live streaming Platform Server creation http
It connects, the http connection request includes the first validation value, the present system time of client, equipment identification information and direct broadcasting room
Room number;The live streaming Platform Server judges whether the room of the equipment identification information and the direct broadcasting room is legal, and sentences
Whether the difference of the current time for the client of breaking and the current time of the live streaming Platform Server is less than default value;If
The room of the equipment identification information and the direct broadcasting room is legal and the difference is less than the default value, the then live streaming
Platform Server is according to the room number meter of the present system time of the client, the equipment identification information and the direct broadcasting room
Calculate the first reference value;If first reference value is equal with first validation value, the live streaming Platform Server is given birth at random
Http connection response is sent at key http_secret, and to the client, the http connection response includes the key
The IP list of http_secret and gateway server, so that the client is according to http connection response acquisition
The barrage of direct broadcasting room.
The third aspect of the embodiment of the present application provides a kind of client, comprising: computing unit, for according to current system
The room number of time, equipment identification information and direct broadcasting room calculate the first validation value;Transmit-Receive Unit is used for live streaming Platform Server
Http connection request is sent, the http connection request is connect for requesting with live streaming Platform Server creation http, institute
Stating http connection request includes first validation value, the present system time, the equipment identification information and the live streaming
Between room number;The Transmit-Receive Unit is also used to verify the letter in the http connection request when the live streaming Platform Server
When ceasing legal, the http connection response that the live streaming Platform Server is sent is received, the http connection response includes gateway clothes
The key http_secret that the IP list of business device and the live streaming Platform Server generate at random;Unit is established, for according to institute
Gateway server IP list and the key http_secret are stated, establishes TCP connection with gateway server, and receive the net
The tcp connection response that server is sent is closed, the tcp connection response includes the IP list and the gateway service of barrage server
The key tcp_key that device generates at random;The barrage is connected with the key tcp_key according to the barrage server ip list
Server, and receive the corresponding barrage of the direct broadcasting room that the barrage server is sent.
The fourth aspect of the embodiment of the present application provides a kind of live streaming Platform Server, comprising: Transmit-Receive Unit, for receiving
The http connection request that client is sent, the http connection request create http with the live streaming Platform Server for requesting
Connection, the http connection request includes the first validation value, the present system time of client, equipment identification information and direct broadcasting room
Room number;Judging unit, whether the room for judging the equipment identification information and the direct broadcasting room is legal, and judges institute
Whether the difference for stating the current time of client and the current time of the live streaming Platform Server is less than default value;It calculates single
Member, if the legal and described difference is less than the default value for the room of the equipment identification information and the direct broadcasting room,
The first ginseng is then calculated according to the room number of the present system time of the client, the equipment identification information and the direct broadcasting room
Examine value;The Transmit-Receive Unit, it is random to generate key if it is equal with first validation value to be also used to first reference value
Http_secret, and http connection response is sent to the client, the http connection response includes the key http_
The IP list of secret and gateway server, so that the client obtains the direct broadcasting room according to the http connection response
Barrage.
The 5th aspect of the application provides a kind of electronic equipment, including memory, processor, which is characterized in that the place
It is realized as described in above-mentioned first aspect any one when reason device is for executing the computer management class method stored in memory
The step of verifying client believable method.
The 6th aspect of the application provides a kind of computer readable storage medium, in the computer readable storage medium
It is stored with instruction, when run on a computer, so that computer executes method described in above-mentioned various aspects.
The 7th aspect of the application provides a kind of computer program product comprising instruction, when it runs on computers
When, so that computer executes method described in above-mentioned various aspects.
As can be seen from the above technical solutions, when the embodiment of the present application has the advantage that client according to current system
Between, the room number of equipment identification information and direct broadcasting room calculate the first validation value;The client is sent to live streaming Platform Server
Http connection request, the http connection request is connect for requesting with live streaming Platform Server creation http, described
Http connection request includes first validation value, the present system time, the equipment identification information and the direct broadcasting room
Room number;When the live streaming Platform Server verify the information in the http connection request it is legal when, client termination
The http connection response that the live streaming Platform Server is sent is received, the http connection response includes the IP list of gateway server
The key http_secret generated at random with the live streaming Platform Server;The client is according to the gateway server IP
List and the key http_secret, establish TCP connection with gateway server, and receive what the gateway server was sent
Tcp connection response, the tcp connection response includes the IP list of barrage server and the gateway server generate at random it is close
Key tcp_key;The client connects the barrage service with the key tcp_key according to the barrage server ip list
Device, and receive the corresponding barrage of the direct broadcasting room that the barrage server is sent.In the embodiment of the present application, in client and directly
When broadcasting Platform Server progress http connection, verification process joined, being only verified live streaming Platform Server can just issue
Gateway server IP list and random key, therefore the APP ability successful connection of only live streaming platform is got in barrage in turn
Hold, protects the barrage privacy and barrage resource of live streaming platform, improve the difficulty that barrage is crawled.
Detailed description of the invention
Fig. 1 a is the flow chart of the possible method for obtaining barrage of one kind provided by the embodiments of the present application;
Fig. 1 b is a kind of possible TCP data pack arrangement schematic diagram provided by the embodiments of the present application;
Fig. 2 a is a kind of structural schematic diagram of possible client provided by the embodiments of the present application;
Fig. 2 b is the structural schematic diagram of the possible live streaming Platform Server of one kind provided by the embodiments of the present application;
Fig. 3 a is a kind of hardware structural diagram of possible electronic equipment provided by the embodiments of the present application;
Fig. 3 b is the hardware structural diagram of another possible electronic equipment provided by the embodiments of the present application
Fig. 4 a is a kind of hardware structural diagram of possible computer readable storage medium provided by the embodiments of the present application;
Fig. 4 b is the hardware structural diagram of another possible computer readable storage medium provided by the embodiments of the present application.
Specific embodiment
The embodiment of the present application provides a kind of method and relevant apparatus for obtaining barrage, for protecting the barrage of live streaming platform
Privacy and barrage resource, to improve the difficulty that barrage is crawled.
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, those skilled in the art's every other implementation obtained without making creative work
Example, shall fall in the protection scope of this application.
Will to be briefly described below to the transmission flow of barrage: spectators convenient for being better understood by the embodiment of the present application
When barrage to watch some direct broadcasting room, client can obtain the information of direct broadcasting room from direct broadcasting room list information, including straight
A classification information is broadcast, which connects gateway server ip list, direct broadcasting room other information etc..This process is that client makes
It is taken with the short connection of hypertext transfer protocol (hypertext transfer protocol, http) to connect live streaming platform
Business device, to pull direct broadcasting room data from live streaming Platform Server.After getting direct broadcasting room data, client will use transmission control
The long of agreement (transmission control protocol, TCP) processed connects to connect the gateway server of live streaming platform.
Client can connect barrage service according to the barrage server ip that gateway server provides after connecting upper gateway server
Device after successful connection, can receive the barrage content of the direct broadcasting room.In addition, client passes through net when there is user to send barrage
Close server send the barrage to live streaming Platform Server, live streaming Platform Server receive after, be then forwarded to the bullet of the direct broadcasting room
Curtain server, barrage server broadcast this barrage content to all spectators of direct broadcasting room again.
Process is connected based on above-mentioned barrage, the embodiment of the present application provides a kind of possible method for obtaining barrage, to prevent
Only hacker steals the barrage of all direct broadcasting rooms, the barrage privacy and barrage resource of protection live streaming platform, is crawled with to improve barrage
Safety.Fig. 1 a is please referred to, is the flow chart of the possible method for obtaining barrage of one kind provided by the embodiments of the present application, it is specific to wrap
It includes:
101, client calculates the first verifying according to the room number of present system time, equipment identification information and direct broadcasting room
Value;
Process is connected from above-mentioned barrage it is recognised that crawl the barrage content of live streaming platform, it is necessary first to be passed through
Http interface obtains room information.In the prior art, client to live streaming Platform Server send direct broadcasting room room number, set
The cookie information that standby identification information and client log in can obtain room information from live streaming Platform Server, the room information
Gateway server IP list including platform is broadcast live, and the room number of direct broadcasting room, equipment indicate what information and client logged in
The hackers such as cookie information easily can grab corresponding interface message by packet capturing software, therefore be easy to be broken
Solution.In view of this, hacker crawls room information and further obtains the address gateway server ip, obtaining in the present embodiment in order to prevent
The algorithm for increasing client validation in the http interface of room information is taken, is reported to so that client can calculate the first validation value
Platform Server is broadcast live, whether live streaming Platform Server can verify first validation value correct, and it is incorrect, it can refuse to issue room
Between information, if correctly can just issue room information.Specifically, the mode of the first validation value of client calculating is as follows:
Step 1, client obtain present system time by calling interface Time (), and specific function representation can be
Current_time=Time (), wherein current_time is present system time, obtains present system time as ginseng
Number participates in the calculating of the first validation value, it is ensured that the first validation value that each moment is calculated is inconsistent;
Present system time, equipment identification information and room number are participated in the calculating of the first validation value by step 2, client
In, specifically,
Present system time is encrypted to export time_md4 by calling interface Md4.Create (), and function representation is
Time_md4=Md4.Create (current_time), therefore one 32 string data time_md4 are finally obtained,
Wherein interface Md4.Create () is the encryption interface of informative abstract (Message-Digest, MD) 4 algorithm;
Equipment identification information is encrypted by calling interface sha1-256.Create () to export Deviceid_sha, function
It is expressed as Deviceid_sha=sha1-256.Create (deviceid), wherein deviceid is for indicating that device identification is believed
Breath, therefore one 160 string data Deviceid_sha are finally obtained, wherein interface sha1-256.Create () is
The encryption interface of secure hash (secure hash Algorithm, sha) 1 algorithm;
Room number is encrypted by calling interface RIPEMD-256.Create () to export Roomid_ripemd, specific function
Be expressed as follows: Roomid_ripemd=RIPEMD-256.Create (Roomid), wherein Roomid is used to indicate room number, because
This finally obtains one 32 string data Roomid_ripemd, and wherein interface RIPEMD-256.Create () is
The encryption interface of RIPEMD algorithm;
Step 3, after obtaining time_md4, Deviceid_sha and Roomid_ripemd, by each hash algorithm
It takes several and takes which position to calculate the first validation value, such as:
It is as follows for the exploitation of time_md4: the bit digital second from the bottom of Time_no=current_time numerical value;
The bit digital last of Time_length=current_time numerical value.
It is as follows for the exploitation of Deviceid_sha: the first bit digital of Deviceid_no=Deviceid numerical value
Or letter;
The bit digital second from the bottom or letter of Deviceid_length=Deviceid numerical value.
It is as follows for the exploitation of Roomid_ripemd: the third bit digital of Roomid_no=Roomid numerical value or
Letter;
The fourth from the last bit digital or letter of Roomid_length=Deviceid numerical value.
It should be noted that taken in each hash algorithm several and take which position calculate the first validation value can be according to reality
Situation setting, specifically herein without limitation.
Step 4, client calculate the first validation value according to following manner:
Sign=Md5.Create (time_md4 [Time_no-Time_length]+Deviceid_sha [Deviceid_
no-De viceid_length]+Roomid_ripemd[Roomid_no-Roomid_length);
Wherein, sign is the encryption interface of Md5 algorithm for indicating the first validation value, Md5.Create ().It i.e. will be above-mentioned
Numerical value be spliced together, the result for then calculating Md5 value is the first validation value.
To sum up, in this step, the first validation value is to be calculated by certain algorithm, and each client is
Different, which can also change with the time, therefore hacker is that can not forge by way of packet capturing
The value of first validation value out improves the difficulty that hacker obtains barrage content.
102, client sends http connection request to live streaming Platform Server;
Client sends http connection request after the first validation value is calculated, to live streaming Platform Server, wherein
Http connection request for request and be broadcast live Platform Server creation http connection, http connection request including the first validation value,
The room number of the present system time of client, equipment identification information and direct broadcasting room.In order to ensure transmission data content it is hidden
Cover and safety, in the embodiment of the present application, data can be packaged by client encrypt together after be sent to live streaming Platform Server, from
And what data content of client transmissions can not then be learnt by third party's packet catcher.It is implemented as follows:
Encryptdata=Rc4.encrypt (current_time+Deviceid+Roomid+sign, key);
Base64_data=Base64.encrypt (Encryptdata);
Wherein, Rc4.encrypt () is the encryption interface of stream cipher algorithm (rivest cipher, RC) 4,
Base64.encrypt () is the encryption interface of coded format Base64 algorithm, and current_time is the current system of client
It unites the time, Deviceid is equipment identification information, and Roomid is the room number of direct broadcasting room, and sign is the first validation value, and key is visitor
The shared key at family end and live streaming Platform Server.Therefore, in the embodiment of the present application, the data content of transmission is successively carried out
Rc4 and Base64 are encrypted twice, improve the safety of network transmission.Therefore, script client is sent to live streaming platform service
The data of device are room number Roomid and equipment identification information deviceId, and in the embodiment of the present application, it is flat that client issues live streaming
The data of platform server are Base64_data.
Based on the above process, hacker can not then know that client transmissions are assorted by packet capturing or other network analysis tools
Data, and data content by encryption after every time changes will occur, and client the first validation value calculate very
Complexity, hacker is very difficult to be cracked, and can keep out hacker's reptile instruments much more very to crawl the barrage content of live streaming platform.
103, live streaming Platform Server verifies the information in http connection request;
After live streaming Platform Server receives the http connection request of client transmission, then can be asked first to http connection
Data in asking are decrypted to obtain initial data, then verify to initial data.Specifically,
Then judge whether the sign value of data is correct, room information related data will not be issued if incorrect, together
When again checking request data it is whether legal, if room number whether there is, whether the unique deviceid of equipment legal, only all numbers
Room information can be just issued according to all legal, otherwise refusal request.The mode specifically verified includes:
Platform Server is broadcast live, base64 decryption, function are carried out to the Base64_data in the http connection request received
It is expressed as follows:
Encryptdata=Base64.decrypt (Base64_data);
Wherein Base64.decrypt is then the decryption interface of base64.We obtain after the completion of decryption
Encryptdata data, wherein contain by the encrypted first validation value sign of Rc4 Encryption Algorithm, room number Roomid,
Equipment identification information Deviceid and present system time current_time, therefore Rc4 decryption is carried out again, specific function is realized
It is as follows:
Rc4.decrypt (Encryptdata, key)=current_time+Deviceid+Roomid+sign;
Wherein Rc4.decrypt is then the decryption interface of Rc4, decrypts used key key and client is shared.Therefore
Initial data has been obtained after the completion of Rc4 decryption, comprising: the first validation value sign, room number Roomid, equipment identification information
Deviceid and present system time current_time.
After obtaining initial data, live streaming Platform Server first verifies that whether Roomid is legal room number, if
Do not conform to rule directly to refuse, then verifies whether Deviceid is legal equipment identification information again.Client is finally verified again
Present system time.Since the time of client and live streaming Platform Server may be not necessarily completely the same, so only visitor
It is legal that the time phase difference of family end and live streaming Platform Server is regarded as within a preset time, such as the preset time can be
1 minute or 5 minutes etc., be otherwise then illegal time data.Therefore, as long as these data have a verifying not conform to rule all
Directly refuse http connection request.If these data are all legal, whether live streaming Platform Server verifies the first validation value again correct,
Specifically, live streaming Platform Server calculates the first reference value, and the mode of the first reference value of calculating and client calculate first and test
The mode of card value is the same, therefore the result calculated should also be the same, therefore Platform Server is broadcast live can be by comparing the first ginseng
Examine whether value and the first validation value equally judge whether the first validation value is legal.
The mode that specific live streaming Platform Server calculates the first reference value is as follows:
Serversign=Md5.Create (time_md4 [Time_no-Time_length]+Deviceid_sha
[Deviceid_no-Deviceid_length]+Roomid_ripemd[Roomid_no-Roomid_length);
Wherein, serversign indicates the first reference value, and time_md4 is indicated after encrypting present system time in step 101
As a result, Deviceid_sha indicate step 101 in encrypt equipment identification information after as a result, Roomid_ripemd indicate step
In rapid 101 encrypt room number after as a result, the bit digital second from the bottom of Time_no=current_time numerical value, Time_
The bit digital last of length=current_time numerical value, the first digit of Deviceid_no=Deviceid numerical value
Word or letter;The bit digital second from the bottom or letter of Deviceid_length=Deviceid numerical value, Roomid_no=
The third bit digital or letter of Roomid numerical value;The fourth from the last bit digital of Roomid_length=Deviceid numerical value or
Person's letter.Live streaming Platform Server the first reference value is calculated after, be compared with the first validation value, if the two unanimously if close
Method passes through verifying;Otherwise illegal.
If 104, being verified, live streaming Platform Server sends http connection response to client;
If the information being broadcast live in Platform Server verifying http connection request is legal, http connection can be sent to client
Response, the http connection response are used to indicate http connection and create successfully.And the http connection response includes room information and straight
Broadcast the random key http_secret that Platform Server generates at random, wherein room information includes that the gateway service of platform is broadcast live
Device IP list so that client by gateway server IP list and live streaming Platform Server and subsequent gateway server into
The series connection of row relationship, improves the difficulty cracked.In addition, the random key http_secret for being issued to client every time can be again
It generates, ensures that key can only once effectively, subsequent client will use the random key http_ when connecting gateway server
Secret, and Platform Server is broadcast live will record key http_secret and inquired to gateway server.
105, client sends tcp connection request to gateway server;
Client is arranged by the http connection response of live streaming Platform Server feedback to obtain gateway server IP therein
Table and random key http_secret, to be connect with gateway server.In the prior art, client and gateway server are even
The information for needing to carry client during connecing, the version number including client, the room number of client connection, client
Account information, the unique deviceid of the equipment of client, specific function representation are as follows:
Type@=loginreq/name@=visitor/roomid@=35/deviceid@=
addbbc234599800bbcdddd;
Wherein, type@=loginreq indicates that the type of the message is logging request, and name@=visitor indicates user
Identification information, roomid=35 indicate that room number, deviceid=addbbc234599800bbcdddd indicate that equipment indicates
The meaning of information, the information of these length connections, each field and field is easier to obtain by packet capturing or conversed analysis
It gets, so hacker is relatively easy to the available barrage content to live streaming platform.Therefore, in the embodiment of the present application, meeting
Increase the authenticity verification that client is connect in the connection procedure with gateway server, to ensure all TCP connections all
It is legal.It is implemented as follows:
Client obtains present system time current_time by calling interface Time (), and specific function representation can be
Current_time=Time (), the calculating of the second validation value is participated in using the present system time as parameter, and guarantee logs in
The verifying of message is all changing all the time;
Client encrypts present system time by calling interface sha1-256.Create () to export time_sha1, letter
Number is expressed as time_sha1=sha1-256.Create (current_time);
Client encrypts equipment identification information by calling interface md4.Create () to export Deviceid_md4, function
It is expressed as Deviceid_md4=md4.Create (deviceid);
After obtaining time_sha1 and Deviceid_md4, client calculates the second validation value in the following manner:
Tcp_sign=Md5.Create (time_sha1+Deviceid_md4+http_secret);
Wherein, Tcp_sign indicates that the second validation value, Md5.Create () are the encryption interface of MD5 algorithm, http_
Secret is after live streaming Platform Server http connectivity verification passes through, to be handed down to the random key of client.
Client is after being calculated the second validation value, according to the IP address in gateway server IP list to gateway service
Device sends tcp connection request, and wherein tcp connection request is connect for requesting with gateway server creation tcp, and tcp connection is asked
The content asked increased the second validation value more originally, and specific function is accomplished by
Type@=loginreq/name@=visitor/roomid@=35/deviceid@=
Addbbc234599800bbcdddd/sign@=Tcp_sign/;
To sum up, in the embodiment of the present application, time_sha1 and Deviceid_md4 and http_secret are spliced together
The second validation value Tcp_sign is calculated, guarantees that the second validation value of each client is different, and second validation value
Also it can change with the time, therefore hacker is the value that pseudo- can not produce the second validation value by way of packet capturing.Client
Second validation value is carried in tcp connection request and is sent to gateway server to verify by end, improve client with
The safety of gateway server connection and hacker obtain the difficulty of barrage content.
106, gateway server verifies the information in tcp connection request;
If 107, being verified, gateway server sends tcp connection response to client;
After gateway server receives the tcp connection request of client, the logging request agreement is parsed, agreement is therefrom parsed
Each field.So gateway server can verify the legitimacy of parameters in tcp connection request, including user's name first
Name, room number roomid, equipment identification information deviceid, if these data are all legal, gateway server verifies second again
Whether validation value is correct, and specifically, gateway server calculates the second reference value, and calculates the mode and client of the second reference value
The mode for calculating the second validation value is the same, therefore the result calculated should also be the same, therefore gateway server can pass through comparison
Whether the second reference value and the second validation value equally judge whether the second validation value is legal.
The mode that specific gateway server calculates the second reference value is as follows:
The present system time current_time and equipment of client are taken out from the tcp connection request that client reports
Identification information deviceid, and HASH is carried out to the present system time of client and equipment identification information respectively and is encrypted
It is close as a result, specific function is accomplished by
Time_sha2=sha1-256.Create (current_time);
Deviceid_md4=md4.Create (deviceid);
After obtaining encrypted result i.e. time_sha2 and Deviceid_md4, the second reference value is calculated as follows:
Sign2=Md5.Create (time_sha+Deviceid_md4+http_secret);
Wherein, sign2 indicates the second reference value.After obtaining the second reference value, gateway server then compares the second reference value
Whether sign2 and the second validation value Tcp_sign are consistent, refuse client login if inconsistent.
If consistent, indicate that the information in gateway server verifying tcp connection request passes through, then gateway server can reply
Client tcp connection response is to indicate to login successfully, and the tcp connection response includes a random key tcp_key and barrage
Server ip list, so that client connects barrage server according to barrage server list.
It should be noted that the data packet format of TCP is as schemed during client and the TCP connection of gateway server
Shown in 1b, in general, hacker can only pay close attention to network data when grabbing network packet, the packet header number without paying close attention to network data
According to because each field of header data be all have concrete meaning, and the concrete meaning of field and content all with protocol contents all
Data content that is unrelated, must more only filling out, therefore hacker will not remove the data content in concern packet header.Therefore, client
The reserved field in packet header can be modified, to realize the header data of live streaming platform client and the packet of non-live streaming platform client
The content of head data not always, therefore identifies which is non-live streaming platform client, and gateway server is directly felt
The connection request of these non-live streaming platform clients.Specific implementation is then one encryption data of filling in reserved field, and is led to
The reserved field content that normal client is sent all be it is fixed the same, entirely 0, and in the embodiment of the present application, platform is broadcast live
Client can insert a non-zero value, so as to distinguish with other no platform clients.For example, reserved field is usual
It is 000, the reserved field in the packet header that live streaming platform client is sent can be 001 perhaps 010 or 011 etc., as long as right and wrong
Full 0 data, therefore specific the application is without limitation.
108, client sends connection request to barrage server;
The tcp connection response that client is fed back by gateway server come obtain barrage server ip list therein and with
Secret key tcp_key, to be connect with barrage server.The third that following client needs to calculate login barrage server is tested
Card value, and the calculating of third validation value can be related to whether client finally can receive barrage message from barrage server,
Direct broadcasting room barrage can not be obtained if the third validation value of client can't pass, so that illegal client can not be computed correctly
Third validation value out, so that hacker can not crawl barrage content.The mode that specific client end calculates third validation value is as follows:
Client obtains present system time current_time by calling interface Time (), and specific function representation can be
Current_time=Time () participates in the calculating of third validation value using the present system time as parameter, ensures third
Validation value is all changing all the time;
Client encrypts present system time by calling interface sha1-256.Create () to export time_sha2, letter
Number is expressed as time_sha2=sha1-256.Create (current_time);
After obtaining time_sha2, client calculates third validation value in the following manner:
Tcp_sign1=Md5.Create (time_sha2+tcp_key);
Wherein, Tcp_sign1 indicates that third validation value, tcp_key indicate that logging in gateway server passes through rear gateway service
The random key that device issues.
Client is after being calculated third validation value, according to the IP address in barrage server ip list to barrage service
Device sends connection request, and wherein connection request is connected for requesting with the creation of barrage server, and the content of connection request includes
The current time in system of third validation value and client.
109, barrage server verifies the information in connection request;
If 110, being verified, barrage server sends the corresponding barrage of direct broadcasting room to client.
After barrage server receives the connection request of client, the connection request is parsed, therefrom parses the connection request
Each field.So barrage server can verify the legitimacy of parameters in connection request, including verifying client first
Present system time it is legal, whether then to verify third validation value correct, and specifically, barrage server calculates third reference value,
And mode and the client for calculating third reference value calculate as the mode of third validation value, therefore the result of calculating should also be
The same, therefore whether barrage server can equally judge that third validation value is with third validation value by comparing third reference value
It is no legal.
The mode that specific barrage server calculates third reference value is as follows:
The present system time current_time of client is taken out from the connection request that client reports, and to client
The present system time at end carries out HASH and encrypts to obtain encrypted result, and specific function is accomplished by
Time_sha3=sha1-256.Create (current_time);
After obtaining encrypted result time_sha3, third reference value is calculated as follows
Sign3=Md5.Create (time_sha3+tcp_key);
Wherein, sign3 indicates third reference value.After obtaining third reference value, barrage server then compares third reference value
Whether sign3 and third validation value Tcp_sign1 are consistent, refuse client login if inconsistent.
If consistent, indicate that the information in barrage server authentication connection request passes through, then barrage server can reply visitor
Family end connection response sends the corresponding barrage of direct broadcasting room to client to indicate to login successfully.
It should be noted that joined the third validation value of verification in the connection procedure of client and barrage server, only
Verifying successfully can just connect barrage server.In the embodiment of the present application, other logics, example can also be added in client
Such as, since common hacker can only go to crack the connectivity verification logged in, and the present embodiment can after connecting upper barrage server,
Client can be sent one to barrage server in certain time interval and be disappeared with pre-buried more set agreement requests, such as client
Breath request, is considered correct client if barrage server receives the request, if barrage server does not receive this
Message request is it may be considered that be illegal client, barrage server can refuse it to the client of no hair request at this time
Connection;It can not also refuse its connection, and be to continue with and send barrage message to the client, but the barrage message sent is interference
The either false barrage of barrage, rather than the true barrage of direct broadcasting room makes it obtain information not so as to gain barrage crawler by cheating
Accurately.Be implemented as follows: the function representation of client to the request message that barrage server is sent is as follows:
@=1 type@=loginreq/name@=visitor/roomid@=35/other;
Wherein, type@=loginreq indicates that the type of the message is logging request, and name@=visitor indicates user
Identification information ,@=35 roomid are room number, and@=1 other is to increase an agreement field in log on request agreement, if objective
Family end carries this agreement field to barrage server, then is considered as the client that platform is broadcast live in legitimate client, subsequent to give
The client sends the corresponding barrage of the true direct broadcasting room;If client does not carry this agreement field, barrage server
It will not be judged as link failure, but marking the client is illegitimate client, so that subsequent send to the client
False barrage.It should be noted that specific field and content can then negotiate with HTTP request before, in http request response
Field and numerical value are carried, so that client can constantly update this agreement field not issuing new version, so that hidden
Effect is more preferable.
Optionally, client can send one to barrage server after connecting barrage server, in certain random time
The new agreement of item, wherein protocol fields and content can be embedded into client release, so that client can constantly change
This field and content, then server is then considered illegal client to the client for always not sending this agreement.For example,
Newly increasing agreement may is that@=1 type@=vx;It is also possible to@=2 type@=vx;Or@=1 type@=vm;Therefore it is specific
Increase agreement the application without limitation.Due to the continuous variation of agreement and field, so which right and wrong barrage server distinguishes
The effect that platform client is broadcast live can be more preferable, improves the safety of direct broadcasting room barrage content.
Optionally, barrage server can also be grouped according to user, and do some limitations according to the ip of client
And strategy.When client is connected to a direct broadcasting room, barrage server can be grouped the user of big direct broadcasting room, Mei Gefen
Group only can obtain direct broadcasting room part barrage, all barrage contents without obtaining direct broadcasting room, if that only one client
End, which is connected to direct broadcasting room then, can not get all barrages of direct broadcasting room.To which barrage crawler can not obtain entire direct broadcasting room
All barrage contents.If hacker crawls the same direct broadcasting room using multiple client, barrage server can also be according to connection
User ip, by the client of the ip in identical location point at same group, so that hacker be prevented to obtain all barrages of direct broadcasting room
Content.Therefore for barrage server by the way that direct broadcasting room barrage is distributed to each grouping, not having any one grouping in this way can
All barrage contents are crawled, so that the reptile instrument of hacker is difficult to crawl all barrage contents of direct broadcasting room.
In the embodiment of the present application, when client and live streaming Platform Server carry out http connection, verification process joined,
Gateway server IP list and random key, therefore only live streaming platform can just be issued by being only verified live streaming Platform Server
APP successful connection and then barrage content could be got, protect the barrage privacy and barrage resource of live streaming platform, improve
The difficulty that barrage is crawled.
The embodiment of the present application is described from the angle for the method for obtaining barrage above, below from live streaming platform service
The embodiment of the present application is described in the angle of device and client.
Fig. 2 a is please referred to, Fig. 2 a is a kind of embodiment schematic diagram of possible client provided by the embodiments of the present application,
In, which specifically includes:
Computing unit 201, for calculating first according to the room number of present system time, equipment identification information and direct broadcasting room
Validation value;
Transmit-Receive Unit 202, for sending http connection request to live streaming Platform Server, the http connection request is used for
Request creates http with the live streaming Platform Server and connect, and the http connection request includes first validation value, described
The room number of present system time, the equipment identification information and the direct broadcasting room;
The Transmit-Receive Unit 202 is also used to verify the letter in the http connection request when the live streaming Platform Server
When ceasing legal, the http connection response that the live streaming Platform Server is sent is received, the http connection response includes gateway clothes
The key http_secret that the IP list of business device and the live streaming Platform Server generate at random;
Unit 203 is established, is used for according to the gateway server IP list and the key http_secret, with gateway
Server establishes TCP connection, and receives the tcp connection response that the gateway server is sent, and the tcp connection response includes bullet
The key tcp_key that the IP list of curtain server and the gateway server generate at random;It is arranged according to the barrage server ip
Table connects the barrage server with the key tcp_key, and receives the direct broadcasting room pair that the barrage server is sent
The barrage answered.
Fig. 2 b is please referred to, Fig. 2 b is that the implementation of the possible live streaming Platform Server of one kind provided by the embodiments of the present application illustrates
It is intended to, wherein the live streaming Platform Server specifically includes:
Transmit-Receive Unit 210, for receiving the http connection request of client transmission, the http connection request is for requesting
With the live streaming Platform Server creation http connect, the http connection request include the first validation value, client it is current
The room number of system time, equipment identification information and direct broadcasting room;
Judging unit 220, whether the room for judging the equipment identification information and the direct broadcasting room is legal, and judges
Whether the difference of the current time of the client and the current time of the live streaming Platform Server is less than default value;
Computing unit 230, if the legal and described difference for the room of the equipment identification information and the direct broadcasting room
Less than the default value, then according to the present system time of the client, the equipment identification information and the direct broadcasting room
Room number calculate the first reference value;
The Transmit-Receive Unit 210, it is random to generate if it is equal with first validation value to be also used to first reference value
Key http_secret, and http connection response is sent to the client, the http connection response includes the key
The IP list of http_secret and gateway server, so that the client is according to http connection response acquisition
The barrage of direct broadcasting room.
Fig. 3 a is please referred to, Fig. 3 a is the embodiment schematic diagram of electronic equipment provided by the embodiments of the present application.
As shown in Figure 3a, the embodiment of the present application provides a kind of electronic equipment, including memory 310, processor 320 and deposits
The computer program 311 that can be run on memory 320 and on the processor 320 is stored up, processor 320 executes computer program
Client is performed the steps of when 311 calculates first according to the room number of present system time, equipment identification information and direct broadcasting room
Validation value;The client to live streaming Platform Server send http connection request, the http connection request for request with
The live streaming Platform Server creates http connection, and the http connection request includes first validation value, the current system
Unite the time, the equipment identification information and the direct broadcasting room room number;When the live streaming Platform Server verifies the http
When information in connection request is legal, the client receives the http connection response that the live streaming Platform Server is sent, institute
State the IP list that http connection response includes gateway server and the key http_ that the live streaming Platform Server generates at random
secret;The client is built according to the gateway server IP list and the key http_secret with gateway server
Vertical TCP connection, and the tcp connection response that the gateway server is sent is received, the tcp connection response includes barrage server
IP list and the key tcp_key that generates at random of the gateway server;The client is according to the barrage server ip
List connects the barrage server with the key tcp_key, and receives the direct broadcasting room that the barrage server is sent
Corresponding barrage.
As shown in Figure 3b, the embodiment of the present application provides a kind of electronic equipment, including memory 330, processor 340 and deposits
The computer program 331 that can be run on memory 340 and on processor 340 is stored up, processor 340 executes computer program
Live streaming Platform Server is performed the steps of when 331 receives the http connection request that client is sent, the http connection request
For requesting to connect with live streaming Platform Server creation http, the http connection request includes the first validation value, client
The room number of the present system time at end, equipment identification information and direct broadcasting room;The live streaming Platform Server judges the equipment
Whether the room of identification information and the direct broadcasting room is legal, and judges that the current time of the client and the live streaming platform take
Whether the difference of the current time of business device is less than default value;If the room of the equipment identification information and the direct broadcasting room closes
Method and the difference are less than the default value, then when the live streaming Platform Server is according to the current system of the client
Between, the room number of the equipment identification information and the direct broadcasting room calculate the first reference value;If first reference value with it is described
First validation value is equal, then the live streaming Platform Server generates key http_secret at random, and sends to the client
Http connection response, the http connection response include the IP list of the key http_secret and gateway server, so that
Obtain the barrage that the client obtains the direct broadcasting room according to the http connection response.
The electronic equipment introduced by the present embodiment for implement in the embodiment of the present application a kind of live streaming Platform Server or
Equipment used by person's client, so based on method described in the embodiment of the present application, those skilled in the art's energy
The specific embodiment and its various change form of the electronic equipment of solution the present embodiment much of that, so being set herein for the electronics
It is standby how to realize that the method in the embodiment of the present application is no longer discussed in detail, as long as those skilled in the art implement the application reality
Equipment used by the method in example is applied, the range to be protected of the application is belonged to.
Fig. 4 a is please referred to, Fig. 4 a is a kind of embodiment signal of computer readable storage medium provided by the embodiments of the present application
Figure.
As shown in fig. 4 a, a kind of computer readable storage medium 400 is present embodiments provided, computer journey is stored thereon with
Sequence 411, the computer program 411 realize following steps when being executed by processor: client is according to present system time, equipment mark
The room number for knowing information and direct broadcasting room calculates the first validation value;The client sends http connection to live streaming Platform Server and asks
It asks, the http connection request is connect for requesting with live streaming Platform Server creation http, the http connection request
Including first validation value, the present system time, the equipment identification information and the direct broadcasting room room number;Work as institute
State live streaming Platform Server verify information in the http connection request it is legal when, the client receives the live streaming platform
Server send http connection response, the http connection response include gateway server IP list and the live streaming platform
The key http_secret that server generates at random;The client is according to the gateway server IP list and the key
Http_secret establishes TCP connection with gateway server, and receives the tcp connection response that the gateway server is sent, institute
State the IP list that tcp connection response includes barrage server and the key tcp_key that the gateway server generates at random;It is described
Client connects the barrage server with the key tcp_key according to the barrage server ip list, and described in reception
The corresponding barrage of the direct broadcasting room that barrage server is sent.
Fig. 4 b is please referred to, Fig. 4 b is a kind of embodiment signal of computer readable storage medium provided by the embodiments of the present application
Figure.
As shown in Figure 4 b, a kind of computer readable storage medium 420 is present embodiments provided, computer journey is stored thereon with
Sequence 431, the computer program 431 realize following steps when being executed by processor: live streaming Platform Server receives client and sends
Http connection request, the http connection request for request with the live streaming Platform Server create http connect, it is described
Http connection request includes the room number of the first validation value, the present system time of client, equipment identification information and direct broadcasting room;
The live streaming Platform Server judges whether the room of the equipment identification information and the direct broadcasting room is legal, and judges the visitor
Whether the difference of the current time at family end and the current time of the live streaming Platform Server is less than default value;If the equipment
The room of identification information and the direct broadcasting room is legal and the difference is less than the default value, then the live streaming platform service
Device calculates the first ginseng according to the room number of the present system time of the client, the equipment identification information and the direct broadcasting room
Examine value;If first reference value is equal with first validation value, the live streaming Platform Server generates key at random
Http_secret, and http connection response is sent to the client, the http connection response includes the key http_
The IP list of secret and gateway server, so that the client obtains the direct broadcasting room according to the http connection response
Barrage.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that each process in flowchart and/or the block diagram can be realized by computer program instructions
And/or the combination of the process and/or box in box and flowchart and/or the block diagram.It can provide these computer programs to refer to
Enable the processor of general purpose computer, special purpose computer, embedded computer or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Concept, then additional changes and modifications may be made to these embodiments.So it includes preferred that the following claims are intended to be interpreted as
Embodiment and all change and modification for falling into the application range.
Obviously, those skilled in the art can carry out various modification and variations without departing from the essence of the application to the application
Mind and range.In this way, if these modifications and variations of the application belong to the range of the claim of this application and its equivalent technologies
Within, then the application is also intended to including these modification and variations.
Claims (10)
1. a kind of method for obtaining barrage characterized by comprising
Client calculates the first validation value according to the room number of present system time, equipment identification information and direct broadcasting room;
The client to live streaming Platform Server send http connection request, the http connection request for request with it is described
Platform Server is broadcast live and creates http connection, when the http connection request includes first validation value, the current system
Between, the room number of the equipment identification information and the direct broadcasting room;
When the live streaming Platform Server verify the information in the http connection request it is legal when, described in the client receives
It is broadcast live the http connection response that Platform Server is sent, the http connection response includes gateway server IP list and described straight
Broadcast the key http_secret that Platform Server generates at random;
The client is established according to the gateway server IP list and the key http_secret with gateway server
TCP connection, and the tcp connection response that the gateway server is sent is received, the tcp connection response includes barrage server
The key tcp_key that IP list and the gateway server generate at random;
The client connects the barrage server with the key tcp_key according to the barrage server ip list, and
Receive the corresponding barrage of the direct broadcasting room that the barrage server is sent.
2. the method according to claim 1, wherein the client is according to present system time, device identification
The room number of information and direct broadcasting room calculates the first validation value
The client obtains present system time by calling interface Time ();
The client encrypts the present system time by calling interface Md4.Create () to export time_md4, passes through
Calling interface sha1-256.Create () encrypts the equipment identification information to export Deviceid_sha, passes through calling interface
RIPEMD-256.Create () encrypts the room number to export Roomid_ripemd, wherein the interface Md4.Create
() is the encryption interface of informative abstract MD4 algorithm, and the interface sha1-256.Create () is adding for secure hash sha algorithm
Touch mouth, the interface RIPEMD-256.Create () is the encryption interface of RIPEMD algorithm;
The client calculates first validation value according to following manner:
Sign=Md5.Create (time_md4 [Time_no-Time_length]+Deviceid_sha [Deviceid_no-
Deviceid_length]+Roomid_ripemd[Roomid_no-Roomid_length);
Wherein, the sign is for indicating first validation value, and the Time_no is reciprocal the of the present system time
One parameter, the Time_length are the penultimate parameter of the present system time, and the Deviceid_no is
First parameter of the equipment identification information, the Deviceid_length are the second from the bottom of the equipment identification information
A parameter, the Roomid_no are the third parameter of the room number, and the Roomid_length is the room number
Fourth from the last parameter, the Md5.Create () are the encryption interface of the MD5 algorithm.
3. connecting the method according to claim 1, wherein the client sends http to live streaming Platform Server
Connecing request includes:
The client is by following Encryption Algorithm to first validation value, the present system time, the device identification
The room number of information and the direct broadcasting room is encrypted:
Encryptdata=Rc4.encrypt (current_time+Deviceid+Roomid+sign, key);
Base64_data=Base64.encrypt (Encryptdata);
The Rc4.encrypt () is the encryption interface of stream cipher algorithm RC4, and the Base64.encrypt () is coding lattice
The encryption interface of formula Base64 algorithm, the current_time are the present system time, and the Deviceid is described
Equipment identification information, the Roomid are the room number of the direct broadcasting room, and the sign is first validation value, the key
For the shared key of the client and the live streaming Platform Server;
The http connection request for carrying the Base64_data is sent to the live streaming platform service by the client
Device.
4. the method according to claim 1, wherein the client according to the gateway server IP list and
The key http_secret, establishing TCP connection with gateway server includes:
The client obtains present system time by calling interface Time ();
The client encrypts the present system time by calling interface sha1-256.Create () to export time_
Sha1 encrypts the equipment identification information by calling interface md4.Create () to export Deviceid_md4;
The client calculates the second validation value in the following manner:
Tcp_sign=Md5.Create (time_sha1+Deviceid_md4+http_secret);
Wherein, the Tcp_sign indicates second validation value, and the Md5.Create () is the encryption interface of MD5 algorithm;
Gateway server of the client into the gateway server IP list sends tcp connection request, the TCP connection
Request includes second validation value, the room number and the equipment identification information;
When the gateway server verify the information in the tcp connection request it is legal when, the client and gateway server
Establish the TCP connection.
5. according to the method described in claim 4, it is characterized in that, the client is into the gateway server IP list
Before gateway server sends tcp connection request, the method also includes:
The specific field of the header data of the tcp connection request is revised as non-zero value by the client, wherein when the finger
Determine field be non-zero value when, be used to indicate the client be legitimate client;When the specific field is full 0 value, for referring to
Show that the client is illegitimate client.
6. the method according to claim 1, wherein the client according to the barrage server ip list and
The key tcp_key connection barrage server includes:
The client adds agreement field in a connection request, and it is legal visitor that the agreement field, which is used to indicate the client,
Family end;
The connection request is sent in the barrage server ip list by the client according to the key tcp_key
Barrage server receives the corresponding barrage of the true direct broadcasting room to connect the barrage server.
7. a kind of method for obtaining barrage characterized by comprising
Be broadcast live Platform Server receive client send http connection request, the http connection request for request with it is described
Be broadcast live Platform Server create http connection, the http connection request include the first validation value, client current system when
Between, the room number of equipment identification information and direct broadcasting room;
The live streaming Platform Server judges whether the room of the equipment identification information and the direct broadcasting room is legal, and judges institute
Whether the difference for stating the current time of client and the current time of the live streaming Platform Server is less than default value;
If the room of the equipment identification information and the direct broadcasting room is legal and the difference is less than the default value, institute
Live streaming Platform Server is stated according to the present system time of the client, the room of the equipment identification information and the direct broadcasting room
Between number calculate the first reference value;
If first reference value is equal with first validation value, the live streaming Platform Server generates key at random
Http_secret, and http connection response is sent to the client, the http connection response includes the key http_
The IP list of secret and gateway server, so that the client obtains the direct broadcasting room according to the http connection response
Barrage.
8. a kind of client characterized by comprising
Computing unit, for calculating the first validation value according to the room number of present system time, equipment identification information and direct broadcasting room;
Transmit-Receive Unit, for live streaming Platform Server send http connection request, the http connection request for request with
The live streaming Platform Server creates http connection, and the http connection request includes first validation value, the current system
Unite the time, the equipment identification information and the direct broadcasting room room number;
The Transmit-Receive Unit, the information for being also used to verify in the http connection request when the live streaming Platform Server are legal
When, the http connection response that the live streaming Platform Server is sent is received, the http connection response includes gateway server
The key http_secret that IP list and the live streaming Platform Server generate at random;
Unit is established, for being built with gateway server according to the gateway server IP list and the key http_secret
Vertical TCP connection, and the tcp connection response that the gateway server is sent is received, the tcp connection response includes barrage server
IP list and the key tcp_key that generates at random of the gateway server;According to the barrage server ip list and described
The key tcp_key connection barrage server, and receive the corresponding barrage of the direct broadcasting room that the barrage server is sent.
9. a kind of computer readable storage medium, including instruction, when run on a computer, so that computer is executed as weighed
Benefit requires method described in 1-7 any one.
10. a kind of computer program product comprising instruction, when run on a computer, so that computer executes such as right
It is required that method described in 1-7 any one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910431255.6A CN110139163B (en) | 2019-05-22 | 2019-05-22 | Method and related device for acquiring bullet screen |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910431255.6A CN110139163B (en) | 2019-05-22 | 2019-05-22 | Method and related device for acquiring bullet screen |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110139163A true CN110139163A (en) | 2019-08-16 |
CN110139163B CN110139163B (en) | 2021-06-22 |
Family
ID=67572519
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910431255.6A Active CN110139163B (en) | 2019-05-22 | 2019-05-22 | Method and related device for acquiring bullet screen |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110139163B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112651045A (en) * | 2020-12-30 | 2021-04-13 | 北京奇艺世纪科技有限公司 | Bullet screen data processing method and device and storage medium |
CN114520923A (en) * | 2020-11-20 | 2022-05-20 | 武汉斗鱼网络科技有限公司 | Barrage information display method, first terminal, second terminal, medium and equipment |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20160011613A (en) * | 2014-06-26 | 2016-02-01 | 시아오미 아이엔씨. | Method and device for information acquisition |
US20170264585A1 (en) * | 2016-02-26 | 2017-09-14 | Shanghai Hode Information Technology Co.,Ltd. | Method and apparatus for displaying comment information |
CN108156508A (en) * | 2017-12-28 | 2018-06-12 | 北京安云世纪科技有限公司 | Method, apparatus, mobile terminal, server and the system of barrage information processing |
US20180191987A1 (en) * | 2017-01-04 | 2018-07-05 | International Business Machines Corporation | Barrage message processing |
CN108366277A (en) * | 2018-03-30 | 2018-08-03 | 武汉斗鱼网络科技有限公司 | A kind of barrage server connection method, client and readable storage medium storing program for executing |
CN109379638A (en) * | 2018-09-13 | 2019-02-22 | 武汉斗鱼网络科技有限公司 | A kind of method and mobile terminal linking barrage |
CN109743586A (en) * | 2018-12-28 | 2019-05-10 | 广州华多网络科技有限公司 | Live streaming media anti-stealing link method and system |
CN109739892A (en) * | 2018-12-27 | 2019-05-10 | 王梅 | The method and system of grading extension are carried out to the data acquisition request in internet |
-
2019
- 2019-05-22 CN CN201910431255.6A patent/CN110139163B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20160011613A (en) * | 2014-06-26 | 2016-02-01 | 시아오미 아이엔씨. | Method and device for information acquisition |
US20170264585A1 (en) * | 2016-02-26 | 2017-09-14 | Shanghai Hode Information Technology Co.,Ltd. | Method and apparatus for displaying comment information |
US20180191987A1 (en) * | 2017-01-04 | 2018-07-05 | International Business Machines Corporation | Barrage message processing |
CN108156508A (en) * | 2017-12-28 | 2018-06-12 | 北京安云世纪科技有限公司 | Method, apparatus, mobile terminal, server and the system of barrage information processing |
CN108366277A (en) * | 2018-03-30 | 2018-08-03 | 武汉斗鱼网络科技有限公司 | A kind of barrage server connection method, client and readable storage medium storing program for executing |
CN109379638A (en) * | 2018-09-13 | 2019-02-22 | 武汉斗鱼网络科技有限公司 | A kind of method and mobile terminal linking barrage |
CN109739892A (en) * | 2018-12-27 | 2019-05-10 | 王梅 | The method and system of grading extension are carried out to the data acquisition request in internet |
CN109743586A (en) * | 2018-12-28 | 2019-05-10 | 广州华多网络科技有限公司 | Live streaming media anti-stealing link method and system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114520923A (en) * | 2020-11-20 | 2022-05-20 | 武汉斗鱼网络科技有限公司 | Barrage information display method, first terminal, second terminal, medium and equipment |
CN114520923B (en) * | 2020-11-20 | 2023-09-01 | 武汉斗鱼网络科技有限公司 | Barrage information display method, first terminal, second terminal, medium and equipment |
CN112651045A (en) * | 2020-12-30 | 2021-04-13 | 北京奇艺世纪科技有限公司 | Bullet screen data processing method and device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110139163B (en) | 2021-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109309565B (en) | Security authentication method and device | |
CN114900338B (en) | Encryption and decryption method, device, equipment and medium | |
US9852300B2 (en) | Secure audit logging | |
US11240269B2 (en) | Method and apparatus for decryption of encrypted SSL data from packet traces | |
CN103581173B (en) | Safe data transmission method, system and device based on industrial Ethernet | |
CN104243419B (en) | Data processing method, apparatus and system based on safety shell protocol | |
US8949935B2 (en) | Secure account creation | |
CN106790183A (en) | Logging on authentication method of calibration, device | |
CN107800675A (en) | A kind of data transmission method, terminal and server | |
CN111130799B (en) | Method and system for HTTPS protocol transmission based on TEE | |
CN111030814A (en) | Key negotiation method and device | |
CN110011950B (en) | Authentication method and device for video stream address | |
CN110213195B (en) | Login authentication method, server and user terminal | |
CN108600222A (en) | The communication means of client application and trusted application, system and terminal | |
CN109361508A (en) | Data transmission method, electronic equipment and computer readable storage medium | |
CN110768973A (en) | Signaling safety evaluation system and method based on GB35114 standard | |
CN108449756A (en) | A kind of system of network cryptographic key updating, method and device | |
CN109040079A (en) | The establishment of live streaming chained address and verification method and related device | |
CN108322416A (en) | A kind of safety certification implementation method, apparatus and system | |
CN110493162A (en) | Identity identifying method and system based on wearable device | |
CN110300287A (en) | A kind of public safety video monitoring networking camera access authentication method | |
CN111756528A (en) | Quantum session key distribution method and device and communication architecture | |
CN114338201B (en) | Data processing method and device, electronic equipment and storage medium | |
CN116743470A (en) | Service data encryption processing method and device | |
CN110139163A (en) | A kind of method and relevant apparatus obtaining barrage |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |